mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Clone profile for immutability in IfcDerivedProfileDef
This commit is contained in:
@@ -23,6 +23,11 @@ using namespace ifcopenshell::geometry;
|
||||
|
||||
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcDerivedProfileDef* inst) {
|
||||
auto it = map(inst->ParentProfile());
|
||||
if (it == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
// @todo we mutate it so we need to clone otherwise we alter the cached item.
|
||||
it = taxonomy::item::ptr(it->clone_());
|
||||
taxonomy::matrix4::ptr m = taxonomy::cast<taxonomy::matrix4>(map(inst->Operator()));
|
||||
if (!taxonomy::cast<taxonomy::geom_item>(it)->matrix) {
|
||||
// @todo should this not be initialized by default? matrix4 already has a 'lazy identity' mechanism.
|
||||
|
||||
Reference in New Issue
Block a user