Don't emit empty results for representation and allow implicit items to

pass when using --plan
This commit is contained in:
Thomas Krijnen
2023-11-21 14:40:50 +01:00
parent dc6eb8611a
commit b52c5ab082
2 changed files with 13 additions and 9 deletions
+8 -2
View File
@@ -42,10 +42,16 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcRepresentation* inst) {
// @todo // @todo
// if (s.ShapeType() == TopAbs_COMPOUND && TopoDS_Iterator(s).More() && TopoDS_Iterator(s).Value().ShapeType() == TopAbs_SOLID) { // if (s.ShapeType() == TopAbs_COMPOUND && TopoDS_Iterator(s).More() && TopoDS_Iterator(s).Value().ShapeType() == TopAbs_SOLID) {
return filter_in_place(items, [&use_body](taxonomy::ptr i) { auto filtered = filter_in_place(items, [&use_body](taxonomy::ptr i) {
// @todo just filter loops for now. // @todo just filter loops for now.
return (i->kind() != taxonomy::LOOP) == use_body; return (i->kind() != taxonomy::LOOP && i->kind() != taxonomy::PIECEWISE_FUNCTION) == use_body;
}); });
if (filtered->children.empty()) {
return nullptr;
}
return filtered;
} }
/* /*
-2
View File
@@ -236,7 +236,6 @@ void mapping::get_representations(std::vector<geometry_conversion_task>& tasks,
} }
// @todo, fix this properly by considering the mapped geometry types in the representation. // @todo, fix this properly by considering the mapped geometry types in the representation.
if (representation->RepresentationIdentifier() && *representation->RepresentationIdentifier() == "Body") {
geometry_conversion_task task; geometry_conversion_task task;
task.index = task_index++; task.index = task_index++;
task.representation = representation; task.representation = representation;
@@ -245,7 +244,6 @@ void mapping::get_representations(std::vector<geometry_conversion_task>& tasks,
tasks.emplace_back(task); tasks.emplace_back(task);
} }
} }
}
const IfcUtil::IfcBaseEntity* mapping::get_single_material_association(const IfcUtil::IfcBaseEntity* product_) { const IfcUtil::IfcBaseEntity* mapping::get_single_material_association(const IfcUtil::IfcBaseEntity* product_) {
auto product = product_->as<IfcSchema::IfcProduct>(); auto product = product_->as<IfcSchema::IfcProduct>();