54 PyModule_AddObjectRef(
75 PyModule_AddObjectRef(
91 PyModule_AddObjectRef(
101 UnaryPredicate1D___doc__,
102 "Base class for unary predicates that work on :class:`Interface1D`. A\n"
103 "UnaryPredicate1D is a functor that evaluates a condition on a\n"
104 "Interface1D and returns true or false depending on whether this\n"
105 "condition is satisfied or not. The UnaryPredicate1D is used by\n"
106 "invoking its __call__() method. Any inherited class must overload the\n"
107 "__call__() method.\n"
109 ".. method:: __init__()\n"
111 " Default constructor.\n"
113 ".. method:: __call__(inter)\n"
115 " Must be overload by inherited classes.\n"
117 " :arg inter: The Interface1D on which we wish to evaluate the predicate.\n"
118 " :type inter: :class:`Interface1D`\n"
119 " :return: True if the condition is satisfied, false otherwise.\n"
123 static const char *kwlist[] = {
nullptr};
125 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
129 self->up1D->py_up1D = (PyObject *)
self;
136 Py_TYPE(
self)->tp_free((PyObject *)
self);
141 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->up1D);
148 static const char *kwlist[] = {
"inter",
nullptr};
151 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist, &
Interface1D_Type, &py_if1D))
159 string class_name(Py_TYPE(
self)->tp_name);
160 PyErr_SetString(PyExc_RuntimeError, (class_name +
" has no Interface1D").c_str());
164 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
167 if (
self->up1D->operator()(*if1D) < 0) {
168 if (!PyErr_Occurred()) {
169 string class_name(Py_TYPE(
self)->tp_name);
170 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
181 UnaryPredicate1D_name_doc,
182 "The name of the unary 1D predicate.\n"
187 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
194 UnaryPredicate1D_name_doc,
196 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
202 PyVarObject_HEAD_INIT(
nullptr, 0)
221 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
222 UnaryPredicate1D___doc__,
PyTypeObject ContourUP1D_Type
PyObject * PyBool_from_bool(bool b)
PyTypeObject DensityLowerThanUP1D_Type
PyTypeObject EqualToChainingTimeStampUP1D_Type
PyTypeObject EqualToTimeStampUP1D_Type
PyTypeObject ExternalContourUP1D_Type
PyTypeObject FalseUP1D_Type
PyTypeObject Interface1D_Type
PyTypeObject QuantitativeInvisibilityUP1D_Type
PyTypeObject ShapeUP1D_Type
PyTypeObject TrueUP1D_Type
PyDoc_STRVAR(UnaryPredicate1D___doc__, "Base class for unary predicates that work on :class:`Interface1D`. A\n" "UnaryPredicate1D is a functor that evaluates a condition on a\n" "Interface1D and returns true or false depending on whether this\n" "condition is satisfied or not. The UnaryPredicate1D is used by\n" "invoking its __call__() method. Any inherited class must overload the\n" "__call__() method.\n" "\n" ".. method:: __init__()\n" "\n" " Default constructor.\n" "\n" ".. method:: __call__(inter)\n" "\n" " Must be overload by inherited classes.\n" "\n" " :arg inter: The Interface1D on which we wish to evaluate the predicate.\n" " :type inter: :class:`Interface1D`\n" " :return: True if the condition is satisfied, false otherwise.\n" " :rtype: bool\n")
static PyObject * UnaryPredicate1D___repr__(BPy_UnaryPredicate1D *self)
static PyObject * UnaryPredicate1D___call__(BPy_UnaryPredicate1D *self, PyObject *args, PyObject *kwds)
static PyObject * UnaryPredicate1D_name_get(BPy_UnaryPredicate1D *self, void *)
PyTypeObject UnaryPredicate1D_Type
static PyGetSetDef BPy_UnaryPredicate1D_getseters[]
int UnaryPredicate1D_Init(PyObject *module)
static void UnaryPredicate1D___dealloc__(BPy_UnaryPredicate1D *self)
static int UnaryPredicate1D___init__(BPy_UnaryPredicate1D *self, PyObject *args, PyObject *kwds)
PyTypeObject WithinImageBoundaryUP1D_Type
static struct PyModuleDef module