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

Stroke Class Reference

#include <Stroke.h>

Inheritance diagram for Stroke:

Interface1D List of all members.

Detailed Description

Class to define a stroke. A stroke is made of a set of 2D vertices (StrokeVertex), regularly spaced out. This set of vertices defines the stroke's backbone geometry. Each of these stroke vertices defines the stroke's shape and appearance at this vertex position.


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 ()
Strokeoperator= (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)

Member Enumeration Documentation

enum MediumType
 

The different blending modes available to similate the interaction media-medium.

Enumeration values:
DRY_MEDIUM  To simulate a dry medium such as Pencil or Charcoal.
HUMID_MEDIUM  To simulate ink painting (color substraction blending).
OPAQUE_MEDIUM  To simulate an opaque medium (oil, spray...).

Constructor & Destructor Documentation

Stroke  ) 
 

default constructor

Stroke const Stroke iBrother  ) 
 

copy 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.

Parameters:
iBegin The iterator pointing to the first vertex.
iEnd The iterator pointing to the end of the vertex list.

virtual ~Stroke  )  [virtual]
 

Destructor


Member Function Documentation

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

Parameters:
iNVertices The number of StrokeVertices we eventually want in our Stroke.
Returns:
the sampling that must be used in the Resample(float) method.
See also:
Resample(int)

Resample(float)

virtual string getExactTypeName  )  const [inline, virtual]
 

Returns the string "Stroke"

Reimplemented from Interface1D.

virtual Id getId  )  const [inline, virtual]
 

Returns the Id of the Stroke

Reimplemented from Interface1D.

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 InsertVertex StrokeVertex iVertex,
StrokeInternal::StrokeVertexIterator  next
 

Inserts the stroke vertex iVertex in the stroke before next. The length, curvilinear abscissa are updated consequently.

Parameters:
iVertex The StrokeVertex to insert in the Stroke.
next A StrokeVertexIterator pointing to the StrokeVeretx before which iVertex must be inserted.

Stroke& operator= const Stroke iBrother  ) 
 

operator =

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.

Parameters:
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.

Parameters:
t The sampling with which we want to iterate over points of this 1D element.

Implements Interface1D.

void RemoveVertex StrokeVertex iVertex  ) 
 

Removes the stroke vertex iVertex from the stroke. The length and curvilinear abscissa are updated consequently.

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.

Parameters:
iSampling The new sampling value.

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.

Parameters:
iNPoints The number of vertices we eventually want in our stroke.

void SetId const Id id  )  [inline]
 

Sets the Id of the Stroke.

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.

Parameters:
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.


The documentation for this class was generated from the following file: