mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 12:02:44 +00:00
Fix #861
This commit is contained in:
@@ -1925,20 +1925,25 @@ IfcGeom::BRepElement<P, PP>* IfcGeom::Kernel::create_brep_for_representation_and
|
|||||||
|
|
||||||
IfcSchema::IfcRepresentation* IfcGeom::Kernel::representation_mapped_to(const IfcSchema::IfcRepresentation* representation) {
|
IfcSchema::IfcRepresentation* IfcGeom::Kernel::representation_mapped_to(const IfcSchema::IfcRepresentation* representation) {
|
||||||
IfcSchema::IfcRepresentation* representation_mapped_to = 0;
|
IfcSchema::IfcRepresentation* representation_mapped_to = 0;
|
||||||
IfcSchema::IfcRepresentationItem::list::ptr items = representation->Items();
|
try {
|
||||||
if (items->size() == 1) {
|
IfcSchema::IfcRepresentationItem::list::ptr items = representation->Items();
|
||||||
IfcSchema::IfcRepresentationItem* item = *items->begin();
|
if (items->size() == 1) {
|
||||||
if (item->declaration().is(IfcSchema::IfcMappedItem::Class())) {
|
IfcSchema::IfcRepresentationItem* item = *items->begin();
|
||||||
if (item->StyledByItem()->size() == 0) {
|
if (item->declaration().is(IfcSchema::IfcMappedItem::Class())) {
|
||||||
IfcSchema::IfcMappedItem* mapped_item = item->as<IfcSchema::IfcMappedItem>();
|
if (item->StyledByItem()->size() == 0) {
|
||||||
if (is_identity_transform(mapped_item->MappingTarget())) {
|
IfcSchema::IfcMappedItem* mapped_item = item->as<IfcSchema::IfcMappedItem>();
|
||||||
IfcSchema::IfcRepresentationMap* map = mapped_item->MappingSource();
|
if (is_identity_transform(mapped_item->MappingTarget())) {
|
||||||
if (is_identity_transform(map->MappingOrigin())) {
|
IfcSchema::IfcRepresentationMap* map = mapped_item->MappingSource();
|
||||||
representation_mapped_to = map->MappedRepresentation();
|
if (is_identity_transform(map->MappingOrigin())) {
|
||||||
|
representation_mapped_to = map->MappedRepresentation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (const IfcParse::IfcException& e) {
|
||||||
|
Logger::Error(e);
|
||||||
|
// @todo reset representation_mapped_to to zero?
|
||||||
}
|
}
|
||||||
return representation_mapped_to;
|
return representation_mapped_to;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user