9 #include "../BPy_Convert.h"
10 #include "../BPy_IntegrationType.h"
11 #include "../BPy_Interface1D.h"
56 "Class hierarchy: :class:`UnaryFunction1D` > :class:`UnaryFunction1DVec2f`\n"
58 "Base class for unary functions (functors) that work on\n"
59 ":class:`Interface1D` and return a 2D vector.\n"
61 ".. method:: __init__()\n"
62 " __init__(integration_type)\n"
64 " Builds a unary 1D function using the default constructor\n"
65 " or the integration method given as an argument.\n"
67 " :arg integration_type: An integration method.\n"
68 " :type integration_type: :class:`IntegrationType`\n";
74 static const char *kwlist[] = {
"integration",
nullptr};
75 PyObject *obj =
nullptr;
77 if (!PyArg_ParseTupleAndKeywords(
89 self->uf1D_vec2f->py_uf1D = (PyObject *)
self;
96 delete self->uf1D_vec2f;
102 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->uf1D_vec2f);
109 static const char *kwlist[] = {
"inter",
nullptr};
110 PyObject *obj =
nullptr;
112 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist, &
Interface1D_Type, &obj)) {
117 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
121 if (!PyErr_Occurred()) {
122 string class_name(Py_TYPE(
self)->tp_name);
123 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
133 "The integration method.\n"
135 ":type: :class:`IntegrationType`");
147 PyErr_SetString(PyExc_TypeError,
"value must be an IntegrationType");
158 integration_type_doc,
160 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
166 PyVarObject_HEAD_INIT(
nullptr, 0)
"UnaryFunction1DVec2f",
184 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * BPy_IntegrationType_from_IntegrationType(IntegrationType i)
PyObject * Vector_from_Vec2f(Vec2f &vec)
IntegrationType IntegrationType_from_BPy_IntegrationType(PyObject *obj)
PyTypeObject IntegrationType_Type
#define BPy_IntegrationType_Check(v)
PyTypeObject Interface1D_Type
PyTypeObject Normal2DF1D_Type
PyTypeObject Orientation2DF1D_Type
PyDoc_STRVAR(integration_type_doc, "The integration method.\n" "\n" ":type: :class:`IntegrationType`")
static PyGetSetDef BPy_UnaryFunction1DVec2f_getseters[]
static int UnaryFunction1DVec2f___init__(BPy_UnaryFunction1DVec2f *self, PyObject *args, PyObject *kwds)
static PyObject * integration_type_get(BPy_UnaryFunction1DVec2f *self, void *UNUSED(closure))
static PyObject * UnaryFunction1DVec2f___repr__(BPy_UnaryFunction1DVec2f *self)
static void UnaryFunction1DVec2f___dealloc__(BPy_UnaryFunction1DVec2f *self)
static PyObject * UnaryFunction1DVec2f___call__(BPy_UnaryFunction1DVec2f *self, PyObject *args, PyObject *kwds)
static char UnaryFunction1DVec2f___doc__[]
static int integration_type_set(BPy_UnaryFunction1DVec2f *self, PyObject *value, void *UNUSED(closure))
PyTypeObject UnaryFunction1DVec2f_Type
int UnaryFunction1DVec2f_Init(PyObject *module)
PyTypeObject UnaryFunction1D_Type
static struct PyModuleDef module