#2805 IfcGeom dynamic casting updates

This commit is contained in:
Thomas Krijnen
2023-06-22 14:07:34 +02:00
parent e9d0b8ab66
commit 65cb47e2d8
7 changed files with 32 additions and 29 deletions
+8 -8
View File
@@ -85,11 +85,11 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcTrimmedCurve* l, TopoDS_Wire&
for (auto it = trims1->begin(); it != trims1->end(); it ++ ) {
auto i = *it;
if ( i->declaration().is(IfcSchema::IfcCartesianPoint::Class()) ) {
IfcGeom::Kernel::convert((IfcSchema::IfcCartesianPoint*)i, pnts[sense_agreement] );
if (i->as<IfcSchema::IfcCartesianPoint>()) {
IfcGeom::Kernel::convert(i->as<IfcSchema::IfcCartesianPoint>(), pnts[sense_agreement] );
has_pnts[sense_agreement] = true;
} else if ( i->declaration().is(IfcSchema::IfcParameterValue::Class()) ) {
const double value = *((IfcSchema::IfcParameterValue*)i);
} else if (i->as<IfcSchema::IfcParameterValue>()) {
const double value = *i->as<IfcSchema::IfcParameterValue>();
flts[sense_agreement] = value * parameterFactor;
has_flts[sense_agreement] = true;
}
@@ -97,11 +97,11 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcTrimmedCurve* l, TopoDS_Wire&
for (auto it = trims2->begin(); it != trims2->end(); it ++ ) {
auto i = *it;
if ( i->declaration().is(IfcSchema::IfcCartesianPoint::Class()) ) {
IfcGeom::Kernel::convert((IfcSchema::IfcCartesianPoint*)i, pnts[1-sense_agreement] );
if (i->as<IfcSchema::IfcCartesianPoint>()) {
IfcGeom::Kernel::convert(i->as<IfcSchema::IfcCartesianPoint>(), pnts[1-sense_agreement] );
has_pnts[1-sense_agreement] = true;
} else if ( i->declaration().is(IfcSchema::IfcParameterValue::Class()) ) {
const double value = *((IfcSchema::IfcParameterValue*)i);
} else if (i->as<IfcSchema::IfcParameterValue>()) {
const double value = *i->as<IfcSchema::IfcParameterValue>();
flts[1-sense_agreement] = value * parameterFactor;
has_flts[1-sense_agreement] = true;
}