Part: Wrap PyArg_ParseTupleAndKeywords

This commit is contained in:
Chris Hennes
2023-08-25 13:17:59 -05:00
parent 8fe9d7e879
commit 0e8be10b90
32 changed files with 547 additions and 440 deletions

View File

@@ -29,6 +29,8 @@
#include <TopoDS_Edge.hxx>
#endif
#include <Base/PyWrapParseTupleAndKeywords.h>
#include "ShapeUpgrade/UnifySameDomainPy.h"
#include "ShapeUpgrade/UnifySameDomainPy.cpp"
#include "PartPyCXX.h"
@@ -47,17 +49,18 @@ PyObject *UnifySameDomainPy::PyMake(struct _typeobject *, PyObject *, PyObject *
int UnifySameDomainPy::PyInit(PyObject* args, PyObject* kwds)
{
PyObject *shape;
PyObject* unifyEdges = Py_True;
PyObject* unifyFaces = Py_True;
PyObject* concatBSpl = Py_False;
PyObject *unifyEdges = Py_True; // NOLINT
PyObject *unifyFaces = Py_True; // NOLINT
PyObject *concatBSpl = Py_False; // NOLINT
static char* keywords[] = {"Shape", "UnifyEdges", "UnifyFaces", "ConcatBSplines", nullptr};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|O!O!O!", keywords,
&TopoShapePy::Type, &shape,
&PyBool_Type, &unifyEdges,
&PyBool_Type, &unifyFaces,
&PyBool_Type, &concatBSpl))
static const std::array<const char *, 5> keywords{"Shape", "UnifyEdges", "UnifyFaces", "ConcatBSplines", nullptr};
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|O!O!O!", keywords,
&TopoShapePy::Type, &shape,
&PyBool_Type, &unifyEdges,
&PyBool_Type, &unifyFaces,
&PyBool_Type, &concatBSpl)) {
return -1;
}
try {
TopoDS_Shape shp = static_cast<TopoShapePy*>(shape)->getTopoShapePtr()->getShape();
@@ -78,17 +81,18 @@ int UnifySameDomainPy::PyInit(PyObject* args, PyObject* kwds)
PyObject* UnifySameDomainPy::initialize(PyObject *args, PyObject* kwds)
{
PyObject *shape;
PyObject* unifyEdges = Py_True;
PyObject* unifyFaces = Py_True;
PyObject* concatBSpl = Py_False;
PyObject *unifyEdges = Py_True;
PyObject *unifyFaces = Py_True;
PyObject *concatBSpl = Py_False;
static char* keywords[] = {"Shape", "UnifyEdges", "UnifyFaces", "ConcatBSplines", nullptr};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|O!O!O!", keywords,
&TopoShapePy::Type, &shape,
&PyBool_Type, &unifyEdges,
&PyBool_Type, &unifyFaces,
&PyBool_Type, &concatBSpl))
static const std::array<const char *, 5> keywords{"Shape", "UnifyEdges", "UnifyFaces", "ConcatBSplines", nullptr};
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|O!O!O!", keywords,
&TopoShapePy::Type, &shape,
&PyBool_Type, &unifyEdges,
&PyBool_Type, &unifyFaces,
&PyBool_Type, &concatBSpl)) {
return nullptr;
}
try {
TopoDS_Shape shp = static_cast<TopoShapePy*>(shape)->getTopoShapePtr()->getShape();