MCPcopy Create free account
hub / github.com/ThatOpen/engine_web-ifc / PopulateRelAggregatesMap

Method PopulateRelAggregatesMap

src/cpp/web-ifc/cache/IfcCache.cpp:56–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 std::unordered_map<uint32_t, std::vector<uint32_t>> IfcCache::PopulateRelAggregatesMap()
57 {
58 std::unordered_map<uint32_t, std::vector<uint32_t>> resultVector;
59 auto relAggregates = _loader.GetExpressIDsWithType(schema::IFCRELAGGREGATES);
60
61 for (uint32_t relAggregateID : relAggregates)
62 {
63 _loader.MoveToArgumentOffset(relAggregateID, 4);
64
65 uint32_t relatingBuildingElement = _loader.GetRefArgument();
66 auto aggregates = _loader.GetSetArgument();
67 auto relVoidsIt2 = _relVoids.find(relatingBuildingElement);
68
69 for (auto &aggregate : aggregates)
70 {
71 uint32_t aggregateID = _loader.GetRefArgument(aggregate);
72 resultVector[relatingBuildingElement].push_back(aggregateID);
73 if (relVoidsIt2 != _relVoids.end() && !relVoidsIt2->second.empty())
74 {
75 auto relVoidsIt1 = _relVoids.find(aggregateID);
76 // any any voids that are aggregated to the voids map
77 if (relVoidsIt1 == _relVoids.end())
78 {
79 _relVoids[aggregateID] = std::vector<uint32_t>();
80 relVoidsIt1 = _relVoids.find(aggregateID);
81 }
82 relVoidsIt1->second.insert(relVoidsIt1->second.end(), relVoidsIt2->second.begin(), relVoidsIt2->second.end());
83 }
84 }
85 }
86 return resultVector;
87 }
88
89 std::unordered_map<uint32_t, std::vector<uint32_t>> IfcCache::PopulateRelNestsMap()
90 {

Callers

nothing calls this directly

Calls 4

GetExpressIDsWithTypeMethod · 0.80
MoveToArgumentOffsetMethod · 0.80
GetRefArgumentMethod · 0.80
GetSetArgumentMethod · 0.80

Tested by

no test coverage detected