Tulip
5.4.0
Large graphs analysis and drawing
|
#include <GlLabel.h>
Public Member Functions | |
GlLabel () | |
GlLabel (const Coord ¢erPosition, const Size &size, Color fontColor, bool leftAlign=false) | |
~GlLabel () override | |
void | draw (float, Camera *camera=nullptr) override |
void | drawWithStencil (float lod, Camera *camera=nullptr) |
void | enableDepthTest (bool state) |
BoundingBox | getBoundingBox () override |
const Color & | getColor () const |
int | getFontSize () const |
float | getHeightAfterScale () |
int | getLabelDensity () const |
int | getMaxSize () const |
int | getMinSize () const |
const Color & | getOutlineColor () const |
float | getOutlineSize () const |
const Coord & | getPosition () const |
const Size & | getSize () const |
const Size & | getSizeForOutAlign () const |
const std::string & | getText () const |
const BoundingBox & | getTextBoundingBox () |
const std::string & | getTextureName () const |
bool | getUseLODOptimisation () const |
void | getXML (std::string &outString) override |
bool | isBillboarded () const |
bool | isUsingMinMaxSize () const |
void | rotate (float xRot, float yRot, float zRot) |
void | setAlignment (int alignment) |
void | setBillboarded (bool billboarded) |
void | setBoldFont () |
void | setColor (const Color &color) |
void | setFontName (const std::string &name) |
void | setFontNameSizeAndColor (const std::string &name, const int &size, const Color &color) |
void | setFontSize (int size) |
void | setLabelsDensity (int density) |
void | setMaxSize (int size) |
void | setMinSize (int size) |
void | setOcclusionTester (OcclusionTest *tester) |
void | setOutlineColor (const Color &color) |
void | setOutlineSize (float size) |
void | setPlainFont () |
void | setPosition (const Coord &position) |
void | setPosition (float x, float y, float z) |
void | setScaleToSize (bool state) |
void | setSize (const Size &size) |
void | setSizeForOutAlign (const Size &size) |
void | setText (const std::string &text) |
void | setTextureName (const std::string &name) |
void | setUseLODOptimisation (bool state, const BoundingBox &bb=BoundingBox()) |
void | setUseMinMaxSize (bool state) |
void | setWithXML (const std::string &inString, unsigned int ¤tPosition) override |
void | translate (const Coord &mouvement) override |
Public Member Functions inherited from tlp::GlSimpleEntity | |
GlSimpleEntity () | |
~GlSimpleEntity () override | |
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 |
Create a label into Tulip 3D engine.
The shortest way to create a label is :
tlp::GlLabel::GlLabel | ( | ) |
Constructor.
tlp::GlLabel::GlLabel | ( | const Coord & | centerPosition, |
const Size & | size, | ||
Color | fontColor, | ||
bool | leftAlign = false |
||
) |
Constructor.
centerPosition | position of the label |
size | size of the label |
fontColor | color of the label |
leftAlign | true if you want a left align label |
|
override |
Destructor.
|
overridevirtual |
Draw the Label.
Implements tlp::GlSimpleEntity.
void tlp::GlLabel::drawWithStencil | ( | float | lod, |
Camera * | camera = nullptr |
||
) |
Set the stencil and draw the Label, this function is useful when we directly call draw without tulip engine.
|
inline |
|
overridevirtual |
Return the bounding box of the label.
Reimplemented from tlp::GlSimpleEntity.
|
inline |
|
inline |
float tlp::GlLabel::getHeightAfterScale | ( | ) |
Return the height of the label after scaling in size box.
|
inline |
|
inline |
Get max screen size (in pixel) of the label : this size is used in not scaled mode.
|
inline |
Get min screen size (in pixel) of the label : this size is used in not scaled mode.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
return the size for alignment outside (left/right/top/bottom)
|
inline |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Function to export data in outString (in XML format)
Implements tlp::GlSimpleEntity.
|
inline |
|
inline |
void tlp::GlLabel::rotate | ( | float | xRot, |
float | yRot, | ||
float | zRot | ||
) |
Rotate Label.
|
inline |
Set the alignment of the label : LabelPosition::Center, LabelPosition::Top, LabelPosition::Bottom, LabelPosition::Left, LabelPosition::Right This function is useful when you have an entity : you specify the size of the position of this entity and you tell that you want a label outside this entity.
|
inline |
void tlp::GlLabel::setBoldFont | ( | ) |
Switch to bold font.
|
inline |
void tlp::GlLabel::setFontName | ( | const std::string & | name | ) |
Change font name.
void tlp::GlLabel::setFontNameSizeAndColor | ( | const std::string & | name, |
const int & | size, | ||
const Color & | color | ||
) |
Change font name, size and color of the text.
|
inline |
|
inline |
|
inline |
Set max screen size (in pixel) of the label : this size is used in not scaled mode.
|
inline |
Set min screen size (in pixel) of the label : this size is used in not scaled mode.
|
inline |
|
inline |
|
inline |
void tlp::GlLabel::setPlainFont | ( | ) |
Switch to plain font.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the size for alignment outside (left/right/top/bottom)
You can have a specific size when you want a label outside
: this size is reinit when you call setSize
void tlp::GlLabel::setText | ( | const std::string & | text | ) |
Set the text of the label.
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Function to set data with inString (in XML format)
Implements tlp::GlSimpleEntity.
|
override |
Translate entity.