22 Interface0DIterator_doc,
23 "Class hierarchy: :class:`Iterator` > :class:`Interface0DIterator`\n"
25 "Class defining an iterator over Interface0D elements. An instance of\n"
26 "this iterator is always obtained from a 1D element.\n"
28 ".. method:: __init__(brother)\n"
31 " Construct a nested Interface0DIterator using either the copy constructor\n"
32 " or the constructor that takes an he argument of a Function0D.\n"
34 " :arg brother: An Interface0DIterator object.\n"
35 " :type brother: :class:`Interface0DIterator`\n"
36 " :arg it: An iterator object to be nested.\n"
37 " :type it: :class:`SVertexIterator`, :class:`CurvePointIterator`, or\n"
38 " :class:`StrokeVertexIterator`");
56 static const char *kwlist_1[] = {
"it",
nullptr};
57 static const char *kwlist_2[] = {
"inter",
nullptr};
58 static const char *kwlist_3[] = {
"brother",
nullptr};
60 PyObject *brother, *inter;
62 if (PyArg_ParseTupleAndKeywords(
66 self->at_start =
true;
67 self->reversed =
false;
69 else if ((
void)PyErr_Clear(),
70 PyArg_ParseTupleAndKeywords(
74 self->at_start =
true;
75 self->reversed =
false;
77 else if ((
void)PyErr_Clear(),
78 PyArg_ParseTupleAndKeywords(
86 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
96 self->at_start =
true;
97 return (PyObject *)
self;
102 if (
self->reversed) {
103 if (
self->if0D_it->isBegin()) {
104 PyErr_SetNone(PyExc_StopIteration);
107 self->if0D_it->decrement();
110 if (
self->if0D_it->isEnd()) {
111 PyErr_SetNone(PyExc_StopIteration);
114 if (
self->at_start) {
115 self->at_start =
false;
117 else if (
self->if0D_it->atLast()) {
118 PyErr_SetNone(PyExc_StopIteration);
122 self->if0D_it->increment();
133 Interface0DIterator_object_doc,
134 "The 0D object currently pointed to by this iterator. Note that the object\n"
135 "may be an instance of an Interface0D subclass. For example if the iterator\n"
136 "has been created from the `vertices_begin()` method of the :class:`Stroke`\n"
137 "class, the .object property refers to a :class:`StrokeVertex` object.\n"
139 ":type: :class:`Interface0D` or one of its subclasses.");
143 if (
self->if0D_it->isEnd()) {
144 PyErr_SetString(PyExc_RuntimeError,
"iteration has stopped");
152 Interface0DIterator_t_doc,
153 "The curvilinear abscissa of the current point.\n"
159 return PyFloat_FromDouble(
self->if0D_it->t());
164 Interface0DIterator_u_doc,
165 "The point parameter at the current point in the 1D element (0 <= u <= 1).\n"
171 return PyFloat_FromDouble(
self->if0D_it->u());
176 Interface0DIterator_at_last_doc,
177 "True if the iterator points to the last valid element.\n"
178 "For its counterpart (pointing to the first valid element), use it.is_begin.\n"
191 Interface0DIterator_object_doc,
198 Interface0DIterator_at_last_doc,
200 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
206 PyVarObject_HEAD_INIT(
nullptr, 0)
207 "Interface0DIterator",
225 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
226 Interface0DIterator_doc,
PyObject * PyBool_from_bool(bool b)
PyObject * Any_BPy_Interface0D_from_Interface0D(Interface0D &if0D)
static PyObject * Interface0DIterator_object_get(BPy_Interface0DIterator *self, void *)
static int Interface0DIterator_init(BPy_Interface0DIterator *self, PyObject *args, PyObject *kwds)
static PyObject * Interface0DIterator_t_get(BPy_Interface0DIterator *self, void *)
static int convert_nested_it(PyObject *obj, void *v)
static PyObject * Interface0DIterator_iternext(BPy_Interface0DIterator *self)
static PyObject * Interface0DIterator_at_last_get(BPy_Interface0DIterator *self, void *)
static PyObject * Interface0DIterator_u_get(BPy_Interface0DIterator *self, void *)
static PyGetSetDef BPy_Interface0DIterator_getseters[]
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 Interface0DIterator_Type
static PyObject * Interface0DIterator_iter(BPy_Interface0DIterator *self)
PyTypeObject Interface1D_Type
PyTypeObject Iterator_Type
#define BPy_Iterator_Check(v)
ATTR_WARN_UNUSED_RESULT const BMVert * v