75 "Base class for binary predicates working on :class:`Interface1D`\n"
76 "objects. A BinaryPredicate1D is typically an ordering relation\n"
77 "between two Interface1D objects. The predicate evaluates a relation\n"
78 "between the two Interface1D instances and returns a boolean value (true\n"
79 "or false). It is used by invoking the __call__() method.\n"
81 ".. method:: __init__()\n"
83 " Default constructor.\n"
85 ".. method:: __call__(inter1, inter2)\n"
87 " Must be overload by inherited classes. It evaluates a relation\n"
88 " between two Interface1D objects.\n"
90 " :arg inter1: The first Interface1D object.\n"
91 " :type inter1: :class:`Interface1D`\n"
92 " :arg inter2: The second Interface1D object.\n"
93 " :type inter2: :class:`Interface1D`\n"
94 " :return: True or false.\n"
99 static const char *kwlist[] = {
nullptr};
101 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
105 self->bp1D->py_bp1D = (PyObject *)
self;
112 Py_TYPE(
self)->tp_free((PyObject *)
self);
117 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->bp1D);
124 static const char *kwlist[] = {
"inter1",
"inter2",
nullptr};
127 if (!PyArg_ParseTupleAndKeywords(args,
138 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
141 if (
self->bp1D->operator()(*(obj1->
if1D), *(obj2->
if1D)) < 0) {
142 if (!PyErr_Occurred()) {
143 string class_name(Py_TYPE(
self)->tp_name);
144 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
154 "The name of the binary 1D predicate.\n"
160 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
167 BinaryPredicate1D_name_doc,
169 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
174 PyVarObject_HEAD_INIT(
nullptr, 0)
"BinaryPredicate1D",
192 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
static PyGetSetDef BPy_BinaryPredicate1D_getseters[]
static char BinaryPredicate1D___doc__[]
int BinaryPredicate1D_Init(PyObject *module)
PyTypeObject BinaryPredicate1D_Type
static PyObject * BinaryPredicate1D___repr__(BPy_BinaryPredicate1D *self)
static PyObject * BinaryPredicate1D_name_get(BPy_BinaryPredicate1D *self, void *UNUSED(closure))
PyDoc_STRVAR(BinaryPredicate1D_name_doc, "The name of the binary 1D predicate.\n" "\n" ":type: str")
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