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

Function GetAlignments

src/cpp/test/web-ifc-test.cpp:67–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67std::vector<webifc::geometry::IfcAlignment> GetAlignments(webifc::parsing::IfcLoader &loader, webifc::geometry::IfcGeometryProcessor &geometryLoader)
68{
69 std::vector<webifc::geometry::IfcAlignment> alignments;
70
71 auto type = webifc::schema::IFCALIGNMENT;
72
73 auto elements = loader.GetExpressIDsWithType(type);
74
75 for (unsigned int i = 0; i < elements.size(); i++)
76 {
77 auto alignment = geometryLoader.GetLoader().GetAlignment(elements[i]);
78 alignment.transform(geometryLoader.GetCoordinationMatrix());
79 alignments.push_back(alignment);
80 }
81
82 bool writeFiles = true;
83
84 if (writeFiles)
85 {
86 DumpAlignment(alignments, "V_ALIGN.obj", "H_ALIGN.obj");
87 }
88
89 for (size_t i = 0; i < alignments.size(); i++)
90 {
91 webifc::geometry::IfcAlignment alignment = alignments[i];
92 std::vector<glm::dvec3> pointsH;
93 std::vector<glm::dvec3> pointsV;
94 for (size_t j = 0; j < alignment.Horizontal.curves.size(); j++)
95 {
96 for (size_t k = 0; k < alignment.Horizontal.curves[j].points.size(); k++)
97 {
98 pointsH.push_back(alignment.Horizontal.curves[j].points[k]);
99 }
100 }
101 for (size_t j = 0; j < alignment.Vertical.curves.size(); j++)
102 {
103 for (size_t k = 0; k < alignment.Vertical.curves[j].points.size(); k++)
104 {
105 pointsV.push_back(alignment.Vertical.curves[j].points[k]);
106 }
107 }
108 webifc::geometry::IfcCurve curve;
109 curve.points = bimGeometry::Convert2DAlignmentsTo3D(pointsH, pointsV);
110 alignments[i].Absolute.curves.push_back(curve);
111 }
112
113 return alignments;
114}
115
116std::vector<webifc::geometry::IfcCrossSections> GetCrossSections3D(webifc::parsing::IfcLoader &loader, webifc::geometry::IfcGeometryProcessor &geometryLoader)
117{

Callers

nothing calls this directly

Calls 7

DumpAlignmentFunction · 0.85
Convert2DAlignmentsTo3DFunction · 0.85
GetExpressIDsWithTypeMethod · 0.80
sizeMethod · 0.80
GetAlignmentMethod · 0.80
transformMethod · 0.80
GetCoordinationMatrixMethod · 0.45

Tested by

no test coverage detected