mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
separate tree::add_element(), dynamic_cast<> for invalid settings
This commit is contained in:
@@ -305,13 +305,19 @@ namespace IfcGeom {
|
||||
void add_file(IfcGeom::Iterator<double>& it) {
|
||||
if (it.initialize()) {
|
||||
do {
|
||||
IfcGeom::BRepElement<double>* elem = (IfcGeom::BRepElement<double>*)it.get();
|
||||
auto compound = elem->geometry().as_compound();
|
||||
compound.Move(elem->transformation().data());
|
||||
add((IfcUtil::IfcBaseEntity*)it.file()->instance_by_id(elem->id()), compound);
|
||||
add_element(dynamic_cast<IfcGeom::BRepElement<double>*>(it.get()));
|
||||
} while (it.next());
|
||||
}
|
||||
}
|
||||
|
||||
void add_element(IfcGeom::BRepElement<double>* elem) {
|
||||
if (!elem) {
|
||||
return;
|
||||
}
|
||||
auto compound = elem->geometry().as_compound();
|
||||
compound.Move(elem->transformation().data());
|
||||
add(elem->product(), compound);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user