41 BinaryPredicate0D___doc__,
42 "Base class for binary predicates working on :class:`Interface0D`\n"
43 "objects. A BinaryPredicate0D is typically an ordering relation\n"
44 "between two Interface0D objects. The predicate evaluates a relation\n"
45 "between the two Interface0D instances and returns a boolean value (true\n"
46 "or false). It is used by invoking the __call__() method.\n"
48 ".. method:: __init__()\n"
50 " Default constructor.\n"
52 ".. method:: __call__(inter1, inter2)\n"
54 " Must be overload by inherited classes. It evaluates a relation\n"
55 " between two Interface0D objects.\n"
57 " :arg inter1: The first Interface0D object.\n"
58 " :type inter1: :class:`Interface0D`\n"
59 " :arg inter2: The second Interface0D object.\n"
60 " :type inter2: :class:`Interface0D`\n"
61 " :return: True or false.\n"
66 static const char *kwlist[] = {
nullptr};
68 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
72 self->bp0D->py_bp0D = (PyObject *)
self;
80 Py_TYPE(
self)->tp_free((PyObject *)
self);
85 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->bp0D);
92 static const char *kwlist[] = {
"inter1",
"inter2",
nullptr};
95 if (!PyArg_ParseTupleAndKeywords(
101 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
104 if (
self->bp0D->operator()(*(obj1->
if0D), *(obj2->
if0D)) < 0) {
105 if (!PyErr_Occurred()) {
106 string class_name(Py_TYPE(
self)->tp_name);
107 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
118 BinaryPredicate0D_name_doc,
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)
159 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
160 BinaryPredicate0D___doc__,
PyTypeObject BinaryPredicate0D_Type
static PyObject * BinaryPredicate0D___call__(BPy_BinaryPredicate0D *self, PyObject *args, PyObject *kwds)
static void BinaryPredicate0D___dealloc__(BPy_BinaryPredicate0D *self)
static PyObject * BinaryPredicate0D___repr__(BPy_BinaryPredicate0D *self)
static int BinaryPredicate0D___init__(BPy_BinaryPredicate0D *self, PyObject *args, PyObject *kwds)
static PyGetSetDef BPy_BinaryPredicate0D_getseters[]
PyDoc_STRVAR(BinaryPredicate0D___doc__, "Base class for binary predicates working on :class:`Interface0D`\n" "objects. A BinaryPredicate0D is typically an ordering relation\n" "between two Interface0D objects. The predicate evaluates a relation\n" "between the two Interface0D 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 Interface0D objects.\n" "\n" " :arg inter1: The first Interface0D object.\n" " :type inter1: :class:`Interface0D`\n" " :arg inter2: The second Interface0D object.\n" " :type inter2: :class:`Interface0D`\n" " :return: True or false.\n" " :rtype: bool\n")
static PyObject * BinaryPredicate0D_name_get(BPy_BinaryPredicate0D *self, void *)
int BinaryPredicate0D_Init(PyObject *module)
PyObject * PyBool_from_bool(bool b)
PyTypeObject Interface0D_Type
static struct PyModuleDef module
PyObject_HEAD Freestyle::Interface0D * if0D