Skip to content

Commit 2f15dbd

Browse files
committed
change first entity ID to 1 instead of 0
1 parent 7423b88 commit 2f15dbd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

IfcPlusPlus/src/ifcpp/model/BuildingModel.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ void BuildingModel::insertEntity( shared_ptr<BuildingEntity> e, bool overwrite_e
301301
return;
302302
}
303303
int tag = e->m_tag;
304-
if( tag < 0 )
304+
if( tag <= 0 )
305305
{
306306
int next_unused_id = getNextUnusedEntityTagFast();
307307
e->m_tag = next_unused_id;
@@ -406,8 +406,8 @@ int BuildingModel::getNextUnusedEntityTagFast()
406406
{
407407
if( m_map_entities.empty() )
408408
{
409-
m_max_entity_id = 0;
410-
return 0;
409+
m_max_entity_id = 1;
410+
return 1;
411411
}
412412

413413
int next_unused_id = m_max_entity_id + 1;
@@ -442,10 +442,10 @@ int BuildingModel::getLowestUnusedEntityTagSlow()
442442
{
443443
if (m_map_entities.empty())
444444
{
445-
return 0;
445+
return 1;
446446
}
447447

448-
m_max_entity_id = 0;
448+
m_max_entity_id = 1;
449449
for (auto it = m_map_entities.begin(); it != m_map_entities.end(); ++it)
450450
{
451451
int tag = it->first;

0 commit comments

Comments
 (0)