Changeset View
Changeset View
Standalone View
Standalone View
source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
| Show First 20 Lines • Show All 280 Lines • ▼ Show 20 Lines | |||||
| " :rtype: :class:`StrokeVertexIterator`"); | " :rtype: :class:`StrokeVertexIterator`"); | ||||
| static PyObject *Stroke_stroke_vertices_end(BPy_Stroke *self) | static PyObject *Stroke_stroke_vertices_end(BPy_Stroke *self) | ||||
| { | { | ||||
| StrokeInternal::StrokeVertexIterator sv_it(self->s->strokeVerticesEnd()); | StrokeInternal::StrokeVertexIterator sv_it(self->s->strokeVerticesEnd()); | ||||
| return BPy_StrokeVertexIterator_from_StrokeVertexIterator(sv_it, true); | return BPy_StrokeVertexIterator_from_StrokeVertexIterator(sv_it, true); | ||||
| } | } | ||||
| PyDoc_STRVAR(Stroke_reversed_doc, | |||||
| ".. method:: __reversed__()\n" | |||||
| "\n" | |||||
| " Returns a StrokeVertexIterator iterating over the vertices of the Stroke\n" | |||||
| " in the reversed order (from the last to the first).\n" | |||||
| "\n" | |||||
| " :return: A StrokeVertexIterator pointing after the last StrokeVertex.\n" | |||||
| " :rtype: :class:`StrokeVertexIterator`"); | |||||
| static PyObject *Stroke_reversed(BPy_Stroke *self) | |||||
| { | |||||
| StrokeInternal::StrokeVertexIterator sv_it(self->s->strokeVerticesEnd()); | |||||
| return BPy_StrokeVertexIterator_from_StrokeVertexIterator(sv_it, true); | |||||
| } | |||||
| PyDoc_STRVAR(Stroke_stroke_vertices_size_doc, | PyDoc_STRVAR(Stroke_stroke_vertices_size_doc, | ||||
| ".. method:: stroke_vertices_size()\n" | ".. method:: stroke_vertices_size()\n" | ||||
| "\n" | "\n" | ||||
| " Returns the number of StrokeVertex constituting the Stroke.\n" | " Returns the number of StrokeVertex constituting the Stroke.\n" | ||||
| "\n" | "\n" | ||||
| " :return: The number of stroke vertices.\n" | " :return: The number of stroke vertices.\n" | ||||
| " :rtype: int"); | " :rtype: int"); | ||||
| static PyObject *Stroke_stroke_vertices_size(BPy_Stroke *self) | static PyObject *Stroke_stroke_vertices_size(BPy_Stroke *self) | ||||
| { | { | ||||
kjym3: I would suggest adding a docstring, e.g.:
PyDoc_STRVAR(Stroke_reversed_doc,
".. method… | |||||
| return PyLong_FromLong(self->s->strokeVerticesSize()); | return PyLong_FromLong(self->s->strokeVerticesSize()); | ||||
| } | } | ||||
| static PyMethodDef BPy_Stroke_methods[] = { | static PyMethodDef BPy_Stroke_methods[] = { | ||||
| {"compute_sampling", (PyCFunction)Stroke_compute_sampling, METH_VARARGS | METH_KEYWORDS, | {"compute_sampling", (PyCFunction)Stroke_compute_sampling, METH_VARARGS | METH_KEYWORDS, | ||||
| Stroke_compute_sampling_doc}, | Stroke_compute_sampling_doc}, | ||||
| {"resample", (PyCFunction)Stroke_resample, METH_VARARGS | METH_KEYWORDS, Stroke_resample_doc}, | {"resample", (PyCFunction)Stroke_resample, METH_VARARGS | METH_KEYWORDS, Stroke_resample_doc}, | ||||
| {"remove_all_vertices", (PyCFunction)Stroke_remove_all_vertices, METH_NOARGS, Stroke_remove_all_vertices_doc}, | {"remove_all_vertices", (PyCFunction)Stroke_remove_all_vertices, METH_NOARGS, Stroke_remove_all_vertices_doc}, | ||||
| {"remove_vertex", (PyCFunction)Stroke_remove_vertex, METH_VARARGS | METH_KEYWORDS, Stroke_remove_vertex_doc}, | {"remove_vertex", (PyCFunction)Stroke_remove_vertex, METH_VARARGS | METH_KEYWORDS, Stroke_remove_vertex_doc}, | ||||
| {"insert_vertex", (PyCFunction)Stroke_insert_vertex, METH_VARARGS | METH_KEYWORDS, Stroke_insert_vertex_doc}, | {"insert_vertex", (PyCFunction)Stroke_insert_vertex, METH_VARARGS | METH_KEYWORDS, Stroke_insert_vertex_doc}, | ||||
| {"update_length", (PyCFunction)Stroke_update_length, METH_NOARGS, Stroke_update_length_doc}, | {"update_length", (PyCFunction)Stroke_update_length, METH_NOARGS, Stroke_update_length_doc}, | ||||
| {"stroke_vertices_begin", (PyCFunction)Stroke_stroke_vertices_begin, METH_VARARGS | METH_KEYWORDS, | {"stroke_vertices_begin", (PyCFunction)Stroke_stroke_vertices_begin, METH_VARARGS | METH_KEYWORDS, | ||||
| Stroke_stroke_vertices_begin_doc}, | Stroke_stroke_vertices_begin_doc}, | ||||
| {"stroke_vertices_end", (PyCFunction)Stroke_stroke_vertices_end, METH_NOARGS, Stroke_stroke_vertices_end_doc}, | {"stroke_vertices_end", (PyCFunction)Stroke_stroke_vertices_end, METH_NOARGS, Stroke_stroke_vertices_end_doc}, | ||||
| {"__reversed__", (PyCFunction)Stroke_reversed, METH_NOARGS, Stroke_reversed_doc}, | |||||
| {"stroke_vertices_size", (PyCFunction)Stroke_stroke_vertices_size, METH_NOARGS, Stroke_stroke_vertices_size_doc}, | {"stroke_vertices_size", (PyCFunction)Stroke_stroke_vertices_size, METH_NOARGS, Stroke_stroke_vertices_size_doc}, | ||||
| {NULL, NULL, 0, NULL} | {NULL, NULL, 0, NULL} | ||||
| }; | }; | ||||
| /*----------------------Stroke get/setters ----------------------------*/ | /*----------------------Stroke get/setters ----------------------------*/ | ||||
| PyDoc_STRVAR(Stroke_medium_type_doc, | PyDoc_STRVAR(Stroke_medium_type_doc, | ||||
| "The MediumType used for this Stroke.\n" | "The MediumType used for this Stroke.\n" | ||||
| ▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines | |||||
I would suggest adding a docstring, e.g.: