89 "Base class for binary predicates working on :class:`Interface1D`\n"
90 "objects. A BinaryPredicate1D is typically an ordering relation\n"
91 "between two Interface1D objects. The predicate evaluates a relation\n"
92 "between the two Interface1D instances and returns a boolean value (true\n"
93 "or false). It is used by invoking the __call__() method.\n"
95 ".. method:: __init__()\n"
97 " Default constructor.\n"
99 ".. method:: __call__(inter1, inter2)\n"
101 " Must be overload by inherited classes. It evaluates a relation\n"
102 " between two Interface1D objects.\n"
104 " :arg inter1: The first Interface1D object.\n"
105 " :type inter1: :class:`Interface1D`\n"
106 " :arg inter2: The second Interface1D object.\n"
107 " :type inter2: :class:`Interface1D`\n"
108 " :return: True or false.\n"
113 static const char *kwlist[] = {
nullptr};
115 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
119 self->bp1D->py_bp1D = (PyObject *)
self;
126 Py_TYPE(
self)->tp_free((PyObject *)
self);
131 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->bp1D);
138 static const char *kwlist[] = {
"inter1",
"inter2",
nullptr};
141 if (!PyArg_ParseTupleAndKeywords(args,
152 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
155 if (
self->bp1D->operator()(*(obj1->
if1D), *(obj2->
if1D)) < 0) {
156 if (!PyErr_Occurred()) {
157 string class_name(Py_TYPE(
self)->tp_name);
158 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
168 "The name of the binary 1D predicate.\n"
174 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
181 BinaryPredicate1D_name_doc,
183 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
188 PyVarObject_HEAD_INIT(
nullptr, 0)
"BinaryPredicate1D",
206 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