Tulip  4.3.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
tlp::GlLabel Class Reference

#include <GlLabel.h>

Inherits tlp::GlSimpleEntity.

Public Member Functions

 GlLabel ()
 
 GlLabel (Coord centerPosition, Size size, Color fontColor, bool leftAlign=false)
 
 ~GlLabel ()
 
virtual void draw (float, Camera *camera=NULL)
 
void drawWithStencil (float lod, Camera *camera=NULL)
 
virtual void enableDepthTest (bool state)
 
virtual BoundingBox getBoundingBox ()
 
virtual Color getColor ()
 
int getFontSize () const
 
float getHeightAfterScale ()
 
virtual int getLabelDensity ()
 
int getMaxSize ()
 
int getMinSize ()
 
Color getOutlineColor () const
 
float getOutlineSize () const
 
Coord getPosition ()
 
virtual Size getSize ()
 
virtual Size getSizeForOutAlign ()
 
const std::string & getText () const
 
virtual BoundingBox getTextBoundingBox ()
 
std::string getTextureName () const
 
virtual bool getUseLODOptimisation ()
 
virtual void getXML (std::string &outString)
 
void init ()
 
bool isBillboarded ()
 
bool isUsingMinMaxSize ()
 
virtual void rotate (float xRot, float yRot, float zRot)
 
virtual void setAlignment (int alignment)
 
void setBillboarded (bool billboarded)
 
virtual void setBoldFont ()
 
virtual void setColor (const Color &color)
 
virtual void setFontName (const std::string &name)
 
virtual void setFontNameSizeAndColor (const std::string &name, const int &size, const Color &color)
 
void setFontSize (int size)
 
virtual void setLabelsDensity (int density)
 
void setMaxSize (int size)
 
void setMinSize (int size)
 
virtual void setOcclusionTester (OcclusionTest *tester)
 
void setOutlineColor (const Color &color)
 
void setOutlineSize (float size)
 
virtual void setPlainFont ()
 
void setPosition (const Coord &position)
 
virtual void setScaleToSize (bool state)
 
virtual void setSize (const Size &size)
 
virtual void setSizeForOutAlign (const Size &size)
 
void setText (const std::string &text)
 
void setTextureName (const std::string &name)
 
virtual void setUseLODOptimisation (bool state, BoundingBox bb=BoundingBox())
 
void setUseMinMaxSize (bool state)
 
virtual void setWithXML (const std::string &inString, unsigned int &currentPosition)
 
virtual void translate (const Coord &mouvement)
 
- Public Member Functions inherited from tlp::GlSimpleEntity
 GlSimpleEntity ()
 
virtual ~GlSimpleEntity ()
 
int getStencil ()
 
bool isVisible () const
 
virtual void setStencil (int stencil)
 
virtual void setVisible (bool visible)
 

Additional Inherited Members

- Protected Attributes inherited from tlp::GlSimpleEntity
BoundingBox boundingBox
 
std::vector< GlComposite * > parents
 
int stencil
 
bool visible
 

Detailed Description

Create a label into Tulip 3D engine.

The shortes way to create a label is :

GlLabel *label=new GlLabel(Coord(0,0,0), Size (1,1,1), Color(1,1,1));
label->setText("example");

Definition at line 51 of file GlLabel.h.

Constructor & Destructor Documentation

tlp::GlLabel::GlLabel ( )

Constructor.

Warning
Don't use this constructor : see other constructor
tlp::GlLabel::GlLabel ( Coord  centerPosition,
Size  size,
Color  fontColor,
bool  leftAlign = false 
)

Contructor.

Parameters
centerPositionposition of the label
sizesize of the label
fontColorcolor of the label
leftAligntrue if you want a left align label
tlp::GlLabel::~GlLabel ( )

Destructor.

Member Function Documentation

virtual void tlp::GlLabel::draw ( float  ,
Camera camera = NULL 
)
virtual

Draw the Label.

Implements tlp::GlSimpleEntity.

void tlp::GlLabel::drawWithStencil ( float  lod,
Camera camera = NULL 
)

Set the stencil and draw the Label, this function is usefull when we directly call draw without tulip engine.

virtual void tlp::GlLabel::enableDepthTest ( bool  state)
inlinevirtual

Enable/disable the OpenGL depth test for the label (default depth test is enable)

Definition at line 183 of file GlLabel.h.

virtual BoundingBox tlp::GlLabel::getBoundingBox ( )
virtual

Return the bounding box of the label.

Reimplemented from tlp::GlSimpleEntity.

virtual Color tlp::GlLabel::getColor ( )
inlinevirtual

Get color use to render the label.

Definition at line 176 of file GlLabel.h.

int tlp::GlLabel::getFontSize ( ) const
inline

Return the font size.

Definition at line 353 of file GlLabel.h.

float tlp::GlLabel::getHeightAfterScale ( )

Return the height of the label after scaling in size box.

virtual int tlp::GlLabel::getLabelDensity ( )
inlinevirtual

Return label density of occlusion test This density will be in interval -100 100.

Definition at line 300 of file GlLabel.h.

int tlp::GlLabel::getMaxSize ( )
inline

Get max screen size (in pixel) of the label : this size is used in not scaled mode.

See Also
setUseMinMaxSize

Definition at line 332 of file GlLabel.h.

int tlp::GlLabel::getMinSize ( )
inline

Get min screen size (in pixel) of the label : this size is used in not scaled mode.

See Also
setUseMinMaxSize

Definition at line 316 of file GlLabel.h.

Color tlp::GlLabel::getOutlineColor ( ) const
inline

Return the outline color.

Definition at line 367 of file GlLabel.h.

float tlp::GlLabel::getOutlineSize ( ) const
inline

Return the outline size.

Definition at line 381 of file GlLabel.h.

Coord tlp::GlLabel::getPosition ( )

Return the position of the label.

virtual Size tlp::GlLabel::getSize ( )
virtual

return the size of the text

virtual Size tlp::GlLabel::getSizeForOutAlign ( )
virtual

return the size for alignment outside (left/right/top/bottom)

See Also
setAlignment
const std::string& tlp::GlLabel::getText ( ) const

getText gets the text of this label.

Returns
The text of this label.
virtual BoundingBox tlp::GlLabel::getTextBoundingBox ( )
virtual

Return the bounding box of the text of the label after transformations.

std::string tlp::GlLabel::getTextureName ( ) const
inline

Return the texture name used to render the label.

Definition at line 395 of file GlLabel.h.

virtual bool tlp::GlLabel::getUseLODOptimisation ( )
inlinevirtual

Return if the label is otimized with the lod.

Definition at line 275 of file GlLabel.h.

virtual void tlp::GlLabel::getXML ( std::string &  outString)
virtual

Function to export data in outString (in XML format)

Implements tlp::GlSimpleEntity.

void tlp::GlLabel::init ( )

Set default parameters of GlLabel.

This function is call by constructor, so you don't have to call it

bool tlp::GlLabel::isBillboarded ( )
inline

Return if the label is billboarded.

Definition at line 409 of file GlLabel.h.

bool tlp::GlLabel::isUsingMinMaxSize ( )
inline

Return if the label using min/max screen size in not scaled mode.

Definition at line 346 of file GlLabel.h.

virtual void tlp::GlLabel::rotate ( float  xRot,
float  yRot,
float  zRot 
)
virtual

Rotate Label.

virtual void tlp::GlLabel::setAlignment ( int  alignment)
inlinevirtual

Set the alignment of the label : ON_CENTER, ON_TOP, ON_BOTTOM, ON_LEFT, ON_RIGHT This function is usefull when you have an entity : you spesify the size of the position of this entity and you tell that you want a label outside this entity.

See Also
LabelPosition
setSizeOfOutAlign

Definition at line 126 of file GlLabel.h.

void tlp::GlLabel::setBillboarded ( bool  billboarded)
inline

Set if the label is billboarded.

Definition at line 416 of file GlLabel.h.

virtual void tlp::GlLabel::setBoldFont ( )
virtual

Switch to bold font.

virtual void tlp::GlLabel::setColor ( const Color &  color)
inlinevirtual

Set color of label.

Definition at line 169 of file GlLabel.h.

virtual void tlp::GlLabel::setFontName ( const std::string &  name)
virtual

Change font name.

virtual void tlp::GlLabel::setFontNameSizeAndColor ( const std::string &  name,
const int &  size,
const Color &  color 
)
virtual

Change font name, size and color of the text.

void tlp::GlLabel::setFontSize ( int  size)
inline

Sets the font size used when rendering the label.

Definition at line 360 of file GlLabel.h.

virtual void tlp::GlLabel::setLabelsDensity ( int  density)
inlinevirtual

Set labels density of occlusion test This density must be in interval -100 100.

  • If density is equal to -100 : we don't have occlusion test
  • If density is equal to 0 : GlLabels don't overlap
  • If density > 0 : GlLabels don't overlap and have space wetween us

Definition at line 287 of file GlLabel.h.

void tlp::GlLabel::setMaxSize ( int  size)
inline

Set max screen size (in pixel) of the label : this size is used in not scaled mode.

See Also
setUseMinMaxSize

Definition at line 324 of file GlLabel.h.

void tlp::GlLabel::setMinSize ( int  size)
inline

Set min screen size (in pixel) of the label : this size is used in not scaled mode.

See Also
setUseMinMaxSize

Definition at line 308 of file GlLabel.h.

virtual void tlp::GlLabel::setOcclusionTester ( OcclusionTest *  tester)
inlinevirtual

Set the occlusion tester If occlusionTester is NULL : deactivate occlusion test.

Definition at line 260 of file GlLabel.h.

void tlp::GlLabel::setOutlineColor ( const Color &  color)
inline

Sets the outline color used when rendering the label.

Definition at line 374 of file GlLabel.h.

void tlp::GlLabel::setOutlineSize ( float  size)
inline

Sets the outline size used when rendering the label.

Definition at line 388 of file GlLabel.h.

virtual void tlp::GlLabel::setPlainFont ( )
virtual

Switch to plain font.

void tlp::GlLabel::setPosition ( const Coord &  position)

Set the position used to render the label.

virtual void tlp::GlLabel::setScaleToSize ( bool  state)
inlinevirtual

Enable/disable if label is scaled to size.

Definition at line 190 of file GlLabel.h.

virtual void tlp::GlLabel::setSize ( const Size &  size)
virtual

Set the size of the label.

virtual void tlp::GlLabel::setSizeForOutAlign ( const Size &  size)
virtual

Set the size for alignment outside (left/right/top/bottom)

You can have a specific size when you want a label outside

See Also
setAlignment

: this size is reinit when you call setSize

void tlp::GlLabel::setText ( const std::string &  text)

Set the text of the label.

void tlp::GlLabel::setTextureName ( const std::string &  name)
inline

Sets the texture name used when rendering the label.

Definition at line 402 of file GlLabel.h.

virtual void tlp::GlLabel::setUseLODOptimisation ( bool  state,
BoundingBox  bb = BoundingBox() 
)
inlinevirtual

Set if the label is otimized with the lod.

Definition at line 267 of file GlLabel.h.

void tlp::GlLabel::setUseMinMaxSize ( bool  state)
inline

Set if the label use min/max screen size in not scaled mode.

Definition at line 339 of file GlLabel.h.

virtual void tlp::GlLabel::setWithXML ( const std::string &  inString,
unsigned int &  currentPosition 
)
virtual

Function to set data with inString (in XML format)

Implements tlp::GlSimpleEntity.

virtual void tlp::GlLabel::translate ( const Coord &  mouvement)
virtual

Translate entity.