mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Set style name
This commit is contained in:
@@ -426,6 +426,14 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcMaterial* material) {
|
||||
}
|
||||
|
||||
taxonomy::style::ptr material_style = taxonomy::make<taxonomy::style>();
|
||||
material_style->instance = material;
|
||||
if (settings_.get<settings::UseMaterialNames>().get()) {
|
||||
material_style->name = material->Name();
|
||||
} else {
|
||||
std::ostringstream oss;
|
||||
oss << material->declaration().name() << "-" << material->data().id();
|
||||
material_style->name = oss.str();
|
||||
}
|
||||
return material_style;
|
||||
|
||||
// @todo
|
||||
@@ -448,8 +456,12 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcStyledItem* inst) {
|
||||
taxonomy::style::ptr surface_style = taxonomy::make<taxonomy::style>();
|
||||
|
||||
surface_style->instance = style;
|
||||
if (style->Name()) {
|
||||
if (settings_.get<settings::UseMaterialNames>().get() && style->Name()) {
|
||||
surface_style->name = *style->Name();
|
||||
} else {
|
||||
std::ostringstream oss;
|
||||
oss << shading->declaration().name() << "-" << shading->data().id();
|
||||
surface_style->name = oss.str();
|
||||
}
|
||||
|
||||
double rgb[3];
|
||||
|
||||
Reference in New Issue
Block a user