Part: modernize type checking

This commit is contained in:
Florian Foinant-Willig
2023-10-15 21:38:52 +02:00
parent 1a83d18a8f
commit eb55f1fe52
22 changed files with 46 additions and 46 deletions

View File

@@ -82,7 +82,7 @@ int CurveConstraintPy::PyInit(PyObject* args, PyObject* kwds)
#if OCC_VERSION_HEX >= 0x070600
Handle(Adaptor3d_Curve) hCurve;
if (curve->getTypeId().isDerivedFrom(GeomTrimmedCurve::getClassTypeId())) {
if (curve->isDerivedFrom<GeomTrimmedCurve>()) {
GeomTrimmedCurve* trim = static_cast<GeomTrimmedCurve*>(curve);
hCurve = new GeomAdaptor_Curve(handle, trim->getFirstParameter(), trim->getLastParameter());
}
@@ -91,7 +91,7 @@ int CurveConstraintPy::PyInit(PyObject* args, PyObject* kwds)
}
#else
Handle(Adaptor3d_HCurve) hCurve;
if (curve->getTypeId().isDerivedFrom(GeomTrimmedCurve::getClassTypeId())) {
if (curve->isDerivedFrom<GeomTrimmedCurve>()) {
GeomTrimmedCurve* trim = static_cast<GeomTrimmedCurve*>(curve);
GeomAdaptor_Curve adapt(handle, trim->getFirstParameter(), trim->getLastParameter());
hCurve = new GeomAdaptor_HCurve(adapt);