Tulip  5.0.0
Large graphs analysis and drawing
tlp::GlLabel Class Reference

#include <GlLabel.h>

+ Inheritance diagram for tlp::GlLabel:
+ Collaboration diagram for tlp::GlLabel:

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)
 
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 50 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 181 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 174 of file GlLabel.h.

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

Return the font size.

Definition at line 351 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 298 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 330 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 314 of file GlLabel.h.

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

Return the outline color.

Definition at line 365 of file GlLabel.h.

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

Return the outline size.

Definition at line 379 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 393 of file GlLabel.h.

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

Return if the label is otimized with the lod.

Definition at line 273 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.

bool tlp::GlLabel::isBillboarded ( )
inline

Return if the label is billboarded.

Definition at line 407 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 344 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 : LabelPosition::Center, LabelPosition::Top, LabelPosition::Bottom, LabelPosition::Left, LabelPosition::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 124 of file GlLabel.h.

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

Set if the label is billboarded.

Definition at line 414 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 167 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 358 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 285 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 322 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 306 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 258 of file GlLabel.h.

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

Sets the outline color used when rendering the label.

Definition at line 372 of file GlLabel.h.

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

Sets the outline size used when rendering the label.

Definition at line 386 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 188 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 400 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 265 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 337 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.