Fixes for RC2 changes re IfcPoint and IfcSegment

This commit is contained in:
Thomas Krijnen
2021-02-14 17:21:58 +01:00
parent d2bf2cf46e
commit 89d6b3d21a
2 changed files with 44 additions and 8 deletions
+13 -4
View File
@@ -370,14 +370,23 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcCompositeCurve* l, TopoDS_Wire
return use_radians || use_degrees;
}
#ifdef SCHEMA_HAS_IfcSegment
// 4x3
IfcSchema::IfcSegment::list::ptr segments = l->Segments();
#else
IfcSchema::IfcCompositeCurveSegment::list::ptr segments = l->Segments();
#endif
TopTools_ListOfShape converted_segments;
for (IfcSchema::IfcCompositeCurveSegment::list::it it = segments->begin(); it != segments->end(); ++it) {
for (auto it = segments->begin(); it != segments->end(); ++it) {
IfcSchema::IfcCurve* curve = (*it)->ParentCurve();
if (!(*it)->declaration().is(IfcSchema::IfcCompositeCurveSegment::Class())) {
Logger::Error("Not implemented", *it);
return false;
}
IfcSchema::IfcCurve* curve = ((IfcSchema::IfcCompositeCurveSegment*)(*it))->ParentCurve();
// The type of ParentCurve is IfcCurve, but the documentation says:
// ParentCurve: The *bounded curve* which defines the geometry of the segment.
@@ -406,7 +415,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcCompositeCurve* l, TopoDS_Wire
continue;
}
if (!(*it)->SameSense()) {
if (!((IfcSchema::IfcCompositeCurveSegment*)(*it))->SameSense()) {
segment.Reverse();
}