20 #ifndef Tulip_GLLABEL_H
21 #define Tulip_GLLABEL_H
23 #include <tulip/Coord.h>
24 #include <tulip/Color.h>
25 #include <tulip/Size.h>
26 #include <tulip/Camera.h>
27 #include <tulip/GlSimpleEntity.h>
28 #include <tulip/TulipViewSettings.h>
30 class FTGLPolygonFont;
37 #define MIN_LABEL_POSITION LabelPosition::Center
38 #define MAX_LABEL_POSITION LabelPosition::Right
66 GlLabel(Coord centerPosition,Size size,Color fontColor,
bool leftAlign=
false);
83 void setText(
const std::string& text);
89 const std::string& getText()
const;
94 void setPosition(
const Coord &position);
106 virtual void setTranslationAfterRotation(Coord translation) {
107 translationAfterRotation=translation;
113 virtual Coord getTranslationAfterRotation() {
114 return translationAfterRotation;
126 this->alignment=alignment;
142 virtual void setSize(
const Size &size);
147 virtual Size getSize();
157 virtual void setSizeForOutAlign(
const Size &size);
163 virtual Size getSizeForOutAlign();
183 depthTestEnabled=state;
196 void drawWithStencil(
float lod,
Camera *camera=NULL);
201 float getHeightAfterScale();
206 virtual void draw(
float,
Camera *camera=NULL);
211 virtual void translate(
const Coord& mouvement);
216 virtual void rotate(
float xRot,
float yRot,
float zRot);
221 virtual void getXML(std::string &outString);
226 virtual void setWithXML(
const std::string &inString,
unsigned int ¤tPosition);
231 virtual void setBoldFont();
236 virtual void setPlainFont();
241 virtual void setFontName(
const std::string &name);
246 virtual void setFontNameSizeAndColor(
const std::string &name,
const int &size,
const Color &color);
252 virtual void setRenderingMode(
int mode);
260 occlusionTester=tester;
292 labelsDensity=density;
300 return labelsDensity;
346 return useMinMaxSize;
374 outlineColor = color;
416 this->billboarded=billboarded;
422 std::string fontName;
425 FTGLPolygonFont *font;
426 FTOutlineFont *borderFont;
427 Coord centerPosition;
428 Coord translationAfterRotation;
430 Size sizeForOutAlign;
434 std::string textureName;
440 bool depthTestEnabled;
449 OcclusionTest *occlusionTester;
455 std::vector<std::string> textVector;
456 std::vector<float> textWidthVector;
int getFontSize() const
Return the font size.
virtual int getLabelDensity()
Return label density of occlusion test This density will be in interval -100 100. ...
Base class for all Tulip OpenGL entities.
virtual void setLabelsDensity(int density)
Set labels density of occlusion test This density must be in interval -100 100.
void setUseMinMaxSize(bool state)
Set if the label use min/max screen size in not scaled mode.
virtual Color getColor()
Get color use to render the label.
virtual void setColor(const Color &color)
Set color of label.
int getMaxSize()
Get max screen size (in pixel) of the label : this size is used in not scaled mode.
void setBillboarded(bool billboarded)
Set if the label is billboarded.
virtual bool getUseLODOptimisation()
Return if the label is otimized with the lod.
Create a label into Tulip 3D engine.
float getOutlineSize() const
Return the outline size.
bool isUsingMinMaxSize()
Return if the label using min/max screen size in not scaled mode.
std::string getTextureName() const
Return the texture name used to render the label.
void setMaxSize(int size)
Set max screen size (in pixel) of the label : this size is used in not scaled mode.
virtual void setOcclusionTester(OcclusionTest *tester)
Set the occlusion tester If occlusionTester is NULL : deactivate occlusion test.
void setOutlineColor(const Color &color)
Sets the outline color used when rendering the label.
This class represents the 3D bounding box of an object. It is mostly used to determine whether or not...
Tulip OpenGL camera object.
void setFontSize(int size)
Sets the font size used when rendering the label.
bool isBillboarded()
Return if the label is billboarded.
Color getOutlineColor() const
Return the outline color.
int getMinSize()
Get min screen size (in pixel) of the label : this size is used in not scaled mode.
virtual void setAlignment(int alignment)
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.
void setMinSize(int size)
Set min screen size (in pixel) of the label : this size is used in not scaled mode.
virtual void setScaleToSize(bool state)
Enable/disable if label is scaled to size.
void setTextureName(const std::string &name)
Sets the texture name used when rendering the label.
virtual void enableDepthTest(bool state)
Enable/disable the OpenGL depth test for the label (default depth test is enable) ...
virtual void setUseLODOptimisation(bool state, BoundingBox bb=BoundingBox())
Set if the label is otimized with the lod.
void setOutlineSize(float size)
Sets the outline size used when rendering the label.