mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
Double check for relationship subtype when processing openings on aggregate parent #5639
This commit is contained in:
@@ -178,13 +178,17 @@ aggregate_of_instance::ptr mapping::find_openings(const IfcUtil::IfcBaseEntity*
|
|||||||
if (obdef != nullptr) {
|
if (obdef != nullptr) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
auto decomposes = obdef->Decomposes()->generalize();
|
auto decomposes = obdef->Decomposes()->generalize();
|
||||||
if (decomposes->size() != 1) break;
|
if (decomposes->size() != 1) {
|
||||||
IfcSchema::IfcObjectDefinition* rel_obdef;
|
// If we have multiple decompositions, not allowed by schema,
|
||||||
#ifdef SCHEMA_IfcRelDecomposes_HAS_RelatingObject
|
// openings associated to relating decompositions are not
|
||||||
rel_obdef = (*decomposes->begin())->as<IfcSchema::IfcRelDecomposes>()->RelatingObject();
|
// considered;
|
||||||
#else // IFC4+
|
break;
|
||||||
rel_obdef = (*decomposes->begin())->as<IfcSchema::IfcRelAggregates>()->RelatingObject();
|
}
|
||||||
#endif
|
if ((*decomposes->begin())->as<IfcSchema::IfcRelAggregates>() == nullptr) {
|
||||||
|
// Only aggregation, not nesting is considered.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
IfcSchema::IfcObjectDefinition* rel_obdef = (*decomposes->begin())->as<IfcSchema::IfcRelAggregates>()->RelatingObject();
|
||||||
if (rel_obdef->as<IfcSchema::IfcElement>() && !rel_obdef->as<IfcSchema::IfcFeatureElementSubtraction>()) {
|
if (rel_obdef->as<IfcSchema::IfcElement>() && !rel_obdef->as<IfcSchema::IfcFeatureElementSubtraction>()) {
|
||||||
IfcSchema::IfcElement* element = rel_obdef->as<IfcSchema::IfcElement>();
|
IfcSchema::IfcElement* element = rel_obdef->as<IfcSchema::IfcElement>();
|
||||||
auto rels = element->HasOpenings();
|
auto rels = element->HasOpenings();
|
||||||
|
|||||||
Reference in New Issue
Block a user