23 #include "../BPy_Convert.h"
24 #include "../BPy_Interface1D.h"
37 "Class hierarchy: :class:`Iterator` > :class:`Interface0DIterator`\n"
39 "Class defining an iterator over Interface0D elements. An instance of\n"
40 "this iterator is always obtained from a 1D element.\n"
42 ".. method:: __init__(brother)\n"
45 " Construct a nested Interface0DIterator using either the copy constructor\n"
46 " or the constructor that takes an he argument of a Function0D.\n"
48 " :arg brother: An Interface0DIterator object.\n"
49 " :type brother: :class:`Interface0DIterator`\n"
50 " :arg it: An iterator object to be nested.\n"
51 " :type it: :class:`SVertexIterator`, :class:`CurvePointIterator`, or\n"
52 " :class:`StrokeVertexIterator`");
70 static const char *kwlist_1[] = {
"it",
nullptr};
71 static const char *kwlist_2[] = {
"inter",
nullptr};
72 static const char *kwlist_3[] = {
"brother",
nullptr};
74 PyObject *brother, *inter;
76 if (PyArg_ParseTupleAndKeywords(
79 self->at_start =
true;
80 self->reversed =
false;
82 else if ((
void)PyErr_Clear(),
83 PyArg_ParseTupleAndKeywords(
86 self->at_start =
true;
87 self->reversed =
false;
89 else if ((
void)PyErr_Clear(),
90 PyArg_ParseTupleAndKeywords(
97 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
100 self->py_it.it =
self->if0D_it;
107 self->at_start =
true;
108 return (PyObject *)
self;
113 if (
self->reversed) {
114 if (
self->if0D_it->isBegin()) {
115 PyErr_SetNone(PyExc_StopIteration);
118 self->if0D_it->decrement();
121 if (
self->if0D_it->isEnd()) {
122 PyErr_SetNone(PyExc_StopIteration);
125 if (
self->at_start) {
126 self->at_start =
false;
128 else if (
self->if0D_it->atLast()) {
129 PyErr_SetNone(PyExc_StopIteration);
133 self->if0D_it->increment();
143 "The 0D object currently pointed to by this iterator. Note that the object\n"
144 "may be an instance of an Interface0D subclass. For example if the iterator\n"
145 "has been created from the `vertices_begin()` method of the :class:`Stroke`\n"
146 "class, the .object property refers to a :class:`StrokeVertex` object.\n"
148 ":type: :class:`Interface0D` or one of its subclasses.");
153 if (
self->if0D_it->isEnd()) {
154 PyErr_SetString(PyExc_RuntimeError,
"iteration has stopped");
161 "The curvilinear abscissa of the current point.\n"
167 return PyFloat_FromDouble(
self->if0D_it->t());
171 "The point parameter at the current point in the 1D element (0 <= u <= 1).\n"
177 return PyFloat_FromDouble(
self->if0D_it->u());
181 "True if the iterator points to the last valid element.\n"
182 "For its counterpart (pointing to the first valid element), use it.is_begin.\n"
196 Interface0DIterator_object_doc,
203 Interface0DIterator_at_last_doc,
205 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
211 PyVarObject_HEAD_INIT(
nullptr, 0)
"Interface0DIterator",
229 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
230 Interface0DIterator_doc,
PyObject * PyBool_from_bool(bool b)
PyObject * Any_BPy_Interface0D_from_Interface0D(Interface0D &if0D)
static PyObject * Interface0DIterator_iternext(BPy_Interface0DIterator *self)
static int Interface0DIterator_init(BPy_Interface0DIterator *self, PyObject *args, PyObject *kwds)
static PyObject * Interface0DIterator_u_get(BPy_Interface0DIterator *self, void *UNUSED(closure))
static PyObject * Interface0DIterator_object_get(BPy_Interface0DIterator *self, void *UNUSED(closure))
static int convert_nested_it(PyObject *obj, void *v)
static PyObject * Interface0DIterator_iter(BPy_Interface0DIterator *self)
static PyObject * Interface0DIterator_t_get(BPy_Interface0DIterator *self, void *UNUSED(closure))
static PyObject * Interface0DIterator_at_last_get(BPy_Interface0DIterator *self, void *UNUSED(closure))
static PyGetSetDef BPy_Interface0DIterator_getseters[]
PyTypeObject Interface0DIterator_Type
PyDoc_STRVAR(Interface0DIterator_doc, "Class hierarchy: :class:`Iterator` > :class:`Interface0DIterator`\n" "\n" "Class defining an iterator over Interface0D elements. An instance of\n" "this iterator is always obtained from a 1D element.\n" "\n" ".. method:: __init__(brother)\n" " __init__(it)\n" "\n" " Construct a nested Interface0DIterator using either the copy constructor\n" " or the constructor that takes an he argument of a Function0D.\n" "\n" " :arg brother: An Interface0DIterator object.\n" " :type brother: :class:`Interface0DIterator`\n" " :arg it: An iterator object to be nested.\n" " :type it: :class:`SVertexIterator`, :class:`CurvePointIterator`, or\n" " :class:`StrokeVertexIterator`")
PyTypeObject Interface1D_Type
PyTypeObject Iterator_Type
#define BPy_Iterator_Check(v)
ATTR_WARN_UNUSED_RESULT const BMVert * v