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> 29 class FTGLPolygonFont;
68 GlLabel(Coord centerPosition,Size size,Color fontColor,
bool leftAlign=
false);
78 void setText(
const std::string& text);
84 const std::string& getText()
const;
89 void setPosition(
const Coord &position);
101 virtual void setTranslationAfterRotation(Coord translation) {
102 translationAfterRotation=translation;
108 virtual Coord getTranslationAfterRotation() {
109 return translationAfterRotation;
121 this->alignment=alignment;
137 virtual void setSize(
const Size &size);
142 virtual Size getSize();
152 virtual void setSizeForOutAlign(
const Size &size);
158 virtual Size getSizeForOutAlign();
178 depthTestEnabled=state;
191 void drawWithStencil(
float lod,
Camera *camera=NULL);
196 float getHeightAfterScale();
201 virtual void draw(
float,
Camera *camera=NULL);
206 virtual void translate(
const Coord& mouvement);
211 virtual void rotate(
float xRot,
float yRot,
float zRot);
216 virtual void getXML(std::string &outString);
221 virtual void setWithXML(
const std::string &inString,
unsigned int ¤tPosition);
226 virtual void setBoldFont();
231 virtual void setPlainFont();
236 virtual void setFontName(
const std::string &name);
241 virtual void setFontNameSizeAndColor(
const std::string &name,
const int &size,
const Color &color);
247 virtual void setRenderingMode(
int mode);
255 occlusionTester=tester;
287 labelsDensity=density;
295 return labelsDensity;
341 return useMinMaxSize;
369 outlineColor = color;
411 this->billboarded=billboarded;
417 std::string fontName;
420 FTGLPolygonFont *font;
421 FTOutlineFont *borderFont;
422 Coord centerPosition;
423 Coord translationAfterRotation;
425 Size sizeForOutAlign;
429 std::string textureName;
435 bool depthTestEnabled;
444 OcclusionTest *occlusionTester;
450 std::vector<std::string> textVector;
451 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.