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

Function GetAllCrossSections

src/cpp/wasm/web-ifc-wasm.cpp:228–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228std::vector<webifc::geometry::IfcCrossSections> GetAllCrossSections(uint32_t modelID, uint8_t dimensions)
229{
230 if (!manager.IsModelOpen(modelID))
231 return std::vector<webifc::geometry::IfcCrossSections>();
232 auto geomLoader = manager.GetGeometryProcessor(modelID);
233
234 std::vector<uint32_t> typeList;
235 typeList.push_back(webifc::schema::IFCSECTIONEDSOLIDHORIZONTAL);
236 typeList.push_back(webifc::schema::IFCSECTIONEDSOLID);
237 typeList.push_back(webifc::schema::IFCSECTIONEDSURFACE);
238
239 std::vector<webifc::geometry::IfcCrossSections> crossSections;
240
241 for (auto &type : typeList)
242 {
243 auto elements = manager.GetIfcLoader(modelID)->GetExpressIDsWithType(type);
244
245 for (size_t i = 0; i < elements.size(); i++)
246 {
247 webifc::geometry::IfcCrossSections crossSection;
248 if (dimensions == 2)
249 crossSection = geomLoader->GetLoader().GetCrossSections2D(elements[i]);
250 else
251 crossSection = geomLoader->GetLoader().GetCrossSections3D(elements[i]);
252 crossSections.push_back(crossSection);
253 }
254 }
255
256 return crossSections;
257}
258
259std::vector<webifc::geometry::IfcAlignment> GetAllAlignments(uint32_t modelID)
260{

Callers

nothing calls this directly

Calls 7

GetGeometryProcessorMethod · 0.80
GetExpressIDsWithTypeMethod · 0.80
GetIfcLoaderMethod · 0.80
sizeMethod · 0.80
GetCrossSections2DMethod · 0.80
GetCrossSections3DMethod · 0.80
IsModelOpenMethod · 0.45

Tested by

no test coverage detected