version 3.3

VRS::TEXT::CombinedText Class Reference

A combined text, build out of different texts, rendered in a distinct order. More...

#include <vrs/text/combinedtext.h>

Inheritance diagram for VRS::TEXT::CombinedText:

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

List of all members.

Public Types

enum  TextHint {
  EMPTY, SPECIAL, SHADOWED, OUTLINED_SOFT,
  OUTLINED_HARD
}
 The types of outlined texts. More...

Public Member Functions

 CombinedText (unsigned int estimatedElements=0)
 Only called by Factory Methods.
virtual ~CombinedText ()
 D-tor.
 VRS_SERIALIZABLE_CLASS_ENUM (TextHint)
virtual TextHint getTextHint () const
 Returns a Hint for the Type of combined Text.
virtual void addText (SO< AbstractText > at, int layer)
 Adds a new text to this CombinedText.
virtual void removeText (SO< AbstractText > at)
 Removes a text from the CombinedText.
virtual const std::string & getText () const
 Returns the text to be rendered.
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 Bounds boundingBox () const
 Bounds (with Matrix applied).
virtual Bounds getLocalBounds () const
 Bounds (without Matrix applied).
const SO< TextIter_getTexts () const
 Returns a list of all the texts of this CombinedTexts Used only internal while rendering.
 VRS_TYPEINFO (CombinedText, Shape)
 VRS_SERIALIZABLE (CombinedText)

Static Public Member Functions

static SO< CombinedTextcreateOutlinedText (const Color &normalcol, const Color &outlinecol, const std::string &text, SO< FontDefinition > fdNormal, float outlineSize)
 Helper method for creating a simple outlined text.
static SO< CombinedTextcreateSoftOutlinedText (const Color &normalcol, const Color &outlinecol, const std::string &text, SO< FontDefinition > fdNormal, float outlineSize, float softSize)
 Helper method for creating a simple outlined text.
static SO< CombinedTextcreateShadowedText (const Color &normalcol, const Color &shadowcol, const std::string &text, SO< FontDefinition > fdNormal, const Vector &shadowOffset)
 Helper method for creating a simple text with a shadow.


Detailed Description

A combined text, build out of different texts, rendered in a distinct order.

Member Enumeration Documentation

The types of outlined texts.

Enumerator:
EMPTY  No Texts.
SPECIAL  Not matching anything else.
SHADOWED  Shadow - Two passes, same FontDefinition.
OUTLINED_SOFT  Soft Outline - Two passes, different FontDefinitions.
OUTLINED_HARD  Hard Outline - Two passes, different FontDefinitions.


Constructor & Destructor Documentation

VRS::TEXT::CombinedText::CombinedText ( unsigned int  estimatedElements = 0  ) 

Only called by Factory Methods.

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

D-tor.


Member Function Documentation

static SO<CombinedText> VRS::TEXT::CombinedText::createOutlinedText ( const Color normalcol,
const Color outlinecol,
const std::string &  text,
SO< FontDefinition fdNormal,
float  outlineSize 
) [static]

Helper method for creating a simple outlined text.

The outlines will be hard, but still antialised.

Parameters:
normalcol The color of the normal text
outlinecol The color of the outlines of the text
text The string for the text
fdNormal The fontdefinition for the normal text, based on this, a FontDefinition for the outlines will be generated.
outlineSize The width of the outline, in pixel
Returns:
The finished CombinedText

static SO<CombinedText> VRS::TEXT::CombinedText::createSoftOutlinedText ( const Color normalcol,
const Color outlinecol,
const std::string &  text,
SO< FontDefinition fdNormal,
float  outlineSize,
float  softSize 
) [static]

Helper method for creating a simple outlined text.

The outlines will be softened.

Parameters:
normalcol The color of the normal text
outlinecol The color of the outlines of the text
text The string for the text
fdNormal The fontdefinition for the normal text, based on this, a FontDefinition for the outlines will be generated.
outlineSize The width of the outline, in pixel
softSize The amount of blur for the outlines, in pixel, usually smaller than outlineSize
Returns:
The finished CombinedText

static SO<CombinedText> VRS::TEXT::CombinedText::createShadowedText ( const Color normalcol,
const Color shadowcol,
const std::string &  text,
SO< FontDefinition fdNormal,
const Vector shadowOffset 
) [static]

Helper method for creating a simple text with a shadow.

The shadow will be as sharp as the original font.

Parameters:
normalcol The color of the normal text
shadowcol The color of the shadow
text The string for the text
fdNormal The fontdefinition for the normal text, based on this, this FontDefinition will also be used for the shadow
shadowOffset The offset of the shadow
Returns:
The finished CombinedText

VRS::TEXT::CombinedText::VRS_SERIALIZABLE_CLASS_ENUM ( TextHint   ) 

virtual TextHint VRS::TEXT::CombinedText::getTextHint (  )  const [virtual]

Returns a Hint for the Type of combined Text.

Returns:
The kind of combined text
See also:
TextHint

virtual void VRS::TEXT::CombinedText::addText ( SO< AbstractText at,
int  layer 
) [virtual]

Adds a new text to this CombinedText.

Parameters:
at The text to be added
layer The layer of this text, higher numbers will be rendered first

virtual void VRS::TEXT::CombinedText::removeText ( SO< AbstractText at  )  [virtual]

Removes a text from the CombinedText.

If the text does not exist, nothing happens.

Parameters:
at The text to be remove

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

Returns the text to be rendered.

Implements VRS::TEXT::AbstractText.

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

Sets the new text to be rendered.

Implements VRS::TEXT::AbstractText.

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

Returns the FontDefinition.

Implements VRS::TEXT::AbstractText.

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

Sets the FontDefinition.

Implements VRS::TEXT::AbstractText.

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

Returns the Horizontal Alignment.

See also:
AbstractText::HorizontalAlignment

Implements VRS::TEXT::AbstractText.

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

Sets the Horizontal Alignment.

See also:
AbstractText::HorizontalAlignment

Implements VRS::TEXT::AbstractText.

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

Returns the Vertical Alignment.

See also:
AbstractText::VerticalAlignment

Implements VRS::TEXT::AbstractText.

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

Sets the Vertical Alignment.

See also:
AbstractText::VerticalAlignment

Implements VRS::TEXT::AbstractText.

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

Returns the Horizontal Direction.

See also:
AbstractText::HorizontalDirection

Implements VRS::TEXT::AbstractText.

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

Sets the Horizontal Direction.

See also:
AbstractText::HorizontalDirection

Implements VRS::TEXT::AbstractText.

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

Returns the Vertical Direction.

See also:
AbstractText::VerticalDirection

Implements VRS::TEXT::AbstractText.

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

Sets the Vertical Direction.

See also:
AbstractText::VerticalDirection

Implements VRS::TEXT::AbstractText.

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

Returns the visible Direction.

See also:
AbstractText::Direction

Implements VRS::TEXT::AbstractText.

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

Set the visible Direction.

See also:
AbstractText::Direction

Implements VRS::TEXT::AbstractText.

virtual void VRS::TEXT::CombinedText::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::CombinedText::setRightAlignmentBound ( float  rightBorder  )  [virtual]

Sets the right alignement bound.

See also:
setAlignmentBounds

Implements VRS::TEXT::AbstractText.

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

Sets the bottom alignement bound.

See also:
setAlignmentBounds

Implements VRS::TEXT::AbstractText.

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

Returns the right alignement bound.

See also:
setAlignmentBounds

Implements VRS::TEXT::AbstractText.

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

Returns the bottom alignement bound.

See also:
setAlignmentBounds

Implements VRS::TEXT::AbstractText.

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

Returns the Scale of the inter line gap.

1.0 means 100%

Implements VRS::TEXT::AbstractText.

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

Sets the Scale of the inter line gap.

1.0 means 100%

Implements VRS::TEXT::AbstractText.

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

Sets the Color of this Text.

Implements VRS::TEXT::AbstractText.

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

Returns the Color of this Text.

Implements VRS::TEXT::AbstractText.

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

Should the Color be used.

Implements VRS::TEXT::AbstractText.

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

Returns the local matrix for the text.

Implements VRS::TEXT::AbstractText.

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

Sets the local matrix for the text.

Implements VRS::TEXT::AbstractText.

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

Bounds (with Matrix applied).

Implements VRS::TEXT::AbstractText.

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

Bounds (without Matrix applied).

Implements VRS::TEXT::AbstractText.

const SO<TextIter> VRS::TEXT::CombinedText::_getTexts (  )  const

Returns a list of all the texts of this CombinedTexts Used only internal while rendering.

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

VRS::TEXT::CombinedText::VRS_SERIALIZABLE ( CombinedText   ) 


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

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