23 StrokeVertexIterator_doc,
24 "Class hierarchy: :class:`Iterator` > :class:`StrokeVertexIterator`\n"
26 "Class defining an iterator designed to iterate over the\n"
27 ":class:`StrokeVertex` of a :class:`Stroke`. An instance of a\n"
28 "StrokeVertexIterator can be obtained from a Stroke by calling\n"
29 "iter(), stroke_vertices_begin() or stroke_vertices_begin(). It is iterating\n"
30 "over the same vertices as an :class:`Interface0DIterator`. The difference\n"
31 "resides in the object access: an Interface0DIterator only allows\n"
32 "access to an Interface0D while one might need to access the\n"
33 "specialized StrokeVertex type. In this case, one should use a\n"
34 "StrokeVertexIterator. To call functions of the UnaryFunction0D type,\n"
35 "a StrokeVertexIterator can be converted to an Interface0DIterator by\n"
36 "by calling Interface0DIterator(it).\n"
38 ".. method:: __init__(*args)\n"
40 " Accepted call signatures:\n"
43 " - ``__init__(brother)``\n"
45 " Creates a :class:`StrokeVertexIterator` using either the\n"
46 " default constructor or the copy constructor.\n"
48 " :param brother: A StrokeVertexIterator object.\n"
49 " :type brother: :class:`StrokeVertexIterator`\n");
54 static const char *kwlist_1[] = {
"brother",
nullptr};
55 static const char *kwlist_2[] = {
"stroke",
nullptr};
56 PyObject *brother =
nullptr, *stroke =
nullptr;
58 if (PyArg_ParseTupleAndKeywords(args,
72 else if ((
void)PyErr_Clear(),
73 PyArg_ParseTupleAndKeywords(args,
87 ((
BPy_Stroke *)stroke)->s->strokeVerticesBegin());
93 PyErr_SetString(PyExc_TypeError,
"argument 1 must be StrokeVertexIterator or Stroke");
104 return (PyObject *)self;
116 if (self->
sv_it->isBegin()) {
117 PyErr_SetNone(PyExc_StopIteration);
120 self->
sv_it->decrement();
124 if (self->
sv_it->isEnd()) {
125 PyErr_SetNone(PyExc_StopIteration);
135 else if (self->
sv_it->atLast()) {
136 PyErr_SetNone(PyExc_StopIteration);
140 self->
sv_it->increment();
151 StrokeVertexIterator_incremented_doc,
152 ".. method:: incremented()\n"
154 " Returns a copy of an incremented StrokeVertexIterator.\n"
156 " :return: A StrokeVertexIterator pointing the next StrokeVertex.\n"
157 " :rtype: :class:`StrokeVertexIterator`\n");
160 if (self->
sv_it->isEnd()) {
161 PyErr_SetString(PyExc_RuntimeError,
"cannot increment any more");
171 StrokeVertexIterator_decremented_doc,
172 ".. method:: decremented()\n"
174 " Returns a copy of a decremented StrokeVertexIterator.\n"
176 " :return: A StrokeVertexIterator pointing the previous StrokeVertex.\n"
177 " :rtype: :class:`StrokeVertexIterator`\n");
180 if (self->
sv_it->isBegin()) {
181 PyErr_SetString(PyExc_RuntimeError,
"cannot decrement any more");
191 StrokeVertexIterator_reversed_doc,
192 ".. method:: reversed()\n"
194 " Returns a StrokeVertexIterator that traverses stroke vertices in the\n"
197 " :return: A StrokeVertexIterator traversing stroke vertices backward.\n"
198 " :rtype: :class:`StrokeVertexIterator`\n");
206# pragma clang diagnostic push
207# pragma clang diagnostic ignored "-Wcast-function-type"
209# pragma GCC diagnostic push
210# pragma GCC diagnostic ignored "-Wcast-function-type"
218 StrokeVertexIterator_incremented_doc},
222 StrokeVertexIterator_decremented_doc},
226 StrokeVertexIterator_reversed_doc},
227 {
nullptr,
nullptr, 0,
nullptr},
232# pragma clang diagnostic pop
234# pragma GCC diagnostic pop
242 StrokeVertexIterator_object_doc,
243 "The StrokeVertex object currently pointed to by this iterator.\n"
245 ":type: :class:`StrokeVertex`\n");
249 if (self->
sv_it->isEnd()) {
250 PyErr_SetString(PyExc_RuntimeError,
"iteration has stopped");
262 StrokeVertexIterator_t_doc,
263 "The curvilinear abscissa of the current point.\n"
268 return PyFloat_FromDouble(self->
sv_it->t());
273 StrokeVertexIterator_u_doc,
274 "The point parameter at the current point in the stroke (0 <= u <= 1).\n"
279 return PyFloat_FromDouble(self->
sv_it->
u());
284 StrokeVertexIterator_at_last_doc,
285 "True if the iterator points to the last valid element.\n"
286 "For its counterpart (pointing to the first valid element), use it.is_begin.\n"
296# pragma clang diagnostic push
297# pragma clang diagnostic ignored "-Wcast-function-type"
299# pragma GCC diagnostic push
300# pragma GCC diagnostic ignored "-Wcast-function-type"
308 StrokeVertexIterator_object_doc,
313 StrokeVertexIterator_t_doc,
318 StrokeVertexIterator_u_doc,
323 StrokeVertexIterator_at_last_doc,
325 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
330# pragma clang diagnostic pop
332# pragma GCC diagnostic pop
339 PyVarObject_HEAD_INIT(
nullptr, 0)
340 "StrokeVertexIterator",
358 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
359 StrokeVertexIterator_doc,
PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator(StrokeInternal::StrokeVertexIterator &sv_it, bool reversed)
PyObject * BPy_StrokeVertex_from_StrokeVertex(StrokeVertex &sv)
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" " :param inter1: The first Interface1D object.\n" " :type inter1: :class:`freestyle.types.Interface1D`\n" " :param inter2: The second Interface1D object.\n" " :type inter2: :class:`freestyle.types.Interface1D`\n" " :return: False.\n" " :rtype: bool\n")
PyTypeObject Iterator_Type
static int StrokeVertexIterator_init(BPy_StrokeVertexIterator *self, PyObject *args, PyObject *kwds)
static PyObject * StrokeVertexIterator_at_last_get(BPy_StrokeVertexIterator *self)
static PyObject * StrokeVertexIterator_reversed(BPy_StrokeVertexIterator *self)
static PyObject * StrokeVertexIterator_t_get(BPy_StrokeVertexIterator *self, void *)
static PyObject * StrokeVertexIterator_decremented(BPy_StrokeVertexIterator *self)
static PyObject * StrokeVertexIterator_object_get(BPy_StrokeVertexIterator *self, void *)
static PyObject * StrokeVertexIterator_u_get(BPy_StrokeVertexIterator *self, void *)
PyTypeObject StrokeVertexIterator_Type
static PyObject * StrokeVertexIterator_iternext(BPy_StrokeVertexIterator *self)
static PyGetSetDef BPy_StrokeVertexIterator_getseters[]
static PyObject * StrokeVertexIterator_incremented(BPy_StrokeVertexIterator *self)
static PyMethodDef BPy_StrokeVertexIterator_methods[]
static PyObject * StrokeVertexIterator_iter(BPy_StrokeVertexIterator *self)
PyObject_HEAD Freestyle::Iterator * it
Freestyle::StrokeInternal::StrokeVertexIterator * sv_it