version 3.3

VRS::TextField Class Reference

#include <vrs/text/deprecated/textfield.h>

Inheritance diagram for VRS::TextField:

VRS::SceneNode VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 TextField (double part=1.0, double lineSpace=0.0)
 See comments on the set/get-methods for part.
void appendLine (Text *text)
 Appends a line to the displayed text.
bool deleteLine (int index)
 Deletes a line by its position beginning with 0 for the first line.
TextgetLine (int index) const
 Returns a line by its position (see comment on deleteLine).
void setBegin (double begin)
 Changes the starting line of the text.
double getBegin () const
 Returns the starting line of the text (see comment on setBegin).
void setPart (double part)
 Changes the shown part of the text (see comment on setBegin).
double getPart () const
 Changes the shown part of the text (see comment on setBegin).
void reset ()
 Resets begin_ so that the upper right corner of the whole text is at the origin.
void setLineSpace (double lineSpace)
 Sets the line space.
double getLineSpace () const
 Returns the line space.
virtual void evaluate (Engine *engine)
 Draws the text lines (see comment on setBegin).
virtual Bounds boundingBox (Engine *) const
 Returns the bounding box of the shown text lines.
Bounds maxBoundingBox () const
 Returns biggest possible bounding box with the current part settings and textlines.
virtual void modified ()
 Overwritten so that it sets the update bounding box flag.


Detailed Description

DEPRECATED: Node to display a text in several lines The node displays several text lines depending on the parameters begin and part. They enable the user to specify, wich part of the text lines shall be shown. Please make sure, that all the text objects added to the node use 3D fonts, because otherwise the text object will not calculate an appropriate bounding box and the display algorithm will be confused. Also the display algorithm ignores the position of the text but leaves it as it is. This means, the algorithm displays the text lines with there positions, but ignores it when calculating the positions for the text lines. Thus it may be the best to set the position to (0, 0, 0) although it is very well possible not to do so and maybe create some nice effects? The algorithm completely ignores the text plane and assumes, that is the XY-plane. It is highly probable, that the algorithm does not make any sense for text lines having the textplane set to another plane, so it will be the best to set the textplane to XY-Plane...

Constructor & Destructor Documentation

VRS::TextField::TextField ( double  part = 1.0,
double  lineSpace = 0.0 
)

See comments on the set/get-methods for part.


Member Function Documentation

void VRS::TextField::appendLine ( Text text  ) 

Appends a line to the displayed text.

bool VRS::TextField::deleteLine ( int  index  ) 

Deletes a line by its position beginning with 0 for the first line.

Returns false, if the index is to high (greater or equal than the number of lines contained) or to low.

Text* VRS::TextField::getLine ( int  index  )  const

Returns a line by its position (see comment on deleteLine).

Returns 0, if the index is invalid (<0 or greater or equal than the number of lines contained.

void VRS::TextField::setBegin ( double  begin  ) 

Changes the starting line of the text.

Begin is from the intervall [-1,1] an determines, from wich line on the text ist shown. Imagine the text lines as continous flow mapped to values from [0,1]. Then the intervall [begin, begin+f(part)] is always shown and the lower left corner of this shown part is always at the origin (as long as the text's alignments are set to LEFT and BOTTOM). ( f(part) calculates the size of the displayed area relative to the size of the textlines, see comment on setPart) As the text lines can only be displayed line wise, the algorithm shows _all_ _neccessary_ lines, this means, if there are 3 line in the node, beginning is set to 0.5 and part is set to 0.33, the lines 2 and 3 are shown and the middle of the left edge of line 3 appears at the origin. So by smoothly incrementing begin while leaving part as it is and hinding the popping lines, e.g. by other shapes or clipping planes, you can create a sliding text.

double VRS::TextField::getBegin (  )  const

Returns the starting line of the text (see comment on setBegin).

void VRS::TextField::setPart ( double  part  ) 

Changes the shown part of the text (see comment on setBegin).

Part defines in absolute coordinates how big the displayes area is. If part is set to 0.5 for example, the y-extension of the area is 0.5 and as much textlines are displayed as neccessary to fill that area.

double VRS::TextField::getPart (  )  const

Changes the shown part of the text (see comment on setBegin).

void VRS::TextField::reset (  ) 

Resets begin_ so that the upper right corner of the whole text is at the origin.

void VRS::TextField::setLineSpace ( double  lineSpace  ) 

Sets the line space.

The line space is added to the y-extension of the bounding box when calculating the advance from one line to the next.

double VRS::TextField::getLineSpace (  )  const

Returns the line space.

virtual void VRS::TextField::evaluate ( Engine engine  )  [virtual]

Draws the text lines (see comment on setBegin).

Reimplemented from VRS::SceneNode.

virtual Bounds VRS::TextField::boundingBox ( Engine  )  const [virtual]

Returns the bounding box of the shown text lines.

Reimplemented from VRS::SceneNode.

Bounds VRS::TextField::maxBoundingBox (  )  const

Returns biggest possible bounding box with the current part settings and textlines.

Asking the shape for the current bounding box is almost useless to determine aproximately the size of the shape, when begin is set to -1.0 for example. Even worth, it is almost impossible to figure out, how long the longest line is. So this method calculates a bounding box that will contain every textline, independant of the current begin_ setting.

virtual void VRS::TextField::modified (  )  [virtual]

Overwritten so that it sets the update bounding box flag.

Reimplemented from VRS::SharedObj.


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

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