h o m e | d o c u m e n t a t i o n | c l a s s h i e r a r c h y |
#include <Stroke.h>
Inheritance diagram for Stroke:
Public Types | |
enum | MediumType { DRY_MEDIUM, HUMID_MEDIUM, OPAQUE_MEDIUM } |
Public Member Functions | |
virtual string | getExactTypeName () const |
virtual Id | getId () const |
Stroke () | |
Stroke (const Stroke &iBrother) | |
template<class InputVertexIterator> | |
Stroke (InputVertexIterator iBegin, InputVertexIterator iEnd) | |
virtual | ~Stroke () |
Stroke & | operator= (const Stroke &iBrother) |
float | ComputeSampling (int iNVertices) |
void | Resample (int iNPoints) |
void | Resample (float iSampling) |
void | RemoveVertex (StrokeVertex *iVertex) |
void | InsertVertex (StrokeVertex *iVertex, StrokeInternal::StrokeVertexIterator next) |
real | getLength2D () const |
MediumType | getMediumType () const |
unsigned int | getTextureId () |
bool | hasTips () const |
void | SetId (const Id &id) |
void | SetLength (float iLength) |
void | SetMediumType (MediumType iType) |
void | SetTextureId (unsigned int id) |
void | SetTips (bool iTips) |
StrokeInternal::StrokeVertexIterator | strokeVerticesBegin (float t=0.f) |
StrokeInternal::StrokeVertexIterator | strokeVerticesEnd () |
unsigned int | strokeVerticesSize () const |
virtual Interface0DIterator | verticesBegin () |
virtual Interface0DIterator | verticesEnd () |
virtual Interface0DIterator | pointsBegin (float t=0.f) |
virtual Interface0DIterator | pointsEnd (float t=0.f) |
enum MediumType |
Stroke | ( | ) |
default constructor
Stroke | ( | InputVertexIterator | iBegin, | |
InputVertexIterator | iEnd | |||
) |
Builds a stroke from a set of StrokeVertex. This constructor is templated by an iterator type. This iterator type must allow the vertices parsing using the ++ operator.
iBegin | The iterator pointing to the first vertex. | |
iEnd | The iterator pointing to the end of the vertex list. |
virtual ~Stroke | ( | ) | [virtual] |
Destructor
virtual string getExactTypeName | ( | ) | const [inline, virtual] |
Returns the string "Stroke"
Reimplemented from Interface1D.
virtual Id getId | ( | ) | const [inline, virtual] |
Reimplemented from Interface1D.
float ComputeSampling | ( | int | iNVertices | ) |
Compute the sampling needed to get iNVertices vertices. If the specified number of vertices is less than the actual number of vertices, the actual sampling value is returned. (To remove Vertices, use the RemoveVertex() method of this class).
iNVertices | The number of StrokeVertices we eventually want in our Stroke. |
void Resample | ( | int | iNPoints | ) |
Resampling method. Resamples the curve so that it eventually has iNPoints. That means it is going to add iNPoints-vertices_size, if vertices_size is the number of points we already have. Is vertices_size >= iNPoints, no resampling is done.
iNPoints | The number of vertices we eventually want in our stroke. |
void Resample | ( | float | iSampling | ) |
Resampling method. Resamples the curve with a given sampling. If this sampling is < to the actual sampling value, no resampling is done.
iSampling | The new sampling value. |
void RemoveVertex | ( | StrokeVertex * | iVertex | ) |
Removes the stroke vertex iVertex from the stroke. The length and curvilinear abscissa are updated consequently.
void InsertVertex | ( | StrokeVertex * | iVertex, | |
StrokeInternal::StrokeVertexIterator | next | |||
) |
Inserts the stroke vertex iVertex in the stroke before next. The length, curvilinear abscissa are updated consequently.
iVertex | The StrokeVertex to insert in the Stroke. | |
next | A StrokeVertexIterator pointing to the StrokeVeretx before which iVertex must be inserted. |
real getLength2D | ( | ) | const [inline, virtual] |
Returns the 2D length of the Stroke
Reimplemented from Interface1D.
MediumType getMediumType | ( | ) | const [inline] |
Returns the MediumType used for this Stroke.
unsigned int getTextureId | ( | ) | [inline] |
Returns the id of the texture used to simulate th marks system for this Stroke
bool hasTips | ( | ) | const [inline] |
Returns true if this Stroke uses a texture with tips, false otherwise.
void SetLength | ( | float | iLength | ) |
Sets the 2D length of the Stroke.
void SetMediumType | ( | MediumType | iType | ) | [inline] |
Sets the medium type that must be used for this Stroke.
void SetTextureId | ( | unsigned int | id | ) | [inline] |
Sets the texture id to be used to simulate the marks system for this Stroke.
void SetTips | ( | bool | iTips | ) | [inline] |
Sets the flag telling whether this stroke is using a texture with tips or not.
StrokeInternal::StrokeVertexIterator strokeVerticesBegin | ( | float | t = 0.f |
) |
Returns a StrokeVertexIterator pointing on the first StrokeVertex of the Stroke. One can specifly a sampling value to resample the Stroke on the fly if needed.
t | The resampling value with which we want our Stroke to be resampled. If 0 is specified, no resampling is done. |
StrokeInternal::StrokeVertexIterator strokeVerticesEnd | ( | ) |
Returns a StrokeVertexIterator pointing after the last StrokeVertex of the Stroke.
unsigned int strokeVerticesSize | ( | ) | const [inline] |
Returns the number of StrokeVertex constituing the Stroke.
virtual Interface0DIterator verticesBegin | ( | ) | [virtual] |
Returns an Interface0DIterator pointing on the first StrokeVertex of the Stroke.
Implements Interface1D.
virtual Interface0DIterator verticesEnd | ( | ) | [virtual] |
Returns an Interface0DIterator pointing after the last StrokeVertex of the Stroke.
Implements Interface1D.
virtual Interface0DIterator pointsBegin | ( | float | t = 0.f |
) | [virtual] |
Returns an iterator over the Interface1D points, pointing to the first point. The difference with verticesBegin() is that here we can iterate over points of the 1D element at a any given sampling. Indeed, for each iteration, a virtual point is created.
t | The sampling with which we want to iterate over points of this 1D element. |
Implements Interface1D.
virtual Interface0DIterator pointsEnd | ( | float | t = 0.f |
) | [virtual] |
Returns an iterator over the Interface1D points, pointing after the last point. The difference with verticesEnd() is that here we can iterate over points of the 1D element at a any given sampling. Indeed, for each iteration, a virtual point is created.
t | The sampling with which we want to iterate over points of this 1D element. |
Implements Interface1D.