Wrap more classes into ifcopenshell:: namespace

This commit is contained in:
Thomas Krijnen
2026-08-08 13:58:39 +02:00
parent 2c47c9d4fa
commit 02481b3247
149 changed files with 678 additions and 627 deletions
+4 -4
View File
@@ -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:
+1 -1
View File
@@ -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);
}
+3 -3
View File
@@ -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: {