Part: Wrap PyArg_ParseTupleAndKeywords
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
#include <Base/Vector3D.h>
|
||||
|
||||
@@ -55,8 +56,9 @@ PyObject *PlateSurfacePy::PyMake(struct _typeobject *, PyObject *, PyObject *)
|
||||
// constructor method
|
||||
int PlateSurfacePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
static char* kwds_Parameter[] = {"Surface","Points","Curves","Degree",
|
||||
"NbPtsOnCur","NbIter","Tol2d","Tol3d","TolAng","TolCurv","Anisotropie",nullptr};
|
||||
static const std::array<const char *, 12> kwds_Parameter{"Surface", "Points", "Curves", "Degree",
|
||||
"NbPtsOnCur", "NbIter", "Tol2d", "Tol3d", "TolAng",
|
||||
"TolCurv", "Anisotropie", nullptr};
|
||||
|
||||
PyObject* surface = nullptr;
|
||||
PyObject* points = nullptr;
|
||||
@@ -68,13 +70,14 @@ int PlateSurfacePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
double Tol3d = 0.0001;
|
||||
double TolAng = 0.01;
|
||||
double TolCurv = 0.1;
|
||||
PyObject* Anisotropie = Py_False;
|
||||
PyObject* Anisotropie = Py_False; // NOLINT
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!OOiiiddddO!", kwds_Parameter,
|
||||
&(GeometryPy::Type), &surface, &points, &curves,
|
||||
&Degree, &NbPtsOnCur, &NbIter, &Tol2d, &Tol3d, &TolAng, &TolCurv,
|
||||
&PyBool_Type,&Anisotropie))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|O!OOiiiddddO!", kwds_Parameter,
|
||||
&(GeometryPy::Type), &surface, &points, &curves,
|
||||
&Degree, &NbPtsOnCur, &NbIter, &Tol2d, &Tol3d, &TolAng, &TolCurv,
|
||||
&PyBool_Type, &Anisotropie)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!surface && !points && !curves) {
|
||||
PyErr_SetString(PyExc_ValueError, "set points or curves as constraints");
|
||||
@@ -137,8 +140,8 @@ 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",nullptr};
|
||||
static const std::array<const char *, 8> kwds_Parameter{"Tol3d", "MaxSegments", "MaxDegree", "MaxDistance",
|
||||
"CritOrder", "Continuity", "EnlargeCoeff", nullptr};
|
||||
|
||||
double tol3d=0.01;
|
||||
int maxSeg=9;
|
||||
@@ -148,9 +151,10 @@ PyObject* PlateSurfacePy::makeApprox(PyObject *args, PyObject* kwds)
|
||||
char* cont = "C1";
|
||||
double enlargeCoeff = 1.1;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|diidisd", kwds_Parameter,
|
||||
&tol3d, &maxSeg, &maxDegree, &dmax, &critOrder, &cont, &enlargeCoeff))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|diidisd", kwds_Parameter,
|
||||
&tol3d, &maxSeg, &maxDegree, &dmax, &critOrder, &cont, &enlargeCoeff)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GeomAbs_Shape continuity;
|
||||
std::string uc = cont;
|
||||
|
||||
Reference in New Issue
Block a user