Part: Wrap PyArg_ParseTupleAndKeywords
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
# include <GeomFill_NSections.hxx>
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "BSplineSurfacePy.h"
|
||||
@@ -1166,10 +1167,15 @@ 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", nullptr};
|
||||
static const std::array<const char *, 14> 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, °Min, °Max, &continuity, &tol3d, &X0, &dX, &Y0, &dY, &parType, &weight1, &weight2, &weight3))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O|iiidddddsddd", kwds_interp, &obj, °Min, °Max,
|
||||
&continuity, &tol3d, &X0, &dX, &Y0, &dY, &parType, &weight1, &weight2,
|
||||
&weight3)) {
|
||||
return nullptr;
|
||||
}
|
||||
try {
|
||||
Py::Sequence list(obj);
|
||||
Standard_Integer lu = list.size();
|
||||
@@ -1328,10 +1334,10 @@ PyObject* BSplineSurfacePy::interpolate(PyObject *args)
|
||||
|
||||
PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *keywds)
|
||||
{
|
||||
static char *kwlist[] = {"poles", "umults", "vmults",
|
||||
"uknots", "vknots", "uperiodic", "vperiodic", "udegree", "vdegree", "weights", nullptr};
|
||||
PyObject* uperiodic = Py_False;
|
||||
PyObject* vperiodic = Py_False;
|
||||
static const std::array<const char *, 11> kwlist{"poles", "umults", "vmults", "uknots", "vknots", "uperiodic",
|
||||
"vperiodic", "udegree", "vdegree", "weights", nullptr};
|
||||
PyObject* uperiodic = Py_False; // NOLINT
|
||||
PyObject* vperiodic = Py_False; // NOLINT
|
||||
PyObject* poles = Py_None;
|
||||
PyObject* umults = Py_None;
|
||||
PyObject* vmults = Py_None;
|
||||
@@ -1345,12 +1351,13 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
int sum_of_umults = 0;
|
||||
int sum_of_vmults = 0;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "OOO|OOO!O!iiO", kwlist,
|
||||
&poles, &umults, &vmults, //required
|
||||
&uknots, &vknots, //optional
|
||||
&PyBool_Type, &uperiodic, &PyBool_Type, &vperiodic, //optinoal
|
||||
&udegree, &vdegree, &weights)) //optional
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, keywds, "OOO|OOO!O!iiO", kwlist,
|
||||
&poles, &umults, &vmults, //required
|
||||
&uknots, &vknots, //optional
|
||||
&PyBool_Type, &uperiodic, &PyBool_Type, &vperiodic, //optional
|
||||
&udegree, &vdegree, &weights)) {
|
||||
return nullptr;
|
||||
}
|
||||
try {
|
||||
Py::Sequence list(poles);
|
||||
Standard_Integer lu = list.size();
|
||||
|
||||
Reference in New Issue
Block a user