Part: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:26:14 +01:00
parent f265c15ac0
commit 068c0e5a98
155 changed files with 1504 additions and 1504 deletions
+7 -7
View File
@@ -194,35 +194,35 @@ PyMOD_INIT_FUNC(Part)
// Python exceptions
//
PyObject* OCCError = 0;
PyObject* OCCError = nullptr;
if (PyObject_IsSubclass(Base::PyExc_FC_GeneralError, PyExc_RuntimeError)) {
OCCError = PyErr_NewException("Part.OCCError", Base::PyExc_FC_GeneralError, NULL);
OCCError = PyErr_NewException("Part.OCCError", Base::PyExc_FC_GeneralError, nullptr);
}
else {
Base::Console().Error("Can not inherit Part.OCCError form BaseFreeCADError.\n");
OCCError = PyErr_NewException("Part.OCCError", PyExc_RuntimeError, NULL);
OCCError = PyErr_NewException("Part.OCCError", PyExc_RuntimeError, nullptr);
}
Py_INCREF(OCCError);
PyModule_AddObject(partModule, "OCCError", OCCError);
PartExceptionOCCError = OCCError; //set global variable ;(
// domain error
PartExceptionOCCDomainError = PyErr_NewException("Part.OCCDomainError", PartExceptionOCCError, NULL);
PartExceptionOCCDomainError = PyErr_NewException("Part.OCCDomainError", PartExceptionOCCError, nullptr);
Py_INCREF(PartExceptionOCCDomainError);
PyModule_AddObject(partModule, "OCCDomainError", PartExceptionOCCDomainError);
// range error
PartExceptionOCCRangeError = PyErr_NewException("Part.OCCRangeError", PartExceptionOCCDomainError, NULL);
PartExceptionOCCRangeError = PyErr_NewException("Part.OCCRangeError", PartExceptionOCCDomainError, nullptr);
Py_INCREF(PartExceptionOCCRangeError);
PyModule_AddObject(partModule, "OCCRangeError", PartExceptionOCCRangeError);
// construction error
PartExceptionOCCConstructionError = PyErr_NewException("Part.OCCConstructionError", PartExceptionOCCDomainError, NULL);
PartExceptionOCCConstructionError = PyErr_NewException("Part.OCCConstructionError", PartExceptionOCCDomainError, nullptr);
Py_INCREF(PartExceptionOCCConstructionError);
PyModule_AddObject(partModule, "OCCConstructionError", PartExceptionOCCConstructionError);
// dimension error
PartExceptionOCCDimensionError = PyErr_NewException("Part.OCCDimensionError", PartExceptionOCCDomainError, NULL);
PartExceptionOCCDimensionError = PyErr_NewException("Part.OCCDimensionError", PartExceptionOCCDomainError, nullptr);
Py_INCREF(PartExceptionOCCConstructionError);
PyModule_AddObject(partModule, "OCCDimensionError", PartExceptionOCCDimensionError);
+19 -19
View File
@@ -874,7 +874,7 @@ private:
Py::Object makeFace(const Py::Tuple& args)
{
try {
char* className = 0;
char* className = nullptr;
PyObject* pcPyShapeOrList = nullptr;
PyErr_Clear();
if (PyArg_ParseTuple(args.ptr(), "Os", &pcPyShapeOrList, &className)) {
@@ -923,7 +923,7 @@ private:
{
// TODO: BRepFeat_SplitShape
PyObject *obj;
PyObject *surf=0;
PyObject *surf=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "O|O!", &obj, &TopoShapeFacePy::Type, &surf))
throw Py::Exception();
@@ -1031,7 +1031,7 @@ private:
Py::Object makePlane(const Py::Tuple& args)
{
double length, width;
PyObject *pPnt=0, *pDirZ=0, *pDirX=0;
PyObject *pPnt=nullptr, *pDirZ=nullptr, *pDirX=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "dd|O!O!O!", &length, &width,
&(Base::VectorPy::Type), &pPnt,
&(Base::VectorPy::Type), &pDirZ,
@@ -1084,7 +1084,7 @@ private:
Py::Object makeBox(const Py::Tuple& args)
{
double length, width, height;
PyObject *pPnt=0, *pDir=0;
PyObject *pPnt=nullptr, *pDir=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "ddd|O!O!",
&length, &width, &height,
&(Base::VectorPy::Type), &pPnt,
@@ -1123,7 +1123,7 @@ private:
Py::Object makeWedge(const Py::Tuple& args)
{
double xmin, ymin, zmin, z2min, x2min, xmax, ymax, zmax, z2max, x2max;
PyObject *pPnt=0, *pDir=0;
PyObject *pPnt=nullptr, *pDir=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "dddddddddd|O!O!",
&xmin, &ymin, &zmin, &z2min, &x2min, &xmax, &ymax, &zmax, &z2max, &x2max,
&(Base::VectorPy::Type), &pPnt, &(Base::VectorPy::Type), &pDir))
@@ -1200,7 +1200,7 @@ private:
BRepBuilderAPI_MakeEdge makeEdge(gp_Pnt(pnt1.x, pnt1.y, pnt1.z),
gp_Pnt(pnt2.x, pnt2.y, pnt2.z));
const char *error=0;
const char *error=nullptr;
switch (makeEdge.Error())
{
case BRepBuilderAPI_EdgeDone:
@@ -1272,7 +1272,7 @@ private:
Py::Object makeCircle(const Py::Tuple& args)
{
double radius, angle1=0.0, angle2=360;
PyObject *pPnt=0, *pDir=0;
PyObject *pPnt=nullptr, *pDir=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "d|O!O!dd",
&radius,
&(Base::VectorPy::Type), &pPnt,
@@ -1308,7 +1308,7 @@ private:
Py::Object makeSphere(const Py::Tuple& args)
{
double radius, angle1=-90, angle2=90, angle3=360;
PyObject *pPnt=0, *pDir=0;
PyObject *pPnt=nullptr, *pDir=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "d|O!O!ddd",
&radius,
&(Base::VectorPy::Type), &pPnt,
@@ -1338,7 +1338,7 @@ private:
Py::Object makeCylinder(const Py::Tuple& args)
{
double radius, height, angle=360;
PyObject *pPnt=0, *pDir=0;
PyObject *pPnt=nullptr, *pDir=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "dd|O!O!d",
&radius, &height,
&(Base::VectorPy::Type), &pPnt,
@@ -1368,7 +1368,7 @@ private:
Py::Object makeCone(const Py::Tuple& args)
{
double radius1, radius2, height, angle=360;
PyObject *pPnt=0, *pDir=0;
PyObject *pPnt=nullptr, *pDir=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "ddd|O!O!d",
&radius1, &radius2, &height,
&(Base::VectorPy::Type), &pPnt,
@@ -1398,7 +1398,7 @@ private:
Py::Object makeTorus(const Py::Tuple& args)
{
double radius1, radius2, angle1=0.0, angle2=360, angle=360;
PyObject *pPnt=0, *pDir=0;
PyObject *pPnt=nullptr, *pDir=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "dd|O!O!ddd",
&radius1, &radius2,
&(Base::VectorPy::Type), &pPnt,
@@ -1486,7 +1486,7 @@ private:
{
double vmin = DBL_MAX, vmax=-DBL_MAX;
double angle=360;
PyObject *pPnt=0, *pDir=0, *pCrv;
PyObject *pPnt=nullptr, *pDir=nullptr, *pCrv;
Handle(Geom_Curve) curve;
union PyType_Object defaultType = {&Part::TopoShapeSolidPy::Type};
PyObject* type = defaultType.o;
@@ -1868,7 +1868,7 @@ private:
double height;
double track = 0;
Py_UNICODE *unichars = NULL;
Py_UNICODE *unichars = nullptr;
Py_ssize_t pysize;
PyObject *CharList;
@@ -1965,7 +1965,7 @@ private:
}
Py::Object exportUnits(const Py::Tuple& args)
{
char* unit=0;
char* unit=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "|s", &unit))
throw Py::Exception();
@@ -2144,7 +2144,7 @@ private:
try {
TopoDS_Shape* shape = new TopoDS_Shape();
(*shape) = static_cast<TopoShapePy*>(pcObj)->getTopoShapePtr()->getShape();
PyObject* proxy = 0;
PyObject* proxy = nullptr;
proxy = Base::Interpreter().createSWIGPointerObj("OCC.TopoDS", "TopoDS_Shape *", (void*)shape, 1);
return Py::asObject(proxy);
}
@@ -2173,15 +2173,15 @@ private:
Py::Object getShape(const Py::Tuple& args, const Py::Dict &kwds) {
PyObject *pObj;
const char *subname = 0;
PyObject *pyMat = 0;
const char *subname = nullptr;
PyObject *pyMat = nullptr;
PyObject *needSubElement = Py_False;
PyObject *transform = Py_True;
PyObject *noElementMap = Py_False;
PyObject *refine = Py_False;
short retType = 0;
static char* kwd_list[] = {"obj", "subname", "mat",
"needSubElement","transform","retType","noElementMap","refine",0};
"needSubElement","transform","retType","noElementMap","refine",nullptr};
if(!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|sO!OOhOO", kwd_list,
&App::DocumentObjectPy::Type, &pObj, &subname, &Base::MatrixPy::Type, &pyMat,
&needSubElement,&transform,&retType,&noElementMap,&refine))
@@ -2189,7 +2189,7 @@ private:
App::DocumentObject *obj =
static_cast<App::DocumentObjectPy*>(pObj)->getDocumentObjectPtr();
App::DocumentObject *subObj = 0;
App::DocumentObject *subObj = nullptr;
Base::Matrix4D mat;
if(pyMat)
mat = *static_cast<Base::MatrixPy*>(pyMat)->getMatrixPtr();
+1 -1
View File
@@ -150,7 +150,7 @@ Py::Object ArcOfCirclePy::getCircle(void) const
PyObject *ArcOfCirclePy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ArcOfCirclePy::setCustomAttributes(const char* , PyObject *)
+2 -2
View File
@@ -47,7 +47,7 @@ PyObject *ArcOfConicPy::PyMake(struct _typeobject *, PyObject *, PyObject *) //
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'ArcOfConic'.");
return 0;
return nullptr;
}
// constructor method
@@ -234,7 +234,7 @@ void ArcOfConicPy::setYAxis(Py::Object arg)
PyObject *ArcOfConicPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ArcOfConicPy::setCustomAttributes(const char* , PyObject *)
+1 -1
View File
@@ -150,7 +150,7 @@ Py::Object ArcOfEllipsePy::getEllipse(void) const
PyObject *ArcOfEllipsePy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ArcOfEllipsePy::setCustomAttributes(const char* , PyObject *)
+1 -1
View File
@@ -150,7 +150,7 @@ Py::Object ArcOfHyperbolaPy::getHyperbola(void) const
PyObject *ArcOfHyperbolaPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ArcOfHyperbolaPy::setCustomAttributes(const char* , PyObject *)
+1 -1
View File
@@ -138,7 +138,7 @@ Py::Object ArcOfParabolaPy::getParabola(void) const
PyObject *ArcOfParabolaPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ArcOfParabolaPy::setCustomAttributes(const char* , PyObject *)
+1 -1
View File
@@ -198,7 +198,7 @@ int ArcPy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyObject *ArcPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int ArcPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+10 -10
View File
@@ -261,7 +261,7 @@ PyObject* AttachEnginePy::getModeInfo(PyObject* args)
{
char* modeName;
if (!PyArg_ParseTuple(args, "s", &modeName))
return 0;
return nullptr;
try {
AttachEngine &attacher = *(this->getAttachEnginePtr());
@@ -317,7 +317,7 @@ PyObject* AttachEnginePy::getRefTypeOfShape(PyObject* args)
{
PyObject *pcObj;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapePy::Type), &pcObj))
return NULL;
return nullptr;
try{
TopoDS_Shape shape = static_cast<Part::TopoShapePy*>(pcObj)->getTopoShapePtr()->getShape();
@@ -331,7 +331,7 @@ PyObject* AttachEnginePy::isFittingRefType(PyObject* args)
char* type_shape_str;
char* type_need_str;
if (!PyArg_ParseTuple(args, "ss", &type_shape_str, &type_need_str))
return 0;
return nullptr;
try {
eRefType type_shape = AttachEngine::getRefTypeByName(std::string(type_shape_str));
eRefType type_need = AttachEngine::getRefTypeByName(std::string(type_need_str));
@@ -344,7 +344,7 @@ PyObject* AttachEnginePy::downgradeRefType(PyObject* args)
{
char* type_shape_str;
if (!PyArg_ParseTuple(args, "s", &type_shape_str))
return 0;
return nullptr;
try {
eRefType type_shape = AttachEngine::getRefTypeByName(std::string(type_shape_str));
eRefType result = AttachEngine::downgradeType(type_shape);
@@ -356,7 +356,7 @@ PyObject* AttachEnginePy::getRefTypeInfo(PyObject* args)
{
char* typeName;
if (!PyArg_ParseTuple(args, "s", &typeName))
return 0;
return nullptr;
try {
AttachEngine &attacher = *(this->getAttachEnginePtr());
@@ -399,7 +399,7 @@ PyObject* AttachEnginePy::getRefTypeInfo(PyObject* args)
PyObject* AttachEnginePy::copy(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
return new AttachEnginePy(this->getAttachEnginePtr()->copy());
}
@@ -408,7 +408,7 @@ PyObject* AttachEnginePy::calculateAttachedPlacement(PyObject* args)
{
PyObject *pcObj;
if (!PyArg_ParseTuple(args, "O!", &(Base::PlacementPy::Type), &pcObj))
return NULL;
return nullptr;
try{
const Base::Placement& plm = *(static_cast<const Base::PlacementPy*>(pcObj)->getPlacementPtr());
Base::Placement result;
@@ -421,13 +421,13 @@ PyObject* AttachEnginePy::calculateAttachedPlacement(PyObject* args)
return new Base::PlacementPy(new Base::Placement(result));
} ATTACHERPY_STDCATCH_METH;
return NULL;
return nullptr;
}
PyObject* AttachEnginePy::suggestModes(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
AttachEngine &attacher = *(this->getAttachEnginePtr());
@@ -556,7 +556,7 @@ PyObject* AttachEnginePy::writeParametersToFeature(PyObject* args)
PyObject* AttachEnginePy::getCustomAttributes(const char*) const
{
return 0;
return nullptr;
}
int AttachEnginePy::setCustomAttributes(const char*,PyObject*)
+2 -2
View File
@@ -39,12 +39,12 @@ using namespace Attacher;
EXTENSION_PROPERTY_SOURCE(Part::AttachExtension, App::DocumentObjectExtension)
AttachExtension::AttachExtension()
: _attacher(0)
: _attacher(nullptr)
{
EXTENSION_ADD_PROPERTY_TYPE(AttacherType, ("Attacher::AttachEngine3D"), "Attachment",(App::PropertyType)(App::Prop_None),"Class name of attach engine object driving the attachment.");
this->AttacherType.setStatus(App::Property::Status::Hidden, true);
EXTENSION_ADD_PROPERTY_TYPE(Support, (0,0), "Attachment",(App::PropertyType)(App::Prop_None),"Support of the 2D geometry");
EXTENSION_ADD_PROPERTY_TYPE(Support, (nullptr,nullptr), "Attachment",(App::PropertyType)(App::Prop_None),"Support of the 2D geometry");
EXTENSION_ADD_PROPERTY_TYPE(MapMode, (mmDeactivated), "Attachment", App::Prop_None, "Mode of attachment to other object");
MapMode.setEditorName("PartGui::PropertyEnumAttacherItem");
+7 -7
View File
@@ -21,16 +21,16 @@ std::string AttachExtensionPy::representation(void) const
PyObject* AttachExtensionPy::positionBySupport(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
bool bAttached = false;
try{
bAttached = this->getAttachExtensionPtr()->positionBySupport();
} catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return NULL;
return nullptr;
} catch (Base::Exception &e) {
e.setPyException();
return NULL;
return nullptr;
}
return Py::new_reference_to(Py::Boolean(bAttached));
}
@@ -39,16 +39,16 @@ PyObject* AttachExtensionPy::changeAttacherType(PyObject *args)
{
const char* typeName;
if (!PyArg_ParseTuple(args, "s", &typeName))
return 0;
return nullptr;
bool ret;
try{
ret = this->getAttachExtensionPtr()->changeAttacherType(typeName);
} catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return NULL;
return nullptr;
} catch (Base::Exception &e) {
e.setPyException();
return NULL;
return nullptr;
}
return Py::new_reference_to(Py::Boolean(ret));
}
@@ -74,7 +74,7 @@ Py::Object AttachExtensionPy::getAttacher(void) const
PyObject *AttachExtensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int AttachExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+2 -2
View File
@@ -133,7 +133,7 @@ const char* AttachEngine::eMapModeStrings[]= {
"OYZ",
"OYX",
NULL};
nullptr};
//this list must be in sync with eRefType enum.
//These strings are used only by Py interface of Attacher. Strings for use in Gui are in Mod/Part/Gui/AttacherTexts.cpp
@@ -161,7 +161,7 @@ const char* AttachEngine::eRefTypeStrings[]= {
"Object",
"Solid",
"Wire",
NULL
nullptr
};
+1 -1
View File
@@ -269,7 +269,7 @@ public: //methods
bool useRefOrg_Plane = false,
bool makeYVertical = false,
bool makeLegacyFlatFaceOrientation = false,
Base::Placement* placeOfRef = 0) const;
Base::Placement* placeOfRef = nullptr) const;
/**
* @brief suggestMapModes is the procedure that knows everything about
+1 -1
View File
@@ -330,7 +330,7 @@ PyObject* MakePrismPy::shape(PyObject *args)
PyObject *MakePrismPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int MakePrismPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -429,7 +429,7 @@ PyObject* BRepOffsetAPI_MakeFillingPy::G2Error(PyObject *args)
PyObject* BRepOffsetAPI_MakeFillingPy::shape(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
const TopoDS_Shape& shape = this->getBRepOffsetAPI_MakeFillingPtr()->Shape();
@@ -437,7 +437,7 @@ PyObject* BRepOffsetAPI_MakeFillingPy::shape(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -49,14 +49,14 @@ PyObject *BRepOffsetAPI_MakePipeShellPy::PyMake(struct _typeobject *, PyObject *
// create a new instance of BRepOffsetAPI_MakePipeShellPy and the Twin object
PyObject* obj;
if (!PyArg_ParseTuple(args, "O!",&(TopoShapePy::Type),&obj))
return 0;
return nullptr;
const TopoDS_Shape& wire = static_cast<TopoShapePy*>(obj)->getTopoShapePtr()->getShape();
if (!wire.IsNull() && wire.ShapeType() == TopAbs_WIRE) {
return new BRepOffsetAPI_MakePipeShellPy(new BRepOffsetAPI_MakePipeShell(TopoDS::Wire(wire)));
}
PyErr_SetString(PartExceptionOCCError, "A valid wire is needed as argument");
return 0;
return nullptr;
}
// constructor method
@@ -75,7 +75,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setFrenetMode(PyObject *args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O!",&PyBool_Type,&obj))
return 0;
return nullptr;
try {
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(PyObject_IsTrue(obj) ? Standard_True : Standard_False);
@@ -83,7 +83,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setFrenetMode(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -92,7 +92,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setTrihedronMode(PyObject *args)
PyObject *pnt, *dir;
if (!PyArg_ParseTuple(args, "O!O!",&Base::VectorPy::Type,&pnt
,&Base::VectorPy::Type,&dir))
return 0;
return nullptr;
try {
gp_Pnt p = Base::convertTo<gp_Pnt>(Py::Vector(pnt,false).toVector());
@@ -102,7 +102,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setTrihedronMode(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -110,7 +110,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setBiNormalMode(PyObject *args)
{
PyObject *dir;
if (!PyArg_ParseTuple(args, "O!",&Base::VectorPy::Type,&dir))
return 0;
return nullptr;
try {
gp_Dir d = Base::convertTo<gp_Dir>(Py::Vector(dir,false).toVector());
@@ -119,7 +119,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setBiNormalMode(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -127,7 +127,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setSpineSupport(PyObject *args)
{
PyObject *shape;
if (!PyArg_ParseTuple(args, "O!",&Part::TopoShapePy::Type,&shape))
return 0;
return nullptr;
try {
const TopoDS_Shape& s = static_cast<Part::TopoShapePy*>(shape)->getTopoShapePtr()->getShape();
@@ -136,7 +136,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setSpineSupport(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -147,13 +147,13 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args)
if (!PyArg_ParseTuple(args, "O!O!O!",&Part::TopoShapePy::Type,&spine
,&PyBool_Type,&curv
,&PyLong_Type,&keep))
return 0;
return nullptr;
try {
const TopoDS_Shape& s = static_cast<Part::TopoShapePy*>(spine)->getTopoShapePtr()->getShape();
if (s.IsNull() || s.ShapeType() != TopAbs_WIRE) {
PyErr_SetString(PyExc_TypeError, "spine is not a wire");
return 0;
return nullptr;
}
BRepFill_TypeOfContact typeOfCantact;
@@ -176,7 +176,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
#else
PyObject *spine, *curv, *keep;
@@ -208,7 +208,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args)
PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args, PyObject *kwds)
{
PyObject *prof, *curv=Py_False, *keep=Py_False;
static char* keywords_pro[] = {"Profile","WithContact","WithCorrection",NULL};
static char* keywords_pro[] = {"Profile","WithContact","WithCorrection",nullptr};
if (PyArg_ParseTupleAndKeywords(args,kwds, "O!|O!O!", keywords_pro
,&Part::TopoShapePy::Type,&prof
,&PyBool_Type,&curv
@@ -222,13 +222,13 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args, PyObject *kwds)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyErr_Clear();
PyObject *loc;
static char* keywords_loc[] = {"Profile","Location","WithContact","WithCorrection",NULL};
static char* keywords_loc[] = {"Profile","Location","WithContact","WithCorrection",nullptr};
if (PyArg_ParseTupleAndKeywords(args,kwds, "O!O!|O!O!", keywords_loc
,&Part::TopoShapePy::Type,&prof
,&Part::TopoShapeVertexPy::Type,&loc
@@ -244,7 +244,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args, PyObject *kwds)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -252,14 +252,14 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args, PyObject *kwds)
"add(Profile, WithContact=False, WithCorrection=False)\n"
"add(Profile, Location, WithContact=False, WithCorrection=False)"
);
return 0;
return nullptr;
}
PyObject* BRepOffsetAPI_MakePipeShellPy::remove(PyObject *args)
{
PyObject *prof;
if (!PyArg_ParseTuple(args, "O!",&Part::TopoShapePy::Type,&prof))
return 0;
return nullptr;
try {
const TopoDS_Shape& s = static_cast<Part::TopoShapePy*>(prof)->getTopoShapePtr()->getShape();
@@ -268,14 +268,14 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::remove(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BRepOffsetAPI_MakePipeShellPy::isReady(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Standard_Boolean ok = this->getBRepOffsetAPI_MakePipeShellPtr()->IsReady();
@@ -283,14 +283,14 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::isReady(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BRepOffsetAPI_MakePipeShellPy::getStatus(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Standard_Integer val = this->getBRepOffsetAPI_MakePipeShellPtr()->GetStatus();
@@ -298,14 +298,14 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::getStatus(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BRepOffsetAPI_MakePipeShellPy::makeSolid(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Standard_Boolean ok = this->getBRepOffsetAPI_MakePipeShellPtr()->MakeSolid();
@@ -313,14 +313,14 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::makeSolid(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BRepOffsetAPI_MakePipeShellPy::build(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
this->getBRepOffsetAPI_MakePipeShellPtr()->Build();
@@ -328,14 +328,14 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::build(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BRepOffsetAPI_MakePipeShellPy::shape(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
const TopoDS_Shape& shape = this->getBRepOffsetAPI_MakePipeShellPtr()->Shape();
@@ -343,14 +343,14 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::shape(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BRepOffsetAPI_MakePipeShellPy::firstShape(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
TopoDS_Shape shape = this->getBRepOffsetAPI_MakePipeShellPtr()->FirstShape();
@@ -358,14 +358,14 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::firstShape(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BRepOffsetAPI_MakePipeShellPy::lastShape(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
TopoDS_Shape shape = this->getBRepOffsetAPI_MakePipeShellPtr()->LastShape();
@@ -373,7 +373,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::lastShape(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -381,7 +381,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::generated(PyObject *args)
{
PyObject *shape;
if (!PyArg_ParseTuple(args, "O!",&Part::TopoShapePy::Type,&shape))
return 0;
return nullptr;
try {
const TopoDS_Shape& s = static_cast<Part::TopoShapePy*>(shape)->getTopoShapePtr()->getShape();
@@ -397,7 +397,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::generated(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -405,7 +405,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setTolerance(PyObject *args)
{
double tol3d, boundTol, tolAngular;
if (!PyArg_ParseTuple(args, "ddd",&tol3d,&boundTol,&tolAngular))
return 0;
return nullptr;
try {
this->getBRepOffsetAPI_MakePipeShellPtr()->SetTolerance(tol3d, boundTol, tolAngular);
@@ -413,7 +413,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setTolerance(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -421,7 +421,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setTransitionMode(PyObject *args)
{
int mode;
if (!PyArg_ParseTuple(args, "i",&mode))
return 0;
return nullptr;
try {
this->getBRepOffsetAPI_MakePipeShellPtr()->SetTransitionMode(BRepBuilderAPI_TransitionMode(mode));
@@ -429,7 +429,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setTransitionMode(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -437,7 +437,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxDegree(PyObject *args)
{
int degree;
if (!PyArg_ParseTuple(args, "i",&degree))
return 0;
return nullptr;
try {
#if OCC_VERSION_HEX >= 0x060800
@@ -451,7 +451,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxDegree(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -459,7 +459,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxSegments(PyObject *args)
{
int nbseg;
if (!PyArg_ParseTuple(args, "i",&nbseg))
return 0;
return nullptr;
try {
#if OCC_VERSION_HEX >= 0x060800
@@ -473,7 +473,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxSegments(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -481,7 +481,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setForceApproxC1(PyObject *args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O!",&PyBool_Type,&obj))
return 0;
return nullptr;
try {
#if OCC_VERSION_HEX >= 0x060700
@@ -494,7 +494,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setForceApproxC1(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -503,7 +503,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::simulate(PyObject *args)
{
int nbsec;
if (!PyArg_ParseTuple(args, "i",&nbsec))
return 0;
return nullptr;
try {
TopTools_ListOfShape list;
@@ -519,14 +519,14 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::simulate(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject *BRepOffsetAPI_MakePipeShellPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int BRepOffsetAPI_MakePipeShellPy::setCustomAttributes(const char* , PyObject *)
+2 -2
View File
@@ -125,8 +125,8 @@ void GeomBSplineCurve::createArcs(double tolerance, std::list<Geometry*>& new_sp
bool can_do_spline_whole = calculateBiArcPoints(p_start, v_start, p_end, v_end, p1, p2, p3);
Geometry* arc_object1 = NULL;
Geometry* arc_object2 = NULL;
Geometry* arc_object1 = nullptr;
Geometry* arc_object2 = nullptr;
if (can_do_spline_whole) {
Part::TangentialArc arc1(p_start, v_start, p2);
+90 -90
View File
@@ -94,7 +94,7 @@ int BSplineCurvePy::PyInit(PyObject* args, PyObject* kwd)
PyObject* BSplineCurvePy::__reduce__(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Py::Tuple tuple(2);
@@ -121,7 +121,7 @@ PyObject* BSplineCurvePy::__reduce__(PyObject *args)
PyObject* BSplineCurvePy::isRational(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
Standard_Boolean val = curve->IsRational();
@@ -131,7 +131,7 @@ PyObject* BSplineCurvePy::isRational(PyObject *args)
PyObject* BSplineCurvePy::isPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
Standard_Boolean val = curve->IsPeriodic();
@@ -141,7 +141,7 @@ PyObject* BSplineCurvePy::isPeriodic(PyObject *args)
PyObject* BSplineCurvePy::isClosed(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
Standard_Boolean val = curve->IsClosed();
@@ -152,7 +152,7 @@ PyObject* BSplineCurvePy::increaseDegree(PyObject * args)
{
int degree;
if (!PyArg_ParseTuple(args, "i", &degree))
return 0;
return nullptr;
PY_TRY {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -166,7 +166,7 @@ PyObject* BSplineCurvePy::increaseMultiplicity(PyObject * args)
int mult=-1;
int start, end;
if (!PyArg_ParseTuple(args, "ii|i", &start, &end, &mult))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
@@ -183,7 +183,7 @@ PyObject* BSplineCurvePy::increaseMultiplicity(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -191,7 +191,7 @@ PyObject* BSplineCurvePy::incrementMultiplicity(PyObject * args)
{
int start, end, mult;
if (!PyArg_ParseTuple(args, "iii", &start, &end, &mult))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
@@ -200,7 +200,7 @@ PyObject* BSplineCurvePy::incrementMultiplicity(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -212,7 +212,7 @@ PyObject* BSplineCurvePy::insertKnot(PyObject * args)
int M=1;
PyObject* add = Py_True;
if (!PyArg_ParseTuple(args, "d|idO!", &U, &M, &tol, &PyBool_Type, &add))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
@@ -221,7 +221,7 @@ PyObject* BSplineCurvePy::insertKnot(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -236,7 +236,7 @@ PyObject* BSplineCurvePy::insertKnots(PyObject * args)
if (!PyArg_ParseTuple(args, "OO|dO!", &obj1,
&obj2,
&tol, &PyBool_Type, &add))
return 0;
return nullptr;
try {
Py::Sequence knots(obj1);
@@ -261,7 +261,7 @@ PyObject* BSplineCurvePy::insertKnots(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -272,7 +272,7 @@ PyObject* BSplineCurvePy::removeKnot(PyObject * args)
double tol;
int Index,M;
if (!PyArg_ParseTuple(args, "iid", &Index, &M, &tol))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
@@ -282,7 +282,7 @@ PyObject* BSplineCurvePy::removeKnot(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -290,7 +290,7 @@ PyObject* BSplineCurvePy::segment(PyObject * args)
{
double u1,u2;
if (!PyArg_ParseTuple(args, "dd", &u1,&u2))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -300,7 +300,7 @@ PyObject* BSplineCurvePy::segment(PyObject * args)
if (std::abs(tempCurve->FirstParameter()-u1) > Precision::Approximation() ||
std::abs(tempCurve->LastParameter()-u2) > Precision::Approximation()) {
Standard_Failure::Raise("Failed to segment BSpline curve");
return 0;
return nullptr;
}
else {
curve->Segment(u1,u2);
@@ -309,7 +309,7 @@ PyObject* BSplineCurvePy::segment(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -318,7 +318,7 @@ PyObject* BSplineCurvePy::setKnot(PyObject * args)
int Index, M=-1;
double K;
if (!PyArg_ParseTuple(args, "id|i", &Index, &K, &M))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
@@ -334,7 +334,7 @@ PyObject* BSplineCurvePy::setKnot(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -342,7 +342,7 @@ PyObject* BSplineCurvePy::getKnot(PyObject * args)
{
int Index;
if (!PyArg_ParseTuple(args, "i", &Index))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
@@ -353,7 +353,7 @@ PyObject* BSplineCurvePy::getKnot(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -361,7 +361,7 @@ PyObject* BSplineCurvePy::setKnots(PyObject * args)
{
PyObject* obj;
if (!PyArg_ParseTuple(args, "O", &obj))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColStd_Array1OfReal k(1,list.size());
@@ -378,14 +378,14 @@ PyObject* BSplineCurvePy::setKnots(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurvePy::getKnots(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -399,7 +399,7 @@ PyObject* BSplineCurvePy::getKnots(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -409,7 +409,7 @@ PyObject* BSplineCurvePy::setPole(PyObject * args)
double weight=-1.0;
PyObject* p;
if (!PyArg_ParseTuple(args, "iO!|d", &index, &(Base::VectorPy::Type), &p, &weight))
return 0;
return nullptr;
Base::Vector3d vec = static_cast<Base::VectorPy*>(p)->value();
gp_Pnt pnt(vec.x, vec.y, vec.z);
try {
@@ -423,7 +423,7 @@ PyObject* BSplineCurvePy::setPole(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -431,7 +431,7 @@ PyObject* BSplineCurvePy::getPole(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -444,14 +444,14 @@ PyObject* BSplineCurvePy::getPole(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurvePy::getPoles(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -468,14 +468,14 @@ PyObject* BSplineCurvePy::getPoles(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurvePy::getPolesAndWeights(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -499,7 +499,7 @@ PyObject* BSplineCurvePy::getPolesAndWeights(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -508,7 +508,7 @@ PyObject* BSplineCurvePy::setWeight(PyObject * args)
int index;
double weight;
if (!PyArg_ParseTuple(args, "id", &index,&weight))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -517,7 +517,7 @@ PyObject* BSplineCurvePy::setWeight(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -525,7 +525,7 @@ PyObject* BSplineCurvePy::getWeight(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -536,14 +536,14 @@ PyObject* BSplineCurvePy::getWeight(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurvePy::getWeights(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -557,7 +557,7 @@ PyObject* BSplineCurvePy::getWeights(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -565,7 +565,7 @@ PyObject* BSplineCurvePy::getResolution(PyObject * args)
{
double tol;
if (!PyArg_ParseTuple(args, "d", &tol))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -575,7 +575,7 @@ PyObject* BSplineCurvePy::getResolution(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -585,7 +585,7 @@ PyObject* BSplineCurvePy::movePoint(PyObject * args)
int index1, index2;
PyObject* pnt;
if (!PyArg_ParseTuple(args, "dO!ii", &U, &(Base::VectorPy::Type),&pnt, &index1, &index2))
return 0;
return nullptr;
try {
Base::Vector3d p = static_cast<Base::VectorPy*>(pnt)->value();
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
@@ -596,14 +596,14 @@ PyObject* BSplineCurvePy::movePoint(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurvePy::setNotPeriodic(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -612,14 +612,14 @@ PyObject* BSplineCurvePy::setNotPeriodic(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurvePy::setPeriodic(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -628,7 +628,7 @@ PyObject* BSplineCurvePy::setPeriodic(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -636,7 +636,7 @@ PyObject* BSplineCurvePy::setOrigin(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -645,7 +645,7 @@ PyObject* BSplineCurvePy::setOrigin(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -653,7 +653,7 @@ PyObject* BSplineCurvePy::getMultiplicity(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -662,14 +662,14 @@ PyObject* BSplineCurvePy::getMultiplicity(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurvePy::getMultiplicities(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast
(getGeometryPtr()->handle());
@@ -683,7 +683,7 @@ PyObject* BSplineCurvePy::getMultiplicities(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
Py::Long BSplineCurvePy::getDegree(void) const
@@ -772,7 +772,7 @@ PyObject* BSplineCurvePy::toBiArcs(PyObject * args)
{
double tolerance = 0.001;
if (!PyArg_ParseTuple(args, "d", &tolerance))
return 0;
return nullptr;
try {
GeomBSplineCurve* curve = getGeomBSplineCurvePtr();
std::list<Geometry*> arcs;
@@ -788,7 +788,7 @@ PyObject* BSplineCurvePy::toBiArcs(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -801,7 +801,7 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds)
char* continuity = "C2";
double tol3d = 1e-3;
char* parType = "ChordLength";
PyObject* par = 0;
PyObject* par = nullptr;
double weight1 = 0;
double weight2 = 0;
double weight3 = 0;
@@ -889,7 +889,7 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds)
}
else {
Standard_Failure::Raise("Smoothing approximation failed");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
@@ -910,7 +910,7 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds)
}
else {
Standard_Failure::Raise("Approximation with parameters failed");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
@@ -931,12 +931,12 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds)
}
else {
Standard_Failure::Raise("failed to approximate points");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -946,7 +946,7 @@ PyObject* BSplineCurvePy::getCardinalSplineTangents(PyObject *args, PyObject *kw
PyObject* tgs;
double parameter;
static char* kwds_interp1[] = {"Points", "Parameter", NULL};
static char* kwds_interp1[] = {"Points", "Parameter", nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "Od",kwds_interp1, &pts, &parameter)) {
Py::Sequence list(pts);
std::vector<gp_Pnt> interpPoints;
@@ -968,7 +968,7 @@ PyObject* BSplineCurvePy::getCardinalSplineTangents(PyObject *args, PyObject *kw
}
PyErr_Clear();
static char* kwds_interp2[] = {"Points", "Parameters", NULL};
static char* kwds_interp2[] = {"Points", "Parameters", nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "OO",kwds_interp2, &pts, &tgs)) {
Py::Sequence list(pts);
std::vector<gp_Pnt> interpPoints;
@@ -997,28 +997,28 @@ PyObject* BSplineCurvePy::getCardinalSplineTangents(PyObject *args, PyObject *kw
return Py::new_reference_to(vec);
}
return 0;
return nullptr;
}
PyObject* BSplineCurvePy::interpolate(PyObject *args, PyObject *kwds)
{
PyObject* obj;
PyObject* par = 0;
PyObject* par = nullptr;
double tol3d = Precision::Approximation();
PyObject* periodic = Py_False;
PyObject* t1 = 0; PyObject* t2 = 0;
PyObject* ts = 0; PyObject* fl = 0;
PyObject* t1 = nullptr; PyObject* t2 = nullptr;
PyObject* ts = nullptr; PyObject* fl = nullptr;
PyObject* scale = Py_True;
static char* kwds_interp[] = {"Points", "PeriodicFlag", "Tolerance", "InitialTangent", "FinalTangent",
"Tangents", "TangentFlags", "Parameters", "Scale", NULL};
"Tangents", "TangentFlags", "Parameters", "Scale", nullptr};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O!dO!O!OOOO!",kwds_interp,
&obj, &PyBool_Type, &periodic, &tol3d,
&Base::VectorPy::Type, &t1,
&Base::VectorPy::Type, &t2,
&ts, &fl, &par, &PyBool_Type, &scale))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
@@ -1092,14 +1092,14 @@ PyObject* BSplineCurvePy::interpolate(PyObject *args, PyObject *kwds)
}
else {
Standard_Failure::Raise("failed to interpolate points");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
catch (Standard_Failure& e) {
std::string err = e.GetMessageString();
if (err.empty()) err = e.DynamicType()->Name();
PyErr_SetString(PartExceptionOCCError, err.c_str());
return 0;
return nullptr;
}
}
@@ -1110,7 +1110,7 @@ PyObject* BSplineCurvePy::buildFromPoles(PyObject *args)
PyObject* periodic = Py_False;
PyObject* interpolate = Py_False;
if (!PyArg_ParseTuple(args, "O|O!iO!",&obj, &PyBool_Type, &periodic, &degree, &PyBool_Type, interpolate))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColgp_Array1OfPnt poles(1, list.size());
@@ -1151,7 +1151,7 @@ PyObject* BSplineCurvePy::buildFromPoles(PyObject *args)
}
else {
Standard_Failure::Raise("failed to create spline");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
else {
@@ -1171,19 +1171,19 @@ PyObject* BSplineCurvePy::buildFromPoles(PyObject *args)
}
else {
Standard_Failure::Raise("failed to create spline");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *keywds)
{
static char *kwlist[] = {"poles", "mults", "knots", "periodic", "degree", "weights", "CheckRational", NULL};
static char *kwlist[] = {"poles", "mults", "knots", "periodic", "degree", "weights", "CheckRational", nullptr};
PyObject* periodic = Py_False;
PyObject* CheckRational = Py_True;
PyObject* poles = Py_None;
@@ -1199,7 +1199,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
&PyBool_Type, &periodic,
&degree, &weights,
&PyBool_Type, &CheckRational))
return 0;
return nullptr;
try {
// poles have to be present
Py::Sequence list(poles);
@@ -1207,7 +1207,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
number_of_poles = list.size();
if ((number_of_poles) < 2) {
Standard_Failure::Raise("need two or more poles");
return 0;
return nullptr;
}
TColgp_Array1OfPnt occpoles(1, number_of_poles);
Standard_Integer index = 1;
@@ -1221,7 +1221,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
number_of_knots = PyObject_Length(mults);
if (PyObject_Length(knots) != number_of_knots) {
Standard_Failure::Raise("number of knots and mults mismatch");
return 0;
return nullptr;
}
}
else {
@@ -1291,7 +1291,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
if (weights != Py_None) { //weights are given
if (PyObject_Length(weights) != number_of_poles) {
Standard_Failure::Raise("number of poles and weights mismatch");
return 0;
return nullptr;
} //complain about mismatch
Py::Sequence weightssq(weights);
Standard_Integer index = 1;
@@ -1309,7 +1309,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
if ((PyObject_IsTrue(periodic) && sum_of_mults != number_of_poles) ||
(PyObject_Not(periodic) && sum_of_mults - degree -1 != number_of_poles)) {
Standard_Failure::Raise("number of poles and sum of mults mismatch");
return(0);
return(nullptr);
}
Handle(Geom_BSplineCurve) spline = new Geom_BSplineCurve(occpoles,occweights,occknots,occmults,degree,
@@ -1321,13 +1321,13 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
}
else {
Standard_Failure::Raise("failed to create spline");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
catch (const Standard_Failure& e) {
Standard_CString msg = e.GetMessageString();
PyErr_SetString(PartExceptionOCCError, msg ? msg : "");
return 0;
return nullptr;
}
}
@@ -1335,7 +1335,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
PyObject* BSplineCurvePy::toBezier(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineCurve) spline = Handle(Geom_BSplineCurve)::DownCast
@@ -1353,7 +1353,7 @@ PyObject* BSplineCurvePy::toBezier(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -1361,7 +1361,7 @@ PyObject* BSplineCurvePy::join(PyObject *args)
{
PyObject* c;
if (!PyArg_ParseTuple(args, "O!", &BSplineCurvePy::Type, &c))
return 0;
return nullptr;
try {
GeomBSplineCurve* curve1 = this->getGeomBSplineCurvePtr();
@@ -1375,7 +1375,7 @@ PyObject* BSplineCurvePy::join(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -1384,7 +1384,7 @@ PyObject* BSplineCurvePy::makeC1Continuous(PyObject *args)
double tol = Precision::Approximation();
double ang_tol = 1.0e-7;
if (!PyArg_ParseTuple(args, "|dd", &tol, &ang_tol))
return 0;
return nullptr;
try {
GeomBSplineCurve* spline = this->getGeomBSplineCurvePtr();
@@ -1395,13 +1395,13 @@ PyObject* BSplineCurvePy::makeC1Continuous(PyObject *args)
std::string err = e.GetMessageString();
if (err.empty()) err = e.DynamicType()->Name();
PyErr_SetString(PartExceptionOCCError, err.c_str());
return 0;
return nullptr;
}
}
PyObject* BSplineCurvePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int BSplineCurvePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+104 -104
View File
@@ -70,7 +70,7 @@ int BSplineSurfacePy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* BSplineSurfacePy::bounds(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -87,7 +87,7 @@ PyObject* BSplineSurfacePy::bounds(PyObject *args)
PyObject* BSplineSurfacePy::isURational(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -98,7 +98,7 @@ PyObject* BSplineSurfacePy::isURational(PyObject *args)
PyObject* BSplineSurfacePy::isVRational(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -109,7 +109,7 @@ PyObject* BSplineSurfacePy::isVRational(PyObject *args)
PyObject* BSplineSurfacePy::isUPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -120,7 +120,7 @@ PyObject* BSplineSurfacePy::isUPeriodic(PyObject *args)
PyObject* BSplineSurfacePy::isVPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -131,7 +131,7 @@ PyObject* BSplineSurfacePy::isVPeriodic(PyObject *args)
PyObject* BSplineSurfacePy::isUClosed(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -142,7 +142,7 @@ PyObject* BSplineSurfacePy::isUClosed(PyObject *args)
PyObject* BSplineSurfacePy::isVClosed(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -154,7 +154,7 @@ PyObject* BSplineSurfacePy::increaseDegree(PyObject *args)
{
int udegree, vdegree;
if (!PyArg_ParseTuple(args, "ii",&udegree,&vdegree))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -167,7 +167,7 @@ PyObject* BSplineSurfacePy::increaseUMultiplicity(PyObject *args)
int mult=-1;
int start, end;
if (!PyArg_ParseTuple(args, "ii|i", &start, &end, &mult))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -187,7 +187,7 @@ PyObject* BSplineSurfacePy::increaseVMultiplicity(PyObject *args)
int mult=-1;
int start, end;
if (!PyArg_ParseTuple(args, "ii|i", &start, &end, &mult))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -206,7 +206,7 @@ PyObject* BSplineSurfacePy::incrementUMultiplicity(PyObject *args)
{
int start, end, mult;
if (!PyArg_ParseTuple(args, "iii", &start, &end, &mult))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
@@ -215,7 +215,7 @@ PyObject* BSplineSurfacePy::incrementUMultiplicity(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -225,7 +225,7 @@ PyObject* BSplineSurfacePy::incrementVMultiplicity(PyObject *args)
{
int start, end, mult;
if (!PyArg_ParseTuple(args, "iii", &start, &end, &mult))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
@@ -234,7 +234,7 @@ PyObject* BSplineSurfacePy::incrementVMultiplicity(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -246,7 +246,7 @@ PyObject* BSplineSurfacePy::insertUKnot(PyObject *args)
int M=1;
PyObject* add = Py_True;
if (!PyArg_ParseTuple(args, "did|O!", &U, &M, &tol, &PyBool_Type, &add))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
@@ -255,7 +255,7 @@ PyObject* BSplineSurfacePy::insertUKnot(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -270,7 +270,7 @@ PyObject* BSplineSurfacePy::insertUKnots(PyObject *args)
if (!PyArg_ParseTuple(args, "OO|dO!", &obj1,
&obj2,
&tol, &PyBool_Type, &add))
return 0;
return nullptr;
try {
Py::Sequence knots(obj1);
@@ -295,7 +295,7 @@ PyObject* BSplineSurfacePy::insertUKnots(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -307,7 +307,7 @@ PyObject* BSplineSurfacePy::insertVKnot(PyObject *args)
int M=1;
PyObject* add = Py_True;
if (!PyArg_ParseTuple(args, "did|O!", &V, &M, &tol, &PyBool_Type, &add))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
@@ -316,7 +316,7 @@ PyObject* BSplineSurfacePy::insertVKnot(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -331,7 +331,7 @@ PyObject* BSplineSurfacePy::insertVKnots(PyObject *args)
if (!PyArg_ParseTuple(args, "OO|dO!", &obj1,
&obj2,
&tol, &PyBool_Type, &add))
return 0;
return nullptr;
try {
Py::Sequence knots(obj1);
@@ -356,7 +356,7 @@ PyObject* BSplineSurfacePy::insertVKnots(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -367,7 +367,7 @@ PyObject* BSplineSurfacePy::removeUKnot(PyObject *args)
double tol;
int Index,M;
if (!PyArg_ParseTuple(args, "iid", &Index, &M, &tol))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
@@ -377,7 +377,7 @@ PyObject* BSplineSurfacePy::removeUKnot(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -386,7 +386,7 @@ PyObject* BSplineSurfacePy::removeVKnot(PyObject *args)
double tol;
int Index,M;
if (!PyArg_ParseTuple(args, "iid", &Index, &M, &tol))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
@@ -396,7 +396,7 @@ PyObject* BSplineSurfacePy::removeVKnot(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -404,7 +404,7 @@ PyObject* BSplineSurfacePy::segment(PyObject *args)
{
double u1,u2,v1,v2;
if (!PyArg_ParseTuple(args, "dddd", &u1,&u2,&v1,&v2))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -414,7 +414,7 @@ PyObject* BSplineSurfacePy::segment(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -423,7 +423,7 @@ PyObject* BSplineSurfacePy::setUKnot(PyObject *args)
int Index, M=-1;
double K;
if (!PyArg_ParseTuple(args, "id|i", &Index, &K, &M))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -442,7 +442,7 @@ PyObject* BSplineSurfacePy::setVKnot(PyObject *args)
int Index, M=-1;
double K;
if (!PyArg_ParseTuple(args, "id|i", &Index, &K, &M))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -460,7 +460,7 @@ PyObject* BSplineSurfacePy::getUKnot(PyObject *args)
{
int Index;
if (!PyArg_ParseTuple(args, "i", &Index))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -473,7 +473,7 @@ PyObject* BSplineSurfacePy::getVKnot(PyObject *args)
{
int Index;
if (!PyArg_ParseTuple(args, "i", &Index))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -486,7 +486,7 @@ PyObject* BSplineSurfacePy::setUKnots(PyObject *args)
{
PyObject* obj;
if (!PyArg_ParseTuple(args, "O", &obj))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColStd_Array1OfReal k(1,list.size());
@@ -503,7 +503,7 @@ PyObject* BSplineSurfacePy::setUKnots(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -511,7 +511,7 @@ PyObject* BSplineSurfacePy::setVKnots(PyObject *args)
{
PyObject* obj;
if (!PyArg_ParseTuple(args, "O", &obj))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColStd_Array1OfReal k(1,list.size());
@@ -528,14 +528,14 @@ PyObject* BSplineSurfacePy::setVKnots(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::getUKnots(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -549,14 +549,14 @@ PyObject* BSplineSurfacePy::getUKnots(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::getVKnots(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -570,7 +570,7 @@ PyObject* BSplineSurfacePy::getVKnots(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -580,7 +580,7 @@ PyObject* BSplineSurfacePy::setPole(PyObject *args)
double weight=-1.0;
PyObject* p;
if (!PyArg_ParseTuple(args, "iiO!|d", &uindex,&vindex,&(Base::VectorPy::Type),&p,&weight))
return 0;
return nullptr;
Base::Vector3d vec = static_cast<Base::VectorPy*>(p)->value();
gp_Pnt pnt(vec.x, vec.y, vec.z);
try {
@@ -594,7 +594,7 @@ PyObject* BSplineSurfacePy::setPole(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -602,9 +602,9 @@ PyObject* BSplineSurfacePy::setPoleCol(PyObject *args)
{
int vindex;
PyObject* obj;
PyObject* obj2=0;
PyObject* obj2=nullptr;
if (!PyArg_ParseTuple(args, "iO|O",&vindex,&obj,&obj2))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColgp_Array1OfPnt poles(1, list.size());
@@ -617,7 +617,7 @@ PyObject* BSplineSurfacePy::setPoleCol(PyObject *args)
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
if (obj2 == 0) {
if (obj2 == nullptr) {
surf->SetPoleCol(vindex, poles);
}
else {
@@ -634,7 +634,7 @@ PyObject* BSplineSurfacePy::setPoleCol(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -642,9 +642,9 @@ PyObject* BSplineSurfacePy::setPoleRow(PyObject *args)
{
int uindex;
PyObject* obj;
PyObject* obj2=0;
PyObject* obj2=nullptr;
if (!PyArg_ParseTuple(args, "iO|O",&uindex,&obj,&obj2))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColgp_Array1OfPnt poles(1, list.size());
@@ -657,7 +657,7 @@ PyObject* BSplineSurfacePy::setPoleRow(PyObject *args)
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
if (obj2 == 0) {
if (obj2 == nullptr) {
surf->SetPoleRow(uindex, poles);
}
else {
@@ -674,7 +674,7 @@ PyObject* BSplineSurfacePy::setPoleRow(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -682,7 +682,7 @@ PyObject* BSplineSurfacePy::getPole(PyObject *args)
{
int uindex,vindex;
if (!PyArg_ParseTuple(args, "ii", &uindex,&vindex))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -696,14 +696,14 @@ PyObject* BSplineSurfacePy::getPole(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::getPoles(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -723,7 +723,7 @@ PyObject* BSplineSurfacePy::getPoles(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -732,7 +732,7 @@ PyObject* BSplineSurfacePy::setWeight(PyObject *args)
int uindex,vindex;
double weight;
if (!PyArg_ParseTuple(args, "iid",&uindex,&vindex,&weight))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -741,7 +741,7 @@ PyObject* BSplineSurfacePy::setWeight(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -750,7 +750,7 @@ PyObject* BSplineSurfacePy::setWeightCol(PyObject *args)
int vindex;
PyObject* obj;
if (!PyArg_ParseTuple(args, "iO",&vindex,&obj))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColStd_Array1OfReal weights(1, list.size());
@@ -766,7 +766,7 @@ PyObject* BSplineSurfacePy::setWeightCol(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -775,7 +775,7 @@ PyObject* BSplineSurfacePy::setWeightRow(PyObject *args)
int uindex;
PyObject* obj;
if (!PyArg_ParseTuple(args, "iO",&uindex,&obj))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColStd_Array1OfReal weights(1, list.size());
@@ -791,7 +791,7 @@ PyObject* BSplineSurfacePy::setWeightRow(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -799,7 +799,7 @@ PyObject* BSplineSurfacePy::getWeight(PyObject *args)
{
int uindex,vindex;
if (!PyArg_ParseTuple(args, "ii",&uindex,&vindex))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -811,14 +811,14 @@ PyObject* BSplineSurfacePy::getWeight(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::getWeights(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -836,14 +836,14 @@ PyObject* BSplineSurfacePy::getWeights(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::getPolesAndWeights(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -871,7 +871,7 @@ PyObject* BSplineSurfacePy::getPolesAndWeights(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -879,7 +879,7 @@ PyObject* BSplineSurfacePy::getResolution(PyObject *args)
{
double tol;
if (!PyArg_ParseTuple(args, "d", &tol))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -889,7 +889,7 @@ PyObject* BSplineSurfacePy::getResolution(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -901,7 +901,7 @@ PyObject* BSplineSurfacePy::movePoint(PyObject *args)
PyObject* pnt;
if (!PyArg_ParseTuple(args, "ddO!iiii", &U, &V, &(Base::VectorPy::Type),&pnt,
&uindex1, &uindex2,&vindex1, &vindex2))
return 0;
return nullptr;
try {
Base::Vector3d p = static_cast<Base::VectorPy*>(pnt)->value();
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
@@ -913,14 +913,14 @@ PyObject* BSplineSurfacePy::movePoint(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::setUNotPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -929,14 +929,14 @@ PyObject* BSplineSurfacePy::setUNotPeriodic(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::setVNotPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -945,14 +945,14 @@ PyObject* BSplineSurfacePy::setVNotPeriodic(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::setUPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -961,14 +961,14 @@ PyObject* BSplineSurfacePy::setUPeriodic(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::setVPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -977,7 +977,7 @@ PyObject* BSplineSurfacePy::setVPeriodic(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -985,7 +985,7 @@ PyObject* BSplineSurfacePy::setUOrigin(PyObject *args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -994,7 +994,7 @@ PyObject* BSplineSurfacePy::setUOrigin(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -1002,7 +1002,7 @@ PyObject* BSplineSurfacePy::setVOrigin(PyObject *args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -1011,7 +1011,7 @@ PyObject* BSplineSurfacePy::setVOrigin(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -1019,7 +1019,7 @@ PyObject* BSplineSurfacePy::getUMultiplicity(PyObject *args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -1028,7 +1028,7 @@ PyObject* BSplineSurfacePy::getUMultiplicity(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -1036,7 +1036,7 @@ PyObject* BSplineSurfacePy::getVMultiplicity(PyObject *args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -1045,14 +1045,14 @@ PyObject* BSplineSurfacePy::getVMultiplicity(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::getUMultiplicities(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -1066,14 +1066,14 @@ PyObject* BSplineSurfacePy::getUMultiplicities(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::getVMultiplicities(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -1087,14 +1087,14 @@ PyObject* BSplineSurfacePy::getVMultiplicities(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::exchangeUV(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BSplineSurface) surf = Handle(Geom_BSplineSurface)::DownCast
(getGeometryPtr()->handle());
@@ -1107,7 +1107,7 @@ PyObject* BSplineSurfacePy::reparametrize(PyObject * args)
int u,v;
double tol = 0.000001;
if (!PyArg_ParseTuple(args, "ii|d", &u, &v, &tol))
return 0;
return nullptr;
// u,v must be at least 2
u = std::max<int>(u, 2);
@@ -1150,7 +1150,7 @@ PyObject* BSplineSurfacePy::reparametrize(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -1170,10 +1170,10 @@ PyObject* BSplineSurfacePy::approximate(PyObject *args, PyObject *kwds)
Standard_Real Y0=0;
Standard_Real dY=0;
static char* kwds_interp[] = {"Points", "DegMin", "DegMax", "Continuity", "Tolerance", "X0", "dX", "Y0", "dY", "ParamType", "LengthWeight", "CurvatureWeight", "TorsionWeight", NULL};
static char* kwds_interp[] = {"Points", "DegMin", "DegMax", "Continuity", "Tolerance", "X0", "dX", "Y0", "dY", "ParamType", "LengthWeight", "CurvatureWeight", "TorsionWeight", nullptr};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|iiidddddsddd", kwds_interp, &obj, &degMin, &degMax, &continuity, &tol3d, &X0, &dX, &Y0, &dY, &parType, &weight1, &weight2, &weight3))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
Standard_Integer lu = list.size();
@@ -1262,7 +1262,7 @@ PyObject* BSplineSurfacePy::approximate(PyObject *args, PyObject *kwds)
std::string err = e.GetMessageString();
if (err.empty()) err = e.DynamicType()->Name();
PyErr_SetString(PartExceptionOCCError, err.c_str());
return 0;
return nullptr;
}
}
@@ -1277,7 +1277,7 @@ PyObject* BSplineSurfacePy::interpolate(PyObject *args)
int len = PyTuple_GET_SIZE(args);
if (!PyArg_ParseTuple(args, "O|dddd", &obj, &X0, &dX, &Y0, &dY))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
Standard_Integer lu = list.size();
@@ -1326,14 +1326,14 @@ PyObject* BSplineSurfacePy::interpolate(PyObject *args)
std::string err = e.GetMessageString();
if (err.empty()) err = e.DynamicType()->Name();
PyErr_SetString(PartExceptionOCCError, err.c_str());
return 0;
return nullptr;
}
}
PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *keywds)
{
static char *kwlist[] = {"poles", "umults", "vmults",
"uknots", "vknots", "uperiodic", "vperiodic", "udegree", "vdegree", "weights", NULL};
"uknots", "vknots", "uperiodic", "vperiodic", "udegree", "vdegree", "weights", nullptr};
PyObject* uperiodic = Py_False;
PyObject* vperiodic = Py_False;
PyObject* poles = Py_None;
@@ -1354,7 +1354,7 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
&uknots, &vknots, //optional
&PyBool_Type, &uperiodic, &PyBool_Type, &vperiodic, //optinoal
&udegree, &vdegree, &weights)) //optional
return 0;
return nullptr;
try {
Py::Sequence list(poles);
Standard_Integer lu = list.size();
@@ -1405,7 +1405,7 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
if (((uknots != Py_None) && PyObject_Length(uknots) != number_of_uknots) ||
((vknots != Py_None) && PyObject_Length(vknots) != number_of_vknots)){
Standard_Failure::Raise("number of knots and mults mismatch");
return 0;
return nullptr;
}
//copy mults
TColStd_Array1OfInteger occumults(1,number_of_uknots);
@@ -1485,14 +1485,14 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
}
else {
Standard_Failure::Raise("failed to create spline");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
catch (const Standard_Failure& e) {
Standard_CString msg = e.GetMessageString();
PyErr_SetString(PartExceptionOCCError, msg ? msg : "");
return 0;
return nullptr;
}
}
@@ -1674,7 +1674,7 @@ Py::List BSplineSurfacePy::getVKnotSequence(void) const
PyObject *BSplineSurfacePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int BSplineSurfacePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+32 -32
View File
@@ -63,7 +63,7 @@ int BezierCurvePy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* BezierCurvePy::isRational(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
Standard_Boolean val = curve->IsRational();
@@ -73,7 +73,7 @@ PyObject* BezierCurvePy::isRational(PyObject *args)
PyObject* BezierCurvePy::isPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
Standard_Boolean val = curve->IsPeriodic();
@@ -83,7 +83,7 @@ PyObject* BezierCurvePy::isPeriodic(PyObject *args)
PyObject* BezierCurvePy::isClosed(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
Standard_Boolean val = curve->IsClosed();
@@ -94,7 +94,7 @@ PyObject* BezierCurvePy::increase(PyObject * args)
{
int degree;
if (!PyArg_ParseTuple(args, "i", &degree))
return 0;
return nullptr;
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
curve->Increase(degree);
@@ -107,7 +107,7 @@ PyObject* BezierCurvePy::insertPoleAfter(PyObject * args)
double weight=1.0;
PyObject* p;
if (!PyArg_ParseTuple(args, "iO!|d", &index, &(Base::VectorPy::Type), &p, &weight))
return 0;
return nullptr;
Base::Vector3d vec = static_cast<Base::VectorPy*>(p)->value();
gp_Pnt pnt(vec.x, vec.y, vec.z);
try {
@@ -118,7 +118,7 @@ PyObject* BezierCurvePy::insertPoleAfter(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -128,7 +128,7 @@ PyObject* BezierCurvePy::insertPoleBefore(PyObject * args)
double weight=1.0;
PyObject* p;
if (!PyArg_ParseTuple(args, "iO!|d", &index, &(Base::VectorPy::Type), &p, &weight))
return 0;
return nullptr;
Base::Vector3d vec = static_cast<Base::VectorPy*>(p)->value();
gp_Pnt pnt(vec.x, vec.y, vec.z);
try {
@@ -139,7 +139,7 @@ PyObject* BezierCurvePy::insertPoleBefore(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -147,7 +147,7 @@ PyObject* BezierCurvePy::removePole(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
@@ -156,7 +156,7 @@ PyObject* BezierCurvePy::removePole(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -164,7 +164,7 @@ PyObject* BezierCurvePy::segment(PyObject * args)
{
double u1,u2;
if (!PyArg_ParseTuple(args, "dd", &u1,&u2))
return 0;
return nullptr;
try {
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
@@ -173,7 +173,7 @@ PyObject* BezierCurvePy::segment(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -183,7 +183,7 @@ PyObject* BezierCurvePy::setPole(PyObject * args)
double weight=-1.0;
PyObject* p;
if (!PyArg_ParseTuple(args, "iO!|d", &index, &(Base::VectorPy::Type), &p, &weight))
return 0;
return nullptr;
Base::Vector3d vec = static_cast<Base::VectorPy*>(p)->value();
gp_Pnt pnt(vec.x, vec.y, vec.z);
try {
@@ -197,7 +197,7 @@ PyObject* BezierCurvePy::setPole(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -205,7 +205,7 @@ PyObject* BezierCurvePy::getPole(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
@@ -218,14 +218,14 @@ PyObject* BezierCurvePy::getPole(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BezierCurvePy::getPoles(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
@@ -242,7 +242,7 @@ PyObject* BezierCurvePy::getPoles(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -250,7 +250,7 @@ PyObject* BezierCurvePy::setPoles(PyObject * args)
{
PyObject* plist;
if (!PyArg_ParseTuple(args, "O", &plist))
return 0;
return nullptr;
try {
Py::Sequence list(plist);
TColgp_Array1OfPnt poles(1,list.size());
@@ -267,7 +267,7 @@ PyObject* BezierCurvePy::setPoles(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -276,7 +276,7 @@ PyObject* BezierCurvePy::setWeight(PyObject * args)
int index;
double weight;
if (!PyArg_ParseTuple(args, "id", &index,&weight))
return 0;
return nullptr;
try {
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
@@ -285,7 +285,7 @@ PyObject* BezierCurvePy::setWeight(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -293,7 +293,7 @@ PyObject* BezierCurvePy::getWeight(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
@@ -304,14 +304,14 @@ PyObject* BezierCurvePy::getWeight(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BezierCurvePy::getWeights(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
@@ -325,7 +325,7 @@ PyObject* BezierCurvePy::getWeights(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -333,7 +333,7 @@ PyObject* BezierCurvePy::getResolution(PyObject* args)
{
double tol;
if (!PyArg_ParseTuple(args, "d", &tol))
return 0;
return nullptr;
try {
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
@@ -343,7 +343,7 @@ PyObject* BezierCurvePy::getResolution(PyObject* args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
Py::Long BezierCurvePy::getDegree(void) const
@@ -386,9 +386,9 @@ Py::Object BezierCurvePy::getEndPoint(void) const
PyObject* BezierCurvePy::interpolate(PyObject * args)
{
PyObject* obj;
PyObject* par=0;
PyObject* par=nullptr;
if (!PyArg_ParseTuple(args, "O|O", &obj, &par))
return 0;
return nullptr;
try {
Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast
(getGeometryPtr()->handle());
@@ -474,13 +474,13 @@ PyObject* BezierCurvePy::interpolate(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject *BezierCurvePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int BezierCurvePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+60 -60
View File
@@ -64,7 +64,7 @@ int BezierSurfacePy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* BezierSurfacePy::bounds(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -81,7 +81,7 @@ PyObject* BezierSurfacePy::bounds(PyObject *args)
PyObject* BezierSurfacePy::isURational(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -92,7 +92,7 @@ PyObject* BezierSurfacePy::isURational(PyObject *args)
PyObject* BezierSurfacePy::isVRational(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -103,7 +103,7 @@ PyObject* BezierSurfacePy::isVRational(PyObject *args)
PyObject* BezierSurfacePy::isUPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -114,7 +114,7 @@ PyObject* BezierSurfacePy::isUPeriodic(PyObject *args)
PyObject* BezierSurfacePy::isVPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -125,7 +125,7 @@ PyObject* BezierSurfacePy::isVPeriodic(PyObject *args)
PyObject* BezierSurfacePy::isUClosed(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -136,7 +136,7 @@ PyObject* BezierSurfacePy::isUClosed(PyObject *args)
PyObject* BezierSurfacePy::isVClosed(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -148,7 +148,7 @@ PyObject* BezierSurfacePy::increase(PyObject *args)
{
int udegree,vdegree;
if (!PyArg_ParseTuple(args, "ii", &udegree, &vdegree))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -158,7 +158,7 @@ PyObject* BezierSurfacePy::increase(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -166,9 +166,9 @@ PyObject* BezierSurfacePy::insertPoleColAfter(PyObject *args)
{
int vindex;
PyObject* obj;
PyObject* obj2=0;
PyObject* obj2=nullptr;
if (!PyArg_ParseTuple(args, "iO|O",&vindex,&obj,&obj2))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColgp_Array1OfPnt poles(1, list.size());
@@ -181,7 +181,7 @@ PyObject* BezierSurfacePy::insertPoleColAfter(PyObject *args)
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
if (obj2 == 0) {
if (obj2 == nullptr) {
surf->InsertPoleColAfter(vindex, poles);
}
else {
@@ -198,7 +198,7 @@ PyObject* BezierSurfacePy::insertPoleColAfter(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -206,9 +206,9 @@ PyObject* BezierSurfacePy::insertPoleRowAfter(PyObject *args)
{
int uindex;
PyObject* obj;
PyObject* obj2=0;
PyObject* obj2=nullptr;
if (!PyArg_ParseTuple(args, "iO|O",&uindex,&obj,&obj2))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColgp_Array1OfPnt poles(1, list.size());
@@ -221,7 +221,7 @@ PyObject* BezierSurfacePy::insertPoleRowAfter(PyObject *args)
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
if (obj2 == 0) {
if (obj2 == nullptr) {
surf->InsertPoleRowAfter(uindex, poles);
}
else {
@@ -238,7 +238,7 @@ PyObject* BezierSurfacePy::insertPoleRowAfter(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -246,9 +246,9 @@ PyObject* BezierSurfacePy::insertPoleColBefore(PyObject *args)
{
int vindex;
PyObject* obj;
PyObject* obj2=0;
PyObject* obj2=nullptr;
if (!PyArg_ParseTuple(args, "iO|O",&vindex,&obj,&obj2))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColgp_Array1OfPnt poles(1, list.size());
@@ -261,7 +261,7 @@ PyObject* BezierSurfacePy::insertPoleColBefore(PyObject *args)
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
if (obj2 == 0) {
if (obj2 == nullptr) {
surf->InsertPoleColBefore(vindex, poles);
}
else {
@@ -278,7 +278,7 @@ PyObject* BezierSurfacePy::insertPoleColBefore(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -286,9 +286,9 @@ PyObject* BezierSurfacePy::insertPoleRowBefore(PyObject *args)
{
int uindex;
PyObject* obj;
PyObject* obj2=0;
PyObject* obj2=nullptr;
if (!PyArg_ParseTuple(args, "iO|O",&uindex,&obj,&obj2))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColgp_Array1OfPnt poles(1, list.size());
@@ -301,7 +301,7 @@ PyObject* BezierSurfacePy::insertPoleRowBefore(PyObject *args)
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
if (obj2 == 0) {
if (obj2 == nullptr) {
surf->InsertPoleRowBefore(uindex, poles);
}
else {
@@ -318,7 +318,7 @@ PyObject* BezierSurfacePy::insertPoleRowBefore(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -326,7 +326,7 @@ PyObject* BezierSurfacePy::removePoleCol(PyObject *args)
{
int vindex;
if (!PyArg_ParseTuple(args, "i",&vindex))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -335,7 +335,7 @@ PyObject* BezierSurfacePy::removePoleCol(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -343,7 +343,7 @@ PyObject* BezierSurfacePy::removePoleRow(PyObject *args)
{
int uindex;
if (!PyArg_ParseTuple(args, "i",&uindex))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -352,7 +352,7 @@ PyObject* BezierSurfacePy::removePoleRow(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -360,7 +360,7 @@ PyObject* BezierSurfacePy::segment(PyObject *args)
{
Standard_Real u1,u2,v1,v2;
if (!PyArg_ParseTuple(args, "dddd",&u1,&u2,&v1,&v2))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -369,7 +369,7 @@ PyObject* BezierSurfacePy::segment(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -379,7 +379,7 @@ PyObject* BezierSurfacePy::setPole(PyObject *args)
PyObject* obj;
double weight=0.0;
if (!PyArg_ParseTuple(args, "iiO!|d",&uindex,&vindex,&(Base::VectorPy::Type),&obj,&weight))
return 0;
return nullptr;
try {
Base::Vector3d pole = static_cast<Base::VectorPy*>(obj)->value();
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
@@ -392,7 +392,7 @@ PyObject* BezierSurfacePy::setPole(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -400,9 +400,9 @@ PyObject* BezierSurfacePy::setPoleCol(PyObject *args)
{
int vindex;
PyObject* obj;
PyObject* obj2=0;
PyObject* obj2=nullptr;
if (!PyArg_ParseTuple(args, "iO|O",&vindex,&obj,&obj2))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColgp_Array1OfPnt poles(1, list.size());
@@ -415,7 +415,7 @@ PyObject* BezierSurfacePy::setPoleCol(PyObject *args)
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
if (obj2 == 0) {
if (obj2 == nullptr) {
surf->SetPoleCol(vindex, poles);
}
else {
@@ -432,7 +432,7 @@ PyObject* BezierSurfacePy::setPoleCol(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -440,9 +440,9 @@ PyObject* BezierSurfacePy::setPoleRow(PyObject *args)
{
int uindex;
PyObject* obj;
PyObject* obj2=0;
PyObject* obj2=nullptr;
if (!PyArg_ParseTuple(args, "iO|O",&uindex,&obj,&obj2))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColgp_Array1OfPnt poles(1, list.size());
@@ -455,7 +455,7 @@ PyObject* BezierSurfacePy::setPoleRow(PyObject *args)
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
if (obj2 == 0) {
if (obj2 == nullptr) {
surf->SetPoleRow(uindex, poles);
}
else {
@@ -472,7 +472,7 @@ PyObject* BezierSurfacePy::setPoleRow(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -480,7 +480,7 @@ PyObject* BezierSurfacePy::getPole(PyObject *args)
{
int uindex,vindex;
if (!PyArg_ParseTuple(args, "ii",&uindex,&vindex))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -492,14 +492,14 @@ PyObject* BezierSurfacePy::getPole(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BezierSurfacePy::getPoles(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -519,7 +519,7 @@ PyObject* BezierSurfacePy::getPoles(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -528,7 +528,7 @@ PyObject* BezierSurfacePy::setWeight(PyObject *args)
int uindex,vindex;
double weight;
if (!PyArg_ParseTuple(args, "iid",&uindex,&vindex,&weight))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -537,7 +537,7 @@ PyObject* BezierSurfacePy::setWeight(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -546,7 +546,7 @@ PyObject* BezierSurfacePy::setWeightCol(PyObject *args)
int vindex;
PyObject* obj;
if (!PyArg_ParseTuple(args, "iO",&vindex,&obj))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColStd_Array1OfReal weights(1, list.size());
@@ -562,7 +562,7 @@ PyObject* BezierSurfacePy::setWeightCol(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -571,7 +571,7 @@ PyObject* BezierSurfacePy::setWeightRow(PyObject *args)
int uindex;
PyObject* obj;
if (!PyArg_ParseTuple(args, "iO",&uindex,&obj))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColStd_Array1OfReal weights(1, list.size());
@@ -587,7 +587,7 @@ PyObject* BezierSurfacePy::setWeightRow(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -595,7 +595,7 @@ PyObject* BezierSurfacePy::getWeight(PyObject *args)
{
int uindex,vindex;
if (!PyArg_ParseTuple(args, "ii",&uindex,&vindex))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -607,14 +607,14 @@ PyObject* BezierSurfacePy::getWeight(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BezierSurfacePy::getWeights(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -632,7 +632,7 @@ PyObject* BezierSurfacePy::getWeights(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -640,7 +640,7 @@ PyObject* BezierSurfacePy::getResolution(PyObject *args)
{
double tol;
if (!PyArg_ParseTuple(args, "d", &tol))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
(getGeometryPtr()->handle());
@@ -650,14 +650,14 @@ PyObject* BezierSurfacePy::getResolution(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BezierSurfacePy::exchangeUV(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_BezierSurface) surf = Handle(Geom_BezierSurface)::DownCast
@@ -668,7 +668,7 @@ PyObject* BezierSurfacePy::exchangeUV(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -709,7 +709,7 @@ Py::Long BezierSurfacePy::getNbVPoles(void) const
PyObject *BezierSurfacePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int BezierSurfacePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+4 -4
View File
@@ -40,10 +40,10 @@ PROPERTY_SOURCE_WITH_EXTENSIONS(Part::BodyBase, Part::Feature)
BodyBase::BodyBase()
{
ADD_PROPERTY(Tip , (0) );
ADD_PROPERTY(Tip , (nullptr) );
Tip.setScope(App::LinkScope::Child);
ADD_PROPERTY(BaseFeature , (0) );
ADD_PROPERTY(BaseFeature , (nullptr) );
App::OriginGroupExtension::initExtension(this);
}
@@ -51,7 +51,7 @@ BodyBase::BodyBase()
BodyBase* BodyBase::findBodyOf(const App::DocumentObject* f)
{
App::Document* doc = f->getDocument();
if (doc != NULL) {
if (doc != nullptr) {
std::vector<App::DocumentObject*> bodies = doc->getObjectsOfType(BodyBase::getClassTypeId());
for (std::vector<App::DocumentObject*>::const_iterator b = bodies.begin(); b != bodies.end(); b++) {
BodyBase* body = static_cast<BodyBase*>(*b);
@@ -60,7 +60,7 @@ BodyBase* BodyBase::findBodyOf(const App::DocumentObject* f)
}
}
return NULL;
return nullptr;
}
bool BodyBase::isAfter(const App::DocumentObject *feature, const App::DocumentObject* target) const {
+1 -1
View File
@@ -40,7 +40,7 @@ std::string BodyBasePy::representation(void) const
PyObject *BodyBasePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int BodyBasePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+2 -2
View File
@@ -47,7 +47,7 @@ PyObject *BoundedCurvePy::PyMake(struct _typeobject *, PyObject *, PyObject *)
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'BoundedCurve'.");
return 0;
return nullptr;
}
// constructor method
@@ -68,7 +68,7 @@ Py::Object BoundedCurvePy::getEndPoint(void) const
PyObject *BoundedCurvePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int BoundedCurvePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+6 -6
View File
@@ -71,7 +71,7 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds)
// circle and distance for offset
PyObject *pCirc;
double dist;
static char* keywords_cd[] = {"Circle","Distance",NULL};
static char* keywords_cd[] = {"Circle","Distance",nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(CirclePy::Type), &pCirc, &dist)) {
CirclePy* pcCircle = static_cast<CirclePy*>(pCirc);
Handle(Geom_Circle) circle = Handle(Geom_Circle)::DownCast
@@ -89,7 +89,7 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds)
// center, normal and radius
PyObject *pV1, *pV2, *pV3;
static char* keywords_cnr[] = {"Center","Normal","Radius",NULL};
static char* keywords_cnr[] = {"Center","Normal","Radius",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!d", keywords_cnr,
&(Base::VectorPy::Type), &pV1,
@@ -110,7 +110,7 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
static char* keywords_c[] = {"Circle",NULL};
static char* keywords_c[] = {"Circle",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(CirclePy::Type), &pCirc)) {
CirclePy* pcCircle = static_cast<CirclePy*>(pCirc);
@@ -122,7 +122,7 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
static char* keywords_ppp[] = {"Point1","Point2","Point3",NULL};
static char* keywords_ppp[] = {"Point1","Point2","Point3",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
&(Base::VectorPy::Type), &pV1,
@@ -145,7 +145,7 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds)
}
// default circle
static char* keywords_n[] = {NULL};
static char* keywords_n[] = {nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
Handle(Geom_Circle) circle = Handle(Geom_Circle)::DownCast(getGeomCirclePtr()->handle());
@@ -176,7 +176,7 @@ void CirclePy::setRadius(Py::Float arg)
PyObject *CirclePy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int CirclePy::setCustomAttributes(const char* , PyObject *)
+5 -5
View File
@@ -63,7 +63,7 @@ PyObject *ConePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Pytho
// constructor method
int ConePy::PyInit(PyObject* args, PyObject* kwds)
{
char* keywords_n[] = {NULL};
char* keywords_n[] = {nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
Handle(Geom_ConicalSurface) s = Handle(Geom_ConicalSurface)::DownCast
(getGeometryPtr()->handle());
@@ -73,7 +73,7 @@ int ConePy::PyInit(PyObject* args, PyObject* kwds)
PyObject *pV1, *pV2;
double radius1, radius2;
static char* keywords_pprr[] = {"Point1","Point2","Radius1","Radius2",NULL};
static char* keywords_pprr[] = {"Point1","Point2","Radius1","Radius2",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!dd", keywords_pprr,
&(Base::VectorPy::Type), &pV1,
@@ -96,7 +96,7 @@ int ConePy::PyInit(PyObject* args, PyObject* kwds)
}
PyObject *pV3, *pV4;
static char* keywords_pppp[] = {"Point1","Point2","Point3","Point4",NULL};
static char* keywords_pppp[] = {"Point1","Point2","Point3","Point4",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!O!", keywords_pppp,
&(Base::VectorPy::Type), &pV1,
@@ -123,7 +123,7 @@ int ConePy::PyInit(PyObject* args, PyObject* kwds)
}
PyObject *pCone;
static char* keywords_c[] = {"Cone",NULL};
static char* keywords_c[] = {"Cone",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_c,
&(ConePy::Type), &pCone)) {
@@ -262,7 +262,7 @@ void ConePy::setAxis(Py::Object arg)
PyObject *ConePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int ConePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+2 -2
View File
@@ -46,7 +46,7 @@ PyObject *ConicPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Pyth
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'Conic'.");
return 0;
return nullptr;
}
// constructor method
@@ -229,7 +229,7 @@ void ConicPy::setYAxis(Py::Object arg)
PyObject *ConicPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ConicPy::setCustomAttributes(const char* , PyObject *)
+6 -6
View File
@@ -66,7 +66,7 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds)
// cylinder and distance for offset
PyObject *pCyl;
double dist;
static char* keywords_cd[] = {"Cylinder","Distance",NULL};
static char* keywords_cd[] = {"Cylinder","Distance",nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(CylinderPy::Type), &pCyl, &dist)) {
CylinderPy* pcCylinder = static_cast<CylinderPy*>(pCyl);
Handle(Geom_CylindricalSurface) cylinder = Handle(Geom_CylindricalSurface)::DownCast
@@ -83,7 +83,7 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
static char* keywords_c[] = {"Cylinder",NULL};
static char* keywords_c[] = {"Cylinder",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(CylinderPy::Type), &pCyl)) {
CylinderPy* pcCylinder = static_cast<CylinderPy*>(pCyl);
@@ -96,7 +96,7 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds)
}
PyObject *pV1, *pV2, *pV3;
static char* keywords_ppp[] = {"Point1","Point2","Point3",NULL};
static char* keywords_ppp[] = {"Point1","Point2","Point3",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
&(Base::VectorPy::Type), &pV1,
@@ -119,7 +119,7 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
static char* keywords_cc[] = {"Circle",NULL};
static char* keywords_cc[] = {"Circle",nullptr};
PyErr_Clear();
PyObject *pCirc;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_cc, &(CirclePy::Type), &pCirc)) {
@@ -138,7 +138,7 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
static char* keywords_n[] = {NULL};
static char* keywords_n[] = {nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast
@@ -246,7 +246,7 @@ void CylinderPy::setAxis(Py::Object arg)
PyObject *CylinderPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int CylinderPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+5 -5
View File
@@ -55,7 +55,7 @@ PyObject *EllipsePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py
// constructor method
int EllipsePy::PyInit(PyObject* args, PyObject* kwds)
{
char* keywords_n[] = {NULL};
char* keywords_n[] = {nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
Handle(Geom_Ellipse) ellipse = Handle(Geom_Ellipse)::DownCast(getGeomEllipsePtr()->handle());
ellipse->SetMajorRadius(2.0);
@@ -63,7 +63,7 @@ int EllipsePy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_e[] = {"Ellipse",NULL};
char* keywords_e[] = {"Ellipse",nullptr};
PyErr_Clear();
PyObject *pElips;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(EllipsePy::Type), &pElips)) {
@@ -76,7 +76,7 @@ int EllipsePy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_ssc[] = {"S1","S2","Center",NULL};
char* keywords_ssc[] = {"S1","S2","Center",nullptr};
PyErr_Clear();
PyObject *pV1, *pV2, *pV3;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
@@ -99,7 +99,7 @@ int EllipsePy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",NULL};
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",nullptr};
PyErr_Clear();
PyObject *pV;
double major, minor;
@@ -173,7 +173,7 @@ Py::Object EllipsePy::getFocus2(void) const
PyObject *EllipsePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int EllipsePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+1 -1
View File
@@ -41,7 +41,7 @@ PROPERTY_SOURCE(Part::Compound, Part::Feature)
Compound::Compound()
{
ADD_PROPERTY(Links,(0));
ADD_PROPERTY(Links,(nullptr));
Links.setSize(0);
}
+4 -4
View File
@@ -54,11 +54,11 @@ const char* Extrusion::eDirModeStrings[] = {
"Custom",
"Edge",
"Normal",
NULL };
nullptr };
Extrusion::Extrusion()
{
ADD_PROPERTY_TYPE(Base, (0), "Extrude", App::Prop_None, "Shape to extrude");
ADD_PROPERTY_TYPE(Base, (nullptr), "Extrude", App::Prop_None, "Shape to extrude");
ADD_PROPERTY_TYPE(Dir, (Base::Vector3d(0.0, 0.0, 1.0)), "Extrude", App::Prop_None, "Direction of extrusion (also magnitude, if both lengths are zero).");
ADD_PROPERTY_TYPE(DirMode, (dmCustom), "Extrude", App::Prop_None, "Sets, how Dir is updated.");
DirMode.setEnums(eDirModeStrings);
@@ -189,9 +189,9 @@ Extrusion::ExtrusionParameters Extrusion::computeFinalParameters()
Base::Vector3d Extrusion::calculateShapeNormal(const App::PropertyLink& shapeLink)
{
App::DocumentObject* docobj = 0;
App::DocumentObject* docobj = nullptr;
Base::Matrix4D mat;
TopoDS_Shape sh = Feature::getShape(shapeLink.getValue(), 0, false, &mat, &docobj);
TopoDS_Shape sh = Feature::getShape(shapeLink.getValue(), nullptr, false, &mat, &docobj);
if (!docobj)
throw Base::ValueError("calculateShapeNormal: link is empty");
+1 -1
View File
@@ -55,7 +55,7 @@ PROPERTY_SOURCE(Part::Face, Part::Feature)
Face::Face()
{
ADD_PROPERTY(Sources,(0));
ADD_PROPERTY(Sources,(nullptr));
ADD_PROPERTY(FaceMakerClass,("Part::FaceMakerCheese"));//default value here is for legacy documents. Default for new objects is set in setupObject.
Sources.setSize(0);
}
+1 -1
View File
@@ -38,7 +38,7 @@ PROPERTY_SOURCE(Part::FeatureGeometrySet, Part::Feature)
FeatureGeometrySet::FeatureGeometrySet()
{
ADD_PROPERTY(GeometrySet,(0));
ADD_PROPERTY(GeometrySet,(nullptr));
}
+1 -1
View File
@@ -41,7 +41,7 @@ PROPERTY_SOURCE(Part::Mirroring, Part::Feature)
Mirroring::Mirroring()
{
ADD_PROPERTY(Source,(0));
ADD_PROPERTY(Source,(nullptr));
ADD_PROPERTY_TYPE(Base,(Base::Vector3d()),"Plane",App::Prop_None,"The base point of the plane");
ADD_PROPERTY_TYPE(Normal,(Base::Vector3d(0,0,1)),"Plane",App::Prop_None,"The normal of the plane");
}
+3 -3
View File
@@ -30,14 +30,14 @@
using namespace Part;
const char* Part::Offset::ModeEnums[]= {"Skin","Pipe", "RectoVerso",NULL};
const char* Part::Offset::JoinEnums[]= {"Arc","Tangent", "Intersection",NULL};
const char* Part::Offset::ModeEnums[]= {"Skin","Pipe", "RectoVerso",nullptr};
const char* Part::Offset::JoinEnums[]= {"Arc","Tangent", "Intersection",nullptr};
PROPERTY_SOURCE(Part::Offset, Part::Feature)
Offset::Offset()
{
ADD_PROPERTY_TYPE(Source,(0),"Offset",App::Prop_None,"Source shape");
ADD_PROPERTY_TYPE(Source,(nullptr),"Offset",App::Prop_None,"Source shape");
ADD_PROPERTY_TYPE(Value,(1.0),"Offset",App::Prop_None,"Offset value");
ADD_PROPERTY_TYPE(Mode,(long(0)),"Offset",App::Prop_None,"Mode");
Mode.setEnums(ModeEnums);
+2 -2
View File
@@ -42,8 +42,8 @@ PROPERTY_SOURCE_ABSTRACT(Part::Boolean, Part::Feature)
Boolean::Boolean(void)
{
ADD_PROPERTY(Base,(0));
ADD_PROPERTY(Tool,(0));
ADD_PROPERTY(Base,(nullptr));
ADD_PROPERTY(Tool,(nullptr));
ADD_PROPERTY_TYPE(History,(ShapeHistory()), "Boolean", (App::PropertyType)
(App::Prop_Output|App::Prop_Transient|App::Prop_Hidden), "Shape history");
History.setSize(0);
+1 -1
View File
@@ -61,7 +61,7 @@ PROPERTY_SOURCE(Part::MultiCommon, Part::Feature)
MultiCommon::MultiCommon(void)
{
ADD_PROPERTY(Shapes,(0));
ADD_PROPERTY(Shapes,(nullptr));
Shapes.setSize(0);
ADD_PROPERTY_TYPE(History,(ShapeHistory()), "Boolean", (App::PropertyType)
(App::Prop_Output|App::Prop_Transient|App::Prop_Hidden), "Shape history");
+1 -1
View File
@@ -60,7 +60,7 @@ PROPERTY_SOURCE(Part::MultiFuse, Part::Feature)
MultiFuse::MultiFuse(void)
{
ADD_PROPERTY(Shapes,(0));
ADD_PROPERTY(Shapes,(nullptr));
Shapes.setSize(0);
ADD_PROPERTY_TYPE(History,(ShapeHistory()), "Boolean", (App::PropertyType)
(App::Prop_Output|App::Prop_Transient|App::Prop_Hidden), "Shape history");
+2 -2
View File
@@ -46,10 +46,10 @@ PROPERTY_SOURCE(Part::Revolution, Part::Feature)
Revolution::Revolution()
{
ADD_PROPERTY_TYPE(Source,(0), "Revolve", App::Prop_None, "Shape to revolve");
ADD_PROPERTY_TYPE(Source,(nullptr), "Revolve", App::Prop_None, "Shape to revolve");
ADD_PROPERTY_TYPE(Base,(Base::Vector3d(0.0,0.0,0.0)), "Revolve", App::Prop_None, "Base point of revolution axis");
ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0.0,0.0,1.0)), "Revolve", App::Prop_None, "Direction of revolution axis");
ADD_PROPERTY_TYPE(AxisLink,(0),"Revolve",App::Prop_None,"Link to edge to use as revolution axis.");
ADD_PROPERTY_TYPE(AxisLink,(nullptr),"Revolve",App::Prop_None,"Link to edge to use as revolution axis.");
ADD_PROPERTY_TYPE(Angle,(360.0), "Revolve", App::Prop_None, "Angle span of revolution. If angle is zero, and an arc is used for axis link, angle span of arc will be used.");
Angle.setConstraints(&angleRangeU);
ADD_PROPERTY_TYPE(Symmetric,(false),"Revolve",App::Prop_None,"Extend revolution symmetrically from the profile.");
@@ -129,7 +129,7 @@ Py::Object ArcOfCircle2dPy::getCircle(void) const
PyObject *ArcOfCircle2dPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ArcOfCircle2dPy::setCustomAttributes(const char* , PyObject *)
@@ -47,7 +47,7 @@ PyObject *ArcOfConic2dPy::PyMake(struct _typeobject *, PyObject *, PyObject *)
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'ArcOfConic2d'.");
return 0;
return nullptr;
}
// constructor method
@@ -113,7 +113,7 @@ void ArcOfConic2dPy::setYAxis(Py::Object arg)
PyObject *ArcOfConic2dPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ArcOfConic2dPy::setCustomAttributes(const char* , PyObject *)
@@ -119,7 +119,7 @@ Py::Object ArcOfEllipse2dPy::getEllipse(void) const
PyObject *ArcOfEllipse2dPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ArcOfEllipse2dPy::setCustomAttributes(const char* , PyObject *)
@@ -120,7 +120,7 @@ Py::Object ArcOfHyperbola2dPy::getHyperbola(void) const
PyObject *ArcOfHyperbola2dPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ArcOfHyperbola2dPy::setCustomAttributes(const char* , PyObject *)
@@ -109,7 +109,7 @@ Py::Object ArcOfParabola2dPy::getParabola(void) const
PyObject *ArcOfParabola2dPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int ArcOfParabola2dPy::setCustomAttributes(const char* , PyObject *)
+86 -86
View File
@@ -78,7 +78,7 @@ int BSplineCurve2dPy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyObject* BSplineCurve2dPy::isRational(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
Standard_Boolean val = curve->IsRational();
@@ -88,7 +88,7 @@ PyObject* BSplineCurve2dPy::isRational(PyObject *args)
PyObject* BSplineCurve2dPy::isPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
Standard_Boolean val = curve->IsPeriodic();
@@ -98,7 +98,7 @@ PyObject* BSplineCurve2dPy::isPeriodic(PyObject *args)
PyObject* BSplineCurve2dPy::isClosed(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
Standard_Boolean val = curve->IsClosed();
@@ -109,7 +109,7 @@ PyObject* BSplineCurve2dPy::increaseDegree(PyObject * args)
{
int degree;
if (!PyArg_ParseTuple(args, "i", &degree))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -118,7 +118,7 @@ PyObject* BSplineCurve2dPy::increaseDegree(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -127,7 +127,7 @@ PyObject* BSplineCurve2dPy::increaseMultiplicity(PyObject * args)
int mult=-1;
int start, end;
if (!PyArg_ParseTuple(args, "ii|i", &start, &end, &mult))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
@@ -144,7 +144,7 @@ PyObject* BSplineCurve2dPy::increaseMultiplicity(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -152,7 +152,7 @@ PyObject* BSplineCurve2dPy::incrementMultiplicity(PyObject * args)
{
int start, end, mult;
if (!PyArg_ParseTuple(args, "iii", &start, &end, &mult))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
@@ -161,7 +161,7 @@ PyObject* BSplineCurve2dPy::incrementMultiplicity(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -172,7 +172,7 @@ PyObject* BSplineCurve2dPy::insertKnot(PyObject * args)
double U, tol = 0.0;
int M=1;
if (!PyArg_ParseTuple(args, "d|idO!", &U, &M, &tol))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
@@ -181,7 +181,7 @@ PyObject* BSplineCurve2dPy::insertKnot(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -196,7 +196,7 @@ PyObject* BSplineCurve2dPy::insertKnots(PyObject * args)
if (!PyArg_ParseTuple(args, "OO|dO!", &obj1,
&obj2,
&tol, &PyBool_Type, &add))
return 0;
return nullptr;
try {
Py::Sequence knots(obj1);
@@ -221,7 +221,7 @@ PyObject* BSplineCurve2dPy::insertKnots(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
@@ -232,7 +232,7 @@ PyObject* BSplineCurve2dPy::removeKnot(PyObject * args)
double tol;
int Index,M;
if (!PyArg_ParseTuple(args, "iid", &Index, &M, &tol))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
@@ -242,7 +242,7 @@ PyObject* BSplineCurve2dPy::removeKnot(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -250,7 +250,7 @@ PyObject* BSplineCurve2dPy::segment(PyObject * args)
{
double u1,u2;
if (!PyArg_ParseTuple(args, "dd", &u1,&u2))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -259,7 +259,7 @@ PyObject* BSplineCurve2dPy::segment(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -268,7 +268,7 @@ PyObject* BSplineCurve2dPy::setKnot(PyObject * args)
int Index, M=-1;
double K;
if (!PyArg_ParseTuple(args, "id|i", &Index, &K, &M))
return 0;
return nullptr;
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -286,7 +286,7 @@ PyObject* BSplineCurve2dPy::getKnot(PyObject * args)
{
int Index;
if (!PyArg_ParseTuple(args, "i", &Index))
return 0;
return nullptr;
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -299,7 +299,7 @@ PyObject* BSplineCurve2dPy::setKnots(PyObject * args)
{
PyObject* obj;
if (!PyArg_ParseTuple(args, "O", &obj))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColStd_Array1OfReal k(1,list.size());
@@ -316,14 +316,14 @@ PyObject* BSplineCurve2dPy::setKnots(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurve2dPy::getKnots(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -337,7 +337,7 @@ PyObject* BSplineCurve2dPy::getKnots(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -347,7 +347,7 @@ PyObject* BSplineCurve2dPy::setPole(PyObject * args)
double weight=-1.0;
PyObject* p;
if (!PyArg_ParseTuple(args, "iO!|d", &index, Base::Vector2dPy::type_object(), &p, &weight))
return 0;
return nullptr;
Base::Vector2d vec = Py::toVector2d(p);
gp_Pnt2d pnt(vec.x, vec.y);
try {
@@ -361,7 +361,7 @@ PyObject* BSplineCurve2dPy::setPole(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -369,7 +369,7 @@ PyObject* BSplineCurve2dPy::getPole(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -380,14 +380,14 @@ PyObject* BSplineCurve2dPy::getPole(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurve2dPy::getPoles(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -403,14 +403,14 @@ PyObject* BSplineCurve2dPy::getPoles(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurve2dPy::getPolesAndWeights(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -433,7 +433,7 @@ PyObject* BSplineCurve2dPy::getPolesAndWeights(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -442,7 +442,7 @@ PyObject* BSplineCurve2dPy::setWeight(PyObject * args)
int index;
double weight;
if (!PyArg_ParseTuple(args, "id", &index,&weight))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -451,7 +451,7 @@ PyObject* BSplineCurve2dPy::setWeight(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -459,7 +459,7 @@ PyObject* BSplineCurve2dPy::getWeight(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -470,14 +470,14 @@ PyObject* BSplineCurve2dPy::getWeight(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurve2dPy::getWeights(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -491,7 +491,7 @@ PyObject* BSplineCurve2dPy::getWeights(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -499,7 +499,7 @@ PyObject* BSplineCurve2dPy::getResolution(PyObject * args)
{
double tol;
if (!PyArg_ParseTuple(args, "d", &tol))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -509,7 +509,7 @@ PyObject* BSplineCurve2dPy::getResolution(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -519,7 +519,7 @@ PyObject* BSplineCurve2dPy::movePoint(PyObject * args)
int index1, index2;
PyObject* pnt;
if (!PyArg_ParseTuple(args, "dO!ii", &U, Base::Vector2dPy::type_object(),&pnt, &index1, &index2))
return 0;
return nullptr;
try {
Base::Vector2d p = Py::toVector2d(pnt);
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
@@ -530,14 +530,14 @@ PyObject* BSplineCurve2dPy::movePoint(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurve2dPy::setNotPeriodic(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -546,14 +546,14 @@ PyObject* BSplineCurve2dPy::setNotPeriodic(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurve2dPy::setPeriodic(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -562,7 +562,7 @@ PyObject* BSplineCurve2dPy::setPeriodic(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -570,7 +570,7 @@ PyObject* BSplineCurve2dPy::setOrigin(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -579,7 +579,7 @@ PyObject* BSplineCurve2dPy::setOrigin(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -587,7 +587,7 @@ PyObject* BSplineCurve2dPy::getMultiplicity(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -597,14 +597,14 @@ PyObject* BSplineCurve2dPy::getMultiplicity(PyObject * args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurve2dPy::getMultiplicities(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -618,7 +618,7 @@ PyObject* BSplineCurve2dPy::getMultiplicities(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -708,7 +708,7 @@ PyObject* BSplineCurve2dPy::toBiArcs(PyObject * args)
{
double tolerance = 0.001;
if (!PyArg_ParseTuple(args, "d", &tolerance))
return 0;
return nullptr;
try {
Geom2dBSplineCurve* curve = getGeom2dBSplineCurvePtr();
std::list<Geometry2d*> arcs;
@@ -724,7 +724,7 @@ PyObject* BSplineCurve2dPy::toBiArcs(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -736,20 +736,20 @@ PyObject* BSplineCurve2dPy::approximate(PyObject *args, PyObject *kwds)
char* continuity = "C2";
double tol3d = 1e-3;
char* parType = "ChordLength";
PyObject* par = 0;
PyObject* par = nullptr;
double weight1 = 0;
double weight2 = 0;
double weight3 = 0;
static char* kwds_interp[] = {"Points", "DegMax", "Continuity", "Tolerance", "DegMin", "ParamType", "Parameters",
"LengthWeight", "CurvatureWeight", "TorsionWeight", NULL};
"LengthWeight", "CurvatureWeight", "TorsionWeight", nullptr};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|isdisOddd",kwds_interp,
&obj, &degMax,
&continuity, &tol3d, &degMin,
&parType, &par,
&weight1, &weight2, &weight3))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
@@ -797,7 +797,7 @@ PyObject* BSplineCurve2dPy::approximate(PyObject *args, PyObject *kwds)
}
else {
Standard_Failure::Raise("Smoothing approximation failed");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
@@ -818,7 +818,7 @@ PyObject* BSplineCurve2dPy::approximate(PyObject *args, PyObject *kwds)
}
else {
Standard_Failure::Raise("Approximation with parameters failed");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
@@ -839,12 +839,12 @@ PyObject* BSplineCurve2dPy::approximate(PyObject *args, PyObject *kwds)
}
else {
Standard_Failure::Raise("failed to approximate points");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -854,7 +854,7 @@ PyObject* BSplineCurve2dPy::getCardinalSplineTangents(PyObject *args, PyObject *
PyObject* tgs;
double parameter;
static char* kwds_interp1[] = {"Points", "Parameter", NULL};
static char* kwds_interp1[] = {"Points", "Parameter", nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "Od",kwds_interp1, &pts, &parameter)) {
Py::Sequence list(pts);
std::vector<gp_Pnt2d> interpPoints;
@@ -876,7 +876,7 @@ PyObject* BSplineCurve2dPy::getCardinalSplineTangents(PyObject *args, PyObject *
}
PyErr_Clear();
static char* kwds_interp2[] = {"Points", "Parameters", NULL};
static char* kwds_interp2[] = {"Points", "Parameters", nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "OO",kwds_interp2, &pts, &tgs)) {
Py::Sequence list(pts);
std::vector<gp_Pnt2d> interpPoints;
@@ -911,21 +911,21 @@ PyObject* BSplineCurve2dPy::getCardinalSplineTangents(PyObject *args, PyObject *
PyObject* BSplineCurve2dPy::interpolate(PyObject *args, PyObject *kwds)
{
PyObject* obj;
PyObject* par = 0;
PyObject* par = nullptr;
double tol3d = Precision::Approximation();
PyObject* periodic = Py_False;
PyObject* t1 = 0; PyObject* t2 = 0;
PyObject* ts = 0; PyObject* fl = 0;
PyObject* t1 = nullptr; PyObject* t2 = nullptr;
PyObject* ts = nullptr; PyObject* fl = nullptr;
static char* kwds_interp[] = {"Points", "PeriodicFlag", "Tolerance", "InitialTangent", "FinalTangent",
"Tangents", "TangentFlags", "Parameters", NULL};
"Tangents", "TangentFlags", "Parameters", nullptr};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O!dO!O!OOO",kwds_interp,
&obj, &PyBool_Type, &periodic, &tol3d,
Base::Vector2dPy::type_object(), &t1,
Base::Vector2dPy::type_object(), &t2,
&ts, &fl, &par))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
@@ -995,14 +995,14 @@ PyObject* BSplineCurve2dPy::interpolate(PyObject *args, PyObject *kwds)
}
else {
Standard_Failure::Raise("failed to interpolate points");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
catch (Standard_Failure& e) {
std::string err = e.GetMessageString();
if (err.empty()) err = e.DynamicType()->Name();
PyErr_SetString(PartExceptionOCCError, err.c_str());
return 0;
return nullptr;
}
}
@@ -1013,7 +1013,7 @@ PyObject* BSplineCurve2dPy::buildFromPoles(PyObject *args)
PyObject* periodic = Py_False;
PyObject* interpolate = Py_False;
if (!PyArg_ParseTuple(args, "O|O!iO!",&obj, &PyBool_Type, &periodic, &degree, &PyBool_Type, interpolate))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
TColgp_Array1OfPnt2d poles(1, list.size());
@@ -1053,7 +1053,7 @@ PyObject* BSplineCurve2dPy::buildFromPoles(PyObject *args)
}
else {
Standard_Failure::Raise("failed to create spline");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
else {
@@ -1073,19 +1073,19 @@ PyObject* BSplineCurve2dPy::buildFromPoles(PyObject *args)
}
else {
Standard_Failure::Raise("failed to create spline");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *keywds)
{
static char *kwlist[] = {"poles", "mults", "knots", "periodic", "degree", "weights", NULL};
static char *kwlist[] = {"poles", "mults", "knots", "periodic", "degree", "weights", nullptr};
PyObject* periodic = Py_False;
PyObject* poles = Py_None;
PyObject* mults = Py_None;
@@ -1099,7 +1099,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
&poles, &mults, &knots,
&PyBool_Type, &periodic,
&degree, &weights))
return 0;
return nullptr;
try {
// poles have to be present
Py::Sequence list(poles);
@@ -1107,7 +1107,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
number_of_poles = list.size();
if ((number_of_poles) < 2) {
Standard_Failure::Raise("need two or more poles");
return 0;
return nullptr;
}
TColgp_Array1OfPnt2d occpoles(1, number_of_poles);
Standard_Integer index = 1;
@@ -1120,7 +1120,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
number_of_knots = PyObject_Length(mults);
if (PyObject_Length(knots) != number_of_knots) {
Standard_Failure::Raise("number of knots and mults mismatch");
return 0;
return nullptr;
}
}
else {
@@ -1182,7 +1182,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
if (weights != Py_None) { //weights are given
if (PyObject_Length(weights) != number_of_poles) {
Standard_Failure::Raise("number of poles and weights mismatch");
return 0;
return nullptr;
} //complain about mismatch
Py::Sequence weightssq(weights);
Standard_Integer index = 1;
@@ -1200,7 +1200,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
if ((PyObject_IsTrue(periodic) && sum_of_mults != number_of_poles) ||
(PyObject_Not(periodic) && sum_of_mults - degree -1 != number_of_poles)) {
Standard_Failure::Raise("number of poles and sum of mults mismatch");
return(0);
return(nullptr);
}
Handle(Geom2d_BSplineCurve) spline = new Geom2d_BSplineCurve(occpoles,occweights,occknots,occmults,degree,
@@ -1211,20 +1211,20 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
}
else {
Standard_Failure::Raise("failed to create spline");
return 0; // goes to the catch block
return nullptr; // goes to the catch block
}
}
catch (const Standard_Failure& e) {
Standard_CString msg = e.GetMessageString();
PyErr_SetString(PartExceptionOCCError, msg ? msg : "");
return 0;
return nullptr;
}
}
PyObject* BSplineCurve2dPy::toBezier(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom2d_BSplineCurve) spline = Handle(Geom2d_BSplineCurve)::DownCast
(this->getGeom2dBSplineCurvePtr()->handle());
@@ -1244,7 +1244,7 @@ PyObject* BSplineCurve2dPy::join(PyObject *args)
{
PyObject* c;
if (!PyArg_ParseTuple(args, "O!", &BSplineCurve2dPy::Type, &c))
return 0;
return nullptr;
Geom2dBSplineCurve* curve1 = this->getGeom2dBSplineCurvePtr();
BSplineCurve2dPy* curve2 = static_cast<BSplineCurve2dPy*>(c);
@@ -1260,7 +1260,7 @@ PyObject* BSplineCurve2dPy::makeC1Continuous(PyObject *args)
{
double tol = Precision::Approximation();
if (!PyArg_ParseTuple(args, "|d", &tol))
return 0;
return nullptr;
try {
Geom2dBSplineCurve* spline = this->getGeom2dBSplineCurvePtr();
@@ -1271,13 +1271,13 @@ PyObject* BSplineCurve2dPy::makeC1Continuous(PyObject *args)
std::string err = e.GetMessageString();
if (err.empty()) err = e.DynamicType()->Name();
PyErr_SetString(PartExceptionOCCError, err.c_str());
return 0;
return nullptr;
}
}
PyObject* BSplineCurve2dPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int BSplineCurve2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+29 -29
View File
@@ -59,7 +59,7 @@ int BezierCurve2dPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* BezierCurve2dPy::isRational(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
Standard_Boolean val = curve->IsRational();
@@ -69,7 +69,7 @@ PyObject* BezierCurve2dPy::isRational(PyObject *args)
PyObject* BezierCurve2dPy::isPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
Standard_Boolean val = curve->IsPeriodic();
@@ -79,7 +79,7 @@ PyObject* BezierCurve2dPy::isPeriodic(PyObject *args)
PyObject* BezierCurve2dPy::isClosed(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
Standard_Boolean val = curve->IsClosed();
@@ -90,7 +90,7 @@ PyObject* BezierCurve2dPy::increase(PyObject * args)
{
int degree;
if (!PyArg_ParseTuple(args, "i", &degree))
return 0;
return nullptr;
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
curve->Increase(degree);
@@ -103,7 +103,7 @@ PyObject* BezierCurve2dPy::insertPoleAfter(PyObject * args)
double weight=1.0;
PyObject* p;
if (!PyArg_ParseTuple(args, "iO!|d", &index, Base::Vector2dPy::type_object(), &p, &weight))
return 0;
return nullptr;
Base::Vector2d vec = Py::toVector2d(p);
gp_Pnt2d pnt(vec.x, vec.y);
try {
@@ -114,7 +114,7 @@ PyObject* BezierCurve2dPy::insertPoleAfter(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -124,7 +124,7 @@ PyObject* BezierCurve2dPy::insertPoleBefore(PyObject * args)
double weight=1.0;
PyObject* p;
if (!PyArg_ParseTuple(args, "iO!|d", &index, Base::Vector2dPy::type_object(), &p, &weight))
return 0;
return nullptr;
Base::Vector2d vec = Py::toVector2d(p);
gp_Pnt2d pnt(vec.x, vec.y);
try {
@@ -135,7 +135,7 @@ PyObject* BezierCurve2dPy::insertPoleBefore(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -143,7 +143,7 @@ PyObject* BezierCurve2dPy::removePole(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -152,7 +152,7 @@ PyObject* BezierCurve2dPy::removePole(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -160,7 +160,7 @@ PyObject* BezierCurve2dPy::segment(PyObject * args)
{
double u1,u2;
if (!PyArg_ParseTuple(args, "dd", &u1,&u2))
return 0;
return nullptr;
try {
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -169,7 +169,7 @@ PyObject* BezierCurve2dPy::segment(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -179,7 +179,7 @@ PyObject* BezierCurve2dPy::setPole(PyObject * args)
double weight=-1.0;
PyObject* p;
if (!PyArg_ParseTuple(args, "iO!|d", &index, Base::Vector2dPy::type_object(), &p, &weight))
return 0;
return nullptr;
Base::Vector2d vec = Py::toVector2d(p);
gp_Pnt2d pnt(vec.x, vec.y);
try {
@@ -193,7 +193,7 @@ PyObject* BezierCurve2dPy::setPole(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -201,7 +201,7 @@ PyObject* BezierCurve2dPy::getPole(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -212,14 +212,14 @@ PyObject* BezierCurve2dPy::getPole(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BezierCurve2dPy::getPoles(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -235,7 +235,7 @@ PyObject* BezierCurve2dPy::getPoles(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -243,7 +243,7 @@ PyObject* BezierCurve2dPy::setPoles(PyObject * args)
{
PyObject* plist;
if (!PyArg_ParseTuple(args, "O", &plist))
return 0;
return nullptr;
try {
Py::Sequence list(plist);
TColgp_Array1OfPnt2d poles(1,list.size());
@@ -259,7 +259,7 @@ PyObject* BezierCurve2dPy::setPoles(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -268,7 +268,7 @@ PyObject* BezierCurve2dPy::setWeight(PyObject * args)
int index;
double weight;
if (!PyArg_ParseTuple(args, "id", &index,&weight))
return 0;
return nullptr;
try {
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -277,7 +277,7 @@ PyObject* BezierCurve2dPy::setWeight(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -285,7 +285,7 @@ PyObject* BezierCurve2dPy::getWeight(PyObject * args)
{
int index;
if (!PyArg_ParseTuple(args, "i", &index))
return 0;
return nullptr;
try {
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -296,14 +296,14 @@ PyObject* BezierCurve2dPy::getWeight(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* BezierCurve2dPy::getWeights(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -317,7 +317,7 @@ PyObject* BezierCurve2dPy::getWeights(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -325,7 +325,7 @@ PyObject* BezierCurve2dPy::getResolution(PyObject* args)
{
double tol;
if (!PyArg_ParseTuple(args, "d", &tol))
return 0;
return nullptr;
try {
Handle(Geom2d_BezierCurve) curve = Handle(Geom2d_BezierCurve)::DownCast
(getGeometry2dPtr()->handle());
@@ -335,7 +335,7 @@ PyObject* BezierCurve2dPy::getResolution(PyObject* args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
Py::Long BezierCurve2dPy::getDegree(void) const
@@ -377,7 +377,7 @@ Py::Object BezierCurve2dPy::getEndPoint(void) const
PyObject *BezierCurve2dPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int BezierCurve2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+6 -6
View File
@@ -56,7 +56,7 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
// circle and distance for offset
PyObject *pCirc;
double dist;
static char* keywords_cd[] = {"Circle","Distance",NULL};
static char* keywords_cd[] = {"Circle","Distance",nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(Circle2dPy::Type), &pCirc, &dist)) {
Circle2dPy* pcCircle = static_cast<Circle2dPy*>(pCirc);
Handle(Geom2d_Circle) circle = Handle(Geom2d_Circle)::DownCast
@@ -74,7 +74,7 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
// center and radius
PyObject *pV1, *pV2, *pV3;
static char* keywords_cnr[] = {"Center","Radius",NULL};
static char* keywords_cnr[] = {"Center","Radius",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cnr,
Base::Vector2dPy::type_object(), &pV1,
@@ -91,7 +91,7 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
static char* keywords_c[] = {"Circle",NULL};
static char* keywords_c[] = {"Circle",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(Circle2dPy::Type), &pCirc)) {
Circle2dPy* pcCircle = static_cast<Circle2dPy*>(pCirc);
@@ -103,7 +103,7 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
static char* keywords_ppp[] = {"Point1","Point2","Point3",NULL};
static char* keywords_ppp[] = {"Point1","Point2","Point3",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
Base::Vector2dPy::type_object(), &pV1,
@@ -126,7 +126,7 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
}
// default circle
static char* keywords_n[] = {NULL};
static char* keywords_n[] = {nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
Handle(Geom2d_Circle) circle = Handle(Geom2d_Circle)::DownCast(getGeom2dCirclePtr()->handle());
@@ -175,7 +175,7 @@ void Circle2dPy::setRadius(Py::Float arg)
PyObject *Circle2dPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int Circle2dPy::setCustomAttributes(const char* , PyObject *)
+2 -2
View File
@@ -45,7 +45,7 @@ PyObject *Conic2dPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'Conic2d'.");
return 0;
return nullptr;
}
// constructor method
@@ -106,7 +106,7 @@ void Conic2dPy::setYAxis(Py::Object arg)
PyObject *Conic2dPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int Conic2dPy::setCustomAttributes(const char* , PyObject *)
+60 -60
View File
@@ -89,7 +89,7 @@ PyObject *Curve2dPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'Curve2d'.");
return 0;
return nullptr;
}
// constructor method
@@ -108,11 +108,11 @@ PyObject* Curve2dPy::reverse(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
return 0;
return nullptr;
}
namespace Part {
@@ -187,7 +187,7 @@ PyObject* Curve2dPy::toShape(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -203,7 +203,7 @@ PyObject* Curve2dPy::toShape(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -223,7 +223,7 @@ PyObject* Curve2dPy::toShape(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -243,7 +243,7 @@ PyObject* Curve2dPy::toShape(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -262,7 +262,7 @@ PyObject* Curve2dPy::toShape(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -281,12 +281,12 @@ PyObject* Curve2dPy::toShape(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyErr_SetString(PyExc_TypeError, "empty parameter list, parameter range or surface expected");
return 0;
return nullptr;
}
PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
@@ -296,7 +296,7 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
Handle(Geom2d_Curve) c = Handle(Geom2d_Curve)::DownCast(g);
if (c.IsNull()) {
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
Geom2dAdaptor_Curve adapt(c);
@@ -304,7 +304,7 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
double last = adapt.LastParameter();
// use Number kwds
static char* kwds_numPoints[] = {"Number","First","Last",NULL};
static char* kwds_numPoints[] = {"Number","First","Last",nullptr};
PyErr_Clear();
int numPoints = -1;
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
@@ -324,12 +324,12 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
// use Distance kwds
static char* kwds_Distance[] = {"Distance","First","Last",NULL};
static char* kwds_Distance[] = {"Distance","First","Last",nullptr};
PyErr_Clear();
double distance = -1;
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
@@ -349,12 +349,12 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
// use Deflection kwds
static char* kwds_Deflection[] = {"Deflection","First","Last",NULL};
static char* kwds_Deflection[] = {"Deflection","First","Last",nullptr};
PyErr_Clear();
double deflection;
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
@@ -372,12 +372,12 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
// use TangentialDeflection kwds
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",NULL};
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",nullptr};
PyErr_Clear();
double angular;
double curvature;
@@ -397,12 +397,12 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
// use QuasiNumber kwds
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",NULL};
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",nullptr};
PyErr_Clear();
int quasiNumPoints;
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first, &last)) {
@@ -420,12 +420,12 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
// use QuasiDeflection kwds
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",NULL};
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",nullptr};
PyErr_Clear();
double quasiDeflection;
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection, &quasiDeflection, &first, &last)) {
@@ -442,17 +442,17 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
}
catch (const Base::Exception& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError,"Wrong arguments");
return 0;
return nullptr;
}
PyObject* Curve2dPy::length(PyObject *args)
@@ -465,7 +465,7 @@ PyObject* Curve2dPy::length(PyObject *args)
double v=c->LastParameter();
double t=Precision::Confusion();
if (!PyArg_ParseTuple(args, "|ddd", &u,&v,&t))
return 0;
return nullptr;
Geom2dAdaptor_Curve adapt(c);
double len = GCPnts_AbscissaPoint::Length(adapt,u,v,t);
return PyFloat_FromDouble(len);
@@ -473,11 +473,11 @@ PyObject* Curve2dPy::length(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* Curve2dPy::parameterAtDistance(PyObject *args)
@@ -489,7 +489,7 @@ PyObject* Curve2dPy::parameterAtDistance(PyObject *args)
double abscissa;
double u = 0;
if (!PyArg_ParseTuple(args, "d|d", &abscissa,&u))
return 0;
return nullptr;
Geom2dAdaptor_Curve adapt(c);
GCPnts_AbscissaPoint abscissaPoint(adapt,abscissa,u);
double parm = abscissaPoint.Parameter();
@@ -498,11 +498,11 @@ PyObject* Curve2dPy::parameterAtDistance(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* Curve2dPy::value(PyObject *args)
@@ -513,18 +513,18 @@ PyObject* Curve2dPy::value(PyObject *args)
if (!c.IsNull()) {
double u;
if (!PyArg_ParseTuple(args, "d", &u))
return 0;
return nullptr;
gp_Pnt2d p = c->Value(u);
return Py::new_reference_to(Base::Vector2dPy::create(p.X(), p.Y()));
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* Curve2dPy::tangent(PyObject *args)
@@ -535,7 +535,7 @@ PyObject* Curve2dPy::tangent(PyObject *args)
if (!c.IsNull()) {
double u;
if (!PyArg_ParseTuple(args, "d", &u))
return 0;
return nullptr;
gp_Dir2d dir;
Geom2dLProp_CLProps2d prop(c,u,2,Precision::Confusion());
if (prop.IsTangentDefined()) {
@@ -547,11 +547,11 @@ PyObject* Curve2dPy::tangent(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* Curve2dPy::normal(PyObject *args)
@@ -562,7 +562,7 @@ PyObject* Curve2dPy::normal(PyObject *args)
if (!c.IsNull()) {
double u;
if (!PyArg_ParseTuple(args, "d", &u))
return 0;
return nullptr;
gp_Dir2d dir;
Geom2dLProp_CLProps2d prop(c,u,2,Precision::Confusion());
prop.Normal(dir);
@@ -572,11 +572,11 @@ PyObject* Curve2dPy::normal(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* Curve2dPy::curvature(PyObject *args)
@@ -587,7 +587,7 @@ PyObject* Curve2dPy::curvature(PyObject *args)
if (!c.IsNull()) {
double u;
if (!PyArg_ParseTuple(args, "d", &u))
return 0;
return nullptr;
Geom2dLProp_CLProps2d prop(c,u,2,Precision::Confusion());
double C = prop.Curvature();
return Py::new_reference_to(Py::Float(C));
@@ -595,11 +595,11 @@ PyObject* Curve2dPy::curvature(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* Curve2dPy::centerOfCurvature(PyObject *args)
@@ -610,7 +610,7 @@ PyObject* Curve2dPy::centerOfCurvature(PyObject *args)
if (!c.IsNull()) {
double u;
if (!PyArg_ParseTuple(args, "d", &u))
return 0;
return nullptr;
Geom2dLProp_CLProps2d prop(c,u,2,Precision::Confusion());
gp_Pnt2d pnt ;
prop.CentreOfCurvature(pnt);
@@ -620,11 +620,11 @@ PyObject* Curve2dPy::centerOfCurvature(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* Curve2dPy::parameter(PyObject *args)
@@ -635,7 +635,7 @@ PyObject* Curve2dPy::parameter(PyObject *args)
if (!c.IsNull()) {
PyObject *p;
if (!PyArg_ParseTuple(args, "O!", Base::Vector2dPy::type_object(), &p))
return 0;
return nullptr;
Base::Vector2d v = Py::toVector2d(p);
gp_Pnt2d pnt(v.x,v.y);
Geom2dAPI_ProjectPointOnCurve ppc(pnt, c);
@@ -646,11 +646,11 @@ PyObject* Curve2dPy::parameter(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* Curve2dPy::toBSpline(PyObject * args)
@@ -663,7 +663,7 @@ PyObject* Curve2dPy::toBSpline(PyObject * args)
u=c->FirstParameter();
v=c->LastParameter();
if (!PyArg_ParseTuple(args, "|dd", &u,&v))
return 0;
return nullptr;
ShapeConstruct_Curve scc;
Handle(Geom2d_BSplineCurve) spline = scc.ConvertToBSpline(c, u, v, Precision::Confusion());
if (spline.IsNull())
@@ -673,11 +673,11 @@ PyObject* Curve2dPy::toBSpline(PyObject * args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* Curve2dPy::approximateBSpline(PyObject *args)
@@ -686,7 +686,7 @@ PyObject* Curve2dPy::approximateBSpline(PyObject *args)
int maxSegment, maxDegree;
char* order = "C2";
if (!PyArg_ParseTuple(args, "dii|s", &tolerance, &maxSegment, &maxDegree, &order))
return 0;
return nullptr;
GeomAbs_Shape absShape;
std::string str = order;
@@ -717,16 +717,16 @@ PyObject* Curve2dPy::approximateBSpline(PyObject *args)
std::stringstream str;
str << "Maximum error (" << approx.MaxError() << ") is outside tolerance";
PyErr_SetString(PyExc_RuntimeError, str.str().c_str());
return 0;
return nullptr;
}
else {
PyErr_SetString(PyExc_RuntimeError, "Approximation of curve failed");
return 0;
return nullptr;
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -790,7 +790,7 @@ Py::Float Curve2dPy::getLastParameter(void) const
PyObject *Curve2dPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int Curve2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -806,7 +806,7 @@ PyObject* Curve2dPy::intersectCC(PyObject *args)
PyObject *p;
double prec = Precision::Confusion();
if (!PyArg_ParseTuple(args, "O!|d", &(Part::Curve2dPy::Type), &p, &prec))
return 0;
return nullptr;
Handle(Geom2d_Curve) curve2 = Handle(Geom2d_Curve)::DownCast(static_cast<Geometry2dPy*>(p)->getGeometry2dPtr()->handle());
Py::List points;
@@ -842,9 +842,9 @@ PyObject* Curve2dPy::intersectCC(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PyExc_TypeError, "Geometry is not a curve");
return 0;
return nullptr;
}
+5 -5
View File
@@ -54,7 +54,7 @@ PyObject *Ellipse2dPy::PyMake(struct _typeobject *, PyObject *, PyObject *) //
// constructor method
int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds)
{
char* keywords_n[] = {NULL};
char* keywords_n[] = {nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle());
ellipse->SetMajorRadius(2.0);
@@ -62,7 +62,7 @@ int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_e[] = {"Ellipse",NULL};
char* keywords_e[] = {"Ellipse",nullptr};
PyErr_Clear();
PyObject *pElips;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(Ellipse2dPy::Type), &pElips)) {
@@ -75,7 +75,7 @@ int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_ssc[] = {"S1","S2","Center",NULL};
char* keywords_ssc[] = {"S1","S2","Center",nullptr};
PyErr_Clear();
PyObject *pV1, *pV2, *pV3;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
@@ -98,7 +98,7 @@ int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",NULL};
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",nullptr};
PyErr_Clear();
PyObject *pV;
double major, minor;
@@ -172,7 +172,7 @@ Py::Object Ellipse2dPy::getFocus2(void) const
PyObject *Ellipse2dPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int Ellipse2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+11 -11
View File
@@ -63,7 +63,7 @@ PyObject *Geometry2dPy::PyMake(struct _typeobject *, PyObject *, PyObject *) //
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'Geometry'.");
return 0;
return nullptr;
}
// constructor method
@@ -94,7 +94,7 @@ PyObject* Geometry2dPy::mirror(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "either a point (vector) or axis (vector, vector) must be given");
return 0;
return nullptr;
}
PyObject* Geometry2dPy::rotate(PyObject *args)
@@ -110,7 +110,7 @@ PyObject* Geometry2dPy::rotate(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "Vector2d and float expected");
return 0;
return nullptr;
}
PyObject* Geometry2dPy::scale(PyObject *args)
@@ -126,14 +126,14 @@ PyObject* Geometry2dPy::scale(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "Vector2d and float expected");
return 0;
return nullptr;
}
PyObject* Geometry2dPy::transform(PyObject *args)
{
PyObject* o;
if (!PyArg_ParseTuple(args, "O", &o))
return 0;
return nullptr;
Py::Sequence list(o);
double a11 = static_cast<double>(Py::Float(list.getItem(0)));
double a12 = static_cast<double>(Py::Float(list.getItem(1)));
@@ -168,23 +168,23 @@ PyObject* Geometry2dPy::translate(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "Vector2d expected");
return 0;
return nullptr;
}
PyObject* Geometry2dPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
Part::Geometry2d* geom = this->getGeometry2dPtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create copy of geometry");
return 0;
return nullptr;
}
Part::Geometry2dPy* geompy = static_cast<Part::Geometry2dPy*>(cpy);
@@ -200,7 +200,7 @@ PyObject* Geometry2dPy::copy(PyObject *args)
PyObject *Geometry2dPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int Geometry2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+5 -5
View File
@@ -54,7 +54,7 @@ PyObject *Hyperbola2dPy::PyMake(struct _typeobject *, PyObject *, PyObject *) /
// constructor method
int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds)
{
char* keywords_n[] = {NULL};
char* keywords_n[] = {nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle());
hyperbola->SetMajorRadius(2.0);
@@ -62,7 +62,7 @@ int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_e[] = {"Hyperbola",NULL};
char* keywords_e[] = {"Hyperbola",nullptr};
PyErr_Clear();
PyObject *pHypr;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(Hyperbola2dPy::Type), &pHypr)) {
@@ -75,7 +75,7 @@ int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_ssc[] = {"S1","S2","Center",NULL};
char* keywords_ssc[] = {"S1","S2","Center",nullptr};
PyErr_Clear();
PyObject *pV1, *pV2, *pV3;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
@@ -98,7 +98,7 @@ int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",NULL};
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",nullptr};
PyErr_Clear();
PyObject *pV;
double major, minor;
@@ -172,7 +172,7 @@ Py::Object Hyperbola2dPy::getFocus2(void) const
PyObject *Hyperbola2dPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int Hyperbola2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+1 -1
View File
@@ -219,7 +219,7 @@ void Line2dPy::setDirection(Py::Object arg)
PyObject *Line2dPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int Line2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -180,7 +180,7 @@ PyObject* Line2dSegmentPy::setParameterRange(PyObject *args)
{
double first, last;
if (!PyArg_ParseTuple(args, "dd", &first, &last))
return NULL;
return nullptr;
try {
Handle(Geom2d_TrimmedCurve) this_curve = Handle(Geom2d_TrimmedCurve)::DownCast
@@ -190,7 +190,7 @@ PyObject* Line2dSegmentPy::setParameterRange(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return NULL;
return nullptr;
}
Py_Return;
@@ -306,7 +306,7 @@ void Line2dSegmentPy::setEndPoint(Py::Object arg)
PyObject *Line2dSegmentPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int Line2dSegmentPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -129,7 +129,7 @@ void OffsetCurve2dPy::setBasisCurve(Py::Object arg)
PyObject *OffsetCurve2dPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int OffsetCurve2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+1 -1
View File
@@ -87,7 +87,7 @@ Py::Float Parabola2dPy::getParameter(void) const
PyObject *Parabola2dPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int Parabola2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -496,7 +496,7 @@ PyObject* BuildPlateSurfacePy::G2Error(PyObject *args)
PyObject *BuildPlateSurfacePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int BuildPlateSurfacePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -411,7 +411,7 @@ Py::Float CurveConstraintPy::getLength(void) const
PyObject *CurveConstraintPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int CurveConstraintPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -249,7 +249,7 @@ PyObject* PointConstraintPy::pnt2dOnSurf(PyObject *args)
PyObject *PointConstraintPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int PointConstraintPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+2 -2
View File
@@ -391,7 +391,7 @@ void Geometry::createNewTag()
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(0)));
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
@@ -5084,7 +5084,7 @@ GeomArcOfCircle *createFilletGeometry(const GeomLineSegment *lineSeg1, const Geo
Base::Vector3d corner;
if (!Part::find2DLinesIntersection(lineSeg1, lineSeg2, corner))
// Parallel Lines so return null pointer
return 0;
return nullptr;
Base::Vector3d dir1 = lineSeg1->getEndPoint() - lineSeg1->getStartPoint();
Base::Vector3d dir2 = lineSeg2->getEndPoint() - lineSeg2->getStartPoint();
+1 -1
View File
@@ -2296,7 +2296,7 @@ PyObject *Geom2dTrimmedCurve::getPyObject(void)
}
PyErr_SetString(PyExc_RuntimeError, "Unknown curve type");
return 0;
return nullptr;
}
// ------------------------------------------------------------------
@@ -95,7 +95,7 @@ void GeometryBoolExtensionPy::setValue(Py::Boolean value)
PyObject *GeometryBoolExtensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int GeometryBoolExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+84 -84
View File
@@ -94,7 +94,7 @@ PyObject *GeometryCurvePy::PyMake(struct _typeobject *, PyObject *, PyObject *)
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'GeometryCurve'.");
return 0;
return nullptr;
}
// constructor method
@@ -113,7 +113,7 @@ PyObject* GeometryCurvePy::toShape(PyObject *args)
u=c->FirstParameter();
v=c->LastParameter();
if (!PyArg_ParseTuple(args, "|dd", &u,&v))
return 0;
return nullptr;
BRepBuilderAPI_MakeEdge mkBuilder(c, u, v);
TopoDS_Shape sh = mkBuilder.Shape();
return new TopoShapeEdgePy(new TopoShape(sh));
@@ -121,11 +121,11 @@ PyObject* GeometryCurvePy::toShape(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
@@ -135,7 +135,7 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
if (c.IsNull()) {
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
GeomAdaptor_Curve adapt(c);
@@ -159,19 +159,19 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PyExc_TypeError, "Either int or float expected");
return 0;
return nullptr;
}
}
else {
// use Number kwds
static char* kwds_numPoints[] = {"Number","First","Last",NULL};
static char* kwds_numPoints[] = {"Number","First","Last",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
uniformAbscissaPoints = true;
}
else {
// use Abscissa kwds
static char* kwds_Distance[] = {"Distance","First","Last",NULL};
static char* kwds_Distance[] = {"Distance","First","Last",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
uniformAbscissaDistance = true;
@@ -198,12 +198,12 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
// use Deflection kwds
static char* kwds_Deflection[] = {"Deflection","First","Last",NULL};
static char* kwds_Deflection[] = {"Deflection","First","Last",nullptr};
PyErr_Clear();
double deflection;
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
@@ -220,12 +220,12 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
// use TangentialDeflection kwds
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",NULL};
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",nullptr};
PyErr_Clear();
double angular;
double curvature;
@@ -244,12 +244,12 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
// use QuasiNumber kwds
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",NULL};
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",nullptr};
PyErr_Clear();
int quasiNumPoints;
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first, &last)) {
@@ -266,12 +266,12 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
// use QuasiDeflection kwds
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",NULL};
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",nullptr};
PyErr_Clear();
double quasiDeflection;
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection, &quasiDeflection, &first, &last)) {
@@ -288,17 +288,17 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
return 0;
return nullptr;
}
}
}
catch (const Base::Exception& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError,"Wrong arguments");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::length(PyObject *args)
@@ -311,7 +311,7 @@ PyObject* GeometryCurvePy::length(PyObject *args)
double v=c->LastParameter();
double t=Precision::Confusion();
if (!PyArg_ParseTuple(args, "|ddd", &u,&v,&t))
return 0;
return nullptr;
GeomAdaptor_Curve adapt(c);
double len = GCPnts_AbscissaPoint::Length(adapt,u,v,t);
return PyFloat_FromDouble(len);
@@ -319,11 +319,11 @@ PyObject* GeometryCurvePy::length(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::parameterAtDistance(PyObject *args)
@@ -335,7 +335,7 @@ PyObject* GeometryCurvePy::parameterAtDistance(PyObject *args)
double abscissa;
double u = 0;
if (!PyArg_ParseTuple(args, "d|d", &abscissa,&u))
return 0;
return nullptr;
GeomAdaptor_Curve adapt(c);
GCPnts_AbscissaPoint abscissaPoint(adapt,abscissa,u);
double parm = abscissaPoint.Parameter();
@@ -344,11 +344,11 @@ PyObject* GeometryCurvePy::parameterAtDistance(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::getD0(PyObject *args)
@@ -489,18 +489,18 @@ PyObject* GeometryCurvePy::value(PyObject *args)
if (!c.IsNull()) {
double u;
if (!PyArg_ParseTuple(args, "d", &u))
return 0;
return nullptr;
gp_Pnt p = c->Value(u);
return new Base::VectorPy(Base::Vector3d(p.X(),p.Y(),p.Z()));
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::tangent(PyObject *args)
@@ -511,7 +511,7 @@ PyObject* GeometryCurvePy::tangent(PyObject *args)
if (!c.IsNull()) {
double u;
if (!PyArg_ParseTuple(args, "d", &u))
return 0;
return nullptr;
gp_Dir dir;
Py::Tuple tuple(1);
GeomLProp_CLProps prop(c,u,2,Precision::Confusion());
@@ -525,11 +525,11 @@ PyObject* GeometryCurvePy::tangent(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::normal(PyObject *args)
@@ -540,7 +540,7 @@ PyObject* GeometryCurvePy::normal(PyObject *args)
if (!c.IsNull()) {
double u;
if (!PyArg_ParseTuple(args, "d", &u))
return 0;
return nullptr;
gp_Dir dir;
GeomLProp_CLProps prop(c,u,2,Precision::Confusion());
prop.Normal(dir);
@@ -549,11 +549,11 @@ PyObject* GeometryCurvePy::normal(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::curvature(PyObject *args)
@@ -564,7 +564,7 @@ PyObject* GeometryCurvePy::curvature(PyObject *args)
if (!c.IsNull()) {
double u;
if (!PyArg_ParseTuple(args, "d", &u))
return 0;
return nullptr;
GeomLProp_CLProps prop(c,u,2,Precision::Confusion());
double C = prop.Curvature();
return Py::new_reference_to(Py::Float(C));
@@ -572,11 +572,11 @@ PyObject* GeometryCurvePy::curvature(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::centerOfCurvature(PyObject *args)
@@ -587,7 +587,7 @@ PyObject* GeometryCurvePy::centerOfCurvature(PyObject *args)
if (!c.IsNull()) {
double u;
if (!PyArg_ParseTuple(args, "d", &u))
return 0;
return nullptr;
GeomLProp_CLProps prop(c,u,2,Precision::Confusion());
gp_Pnt V ;
prop.CentreOfCurvature(V);
@@ -596,11 +596,11 @@ PyObject* GeometryCurvePy::centerOfCurvature(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::parameter(PyObject *args)
@@ -608,7 +608,7 @@ PyObject* GeometryCurvePy::parameter(PyObject *args)
try {
PyObject *p;
if (!PyArg_ParseTuple(args, "O!", &(Base::VectorPy::Type), &p))
return 0;
return nullptr;
Base::Vector3d v = Py::Vector(p, false).toVector();
double u;
@@ -618,18 +618,18 @@ PyObject* GeometryCurvePy::parameter(PyObject *args)
}
catch (Base::CADKernelError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::makeRuledSurface(PyObject *args)
{
PyObject* curve;
if (!PyArg_ParseTuple(args, "O!", &(Part::GeometryCurvePy::Type), &curve))
return 0;
return nullptr;
try {
Handle(Geom_Curve) aCrv1 = Handle(Geom_Curve)::DownCast(getGeometryPtr()->handle());
@@ -638,7 +638,7 @@ PyObject* GeometryCurvePy::makeRuledSurface(PyObject *args)
Handle(Geom_Surface) aSurf = GeomFill::Surface (aCrv1, aCrv2);
if (aSurf.IsNull()) {
PyErr_SetString(PartExceptionOCCError, "Failed to create ruled surface");
return 0;
return nullptr;
}
// check the result surface type
if (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
@@ -654,12 +654,12 @@ PyObject* GeometryCurvePy::makeRuledSurface(PyObject *args)
else {
PyErr_Format(PyExc_NotImplementedError, "Ruled surface is of type '%s'",
aSurf->DynamicType()->Name());
return 0;
return nullptr;
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -668,7 +668,7 @@ PyObject* GeometryCurvePy::intersect2d(PyObject *args)
PyObject *c,*p;
if (!PyArg_ParseTuple(args, "O!O!", &(Part::GeometryCurvePy::Type), &c,
&(Part::PlanePy::Type), &p))
return 0;
return nullptr;
try {
Handle(Geom_Curve) self = Handle(Geom_Curve)::DownCast(getGeometryPtr()->handle());
@@ -708,7 +708,7 @@ PyObject* GeometryCurvePy::intersect2d(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -722,18 +722,18 @@ PyObject* GeometryCurvePy::toBSpline(PyObject * args)
u=c->FirstParameter();
v=c->LastParameter();
if (!PyArg_ParseTuple(args, "|dd", &u,&v))
return 0;
return nullptr;
GeomBSplineCurve* spline = getGeomCurvePtr()->toBSpline(u, v);
return new BSplineCurvePy(spline);
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::toNurbs(PyObject * args)
@@ -746,18 +746,18 @@ PyObject* GeometryCurvePy::toNurbs(PyObject * args)
u=c->FirstParameter();
v=c->LastParameter();
if (!PyArg_ParseTuple(args, "|dd", &u,&v))
return 0;
return nullptr;
GeomBSplineCurve* spline = getGeomCurvePtr()->toNurbs(u, v);
return new BSplineCurvePy(spline);
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::trim(PyObject * args)
@@ -770,17 +770,17 @@ PyObject* GeometryCurvePy::trim(PyObject * args)
u=c->FirstParameter();
v=c->LastParameter();
if (!PyArg_ParseTuple(args, "|dd", &u,&v))
return 0;
return nullptr;
return Py::new_reference_to(makeTrimmedCurvePy(c,u,v));
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::approximateBSpline(PyObject *args)
@@ -789,7 +789,7 @@ PyObject* GeometryCurvePy::approximateBSpline(PyObject *args)
int maxSegment, maxDegree;
char* order = "C2";
if (!PyArg_ParseTuple(args, "dii|s", &tolerance, &maxSegment, &maxDegree, &order))
return 0;
return nullptr;
GeomAbs_Shape absShape;
std::string str = order;
@@ -820,16 +820,16 @@ PyObject* GeometryCurvePy::approximateBSpline(PyObject *args)
std::stringstream str;
str << "Maximum error (" << approx.MaxError() << ") is outside tolerance";
PyErr_SetString(PyExc_RuntimeError, str.str().c_str());
return 0;
return nullptr;
}
else {
PyErr_SetString(PyExc_RuntimeError, "Approximation of curve failed");
return 0;
return nullptr;
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -904,11 +904,11 @@ PyObject* GeometryCurvePy::continuityWith(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
return nullptr;
}
Py::String GeometryCurvePy::getContinuity(void) const
@@ -959,7 +959,7 @@ Py::Float GeometryCurvePy::getLastParameter(void) const
PyObject *GeometryCurvePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int GeometryCurvePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -977,12 +977,12 @@ PyObject* GeometryCurvePy::intersectCS(PyObject *args)
PyObject *p;
double prec = Precision::Confusion();
if (!PyArg_ParseTuple(args, "O!|d", &(Part::GeometrySurfacePy::Type), &p, &prec))
return 0;
return nullptr;
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast(static_cast<GeometryPy*>(p)->getGeometryPtr()->handle());
GeomAPI_IntCS intersector(curve, surf);
if (!intersector.IsDone()) {
PyErr_SetString(PyExc_RuntimeError, "Intersection of curve and surface failed");
return 0;
return nullptr;
}
Py::List points;
@@ -1004,11 +1004,11 @@ PyObject* GeometryCurvePy::intersectCS(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PyExc_TypeError, "Geometry is not a curve");
return 0;
return nullptr;
}
PyObject* GeometryCurvePy::intersectCC(PyObject *args)
@@ -1016,7 +1016,7 @@ PyObject* GeometryCurvePy::intersectCC(PyObject *args)
PyObject *p;
double prec = Precision::Confusion();
if (!PyArg_ParseTuple(args, "O!|d", &(Part::GeometryCurvePy::Type), &p, &prec))
return 0;
return nullptr;
GeomCurve* curve1 = getGeomCurvePtr();
GeomCurve* curve2 = static_cast<GeometryCurvePy*>(p)->getGeomCurvePtr();
@@ -1037,7 +1037,7 @@ PyObject* GeometryCurvePy::intersectCC(PyObject *args)
}
catch (Base::Exception& e) {
PyErr_SetString(PyExc_RuntimeError, e.what());
return 0;
return nullptr;
}
}
@@ -1059,16 +1059,16 @@ PyObject* GeometryCurvePy::intersect(PyObject *args)
if (PyArg_ParseTuple(args, "O!|d", &(Part::GeometrySurfacePy::Type), &p, &prec))
return intersectCS(args);
else
return 0;
return nullptr;
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PyExc_TypeError, "Geometry is not a curve");
return 0;
return nullptr;
}
Py::Object GeometryCurvePy::getRotation(void) const
@@ -1085,7 +1085,7 @@ Py::Object GeometryCurvePy::getRotation(void) const
PyObject* GeometryCurvePy::reverse(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
@@ -1093,7 +1093,7 @@ PyObject* GeometryCurvePy::reverse(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
Py_Return;
}
@@ -1102,7 +1102,7 @@ PyObject* GeometryCurvePy::reversedParameter(PyObject *args)
{
double p;
if (!PyArg_ParseTuple(args, "d", &p))
return 0;
return nullptr;
try {
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
@@ -1111,14 +1111,14 @@ PyObject* GeometryCurvePy::reversedParameter(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* GeometryCurvePy::isPeriodic(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
@@ -1127,14 +1127,14 @@ PyObject* GeometryCurvePy::isPeriodic(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* GeometryCurvePy::period(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
@@ -1143,14 +1143,14 @@ PyObject* GeometryCurvePy::period(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* GeometryCurvePy::isClosed(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
@@ -1159,6 +1159,6 @@ PyObject* GeometryCurvePy::isClosed(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -97,7 +97,7 @@ void GeometryDoubleExtensionPy::setValue(Py::Float value)
PyObject *GeometryDoubleExtensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int GeometryDoubleExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+6 -6
View File
@@ -40,7 +40,7 @@ PyObject *GeometryExtensionPy::PyMake(struct _typeobject *, PyObject *, PyObject
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'GeometryExtension'.");
return 0;
return nullptr;
}
// constructor method
@@ -52,17 +52,17 @@ int GeometryExtensionPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* GeometryExtensionPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
Part::GeometryExtension* ext = this->getGeometryExtensionPtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create copy of the geometry extension");
return 0;
return nullptr;
}
Part::GeometryExtensionPy* extpy = static_cast<Part::GeometryExtensionPy*>(cpy);
@@ -92,7 +92,7 @@ void GeometryExtensionPy::setName(Py::String arg)
PyObject *GeometryExtensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int GeometryExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -97,7 +97,7 @@ void GeometryIntExtensionPy::setValue(Py::Long value)
PyObject *GeometryIntExtensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int GeometryIntExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+37 -37
View File
@@ -68,7 +68,7 @@ PyObject *GeometryPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // P
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'Geometry'.");
return 0;
return nullptr;
}
// constructor method
@@ -97,14 +97,14 @@ PyObject* GeometryPy::mirror(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "either a point (vector) or axis (vector, vector) must be given");
return 0;
return nullptr;
}
PyObject* GeometryPy::rotate(PyObject *args)
{
PyObject* o;
if (!PyArg_ParseTuple(args, "O!", &(Base::PlacementPy::Type),&o))
return 0;
return nullptr;
Base::Placement* plm = static_cast<Base::PlacementPy*>(o)->getPlacementPtr();
getGeometryPtr()->rotate(*plm);
@@ -130,14 +130,14 @@ PyObject* GeometryPy::scale(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "either vector or tuple and float expected");
return 0;
return nullptr;
}
PyObject* GeometryPy::transform(PyObject *args)
{
PyObject* o;
if (!PyArg_ParseTuple(args, "O!", &(Base::MatrixPy::Type),&o))
return 0;
return nullptr;
Base::Matrix4D mat = static_cast<Base::MatrixPy*>(o)->value();
getGeometryPtr()->transform(mat);
Py_Return;
@@ -161,23 +161,23 @@ PyObject* GeometryPy::translate(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "either vector or tuple expected");
return 0;
return nullptr;
}
PyObject* GeometryPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
Part::Geometry* geom = this->getGeometryPtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create copy of geometry");
return 0;
return nullptr;
}
Part::GeometryPy* geompy = static_cast<Part::GeometryPy*>(cpy);
@@ -194,17 +194,17 @@ PyObject* GeometryPy::copy(PyObject *args)
PyObject* GeometryPy::clone(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
Part::Geometry* geom = this->getGeometryPtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create clone of geometry");
return 0;
return nullptr;
}
Part::GeometryPy* geompy = static_cast<Part::GeometryPy*>(cpy);
@@ -233,7 +233,7 @@ PyObject* GeometryPy::setExtension(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "A geometry extension object was expected");
return 0;
return nullptr;
}
PyObject* GeometryPy::getExtensionOfType(PyObject *args)
@@ -253,27 +253,27 @@ PyObject* GeometryPy::getExtensionOfType(PyObject *args)
}
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
catch(const std::bad_weak_ptr&) {
PyErr_SetString(PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
return nullptr;
}
catch(Base::NotImplementedError&) {
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not implement a Python counterpart.");
return 0;
return nullptr;
}
}
else
{
PyErr_SetString(PartExceptionOCCError, "Exception type does not exist");
return 0;
return nullptr;
}
}
PyErr_SetString(PartExceptionOCCError, "A string with the name of the geometry extension type was expected");
return 0;
return nullptr;
}
PyObject* GeometryPy::getExtensionOfName(PyObject *args)
@@ -290,21 +290,21 @@ PyObject* GeometryPy::getExtensionOfName(PyObject *args)
}
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
catch(const std::bad_weak_ptr&) {
PyErr_SetString(PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
return nullptr;
}
catch(Base::NotImplementedError&) {
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not implement a Python counterpart.");
return 0;
return nullptr;
}
}
PyErr_SetString(PartExceptionOCCError, "A string with the name of the geometry extension was expected");
return 0;
return nullptr;
}
PyObject* GeometryPy::hasExtensionOfType(PyObject *args)
@@ -320,19 +320,19 @@ PyObject* GeometryPy::hasExtensionOfType(PyObject *args)
}
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
}
else
{
PyErr_SetString(PartExceptionOCCError, "Exception type does not exist");
return 0;
return nullptr;
}
}
PyErr_SetString(PartExceptionOCCError, "A string with the type of the geometry extension was expected");
return 0;
return nullptr;
}
PyObject* GeometryPy::hasExtensionOfName(PyObject *args)
@@ -345,13 +345,13 @@ PyObject* GeometryPy::hasExtensionOfName(PyObject *args)
}
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
}
PyErr_SetString(PartExceptionOCCError, "A string with the type of the geometry extension was expected");
return 0;
return nullptr;
}
PyObject* GeometryPy::deleteExtensionOfType(PyObject *args)
@@ -368,19 +368,19 @@ PyObject* GeometryPy::deleteExtensionOfType(PyObject *args)
}
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
}
else
{
PyErr_SetString(PartExceptionOCCError, "Type does not exist");
return 0;
return nullptr;
}
}
PyErr_SetString(PartExceptionOCCError, "A string with a type object was expected");
return 0;
return nullptr;
}
PyObject* GeometryPy::deleteExtensionOfName(PyObject *args)
@@ -394,19 +394,19 @@ PyObject* GeometryPy::deleteExtensionOfName(PyObject *args)
}
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
}
PyErr_SetString(PartExceptionOCCError, "A string with the name of the extension was expected");
return 0;
return nullptr;
}
PyObject* GeometryPy::getExtensions(PyObject *args)
{
if (!PyArg_ParseTuple(args, "")){
PyErr_SetString(PartExceptionOCCError, "No arguments were expected");
return NULL;
return nullptr;
}
try {
@@ -435,7 +435,7 @@ PyObject* GeometryPy::getExtensions(PyObject *args)
}
catch(const Base::ValueError& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
}
@@ -448,7 +448,7 @@ Py::String GeometryPy::getTag(void) const
PyObject *GeometryPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int GeometryPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -98,7 +98,7 @@ void GeometryStringExtensionPy::setValue(Py::String value)
PyObject *GeometryStringExtensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int GeometryStringExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+55 -55
View File
@@ -117,7 +117,7 @@ PyObject *GeometrySurfacePy::PyMake(struct _typeobject *, PyObject *, PyObject *
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'GeometrySurface'.");
return 0;
return nullptr;
}
// constructor method
@@ -135,7 +135,7 @@ PyObject* GeometrySurfacePy::toShape(PyObject *args)
double u1,u2,v1,v2;
s->Bounds(u1,u2,v1,v2);
if (!PyArg_ParseTuple(args, "|dddd", &u1,&u2,&v1,&v2))
return 0;
return nullptr;
BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2
#if OCC_VERSION_HEX >= 0x060502
, Precision::Confusion()
@@ -148,11 +148,11 @@ PyObject* GeometrySurfacePy::toShape(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a surface");
return 0;
return nullptr;
}
PyObject* GeometrySurfacePy::toShell(PyObject *args, PyObject* kwds)
@@ -248,7 +248,7 @@ PyObject* GeometrySurfacePy::value(PyObject *args)
if (!s.IsNull()) {
double u,v;
if (!PyArg_ParseTuple(args, "dd", &u,&v))
return 0;
return nullptr;
gp_Pnt p = s->Value(u,v);
return new Base::VectorPy(Base::Vector3d(p.X(),p.Y(),p.Z()));
}
@@ -256,11 +256,11 @@ PyObject* GeometrySurfacePy::value(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a surface");
return 0;
return nullptr;
}
PyObject* GeometrySurfacePy::tangent(PyObject *args)
@@ -271,7 +271,7 @@ PyObject* GeometrySurfacePy::tangent(PyObject *args)
if (!s.IsNull()) {
double u,v;
if (!PyArg_ParseTuple(args, "dd", &u,&v))
return 0;
return nullptr;
gp_Dir dir;
Py::Tuple tuple(2);
GeomLProp_SLProps prop(s,u,v,2,Precision::Confusion());
@@ -290,11 +290,11 @@ PyObject* GeometrySurfacePy::tangent(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a surface");
return 0;
return nullptr;
}
PyObject* GeometrySurfacePy::normal(PyObject *args)
@@ -304,31 +304,31 @@ PyObject* GeometrySurfacePy::normal(PyObject *args)
if (s) {
double u,v;
if (!PyArg_ParseTuple(args, "dd", &u,&v))
return 0;
return nullptr;
gp_Dir d;
if (s->normal(u,v,d)) {
return new Base::VectorPy(Base::Vector3d(d.X(),d.Y(),d.Z()));
}
else {
PyErr_SetString(PyExc_RuntimeError, "normal at this point is not defined");
return 0;
return nullptr;
}
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a surface");
return 0;
return nullptr;
}
PyObject* GeometrySurfacePy::projectPoint(PyObject *args, PyObject* kwds)
{
PyObject* v;
const char* meth = "NearestPoint";
static char *kwlist[] = {"Point", "Method", NULL};
static char *kwlist[] = {"Point", "Method", nullptr};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|s", kwlist,
&Base::VectorPy::Type, &v, &meth))
return nullptr;
@@ -408,7 +408,7 @@ PyObject* GeometrySurfacePy::isUmbillic(PyObject *args)
if (s) {
double u,v;
if (!PyArg_ParseTuple(args, "dd", &u,&v))
return 0;
return nullptr;
bool val = s->isUmbillic(u,v);
return PyBool_FromLong(val ? 1 : 0);
@@ -417,11 +417,11 @@ PyObject* GeometrySurfacePy::isUmbillic(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a surface");
return 0;
return nullptr;
}
PyObject* GeometrySurfacePy::curvatureDirections(PyObject *args)
@@ -431,7 +431,7 @@ PyObject* GeometrySurfacePy::curvatureDirections(PyObject *args)
if (s) {
double u,v;
if (!PyArg_ParseTuple(args, "dd", &u,&v))
return 0;
return nullptr;
gp_Dir maxd, mind;
s->curvatureDirections(u,v,maxd,mind);
@@ -445,11 +445,11 @@ PyObject* GeometrySurfacePy::curvatureDirections(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a surface");
return 0;
return nullptr;
}
PyObject* GeometrySurfacePy::curvature(PyObject *args)
@@ -460,7 +460,7 @@ PyObject* GeometrySurfacePy::curvature(PyObject *args)
double u,v;
char* type;
if (!PyArg_ParseTuple(args, "dds", &u,&v,&type))
return 0;
return nullptr;
GeomSurface::Curvature t;
if (strcmp(type,"Max") == 0) {
@@ -477,7 +477,7 @@ PyObject* GeometrySurfacePy::curvature(PyObject *args)
}
else {
PyErr_SetString(PyExc_ValueError, "unknown curvature type");
return 0;
return nullptr;
}
double c = s->curvature(u,v,t);
@@ -487,11 +487,11 @@ PyObject* GeometrySurfacePy::curvature(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a surface");
return 0;
return nullptr;
}
PyObject* GeometrySurfacePy::isPlanar(PyObject *args)
@@ -502,7 +502,7 @@ PyObject* GeometrySurfacePy::isPlanar(PyObject *args)
if (!surf.IsNull()) {
double tol = Precision::Confusion();
if (!PyArg_ParseTuple(args, "|d", &tol))
return 0;
return nullptr;
GeomLib_IsPlanarSurface check(surf, tol);
Standard_Boolean val = check.IsPlanar();
@@ -511,11 +511,11 @@ PyObject* GeometrySurfacePy::isPlanar(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a surface");
return 0;
return nullptr;
}
PyObject* GeometrySurfacePy::parameter(PyObject *args)
@@ -527,7 +527,7 @@ PyObject* GeometrySurfacePy::parameter(PyObject *args)
PyObject *p;
double prec = Precision::Confusion();
if (!PyArg_ParseTuple(args, "O!|d", &(Base::VectorPy::Type), &p, &prec))
return 0;
return nullptr;
Base::Vector3d v = Py::Vector(p, false).toVector();
gp_Pnt pnt(v.x,v.y,v.z);
ShapeAnalysis_Surface as(surf);
@@ -541,17 +541,17 @@ PyObject* GeometrySurfacePy::parameter(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a surface");
return 0;
return nullptr;
}
PyObject* GeometrySurfacePy::bounds(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_Surface) surf = Handle(Geom_Surface)
::DownCast(getGeometryPtr()->handle());
@@ -569,7 +569,7 @@ PyObject* GeometrySurfacePy::uIso(PyObject * args)
{
double v;
if (!PyArg_ParseTuple(args, "d", &v))
return 0;
return nullptr;
try {
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast
@@ -577,7 +577,7 @@ PyObject* GeometrySurfacePy::uIso(PyObject * args)
Handle(Geom_Curve) c = surf->UIso(v);
if (c.IsNull()) {
PyErr_SetString(PyExc_RuntimeError, "failed to create u iso curve");
return 0;
return nullptr;
}
if (c->IsKind(STANDARD_TYPE(Geom_Line))) {
@@ -595,7 +595,7 @@ PyObject* GeometrySurfacePy::uIso(PyObject * args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -603,7 +603,7 @@ PyObject* GeometrySurfacePy::vIso(PyObject * args)
{
double v;
if (!PyArg_ParseTuple(args, "d", &v))
return 0;
return nullptr;
try {
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast
@@ -611,7 +611,7 @@ PyObject* GeometrySurfacePy::vIso(PyObject * args)
Handle(Geom_Curve) c = surf->VIso(v);
if (c.IsNull()) {
PyErr_SetString(PyExc_RuntimeError, "failed to create v iso curve");
return 0;
return nullptr;
}
if (c->IsKind(STANDARD_TYPE(Geom_Line))) {
@@ -629,14 +629,14 @@ PyObject* GeometrySurfacePy::vIso(PyObject * args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* GeometrySurfacePy::isUPeriodic(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast
(getGeometryPtr()->handle());
@@ -647,7 +647,7 @@ PyObject* GeometrySurfacePy::isUPeriodic(PyObject * args)
PyObject* GeometrySurfacePy::isVPeriodic(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast
(getGeometryPtr()->handle());
@@ -658,7 +658,7 @@ PyObject* GeometrySurfacePy::isVPeriodic(PyObject * args)
PyObject* GeometrySurfacePy::isUClosed(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast
(getGeometryPtr()->handle());
@@ -669,7 +669,7 @@ PyObject* GeometrySurfacePy::isUClosed(PyObject * args)
PyObject* GeometrySurfacePy::isVClosed(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast
(getGeometryPtr()->handle());
@@ -680,7 +680,7 @@ PyObject* GeometrySurfacePy::isVClosed(PyObject * args)
PyObject* GeometrySurfacePy::UPeriod(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast
@@ -691,14 +691,14 @@ PyObject* GeometrySurfacePy::UPeriod(PyObject * args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* GeometrySurfacePy::VPeriod(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast
@@ -709,7 +709,7 @@ PyObject* GeometrySurfacePy::VPeriod(PyObject * args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -814,12 +814,12 @@ PyObject* GeometrySurfacePy::toBSpline(PyObject * args, PyObject * kwds)
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
}
return 0;
return nullptr;
}
PyObject *GeometrySurfacePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int GeometrySurfacePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -837,12 +837,12 @@ PyObject* GeometrySurfacePy::intersectSS(PyObject *args)
PyObject *p;
double prec = Precision::Confusion();
if (!PyArg_ParseTuple(args, "O!|d", &(Part::GeometrySurfacePy::Type), &p, &prec))
return 0;
return nullptr;
Handle(Geom_Surface) surf2 = Handle(Geom_Surface)::DownCast(static_cast<GeometryPy*>(p)->getGeometryPtr()->handle());
GeomAPI_IntSS intersector(surf1, surf2, prec);
if (!intersector.IsDone()) {
PyErr_SetString(PyExc_RuntimeError, "Intersection of surfaces failed");
return 0;
return nullptr;
}
Py::List result;
@@ -857,11 +857,11 @@ PyObject* GeometrySurfacePy::intersectSS(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PyExc_TypeError, "intersectSS(): Geometry is not a surface");
return 0;
return nullptr;
}
// General intersection function
@@ -888,18 +888,18 @@ PyObject* GeometrySurfacePy::intersect(PyObject *args)
PyTuple_SetItem(t, 1, PyFloat_FromDouble(prec));
return curve->intersectCS(t);
} else {
return 0;
return nullptr;
}
}
}
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PyExc_TypeError, "intersect(): Geometry is not a surface");
return 0;
return nullptr;
}
Py::Object GeometrySurfacePy::getRotation(void) const
+5 -5
View File
@@ -55,7 +55,7 @@ PyObject *HyperbolaPy::PyMake(struct _typeobject *, PyObject *, PyObject *) //
// constructor method
int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
{
char* keywords_n[] = {NULL};
char* keywords_n[] = {nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
hyperbola->SetMajorRadius(2.0);
@@ -63,7 +63,7 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_e[] = {"Hyperbola",NULL};
char* keywords_e[] = {"Hyperbola",nullptr};
PyErr_Clear();
PyObject *pHypr;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(HyperbolaPy::Type), &pHypr)) {
@@ -76,7 +76,7 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_ssc[] = {"S1","S2","Center",NULL};
char* keywords_ssc[] = {"S1","S2","Center",nullptr};
PyErr_Clear();
PyObject *pV1, *pV2, *pV3;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
@@ -99,7 +99,7 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",NULL};
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",nullptr};
PyErr_Clear();
PyObject *pV;
double major, minor;
@@ -173,7 +173,7 @@ Py::Object HyperbolaPy::getFocus2(void) const
PyObject *HyperbolaPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int HyperbolaPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+1 -1
View File
@@ -224,7 +224,7 @@ void LinePy::setDirection(Py::Object arg)
PyObject *LinePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int LinePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+3 -3
View File
@@ -188,7 +188,7 @@ PyObject* LineSegmentPy::setParameterRange(PyObject *args)
{
double first, last;
if (!PyArg_ParseTuple(args, "dd", &first, &last))
return NULL;
return nullptr;
try {
Handle(Geom_TrimmedCurve) this_curve = Handle(Geom_TrimmedCurve)::DownCast
@@ -197,7 +197,7 @@ PyObject* LineSegmentPy::setParameterRange(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return NULL;
return nullptr;
}
Py_Return;
@@ -317,7 +317,7 @@ void LineSegmentPy::setEndPoint(Py::Object arg)
PyObject *LineSegmentPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int LineSegmentPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+1 -1
View File
@@ -153,7 +153,7 @@ void OffsetCurvePy::setBasisCurve(Py::Object arg)
PyObject *OffsetCurvePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int OffsetCurvePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+1 -1
View File
@@ -127,7 +127,7 @@ void OffsetSurfacePy::setBasisSurface(Py::Object arg)
PyObject *OffsetSurfacePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int OffsetSurfacePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+6 -6
View File
@@ -55,14 +55,14 @@ PyObject *ParabolaPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // P
// constructor method
int ParabolaPy::PyInit(PyObject* args, PyObject* kwds)
{
char* keywords_n[] = {NULL};
char* keywords_n[] = {nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
Handle(Geom_Parabola) parabola = Handle(Geom_Parabola)::DownCast(getGeomParabolaPtr()->handle());
parabola->SetFocal(1.0);
return 0;
}
char* keywords_e[] = {"Parabola",NULL};
char* keywords_e[] = {"Parabola",nullptr};
PyErr_Clear();
PyObject *pParab;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(ParabolaPy::Type), &pParab)) {
@@ -75,7 +75,7 @@ int ParabolaPy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
char* keywords_ssc[] = {"Focus","Center","Normal",NULL};
char* keywords_ssc[] = {"Focus","Center","Normal",nullptr};
PyErr_Clear();
PyObject *pV1, *pV2, *pV3;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
@@ -121,7 +121,7 @@ PyObject* ParabolaPy::compute(PyObject *args)
&Base::VectorPy::Type,&p1,
&Base::VectorPy::Type,&p2,
&Base::VectorPy::Type,&p3))
return 0;
return nullptr;
Base::Vector3d v1 = Py::Vector(p1,false).toVector();
Base::Vector3d v2 = Py::Vector(p2,false).toVector();
Base::Vector3d v3 = Py::Vector(p3,false).toVector();
@@ -129,7 +129,7 @@ PyObject* ParabolaPy::compute(PyObject *args)
double zValue = v1.z;
if (fabs(c.Length()) < 0.0001) {
PyErr_SetString(PartExceptionOCCError, "Points are collinear");
return 0;
return nullptr;
}
Base::Matrix4D m;
@@ -187,7 +187,7 @@ Py::Float ParabolaPy::getParameter(void) const
PyObject *ParabolaPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int ParabolaPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+1 -1
View File
@@ -41,7 +41,7 @@ std::string Part2DObjectPy::representation(void) const
PyObject *Part2DObjectPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int Part2DObjectPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+18 -18
View File
@@ -201,7 +201,7 @@ App::DocumentObject *Feature::getSubObject(const char *subname,
if (subname)
str << '.' << subname;
FC_LOG(str.str());
return 0;
return nullptr;
}
}
@@ -240,7 +240,7 @@ struct ShapeCache {
return;
if(strcmp(propName,"Shape")==0
|| strcmp(propName,"Group")==0
|| strstr(propName,"Touched")!=0)
|| strstr(propName,"Touched")!=nullptr)
slotClear(obj);
}
@@ -256,7 +256,7 @@ struct ShapeCache {
}
}
bool getShape(const App::DocumentObject *obj, TopoShape &shape, const char *subname=0) {
bool getShape(const App::DocumentObject *obj, TopoShape &shape, const char *subname=nullptr) {
init();
auto &entry = cache[obj->getDocument()];
if(!subname) subname = "";
@@ -268,7 +268,7 @@ struct ShapeCache {
return false;
}
void setShape(const App::DocumentObject *obj, const TopoShape &shape, const char *subname=0) {
void setShape(const App::DocumentObject *obj, const TopoShape &shape, const char *subname=nullptr) {
init();
if(!subname) subname = "";
cache[obj->getDocument()][std::make_pair(obj,std::string(subname))] = shape;
@@ -289,9 +289,9 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna
if(!obj) return shape;
PyObject *pyobj = 0;
PyObject *pyobj = nullptr;
Base::Matrix4D mat;
if(powner) *powner = 0;
if(powner) *powner = nullptr;
std::string _subname;
auto subelement = Data::ComplexGeoData::findElementName(subname);
@@ -311,14 +311,14 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna
}
}
App::DocumentObject *linked = 0;
App::DocumentObject *owner = 0;
App::DocumentObject *linked = nullptr;
App::DocumentObject *owner = nullptr;
Base::Matrix4D linkMat;
// App::StringHasherRef hasher;
// long tag;
{
Base::PyGILStateLocker lock;
owner = obj->getSubObject(subname,shape.isNull()?&pyobj:0,&mat,false);
owner = obj->getSubObject(subname,shape.isNull()?&pyobj:nullptr,&mat,false);
if(!owner)
return shape;
// tag = owner->getID();
@@ -387,7 +387,7 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna
{
// if there is a linked object, and there is no child cache (which is used
// for special handling of plain group), obtain shape from the linked object
shape = Feature::getTopoShape(linked,0,false,0,0,false,false);
shape = Feature::getTopoShape(linked,nullptr,false,nullptr,nullptr,false,false);
if(shape.isNull())
return shape;
if(owner==obj)
@@ -413,7 +413,7 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna
if(link && link->getElementCountValue()) {
linked = link->getTrueLinkedObject(false,&baseMat);
if(linked && linked!=owner) {
baseShape = Feature::getTopoShape(linked,0,false,0,0,false,false);
baseShape = Feature::getTopoShape(linked,nullptr,false,nullptr,nullptr,false,false);
// if(!link->getShowElementValue())
// baseShape.reTagElementMap(owner->getID(),owner->getDocument()->getStringHasher());
}
@@ -422,13 +422,13 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna
if(sub.empty()) continue;
int visible;
std::string childName;
App::DocumentObject *parent=0;
App::DocumentObject *parent=nullptr;
Base::Matrix4D mat = baseMat;
App::DocumentObject *subObj=0;
App::DocumentObject *subObj=nullptr;
if(sub.find('.')==std::string::npos)
visible = 1;
else {
subObj = owner->resolve(sub.c_str(), &parent, &childName,0,0,&mat,false);
subObj = owner->resolve(sub.c_str(), &parent, &childName,nullptr,nullptr,&mat,false);
if(!parent || !subObj)
continue;
if(linkStack.size()
@@ -442,7 +442,7 @@ static TopoShape _getTopoShape(const App::DocumentObject *obj, const char *subna
continue;
TopoShape shape;
if(!subObj || baseShape.isNull()) {
shape = _getTopoShape(owner,sub.c_str(),true,0,&subObj,false,false,linkStack);
shape = _getTopoShape(owner,sub.c_str(),true,nullptr,&subObj,false,false,linkStack);
if(shape.isNull())
continue;
if(visible<0 && subObj && !subObj->Visibility.getValue())
@@ -510,7 +510,7 @@ TopoShape Feature::getTopoShape(const App::DocumentObject *obj, const char *subn
if(pmat)
topMat = *pmat;
if(transform)
obj->getSubObject(0,0,&topMat);
obj->getSubObject(nullptr,nullptr,&topMat);
// Apply the top level transformation
if(!shape.isNull())
@@ -526,7 +526,7 @@ TopoShape Feature::getTopoShape(const App::DocumentObject *obj, const char *subn
App::DocumentObject *Feature::getShapeOwner(const App::DocumentObject *obj, const char *subname)
{
if(!obj) return 0;
if(!obj) return nullptr;
auto owner = obj->getSubObject(subname);
if(owner) {
auto linked = owner->getLinkedObject(true);
@@ -669,7 +669,7 @@ PROPERTY_SOURCE(Part::FilletBase, Part::Feature)
FilletBase::FilletBase()
{
ADD_PROPERTY(Base,(0));
ADD_PROPERTY(Base,(nullptr));
ADD_PROPERTY(Edges,(0,0,0));
Edges.setSize(0);
}
+6 -6
View File
@@ -93,19 +93,19 @@ public:
* if pmat already include obj's transformation matrix.
*/
static TopoDS_Shape getShape(const App::DocumentObject *obj,
const char *subname=0, bool needSubElement=false, Base::Matrix4D *pmat=0,
App::DocumentObject **owner=0, bool resolveLink=true, bool transform=true);
const char *subname=nullptr, bool needSubElement=false, Base::Matrix4D *pmat=nullptr,
App::DocumentObject **owner=nullptr, bool resolveLink=true, bool transform=true);
static TopoShape getTopoShape(const App::DocumentObject *obj,
const char *subname=0, bool needSubElement=false, Base::Matrix4D *pmat=0,
App::DocumentObject **owner=0, bool resolveLink=true, bool transform=true,
const char *subname=nullptr, bool needSubElement=false, Base::Matrix4D *pmat=nullptr,
App::DocumentObject **owner=nullptr, bool resolveLink=true, bool transform=true,
bool noElementMap=false);
static void clearShapeCache();
static App::DocumentObject *getShapeOwner(const App::DocumentObject *obj, const char *subname=0);
static App::DocumentObject *getShapeOwner(const App::DocumentObject *obj, const char *subname=nullptr);
static bool hasShapeOwner(const App::DocumentObject *obj, const char *subname=0) {
static bool hasShapeOwner(const App::DocumentObject *obj, const char *subname=nullptr) {
auto owner = getShapeOwner(obj,subname);
return owner && owner->isDerivedFrom(getClassTypeId());
}
+1 -1
View File
@@ -39,7 +39,7 @@ std::string PartFeaturePy::representation(void) const
PyObject *PartFeaturePy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int PartFeaturePy::setCustomAttributes(const char* , PyObject *)
+1 -1
View File
@@ -49,7 +49,7 @@ PROPERTY_SOURCE(Part::FeatureReference, App::GeoFeature)
FeatureReference::FeatureReference(void)
{
ADD_PROPERTY(Reference, (0));
ADD_PROPERTY(Reference, (nullptr));
}
FeatureReference::~FeatureReference()
+12 -12
View File
@@ -52,12 +52,12 @@ using namespace Part;
PROPERTY_SOURCE(Part::RuledSurface, Part::Feature)
const char* RuledSurface::OrientationEnums[] = {"Automatic","Forward","Reversed",NULL};
const char* RuledSurface::OrientationEnums[] = {"Automatic","Forward","Reversed",nullptr};
RuledSurface::RuledSurface()
{
ADD_PROPERTY_TYPE(Curve1,(0),"Ruled Surface",App::Prop_None,"Curve of ruled surface");
ADD_PROPERTY_TYPE(Curve2,(0),"Ruled Surface",App::Prop_None,"Curve of ruled surface");
ADD_PROPERTY_TYPE(Curve1,(nullptr),"Ruled Surface",App::Prop_None,"Curve of ruled surface");
ADD_PROPERTY_TYPE(Curve2,(nullptr),"Ruled Surface",App::Prop_None,"Curve of ruled surface");
ADD_PROPERTY_TYPE(Orientation,((long)0),"Ruled Surface",App::Prop_None,"Orientation of ruled surface");
Orientation.setEnums(OrientationEnums);
}
@@ -266,7 +266,7 @@ PROPERTY_SOURCE(Part::Loft, Part::Feature)
Loft::Loft()
{
ADD_PROPERTY_TYPE(Sections,(0),"Loft",App::Prop_None,"List of sections");
ADD_PROPERTY_TYPE(Sections,(nullptr),"Loft",App::Prop_None,"List of sections");
Sections.setSize(0);
ADD_PROPERTY_TYPE(Solid,(false),"Loft",App::Prop_None,"Create solid");
ADD_PROPERTY_TYPE(Ruled,(false),"Loft",App::Prop_None,"Ruled surface");
@@ -376,15 +376,15 @@ App::DocumentObjectExecReturn *Loft::execute(void)
// ----------------------------------------------------------------------------
const char* Part::Sweep::TransitionEnums[]= {"Transformed","Right corner", "Round corner",NULL};
const char* Part::Sweep::TransitionEnums[]= {"Transformed","Right corner", "Round corner",nullptr};
PROPERTY_SOURCE(Part::Sweep, Part::Feature)
Sweep::Sweep()
{
ADD_PROPERTY_TYPE(Sections,(0),"Sweep",App::Prop_None,"List of sections");
ADD_PROPERTY_TYPE(Sections,(nullptr),"Sweep",App::Prop_None,"List of sections");
Sections.setSize(0);
ADD_PROPERTY_TYPE(Spine,(0),"Sweep",App::Prop_None,"Path to sweep along");
ADD_PROPERTY_TYPE(Spine,(nullptr),"Sweep",App::Prop_None,"Path to sweep along");
ADD_PROPERTY_TYPE(Solid,(false),"Sweep",App::Prop_None,"Create solid");
ADD_PROPERTY_TYPE(Frenet,(false),"Sweep",App::Prop_None,"Frenet");
ADD_PROPERTY_TYPE(Transition,(long(1)),"Sweep",App::Prop_None,"Transition mode");
@@ -581,14 +581,14 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
// ----------------------------------------------------------------------------
const char* Part::Thickness::ModeEnums[]= {"Skin","Pipe", "RectoVerso",NULL};
const char* Part::Thickness::JoinEnums[]= {"Arc","Tangent", "Intersection",NULL};
const char* Part::Thickness::ModeEnums[]= {"Skin","Pipe", "RectoVerso",nullptr};
const char* Part::Thickness::JoinEnums[]= {"Arc","Tangent", "Intersection",nullptr};
PROPERTY_SOURCE(Part::Thickness, Part::Feature)
Thickness::Thickness()
{
ADD_PROPERTY_TYPE(Faces,(0),"Thickness",App::Prop_None,"Faces to be removed");
ADD_PROPERTY_TYPE(Faces,(nullptr),"Thickness",App::Prop_None,"Faces to be removed");
ADD_PROPERTY_TYPE(Value,(1.0),"Thickness",App::Prop_None,"Thickness value");
ADD_PROPERTY_TYPE(Mode,(long(0)),"Thickness",App::Prop_None,"Mode");
Mode.setEnums(ModeEnums);
@@ -677,7 +677,7 @@ PROPERTY_SOURCE(Part::Refine, Part::Feature)
Refine::Refine()
{
ADD_PROPERTY_TYPE(Source,(0),"Refine",App::Prop_None,"Source shape");
ADD_PROPERTY_TYPE(Source,(nullptr),"Refine",App::Prop_None,"Source shape");
}
App::DocumentObjectExecReturn *Refine::execute(void)
@@ -702,7 +702,7 @@ PROPERTY_SOURCE(Part::Reverse, Part::Feature)
Reverse::Reverse()
{
ADD_PROPERTY_TYPE(Source, (0), "Reverse", App::Prop_None, "Source shape");
ADD_PROPERTY_TYPE(Source, (nullptr), "Reverse", App::Prop_None, "Source shape");
}
App::DocumentObjectExecReturn* Reverse::execute(void)
+7 -7
View File
@@ -66,7 +66,7 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
// plane and distance for offset
PyObject *pPlane;
double dist;
static char* keywords_pd[] = {"Plane","Distance",NULL};
static char* keywords_pd[] = {"Plane","Distance",nullptr};
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_pd, &(PlanePy::Type), &pPlane, &dist)) {
PlanePy* pcPlane = static_cast<PlanePy*>(pPlane);
Handle(Geom_Plane) plane = Handle(Geom_Plane)::DownCast
@@ -84,7 +84,7 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
// plane from equation
double a,b,c,d;
static char* keywords_abcd[] = {"A","B","C","D",NULL};
static char* keywords_abcd[] = {"A","B","C","D",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "dddd", keywords_abcd,
&a,&b,&c,&d)) {
@@ -100,7 +100,7 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
}
PyObject *pV1, *pV2, *pV3;
static char* keywords_ppp[] = {"Point1","Point2","Point3",NULL};
static char* keywords_ppp[] = {"Point1","Point2","Point3",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
&(Base::VectorPy::Type), &pV1,
@@ -123,7 +123,7 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
}
// location and normal
static char* keywords_cnr[] = {"Location","Normal",NULL};
static char* keywords_cnr[] = {"Location","Normal",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!", keywords_cnr,
&(Base::VectorPy::Type), &pV1,
@@ -142,7 +142,7 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
static char* keywords_p[] = {"Plane",NULL};
static char* keywords_p[] = {"Plane",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_p, &(PlanePy::Type), &pPlane)) {
PlanePy* pcPlane = static_cast<PlanePy*>(pPlane);
@@ -154,7 +154,7 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
return 0;
}
static char* keywords_n[] = {NULL};
static char* keywords_n[] = {nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
// do nothing
@@ -257,7 +257,7 @@ void PlanePy::setAxis(Py::Object arg)
PyObject *PlanePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int PlanePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+8 -8
View File
@@ -58,11 +58,11 @@ PyObject *PlateSurfacePy::PyMake(struct _typeobject *, PyObject *, PyObject *)
int PlateSurfacePy::PyInit(PyObject* args, PyObject* kwds)
{
static char* kwds_Parameter[] = {"Surface","Points","Curves","Degree",
"NbPtsOnCur","NbIter","Tol2d","Tol3d","TolAng","TolCurv","Anisotropie",NULL};
"NbPtsOnCur","NbIter","Tol2d","Tol3d","TolAng","TolCurv","Anisotropie",nullptr};
PyObject* surface = 0;
PyObject* points = 0;
PyObject* curves = 0;
PyObject* surface = nullptr;
PyObject* points = nullptr;
PyObject* curves = nullptr;
int Degree = 3;
int NbPtsOnCur = 10;
int NbIter = 3;
@@ -140,7 +140,7 @@ int PlateSurfacePy::PyInit(PyObject* args, PyObject* kwds)
PyObject* PlateSurfacePy::makeApprox(PyObject *args, PyObject* kwds)
{
static char* kwds_Parameter[] = {"Tol3d","MaxSegments","MaxDegree","MaxDistance",
"CritOrder","Continuity","EnlargeCoeff",NULL};
"CritOrder","Continuity","EnlargeCoeff",nullptr};
double tol3d=0.01;
int maxSeg=9;
@@ -152,7 +152,7 @@ PyObject* PlateSurfacePy::makeApprox(PyObject *args, PyObject* kwds)
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|diidisd", kwds_Parameter,
&tol3d, &maxSeg, &maxDegree, &dmax, &critOrder, &cont, &enlargeCoeff))
return 0;
return nullptr;
GeomAbs_Shape continuity;
std::string uc = cont;
@@ -181,13 +181,13 @@ PyObject* PlateSurfacePy::makeApprox(PyObject *args, PyObject* kwds)
}
PyErr_SetString(PyExc_RuntimeError, "Approximation of B-spline surface failed");
return 0;
return nullptr;
} PY_CATCH_OCC;
}
PyObject *PlateSurfacePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int PlateSurfacePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+4 -4
View File
@@ -111,7 +111,7 @@ PyObject* PointPy::toShape(PyObject *args)
try {
if (!this_point.IsNull()) {
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
BRepBuilderAPI_MakeVertex mkBuilder(this_point->Pnt());
const TopoDS_Vertex& sh = mkBuilder.Vertex();
@@ -121,11 +121,11 @@ PyObject* PointPy::toShape(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a point");
return 0;
return nullptr;
}
Py::Float PointPy::getX(void) const
@@ -191,7 +191,7 @@ void PointPy::setZ(Py::Float Z)
PyObject *PointPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int PointPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+3 -3
View File
@@ -330,7 +330,7 @@ App::DocumentObjectExecReturn *Plane::execute(void)
#endif
);
const char *error=0;
const char *error=nullptr;
switch (mkFace.Error())
{
case BRepBuilderAPI_FaceDone:
@@ -760,8 +760,8 @@ App::DocumentObjectExecReturn *Torus::execute(void)
PROPERTY_SOURCE(Part::Helix, Part::Primitive)
const char* Part::Helix::LocalCSEnums[]= {"Right-handed","Left-handed",NULL};
const char* Part::Helix::StyleEnums []= {"Old style","New style",NULL};
const char* Part::Helix::LocalCSEnums[]= {"Right-handed","Left-handed",nullptr};
const char* Part::Helix::StyleEnums []= {"Old style","New style",nullptr};
Helix::Helix(void)
{
@@ -123,7 +123,7 @@ Py::Object RectangularTrimmedSurfacePy::getBasisSurface() const
PyObject *RectangularTrimmedSurfacePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int RectangularTrimmedSurfacePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -247,7 +247,7 @@ PyObject* UnifySameDomainPy::shape(PyObject *args)
PyObject *UnifySameDomainPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int UnifySameDomainPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+1 -1
View File
@@ -183,7 +183,7 @@ void SpherePy::setAxis(Py::Object arg)
PyObject *SpherePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int SpherePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+1 -1
View File
@@ -153,7 +153,7 @@ void SurfaceOfExtrusionPy::setBasisCurve(Py::Object arg)
PyObject *SurfaceOfExtrusionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int SurfaceOfExtrusionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -180,7 +180,7 @@ void SurfaceOfRevolutionPy::setBasisCurve(Py::Object arg)
PyObject *SurfaceOfRevolutionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int SurfaceOfRevolutionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+2 -2
View File
@@ -3198,7 +3198,7 @@ bool TopoShape::transformShape(const Base::Matrix4D& rclTrf, bool copy, bool che
if (this->_Shape.IsNull())
Standard_Failure::Raise("Cannot transform null shape");
return _makeTransform(TopoShape(*this),rclTrf,0,checkScale,copy);
return _makeTransform(TopoShape(*this),rclTrf,nullptr,checkScale,copy);
}
TopoDS_Shape TopoShape::mirror(const gp_Ax2& ax2) const
@@ -4128,7 +4128,7 @@ TopoShape &TopoShape::makeWires(const TopoShape &shape, const char *op, bool fix
// Now retrieve the shape and set it without touching element map
wires.back().setShape(aFix.Wire());
}
return makeCompound(wires,0,false);
return makeCompound(wires,nullptr,false);
}
TopoShape &TopoShape::makeCompound(const std::vector<TopoShape> &shapes, const char *op, bool force)
+15 -15
View File
@@ -313,33 +313,33 @@ public:
* To be complete in next batch of patches
*/
//@{
TopoShape &makeCompound(const std::vector<TopoShape> &shapes, const char *op=0, bool force=true);
TopoShape &makeCompound(const std::vector<TopoShape> &shapes, const char *op=nullptr, bool force=true);
TopoShape &makeWires(const TopoShape &shape, const char *op=0, bool fix=false, double tol=0.0);
TopoShape makeWires(const char *op=0, bool fix=false, double tol=0.0) const {
TopoShape &makeWires(const TopoShape &shape, const char *op=nullptr, bool fix=false, double tol=0.0);
TopoShape makeWires(const char *op=nullptr, bool fix=false, double tol=0.0) const {
return TopoShape().makeWires(*this,op,fix,tol);
}
TopoShape &makeFace(const std::vector<TopoShape> &shapes, const char *op=0, const char *maker=0);
TopoShape &makeFace(const TopoShape &shape, const char *op=0, const char *maker=0);
TopoShape makeFace(const char *op=0, const char *maker=0) const {
TopoShape &makeFace(const std::vector<TopoShape> &shapes, const char *op=nullptr, const char *maker=nullptr);
TopoShape &makeFace(const TopoShape &shape, const char *op=nullptr, const char *maker=nullptr);
TopoShape makeFace(const char *op=nullptr, const char *maker=nullptr) const {
return TopoShape().makeFace(*this,op,maker);
}
bool _makeTransform(const TopoShape &shape, const Base::Matrix4D &mat,
const char *op=0, bool checkScale=false, bool copy=false);
const char *op=nullptr, bool checkScale=false, bool copy=false);
TopoShape &makeTransform(const TopoShape &shape, const Base::Matrix4D &mat,
const char *op=0, bool checkScale=false, bool copy=false) {
const char *op=nullptr, bool checkScale=false, bool copy=false) {
_makeTransform(shape,mat,op,checkScale,copy);
return *this;
}
TopoShape makeTransform(const Base::Matrix4D &mat, const char *op=0,
TopoShape makeTransform(const Base::Matrix4D &mat, const char *op=nullptr,
bool checkScale=false, bool copy=false) const {
return TopoShape().makeTransform(*this,mat,op,checkScale,copy);
}
TopoShape &makeTransform(const TopoShape &shape, const gp_Trsf &trsf,
const char *op=0, bool copy=false);
TopoShape makeTransform(const gp_Trsf &trsf, const char *op=0, bool copy=false) const {
const char *op=nullptr, bool copy=false);
TopoShape makeTransform(const gp_Trsf &trsf, const char *op=nullptr, bool copy=false) const {
return TopoShape().makeTransform(*this,trsf,op,copy);
}
@@ -353,13 +353,13 @@ public:
}
TopoShape &makeGTransform(const TopoShape &shape, const Base::Matrix4D &mat,
const char *op=0, bool copy=false);
TopoShape makeGTransform(const Base::Matrix4D &mat, const char *op=0, bool copy=false) const {
const char *op=nullptr, bool copy=false);
TopoShape makeGTransform(const Base::Matrix4D &mat, const char *op=nullptr, bool copy=false) const {
return TopoShape().makeGTransform(*this,mat,op,copy);
}
TopoShape &makeRefine(const TopoShape &shape, const char *op=0, bool no_fail=true);
TopoShape makeRefine(const char *op=0, bool no_fail=true) const {
TopoShape &makeRefine(const TopoShape &shape, const char *op=nullptr, bool no_fail=true);
TopoShape makeRefine(const char *op=nullptr, bool no_fail=true) const {
return TopoShape().makeRefine(*this,op,no_fail);
}
//@}
+3 -3
View File
@@ -95,7 +95,7 @@ PyObject* TopoShapeCompSolidPy::add(PyObject *args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeSolidPy::Type), &obj))
return NULL;
return nullptr;
BRep_Builder builder;
TopoDS_Shape comp = getTopoShapePtr()->getShape();
@@ -111,7 +111,7 @@ PyObject* TopoShapeCompSolidPy::add(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
getTopoShapePtr()->setShape(comp);
@@ -121,7 +121,7 @@ PyObject* TopoShapeCompSolidPy::add(PyObject *args)
PyObject *TopoShapeCompSolidPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int TopoShapeCompSolidPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+5 -5
View File
@@ -98,7 +98,7 @@ PyObject* TopoShapeCompoundPy::add(PyObject *args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapePy::Type), &obj))
return NULL;
return nullptr;
BRep_Builder builder;
TopoDS_Shape comp = getTopoShapePtr()->getShape();
@@ -112,7 +112,7 @@ PyObject* TopoShapeCompoundPy::add(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
getTopoShapePtr()->setShape(comp);
@@ -125,7 +125,7 @@ PyObject* TopoShapeCompoundPy::connectEdgesToWires(PyObject *args)
PyObject *shared=Py_True;
double tol = Precision::Confusion();
if (!PyArg_ParseTuple(args, "|O!d",&PyBool_Type,&shared,&tol))
return 0;
return nullptr;
try {
const TopoDS_Shape& s = getTopoShapePtr()->getShape();
@@ -152,13 +152,13 @@ PyObject* TopoShapeCompoundPy::connectEdgesToWires(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject *TopoShapeCompoundPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int TopoShapeCompoundPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+52 -52
View File
@@ -199,7 +199,7 @@ PyObject* TopoShapeEdgePy::getParameterByLength(PyObject *args)
double u;
double t=Precision::Confusion();
if (!PyArg_ParseTuple(args, "d|d",&u,&t))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
BRepAdaptor_Curve adapt(e);
@@ -212,7 +212,7 @@ PyObject* TopoShapeEdgePy::getParameterByLength(PyObject *args)
if (u < -length || u > length) {
PyErr_SetString(PyExc_ValueError, "value out of range");
return 0;
return nullptr;
}
if (u < 0)
u = length+u;
@@ -228,7 +228,7 @@ PyObject* TopoShapeEdgePy::valueAt(PyObject *args)
{
double u;
if (!PyArg_ParseTuple(args, "d",&u))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
BRepAdaptor_Curve adapt(e);
@@ -242,9 +242,9 @@ PyObject* TopoShapeEdgePy::valueAt(PyObject *args)
PyObject* TopoShapeEdgePy::parameters(PyObject *args)
{
PyObject* pyface = 0;
PyObject* pyface = nullptr;
if (!PyArg_ParseTuple(args, "|O!", &(TopoShapeFacePy::Type), &pyface))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
TopLoc_Location aLoc;
@@ -291,21 +291,21 @@ PyObject* TopoShapeEdgePy::parameters(PyObject *args)
}
else {
PyErr_SetString(PyExc_ValueError, "Edge is not part of the face");
return 0;
return nullptr;
}
}
PyErr_SetString(PyExc_RuntimeError, "Edge has no polygon");
return 0;
return nullptr;
}
PyObject* TopoShapeEdgePy::parameterAt(PyObject *args)
{
PyObject* pnt;
PyObject* face=0;
PyObject* face=nullptr;
if (!PyArg_ParseTuple(args, "O!|O!",&TopoShapeVertexPy::Type,&pnt,
&TopoShapeFacePy::Type,&face))
return 0;
return nullptr;
try {
const TopoDS_Shape& v = static_cast<TopoShapePy*>(pnt)->getTopoShapePtr()->getShape();
@@ -324,7 +324,7 @@ PyObject* TopoShapeEdgePy::parameterAt(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -332,7 +332,7 @@ PyObject* TopoShapeEdgePy::tangentAt(PyObject *args)
{
double u;
if (!PyArg_ParseTuple(args, "d",&u))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
BRepAdaptor_Curve adapt(e);
@@ -345,7 +345,7 @@ PyObject* TopoShapeEdgePy::tangentAt(PyObject *args)
}
else {
PyErr_SetString(PyExc_NotImplementedError, "Tangent not defined at this position!");
return 0;
return nullptr;
}
}
@@ -353,7 +353,7 @@ PyObject* TopoShapeEdgePy::normalAt(PyObject *args)
{
double u;
if (!PyArg_ParseTuple(args, "d",&u))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
BRepAdaptor_Curve adapt(e);
@@ -367,7 +367,7 @@ PyObject* TopoShapeEdgePy::normalAt(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -375,7 +375,7 @@ PyObject* TopoShapeEdgePy::curvatureAt(PyObject *args)
{
double u;
if (!PyArg_ParseTuple(args, "d",&u))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
BRepAdaptor_Curve adapt(e);
@@ -388,7 +388,7 @@ PyObject* TopoShapeEdgePy::curvatureAt(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -396,7 +396,7 @@ PyObject* TopoShapeEdgePy::centerOfCurvatureAt(PyObject *args)
{
double u;
if (!PyArg_ParseTuple(args, "d",&u))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
BRepAdaptor_Curve adapt(e);
@@ -410,7 +410,7 @@ PyObject* TopoShapeEdgePy::centerOfCurvatureAt(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -418,7 +418,7 @@ PyObject* TopoShapeEdgePy::derivative1At(PyObject *args)
{
double u;
if (!PyArg_ParseTuple(args, "d",&u))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
BRepAdaptor_Curve adapt(e);
@@ -431,7 +431,7 @@ PyObject* TopoShapeEdgePy::derivative1At(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -439,7 +439,7 @@ PyObject* TopoShapeEdgePy::derivative2At(PyObject *args)
{
double u;
if (!PyArg_ParseTuple(args, "d",&u))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
BRepAdaptor_Curve adapt(e);
@@ -452,7 +452,7 @@ PyObject* TopoShapeEdgePy::derivative2At(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -460,7 +460,7 @@ PyObject* TopoShapeEdgePy::derivative3At(PyObject *args)
{
double u;
if (!PyArg_ParseTuple(args, "d",&u))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
BRepAdaptor_Curve adapt(e);
@@ -473,7 +473,7 @@ PyObject* TopoShapeEdgePy::derivative3At(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -501,19 +501,19 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PyExc_TypeError, "Either int or float expected");
return 0;
return nullptr;
}
}
else {
// use Number kwds
static char* kwds_numPoints[] = {"Number","First","Last",NULL};
static char* kwds_numPoints[] = {"Number","First","Last",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
uniformAbscissaPoints = true;
}
else {
// use Abscissa kwds
static char* kwds_Distance[] = {"Distance","First","Last",NULL};
static char* kwds_Distance[] = {"Distance","First","Last",nullptr};
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
uniformAbscissaDistance = true;
@@ -540,12 +540,12 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of edge failed");
return 0;
return nullptr;
}
}
// use Deflection kwds
static char* kwds_Deflection[] = {"Deflection","First","Last",NULL};
static char* kwds_Deflection[] = {"Deflection","First","Last",nullptr};
PyErr_Clear();
double deflection;
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
@@ -562,12 +562,12 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of edge failed");
return 0;
return nullptr;
}
}
// use TangentialDeflection kwds
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",NULL};
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",nullptr};
PyErr_Clear();
double angular;
double curvature;
@@ -586,12 +586,12 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of edge failed");
return 0;
return nullptr;
}
}
// use QuasiNumber kwds
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",NULL};
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",nullptr};
PyErr_Clear();
int quasiNumPoints;
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first, &last)) {
@@ -608,12 +608,12 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of edge failed");
return 0;
return nullptr;
}
}
// use QuasiDeflection kwds
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",NULL};
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",nullptr};
PyErr_Clear();
double quasiDeflection;
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection, &quasiDeflection, &first, &last)) {
@@ -630,24 +630,24 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
}
else {
PyErr_SetString(PartExceptionOCCError, "Discretization of edge failed");
return 0;
return nullptr;
}
}
}
catch (const Base::Exception& e) {
PyErr_SetString(PartExceptionOCCError, e.what());
return 0;
return nullptr;
}
PyErr_SetString(PartExceptionOCCError,"Wrong arguments");
return 0;
return nullptr;
}
PyObject* TopoShapeEdgePy::split(PyObject *args)
{
PyObject* float_or_list;
if (!PyArg_ParseTuple(args, "O", &float_or_list))
return 0;
return nullptr;
try {
BRepAdaptor_Curve adapt(TopoDS::Edge(getTopoShapePtr()->getShape()));
@@ -660,11 +660,11 @@ PyObject* TopoShapeEdgePy::split(PyObject *args)
double val = PyFloat_AsDouble(float_or_list);
if (val == f || val == l) {
PyErr_SetString(PyExc_ValueError, "Cannot split edge at start or end point");
return 0;
return nullptr;
}
else if (val < f || val > l) {
PyErr_SetString(PyExc_ValueError, "Value out of parameter range");
return 0;
return nullptr;
}
par.push_back(val);
}
@@ -674,18 +674,18 @@ PyObject* TopoShapeEdgePy::split(PyObject *args)
double val = (double)Py::Float(*it);
if (val == f || val == l) {
PyErr_SetString(PyExc_ValueError, "Cannot split edge at start or end point");
return 0;
return nullptr;
}
else if (val < f || val > l) {
PyErr_SetString(PyExc_ValueError, "Value out of parameter range");
return 0;
return nullptr;
}
par.push_back(val);
}
}
else {
PyErr_SetString(PyExc_TypeError, "Either float or list of floats expected");
return 0;
return nullptr;
}
par.push_back(l);
@@ -704,7 +704,7 @@ PyObject* TopoShapeEdgePy::split(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -712,7 +712,7 @@ PyObject* TopoShapeEdgePy::isSeam(PyObject *args)
{
PyObject* face;
if (!PyArg_ParseTuple(args, "O!", &TopoShapeFacePy::Type, &face))
return 0;
return nullptr;
try {
const TopoDS_Edge& e = TopoDS::Edge(this->getTopoShapePtr()->getShape());
@@ -725,7 +725,7 @@ PyObject* TopoShapeEdgePy::isSeam(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -733,7 +733,7 @@ PyObject* TopoShapeEdgePy::firstVertex(PyObject *args)
{
PyObject* orient = Py_False;
if (!PyArg_ParseTuple(args, "|O!", &PyBool_Type, &orient))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
TopoDS_Vertex v = TopExp::FirstVertex(e, PyObject_IsTrue(orient) ? Standard_True : Standard_False);
return new TopoShapeVertexPy(new TopoShape(v));
@@ -743,7 +743,7 @@ PyObject* TopoShapeEdgePy::lastVertex(PyObject *args)
{
PyObject* orient = Py_False;
if (!PyArg_ParseTuple(args, "|O!", &PyBool_Type, &orient))
return 0;
return nullptr;
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
TopoDS_Vertex v = TopExp::LastVertex(e, PyObject_IsTrue(orient) ? Standard_True : Standard_False);
return new TopoShapeVertexPy(new TopoShape(v));
@@ -1022,7 +1022,7 @@ PyObject* TopoShapeEdgePy::curveOnSurface(PyObject *args)
{
int idx;
if (!PyArg_ParseTuple(args, "i", &idx))
return 0;
return nullptr;
try {
TopoDS_Edge edge = TopoDS::Edge(getTopoShapePtr()->getShape());
@@ -1059,13 +1059,13 @@ PyObject* TopoShapeEdgePy::curveOnSurface(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject *TopoShapeEdgePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int TopoShapeEdgePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+30 -30
View File
@@ -223,7 +223,7 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
}
PyErr_Clear();
PyObject *bound=0;
PyObject *bound=nullptr;
if (PyArg_ParseTuple(args, "O!|O!", &(GeometryPy::Type), &surf, &(PyList_Type), &bound)) {
try {
Handle(Geom_Surface) S = Handle(Geom_Surface)::DownCast
@@ -326,7 +326,7 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
}
}
char* className = 0;
char* className = nullptr;
PyObject* pcPyShapeOrList = nullptr;
PyErr_Clear();
if (PyArg_ParseTuple(args, "Os", &pcPyShapeOrList, &className)) {
@@ -429,12 +429,12 @@ PyObject* TopoShapeFacePy::makeOffset(PyObject *args)
{
double dist;
if (!PyArg_ParseTuple(args, "d",&dist))
return 0;
return nullptr;
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
BRepBuilderAPI_FindPlane findPlane(f);
if (!findPlane.Found()) {
PyErr_SetString(PartExceptionOCCError, "No planar face");
return 0;
return nullptr;
}
BRepOffsetAPI_MakeOffset mkOffset(f);
@@ -507,7 +507,7 @@ PyObject* TopoShapeFacePy::valueAt(PyObject *args)
{
double u,v;
if (!PyArg_ParseTuple(args, "dd",&u,&v))
return 0;
return nullptr;
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
@@ -540,14 +540,14 @@ PyObject* TopoShapeFacePy::normalAt(PyObject *args)
PyObject* TopoShapeFacePy::getUVNodes(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
TopLoc_Location aLoc;
Handle (Poly_Triangulation) mesh = BRep_Tool::Triangulation(f,aLoc);
if (mesh.IsNull()) {
PyErr_SetString(PyExc_RuntimeError, "Face has no triangulation");
return 0;
return nullptr;
}
Py::List list;
@@ -581,7 +581,7 @@ PyObject* TopoShapeFacePy::tangentAt(PyObject *args)
{
double u,v;
if (!PyArg_ParseTuple(args, "dd",&u,&v))
return 0;
return nullptr;
gp_Dir dir;
Py::Tuple tuple(2);
@@ -595,7 +595,7 @@ PyObject* TopoShapeFacePy::tangentAt(PyObject *args)
}
else {
PyErr_SetString(PartExceptionOCCError, "tangent in u not defined");
return 0;
return nullptr;
}
if (prop.IsTangentVDefined()) {
prop.TangentV(dir);
@@ -603,7 +603,7 @@ PyObject* TopoShapeFacePy::tangentAt(PyObject *args)
}
else {
PyErr_SetString(PartExceptionOCCError, "tangent in v not defined");
return 0;
return nullptr;
}
return Py::new_reference_to(tuple);
@@ -613,7 +613,7 @@ PyObject* TopoShapeFacePy::curvatureAt(PyObject *args)
{
double u,v;
if (!PyArg_ParseTuple(args, "dd",&u,&v))
return 0;
return nullptr;
Py::Tuple tuple(2);
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
@@ -626,7 +626,7 @@ PyObject* TopoShapeFacePy::curvatureAt(PyObject *args)
}
else {
PyErr_SetString(PartExceptionOCCError, "curvature not defined");
return 0;
return nullptr;
}
return Py::new_reference_to(tuple);
@@ -636,7 +636,7 @@ PyObject* TopoShapeFacePy::derivative1At(PyObject *args)
{
double u,v;
if (!PyArg_ParseTuple(args, "dd",&u,&v))
return 0;
return nullptr;
Py::Tuple tuple(2);
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
@@ -652,7 +652,7 @@ PyObject* TopoShapeFacePy::derivative1At(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -660,7 +660,7 @@ PyObject* TopoShapeFacePy::derivative2At(PyObject *args)
{
double u,v;
if (!PyArg_ParseTuple(args, "dd",&u,&v))
return 0;
return nullptr;
Py::Tuple tuple(2);
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
@@ -676,7 +676,7 @@ PyObject* TopoShapeFacePy::derivative2At(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -684,7 +684,7 @@ PyObject* TopoShapeFacePy::isPartOfDomain(PyObject *args)
{
double u,v;
if (!PyArg_ParseTuple(args, "dd",&u,&v))
return 0;
return nullptr;
const TopoDS_Face& face = TopoDS::Face(getTopoShapePtr()->getShape());
@@ -702,7 +702,7 @@ PyObject* TopoShapeFacePy::isPartOfDomain(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -710,7 +710,7 @@ PyObject* TopoShapeFacePy::makeHalfSpace(PyObject *args)
{
PyObject* pPnt;
if (!PyArg_ParseTuple(args, "O!",&(Base::VectorPy::Type),&pPnt))
return 0;
return nullptr;
try {
Base::Vector3d pt = Py::Vector(pPnt,false).toVector();
@@ -719,14 +719,14 @@ PyObject* TopoShapeFacePy::makeHalfSpace(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* TopoShapeFacePy::validate(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
const TopoDS_Face& face = TopoDS::Face(getTopoShapePtr()->getShape());
@@ -770,7 +770,7 @@ PyObject* TopoShapeFacePy::validate(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -778,13 +778,13 @@ PyObject* TopoShapeFacePy::curveOnSurface(PyObject *args)
{
PyObject* e;
if (!PyArg_ParseTuple(args, "O!", &(TopoShapeEdgePy::Type), &e))
return 0;
return nullptr;
try {
TopoDS_Shape shape = static_cast<TopoShapeEdgePy*>(e)->getTopoShapePtr()->getShape();
if (shape.IsNull()) {
PyErr_SetString(PyExc_RuntimeError, "invalid shape");
return 0;
return nullptr;
}
TopoDS_Edge edge = TopoDS::Edge(shape);
@@ -804,13 +804,13 @@ PyObject* TopoShapeFacePy::curveOnSurface(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject* TopoShapeFacePy::cutHoles(PyObject *args)
{
PyObject *holes=0;
PyObject *holes=nullptr;
if (PyArg_ParseTuple(args, "O!", &(PyList_Type), &holes)) {
try {
std::vector<TopoDS_Wire> wires;
@@ -867,11 +867,11 @@ PyObject* TopoShapeFacePy::cutHoles(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyErr_SetString(PyExc_RuntimeError, "invalid list of wires");
return 0;
return nullptr;
}
@@ -879,7 +879,7 @@ Py::Object TopoShapeFacePy::getSurface() const
{
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
BRepAdaptor_Surface adapt(f);
Base::PyObjectBase* surface = 0;
Base::PyObjectBase* surface = nullptr;
switch(adapt.GetType())
{
case GeomAbs_Plane:
@@ -1141,7 +1141,7 @@ Py::Dict TopoShapeFacePy::getPrincipalProperties(void) const
PyObject *TopoShapeFacePy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int TopoShapeFacePy::setCustomAttributes(const char* , PyObject *)
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -131,7 +131,7 @@ PyObject* TopoShapeShellPy::add(PyObject *args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeFacePy::Type), &obj))
return NULL;
return nullptr;
BRep_Builder builder;
TopoDS_Shape shell = getTopoShapePtr()->getShape();
@@ -153,7 +153,7 @@ PyObject* TopoShapeShellPy::add(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
getTopoShapePtr()->setShape(shell);
@@ -164,7 +164,7 @@ PyObject* TopoShapeShellPy::add(PyObject *args)
PyObject* TopoShapeShellPy::getFreeEdges(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
ShapeAnalysis_Shell as;
as.LoadShells(getTopoShapePtr()->getShape());
#if OCC_VERSION_HEX < 0x060500
@@ -179,7 +179,7 @@ PyObject* TopoShapeShellPy::getFreeEdges(PyObject *args)
PyObject* TopoShapeShellPy::getBadEdges(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
ShapeAnalysis_Shell as;
as.LoadShells(getTopoShapePtr()->getShape());
#if OCC_VERSION_HEX < 0x060500
@@ -195,7 +195,7 @@ PyObject* TopoShapeShellPy::makeHalfSpace(PyObject *args)
{
PyObject* pPnt;
if (!PyArg_ParseTuple(args, "O!",&(Base::VectorPy::Type),&pPnt))
return 0;
return nullptr;
try {
Base::Vector3d pt = Py::Vector(pPnt,false).toVector();
@@ -204,7 +204,7 @@ PyObject* TopoShapeShellPy::makeHalfSpace(PyObject *args)
}
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -286,7 +286,7 @@ Py::Dict TopoShapeShellPy::getPrincipalProperties(void) const
PyObject *TopoShapeShellPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int TopoShapeShellPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+7 -7
View File
@@ -232,7 +232,7 @@ PyObject* TopoShapeSolidPy::getMomentOfInertia(PyObject *args)
PyObject *p,*d;
if (!PyArg_ParseTuple(args, "O!O!",&Base::VectorPy::Type,&p
,&Base::VectorPy::Type,&d))
return 0;
return nullptr;
Base::Vector3d pnt = Py::Vector(p,false).toVector();
Base::Vector3d dir = Py::Vector(d,false).toVector();
@@ -246,7 +246,7 @@ PyObject* TopoShapeSolidPy::getMomentOfInertia(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -255,7 +255,7 @@ PyObject* TopoShapeSolidPy::getRadiusOfGyration(PyObject *args)
PyObject *p,*d;
if (!PyArg_ParseTuple(args, "O!O!",&Base::VectorPy::Type,&p
,&Base::VectorPy::Type,&d))
return 0;
return nullptr;
Base::Vector3d pnt = Py::Vector(p,false).toVector();
Base::Vector3d dir = Py::Vector(d,false).toVector();
@@ -269,7 +269,7 @@ PyObject* TopoShapeSolidPy::getRadiusOfGyration(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
@@ -318,7 +318,7 @@ PyObject* TopoShapeSolidPy::offsetFaces(PyObject *args)
if (!paramOK) {
PyErr_SetString(PyExc_TypeError, "Wrong parameter");
return 0;
return nullptr;
}
try {
@@ -329,13 +329,13 @@ PyObject* TopoShapeSolidPy::offsetFaces(PyObject *args)
catch (Standard_Failure& e) {
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return 0;
return nullptr;
}
}
PyObject *TopoShapeSolidPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int TopoShapeSolidPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
+1 -1
View File
@@ -206,7 +206,7 @@ Py::Object TopoShapeVertexPy::getPoint(void) const
PyObject *TopoShapeVertexPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int TopoShapeVertexPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

Some files were not shown because too many files have changed in this diff Show More