Blender V5.3
BPy_Stroke.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2004-2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BPy_Stroke.h"
10
11#include "../BPy_Convert.h"
12#include "../BPy_Id.h"
13#include "../BPy_MediumType.h"
17
18#include "BLI_sys_types.hh"
19
20using namespace Freestyle;
21
23
24/*----------------------Stroke methods ----------------------------*/
25
26// Stroke ()
27// template<class InputVertexIterator> Stroke (InputVertexIterator begin, InputVertexIterator end)
28//
29// pb: - need to be able to switch representation: InputVertexIterator <=> position
30// - is it even used ? not even in SWIG version
31
33 /* Wrap. */
34 Stroke_doc,
35 "Class hierarchy: :class:`Interface1D` > :class:`Stroke`\n"
36 "\n"
37 "Class to define a stroke. A stroke is made of a set of 2D vertices\n"
38 "(:class:`StrokeVertex`), regularly spaced out. This set of vertices\n"
39 "defines the stroke's backbone geometry. Each of these stroke vertices\n"
40 "defines the stroke's shape and appearance at this vertex position.\n"
41 "\n"
42 ".. method:: Stroke(*args)\n"
43 "\n"
44 " Accepted call signatures:\n"
45 "\n"
46 " - ``Stroke()``\n"
47 " - ``Stroke(brother)``\n"
48 "\n"
49 " Creates a :class:`Stroke` using the default constructor or copy constructor\n");
50static int Stroke_init(BPy_Stroke *self, PyObject *args, PyObject *kwds)
51{
52 static const char *kwlist[] = {"brother", nullptr};
53 PyObject *brother = nullptr;
54
55 if (!PyArg_ParseTupleAndKeywords(args,
56 kwds,
57 "|" /* Optional arguments. */
58 "O!" /* `brother` */
59 ":__init__",
60 (char **)kwlist,
62 &brother))
63 {
64 return -1;
65 }
66 if (!brother) {
67 self->s = new Stroke();
68 }
69 else {
70 self->s = new Stroke(*(((BPy_Stroke *)brother)->s));
71 }
72 self->py_if1D.if1D = self->s;
73 self->py_if1D.borrowed = false;
74 return 0;
75}
76
77static PyObject *Stroke_iter(PyObject *self)
78{
79 StrokeInternal::StrokeVertexIterator sv_it(((BPy_Stroke *)self)->s->strokeVerticesBegin());
81}
82
83static Py_ssize_t Stroke_sq_length(BPy_Stroke *self)
84{
85 return self->s->strokeVerticesSize();
86}
87
88static PyObject *Stroke_sq_item(BPy_Stroke *self, Py_ssize_t keynum)
89{
90 if (keynum < 0) {
91 keynum += Stroke_sq_length(self);
92 }
93 if (keynum < 0 || keynum >= Stroke_sq_length(self)) {
94 PyErr_Format(PyExc_IndexError, "Stroke[index]: index %d out of range", keynum);
95 return nullptr;
96 }
98}
99
101 /* Wrap. */
102 Stroke_compute_sampling_doc,
103 ".. method:: compute_sampling(n)\n"
104 "\n"
105 " Compute the sampling needed to get N vertices. If the\n"
106 " specified number of vertices is less than the actual number of\n"
107 " vertices, the actual sampling value is returned. (To remove Vertices,\n"
108 " use the RemoveVertex() method of this class.)\n"
109 "\n"
110 " :param n: The number of stroke vertices we eventually want\n"
111 " in our Stroke.\n"
112 " :type n: int\n"
113 " :return: The sampling that must be used in the Resample(float)\n"
114 " method.\n"
115 " :rtype: float\n");
116static 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,
122 kwds,
123 "i" /* `n` */
124 ":compute_sampling",
125 (char **)kwlist,
126 &i))
127 {
128 return nullptr;
129 }
130 return PyFloat_FromDouble(self->s->ComputeSampling(i));
131}
132
134 /* Wrap. */
135 Stroke_resample_doc,
136 ".. method:: resample(*args)\n"
137 "\n"
138 " Accepted call signatures:\n"
139 "\n"
140 " - ``resample(n)``\n"
141 " - ``resample(sampling)``\n"
142 "\n"
143 " Resamples the stroke so using one of two methods with the goal\n"
144 " of creating a stroke with fewer points and the same shape.\n"
145 "\n"
146 " :param n: Resamples the stroke so that it eventually has N points. That means\n"
147 " it is going to add N-vertices_size, where vertices_size is the\n"
148 " number of points we already have. If vertices_size >= N, no\n"
149 " resampling is done.\n"
150 " :type n: int\n"
151 " :param sampling: Resamples the stroke with a given sampling value. If the\n"
152 " sampling is smaller than the actual sampling value, no resampling is done.\n"
153 " :type sampling: float\n");
154static PyObject *Stroke_resample(BPy_Stroke *self, PyObject *args, PyObject *kwds)
155{
156 static const char *kwlist_1[] = {"n", nullptr};
157 static const char *kwlist_2[] = {"sampling", nullptr};
158 int i;
159 float f;
160
161 if (PyArg_ParseTupleAndKeywords(args,
162 kwds,
163 "i" /* `n` */
164 ":resample",
165 (char **)kwlist_1,
166 &i))
167 {
168 if (self->s->Resample(i) < 0) {
169 PyErr_SetString(PyExc_RuntimeError, "Stroke resampling (by vertex count) failed");
170 return nullptr;
171 }
172 }
173 else if ((void)PyErr_Clear(),
174 PyArg_ParseTupleAndKeywords(args,
175 kwds,
176 "f" /* `sampling` */
177 ":resample",
178 (char **)kwlist_2,
179 &f))
180 {
181 if (self->s->Resample(f) < 0) {
182 PyErr_SetString(PyExc_RuntimeError, "Stroke resampling (by vertex interval) failed");
183 return nullptr;
184 }
185 }
186 else {
187 PyErr_SetString(PyExc_TypeError, "invalid argument");
188 return nullptr;
189 }
190 Py_RETURN_NONE;
191}
192
194 /* Wrap. */
195 Stroke_insert_vertex_doc,
196 ".. method:: insert_vertex(vertex, next)\n"
197 "\n"
198 " Inserts the StrokeVertex given as argument into the Stroke before the\n"
199 " point specified by next. The length and curvilinear abscissa are\n"
200 " updated consequently.\n"
201 "\n"
202 " :param vertex: The StrokeVertex to insert in the Stroke.\n"
203 " :type vertex: :class:`StrokeVertex`\n"
204 " :param next: A StrokeVertexIterator pointing to the StrokeVertex\n"
205 " before which vertex must be inserted.\n"
206 " :type next: :class:`StrokeVertexIterator`\n");
207static PyObject *Stroke_insert_vertex(BPy_Stroke *self, PyObject *args, PyObject *kwds)
208{
209 static const char *kwlist[] = {"vertex", "next", nullptr};
210 PyObject *py_sv = nullptr, *py_sv_it = nullptr;
211
212 if (!PyArg_ParseTupleAndKeywords(args,
213 kwds,
214 "O!" /* `vertex` */
215 "O!" /* `next` */
216 ":insert_vertex",
217 (char **)kwlist,
219 &py_sv,
221 &py_sv_it))
222 {
223 return nullptr;
224 }
225
226 /* Make the wrapped StrokeVertex internal. */
227 ((BPy_StrokeVertex *)py_sv)->py_cp.py_if0D.borrowed = true;
228
229 StrokeVertex *sv = ((BPy_StrokeVertex *)py_sv)->sv;
231 self->s->InsertVertex(sv, sv_it);
232 Py_RETURN_NONE;
233}
234
236 /* Wrap. */
237 Stroke_remove_vertex_doc,
238 ".. method:: remove_vertex(vertex)\n"
239 "\n"
240 " Removes the StrokeVertex given as argument from the Stroke. The length\n"
241 " and curvilinear abscissa are updated consequently.\n"
242 "\n"
243 " :param vertex: the StrokeVertex to remove from the Stroke.\n"
244 " :type vertex: :class:`StrokeVertex`\n");
245static PyObject *Stroke_remove_vertex(BPy_Stroke *self, PyObject *args, PyObject *kwds)
246{
247 static const char *kwlist[] = {"vertex", nullptr};
248 PyObject *py_sv = nullptr;
249
250 if (!PyArg_ParseTupleAndKeywords(args,
251 kwds,
252 "O!" /* `vertex` */
253 ":remove_vertex",
254 (char **)kwlist,
256 &py_sv))
257 {
258 return nullptr;
259 }
260 if (((BPy_StrokeVertex *)py_sv)->sv) {
261 self->s->RemoveVertex(((BPy_StrokeVertex *)py_sv)->sv);
262 }
263 else {
264 PyErr_SetString(PyExc_TypeError, "invalid argument");
265 return nullptr;
266 }
267 Py_RETURN_NONE;
268}
269
271 /* Wrap. */
272 Stroke_remove_all_vertices_doc,
273 ".. method:: remove_all_vertices()\n"
274 "\n"
275 " Removes all vertices from the Stroke.\n");
277{
278 self->s->RemoveAllVertices();
279 Py_RETURN_NONE;
280}
281
283 /* Wrap. */
284 Stroke_update_length_doc,
285 ".. method:: update_length()\n"
286 "\n"
287 " Updates the 2D length of the Stroke.\n");
288static PyObject *Stroke_update_length(BPy_Stroke *self)
289{
290 self->s->UpdateLength();
291 Py_RETURN_NONE;
292}
293
295 /* Wrap. */
296 Stroke_stroke_vertices_begin_doc,
297 ".. method:: stroke_vertices_begin(t=0.0)\n"
298 "\n"
299 " Returns a StrokeVertexIterator pointing on the first StrokeVertex of\n"
300 " the Stroke. One can specify a sampling value to re-sample the Stroke\n"
301 " on the fly if needed.\n"
302 "\n"
303 " :param t: The resampling value with which we want our Stroke to be\n"
304 " resampled. If 0 is specified, no resampling is done.\n"
305 " :type t: float\n"
306 " :return: A StrokeVertexIterator pointing on the first StrokeVertex.\n"
307 " :rtype: :class:`StrokeVertexIterator`\n");
308static PyObject *Stroke_stroke_vertices_begin(BPy_Stroke *self, PyObject *args, PyObject *kwds)
309{
310 static const char *kwlist[] = {"t", nullptr};
311 float f = 0.0f;
312
313 if (!PyArg_ParseTupleAndKeywords(args,
314 kwds,
315 "|" /* Optional arguments. */
316 "f" /* `t` */
317 ":stroke_vertices_begin",
318 (char **)kwlist,
319 &f))
320 {
321 return nullptr;
322 }
325}
326
328 /* Wrap. */
329 Stroke_stroke_vertices_end_doc,
330 ".. method:: stroke_vertices_end()\n"
331 "\n"
332 " Returns a StrokeVertexIterator pointing after the last StrokeVertex\n"
333 " of the Stroke.\n"
334 "\n"
335 " :return: A StrokeVertexIterator pointing after the last StrokeVertex.\n"
336 " :rtype: :class:`StrokeVertexIterator`\n");
342
344 /* Wrap. */
345 Stroke_reversed_doc,
346 ".. method:: __reversed__()\n"
347 "\n"
348 " Returns a StrokeVertexIterator iterating over the vertices of the Stroke\n"
349 " in the reversed order (from the last to the first).\n"
350 "\n"
351 " :return: A StrokeVertexIterator pointing after the last StrokeVertex.\n"
352 " :rtype: :class:`StrokeVertexIterator`\n");
358
360 /* Wrap. */
361 Stroke_stroke_vertices_size_doc,
362 ".. method:: stroke_vertices_size()\n"
363 "\n"
364 " Returns the number of StrokeVertex constituting the Stroke.\n"
365 "\n"
366 " :return: The number of stroke vertices.\n"
367 " :rtype: int\n");
369{
370 return PyLong_FromLong(self->s->strokeVerticesSize());
371}
372
373#ifdef __GNUC__
374# ifdef __clang__
375# pragma clang diagnostic push
376# pragma clang diagnostic ignored "-Wcast-function-type"
377# else
378# pragma GCC diagnostic push
379# pragma GCC diagnostic ignored "-Wcast-function-type"
380# endif
381#endif
382
383static PyMethodDef BPy_Stroke_methods[] = {
384 {"compute_sampling",
385 (PyCFunction)Stroke_compute_sampling,
386 METH_VARARGS | METH_KEYWORDS,
387 Stroke_compute_sampling_doc},
388 {"resample", (PyCFunction)Stroke_resample, METH_VARARGS | METH_KEYWORDS, Stroke_resample_doc},
389 {"remove_all_vertices",
390 (PyCFunction)Stroke_remove_all_vertices,
391 METH_NOARGS,
392 Stroke_remove_all_vertices_doc},
393 {"remove_vertex",
394 (PyCFunction)Stroke_remove_vertex,
395 METH_VARARGS | METH_KEYWORDS,
396 Stroke_remove_vertex_doc},
397 {"insert_vertex",
398 (PyCFunction)Stroke_insert_vertex,
399 METH_VARARGS | METH_KEYWORDS,
400 Stroke_insert_vertex_doc},
401 {"update_length", (PyCFunction)Stroke_update_length, METH_NOARGS, Stroke_update_length_doc},
402 {"stroke_vertices_begin",
403 (PyCFunction)Stroke_stroke_vertices_begin,
404 METH_VARARGS | METH_KEYWORDS,
405 Stroke_stroke_vertices_begin_doc},
406 {"stroke_vertices_end",
407 (PyCFunction)Stroke_stroke_vertices_end,
408 METH_NOARGS,
409 Stroke_stroke_vertices_end_doc},
410 {"__reversed__", (PyCFunction)Stroke_reversed, METH_NOARGS, Stroke_reversed_doc},
411 {"stroke_vertices_size",
412 (PyCFunction)Stroke_stroke_vertices_size,
413 METH_NOARGS,
414 Stroke_stroke_vertices_size_doc},
415 {nullptr, nullptr, 0, nullptr},
416};
417
418#ifdef __GNUC__
419# ifdef __clang__
420# pragma clang diagnostic pop
421# else
422# pragma GCC diagnostic pop
423# endif
424#endif
425
426/*----------------------Stroke get/setters ----------------------------*/
427
429 /* Wrap. */
430 Stroke_medium_type_doc,
431 "The MediumType used for this Stroke.\n"
432 "\n"
433 ":type: :class:`MediumType`\n");
434static PyObject *Stroke_medium_type_get(BPy_Stroke *self, void * /*closure*/)
435{
437}
438
439static int Stroke_medium_type_set(BPy_Stroke *self, PyObject *value, void * /*closure*/)
440{
441 if (!BPy_MediumType_Check(value)) {
442 PyErr_SetString(PyExc_TypeError, "value must be a MediumType");
443 return -1;
444 }
446 return 0;
447}
448
450 /* Wrap. */
451 Stroke_texture_id_doc,
452 "The ID of the texture used to simulate th marks system for this Stroke.\n"
453 "\n"
454 ":type: int\n");
455static PyObject *Stroke_texture_id_get(BPy_Stroke *self, void * /*closure*/)
456{
457 return PyLong_FromLong(self->s->getTextureId());
458}
459
460static int Stroke_texture_id_set(BPy_Stroke *self, PyObject *value, void * /*closure*/)
461{
462 uint i = PyLong_AsUnsignedLong(value);
463 if (PyErr_Occurred()) {
464 return -1;
465 }
466 self->s->setTextureId(i);
467 return 0;
468}
469
471 /* Wrap. */
472 Stroke_tips_doc,
473 "True if this Stroke uses a texture with tips, and false otherwise.\n"
474 "\n"
475 ":type: bool\n");
476static PyObject *Stroke_tips_get(BPy_Stroke *self, void * /*closure*/)
477{
478 return PyBool_from_bool(self->s->hasTips());
479}
480
481static int Stroke_tips_set(BPy_Stroke *self, PyObject *value, void * /*closure*/)
482{
483 if (!PyBool_Check(value)) {
484 return -1;
485 }
486 self->s->setTips(bool_from_PyBool(value));
487 return 0;
488}
489
491 /* Wrap. */
492 Stroke_length_2d_doc,
493 "The 2D length of the Stroke.\n"
494 "\n"
495 ":type: float\n");
496static PyObject *Stroke_length_2d_get(BPy_Stroke *self, void * /*closure*/)
497{
498 return PyFloat_FromDouble(self->s->getLength2D());
499}
500
501static int Stroke_length_2d_set(BPy_Stroke *self, PyObject *value, void * /*closure*/)
502{
503 float scalar;
504 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
505 /* parsed item not a number */
506 PyErr_SetString(PyExc_TypeError, "value must be a number");
507 return -1;
508 }
509 self->s->setLength(scalar);
510 return 0;
511}
512
514 /* Wrap. */
515 Stroke_id_doc,
516 "The Id of this Stroke.\n"
517 "\n"
518 ":type: :class:`Id`\n");
519static PyObject *Stroke_id_get(BPy_Stroke *self, void * /*closure*/)
520{
521 Id id(self->s->getId());
522 return BPy_Id_from_Id(id); // return a copy
523}
524
525static int Stroke_id_set(BPy_Stroke *self, PyObject *value, void * /*closure*/)
526{
527 if (!BPy_Id_Check(value)) {
528 PyErr_SetString(PyExc_TypeError, "value must be an Id");
529 return -1;
530 }
531 self->s->setId(*(((BPy_Id *)value)->id));
532 return 0;
533}
534
535static PyGetSetDef BPy_Stroke_getseters[] = {
536 {"medium_type",
539 Stroke_medium_type_doc,
540 nullptr},
541 {"texture_id",
542 (getter)Stroke_texture_id_get,
543 (setter)Stroke_texture_id_set,
544 Stroke_texture_id_doc,
545 nullptr},
546 {"tips", (getter)Stroke_tips_get, (setter)Stroke_tips_set, Stroke_tips_doc, nullptr},
547 {"length_2d",
548 (getter)Stroke_length_2d_get,
549 (setter)Stroke_length_2d_set,
550 Stroke_length_2d_doc,
551 nullptr},
552 {"id", (getter)Stroke_id_get, (setter)Stroke_id_set, Stroke_id_doc, nullptr},
553 {nullptr, nullptr, nullptr, nullptr, nullptr} /* Sentinel */
554};
555
556/*-----------------------BPy_Stroke type definition ------------------------------*/
557
558static PySequenceMethods BPy_Stroke_as_sequence = {
559 /*sq_length*/ (lenfunc)Stroke_sq_length,
560 /*sq_concat*/ nullptr,
561 /*sq_repeat*/ nullptr,
562 /*sq_item*/ (ssizeargfunc)Stroke_sq_item,
563 /*was_sq_slice*/ nullptr, /* DEPRECATED. */
564 /*sq_ass_item*/ nullptr,
565 /*was_sq_ass_slice*/ nullptr, /* DEPRECATED. */
566 /*sq_contains*/ nullptr,
567 /*sq_inplace_concat*/ nullptr,
568 /*sq_inplace_repeat*/ nullptr,
569};
570
571PyTypeObject Stroke_Type = {
572 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
573 /*tp_name*/ "Stroke",
574 /*tp_basicsize*/ sizeof(BPy_Stroke),
575 /*tp_itemsize*/ 0,
576 /*tp_dealloc*/ nullptr,
577 /*tp_vectorcall_offset*/ 0,
578 /*tp_getattr*/ nullptr,
579 /*tp_setattr*/ nullptr,
580 /*tp_as_async*/ nullptr,
581 /*tp_repr*/ nullptr,
582 /*tp_as_number*/ nullptr,
583 /*tp_as_sequence*/ &BPy_Stroke_as_sequence,
584 /*tp_as_mapping*/ nullptr,
585 /*tp_hash*/ nullptr,
586 /*tp_call*/ nullptr,
587 /*tp_str*/ nullptr,
588 /*tp_getattro*/ nullptr,
589 /*tp_setattro*/ nullptr,
590 /*tp_as_buffer*/ nullptr,
591 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
592 /*tp_doc*/ Stroke_doc,
593 /*tp_traverse*/ nullptr,
594 /*tp_clear*/ nullptr,
595 /*tp_richcompare*/ nullptr,
596 /*tp_weaklistoffset*/ 0,
597 /*tp_iter*/ (getiterfunc)Stroke_iter,
598 /*tp_iternext*/ nullptr,
599 /*tp_methods*/ BPy_Stroke_methods,
600 /*tp_members*/ nullptr,
601 /*tp_getset*/ BPy_Stroke_getseters,
602 /*tp_base*/ &Interface1D_Type,
603 /*tp_dict*/ nullptr,
604 /*tp_descr_get*/ nullptr,
605 /*tp_descr_set*/ nullptr,
606 /*tp_dictoffset*/ 0,
607 /*tp_init*/ (initproc)Stroke_init,
608 /*tp_alloc*/ nullptr,
609 /*tp_new*/ nullptr,
610};
611
PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator(StrokeInternal::StrokeVertexIterator &sv_it, bool reversed)
PyObject * BPy_Id_from_Id(Id &id)
bool bool_from_PyBool(PyObject *b)
PyObject * BPy_StrokeVertex_from_StrokeVertex(StrokeVertex &sv)
PyObject * BPy_MediumType_from_MediumType(Stroke::MediumType n)
Stroke::MediumType MediumType_from_BPy_MediumType(PyObject *obj)
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")
#define BPy_Id_Check(v)
Definition BPy_Id.h:23
PyTypeObject Interface1D_Type
#define BPy_MediumType_Check(v)
PyTypeObject StrokeVertexIterator_Type
PyTypeObject StrokeVertex_Type
static PyObject * Stroke_remove_vertex(BPy_Stroke *self, PyObject *args, PyObject *kwds)
static int Stroke_medium_type_set(BPy_Stroke *self, PyObject *value, void *)
static PyObject * Stroke_update_length(BPy_Stroke *self)
static Py_ssize_t Stroke_sq_length(BPy_Stroke *self)
static PyObject * Stroke_texture_id_get(BPy_Stroke *self, void *)
PyTypeObject Stroke_Type
static PyObject * Stroke_iter(PyObject *self)
static PyObject * Stroke_remove_all_vertices(BPy_Stroke *self)
static PyObject * Stroke_resample(BPy_Stroke *self, PyObject *args, PyObject *kwds)
static int Stroke_length_2d_set(BPy_Stroke *self, PyObject *value, void *)
static PyObject * Stroke_stroke_vertices_end(BPy_Stroke *self)
static PyObject * Stroke_medium_type_get(BPy_Stroke *self, void *)
static PySequenceMethods BPy_Stroke_as_sequence
static PyObject * Stroke_stroke_vertices_begin(BPy_Stroke *self, PyObject *args, PyObject *kwds)
static PyObject * Stroke_insert_vertex(BPy_Stroke *self, PyObject *args, PyObject *kwds)
static PyObject * Stroke_length_2d_get(BPy_Stroke *self, void *)
static PyMethodDef BPy_Stroke_methods[]
static int Stroke_id_set(BPy_Stroke *self, PyObject *value, void *)
static int Stroke_tips_set(BPy_Stroke *self, PyObject *value, void *)
static PyObject * Stroke_tips_get(BPy_Stroke *self, void *)
static PyObject * Stroke_reversed(BPy_Stroke *self)
static int Stroke_texture_id_set(BPy_Stroke *self, PyObject *value, void *)
static PyObject * Stroke_stroke_vertices_size(BPy_Stroke *self)
static PyObject * Stroke_compute_sampling(BPy_Stroke *self, PyObject *args, PyObject *kwds)
static int Stroke_init(BPy_Stroke *self, PyObject *args, PyObject *kwds)
static PyGetSetDef BPy_Stroke_getseters[]
static PyObject * Stroke_sq_item(BPy_Stroke *self, Py_ssize_t keynum)
static PyObject * Stroke_id_get(BPy_Stroke *self, void *)
void setTextureId(uint id)
Definition Stroke.h:746
void setId(const Id &id)
Definition Stroke.h:731
StrokeVertex & strokeVerticeAt(uint i)
Definition Stroke.h:842
virtual Id getId() const
Definition Stroke.h:494
uint getTextureId()
Definition Stroke.h:633
void RemoveAllVertices()
Definition Stroke.cpp:693
void RemoveVertex(StrokeVertex *iVertex)
Definition Stroke.cpp:703
void InsertVertex(StrokeVertex *iVertex, StrokeInternal::StrokeVertexIterator next)
Definition Stroke.cpp:716
bool hasTips() const
Definition Stroke.h:663
void UpdateLength()
Definition Stroke.cpp:723
uint strokeVerticesSize() const
Definition Stroke.h:836
void setTips(bool iTips)
Definition Stroke.h:776
MediumType getMediumType() const
Definition Stroke.h:627
void setLength(float iLength)
Definition Stroke.cpp:483
float ComputeSampling(int iNVertices)
Definition Stroke.cpp:491
StrokeInternal::StrokeVertexIterator strokeVerticesEnd()
Definition Stroke.cpp:765
StrokeInternal::StrokeVertexIterator strokeVerticesBegin(float t=0.0f)
Definition Stroke.cpp:756
real getLength2D() const
Definition Stroke.h:620
int Resample(int iNPoints)
Definition Stroke.cpp:525
void setMediumType(MediumType iType)
Definition Stroke.h:740
inherits from class Rep
Definition AppCanvas.cpp:20
PyObject_HEAD Freestyle::Interface1D * if1D
BPy_Interface1D py_if1D
Definition BPy_Stroke.h:23
Freestyle::Stroke * s
Definition BPy_Stroke.h:24