mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
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:
@@ -430,9 +430,11 @@ namespace {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
IfcSchema::IfcSurfaceStyle *surface_style_ = nullptr;
|
||||||
for (auto& style : prs_styles) {
|
for (auto& style : prs_styles) {
|
||||||
if (auto surface_style = style->as<IfcSchema::IfcSurfaceStyle>()) {
|
if (auto surface_style = style->as<IfcSchema::IfcSurfaceStyle>()) {
|
||||||
if (surface_style->Side() != IfcSchema::IfcSurfaceSide::IfcSurfaceSide_NEGATIVE) {
|
if (surface_style->Side() != IfcSchema::IfcSurfaceSide::IfcSurfaceSide_NEGATIVE) {
|
||||||
|
surface_style_ = surface_style;
|
||||||
auto styles_elements = surface_style->Styles();
|
auto styles_elements = surface_style->Styles();
|
||||||
for (auto mt = styles_elements->begin(); mt != styles_elements->end(); ++mt) {
|
for (auto mt = styles_elements->begin(); mt != styles_elements->end(); ++mt) {
|
||||||
if ((*mt)->template as<T>()) {
|
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) {
|
bool process_colour(IfcSchema::IfcColourRgb* colour, double* rgb) {
|
||||||
@@ -556,9 +558,6 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSurfaceStyle* style) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (shading == nullptr) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
taxonomy::style::ptr surface_style = taxonomy::make<taxonomy::style>();
|
taxonomy::style::ptr surface_style = taxonomy::make<taxonomy::style>();
|
||||||
surface_style->instance = style;
|
surface_style->instance = style;
|
||||||
if (settings_.get<settings::UseMaterialNames>().get() && style->Name()) {
|
if (settings_.get<settings::UseMaterialNames>().get() && style->Name()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user