mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 22:43:41 +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) {
|
void add_file(IfcGeom::Iterator<double>& it) {
|
||||||
if (it.initialize()) {
|
if (it.initialize()) {
|
||||||
do {
|
do {
|
||||||
IfcGeom::BRepElement<double>* elem = (IfcGeom::BRepElement<double>*)it.get();
|
add_element(dynamic_cast<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);
|
|
||||||
} while (it.next());
|
} 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