| 653 | } |
| 654 | |
| 655 | IfcCurve IfcGeometryLoader::GetAlignmentCurve(uint32_t expressID, uint32_t parentExpressID) const |
| 656 | { |
| 657 | spdlog::debug("[GetAlignmentCurve({})]", expressID); |
| 658 | auto lineType = _loader.GetLineType(expressID); |
| 659 | |
| 660 | IfcCurve alignmentCurve; |
| 661 | |
| 662 | switch (lineType) |
| 663 | { |
| 664 | case schema::IFCALIGNMENTSEGMENT: |
| 665 | { |
| 666 | |
| 667 | _loader.MoveToArgumentOffset(expressID, 5); |
| 668 | uint32_t localPlacement = 0; |
| 669 | if (_loader.GetTokenType() == parsing::IfcTokenType::REF) |
| 670 | { |
| 671 | _loader.StepBack(); |
| 672 | localPlacement = _loader.GetRefArgument(); |
| 673 | } |
| 674 | |
| 675 | glm::dmat4 transform_t = glm::dmat4(1); |
| 676 | if (localPlacement != 0 && _loader.IsValidExpressID(localPlacement)) |
| 677 | { |
| 678 | transform_t = GetLocalPlacement(localPlacement); |
| 679 | } |
| 680 | |
| 681 | _loader.MoveToArgumentOffset(expressID, 7); |
| 682 | uint32_t curveID = 0; |
| 683 | if (_loader.GetTokenType() == parsing::IfcTokenType::REF) |
| 684 | { |
| 685 | _loader.StepBack(); |
| 686 | curveID = _loader.GetRefArgument(); |
| 687 | } |
| 688 | if (curveID != 0 && _loader.IsValidExpressID(curveID)) |
| 689 | { |
| 690 | IfcCurve temp = GetAlignmentCurve(curveID, parentExpressID); |
| 691 | alignmentCurve = temp; |
| 692 | } |
| 693 | |
| 694 | for (size_t i = 0; i < alignmentCurve.points.size(); i++) |
| 695 | { |
| 696 | alignmentCurve.points[i] = glm::dvec4(alignmentCurve.points[i].x, alignmentCurve.points[i].y, 0, 1) * transform_t; |
| 697 | } |
| 698 | |
| 699 | break; |
| 700 | } |
| 701 | case schema::IFCALIGNMENTHORIZONTALSEGMENT: |
| 702 | { |
| 703 | |
| 704 | _loader.MoveToArgumentOffset(expressID, 8); |
| 705 | std::string_view type = _loader.GetStringArgument(); |
| 706 | |
| 707 | _loader.MoveToArgumentOffset(expressID, 2); |
| 708 | uint32_t ifcStartPoint = _loader.GetRefArgument(); |
| 709 | glm::dvec2 StartPoint = GetCartesianPoint2D(ifcStartPoint); |
| 710 | |
| 711 | _loader.MoveToArgumentOffset(expressID, 3); |
| 712 | double ifcStartDirection = _loader.GetDoubleArgument(); |
nothing calls this directly
no test coverage detected