RE: Wrap PyArg_ParseTupleAndKeywords

This commit is contained in:
Chris Hennes
2023-08-25 13:18:31 -05:00
parent d2e51218c8
commit 0733261d06

View File

@@ -30,6 +30,7 @@
#include <Base/Converter.h>
#include <Base/GeometryPyCXX.h>
#include <Base/Interpreter.h>
#include <Base/PyWrapParseTupleAndKeywords.h>
#include <Mod/Part/App/BSplineSurfacePy.h>
#include <Mod/Mesh/App/MeshPy.h>
#include <Mod/Points/App/PointsPy.h>
@@ -178,15 +179,16 @@ private:
PyObject* correction = Py_True;
double factor = 1.0;
static char* kwds_approx[] = {"Points", "UDegree", "VDegree", "NbUPoles", "NbVPoles",
"Smooth", "Weight", "Grad", "Bend", "Curv",
"Iterations", "Correction", "PatchFactor","UVDirs", nullptr};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O|iiiiO!ddddiO!dO!",kwds_approx,
&o,&uDegree,&vDegree,&uPoles,&vPoles,
&PyBool_Type,&smooth,&weight,&grad,&bend,&curv,
&iteration,&PyBool_Type,&correction,&factor,
&PyTuple_Type,&uvdirs))
static const std::array<const char *, 15> kwds_approx{"Points", "UDegree", "VDegree", "NbUPoles", "NbVPoles",
"Smooth", "Weight", "Grad", "Bend", "Curv", "Iterations",
"Correction", "PatchFactor", "UVDirs", nullptr};
if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O|iiiiO!ddddiO!dO!", kwds_approx,
&o, &uDegree, &vDegree, &uPoles, &vPoles,
&PyBool_Type, &smooth, &weight, &grad, &bend, &curv,
&iteration, &PyBool_Type, &correction, &factor,
&PyTuple_Type, &uvdirs)) {
throw Py::Exception();
}
int uOrder = uDegree + 1;
int vOrder = vDegree + 1;
@@ -313,7 +315,7 @@ Mesh.show(m)
static char* kwds_greedy[] = {"Points", "SearchRadius", "Mu", "KSearch",
"Normals", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!d|diO", kwds_greedy,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!d|diO", kwds_greedy,
&(Points::PointsPy::Type), &pts,
&searchRadius, &mu, &ksearch, &vec))
throw Py::Exception();
@@ -351,7 +353,7 @@ Mesh.show(m)
static char* kwds_poisson[] = {"Points", "KSearch", "OctreeDepth", "SolverDivide",
"SamplesPerNode", "Normals", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iiidO", kwds_poisson,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iiidO", kwds_poisson,
&(Points::PointsPy::Type), &pts,
&ksearch, &octreeDepth, &solverDivide, &samplesPerNode, &vec))
throw Py::Exception();
@@ -419,7 +421,7 @@ Mesh.show(m)
int height;
static char* kwds_view[] = {"Points", "Width", "Height", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|ii", kwds_view,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|ii", kwds_view,
&(Points::PointsPy::Type), &pts,
&width, &height))
throw Py::Exception();
@@ -444,7 +446,7 @@ Mesh.show(m)
int ksearch=5;
static char* kwds_greedy[] = {"Points", "KSearch", "Normals", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iO", kwds_greedy,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iO", kwds_greedy,
&(Points::PointsPy::Type), &pts,
&ksearch, &vec))
throw Py::Exception();
@@ -476,7 +478,7 @@ Mesh.show(m)
int ksearch=5;
static char* kwds_greedy[] = {"Points", "KSearch", "Normals", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iO", kwds_greedy,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iO", kwds_greedy,
&(Points::PointsPy::Type), &pts,
&ksearch, &vec))
throw Py::Exception();
@@ -526,7 +528,7 @@ Mesh.show(m)
int ksearch=5;
static char* kwds_greedy[] = {"Points", "KSearch", "Normals", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iO", kwds_greedy,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iO", kwds_greedy,
&(Points::PointsPy::Type), &pts,
&ksearch, &vec))
throw Py::Exception();
@@ -566,7 +568,7 @@ Mesh.show(m)
static char* kwds_approx[] = {"Points", "Degree", "Refinement", "Iterations",
"InteriorSmoothness", "InteriorWeight", "BoundarySmoothness", "BoundaryWeight", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iiidddd", kwds_approx,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iiidddd", kwds_approx,
&(Points::PointsPy::Type), &pts,
&degree, &refinement, &iterations,
&interiorSmoothness, &interiorWeight,
@@ -601,7 +603,7 @@ Mesh.show(m)
double voxDimZ = 0;
static char* kwds_voxel[] = {"Points", "DimX", "DimY", "DimZ", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!d|dd", kwds_voxel,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!d|dd", kwds_voxel,
&(Points::PointsPy::Type), &pts,
&voxDimX, &voxDimY, &voxDimZ))
throw Py::Exception();
@@ -644,7 +646,7 @@ Mesh.show(m)
double searchRadius=0;
static char* kwds_normals[] = {"Points", "KSearch", "SearchRadius", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|id", kwds_normals,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|id", kwds_normals,
&(Points::PointsPy::Type), &pts,
&ksearch, &searchRadius))
throw Py::Exception();
@@ -673,7 +675,7 @@ Mesh.show(m)
int ksearch=5;
static char* kwds_segment[] = {"Points", "KSearch", "Normals", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iO", kwds_segment,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|iO", kwds_segment,
&(Points::PointsPy::Type), &pts,
&ksearch, &vec))
throw Py::Exception();
@@ -713,7 +715,7 @@ Mesh.show(m)
int ksearch=5;
static char* kwds_segment[] = {"Points", "KSearch", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|i", kwds_segment,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|i", kwds_segment,
&(Points::PointsPy::Type), &pts, &ksearch))
throw Py::Exception();
@@ -782,7 +784,7 @@ Points.show(np)
const char* sacModelType = nullptr;
static char* kwds_sample[] = {"SacModel", "Points", "Normals", NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "sO!|O", kwds_sample,
if (!Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "sO!|O", kwds_sample,
&sacModelType, &(Points::PointsPy::Type), &pts, &vec))
throw Py::Exception();