mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +00:00
1) Implement a breadth-first traversal of forward references 2) implement entity instance deletion from a file 3) recursively copy entity instances to another file
This commit is contained in:
@@ -41,6 +41,29 @@ IfcUtil::IfcBaseClass* IfcEntityList::operator[] (int i) {
|
||||
bool IfcEntityList::contains(IfcUtil::IfcBaseClass* instance) const {
|
||||
return std::find(ls.begin(), ls.end(), instance) != ls.end();
|
||||
}
|
||||
void IfcEntityList::remove(IfcUtil::IfcBaseClass* instance) {
|
||||
std::vector<IfcUtil::IfcBaseClass*>::const_iterator it;
|
||||
while ((it = std::find(ls.begin(), ls.end(), instance)) != ls.end()) {
|
||||
ls.erase(it);
|
||||
}
|
||||
}
|
||||
IfcEntityList::ptr IfcEntityList::filtered(const std::set<IfcSchema::Type::Enum>& entities) {
|
||||
IfcEntityList::ptr return_value(new IfcEntityList);
|
||||
for (it it = begin(); it != end(); ++it) {
|
||||
bool contained = false;
|
||||
for (std::set<IfcSchema::Type::Enum>::const_iterator jt = entities.begin(); jt != entities.end(); ++jt) {
|
||||
if ((*it)->is(*jt)) {
|
||||
contained = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!contained) {
|
||||
return_value->push(*it);
|
||||
}
|
||||
}
|
||||
return return_value;
|
||||
}
|
||||
|
||||
|
||||
unsigned int IfcUtil::IfcBaseType::getArgumentCount() const { return 1; }
|
||||
Argument* IfcUtil::IfcBaseType::getArgument(unsigned int i) const { return entity->getArgument(i); }
|
||||
|
||||
Reference in New Issue
Block a user