 |
Tulip
5.5.0
Large graphs analysis and drawing
|
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;
void setMaxSize(int size)
Set max screen size (in pixel) of the label : this size is used in not scaled mode.
void setAlignment(int alignment)
Set the alignment of the label : LabelPosition::Center, LabelPosition::Top, LabelPosition::Bottom,...
void setFontSize(int size)
Sets the font size used when rendering the label.
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.
void setMinSize(int size)
Set min screen size (in pixel) of the label : this size is used in not scaled mode.
void setTextureName(const std::string &name)
Sets the texture name used when rendering the label.
void setScaleToSize(bool state)
Enable/disable if label is scaled to size.
int getMaxSize() const
Get max screen size (in pixel) of the label : this size is used in not scaled mode.
int getFontSize() const
Return the font size.
bool getUseLODOptimisation() const
Return if the label is otimized with the lod.
bool isUsingMinMaxSize() const
Return if the label using min/max screen size in not scaled mode.
void setSizeForOutAlign(const Size &size)
Set the size for alignment outside (left/right/top/bottom)
const BoundingBox & getTextBoundingBox()
Return the bounding box of the text of the label after transformations.
void setColor(const Color &color)
Set color of label.
const Coord & getPosition() const
Return the position of the label.
void setLabelsDensity(int density)
Set labels density of occlusion test This density must be in interval -100 100.
void setUseLODOptimisation(bool state, const BoundingBox &bb=BoundingBox())
Set if the label is optimized with the lod.
const Size & getSizeForOutAlign() const
return the size for alignment outside (left/right/top/bottom)
const Color & getColor() const
Get color use to render the label.
Base class for all Tulip OpenGL entities.
void setSize(const Size &size)
Set the size of the label.
const Size & getSize() const
return the size of the text
Create a label into Tulip 3D engine.
void setOutlineSize(float size)
Sets the outline size used when rendering the label.
float getOutlineSize() const
Return the outline size.
void setUseMinMaxSize(bool state)
Set if the label use min/max screen size in not scaled mode.
void setOcclusionTester(OcclusionTest *tester)
Set the occlusion tester If occlusionTester is nullptr : deactivate occlusion test.
bool isBillboarded() const
Return if the label is billboarded.
const Color & getOutlineColor() const
Return the outline color.
This class represents the 3D bounding box of an object. It is mostly used to determine whether or not...
const std::string & getText() const
getText gets the text of this label.
const std::string & getTextureName() const
Return the texture name used to render the label.
int getMinSize() const
Get min screen size (in pixel) of the label : this size is used in not scaled mode.
void setPosition(const Coord &position)
Set the position used to render the label.
Tulip OpenGL camera object.
void setPosition(float x, float y, float z)
Set the position used to render the label.
void enableDepthTest(bool state)
Enable/disable the OpenGL depth test for the label (default depth test is enable)
void setOutlineColor(const Color &color)
Sets the outline color used when rendering the label.