From 7af9944c2744be1d58297691e44c9574e695f0fc Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Mon, 29 Apr 2024 21:29:34 +0200 Subject: [PATCH] find_openings() on representation as a hint for hybrid kernel --- src/ifcgeom/mapping/mapping.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/mapping/mapping.cpp b/src/ifcgeom/mapping/mapping.cpp index bee1973ccc..95d2a880b0 100644 --- a/src/ifcgeom/mapping/mapping.cpp +++ b/src/ifcgeom/mapping/mapping.cpp @@ -153,9 +153,20 @@ bool mapping::reuse_ok_(const IfcSchema::IfcProduct::list::ptr& products) { } aggregate_of_instance::ptr mapping::find_openings(const IfcUtil::IfcBaseEntity* inst) { + aggregate_of_instance::ptr openings(new aggregate_of_instance); + + if (auto rep = inst->as()) { + // @todo this is essentially only for hybrid kernel trying to guess + // when not to use a simple kernel. + auto prods = products_represented_by(rep, true); + for (auto& p : *prods) { + openings->push(find_openings(p)); + } + return openings; + } + auto product = inst->as(); - aggregate_of_instance::ptr openings(new aggregate_of_instance); if (product->as() && !product->as()) { const IfcSchema::IfcElement* element = product->as(); auto rels = element->HasOpenings();