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

Function GetAllAlignments

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

Source from the content-addressed store, hash-verified

257}
258
259std::vector<webifc::geometry::IfcAlignment> GetAllAlignments(uint32_t modelID)
260{
261 if (!manager.IsModelOpen(modelID))
262 return std::vector<webifc::geometry::IfcAlignment>();
263 auto geomLoader = manager.GetGeometryProcessor(modelID);
264 auto type = webifc::schema::IFCALIGNMENT;
265
266 auto elements = manager.GetIfcLoader(modelID)->GetExpressIDsWithType(type);
267
268 std::vector<webifc::geometry::IfcAlignment> alignments;
269
270 for (size_t i = 0; i < elements.size(); i++)
271 {
272 webifc::geometry::IfcAlignment alignment = geomLoader->GetLoader().GetAlignment(elements[i]);
273 alignment.transform(geomLoader->GetCoordinationMatrix());
274 alignments.push_back(alignment);
275 }
276
277 for (size_t i = 0; i < alignments.size(); i++)
278 {
279 webifc::geometry::IfcAlignment alignment = alignments[i];
280 std::vector<glm::dvec3> pointsH;
281 std::vector<glm::dvec3> pointsV;
282 for (size_t j = 0; j < alignment.Horizontal.curves.size(); j++)
283 {
284 for (size_t k = 0; k < alignment.Horizontal.curves[j].points.size(); k++)
285 {
286 pointsH.push_back(alignment.Horizontal.curves[j].points[k]);
287 }
288 }
289 for (size_t j = 0; j < alignment.Vertical.curves.size(); j++)
290 {
291 for (size_t k = 0; k < alignment.Vertical.curves[j].points.size(); k++)
292 {
293 pointsV.push_back(alignment.Vertical.curves[j].points[k]);
294 }
295 }
296 webifc::geometry::IfcCurve curve;
297 curve.points = bimGeometry::Convert2DAlignmentsTo3D(pointsH, pointsV);
298 alignments[i].Absolute.curves.push_back(curve);
299 }
300
301 return alignments;
302}
303
304void SetGeometryTransformation(uint32_t modelID, std::array<double, 16> m)
305{

Callers

nothing calls this directly

Calls 9

Convert2DAlignmentsTo3DFunction · 0.85
GetGeometryProcessorMethod · 0.80
GetExpressIDsWithTypeMethod · 0.80
GetIfcLoaderMethod · 0.80
sizeMethod · 0.80
GetAlignmentMethod · 0.80
transformMethod · 0.80
IsModelOpenMethod · 0.45
GetCoordinationMatrixMethod · 0.45

Tested by

no test coverage detected