Support styles without shading styles after 189bcd5

Noticed that after 189bcd5 some representations were missing styles - the ones that are using IfcSurfaceStyle with just IfcExternallyDefinedSurfaceStyle.

Ping @aothms just in case
This commit is contained in:
Andrej730
2024-10-21 16:35:08 +05:00
parent 45b3008b99
commit e8eb3972a1
+3 -4
View File
@@ -430,9 +430,11 @@ namespace {
}
#endif
IfcSchema::IfcSurfaceStyle *surface_style_ = nullptr;
for (auto& style : prs_styles) {
if (auto surface_style = style->as<IfcSchema::IfcSurfaceStyle>()) {
if (surface_style->Side() != IfcSchema::IfcSurfaceSide::IfcSurfaceSide_NEGATIVE) {
surface_style_ = surface_style;
auto styles_elements = surface_style->Styles();
for (auto mt = styles_elements->begin(); mt != styles_elements->end(); ++mt) {
if ((*mt)->template as<T>()) {
@@ -442,7 +444,7 @@ namespace {
}
}
}
return std::make_pair(nullptr, nullptr);
return std::make_pair(surface_style_, nullptr);
}
bool process_colour(IfcSchema::IfcColourRgb* colour, double* rgb) {
@@ -556,9 +558,6 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSurfaceStyle* style) {
break;
}
}
if (shading == nullptr) {
return nullptr;
}
taxonomy::style::ptr surface_style = taxonomy::make<taxonomy::style>();
surface_style->instance = style;
if (settings_.get<settings::UseMaterialNames>().get() && style->Name()) {