58 PyModule_AddObjectRef(
79 PyModule_AddObjectRef(
95 PyModule_AddObjectRef(
105 UnaryPredicate1D___doc__,
106 "Base class for unary predicates that work on :class:`Interface1D`. A\n"
107 "UnaryPredicate1D is a functor that evaluates a condition on a\n"
108 "Interface1D and returns true or false depending on whether this\n"
109 "condition is satisfied or not. The UnaryPredicate1D is used by\n"
110 "invoking its __call__() method. Any inherited class must overload the\n"
111 "__call__() method.\n"
113 ".. method:: __init__()\n"
115 " Default constructor.\n"
117 ".. method:: __call__(inter)\n"
119 " Must be overload by inherited classes.\n"
121 " :arg inter: The Interface1D on which we wish to evaluate the predicate.\n"
122 " :type inter: :class:`Interface1D`\n"
123 " :return: True if the condition is satisfied, false otherwise.\n"
128 static const char *kwlist[] = {
nullptr};
130 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
134 self->up1D->py_up1D = (PyObject *)
self;
141 Py_TYPE(
self)->tp_free((PyObject *)
self);
146 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->up1D);
153 static const char *kwlist[] = {
"inter",
nullptr};
156 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist, &
Interface1D_Type, &py_if1D))
164 string class_name(Py_TYPE(
self)->tp_name);
165 PyErr_SetString(PyExc_RuntimeError, (class_name +
" has no Interface1D").c_str());
169 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
172 if (
self->up1D->operator()(*if1D) < 0) {
173 if (!PyErr_Occurred()) {
174 string class_name(Py_TYPE(
self)->tp_name);
175 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
186 UnaryPredicate1D_name_doc,
187 "The name of the unary 1D predicate.\n"
193 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
200 UnaryPredicate1D_name_doc,
202 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
208 PyVarObject_HEAD_INIT(
nullptr, 0)
227 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
228 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