#2805 IfcGeom dynamic casting updates

This commit is contained in:
Thomas Krijnen
2023-06-22 14:07:34 +02:00
parent e9d0b8ab66
commit 65cb47e2d8
7 changed files with 32 additions and 29 deletions
+5 -2
View File
@@ -45,8 +45,11 @@ public:
template <class U>
typename U::list::ptr as() {
typename U::list::ptr r(new typename U::list);
const bool all = !U::Class().as_entity();
for (it i = begin(); i != end(); ++i) if (all || (*i)->declaration().is(U::Class())) r->push((U*)*i);
for (it i = begin(); i != end(); ++i) {
if ((*i)->as<U>()) {
r->push((*i)->as<U>());
}
}
return r;
}
void remove(IfcUtil::IfcBaseClass*);