Merge pull request #3987 from RickBrice/v0.8.0

Fixes build issue with mapping
This commit is contained in:
Richard Brice
2023-11-09 10:44:45 -07:00
committed by GitHub
+24 -23
View File
@@ -97,29 +97,30 @@ class segment_geometry_adjuster {
auto next = taxonomy::cast<taxonomy::piecewise_function>(mapping->map(next_inst)); auto next = taxonomy::cast<taxonomy::piecewise_function>(mapping->map(next_inst));
start_of_next_inst_ = next->evaluate(0.0); start_of_next_inst_ = next->evaluate(0.0);
} else { } else {
// there is not a next segment, however IfcGradientCurve and IfcSegmentedRefernceCurve // there is not a next segment, however IfcGradientCurve and IfcSegmentedRefernceCurve
// have an optional EndPoint attribute that serves the same purpose as the zero-length // 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 // "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 // 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 // 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 // Get the parent of this segment. If it is a IfcGradientCurve or IfcSegmentedRefernceCurve
// look for the optional EndPoint attribute // look for the optional EndPoint attribute
auto curves = inst->UsingCurves(); auto curves = inst->UsingCurves();
if (curves && curves->size() { if (curves && curves->size() {
auto curve = *curves->begin(); auto curve = *curves->begin();
const IfcSchema::IfcPlacement* placement = nullptr; const IfcSchema::IfcPlacement* placement = nullptr;
if (curve->as<IfcSchema::IfcSegmentedReferenceCurve>()) { if (curve->as<IfcSchema::IfcSegmentedReferenceCurve>()) {
auto s = curve->as<IfcSchema::IfcSegmentedReferenceCurve>(); auto s = curve->as<IfcSchema::IfcSegmentedReferenceCurve>();
placement = s->EndPoint(); placement = s->EndPoint();
} else if (curve->as<IfcSchema::IfcGradientCurve>()) { } else if (curve->as<IfcSchema::IfcGradientCurve>()) {
auto s = curve->as<IfcSchema::IfcGradientCurve>(); auto s = curve->as<IfcSchema::IfcGradientCurve>();
placement = s->EndPoint(); placement = s->EndPoint();
} }
if (placement) { if (placement) {
start_of_next_inst_ = taxonomy::cast<taxonomy::matrix4>(mapping->map(placement))->ccomponents(); start_of_next_inst_ = taxonomy::cast<taxonomy::matrix4>(mapping->map(placement))->ccomponents();
} }
} }
}
} }
} }