Tulip  6.0.0
Large graphs analysis and drawing
tlp::GlRect Class Reference

#include <GlRect.h>

+ Inheritance diagram for tlp::GlRect:
+ Collaboration diagram for tlp::GlRect:

Public Member Functions

 GlRect (bool filled=true, bool outlined=false)
 
 GlRect (const Coord &center, const float width, const float height, const Color &fillColor, const Color &outlineColor)
 
 GlRect (const Coord &topLeftPos, const Coord &bottomRightPos, const Color &topLeftCol, const Color &bottomRightCol, bool filled=true, bool outlined=false)
 
 ~GlRect () override
 
void draw (float lod, Camera *camera) override
 
virtual Color getBottomRightColor ()
 
virtual Coord getBottomRightPos ()
 
virtual Coord getCenter ()
 
virtual Color getTopLeftColor ()
 
virtual Coord getTopLeftPos ()
 
bool inRect (double x, double y)
 
virtual void setBottomRightColor (const Color &bottomRightCol)
 
virtual void setBottomRightPos (const Coord &bottomRightPos)
 
void setCenterAndSize (const Coord &center, const Size &size)
 
virtual void setTopLeftColor (const Color &topLeftCol)
 
virtual void setTopLeftPos (const Coord &topLeftPos)
 
- Public Member Functions inherited from tlp::GlPolygon
 GlPolygon (const bool filled=true, const bool outlined=true, const std::string &textureName="", const float outlineSize=1)
 
 GlPolygon (const std::vector< Coord > &points, const std::vector< Color > &fillColors, const std::vector< Color > &outlineColors, const bool filled, const bool outlined, const std::string &textureName="", const float outlineSize=1)
 
 GlPolygon (const unsigned int nbPoints, const unsigned int nbFillColors, const unsigned int nbOutlineColors, const bool filled=true, const bool outlined=true, const std::string &textureName="", const float outlineSize=1)
 
virtual Coord & point (const unsigned int i)
 
virtual const Coord & point (const unsigned int i) const
 
virtual void resizeColors (const unsigned int nbColors)
 
virtual void resizePoints (const unsigned int nbPoints)
 
- Public Member Functions inherited from tlp::GlAbstractPolygon
float getOutlineSize ()
 
std::string getTextureName ()
 
void setFillColor (const Color &color)
 
void setOutlineColor (const Color &color)
 
void setOutlineSize (float size)
 
void setTextureName (const std::string &name)
 
- Public Member Functions inherited from tlp::GlSimpleEntity
 GlSimpleEntity ()
 
 ~GlSimpleEntity () override
 
virtual BoundingBox getBoundingBox ()
 
int getStencil ()
 
virtual void getXML (std::string &outString)=0
 
bool isVisible () const
 
virtual void setStencil (int stencil)
 
virtual void setVisible (bool visible)
 
virtual void setWithXML (const std::string &inString, unsigned int &currentPosition)=0
 

Additional Inherited Members

- Protected Attributes inherited from tlp::GlAbstractPolygon
GLubyte * auxIndices
 
GLuint buffers [7]
 
std::vector< Color > fillColors
 
bool filled
 
bool generated
 
float hideOutlineLod
 
GLubyte * indices
 
bool invertYTexture
 
bool lighting
 
std::vector< Coord > normalArray
 
std::vector< Color > outlineColors
 
bool outlined
 
float outlineSize
 
std::vector< Coord > points
 
PolygonMode polygonMode
 
GLfloat * texArray
 
std::string textureName
 
- Protected Attributes inherited from tlp::GlSimpleEntity
BoundingBox boundingBox
 
std::vector< GlComposite * > parents
 
int stencil
 
bool visible
 

Detailed Description

This is a general class for the rendering of 2D rectangles.

This class is used as a 2D HUD for the rendering of 2D rectangles.

Definition at line 35 of file GlRect.h.

Constructor & Destructor Documentation

◆ GlRect() [1/3]

tlp::GlRect::GlRect ( const Coord &  topLeftPos,
const Coord &  bottomRightPos,
const Color &  topLeftCol,
const Color &  bottomRightCol,
bool  filled = true,
bool  outlined = false 
)

Constructor : with topLeft/bottomRight coords, topLeft/bottomRight colors and if GlRect is filled/outlined

◆ GlRect() [2/3]

tlp::GlRect::GlRect ( const Coord &  center,
const float  width,
const float  height,
const Color &  fillColor,
const Color &  outlineColor 
)

Constructor : with center coords and size, fill color and outline color

◆ GlRect() [3/3]

tlp::GlRect::GlRect ( bool  filled = true,
bool  outlined = false 
)

Constructor : with GlRect is filled/outlined

◆ ~GlRect()

tlp::GlRect::~GlRect ( )
override

Destructor

Member Function Documentation

◆ draw()

void tlp::GlRect::draw ( float  lod,
Camera camera 
)
overridevirtual

Draw function.

Warning
You don't have to call this function, the Tulip OpenGL engine call it.

Implements tlp::GlSimpleEntity.

◆ getBottomRightColor()

virtual Color tlp::GlRect::getBottomRightColor ( )
virtual

Accessor in reading to the Bottom Right Corner Color of the Rectangle

◆ getBottomRightPos()

virtual Coord tlp::GlRect::getBottomRightPos ( )
virtual

Accessor in reading to the Bottom Right Corner of the rectangle

◆ getCenter()

virtual Coord tlp::GlRect::getCenter ( )
virtual

Accessor in reading to the Top Left Corner of the rectangle

◆ getTopLeftColor()

virtual Color tlp::GlRect::getTopLeftColor ( )
virtual

Accessor in reading to the Top Left Corner Color of the rectangle

◆ getTopLeftPos()

virtual Coord tlp::GlRect::getTopLeftPos ( )
virtual

Accessor in reading to the Top Left Corner of the rectangle

◆ inRect()

bool tlp::GlRect::inRect ( double  x,
double  y 
)

Is the point in the rectangle ?

◆ setBottomRightColor()

virtual void tlp::GlRect::setBottomRightColor ( const Color &  bottomRightCol)
virtual

Accessor in writing to the Bottom Right Corner Color of the rectangle

◆ setBottomRightPos()

virtual void tlp::GlRect::setBottomRightPos ( const Coord &  bottomRightPos)
virtual

Accessor in writing to the Bottom Right Corner Color of the rectangle

◆ setCenterAndSize()

void tlp::GlRect::setCenterAndSize ( const Coord &  center,
const Size &  size 
)

Set the center and the size of the GlRect

◆ setTopLeftColor()

virtual void tlp::GlRect::setTopLeftColor ( const Color &  topLeftCol)
virtual

Accessor in writing to the Top Left Corner of the rectangle

◆ setTopLeftPos()

virtual void tlp::GlRect::setTopLeftPos ( const Coord &  topLeftPos)
virtual

Accessor in writing to the Top Left Corner of the rectangle