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 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` | "
38 ":class:`StrokeVertexIterator`\n");
55 static const char *kwlist_1[] = {
"it",
nullptr};
56 static const char *kwlist_2[] = {
"inter",
nullptr};
57 static const char *kwlist_3[] = {
"brother",
nullptr};
59 PyObject *brother, *inter;
61 if (PyArg_ParseTupleAndKeywords(
65 self->at_start =
true;
66 self->reversed =
false;
68 else if ((
void)PyErr_Clear(),
69 PyArg_ParseTupleAndKeywords(
73 self->at_start =
true;
74 self->reversed =
false;
76 else if ((
void)PyErr_Clear(),
77 PyArg_ParseTupleAndKeywords(
85 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
95 self->at_start =
true;
96 return (PyObject *)
self;
101 if (
self->reversed) {
102 if (
self->if0D_it->isBegin()) {
103 PyErr_SetNone(PyExc_StopIteration);
106 self->if0D_it->decrement();
109 if (
self->if0D_it->isEnd()) {
110 PyErr_SetNone(PyExc_StopIteration);
113 if (
self->at_start) {
114 self->at_start =
false;
116 else if (
self->if0D_it->atLast()) {
117 PyErr_SetNone(PyExc_StopIteration);
121 self->if0D_it->increment();
132 Interface0DIterator_object_doc,
133 "The 0D object currently pointed to by this iterator. Note that the object\n"
134 "may be an instance of an Interface0D subclass. For example if the iterator\n"
135 "has been created from the `vertices_begin()` method of the :class:`Stroke`\n"
136 "class, the .object property refers to a :class:`StrokeVertex` object.\n"
138 ":type: :class:`Interface0D` or one of its subclasses.\n");
141 if (
self->if0D_it->isEnd()) {
142 PyErr_SetString(PyExc_RuntimeError,
"iteration has stopped");
150 Interface0DIterator_t_doc,
151 "The curvilinear abscissa of the current point.\n"
156 return PyFloat_FromDouble(
self->if0D_it->t());
161 Interface0DIterator_u_doc,
162 "The point parameter at the current point in the 1D element (0 <= u <= 1).\n"
167 return PyFloat_FromDouble(
self->if0D_it->u());
172 Interface0DIterator_at_last_doc,
173 "True if the iterator points to the last valid element.\n"
174 "For its counterpart (pointing to the first valid element), use it.is_begin.\n"
186 Interface0DIterator_object_doc,
193 Interface0DIterator_at_last_doc,
195 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
201 PyVarObject_HEAD_INIT(
nullptr, 0)
202 "Interface0DIterator",
220 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
221 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)
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 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` | " ":class:`StrokeVertexIterator`\n")
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[]
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