mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
Merge branch 'master' into v0.6.0
This commit is contained in:
+25
-10
@@ -1257,7 +1257,9 @@ void IfcEntityInstanceData::setArgument(unsigned int i, Argument* a, IfcUtil::Ar
|
||||
if (this->file) {
|
||||
register_inverse_visitor visitor(*this->file, *this);
|
||||
apply_individual_instance_visitor(copy).apply(visitor);
|
||||
}
|
||||
|
||||
this->file->mark_entity_as_modified(id_);
|
||||
}
|
||||
|
||||
attributes_[i] = copy;
|
||||
}
|
||||
@@ -1504,6 +1506,11 @@ IfcEntityList::ptr IfcFile::traverse(IfcUtil::IfcBaseClass* instance, int max_le
|
||||
return IfcParse::traverse(instance, max_level);
|
||||
}
|
||||
|
||||
void IfcFile::mark_entity_as_modified(int /*id*/)
|
||||
{
|
||||
by_ref_cached_.clear();
|
||||
}
|
||||
|
||||
void IfcFile::addEntities(IfcEntityList::ptr es) {
|
||||
for( IfcEntityList::it i = es->begin(); i != es->end(); ++ i ) {
|
||||
addEntity(*i);
|
||||
@@ -1868,17 +1875,25 @@ IfcEntityList::ptr IfcFile::instances_by_type(const std::string& t) {
|
||||
|
||||
IfcEntityList::ptr IfcFile::instances_by_reference(int t) {
|
||||
entities_by_ref_t::const_iterator it = byref.find(t);
|
||||
IfcEntityList::ptr return_value;
|
||||
IfcEntityList::ptr ret;
|
||||
if (it != byref.end()) {
|
||||
const std::vector<unsigned>& ids = it->second;
|
||||
for (std::vector<unsigned>::const_iterator jt = ids.begin(); jt != ids.end(); ++jt) {
|
||||
if (!return_value) {
|
||||
return_value.reset(new IfcEntityList);
|
||||
}
|
||||
return_value->push(instance_by_id(*jt));
|
||||
}
|
||||
ref_map_t::const_iterator cached_it = by_ref_cached_.find(t);
|
||||
if (cached_it != by_ref_cached_.end()) {
|
||||
ret = cached_it->second;
|
||||
}
|
||||
else {
|
||||
if (it->second.size()) {
|
||||
ret.reset(new IfcEntityList);
|
||||
ret->reserve((unsigned)it->second.size());
|
||||
const std::vector<unsigned>& ids = it->second;
|
||||
for (std::vector<unsigned>::const_iterator jt = ids.begin(); jt != ids.end(); ++jt) {
|
||||
ret->push(instance_by_id(*jt));
|
||||
}
|
||||
}
|
||||
by_ref_cached_[t] = ret;
|
||||
}
|
||||
}
|
||||
return return_value;
|
||||
return ret;
|
||||
}
|
||||
|
||||
IfcUtil::IfcBaseClass* IfcFile::instance_by_id(int id) {
|
||||
|
||||
Reference in New Issue
Block a user