mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
#1475 IfcFile::recalculate_id_counter()
This commit is contained in:
@@ -228,6 +228,8 @@ public:
|
|||||||
|
|
||||||
unsigned int FreshId() { return ++MaxId; }
|
unsigned int FreshId() { return ++MaxId; }
|
||||||
|
|
||||||
|
void recalculate_id_counter();
|
||||||
|
|
||||||
IfcUtil::IfcBaseClass* addEntity(IfcUtil::IfcBaseClass* entity);
|
IfcUtil::IfcBaseClass* addEntity(IfcUtil::IfcBaseClass* entity);
|
||||||
void addEntities(IfcEntityList::ptr es);
|
void addEntities(IfcEntityList::ptr es);
|
||||||
|
|
||||||
|
|||||||
@@ -1494,6 +1494,16 @@ void IfcFile::initialize_(IfcParse::IfcSpfStream* s) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IfcFile::recalculate_id_counter() {
|
||||||
|
entity_by_id_t::key_type k = 0;
|
||||||
|
for (auto& p : byid) {
|
||||||
|
if (p.first > k) {
|
||||||
|
k = p.first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MaxId = (unsigned int)k;
|
||||||
|
}
|
||||||
|
|
||||||
class traversal_visitor {
|
class traversal_visitor {
|
||||||
private:
|
private:
|
||||||
std::set<IfcUtil::IfcBaseClass*>& visited_;
|
std::set<IfcUtil::IfcBaseClass*>& visited_;
|
||||||
|
|||||||
Reference in New Issue
Block a user