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;
67 GlLabel(
const Coord ¢erPosition,
const Size &size, Color fontColor,
bool leftAlign =
false);
77 void setText(
const std::string &text);
91 centerPosition = position;
98 centerPosition.set(x, y, z);
105 return centerPosition;
113 void setTranslationAfterRotation(
const Coord &translation) {
114 translationAfterRotation = translation;
120 const Coord &getTranslationAfterRotation()
const {
121 return translationAfterRotation;
135 this->alignment = alignment;
147 return textBoundingBox;
154 this->sizeForOutAlign = this->size = size;
173 sizeForOutAlign = size;
181 return sizeForOutAlign;
202 depthTestEnabled = state;
216 void drawWithStencil(
float lod,
Camera *camera =
nullptr);
221 float getHeightAfterScale();
226 void draw(
float,
Camera *camera =
nullptr)
override;
231 void translate(
const Coord &mouvement)
override;
236 void rotate(
float xRot,
float yRot,
float zRot);
241 void getXML(std::string &outString)
override;
246 void setWithXML(
const std::string &inString,
unsigned int ¤tPosition)
override;
261 void setFontName(
const std::string &name);
266 void setFontNameSizeAndColor(
const std::string &name,
const int &size,
const Color &color);
272 void setRenderingMode(
int mode) {
273 renderingMode = mode;
282 occlusionTester = tester;
310 labelsDensity = -100;
311 else if (density > 100)
314 labelsDensity = density;
322 return labelsDensity;
361 useMinMaxSize = state;
368 return useMinMaxSize;
396 outlineColor = color;
438 this->billboarded = billboarded;
443 std::string fontName;
446 FTGLPolygonFont *font;
447 FTOutlineFont *borderFont;
448 Coord centerPosition;
449 Coord translationAfterRotation;
451 Size sizeForOutAlign;
455 std::string textureName;
461 bool depthTestEnabled;
470 OcclusionTest *occlusionTester;
476 std::vector<std::string> textVector;
477 std::vector<float> textWidthVector;
const std::string & getTextureName() const
Return the texture name used to render the label.
bool isBillboarded() const
Return if the label is billboarded.
int getMinSize() const
Get min screen size (in pixel) of the label : this size is used in not scaled mode.
void setLabelsDensity(int density)
Set labels density of occlusion test This density must be in interval -100 100.
bool getUseLODOptimisation() const
Return if the label is otimized with the lod.
float getOutlineSize() const
Return the outline size.
Base class for all Tulip OpenGL entities.
void setUseLODOptimisation(bool state, const BoundingBox &bb=BoundingBox())
Set if the label is optimized with the lod.
void setOcclusionTester(OcclusionTest *tester)
Set the occlusion tester If occlusionTester is nullptr : deactivate occlusion test.
void setUseMinMaxSize(bool state)
Set if the label use min/max screen size in not scaled mode.
const BoundingBox & getTextBoundingBox()
Return the bounding box of the text of the label after transformations.
void setBillboarded(bool billboarded)
Set if the label is billboarded.
int getLabelDensity() const
Return label density of occlusion test This density will be in interval -100 100. ...
const Size & getSizeForOutAlign() const
return the size for alignment outside (left/right/top/bottom)
Create a label into Tulip 3D engine.
const std::string & getText() const
getText gets the text of this label.
const Color & getOutlineColor() const
Return the outline color.
void setMaxSize(int size)
Set max screen size (in pixel) of the label : this size is used in not scaled mode.
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.
void setPosition(const Coord &position)
Set the position used to render the label.
void setScaleToSize(bool state)
Enable/disable if label is scaled to size.
void setMinSize(int size)
Set min screen size (in pixel) of the label : this size is used in not scaled mode.
void setPosition(float x, float y, float z)
Set the position used to render the label.
const Coord & getPosition() const
Return the position of the label.
const Color & getColor() const
Get color use to render the label.
void setTextureName(const std::string &name)
Sets the texture name used when rendering the label.
int getFontSize() const
Return the font size.
void enableDepthTest(bool state)
Enable/disable the OpenGL depth test for the label (default depth test is enable) ...
bool isUsingMinMaxSize() const
Return if the label using min/max screen size in not scaled mode.
void setColor(const Color &color)
Set color of label.
void setAlignment(int alignment)
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.
const Size & getSize() const
return the size of the text
int getMaxSize() const
Get max screen size (in pixel) of the label : this size is used in not scaled mode.
void setSize(const Size &size)
Set the size of the label.
void setSizeForOutAlign(const Size &size)
Set the size for alignment outside (left/right/top/bottom)
void setOutlineSize(float size)
Sets the outline size used when rendering the label.