@@ -58,7 +58,7 @@ class GeometryConverter : public StatusCallback
58
58
59
59
std::map<std::string, shared_ptr<ProductShapeData> > m_product_shape_data;
60
60
std::map<std::string, shared_ptr<BuildingObject> > m_map_outside_spatial_structure;
61
- std::set<std::string > m_setResolvedProjectStructure;
61
+ std::set<int > m_setResolvedProjectStructure;
62
62
vec3 m_siteOffset;
63
63
double m_recent_progress = 0 ;
64
64
std::map<int , std::vector<shared_ptr<StatusCallback::Message> > > m_messages;
@@ -225,7 +225,7 @@ class GeometryConverter : public StatusCallback
225
225
}
226
226
227
227
#ifdef _DEBUG
228
- std::string className = IFC4X3::EntityFactory::getStringForClassID (ifc_object_def->classID ());
228
+ std::string className = IFC4X3::EntityFactory::getStringForClassID (ifc_object_def->classID ());
229
229
#endif
230
230
231
231
for ( const weak_ptr<IfcRelAggregates>& relAggregates_weak_ptr : ifc_object_def->m_IsDecomposedBy_inverse )
@@ -243,33 +243,31 @@ class GeometryConverter : public StatusCallback
243
243
const shared_ptr<IfcObjectDefinition>& related_obj_def = vec_related_objects[jj];
244
244
if ( related_obj_def )
245
245
{
246
- std::string related_guid ;
247
- if ( related_obj_def-> m_GlobalId )
246
+ int tag = related_obj_def-> m_tag ;
247
+ if ( tag < 0 )
248
248
{
249
- related_guid = related_obj_def->m_GlobalId ->m_value ;
250
- }
251
-
252
- if ( related_guid.size () < 20 )
253
- {
254
- std::cout << " guid invalid: " << related_guid << std::endl;
249
+ std::cout << " invalid tag: " << tag << std::endl;
255
250
continue ;
256
251
}
257
252
258
- if ( m_setResolvedProjectStructure.find (related_guid ) != m_setResolvedProjectStructure.end () )
253
+ if ( m_setResolvedProjectStructure.find (tag ) != m_setResolvedProjectStructure.end () )
259
254
{
260
255
continue ;
261
256
}
262
- m_setResolvedProjectStructure.insert (related_guid);
263
-
257
+ m_setResolvedProjectStructure.insert (tag);
264
258
265
- auto it_product_map = m_product_shape_data.find (related_guid);
266
- if ( it_product_map != m_product_shape_data.end () )
259
+ if ( related_obj_def->m_GlobalId )
267
260
{
268
- shared_ptr<ProductShapeData>& related_product_shape = it_product_map->second ;
269
- if ( related_product_shape )
261
+ std::string guid = related_obj_def->m_GlobalId ->m_value ;
262
+ auto it_product_map = m_product_shape_data.find (guid);
263
+ if ( it_product_map != m_product_shape_data.end () )
270
264
{
271
- product_data->addChildProduct (related_product_shape, product_data);
272
- resolveProjectStructure (related_product_shape, resolveSecondaryStructure);
265
+ shared_ptr<ProductShapeData>& related_product_shape = it_product_map->second ;
266
+ if ( related_product_shape )
267
+ {
268
+ product_data->addChildProduct (related_product_shape, product_data);
269
+ resolveProjectStructure (related_product_shape, resolveSecondaryStructure);
270
+ }
273
271
}
274
272
}
275
273
}
@@ -298,41 +296,40 @@ class GeometryConverter : public StatusCallback
298
296
const shared_ptr<IfcProduct>& related_product = vec_related_elements[jj];
299
297
if ( related_product )
300
298
{
301
- std::string related_guid ;
302
- if ( related_product-> m_GlobalId )
299
+ int tag = related_product-> m_tag ;
300
+ if ( tag < 0 )
303
301
{
304
- related_guid = related_product->m_GlobalId ->m_value ;
305
- }
306
-
307
- if ( related_guid.size () < 20 )
308
- {
309
- std::cout << " guid invalid: " << related_guid << std::endl;
302
+ std::cout << " tag invalid: " << tag << std::endl;
310
303
continue ;
311
304
}
312
305
313
- if ( m_setResolvedProjectStructure.find (related_guid ) != m_setResolvedProjectStructure.end () )
306
+ if ( m_setResolvedProjectStructure.find (tag ) != m_setResolvedProjectStructure.end () )
314
307
{
315
- // std::cout << "duplicate guid in model tree: " << related_guid << std::endl;
316
308
continue ;
317
309
}
318
- m_setResolvedProjectStructure.insert (related_guid );
310
+ m_setResolvedProjectStructure.insert (tag );
319
311
320
- auto it_product_map = m_product_shape_data.find (related_guid);
321
- if ( it_product_map != m_product_shape_data.end () )
312
+ if ( related_product->m_GlobalId )
322
313
{
323
- shared_ptr<ProductShapeData>& related_product_shape = it_product_map->second ;
324
- if ( related_product_shape )
314
+ std::string related_guid = related_product->m_GlobalId ->m_value ;
315
+
316
+ auto it_product_map = m_product_shape_data.find (related_guid);
317
+ if ( it_product_map != m_product_shape_data.end () )
325
318
{
326
- product_data->addChildProduct (related_product_shape, product_data);
327
- resolveProjectStructure (related_product_shape, resolveSecondaryStructure);
319
+ shared_ptr<ProductShapeData>& related_product_shape = it_product_map->second ;
320
+ if ( related_product_shape )
321
+ {
322
+ product_data->addChildProduct (related_product_shape, product_data);
323
+ resolveProjectStructure (related_product_shape, resolveSecondaryStructure);
324
+ }
328
325
}
329
326
}
330
327
}
331
328
}
332
329
}
333
330
}
334
331
}
335
-
332
+
336
333
if ( resolveSecondaryStructure )
337
334
{
338
335
// handle IfcRelAssigns
@@ -373,33 +370,33 @@ class GeometryConverter : public StatusCallback
373
370
374
371
for ( auto related_object : groupedBy->m_RelatedObjects )
375
372
{
376
- std::string related_guid ;
377
- if ( related_object-> m_GlobalId )
373
+ int tag = related_object-> m_tag ;
374
+ if ( tag < 0 )
378
375
{
379
- related_guid = related_object->m_GlobalId ->m_value ;
380
- }
381
-
382
- if ( related_guid.size () < 20 )
383
- {
384
- std::cout << " guid invalid: " << related_guid << std::endl;
376
+ std::cout << " tag invalid: " << tag << std::endl;
385
377
continue ;
386
378
}
387
379
388
- if ( m_setResolvedProjectStructure.find (related_guid ) != m_setResolvedProjectStructure.end () )
380
+ if ( m_setResolvedProjectStructure.find (tag ) != m_setResolvedProjectStructure.end () )
389
381
{
390
382
// std::cout << "duplicate guid in model tree: " << related_guid << std::endl;
391
383
continue ;
392
384
}
393
- m_setResolvedProjectStructure.insert (related_guid );
385
+ m_setResolvedProjectStructure.insert (tag );
394
386
395
- auto it_product_map = m_product_shape_data.find (related_guid);
396
- if ( it_product_map != m_product_shape_data.end () )
387
+ if ( related_object->m_GlobalId )
397
388
{
398
- shared_ptr<ProductShapeData>& related_product_shape = it_product_map->second ;
399
- if ( related_product_shape )
389
+ std::string related_guid = related_object->m_GlobalId ->m_value ;
390
+
391
+ auto it_product_map = m_product_shape_data.find (related_guid);
392
+ if ( it_product_map != m_product_shape_data.end () )
400
393
{
401
- product_data->addChildProduct (related_product_shape, product_data);
402
- resolveProjectStructure (related_product_shape, resolveSecondaryStructure);
394
+ shared_ptr<ProductShapeData>& related_product_shape = it_product_map->second ;
395
+ if ( related_product_shape )
396
+ {
397
+ product_data->addChildProduct (related_product_shape, product_data);
398
+ resolveProjectStructure (related_product_shape, resolveSecondaryStructure);
399
+ }
403
400
}
404
401
}
405
402
}
@@ -434,33 +431,33 @@ class GeometryConverter : public StatusCallback
434
431
// shared_ptr<IfcPort> m_RelatingPort;
435
432
// shared_ptr<IfcDistributionElement> m_RelatedElement;
436
433
437
- std::string related_guid;
438
- if ( related_object->m_GlobalId )
439
- {
440
- related_guid = related_object->m_GlobalId ->m_value ;
441
- }
434
+ int tag = related_object->m_tag ;
442
435
443
- if ( related_guid. size () < 20 )
436
+ if ( tag < 0 )
444
437
{
445
- std::cout << " guid invalid: " << related_guid << std::endl;
438
+ std::cout << " tag invalid: " << tag << std::endl;
446
439
continue ;
447
440
}
448
441
449
- if ( m_setResolvedProjectStructure.find (related_guid ) != m_setResolvedProjectStructure.end () )
442
+ if ( m_setResolvedProjectStructure.find (tag ) != m_setResolvedProjectStructure.end () )
450
443
{
451
444
// std::cout << "duplicate guid in model tree: " << related_guid << std::endl;
452
445
continue ;
453
446
}
454
- m_setResolvedProjectStructure.insert (related_guid );
447
+ m_setResolvedProjectStructure.insert (tag );
455
448
456
- auto it_product_map = m_product_shape_data.find (related_guid);
457
- if ( it_product_map != m_product_shape_data.end () )
449
+ if ( related_object->m_GlobalId )
458
450
{
459
- shared_ptr<ProductShapeData>& related_product_shape = it_product_map->second ;
460
- if ( related_product_shape )
451
+ std::string related_guid = related_object->m_GlobalId ->m_value ;
452
+ auto it_product_map = m_product_shape_data.find (related_guid);
453
+ if ( it_product_map != m_product_shape_data.end () )
461
454
{
462
- product_data->addChildProduct (related_product_shape, product_data);
463
- resolveProjectStructure (related_product_shape, resolveSecondaryStructure);
455
+ shared_ptr<ProductShapeData>& related_product_shape = it_product_map->second ;
456
+ if ( related_product_shape )
457
+ {
458
+ product_data->addChildProduct (related_product_shape, product_data);
459
+ resolveProjectStructure (related_product_shape, resolveSecondaryStructure);
460
+ }
464
461
}
465
462
}
466
463
}
@@ -476,10 +473,9 @@ class GeometryConverter : public StatusCallback
476
473
std::map<std::string, shared_ptr<ProductShapeData> >& map_shapeInputData = getShapeInputData ();
477
474
shared_ptr<BuildingModel> ifc_model = getBuildingModel ();
478
475
shared_ptr<IfcProject> ifc_project = ifc_model->getIfcProject ();
479
- shared_ptr<IfcSite> ifc_site;
480
-
476
+ std::vector<shared_ptr<IfcSite> > vec_ifc_sites;
481
477
std::vector<shared_ptr<ProductShapeData> > vec_ifc_buildings;
482
-
478
+
483
479
for ( auto it : map_shapeInputData )
484
480
{
485
481
std::string guid = it.first ;
@@ -511,7 +507,7 @@ class GeometryConverter : public StatusCallback
511
507
shared_ptr<IfcSite> site = dynamic_pointer_cast<IfcSite>(ifc_object_definition);
512
508
if ( site )
513
509
{
514
- ifc_site = site;
510
+ vec_ifc_sites. push_back ( site ) ;
515
511
continue ;
516
512
}
517
513
}
@@ -528,7 +524,7 @@ class GeometryConverter : public StatusCallback
528
524
}
529
525
530
526
// if IfcBuilding is not connected to IfcSite and IfcProject, find IfcSite, and connect it
531
- if ( ifc_site )
527
+ for ( auto ifc_site : vec_ifc_sites )
532
528
{
533
529
for ( auto product_shape_building : vec_ifc_buildings )
534
530
{
@@ -830,7 +826,7 @@ class GeometryConverter : public StatusCallback
830
826
} // implicit barrier
831
827
#endif
832
828
833
- // subtract openings in related objects, such as IFCBUILDINGELEMENTPART connected to a window through IFCRELAGGREGATES
829
+ // subtract openings in related objects, such as IFCBUILDINGELEMENTPART connected to a window through IFCRELAGGREGATES
834
830
for ( auto it = map_products_ptr->begin (); it != map_products_ptr->end (); ++it )
835
831
{
836
832
shared_ptr<ProductShapeData> product_geom_input_data = it->second ;
@@ -883,13 +879,13 @@ class GeometryConverter : public StatusCallback
883
879
if ( !product_shape->m_ifc_object_definition .expired () )
884
880
{
885
881
shared_ptr<IfcObjectDefinition> ifc_object_def ( product_shape->m_ifc_object_definition );
886
-
887
- if ( ! m_geom_settings->skipRenderObject (ifc_object_def->classID ()) )
882
+
883
+ if ( m_geom_settings->skipRenderObject (ifc_object_def->classID ()) )
888
884
{
889
885
continue ;
890
886
}
891
887
std::string guid;
892
-
888
+
893
889
if (ifc_object_def->m_GlobalId )
894
890
{
895
891
guid = ifc_object_def->m_GlobalId ->m_value ;
@@ -1068,7 +1064,7 @@ class GeometryConverter : public StatusCallback
1068
1064
if ( enableCaching )
1069
1065
{
1070
1066
bool equalItemFound = false ;
1071
-
1067
+
1072
1068
for ( auto it : m_product_shape_data )
1073
1069
{
1074
1070
const shared_ptr<ProductShapeData>& existingProductShape = it.second ;
@@ -1091,14 +1087,14 @@ class GeometryConverter : public StatusCallback
1091
1087
}
1092
1088
if ( !equalItemFound )
1093
1089
{
1094
- // representation_data->m_vec_item_data.push_back(geom_item_data);
1095
- // #ifdef _OPENMP
1096
- // ScopedLock lock( m_writelock_item_cache );
1097
- // #endif
1098
- // m_map_item_data_cache.push_back(geom_item_data);
1090
+ // representation_data->m_vec_item_data.push_back(geom_item_data);
1091
+ // #ifdef _OPENMP
1092
+ // ScopedLock lock( m_writelock_item_cache );
1093
+ // #endif
1094
+ // m_map_item_data_cache.push_back(geom_item_data);
1099
1095
}
1100
1096
}
1101
-
1097
+
1102
1098
if ( m_clear_memory_immedeately )
1103
1099
{
1104
1100
ifc_product->m_Representation .reset ();
@@ -1186,7 +1182,7 @@ class GeometryConverter : public StatusCallback
1186
1182
if (related_object->m_GlobalId )
1187
1183
{
1188
1184
guid = related_object->m_GlobalId ->m_value ;
1189
-
1185
+
1190
1186
auto it_find_related_shape = m_product_shape_data.find (guid);
1191
1187
if ( it_find_related_shape != m_product_shape_data.end () )
1192
1188
{
0 commit comments