| 257 | } |
| 258 | |
| 259 | std::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 | |
| 304 | void SetGeometryTransformation(uint32_t modelID, std::array<double, 16> m) |
| 305 | { |
nothing calls this directly
no test coverage detected