Stroke Class Reference
#include <Stroke.h>
Inheritance diagram for Stroke:
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.
Member Enumeration Documentation
|
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 |
( |
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. |
|
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] |
|
real getLength2D |
( |
|
) |
const [inline, virtual] |
|
|
Returns the 2D length of the Stroke
Reimplemented from Interface1D. |
|
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. |
|
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. |
|
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
|
Returns a StrokeVertexIterator pointing after the last StrokeVertex of the Stroke. |
unsigned int strokeVerticesSize |
( |
|
) |
const [inline] |
|
The documentation for this class was generated from the following file: