MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / mapAlignmentSegment

Function mapAlignmentSegment

src/ifcparse/IfcAlignmentHelper.cpp:402–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402std::pair<Ifc4x3_add2::IfcCurveSegment*, Ifc4x3_add2::IfcCurveSegment*> mapAlignmentSegment(const Ifc4x3_add2::IfcAlignmentSegment* segment) {
403 std::pair<Ifc4x3_add2::IfcCurveSegment*, Ifc4x3_add2::IfcCurveSegment*> result(nullptr, nullptr);
404 auto design_parameters = segment->DesignParameters();
405 auto horizontal = design_parameters->as<Ifc4x3_add2::IfcAlignmentHorizontalSegment>();
406 auto vertical = design_parameters->as<Ifc4x3_add2::IfcAlignmentVerticalSegment>();
407 auto cant = design_parameters->as<Ifc4x3_add2::IfcAlignmentCantSegment>();
408 if (horizontal) {
409 result = mapAlignmentHorizontalSegment(horizontal);
410 } else if (vertical) {
411 result = mapAlignmentVerticalSegment(vertical);
412 } else if (cant) {
413 result = mapAlignmentCantSegment(cant);
414 } else {
415 Logger::Error(std::string("Unexpected IfcAlignmentSegment subtype encountered"));
416 }
417 return result;
418}
419
420std::pair<Ifc4x3_add2::IfcCurveSegment*, Ifc4x3_add2::IfcCurveSegment*> mapAlignmentHorizontalSegment(const Ifc4x3_add2::IfcAlignmentHorizontalSegment* segment) {
421 std::pair<Ifc4x3_add2::IfcCurveSegment*, Ifc4x3_add2::IfcCurveSegment*> result(nullptr, nullptr);

Callers

nothing calls this directly

Calls 4

mapAlignmentCantSegmentFunction · 0.85
ErrorFunction · 0.70

Tested by

no test coverage detected