Part: replace PyObject_IsTrue with Base::asBoolean

This commit is contained in:
wmayer
2022-07-16 13:31:10 +02:00
parent 343aadf02b
commit 8ae3185e3b
38 changed files with 141 additions and 161 deletions

View File

@@ -59,8 +59,8 @@ int RectangularTrimmedSurfacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
Handle(Geom_Surface)::DownCast(static_cast<GeometrySurfacePy*>(surf)->
getGeomSurfacePtr()->handle()),
u1, u2, v1, v2,
PyObject_IsTrue(usense) ? Standard_True : Standard_False,
PyObject_IsTrue(vsense) ? Standard_True : Standard_False
Base::asBoolean(usense),
Base::asBoolean(vsense)
));
return 0;
}
@@ -70,8 +70,8 @@ int RectangularTrimmedSurfacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyObject *utrim=Py_False, *sense=Py_True;
if (PyArg_ParseTuple(args, "O!ddO!|O!",&(Part::GeometrySurfacePy::Type),&surf,
&param1,&param2,&PyBool_Type,&utrim,&PyBool_Type,&sense)) {
Standard_Boolean UTrim = PyObject_IsTrue(utrim) ? Standard_True : Standard_False;
Standard_Boolean Sense = PyObject_IsTrue(sense) ? Standard_True : Standard_False;
Standard_Boolean UTrim = Base::asBoolean(utrim);
Standard_Boolean Sense = Base::asBoolean(sense);
getGeomTrimmedSurfacePtr()->setHandle(new Geom_RectangularTrimmedSurface(
Handle(Geom_Surface)::DownCast(static_cast<GeometrySurfacePy*>(surf)->
getGeomSurfacePtr()->handle()),