39 "Base class for binary predicates working on :class:`Interface0D`\n"
40 "objects. A BinaryPredicate0D is typically an ordering relation\n"
41 "between two Interface0D objects. The predicate evaluates a relation\n"
42 "between the two Interface0D instances and returns a boolean value (true\n"
43 "or false). It is used by invoking the __call__() method.\n"
45 ".. method:: __init__()\n"
47 " Default constructor.\n"
49 ".. method:: __call__(inter1, inter2)\n"
51 " Must be overload by inherited classes. It evaluates a relation\n"
52 " between two Interface0D objects.\n"
54 " :arg inter1: The first Interface0D object.\n"
55 " :type inter1: :class:`Interface0D`\n"
56 " :arg inter2: The second Interface0D object.\n"
57 " :type inter2: :class:`Interface0D`\n"
58 " :return: True or false.\n"
63 static const char *kwlist[] = {
nullptr};
65 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
69 self->bp0D->py_bp0D = (PyObject *)
self;
77 Py_TYPE(
self)->tp_free((PyObject *)
self);
82 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->bp0D);
89 static const char *kwlist[] = {
"inter1",
"inter2",
nullptr};
92 if (!PyArg_ParseTupleAndKeywords(args,
103 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
106 if (
self->bp0D->operator()(*(obj1->
if0D), *(obj2->
if0D)) < 0) {
107 if (!PyErr_Occurred()) {
108 string class_name(Py_TYPE(
self)->tp_name);
109 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
119 "The name of the binary 0D predicate.\n"
125 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
132 BinaryPredicate0D_name_doc,
134 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
140 PyVarObject_HEAD_INIT(
nullptr, 0)
"BinaryPredicate0D",
158 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
static PyObject * BinaryPredicate0D___repr__(BPy_BinaryPredicate0D *self)
PyTypeObject BinaryPredicate0D_Type
PyDoc_STRVAR(BinaryPredicate0D_name_doc, "The name of the binary 0D predicate.\n" "\n" ":type: str")
static void BinaryPredicate0D___dealloc__(BPy_BinaryPredicate0D *self)
static int BinaryPredicate0D___init__(BPy_BinaryPredicate0D *self, PyObject *args, PyObject *kwds)
static PyGetSetDef BPy_BinaryPredicate0D_getseters[]
static char BinaryPredicate0D___doc__[]
static PyObject * BinaryPredicate0D_name_get(BPy_BinaryPredicate0D *self, void *UNUSED(closure))
static PyObject * BinaryPredicate0D___call__(BPy_BinaryPredicate0D *self, PyObject *args, PyObject *kwds)
int BinaryPredicate0D_Init(PyObject *module)
PyObject * PyBool_from_bool(bool b)
PyTypeObject Interface0D_Type
static struct PyModuleDef module
PyObject_HEAD Freestyle::Interface0D * if0D