Core: replace PyObject_IsTrue with Base::asBoolean
This commit is contained in:
@@ -77,7 +77,7 @@ PyObject* ViewProviderPy::addProperty(PyObject *args)
|
||||
App::Property* prop=nullptr;
|
||||
try {
|
||||
prop = getViewProviderPtr()->addDynamicProperty(sType,sName,sGroup,sDocStr.c_str(),attr,
|
||||
PyObject_IsTrue(ro) ? true : false, PyObject_IsTrue(hd) ? true : false);
|
||||
Base::asBoolean(ro), Base::asBoolean(hd));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::RuntimeError(e.what());
|
||||
@@ -427,7 +427,7 @@ PyObject* ViewProviderPy::partialRender(PyObject* args)
|
||||
}
|
||||
}
|
||||
|
||||
Py::Int ret(getViewProviderPtr()->partialRender(values, PyObject_IsTrue(clear) ? true : false));
|
||||
Py::Int ret(getViewProviderPtr()->partialRender(values, Base::asBoolean(clear)));
|
||||
return Py::new_reference_to(ret);
|
||||
}
|
||||
|
||||
@@ -532,7 +532,7 @@ PyObject *ViewProviderPy::getBoundingBox(PyObject *args) {
|
||||
View3DInventor *view = nullptr;
|
||||
if(pyView)
|
||||
view = static_cast<View3DInventorPy*>(pyView)->getView3DIventorPtr();
|
||||
auto bbox = getViewProviderPtr()->getBoundingBox(subname,PyObject_IsTrue(transform) ? true : false,view);
|
||||
auto bbox = getViewProviderPtr()->getBoundingBox(subname, Base::asBoolean(transform), view);
|
||||
return new Base::BoundBoxPy(new Base::BoundBox3d(bbox));
|
||||
}
|
||||
PY_CATCH;
|
||||
|
||||
Reference in New Issue
Block a user