From 12e69ff07af0f8026b472fffe51f36d04b80df51 Mon Sep 17 00:00:00 2001 From: Richard Brice <37087370+RickBrice@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:43:36 -0800 Subject: [PATCH] Fixes build issue with mapping --- src/ifcgeom/mapping/IfcCurveSegment.cpp | 47 +++++++++++++------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/ifcgeom/mapping/IfcCurveSegment.cpp b/src/ifcgeom/mapping/IfcCurveSegment.cpp index 4722621116..8b42627faa 100644 --- a/src/ifcgeom/mapping/IfcCurveSegment.cpp +++ b/src/ifcgeom/mapping/IfcCurveSegment.cpp @@ -97,29 +97,30 @@ class segment_geometry_adjuster { auto next = taxonomy::cast(mapping->map(next_inst)); start_of_next_inst_ = next->evaluate(0.0); } else { - // there is not a next segment, however IfcGradientCurve and IfcSegmentedRefernceCurve - // have an optional EndPoint attribute that serves the same purpose as the zero-length - // "next segment" at the end of the curve. The Ifc specification is a little redundant - // in that the "zero length" segment is required thereby negating the need for EndPoint - // but some implementations use the EndPoint instead of the "zero length" segment - // - // Get the parent of this segment. If it is a IfcGradientCurve or IfcSegmentedRefernceCurve - // look for the optional EndPoint attribute - auto curves = inst->UsingCurves(); -if (curves && curves->size() { - auto curve = *curves->begin(); - const IfcSchema::IfcPlacement* placement = nullptr; - if (curve->as()) { - auto s = curve->as(); - placement = s->EndPoint(); - } else if (curve->as()) { - auto s = curve->as(); - placement = s->EndPoint(); - } - if (placement) { - start_of_next_inst_ = taxonomy::cast(mapping->map(placement))->ccomponents(); - } -} + // there is not a next segment, however IfcGradientCurve and IfcSegmentedRefernceCurve + // have an optional EndPoint attribute that serves the same purpose as the zero-length + // "next segment" at the end of the curve. The Ifc specification is a little redundant + // in that the "zero length" segment is required thereby negating the need for EndPoint + // but some implementations use the EndPoint instead of the "zero length" segment + // + // Get the parent of this segment. If it is a IfcGradientCurve or IfcSegmentedRefernceCurve + // look for the optional EndPoint attribute + auto curves = inst->UsingCurves(); + if (curves && curves->size() { + auto curve = *curves->begin(); + const IfcSchema::IfcPlacement* placement = nullptr; + if (curve->as()) { + auto s = curve->as(); + placement = s->EndPoint(); + } else if (curve->as()) { + auto s = curve->as(); + placement = s->EndPoint(); + } + if (placement) { + start_of_next_inst_ = taxonomy::cast(mapping->map(placement))->ccomponents(); + } + } + } } }