version 3.3

VRS::TextureEdgesGL Class Reference

#include <vrs/opengl/textureedgesgl.h>

Inheritance diagram for VRS::TextureEdgesGL:

VRS::MonoAttribute VRS::Attribute VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 TextureEdgesGL (Image *strokeImage, Iterator< Vector > *minTexCoords, Iterator< Vector > *maxTexCoords, unsigned int style=1, double width=0.25, double lengthOffset=0.0, double tiltOffset=0.0, unsigned int hue=100, Color color=Color(0.0, 0.0, 0.0), double depthOffset=0.0, double fadeOutDist=0, double maxDist=0)
unsigned int getStyle () const
void setStyle (unsigned int style)
double getWidth () const
void setWidth (double width)
double getLengthOffset () const
void setLengthOffset (double offset)
double getTiltOffset () const
void setTiltOffset (double offset)
unsigned int getHue () const
void setHue (unsigned int hue)
Color getColor () const
void setColor (const Color &color)
double getDepthOffset () const
void setDepthOffset (double offset)
double getFadeOutDistance () const
double getMaxDistance () const
void setFading (double fadeOutDist=0, double maxDist=0)
SO< TexturegetStrokeTexture () const
SO< Iterator< Vector > > getMinTexCoords () const
SO< Iterator< Vector > > getMaxTexCoords () const
 VRS_TYPEINFO (TextureEdgesGL, MonoAttribute)
 VRS_SERIALIZABLE (TextureEdgesGL)

Static Public Member Functions

static SO< PolygonSetcreateEdgeGeometry (Iterator< Vector > *edges)


Detailed Description

TextureEdgesGL allows to represent edges by texture-based strokes. To use a TextureEdgesGL you have to:

Note:


Constructor & Destructor Documentation

VRS::TextureEdgesGL::TextureEdgesGL ( Image strokeImage,
Iterator< Vector > *  minTexCoords,
Iterator< Vector > *  maxTexCoords,
unsigned int  style = 1,
double  width = 0.25,
double  lengthOffset = 0.0,
double  tiltOffset = 0.0,
unsigned int  hue = 100,
Color  color = Color(0.0, 0.0, 0.0),
double  depthOffset = 0.0,
double  fadeOutDist = 0,
double  maxDist = 0 
)

  • strokeImage must be a texture image containing the strokes in its alpha channel.
    • minTexCoords/maxTexCoords must be iterators of the same length > 0. Each pair of corresponding min/max vectors specify a rectangular part of the stroke image. Note that the tex-coords must be specified in [0,1]x[0,1], i.e. independently on the image resolution.
    • see the corresponding get/set methods for the remaining parameters.


Member Function Documentation

unsigned int VRS::TextureEdgesGL::getStyle (  )  const

void VRS::TextureEdgesGL::setStyle ( unsigned int  style  ) 

Sets the current stroke style. Each rectangle (defined via a min/max-coords pair in the constructor) in the strokeImage defines a stroke style. Consequently The number of styles is defined by the length of minTexCoords. style must be in {0,...,number-of-styles}.

double VRS::TextureEdgesGL::getWidth (  )  const

void VRS::TextureEdgesGL::setWidth ( double  width  ) 

Sets the width of the quads that are textured with strokes.

double VRS::TextureEdgesGL::getLengthOffset (  )  const

void VRS::TextureEdgesGL::setLengthOffset ( double  offset  ) 

The edges may overlap their endpoints by a fixed length offset. Note that the length offset is scale dependent.

double VRS::TextureEdgesGL::getTiltOffset (  )  const

void VRS::TextureEdgesGL::setTiltOffset ( double  offset  ) 

The endpoints of each edge may be shifted orthogonally to the edge direction by a fixed tilt offset.

unsigned int VRS::TextureEdgesGL::getHue (  )  const

void VRS::TextureEdgesGL::setHue ( unsigned int  hue  ) 

Sets the hue value of the strokes.

Color VRS::TextureEdgesGL::getColor (  )  const

void VRS::TextureEdgesGL::setColor ( const Color color  ) 

Sets the stroke color.

double VRS::TextureEdgesGL::getDepthOffset (  )  const

void VRS::TextureEdgesGL::setDepthOffset ( double  offset  ) 

Usually the edges are used to enhance a given shape. For this the strokes must not be covered by this shape. So the TextureEdges moves the edge vertices slightly towards the viewer. Note that the depth offset is scale dependent.

double VRS::TextureEdgesGL::getFadeOutDistance (  )  const

double VRS::TextureEdgesGL::getMaxDistance (  )  const

void VRS::TextureEdgesGL::setFading ( double  fadeOutDist = 0,
double  maxDist = 0 
)

When viewing from a large distance the edges can produce z-Buffer artifacts or aliasing. To avoid this, the edges can be smoothly faded out when moving away from the viewer. The fading starts at distance 'fadeOutDist' and stops at 'maxDist'. 'fadeOutDist' must be less or equal maxDist! Setting maxDist to 0 disables the fading, i.e. in this case the max distance is infinite.

static SO<PolygonSet> VRS::TextureEdgesGL::createEdgeGeometry ( Iterator< Vector > *  edges  )  [static]

Creates an appropriate edge representation that can be rendered with an active TextureEdgeGL attribute. 'edges' must not be NULL and must contain all edge vertices. Note that subsequent edges need not be adjacent. E.g. a polygon (a,b,c,d) has to be passed as (a,b,b,c,c,d,d,a).

SO<Texture> VRS::TextureEdgesGL::getStrokeTexture (  )  const

SO<Iterator<Vector> > VRS::TextureEdgesGL::getMinTexCoords (  )  const

SO<Iterator<Vector> > VRS::TextureEdgesGL::getMaxTexCoords (  )  const

Used by the painter.

VRS::TextureEdgesGL::VRS_TYPEINFO ( TextureEdgesGL  ,
MonoAttribute   
)

VRS::TextureEdgesGL::VRS_SERIALIZABLE ( TextureEdgesGL   ) 


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

Generated on Wed May 23 06:00:23 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact