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 72 GlLabel(Coord centerPosition,Size size,Color fontColor,
bool leftAlign=
false);
82 void setText(
const std::string& text);
88 const std::string& getText()
const;
93 void setPosition(
const Coord &position);
105 virtual void setTranslationAfterRotation(Coord translation) {
106 translationAfterRotation=translation;
112 virtual Coord getTranslationAfterRotation() {
113 return translationAfterRotation;
125 this->alignment=alignment;
141 virtual void setSize(
const Size &size);
146 virtual Size getSize();
156 virtual void setSizeForOutAlign(
const Size &size);
162 virtual Size getSizeForOutAlign();
182 depthTestEnabled=state;
195 void drawWithStencil(
float lod,
Camera *camera=NULL);
200 float getHeightAfterScale();
205 virtual void draw(
float,
Camera *camera=NULL);
210 virtual void translate(
const Coord& mouvement);
215 virtual void rotate(
float xRot,
float yRot,
float zRot);
220 virtual void getXML(std::string &outString);
225 virtual void setWithXML(
const std::string &inString,
unsigned int ¤tPosition);
230 virtual void setBoldFont();
235 virtual void setPlainFont();
240 virtual void setFontName(
const std::string &name);
245 virtual void setFontNameSizeAndColor(
const std::string &name,
const int &size,
const Color &color);
251 virtual void setRenderingMode(
int mode);
259 occlusionTester=tester;
291 labelsDensity=density;
299 return labelsDensity;
345 return useMinMaxSize;
373 outlineColor = color;
415 this->billboarded=billboarded;
421 std::string fontName;
424 FTGLPolygonFont *font;
425 FTOutlineFont *borderFont;
426 Coord centerPosition;
427 Coord translationAfterRotation;
429 Size sizeForOutAlign;
433 std::string textureName;
439 bool depthTestEnabled;
448 OcclusionTest *occlusionTester;
454 std::vector<std::string> textVector;
455 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.