Tulip 6.1.0
Large graphs analysis and drawing
Loading...
Searching...
No Matches
tlp::Gl2DRect Class Reference

#include <Gl2DRect.h>

Inheritance diagram for tlp::Gl2DRect:
Collaboration diagram for tlp::Gl2DRect:

Public Member Functions

 Gl2DRect ()
 Gl2DRect (float bottom, float left, float height, float width, const std::string &textureName, bool xInv, bool yInv)
 Gl2DRect (float top, float bottom, float left, float right, const std::string &textureName, bool inPercent=false)
 ~Gl2DRect () override
void draw (float lod, Camera *camera) override
BoundingBox getBoundingBox () override
virtual std::string getTexture ()
void getXML (std::string &outString) override
virtual void setCoordinates (float bottom, float left, float width, float height)
virtual void setTexture (const std::string &name)
void setWithXML (const std::string &inString, unsigned int &currentPosition) override
void translate (const Coord &mouvement) override
Public Member Functions inherited from tlp::GlRect
 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
int getStencil ()
bool isVisible () const
virtual void setStencil (int stencil)
virtual void setVisible (bool visible)

Protected Attributes

float bottom
bool inPercent
float left
float right
float top
bool xInv
bool yInv
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

Create a 2D rectangle.

This rect add screen percentage system (for example you can create a rectangle that start on (10%,10%) and finish on (90%90%) If you when a simple 2D rectangle with normal coordinates use GlRect class

See also
GlRect

Definition at line 38 of file Gl2DRect.h.

Constructor & Destructor Documentation

◆ Gl2DRect() [1/3]

tlp::Gl2DRect::Gl2DRect ( )

Don't use this constructor.

◆ Gl2DRect() [2/3]

tlp::Gl2DRect::Gl2DRect ( float top,
float bottom,
float left,
float right,
const std::string & textureName,
bool inPercent = false )

Constructor.

Parameters
topcoordinate
bottomcoordinate
leftcoordinate
rightcoordinate
textureNamepath to a texture
inPercentif true : top/bottom/left/right is used as in percent parameters

◆ Gl2DRect() [3/3]

tlp::Gl2DRect::Gl2DRect ( float bottom,
float left,
float height,
float width,
const std::string & textureName,
bool xInv,
bool yInv )

Constructor.

Parameters
topcoordinate
bottomcoordinate
leftcoordinate
rightcoordinate
textureNamepath to a texture
xInvif true : use viewportX - left and viewportX - right
yInvif true : use viewportY - top and viewportY - bottom

◆ ~Gl2DRect()

tlp::Gl2DRect::~Gl2DRect ( )
inlineoverride

Destructor.

Definition at line 76 of file Gl2DRect.h.

Member Function Documentation

◆ draw()

void tlp::Gl2DRect::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.

◆ getBoundingBox()

BoundingBox tlp::Gl2DRect::getBoundingBox ( )
overridevirtual

Return the entity boundingbox.

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

Reimplemented from tlp::GlSimpleEntity.

◆ getTexture()

virtual std::string tlp::Gl2DRect::getTexture ( )
virtual

Get texture.

◆ getXML()

void tlp::Gl2DRect::getXML ( std::string & outString)
overridevirtual

Save the entity in outString (in XML format).

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

Implements tlp::GlSimpleEntity.

◆ setCoordinates()

virtual void tlp::Gl2DRect::setCoordinates ( float bottom,
float left,
float width,
float height )
virtual

Set coordinates of rectangle.

◆ setTexture()

virtual void tlp::Gl2DRect::setTexture ( const std::string & name)
virtual

Set texture.

◆ setWithXML()

void tlp::Gl2DRect::setWithXML ( const std::string & inString,
unsigned int & currentPosition )
overridevirtual

Load entity with inString (in XML format).

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

Implements tlp::GlSimpleEntity.

Member Data Documentation

◆ bottom

float tlp::Gl2DRect::bottom
protected

Definition at line 105 of file Gl2DRect.h.

◆ inPercent

bool tlp::Gl2DRect::inPercent
protected

Definition at line 108 of file Gl2DRect.h.

◆ left

float tlp::Gl2DRect::left
protected

Definition at line 106 of file Gl2DRect.h.

◆ right

float tlp::Gl2DRect::right
protected

Definition at line 107 of file Gl2DRect.h.

◆ top

float tlp::Gl2DRect::top
protected

Definition at line 104 of file Gl2DRect.h.

◆ xInv

bool tlp::Gl2DRect::xInv
protected

Definition at line 109 of file Gl2DRect.h.

◆ yInv

bool tlp::Gl2DRect::yInv
protected

Definition at line 110 of file Gl2DRect.h.