mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
Don't try to apply opening elements marked as Reference
This commit is contained in:
@@ -1640,11 +1640,12 @@ void IfcGeom::Kernel::sequence_of_point_to_wire(const TColgp_SequenceOfPnt& p, T
|
|||||||
}
|
}
|
||||||
|
|
||||||
IfcSchema::IfcRelVoidsElement::list::ptr IfcGeom::Kernel::find_openings(IfcSchema::IfcProduct* product) {
|
IfcSchema::IfcRelVoidsElement::list::ptr IfcGeom::Kernel::find_openings(IfcSchema::IfcProduct* product) {
|
||||||
|
std::vector<IfcSchema::IfcRelVoidsElement*> rs;
|
||||||
IfcSchema::IfcRelVoidsElement::list::ptr openings(new IfcSchema::IfcRelVoidsElement::list);
|
|
||||||
if ( product->declaration().is(IfcSchema::IfcElement::Class()) && !product->declaration().is(IfcSchema::IfcOpeningElement::Class()) ) {
|
if ( product->declaration().is(IfcSchema::IfcElement::Class()) && !product->declaration().is(IfcSchema::IfcOpeningElement::Class()) ) {
|
||||||
IfcSchema::IfcElement* element = (IfcSchema::IfcElement*)product;
|
IfcSchema::IfcElement* element = (IfcSchema::IfcElement*)product;
|
||||||
openings = element->HasOpenings();
|
auto rels = element->HasOpenings();
|
||||||
|
rs.insert(rs.end(), rels->begin(), rels->end());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is the IfcElement a decomposition of an IfcElement with any IfcOpeningElements?
|
// Is the IfcElement a decomposition of an IfcElement with any IfcOpeningElements?
|
||||||
@@ -1655,12 +1656,22 @@ IfcSchema::IfcRelVoidsElement::list::ptr IfcGeom::Kernel::find_openings(IfcSchem
|
|||||||
IfcSchema::IfcObjectDefinition* rel_obdef = (*decomposes->begin())->RelatingObject();
|
IfcSchema::IfcObjectDefinition* rel_obdef = (*decomposes->begin())->RelatingObject();
|
||||||
if ( rel_obdef->declaration().is(IfcSchema::IfcElement::Class()) && !rel_obdef->declaration().is(IfcSchema::IfcOpeningElement::Class()) ) {
|
if ( rel_obdef->declaration().is(IfcSchema::IfcElement::Class()) && !rel_obdef->declaration().is(IfcSchema::IfcOpeningElement::Class()) ) {
|
||||||
IfcSchema::IfcElement* element = (IfcSchema::IfcElement*)rel_obdef;
|
IfcSchema::IfcElement* element = (IfcSchema::IfcElement*)rel_obdef;
|
||||||
openings->push(element->HasOpenings());
|
auto rels = element->HasOpenings();
|
||||||
|
rs.insert(rs.end(), rels->begin(), rels->end());
|
||||||
}
|
}
|
||||||
|
|
||||||
obdef = rel_obdef;
|
obdef = rel_obdef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filter openings in Reference view, solely marked as Reference.
|
||||||
|
IfcSchema::IfcRelVoidsElement::list::ptr openings(new IfcSchema::IfcRelVoidsElement::list);
|
||||||
|
std::for_each(rs.begin(), rs.end(), [&openings](IfcSchema::IfcRelVoidsElement* rel) {
|
||||||
|
auto reps = rel->RelatedOpeningElement()->Representation()->Representations();
|
||||||
|
if (!(reps->size() == 1 && (*reps->begin())->RepresentationIdentifier() == "Reference")) {
|
||||||
|
openings->push(rel);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return openings;
|
return openings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user