version 3.3

VRS::TEXT::BaseText Class Reference

The base text rendering class, containing common information for most kinds of texts. More...

#include <vrs/text/basetext.h>

Inheritance diagram for VRS::TEXT::BaseText:

VRS::TEXT::AbstractText VRS::Shape VRS::RenderObj VRS::SharedObj VRS::Visitable VRS::TEXT::TextureText VRS::TEXT::DisplacedTextureText

List of all members.

Public Member Functions

 BaseText (SO< FontDefinition > fd, const std::string &text)
 BaseText (SO< FontDefinition > fd, BaseText *bt)
virtual ~BaseText ()
virtual const std::string & getText () const
 Returns the text to be rendered.
virtual const std::string & getCachedText () const
 Returns the cached text, with text direction already calculated.
virtual void setText (const std::string &str)
 Sets the new text to be rendered.
virtual SO< FontDefinitiongetFontDefinition () const
 Returns the FontDefinition.
virtual void setFontDefinition (SO< FontDefinition >)
 Sets the FontDefinition.
virtual
AbstractText::HorizontalAlignment 
getHorizontalAlignment () const
 Returns the Horizontal Alignment.
virtual void setHorizontalAlignment (AbstractText::HorizontalAlignment tva)
 Sets the Horizontal Alignment.
virtual
AbstractText::VerticalAlignment 
getVerticalAlignment () const
 Returns the Vertical Alignment.
virtual void setVerticalAlignment (AbstractText::VerticalAlignment tva)
 Sets the Vertical Alignment.
virtual
AbstractText::HorizontalDirection 
getHorizontalDirection () const
 Returns the Horizontal Direction.
virtual void setHorizontalDirection (AbstractText::HorizontalDirection thd)
 Sets the Horizontal Direction.
virtual
AbstractText::VerticalDirection 
getVerticalDirection () const
 Returns the Vertical Direction.
virtual void setVerticalDirection (AbstractText::VerticalDirection thd)
 Sets the Vertical Direction.
virtual AbstractText::Direction getDirection () const
 Returns the visible Direction.
virtual void setDirection (AbstractText::Direction td)
 Set the visible Direction.
virtual void setAlignmentBounds (float rightBorder, float bottomBorder)
 Sets the bottom and right bounds of the Text.
virtual void setRightAlignmentBound (float rightBorder)
 Sets the right alignement bound.
virtual void setBottomAlignmentBound (float bottomBorder)
 Sets the bottom alignement bound.
virtual float getRightAlignmentBound () const
 Returns the right alignement bound.
virtual float getBottomAlignmentBound () const
 Returns the bottom alignement bound.
virtual float getLineSpacing () const
 Returns the Scale of the inter line gap.
virtual void setLineSpacing (float LineSpacing)
 Sets the Scale of the inter line gap.
virtual void setColor (const Color &color, bool use=true)
 Sets the Color of this Text.
virtual Color getColor () const
 Returns the Color of this Text.
virtual bool useColor () const
 Should the Color be used.
virtual Matrix getMatrix () const
 Returns the local matrix for the text.
virtual void setMatrix (const Matrix &m)
 Sets the local matrix for the text.
virtual void setMatrix (AbstractText::TextPlane tp, const Vector &offset=Vector(0, 0, 0), const Vector &scale=Vector(1, 1, 1))
 Sets the local Matrix.
virtual Bounds boundingBox () const
 Bounds (with Matrix applied).
virtual Bounds getLocalBounds () const
 Bounds (without Matrix applied).
const GlyphPositions getCachedGlyphPositions () const
 Returns the cached GlyphPositions.
bool isDirty () const
 Should the text be rebuild.
virtual void rebuildAllCaches ()
 Refreshes all caches.
virtual void rebuildTextCache ()
 Refreshes the cached text (used with rendering Direction).
virtual void rebuildGlyphCache ()
 Refreshes the cached glyph positions.
 VRS_TYPEINFO (BaseText, Shape)
 VRS_SERIALIZABLE (BaseText)

Protected Member Functions

 BaseText ()
 Constructor for persistency.
virtual void computeLineLengthAndWidth (std::vector< float > *lineWidths, float *totalWidth, float *totalHeight) const
 Computes the size of the font by summing up all advances and font spacings.

Protected Attributes

SO< FontDefinitionm_FontDefinition
 The FontDefinition.
std::string m_Text
 The text to be rendered.
std::string m_CachedText
float m_LineSpacing
 Percentual Scale of the LineHeight.
float m_RightBorder
 The right border of the Text.
float m_BottomBorder
 The bottom border of the Text.
Color m_Color
 The Color of this Text.
bool m_UseColor
 Should the Color be used.
AbstractText::HorizontalAlignment m_HorizontalAlignment
 The horizontal alignment of the text.
AbstractText::VerticalAlignment m_VerticalAlignment
 The vertical alignment of the text.
AbstractText::HorizontalDirection m_HorizontalDirection
 The horizontal direction of the text.
AbstractText::VerticalDirection m_VerticalDirection
 The vertical direction of the text.
AbstractText::Direction m_Direction
 The text direction.
Matrix m_Matrix
 The Rotation of the Text.
Bounds m_CachedBounds
 The cached bounds.
GlyphPositions m_CachedGlyphPositions
 The cached positions of the glyph.
bool m_IsDirty
 Needs redraw.


Detailed Description

The base text rendering class, containing common information for most kinds of texts.

Provides no render methods, its only for convinience.

For usable Shape

See also:
TextureText

Constructor & Destructor Documentation

VRS::TEXT::BaseText::BaseText ( SO< FontDefinition fd,
const std::string &  text 
)

VRS::TEXT::BaseText::BaseText ( SO< FontDefinition fd,
BaseText bt 
)

virtual VRS::TEXT::BaseText::~BaseText (  )  [virtual]

VRS::TEXT::BaseText::BaseText (  )  [protected]

Constructor for persistency.


Member Function Documentation

virtual const std::string& VRS::TEXT::BaseText::getText (  )  const [virtual]

Returns the text to be rendered.

Implements VRS::TEXT::AbstractText.

virtual const std::string& VRS::TEXT::BaseText::getCachedText (  )  const [virtual]

Returns the cached text, with text direction already calculated.

virtual void VRS::TEXT::BaseText::setText ( const std::string &  str  )  [virtual]

Sets the new text to be rendered.

Implements VRS::TEXT::AbstractText.

virtual SO<FontDefinition> VRS::TEXT::BaseText::getFontDefinition (  )  const [virtual]

Returns the FontDefinition.

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setFontDefinition ( SO< FontDefinition  )  [virtual]

Sets the FontDefinition.

Implements VRS::TEXT::AbstractText.

virtual AbstractText::HorizontalAlignment VRS::TEXT::BaseText::getHorizontalAlignment (  )  const [virtual]

Returns the Horizontal Alignment.

See also:
AbstractText::HorizontalAlignment

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setHorizontalAlignment ( AbstractText::HorizontalAlignment  tva  )  [virtual]

Sets the Horizontal Alignment.

See also:
AbstractText::HorizontalAlignment

Implements VRS::TEXT::AbstractText.

virtual AbstractText::VerticalAlignment VRS::TEXT::BaseText::getVerticalAlignment (  )  const [virtual]

Returns the Vertical Alignment.

See also:
AbstractText::VerticalAlignment

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setVerticalAlignment ( AbstractText::VerticalAlignment  tva  )  [virtual]

Sets the Vertical Alignment.

See also:
AbstractText::VerticalAlignment

Implements VRS::TEXT::AbstractText.

virtual AbstractText::HorizontalDirection VRS::TEXT::BaseText::getHorizontalDirection (  )  const [virtual]

Returns the Horizontal Direction.

See also:
AbstractText::HorizontalDirection

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setHorizontalDirection ( AbstractText::HorizontalDirection  thd  )  [virtual]

Sets the Horizontal Direction.

See also:
AbstractText::HorizontalDirection

Implements VRS::TEXT::AbstractText.

virtual AbstractText::VerticalDirection VRS::TEXT::BaseText::getVerticalDirection (  )  const [virtual]

Returns the Vertical Direction.

See also:
AbstractText::VerticalDirection

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setVerticalDirection ( AbstractText::VerticalDirection  thd  )  [virtual]

Sets the Vertical Direction.

See also:
AbstractText::VerticalDirection

Implements VRS::TEXT::AbstractText.

virtual AbstractText::Direction VRS::TEXT::BaseText::getDirection (  )  const [virtual]

Returns the visible Direction.

See also:
AbstractText::Direction

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setDirection ( AbstractText::Direction  td  )  [virtual]

Set the visible Direction.

See also:
AbstractText::Direction

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setAlignmentBounds ( float  rightBorder,
float  bottomBorder 
) [virtual]

Sets the bottom and right bounds of the Text.

Used for alignment and justification. If no alignment bounds are specified, the bounds that will be used is the position of the texts origin. This means that with AbstractText::RIGHT, the text will bei on the right side of the origin, or with AbstractText::CENTER and AbstractText::MIDDLE the cneter of the text will be on the origin.

If specified, the text will be aligned between the origin and the given borders.

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setRightAlignmentBound ( float  rightBorder  )  [virtual]

Sets the right alignement bound.

See also:
setAlignmentBounds

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setBottomAlignmentBound ( float  bottomBorder  )  [virtual]

Sets the bottom alignement bound.

See also:
setAlignmentBounds

Implements VRS::TEXT::AbstractText.

virtual float VRS::TEXT::BaseText::getRightAlignmentBound (  )  const [virtual]

Returns the right alignement bound.

See also:
setAlignmentBounds

Implements VRS::TEXT::AbstractText.

virtual float VRS::TEXT::BaseText::getBottomAlignmentBound (  )  const [virtual]

Returns the bottom alignement bound.

See also:
setAlignmentBounds

Implements VRS::TEXT::AbstractText.

virtual float VRS::TEXT::BaseText::getLineSpacing (  )  const [virtual]

Returns the Scale of the inter line gap.

1.0 means 100%

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setLineSpacing ( float  LineSpacing  )  [virtual]

Sets the Scale of the inter line gap.

1.0 means 100%

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setColor ( const Color color,
bool  use = true 
) [virtual]

Sets the Color of this Text.

Implements VRS::TEXT::AbstractText.

virtual Color VRS::TEXT::BaseText::getColor (  )  const [virtual]

Returns the Color of this Text.

Implements VRS::TEXT::AbstractText.

virtual bool VRS::TEXT::BaseText::useColor (  )  const [virtual]

Should the Color be used.

Implements VRS::TEXT::AbstractText.

virtual Matrix VRS::TEXT::BaseText::getMatrix (  )  const [virtual]

Returns the local matrix for the text.

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::BaseText::setMatrix ( const Matrix m  )  [virtual]

Sets the local matrix for the text.

Implements VRS::TEXT::AbstractText.

Reimplemented in VRS::TEXT::TextureText.

virtual void VRS::TEXT::BaseText::setMatrix ( AbstractText::TextPlane  tp,
const Vector offset = Vector(0,0,0),
const Vector scale = Vector(1,1,1) 
) [inline, virtual]

Sets the local Matrix.

Parameters:
tp Turns the text onto the given plane
offset The offset
offset The scaling

Reimplemented from VRS::TEXT::AbstractText.

Reimplemented in VRS::TEXT::TextureText.

virtual Bounds VRS::TEXT::BaseText::boundingBox (  )  const [virtual]

Bounds (with Matrix applied).

Implements VRS::TEXT::AbstractText.

Reimplemented in VRS::TEXT::DisplacedTextureText, and VRS::TEXT::TextureText.

virtual Bounds VRS::TEXT::BaseText::getLocalBounds (  )  const [virtual]

Bounds (without Matrix applied).

Implements VRS::TEXT::AbstractText.

const GlyphPositions VRS::TEXT::BaseText::getCachedGlyphPositions (  )  const

Returns the cached GlyphPositions.

bool VRS::TEXT::BaseText::isDirty (  )  const

Should the text be rebuild.

virtual void VRS::TEXT::BaseText::rebuildAllCaches (  )  [virtual]

Refreshes all caches.

Reimplemented in VRS::TEXT::TextureText.

virtual void VRS::TEXT::BaseText::rebuildTextCache (  )  [virtual]

Refreshes the cached text (used with rendering Direction).

virtual void VRS::TEXT::BaseText::rebuildGlyphCache (  )  [virtual]

Refreshes the cached glyph positions.

VRS::TEXT::BaseText::VRS_TYPEINFO ( BaseText  ,
Shape   
)

VRS::TEXT::BaseText::VRS_SERIALIZABLE ( BaseText   ) 

virtual void VRS::TEXT::BaseText::computeLineLengthAndWidth ( std::vector< float > *  lineWidths,
float *  totalWidth,
float *  totalHeight 
) const [protected, virtual]

Computes the size of the font by summing up all advances and font spacings.

Parameters:
lineWidths A pointer to a float vector, which will be filled with the length of all the lines
totalWidth A pointer to a float, which will be set to the maximum width of all lines
totalHeight A pointer to a float, which will be set to the to total height of the text
Each parameter can be NULL, and will then not be processed


Member Data Documentation

std::string VRS::TEXT::BaseText::m_Text [protected]

The text to be rendered.

std::string VRS::TEXT::BaseText::m_CachedText [protected]

Percentual Scale of the LineHeight.

The right border of the Text.

The bottom border of the Text.

The Color of this Text.

Should the Color be used.

The horizontal alignment of the text.

The vertical alignment of the text.

The horizontal direction of the text.

The vertical direction of the text.

The text direction.

The Rotation of the Text.

The cached bounds.

The cached positions of the glyph.

Needs redraw.


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

Generated on Sat May 25 06:00:40 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact