23 if (module ==
nullptr) {
35 PyModule_AddObjectRef(module,
"FalseUP0D", (PyObject *)&
FalseUP0D_Type);
40 PyModule_AddObjectRef(module,
"TrueUP0D", (PyObject *)&
TrueUP0D_Type);
49 UnaryPredicate0D___doc__,
50 "Base class for unary predicates that work on\n"
51 ":class:`Interface0DIterator`. A UnaryPredicate0D is a functor that\n"
52 "evaluates a condition on an Interface0DIterator and returns true or\n"
53 "false depending on whether this condition is satisfied or not. The\n"
54 "UnaryPredicate0D is used by invoking its __call__() method. Any\n"
55 "inherited class must overload the __call__() method.\n"
57 ".. method:: __init__()\n"
59 " Default constructor.\n"
61 ".. method:: __call__(it)\n"
63 " Must be overload by inherited classes.\n"
65 " :arg it: The Interface0DIterator pointing onto the Interface0D at\n"
66 " which we wish to evaluate the predicate.\n"
67 " :type it: :class:`Interface0DIterator`\n"
68 " :return: True if the condition is satisfied, false otherwise.\n"
73 static const char *kwlist[] = {
nullptr};
75 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
86 Py_TYPE(self)->tp_free((PyObject *)self);
91 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(self)->tp_name, self->
up0D);
98 static const char *kwlist[] = {
"it",
nullptr};
101 if (!PyArg_ParseTupleAndKeywords(
110 string class_name(Py_TYPE(self)->tp_name);
111 PyErr_SetString(PyExc_RuntimeError, (class_name +
" has no Interface0DIterator").c_str());
115 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
118 if (self->
up0D->operator()(*if0D_it) < 0) {
119 if (!PyErr_Occurred()) {
120 string class_name(Py_TYPE(self)->tp_name);
121 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
132 UnaryPredicate0D_name_doc,
133 "The name of the unary 0D predicate.\n"
139 return PyUnicode_FromString(Py_TYPE(self)->tp_name);
146 UnaryPredicate0D_name_doc,
148 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
154 PyVarObject_HEAD_INIT(
nullptr, 0)
173 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
174 UnaryPredicate0D___doc__,
PyObject * PyBool_from_bool(bool b)
PyDoc_STRVAR(FalseBP1D___doc__, "Class hierarchy: :class:`freestyle.types.BinaryPredicate1D` > :class:`FalseBP1D`\n" "\n" ".. method:: __call__(inter1, inter2)\n" "\n" " Always returns false.\n" "\n" " :arg inter1: The first Interface1D object.\n" " :type inter1: :class:`freestyle.types.Interface1D`\n" " :arg inter2: The second Interface1D object.\n" " :type inter2: :class:`freestyle.types.Interface1D`\n" " :return: False.\n" " :rtype: bool\n")
PyTypeObject FalseUP0D_Type
PyTypeObject Interface0DIterator_Type
PyTypeObject TrueUP0D_Type
static PyObject * UnaryPredicate0D_name_get(BPy_UnaryPredicate0D *self, void *)
int UnaryPredicate0D_Init(PyObject *module)
PyTypeObject UnaryPredicate0D_Type
static PyObject * UnaryPredicate0D___repr__(BPy_UnaryPredicate0D *self)
static void UnaryPredicate0D___dealloc__(BPy_UnaryPredicate0D *self)
static int UnaryPredicate0D___init__(BPy_UnaryPredicate0D *self, PyObject *args, PyObject *kwds)
static PyObject * UnaryPredicate0D___call__(BPy_UnaryPredicate0D *self, PyObject *args, PyObject *kwds)
static PyGetSetDef BPy_UnaryPredicate0D_getseters[]
PyObject_HEAD Freestyle::UnaryPredicate0D * up0D