63 PyModule_AddObjectRef(
73 BinaryPredicate1D___doc__,
74 "Base class for binary predicates working on :class:`Interface1D`\n"
75 "objects. A BinaryPredicate1D is typically an ordering relation\n"
76 "between two Interface1D objects. The predicate evaluates a relation\n"
77 "between the two Interface1D instances and returns a boolean value (true\n"
78 "or false). It is used by invoking the __call__() method.\n"
80 ".. method:: __init__()\n"
82 " Default constructor.\n"
84 ".. method:: __call__(inter1, inter2)\n"
86 " Must be overload by inherited classes. It evaluates a relation\n"
87 " between two Interface1D objects.\n"
89 " :arg inter1: The first Interface1D object.\n"
90 " :type inter1: :class:`Interface1D`\n"
91 " :arg inter2: The second Interface1D object.\n"
92 " :type inter2: :class:`Interface1D`\n"
93 " :return: True or false.\n"
98 static const char *kwlist[] = {
nullptr};
100 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
104 self->bp1D->py_bp1D = (PyObject *)
self;
111 Py_TYPE(
self)->tp_free((PyObject *)
self);
116 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->bp1D);
123 static const char *kwlist[] = {
"inter1",
"inter2",
nullptr};
126 if (!PyArg_ParseTupleAndKeywords(
132 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
135 if (
self->bp1D->operator()(*(obj1->
if1D), *(obj2->
if1D)) < 0) {
136 if (!PyErr_Occurred()) {
137 string class_name(Py_TYPE(
self)->tp_name);
138 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
149 BinaryPredicate1D_name_doc,
150 "The name of the binary 1D predicate.\n"
156 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
163 BinaryPredicate1D_name_doc,
165 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
171 PyVarObject_HEAD_INIT(
nullptr, 0)
190 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
191 BinaryPredicate1D___doc__,
PyDoc_STRVAR(BinaryPredicate1D___doc__, "Base class for binary predicates working on :class:`Interface1D`\n" "objects. A BinaryPredicate1D is typically an ordering relation\n" "between two Interface1D objects. The predicate evaluates a relation\n" "between the two Interface1D instances and returns a boolean value (true\n" "or false). It is used by invoking the __call__() method.\n" "\n" ".. method:: __init__()\n" "\n" " Default constructor.\n" "\n" ".. method:: __call__(inter1, inter2)\n" "\n" " Must be overload by inherited classes. It evaluates a relation\n" " between two Interface1D objects.\n" "\n" " :arg inter1: The first Interface1D object.\n" " :type inter1: :class:`Interface1D`\n" " :arg inter2: The second Interface1D object.\n" " :type inter2: :class:`Interface1D`\n" " :return: True or false.\n" " :rtype: bool\n")
static PyGetSetDef BPy_BinaryPredicate1D_getseters[]
static PyObject * BinaryPredicate1D___repr__(BPy_BinaryPredicate1D *self)
int BinaryPredicate1D_Init(PyObject *module)
PyTypeObject BinaryPredicate1D_Type
static PyObject * BinaryPredicate1D_name_get(BPy_BinaryPredicate1D *self, void *)
static int BinaryPredicate1D___init__(BPy_BinaryPredicate1D *self, PyObject *args, PyObject *kwds)
static PyObject * BinaryPredicate1D___call__(BPy_BinaryPredicate1D *self, PyObject *args, PyObject *kwds)
static void BinaryPredicate1D___dealloc__(BPy_BinaryPredicate1D *self)
PyObject * PyBool_from_bool(bool b)
PyTypeObject FalseBP1D_Type
PyTypeObject Interface1D_Type
PyTypeObject Length2DBP1D_Type
PyTypeObject SameShapeIdBP1D_Type
PyTypeObject TrueBP1D_Type
PyTypeObject ViewMapGradientNormBP1D_Type
static struct PyModuleDef module
PyObject_HEAD Freestyle::Interface1D * if1D