mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-31 08:56:34 +00:00
Wrap more classes into ifcopenshell:: namespace
This commit is contained in:
@@ -52,7 +52,7 @@ std::string schema_name(const express::base& instance) {
|
||||
// A primitive scalar attribute value formatted for display, or std::nullopt for
|
||||
// IFC null and for non-primitive values (entity references, aggregates/lists,
|
||||
// binary) — which the properties UI omits.
|
||||
std::optional<std::string> format_scalar(const attribute_value& value) {
|
||||
std::optional<std::string> format_scalar(const ifcopenshell::attribute_value& value) {
|
||||
if (value.isNull()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ std::optional<std::string> format_scalar(const attribute_value& value) {
|
||||
case ifcopenshell::Argument_STRING:
|
||||
return static_cast<std::string>(value);
|
||||
case ifcopenshell::Argument_ENUMERATION: {
|
||||
const enumeration_reference enumeration = value;
|
||||
const ifcopenshell::enumeration_reference enumeration = value;
|
||||
return enumeration.value() ? std::string(enumeration.value()) : std::string();
|
||||
}
|
||||
case ifcopenshell::Argument_INT:
|
||||
@@ -288,13 +288,13 @@ std::optional<std::string> get_string_attribute(const express::base& element,
|
||||
if (index < 0) {
|
||||
return std::nullopt;
|
||||
}
|
||||
const attribute_value value = element.get_attribute_value(static_cast<std::size_t>(index));
|
||||
const ifcopenshell::attribute_value value = element.get_attribute_value(static_cast<std::size_t>(index));
|
||||
if (value.isNull()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
switch (value.type()) {
|
||||
case ifcopenshell::Argument_ENUMERATION: {
|
||||
const enumeration_reference enumeration = value;
|
||||
const ifcopenshell::enumeration_reference enumeration = value;
|
||||
return enumeration.value() ? std::string(enumeration.value()) : std::string();
|
||||
}
|
||||
case ifcopenshell::Argument_STRING:
|
||||
|
||||
@@ -144,7 +144,7 @@ double get_storey_elevation_s(const express::base& storey) {
|
||||
if (declaration != nullptr) {
|
||||
const std::ptrdiff_t index = declaration->attribute_index("Elevation");
|
||||
if (index >= 0) {
|
||||
const attribute_value value = storey.get_attribute_value(static_cast<std::size_t>(index));
|
||||
const ifcopenshell::attribute_value value = storey.get_attribute_value(static_cast<std::size_t>(index));
|
||||
if (!value.isNull() && value.type() == ifcopenshell::Argument_DOUBLE) {
|
||||
return static_cast<double>(value);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ std::string schema_name(const express::base& instance) {
|
||||
throw ifcopenshell::exception("No helper implementation was built for schema " + name);
|
||||
}
|
||||
|
||||
property_value from_attribute(const attribute_value& value);
|
||||
property_value from_attribute(const ifcopenshell::attribute_value& value);
|
||||
|
||||
template <typename T>
|
||||
property_list scalar_list(const std::vector<T>& values) {
|
||||
@@ -81,7 +81,7 @@ property_list scalar_list(const std::vector<T>& values) {
|
||||
return result;
|
||||
}
|
||||
|
||||
property_value from_attribute(const attribute_value& value) {
|
||||
property_value from_attribute(const ifcopenshell::attribute_value& value) {
|
||||
if (value.isNull()) {
|
||||
return {};
|
||||
}
|
||||
@@ -103,7 +103,7 @@ property_value from_attribute(const attribute_value& value) {
|
||||
case ifcopenshell::Argument_STRING:
|
||||
return static_cast<std::string>(value);
|
||||
case ifcopenshell::Argument_ENUMERATION: {
|
||||
const enumeration_reference enumeration = value;
|
||||
const ifcopenshell::enumeration_reference enumeration = value;
|
||||
return enumeration.value() ? enumeration.value() : "";
|
||||
}
|
||||
case ifcopenshell::Argument_BINARY: {
|
||||
|
||||
Reference in New Issue
Block a user