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

StrokeShader Class Reference

#include <StrokeShader.h>

Inheritance diagram for StrokeShader:

CalligraphicShader SpatialNoiseShader BackboneStretcherShader BezierCurveShader ColorNoiseShader ColorVariationPatternShader ConstantColorShader ConstantThicknessShader ConstrainedIncreasingThicknessShader fstreamShader GuidingLinesShader IncreasingColorShader IncreasingThicknessShader PolygonalizationShader SamplingShader streamShader StrokeTextureShader TextureAssignerShader ThicknessNoiseShader ThicknessVariationPatternShader TipRemoverShader List of all members.

Detailed Description

Base class for Stroke Shaders. Any Stroke Shader must inherit from this class and overload the shade() method. A StrokeShader is designed to modify any Stroke's attribute such as Thickness, Color, Geometry, Texture, Blending mode... The basic way to achieve this operation consists in iterating over the StrokeVertices of the Stroke and to modify each one's StrokeAttribute. Here is a python code example of such an iteration:
  it = ioStroke.strokeVerticesBegin()
  while it.isEnd() == 0:
      att = it.getObject().attribute()
      ## perform here any attribute modification
      it.increment()
Here is a C++ code example of such an iteration:
  for(StrokeInternal::StrokeVertexIterator v=ioStroke.strokeVerticesBegin(), vend=ioStroke.strokeVerticesEnd();
        v!=vend;
        ++v){
    StrokeAttribute& att = v->attribute();
    // perform any attribute modification here...
  }


Public Member Functions

 StrokeShader ()
virtual ~StrokeShader ()
virtual string getName () const
virtual void shade (Stroke &ioStroke) const

Constructor & Destructor Documentation

StrokeShader  )  [inline]
 

Default constructor.

virtual ~StrokeShader  )  [inline, virtual]
 

Destructor.


Member Function Documentation

virtual string getName  )  const [inline, virtual]
 

Returns the string corresponding to the shader's name.

Reimplemented in ConstantThicknessShader, ConstantColorShader, streamShader, and fstreamShader.

virtual void shade Stroke ioStroke  )  const [inline, virtual]
 

The shading method. This method must be overloaded by inherited classes. The shading method is designed to modify any Stroke's attribute such as Thickness, Color, Geometry, Texture, Blending mode... The basic way to achieve this operation consists in iterating over the StrokeVertices of the Stroke and to modify each one's StrokeAttribute. Here is a python code example of such an iteration:

  it = ioStroke.strokeVerticesBegin()
  while it.isEnd() == 0:
      att = it.getObject().attribute()
      ## perform here any attribute modification
      it.increment()
Here is a C++ code example of such an iteration:
  for(StrokeInternal::StrokeVertexIterator v=ioStroke.strokeVerticesBegin(), vend=ioStroke.strokeVerticesEnd();
        v!=vend;
        ++v){
    StrokeAttribute& att = v->attribute();
    // perform any attribute modification here...
  }
Parameters:
ioStroke The stroke we wish to shade. this Stroke is modified by the Shader (which typically modifies the Stroke's attribute's values such as Color, Thickness, Geometry...)

Reimplemented in ConstantThicknessShader, IncreasingThicknessShader, ConstrainedIncreasingThicknessShader, ThicknessVariationPatternShader, ThicknessNoiseShader, ConstantColorShader, IncreasingColorShader, ColorVariationPatternShader, ColorNoiseShader, TextureAssignerShader, StrokeTextureShader, BackboneStretcherShader, SamplingShader, BezierCurveShader, PolygonalizationShader, GuidingLinesShader, TipRemoverShader, streamShader, fstreamShader, CalligraphicShader, and SpatialNoiseShader.


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