Blender  V3.3
Functions | Variables
BPy_Stroke.cpp File Reference
#include "BPy_Stroke.h"
#include "../BPy_Convert.h"
#include "../BPy_Id.h"
#include "../BPy_MediumType.h"
#include "../Interface0D/BPy_SVertex.h"
#include "../Interface0D/CurvePoint/BPy_StrokeVertex.h"
#include "../Iterator/BPy_StrokeVertexIterator.h"

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, int 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 *UNUSED(closure))
 
static int Stroke_medium_type_set (BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
 
 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 *UNUSED(closure))
 
static int Stroke_texture_id_set (BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
 
 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 *UNUSED(closure))
 
static int Stroke_tips_set (BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
 
 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 *UNUSED(closure))
 
static int Stroke_length_2d_set (BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
 
 PyDoc_STRVAR (Stroke_id_doc, "The Id of this Stroke.\n" "\n" ":type: :class:`Id`")
 
static PyObject * Stroke_id_get (BPy_Stroke *self, void *UNUSED(closure))
 
static int Stroke_id_set (BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
 

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

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

◆ PyDoc_STRVAR() [3/16]

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

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

◆ PyDoc_STRVAR() [5/16]

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

◆ PyDoc_STRVAR() [6/16]

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

◆ PyDoc_STRVAR() [7/16]

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

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

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

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

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

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

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

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

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

◆ PyDoc_STRVAR() [16/16]

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

◆ Stroke_compute_sampling()

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

Definition at line 102 of file BPy_Stroke.cpp.

References self.

◆ Stroke_id_get()

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

Definition at line 435 of file BPy_Stroke.cpp.

References BPy_Id_from_Id(), id, and self.

◆ Stroke_id_set()

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

Definition at line 441 of file BPy_Stroke.cpp.

References BPy_Id_Check.

◆ Stroke_init()

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

Definition at line 45 of file BPy_Stroke.cpp.

References Stroke_Type.

◆ Stroke_insert_vertex()

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

Definition at line 169 of file BPy_Stroke.cpp.

References StrokeVertex_Type, and StrokeVertexIterator_Type.

◆ Stroke_iter()

static PyObject* Stroke_iter ( PyObject *  self)
static

◆ Stroke_length_2d_get()

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

Definition at line 413 of file BPy_Stroke.cpp.

References self.

◆ Stroke_length_2d_set()

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

Definition at line 418 of file BPy_Stroke.cpp.

◆ Stroke_medium_type_get()

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

Definition at line 354 of file BPy_Stroke.cpp.

References BPy_MediumType_from_MediumType(), and self.

◆ Stroke_medium_type_set()

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

Definition at line 359 of file BPy_Stroke.cpp.

References BPy_MediumType_Check, and MediumType_from_BPy_MediumType().

◆ Stroke_remove_all_vertices()

static PyObject* Stroke_remove_all_vertices ( BPy_Stroke self)
static

Definition at line 227 of file BPy_Stroke.cpp.

◆ Stroke_remove_vertex()

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

Definition at line 203 of file BPy_Stroke.cpp.

References StrokeVertex_Type.

◆ Stroke_resample()

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

Definition at line 129 of file BPy_Stroke.cpp.

References self.

◆ Stroke_reversed()

static PyObject* Stroke_reversed ( BPy_Stroke self)
static

Definition at line 293 of file BPy_Stroke.cpp.

References BPy_StrokeVertexIterator_from_StrokeVertexIterator(), and self.

◆ Stroke_sq_item()

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

Definition at line 75 of file BPy_Stroke.cpp.

References BPy_StrokeVertex_from_StrokeVertex(), self, and Stroke_sq_length().

◆ Stroke_sq_length()

static Py_ssize_t Stroke_sq_length ( BPy_Stroke self)
static

Definition at line 70 of file BPy_Stroke.cpp.

Referenced by Stroke_sq_item().

◆ Stroke_stroke_vertices_begin()

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

Definition at line 257 of file BPy_Stroke.cpp.

References BPy_StrokeVertexIterator_from_StrokeVertexIterator(), and self.

◆ Stroke_stroke_vertices_end()

static PyObject* Stroke_stroke_vertices_end ( BPy_Stroke self)
static

Definition at line 278 of file BPy_Stroke.cpp.

References BPy_StrokeVertexIterator_from_StrokeVertexIterator(), and self.

◆ Stroke_stroke_vertices_size()

static PyObject* Stroke_stroke_vertices_size ( BPy_Stroke self)
static

Definition at line 307 of file BPy_Stroke.cpp.

References self.

◆ Stroke_texture_id_get()

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

Definition at line 374 of file BPy_Stroke.cpp.

References self.

◆ Stroke_texture_id_set()

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

Definition at line 379 of file BPy_Stroke.cpp.

◆ Stroke_tips_get()

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

Definition at line 394 of file BPy_Stroke.cpp.

References PyBool_from_bool(), and self.

◆ Stroke_tips_set()

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

Definition at line 399 of file BPy_Stroke.cpp.

References bool_from_PyBool().

◆ Stroke_update_length()

static PyObject* Stroke_update_length ( BPy_Stroke self)
static

Definition at line 238 of file BPy_Stroke.cpp.

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)
Definition: BPy_Stroke.cpp:70
static PyObject * Stroke_sq_item(BPy_Stroke *self, int keynum)
Definition: BPy_Stroke.cpp:75

Definition at line 474 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 PyObject * Stroke_medium_type_get(BPy_Stroke *self, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:354
static int Stroke_id_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:441
static int Stroke_medium_type_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:359
static PyObject * Stroke_length_2d_get(BPy_Stroke *self, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:413
static PyObject * Stroke_texture_id_get(BPy_Stroke *self, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:374
static int Stroke_tips_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:399
static int Stroke_length_2d_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:418
static PyObject * Stroke_tips_get(BPy_Stroke *self, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:394
static PyObject * Stroke_id_get(BPy_Stroke *self, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:435
static int Stroke_texture_id_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure))
Definition: BPy_Stroke.cpp:379

Definition at line 451 of file BPy_Stroke.cpp.

◆ BPy_Stroke_methods

PyMethodDef BPy_Stroke_methods[]
static

Definition at line 312 of file BPy_Stroke.cpp.

◆ Stroke_Type

PyTypeObject Stroke_Type