Blender V4.5
BPy_Stroke.cpp File Reference

Go to the source code of this file.

Functions

 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 int Stroke_init (BPy_Stroke *self, PyObject *args, PyObject *kwds)
static PyObject * Stroke_iter (PyObject *self)
static Py_ssize_t Stroke_sq_length (BPy_Stroke *self)
static PyObject * Stroke_sq_item (BPy_Stroke *self, Py_ssize_t keynum)
 PyDoc_STRVAR (Stroke_compute_sampling_doc, ".. method:: compute_sampling(n)\n" "\n" " Compute the sampling needed to get N vertices. If the\n" " specified number of vertices is less than the actual number of\n" " vertices, the actual sampling value is returned. (To remove Vertices,\n" " use the RemoveVertex() method of this class.)\n" "\n" " :arg n: The number of stroke vertices we eventually want\n" " in our Stroke.\n" " :type n: int\n" " :return: The sampling that must be used in the Resample(float)\n" " method.\n" " :rtype: float")
static PyObject * Stroke_compute_sampling (BPy_Stroke *self, PyObject *args, PyObject *kwds)
 PyDoc_STRVAR (Stroke_resample_doc, ".. method:: resample(n)\n" " resample(sampling)\n" "\n" " Resamples the stroke so using one of two methods with the goal\n" " of creating a stroke with fewer points and the same shape.\n" "\n" " :arg n: Resamples the stroke so that it eventually has N points. That means\n" " it is going to add N-vertices_size, where vertices_size is the\n" " number of points we already have. If vertices_size >= N, no\n" " resampling is done.\n" " :type n: int\n" " :arg sampling: Resamples the stroke with a given sampling value. If the\n" " sampling is smaller than the actual sampling value, no resampling is done.\n" " :type sampling: float")
static PyObject * Stroke_resample (BPy_Stroke *self, PyObject *args, PyObject *kwds)
 PyDoc_STRVAR (Stroke_insert_vertex_doc, ".. method:: insert_vertex(vertex, next)\n" "\n" " Inserts the StrokeVertex given as argument into the Stroke before the\n" " point specified by next. The length and curvilinear abscissa are\n" " updated consequently.\n" "\n" " :arg vertex: The StrokeVertex to insert in the Stroke.\n" " :type vertex: :class:`StrokeVertex`\n" " :arg next: A StrokeVertexIterator pointing to the StrokeVertex\n" " before which vertex must be inserted.\n" " :type next: :class:`StrokeVertexIterator`")
static PyObject * Stroke_insert_vertex (BPy_Stroke *self, PyObject *args, PyObject *kwds)
 PyDoc_STRVAR (Stroke_remove_vertex_doc, ".. method:: remove_vertex(vertex)\n" "\n" " Removes the StrokeVertex given as argument from the Stroke. The length\n" " and curvilinear abscissa are updated consequently.\n" "\n" " :arg vertex: the StrokeVertex to remove from the Stroke.\n" " :type vertex: :class:`StrokeVertex`")
static PyObject * Stroke_remove_vertex (BPy_Stroke *self, PyObject *args, PyObject *kwds)
 PyDoc_STRVAR (Stroke_remove_all_vertices_doc, ".. method:: remove_all_vertices()\n" "\n" " Removes all vertices from the Stroke.")
static PyObject * Stroke_remove_all_vertices (BPy_Stroke *self)
 PyDoc_STRVAR (Stroke_update_length_doc, ".. method:: update_length()\n" "\n" " Updates the 2D length of the Stroke.")
static PyObject * Stroke_update_length (BPy_Stroke *self)
 PyDoc_STRVAR (Stroke_stroke_vertices_begin_doc, ".. method:: stroke_vertices_begin(t=0.0)\n" "\n" " Returns a StrokeVertexIterator pointing on the first StrokeVertex of\n" " the Stroke. One can specify a sampling value to re-sample the Stroke\n" " on the fly if needed.\n" "\n" " :arg t: The resampling value with which we want our Stroke to be\n" " resampled. If 0 is specified, no resampling is done.\n" " :type t: float\n" " :return: A StrokeVertexIterator pointing on the first StrokeVertex.\n" " :rtype: :class:`StrokeVertexIterator`")
static PyObject * Stroke_stroke_vertices_begin (BPy_Stroke *self, PyObject *args, PyObject *kwds)
 PyDoc_STRVAR (Stroke_stroke_vertices_end_doc, ".. method:: stroke_vertices_end()\n" "\n" " Returns a StrokeVertexIterator pointing after the last StrokeVertex\n" " of the Stroke.\n" "\n" " :return: A StrokeVertexIterator pointing after the last StrokeVertex.\n" " :rtype: :class:`StrokeVertexIterator`")
static PyObject * Stroke_stroke_vertices_end (BPy_Stroke *self)
 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)
 PyDoc_STRVAR (Stroke_stroke_vertices_size_doc, ".. method:: stroke_vertices_size()\n" "\n" " Returns the number of StrokeVertex constituting the Stroke.\n" "\n" " :return: The number of stroke vertices.\n" " :rtype: int")
static PyObject * Stroke_stroke_vertices_size (BPy_Stroke *self)
 PyDoc_STRVAR (Stroke_medium_type_doc, "The MediumType used for this Stroke.\n" "\n" ":type: :class:`MediumType`")
static PyObject * Stroke_medium_type_get (BPy_Stroke *self, void *)
static int Stroke_medium_type_set (BPy_Stroke *self, PyObject *value, void *)
 PyDoc_STRVAR (Stroke_texture_id_doc, "The ID of the texture used to simulate th marks system for this Stroke.\n" "\n" ":type: int")
static PyObject * Stroke_texture_id_get (BPy_Stroke *self, void *)
static int Stroke_texture_id_set (BPy_Stroke *self, PyObject *value, void *)
 PyDoc_STRVAR (Stroke_tips_doc, "True if this Stroke uses a texture with tips, and false otherwise.\n" "\n" ":type: bool")
static PyObject * Stroke_tips_get (BPy_Stroke *self, void *)
static int Stroke_tips_set (BPy_Stroke *self, PyObject *value, void *)
 PyDoc_STRVAR (Stroke_length_2d_doc, "The 2D length of the Stroke.\n" "\n" ":type: float")
static PyObject * Stroke_length_2d_get (BPy_Stroke *self, void *)
static int Stroke_length_2d_set (BPy_Stroke *self, PyObject *value, void *)
 PyDoc_STRVAR (Stroke_id_doc, "The Id of this Stroke.\n" "\n" ":type: :class:`Id`")
static PyObject * Stroke_id_get (BPy_Stroke *self, void *)
static int Stroke_id_set (BPy_Stroke *self, PyObject *value, void *)

Variables

static PyMethodDef BPy_Stroke_methods []
static PyGetSetDef BPy_Stroke_getseters []
static PySequenceMethods BPy_Stroke_as_sequence
PyTypeObject Stroke_Type

Function Documentation

◆ PyDoc_STRVAR() [1/16]

PyDoc_STRVAR ( Stroke_compute_sampling_doc ,
".. method:: compute_sampling(n)\n" "\n" " Compute the sampling needed to get N vertices. If the\n" " specified number of vertices is less than the actual number of\n" " vertices,
the actual sampling value is returned.(To remove Vertices,\n" " use the RemoveVertex() method of this class.)\n" "\n" " :arg n:The number of stroke vertices we eventually want\n" " in our Stroke.\n" " :type n:int\n" " :return:The sampling that must be used in the Resample(float)\n" " method.\n" " :rtype:float"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [2/16]

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"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [3/16]

PyDoc_STRVAR ( Stroke_id_doc ,
"The Id of this Stroke.\n" "\n" ":type: :class:`Id`"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [4/16]

PyDoc_STRVAR ( Stroke_insert_vertex_doc ,
".. method:: insert_vertex(vertex, next)\n" "\n" " Inserts the StrokeVertex given as argument into the Stroke before the\n" " point specified by next. The length and curvilinear abscissa are\n" " updated consequently.\n" "\n" " :arg vertex: The StrokeVertex to insert in the Stroke.\n" " :type vertex: :class:`StrokeVertex`\n" " :arg next: A StrokeVertexIterator pointing to the StrokeVertex\n" " before which vertex must be inserted.\n" " :type next: :class:`StrokeVertexIterator`"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [5/16]

PyDoc_STRVAR ( Stroke_length_2d_doc ,
"The 2D length of the Stroke.\n" "\n" ":type: float"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [6/16]

PyDoc_STRVAR ( Stroke_medium_type_doc ,
"The MediumType used for this Stroke.\n" "\n" ":type: :class:`MediumType`"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [7/16]

PyDoc_STRVAR ( Stroke_remove_all_vertices_doc ,
".. method:: remove_all_vertices()\n" "\n" " Removes all vertices from the Stroke."  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [8/16]

PyDoc_STRVAR ( Stroke_remove_vertex_doc ,
".. method:: remove_vertex(vertex)\n" "\n" " Removes the StrokeVertex given as argument from the Stroke. The length\n" " and curvilinear abscissa are updated consequently.\n" "\n" " :arg vertex: the StrokeVertex to remove from the Stroke.\n" " :type vertex: :class:`StrokeVertex`"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [9/16]

PyDoc_STRVAR ( Stroke_resample_doc ,
".. method:: resample(n)\n" " resample(sampling)\n" "\n" " Resamples the stroke so using one of two methods with the goal\n" " of creating a stroke with fewer points and the same shape.\n" "\n" " :arg n: Resamples the stroke so that it eventually has N points. That means\n" " it is going to add N- vertices_size,
where vertices_size is the\n" " number of points we already have. If vertices_size >= N,
no\n" " resampling is done.\n" " :type n:int\n" " :arg sampling:Resamples the stroke with a given sampling value. If the\n" " sampling is smaller than the actual sampling value,
no resampling is done.\n" " :type sampling:float"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [10/16]

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`"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [11/16]

PyDoc_STRVAR ( Stroke_stroke_vertices_begin_doc ,
".. method:: stroke_vertices_begin(t=0.0)\n" "\n" " Returns a StrokeVertexIterator pointing on the first StrokeVertex of\n" " the Stroke. One can specify a sampling value to re-sample the Stroke\n" " on the fly if needed.\n" "\n" " :arg t: The resampling value with which we want our Stroke to be\n" " resampled. If 0 is specified,
no resampling is done.\n" " :type t:float\n" " :return:A StrokeVertexIterator pointing on the first StrokeVertex.\n" " :rtype::class:`StrokeVertexIterator`"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [12/16]

PyDoc_STRVAR ( Stroke_stroke_vertices_end_doc ,
".. method:: stroke_vertices_end()\n" "\n" " Returns a StrokeVertexIterator pointing after the last StrokeVertex\n" " of the Stroke.\n" "\n" " :return: A StrokeVertexIterator pointing after the last StrokeVertex.\n" " :rtype: :class:`StrokeVertexIterator`"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [13/16]

PyDoc_STRVAR ( Stroke_stroke_vertices_size_doc ,
".. method:: stroke_vertices_size()\n" "\n" " Returns the number of StrokeVertex constituting the Stroke.\n" "\n" " :return: The number of stroke vertices.\n" " :rtype: int"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [14/16]

PyDoc_STRVAR ( Stroke_texture_id_doc ,
"The ID of the texture used to simulate th marks system for this Stroke.\n" "\n" ":type: int"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [15/16]

PyDoc_STRVAR ( Stroke_tips_doc ,
"True if this Stroke uses a texture with tips,
and false otherwise.\n" "\n" ":type:bool"  )

References PyDoc_STRVAR().

◆ PyDoc_STRVAR() [16/16]

PyDoc_STRVAR ( Stroke_update_length_doc ,
".. method:: update_length()\n" "\n" " Updates the 2D length of the Stroke."  )

References PyDoc_STRVAR().

◆ Stroke_compute_sampling()

PyObject * Stroke_compute_sampling ( BPy_Stroke * self,
PyObject * args,
PyObject * kwds )
static

◆ Stroke_id_get()

PyObject * Stroke_id_get ( BPy_Stroke * self,
void *  )
static

Definition at line 487 of file BPy_Stroke.cpp.

References BPy_Id_from_Id(), Freestyle::Stroke::getId(), BPy_Stroke::s, and Stroke_id_get().

Referenced by Stroke_id_get().

◆ Stroke_id_set()

int Stroke_id_set ( BPy_Stroke * self,
PyObject * value,
void *  )
static

Definition at line 493 of file BPy_Stroke.cpp.

References BPy_Id_Check, BPy_Stroke::s, Freestyle::Stroke::setId(), and Stroke_id_set().

Referenced by Stroke_id_set().

◆ Stroke_init()

int Stroke_init ( BPy_Stroke * self,
PyObject * args,
PyObject * kwds )
static

◆ Stroke_insert_vertex()

PyObject * Stroke_insert_vertex ( BPy_Stroke * self,
PyObject * args,
PyObject * kwds )
static

◆ Stroke_iter()

PyObject * Stroke_iter ( PyObject * self)
static

Definition at line 66 of file BPy_Stroke.cpp.

References BPy_StrokeVertexIterator_from_StrokeVertexIterator(), and Stroke_iter().

Referenced by Stroke_iter().

◆ Stroke_length_2d_get()

PyObject * Stroke_length_2d_get ( BPy_Stroke * self,
void *  )
static

◆ Stroke_length_2d_set()

int Stroke_length_2d_set ( BPy_Stroke * self,
PyObject * value,
void *  )
static

◆ Stroke_medium_type_get()

PyObject * Stroke_medium_type_get ( BPy_Stroke * self,
void *  )
static

◆ Stroke_medium_type_set()

int Stroke_medium_type_set ( BPy_Stroke * self,
PyObject * value,
void *  )
static

◆ Stroke_remove_all_vertices()

PyObject * Stroke_remove_all_vertices ( BPy_Stroke * self)
static

◆ Stroke_remove_vertex()

PyObject * Stroke_remove_vertex ( BPy_Stroke * self,
PyObject * args,
PyObject * kwds )
static

◆ Stroke_resample()

PyObject * Stroke_resample ( BPy_Stroke * self,
PyObject * args,
PyObject * kwds )
static

Definition at line 135 of file BPy_Stroke.cpp.

References i, Freestyle::Stroke::Resample(), BPy_Stroke::s, and Stroke_resample().

Referenced by Stroke_resample().

◆ Stroke_reversed()

PyObject * Stroke_reversed ( BPy_Stroke * self)
static

◆ Stroke_sq_item()

PyObject * Stroke_sq_item ( BPy_Stroke * self,
Py_ssize_t keynum )
static

◆ Stroke_sq_length()

Py_ssize_t Stroke_sq_length ( BPy_Stroke * self)
static

◆ Stroke_stroke_vertices_begin()

PyObject * Stroke_stroke_vertices_begin ( BPy_Stroke * self,
PyObject * args,
PyObject * kwds )
static

◆ Stroke_stroke_vertices_end()

PyObject * Stroke_stroke_vertices_end ( BPy_Stroke * self)
static

◆ Stroke_stroke_vertices_size()

PyObject * Stroke_stroke_vertices_size ( BPy_Stroke * self)
static

◆ Stroke_texture_id_get()

PyObject * Stroke_texture_id_get ( BPy_Stroke * self,
void *  )
static

◆ Stroke_texture_id_set()

int Stroke_texture_id_set ( BPy_Stroke * self,
PyObject * value,
void *  )
static

◆ Stroke_tips_get()

PyObject * Stroke_tips_get ( BPy_Stroke * self,
void *  )
static

◆ Stroke_tips_set()

int Stroke_tips_set ( BPy_Stroke * self,
PyObject * value,
void *  )
static

◆ Stroke_update_length()

PyObject * Stroke_update_length ( BPy_Stroke * self)
static

Variable Documentation

◆ BPy_Stroke_as_sequence

PySequenceMethods BPy_Stroke_as_sequence
static
Initial value:
= {
(lenfunc)Stroke_sq_length,
nullptr,
nullptr,
(ssizeargfunc)Stroke_sq_item,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
}
static Py_ssize_t Stroke_sq_length(BPy_Stroke *self)
static PyObject * Stroke_sq_item(BPy_Stroke *self, Py_ssize_t keynum)

Definition at line 526 of file BPy_Stroke.cpp.

◆ BPy_Stroke_getseters

PyGetSetDef BPy_Stroke_getseters[]
static
Initial value:
= {
{"medium_type",
Stroke_medium_type_doc,
nullptr},
{"texture_id",
Stroke_texture_id_doc,
nullptr},
{"tips", (getter)Stroke_tips_get, (setter)Stroke_tips_set, Stroke_tips_doc, nullptr},
{"length_2d",
Stroke_length_2d_doc,
nullptr},
{"id", (getter)Stroke_id_get, (setter)Stroke_id_set, Stroke_id_doc, nullptr},
{nullptr, nullptr, nullptr, nullptr, nullptr}
}
static int Stroke_medium_type_set(BPy_Stroke *self, PyObject *value, void *)
static PyObject * Stroke_texture_id_get(BPy_Stroke *self, void *)
static int Stroke_length_2d_set(BPy_Stroke *self, PyObject *value, void *)
static PyObject * Stroke_medium_type_get(BPy_Stroke *self, void *)
static PyObject * Stroke_length_2d_get(BPy_Stroke *self, void *)
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 int Stroke_texture_id_set(BPy_Stroke *self, PyObject *value, void *)
static PyObject * Stroke_id_get(BPy_Stroke *self, void *)

Definition at line 503 of file BPy_Stroke.cpp.

◆ BPy_Stroke_methods

PyMethodDef BPy_Stroke_methods[]
static

Definition at line 346 of file BPy_Stroke.cpp.

◆ Stroke_Type

PyTypeObject Stroke_Type