| 65 | } |
| 66 | |
| 67 | std::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 | |
| 116 | std::vector<webifc::geometry::IfcCrossSections> GetCrossSections3D(webifc::parsing::IfcLoader &loader, webifc::geometry::IfcGeometryProcessor &geometryLoader) |
| 117 | { |
nothing calls this directly
no test coverage detected