Blender  V2.93
BPy_Stroke.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #include "BPy_Stroke.h"
22 
23 #include "../BPy_Convert.h"
24 #include "../BPy_Id.h"
25 #include "../BPy_MediumType.h"
26 #include "../Interface0D/BPy_SVertex.h"
27 #include "../Interface0D/CurvePoint/BPy_StrokeVertex.h"
28 #include "../Iterator/BPy_StrokeVertexIterator.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 using namespace Freestyle;
35 
37 
38 /*----------------------Stroke methods ----------------------------*/
39 
40 // Stroke ()
41 // template<class InputVertexIterator> Stroke (InputVertexIterator begin, InputVertexIterator end)
42 //
43 // pb: - need to be able to switch representation: InputVertexIterator <=> position
44 // - is it even used ? not even in SWIG version
45 
46 PyDoc_STRVAR(Stroke_doc,
47  "Class hierarchy: :class:`Interface1D` > :class:`Stroke`\n"
48  "\n"
49  "Class to define a stroke. A stroke is made of a set of 2D vertices\n"
50  "(:class:`StrokeVertex`), regularly spaced out. This set of vertices\n"
51  "defines the stroke's backbone geometry. Each of these stroke vertices\n"
52  "defines the stroke's shape and appearance at this vertex position.\n"
53  "\n"
54  ".. method:: Stroke()\n"
55  " Stroke(brother)\n"
56  "\n"
57  " Creates a :class:`Stroke` using the default constructor or copy constructor\n");
58 
59 static int Stroke_init(BPy_Stroke *self, PyObject *args, PyObject *kwds)
60 {
61  static const char *kwlist[] = {"brother", nullptr};
62  PyObject *brother = nullptr;
63 
64  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &Stroke_Type, &brother)) {
65  return -1;
66  }
67  if (!brother) {
68  self->s = new Stroke();
69  }
70  else {
71  self->s = new Stroke(*(((BPy_Stroke *)brother)->s));
72  }
73  self->py_if1D.if1D = self->s;
74  self->py_if1D.borrowed = false;
75  return 0;
76 }
77 
78 static PyObject *Stroke_iter(PyObject *self)
79 {
80  StrokeInternal::StrokeVertexIterator sv_it(((BPy_Stroke *)self)->s->strokeVerticesBegin());
82 }
83 
84 static Py_ssize_t Stroke_sq_length(BPy_Stroke *self)
85 {
86  return self->s->strokeVerticesSize();
87 }
88 
89 static PyObject *Stroke_sq_item(BPy_Stroke *self, int keynum)
90 {
91  if (keynum < 0) {
92  keynum += Stroke_sq_length(self);
93  }
94  if (keynum < 0 || keynum >= Stroke_sq_length(self)) {
95  PyErr_Format(PyExc_IndexError, "Stroke[index]: index %d out of range", keynum);
96  return nullptr;
97  }
98  return BPy_StrokeVertex_from_StrokeVertex(self->s->strokeVerticeAt(keynum));
99 }
100 
101 PyDoc_STRVAR(Stroke_compute_sampling_doc,
102  ".. method:: compute_sampling(n)\n"
103  "\n"
104  " Compute the sampling needed to get N vertices. If the\n"
105  " specified number of vertices is less than the actual number of\n"
106  " vertices, the actual sampling value is returned. (To remove Vertices,\n"
107  " use the RemoveVertex() method of this class.)\n"
108  "\n"
109  " :arg n: The number of stroke vertices we eventually want\n"
110  " in our Stroke.\n"
111  " :type n: int\n"
112  " :return: The sampling that must be used in the Resample(float)\n"
113  " method.\n"
114  " :rtype: float");
115 
116 static PyObject *Stroke_compute_sampling(BPy_Stroke *self, PyObject *args, PyObject *kwds)
117 {
118  static const char *kwlist[] = {"n", nullptr};
119  int i;
120 
121  if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", (char **)kwlist, &i)) {
122  return nullptr;
123  }
124  return PyFloat_FromDouble(self->s->ComputeSampling(i));
125 }
126 
127 PyDoc_STRVAR(Stroke_resample_doc,
128  ".. method:: resample(n)\n"
129  " resample(sampling)\n"
130  "\n"
131  " Resamples the stroke so using one of two methods with the goal\n"
132  " of creating a stroke with fewer points and the same shape.\n"
133  "\n"
134  " :arg n: Resamples the stroke so that it eventually has N points. That means\n"
135  " it is going to add N-vertices_size, where vertices_size is the\n"
136  " number of points we already have. If vertices_size >= N, no\n"
137  " resampling is done.\n"
138  " :type n: int\n"
139  " :arg sampling: Resamples the stroke with a given sampling value. If the\n"
140  " sampling is smaller than the actual sampling value, no resampling is done.\n"
141  " :type sampling: float");
142 
143 static PyObject *Stroke_resample(BPy_Stroke *self, PyObject *args, PyObject *kwds)
144 {
145  static const char *kwlist_1[] = {"n", nullptr};
146  static const char *kwlist_2[] = {"sampling", nullptr};
147  int i;
148  float f;
149 
150  if (PyArg_ParseTupleAndKeywords(args, kwds, "i", (char **)kwlist_1, &i)) {
151  if (self->s->Resample(i) < 0) {
152  PyErr_SetString(PyExc_RuntimeError, "Stroke resampling (by vertex count) failed");
153  return nullptr;
154  }
155  }
156  else if ((void)PyErr_Clear(),
157  PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist_2, &f)) {
158  if (self->s->Resample(f) < 0) {
159  PyErr_SetString(PyExc_RuntimeError, "Stroke resampling (by vertex interval) failed");
160  return nullptr;
161  }
162  }
163  else {
164  PyErr_SetString(PyExc_TypeError, "invalid argument");
165  return nullptr;
166  }
167  Py_RETURN_NONE;
168 }
169 
170 PyDoc_STRVAR(Stroke_insert_vertex_doc,
171  ".. method:: insert_vertex(vertex, next)\n"
172  "\n"
173  " Inserts the StrokeVertex given as argument into the Stroke before the\n"
174  " point specified by next. The length and curvilinear abscissa are\n"
175  " updated consequently.\n"
176  "\n"
177  " :arg vertex: The StrokeVertex to insert in the Stroke.\n"
178  " :type vertex: :class:`StrokeVertex`\n"
179  " :arg next: A StrokeVertexIterator pointing to the StrokeVertex\n"
180  " before which vertex must be inserted.\n"
181  " :type next: :class:`StrokeVertexIterator`");
182 
183 static PyObject *Stroke_insert_vertex(BPy_Stroke *self, PyObject *args, PyObject *kwds)
184 {
185  static const char *kwlist[] = {"vertex", "next", nullptr};
186  PyObject *py_sv = nullptr, *py_sv_it = nullptr;
187 
188  if (!PyArg_ParseTupleAndKeywords(args,
189  kwds,
190  "O!O!",
191  (char **)kwlist,
193  &py_sv,
195  &py_sv_it)) {
196  return nullptr;
197  }
198 
199  /* Make the wrapped StrokeVertex internal. */
200  ((BPy_StrokeVertex *)py_sv)->py_cp.py_if0D.borrowed = true;
201 
202  StrokeVertex *sv = ((BPy_StrokeVertex *)py_sv)->sv;
203  StrokeInternal::StrokeVertexIterator sv_it(*(((BPy_StrokeVertexIterator *)py_sv_it)->sv_it));
204  self->s->InsertVertex(sv, sv_it);
205  Py_RETURN_NONE;
206 }
207 
208 PyDoc_STRVAR(Stroke_remove_vertex_doc,
209  ".. method:: remove_vertex(vertex)\n"
210  "\n"
211  " Removes the StrokeVertex given as argument from the Stroke. The length\n"
212  " and curvilinear abscissa are updated consequently.\n"
213  "\n"
214  " :arg vertex: the StrokeVertex to remove from the Stroke.\n"
215  " :type vertex: :class:`StrokeVertex`");
216 
217 static PyObject *Stroke_remove_vertex(BPy_Stroke *self, PyObject *args, PyObject *kwds)
218 {
219  static const char *kwlist[] = {"vertex", nullptr};
220  PyObject *py_sv = nullptr;
221 
222  if (!PyArg_ParseTupleAndKeywords(
223  args, kwds, "O!", (char **)kwlist, &StrokeVertex_Type, &py_sv)) {
224  return nullptr;
225  }
226  if (((BPy_StrokeVertex *)py_sv)->sv) {
227  self->s->RemoveVertex(((BPy_StrokeVertex *)py_sv)->sv);
228  }
229  else {
230  PyErr_SetString(PyExc_TypeError, "invalid argument");
231  return nullptr;
232  }
233  Py_RETURN_NONE;
234 }
235 
236 PyDoc_STRVAR(Stroke_remove_all_vertices_doc,
237  ".. method:: remove_all_vertices()\n"
238  "\n"
239  " Removes all vertices from the Stroke.");
240 
241 static PyObject *Stroke_remove_all_vertices(BPy_Stroke *self)
242 {
243  self->s->RemoveAllVertices();
244  Py_RETURN_NONE;
245 }
246 
247 PyDoc_STRVAR(Stroke_update_length_doc,
248  ".. method:: update_length()\n"
249  "\n"
250  " Updates the 2D length of the Stroke.");
251 
252 static PyObject *Stroke_update_length(BPy_Stroke *self)
253 {
254  self->s->UpdateLength();
255  Py_RETURN_NONE;
256 }
257 
258 PyDoc_STRVAR(Stroke_stroke_vertices_begin_doc,
259  ".. method:: stroke_vertices_begin(t=0.0)\n"
260  "\n"
261  " Returns a StrokeVertexIterator pointing on the first StrokeVertex of\n"
262  " the Stroke. One can specify a sampling value to re-sample the Stroke\n"
263  " on the fly if needed.\n"
264  "\n"
265  " :arg t: The resampling value with which we want our Stroke to be\n"
266  " resampled. If 0 is specified, no resampling is done.\n"
267  " :type t: float\n"
268  " :return: A StrokeVertexIterator pointing on the first StrokeVertex.\n"
269  " :rtype: :class:`StrokeVertexIterator`");
270 
271 static PyObject *Stroke_stroke_vertices_begin(BPy_Stroke *self, PyObject *args, PyObject *kwds)
272 {
273  static const char *kwlist[] = {"t", nullptr};
274  float f = 0.0f;
275 
276  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|f", (char **)kwlist, &f)) {
277  return nullptr;
278  }
279  StrokeInternal::StrokeVertexIterator sv_it(self->s->strokeVerticesBegin(f));
281 }
282 
283 PyDoc_STRVAR(Stroke_stroke_vertices_end_doc,
284  ".. method:: stroke_vertices_end()\n"
285  "\n"
286  " Returns a StrokeVertexIterator pointing after the last StrokeVertex\n"
287  " of the Stroke.\n"
288  "\n"
289  " :return: A StrokeVertexIterator pointing after the last StrokeVertex.\n"
290  " :rtype: :class:`StrokeVertexIterator`");
291 
292 static PyObject *Stroke_stroke_vertices_end(BPy_Stroke *self)
293 {
294  StrokeInternal::StrokeVertexIterator sv_it(self->s->strokeVerticesEnd());
296 }
297 
298 PyDoc_STRVAR(Stroke_reversed_doc,
299  ".. method:: __reversed__()\n"
300  "\n"
301  " Returns a StrokeVertexIterator iterating over the vertices of the Stroke\n"
302  " in the reversed order (from the last to the first).\n"
303  "\n"
304  " :return: A StrokeVertexIterator pointing after the last StrokeVertex.\n"
305  " :rtype: :class:`StrokeVertexIterator`");
306 
307 static PyObject *Stroke_reversed(BPy_Stroke *self)
308 {
309  StrokeInternal::StrokeVertexIterator sv_it(self->s->strokeVerticesEnd());
311 }
312 
313 PyDoc_STRVAR(Stroke_stroke_vertices_size_doc,
314  ".. method:: stroke_vertices_size()\n"
315  "\n"
316  " Returns the number of StrokeVertex constituting the Stroke.\n"
317  "\n"
318  " :return: The number of stroke vertices.\n"
319  " :rtype: int");
320 
322 {
323  return PyLong_FromLong(self->s->strokeVerticesSize());
324 }
325 
326 static PyMethodDef BPy_Stroke_methods[] = {
327  {"compute_sampling",
328  (PyCFunction)Stroke_compute_sampling,
329  METH_VARARGS | METH_KEYWORDS,
330  Stroke_compute_sampling_doc},
331  {"resample", (PyCFunction)Stroke_resample, METH_VARARGS | METH_KEYWORDS, Stroke_resample_doc},
332  {"remove_all_vertices",
333  (PyCFunction)Stroke_remove_all_vertices,
334  METH_NOARGS,
335  Stroke_remove_all_vertices_doc},
336  {"remove_vertex",
337  (PyCFunction)Stroke_remove_vertex,
338  METH_VARARGS | METH_KEYWORDS,
339  Stroke_remove_vertex_doc},
340  {"insert_vertex",
341  (PyCFunction)Stroke_insert_vertex,
342  METH_VARARGS | METH_KEYWORDS,
343  Stroke_insert_vertex_doc},
344  {"update_length", (PyCFunction)Stroke_update_length, METH_NOARGS, Stroke_update_length_doc},
345  {"stroke_vertices_begin",
346  (PyCFunction)Stroke_stroke_vertices_begin,
347  METH_VARARGS | METH_KEYWORDS,
348  Stroke_stroke_vertices_begin_doc},
349  {"stroke_vertices_end",
350  (PyCFunction)Stroke_stroke_vertices_end,
351  METH_NOARGS,
352  Stroke_stroke_vertices_end_doc},
353  {"__reversed__", (PyCFunction)Stroke_reversed, METH_NOARGS, Stroke_reversed_doc},
354  {"stroke_vertices_size",
355  (PyCFunction)Stroke_stroke_vertices_size,
356  METH_NOARGS,
357  Stroke_stroke_vertices_size_doc},
358  {nullptr, nullptr, 0, nullptr},
359 };
360 
361 /*----------------------Stroke get/setters ----------------------------*/
362 
363 PyDoc_STRVAR(Stroke_medium_type_doc,
364  "The MediumType used for this Stroke.\n"
365  "\n"
366  ":type: :class:`MediumType`");
367 
368 static PyObject *Stroke_medium_type_get(BPy_Stroke *self, void *UNUSED(closure))
369 {
370  return BPy_MediumType_from_MediumType(self->s->getMediumType());
371 }
372 
373 static int Stroke_medium_type_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
374 {
375  if (!BPy_MediumType_Check(value)) {
376  PyErr_SetString(PyExc_TypeError, "value must be a MediumType");
377  return -1;
378  }
379  self->s->setMediumType(MediumType_from_BPy_MediumType(value));
380  return 0;
381 }
382 
383 PyDoc_STRVAR(Stroke_texture_id_doc,
384  "The ID of the texture used to simulate th marks system for this Stroke.\n"
385  "\n"
386  ":type: int");
387 
388 static PyObject *Stroke_texture_id_get(BPy_Stroke *self, void *UNUSED(closure))
389 {
390  return PyLong_FromLong(self->s->getTextureId());
391 }
392 
393 static int Stroke_texture_id_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
394 {
395  unsigned int i = PyLong_AsUnsignedLong(value);
396  if (PyErr_Occurred()) {
397  return -1;
398  }
399  self->s->setTextureId(i);
400  return 0;
401 }
402 
403 PyDoc_STRVAR(Stroke_tips_doc,
404  "True if this Stroke uses a texture with tips, and false otherwise.\n"
405  "\n"
406  ":type: bool");
407 
408 static PyObject *Stroke_tips_get(BPy_Stroke *self, void *UNUSED(closure))
409 {
410  return PyBool_from_bool(self->s->hasTips());
411 }
412 
413 static int Stroke_tips_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
414 {
415  if (!PyBool_Check(value)) {
416  return -1;
417  }
418  self->s->setTips(bool_from_PyBool(value));
419  return 0;
420 }
421 
422 PyDoc_STRVAR(Stroke_length_2d_doc,
423  "The 2D length of the Stroke.\n"
424  "\n"
425  ":type: float");
426 
427 static PyObject *Stroke_length_2d_get(BPy_Stroke *self, void *UNUSED(closure))
428 {
429  return PyFloat_FromDouble(self->s->getLength2D());
430 }
431 
432 static int Stroke_length_2d_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
433 {
434  float scalar;
435  if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
436  /* parsed item not a number */
437  PyErr_SetString(PyExc_TypeError, "value must be a number");
438  return -1;
439  }
440  self->s->setLength(scalar);
441  return 0;
442 }
443 
444 PyDoc_STRVAR(Stroke_id_doc,
445  "The Id of this Stroke.\n"
446  "\n"
447  ":type: :class:`Id`");
448 
449 static PyObject *Stroke_id_get(BPy_Stroke *self, void *UNUSED(closure))
450 {
451  Id id(self->s->getId());
452  return BPy_Id_from_Id(id); // return a copy
453 }
454 
455 static int Stroke_id_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
456 {
457  if (!BPy_Id_Check(value)) {
458  PyErr_SetString(PyExc_TypeError, "value must be an Id");
459  return -1;
460  }
461  self->s->setId(*(((BPy_Id *)value)->id));
462  return 0;
463 }
464 
465 static PyGetSetDef BPy_Stroke_getseters[] = {
466  {"medium_type",
467  (getter)Stroke_medium_type_get,
468  (setter)Stroke_medium_type_set,
469  Stroke_medium_type_doc,
470  nullptr},
471  {"texture_id",
472  (getter)Stroke_texture_id_get,
473  (setter)Stroke_texture_id_set,
474  Stroke_texture_id_doc,
475  nullptr},
476  {"tips", (getter)Stroke_tips_get, (setter)Stroke_tips_set, Stroke_tips_doc, nullptr},
477  {"length_2d",
478  (getter)Stroke_length_2d_get,
479  (setter)Stroke_length_2d_set,
480  Stroke_length_2d_doc,
481  nullptr},
482  {"id", (getter)Stroke_id_get, (setter)Stroke_id_set, Stroke_id_doc, nullptr},
483  {nullptr, nullptr, nullptr, nullptr, nullptr} /* Sentinel */
484 };
485 
486 /*-----------------------BPy_Stroke type definition ------------------------------*/
487 
488 static PySequenceMethods BPy_Stroke_as_sequence = {
489  (lenfunc)Stroke_sq_length, /* sq_length */
490  nullptr, /* sq_concat */
491  nullptr, /* sq_repeat */
492  (ssizeargfunc)Stroke_sq_item, /* sq_item */
493  nullptr, /* sq_slice */
494  nullptr, /* sq_ass_item */
495  nullptr, /* *was* sq_ass_slice */
496  nullptr, /* sq_contains */
497  nullptr, /* sq_inplace_concat */
498  nullptr, /* sq_inplace_repeat */
499 };
500 
501 PyTypeObject Stroke_Type = {
502  PyVarObject_HEAD_INIT(nullptr, 0) "Stroke", /* tp_name */
503  sizeof(BPy_Stroke), /* tp_basicsize */
504  0, /* tp_itemsize */
505  nullptr, /* tp_dealloc */
506  0, /* tp_vectorcall_offset */
507  nullptr, /* tp_getattr */
508  nullptr, /* tp_setattr */
509  nullptr, /* tp_reserved */
510  nullptr, /* tp_repr */
511  nullptr, /* tp_as_number */
512  &BPy_Stroke_as_sequence, /* tp_as_sequence */
513  nullptr, /* tp_as_mapping */
514  nullptr, /* tp_hash */
515  nullptr, /* tp_call */
516  nullptr, /* tp_str */
517  nullptr, /* tp_getattro */
518  nullptr, /* tp_setattro */
519  nullptr, /* tp_as_buffer */
520  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
521  Stroke_doc, /* tp_doc */
522  nullptr, /* tp_traverse */
523  nullptr, /* tp_clear */
524  nullptr, /* tp_richcompare */
525  0, /* tp_weaklistoffset */
526  (getiterfunc)Stroke_iter, /* tp_iter */
527  nullptr, /* tp_iternext */
528  BPy_Stroke_methods, /* tp_methods */
529  nullptr, /* tp_members */
530  BPy_Stroke_getseters, /* tp_getset */
531  &Interface1D_Type, /* tp_base */
532  nullptr, /* tp_dict */
533  nullptr, /* tp_descr_get */
534  nullptr, /* tp_descr_set */
535  0, /* tp_dictoffset */
536  (initproc)Stroke_init, /* tp_init */
537  nullptr, /* tp_alloc */
538  nullptr, /* tp_new */
539 };
540 
542 
543 #ifdef __cplusplus
544 }
545 #endif
#define UNUSED(x)
PyObject * BPy_MediumType_from_MediumType(Stroke::MediumType n)
PyObject * PyBool_from_bool(bool b)
Definition: BPy_Convert.cpp:73
bool bool_from_PyBool(PyObject *b)
PyObject * BPy_StrokeVertex_from_StrokeVertex(StrokeVertex &sv)
PyObject * BPy_Id_from_Id(Id &id)
Stroke::MediumType MediumType_from_BPy_MediumType(PyObject *obj)
PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator(StrokeInternal::StrokeVertexIterator &sv_it, bool reversed)
#define BPy_Id_Check(v)
Definition: BPy_Id.h:39
PyTypeObject Interface1D_Type
#define BPy_MediumType_Check(v)
PyTypeObject StrokeVertexIterator_Type
PyTypeObject StrokeVertex_Type
static PyObject * Stroke_medium_type_get(BPy_Stroke *self, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:368
PyDoc_STRVAR(Stroke_doc, "Class hierarchy: :class:`Interface1D` > :class:`Stroke`\n" "\n" "Class to define a stroke. A stroke is made of a set of 2D vertices\n" "(:class:`StrokeVertex`), regularly spaced out. This set of vertices\n" "defines the stroke's backbone geometry. Each of these stroke vertices\n" "defines the stroke's shape and appearance at this vertex position.\n" "\n" ".. method:: Stroke()\n" " Stroke(brother)\n" "\n" " Creates a :class:`Stroke` using the default constructor or copy constructor\n")
static Py_ssize_t Stroke_sq_length(BPy_Stroke *self)
Definition: BPy_Stroke.cpp:84
static PyObject * Stroke_remove_vertex(BPy_Stroke *self, PyObject *args, PyObject *kwds)
Definition: BPy_Stroke.cpp:217
PyTypeObject Stroke_Type
Definition: BPy_Stroke.cpp:501
static int Stroke_id_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:455
static PyObject * Stroke_sq_item(BPy_Stroke *self, int keynum)
Definition: BPy_Stroke.cpp:89
static int Stroke_medium_type_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:373
static PyObject * Stroke_reversed(BPy_Stroke *self)
Definition: BPy_Stroke.cpp:307
static PySequenceMethods BPy_Stroke_as_sequence
Definition: BPy_Stroke.cpp:488
static PyObject * Stroke_stroke_vertices_begin(BPy_Stroke *self, PyObject *args, PyObject *kwds)
Definition: BPy_Stroke.cpp:271
static PyMethodDef BPy_Stroke_methods[]
Definition: BPy_Stroke.cpp:326
static PyObject * Stroke_iter(PyObject *self)
Definition: BPy_Stroke.cpp:78
static PyObject * Stroke_stroke_vertices_size(BPy_Stroke *self)
Definition: BPy_Stroke.cpp:321
static PyObject * Stroke_stroke_vertices_end(BPy_Stroke *self)
Definition: BPy_Stroke.cpp:292
static PyObject * Stroke_length_2d_get(BPy_Stroke *self, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:427
static PyObject * Stroke_remove_all_vertices(BPy_Stroke *self)
Definition: BPy_Stroke.cpp:241
static PyObject * Stroke_resample(BPy_Stroke *self, PyObject *args, PyObject *kwds)
Definition: BPy_Stroke.cpp:143
static PyObject * Stroke_texture_id_get(BPy_Stroke *self, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:388
static int Stroke_tips_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:413
static PyObject * Stroke_update_length(BPy_Stroke *self)
Definition: BPy_Stroke.cpp:252
static int Stroke_length_2d_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:432
static int Stroke_init(BPy_Stroke *self, PyObject *args, PyObject *kwds)
Definition: BPy_Stroke.cpp:59
static PyObject * Stroke_compute_sampling(BPy_Stroke *self, PyObject *args, PyObject *kwds)
Definition: BPy_Stroke.cpp:116
static PyGetSetDef BPy_Stroke_getseters[]
Definition: BPy_Stroke.cpp:465
static PyObject * Stroke_tips_get(BPy_Stroke *self, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:408
static PyObject * Stroke_insert_vertex(BPy_Stroke *self, PyObject *args, PyObject *kwds)
Definition: BPy_Stroke.cpp:183
static PyObject * Stroke_id_get(BPy_Stroke *self, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:449
static int Stroke_texture_id_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:393
PyObject * self
Definition: bpy_driver.c:185
inherits from class Rep
Definition: AppCanvas.cpp:32
Definition: BPy_Id.h:42