9 #include "../BPy_Convert.h"
10 #include "../BPy_IntegrationType.h"
11 #include "../BPy_Interface1D.h"
64 "Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DVectorViewShape`\n"
66 "Base class for unary functions (functors) that work on\n"
67 ":class:`Interface1D` and return a list of :class:`ViewShape`\n"
70 ".. method:: __init__()\n"
71 " __init__(integration_type)\n"
73 " Builds a unary 1D function using the default constructor\n"
74 " or the integration method given as an argument.\n"
76 " :arg integration_type: An integration method.\n"
77 " :type integration_type: :class:`IntegrationType`\n";
83 static const char *kwlist[] = {
"integration",
nullptr};
84 PyObject *obj =
nullptr;
86 if (!PyArg_ParseTupleAndKeywords(
99 self->uf1D_vectorviewshape->
py_uf1D = (PyObject *)
self;
106 delete self->uf1D_vectorviewshape;
112 return PyUnicode_FromFormat(
113 "type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->uf1D_vectorviewshape);
120 static const char *kwlist[] = {
"inter",
nullptr};
121 PyObject *obj =
nullptr;
123 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist, &
Interface1D_Type, &obj)) {
127 if (
typeid(*(
self->uf1D_vectorviewshape)) ==
typeid(
UnaryFunction1D<std::vector<ViewShape *>>)) {
128 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
132 if (!PyErr_Occurred()) {
133 string class_name(Py_TYPE(
self)->tp_name);
134 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
139 const unsigned int list_len =
self->uf1D_vectorviewshape->result.size();
140 PyObject *list = PyList_New(list_len);
141 for (
unsigned int i = 0; i < list_len; i++) {
142 ViewShape *
v =
self->uf1D_vectorviewshape->result[i];
152 "The integration method.\n"
154 ":type: :class:`IntegrationType`");
160 self->uf1D_vectorviewshape->getIntegrationType());
168 PyErr_SetString(PyExc_TypeError,
"value must be an IntegrationType");
179 integration_type_doc,
181 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
187 PyVarObject_HEAD_INIT(
nullptr, 0)
"UnaryFunction1DVectorViewShape",
205 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * BPy_ViewShape_from_ViewShape(ViewShape &vs)
PyObject * BPy_IntegrationType_from_IntegrationType(IntegrationType i)
IntegrationType IntegrationType_from_BPy_IntegrationType(PyObject *obj)
PyTypeObject GetOccludeeF1D_Type
PyTypeObject GetOccludersF1D_Type
PyTypeObject GetShapeF1D_Type
PyTypeObject IntegrationType_Type
#define BPy_IntegrationType_Check(v)
PyTypeObject Interface1D_Type
PyDoc_STRVAR(integration_type_doc, "The integration method.\n" "\n" ":type: :class:`IntegrationType`")
static PyObject * integration_type_get(BPy_UnaryFunction1DVectorViewShape *self, void *UNUSED(closure))
static PyObject * UnaryFunction1DVectorViewShape___call__(BPy_UnaryFunction1DVectorViewShape *self, PyObject *args, PyObject *kwds)
static int UnaryFunction1DVectorViewShape___init__(BPy_UnaryFunction1DVectorViewShape *self, PyObject *args, PyObject *kwds)
static char UnaryFunction1DVectorViewShape___doc__[]
static PyGetSetDef BPy_UnaryFunction1DVectorViewShape_getseters[]
PyTypeObject UnaryFunction1DVectorViewShape_Type
static PyObject * UnaryFunction1DVectorViewShape___repr__(BPy_UnaryFunction1DVectorViewShape *self)
int UnaryFunction1DVectorViewShape_Init(PyObject *module)
static void UnaryFunction1DVectorViewShape___dealloc__(BPy_UnaryFunction1DVectorViewShape *self)
static int integration_type_set(BPy_UnaryFunction1DVectorViewShape *self, PyObject *value, void *UNUSED(closure))
PyTypeObject UnaryFunction1D_Type
ATTR_WARN_UNUSED_RESULT const BMVert * v
static struct PyModuleDef module