Tulip  4.0.0
Better Visualization Through Research
 All Classes Files Functions Variables Enumerations Enumerator Properties Groups Pages
tlp::Gl2DRect Class Reference

#include <Gl2DRect.h>

Inherits tlp::GlRect.

Public Member Functions

 Gl2DRect ()
 
 Gl2DRect (float top, float bottom, float left, float right, const std::string &textureName, bool inPercent=false)
 
 Gl2DRect (float bottom, float left, float height, float width, const std::string &textureName, bool xInv, bool yInv)
 
virtual ~Gl2DRect ()
 
virtual void draw (float lod, Camera *camera)
 
virtual BoundingBox getBoundingBox ()
 
virtual std::string getTexture ()
 
virtual void getXML (std::string &outString)
 
virtual void setCoordinates (float bottom, float left, float width, float height)
 
virtual void setTexture (const std::string &name)
 
virtual void setWithXML (const std::string &inString, unsigned int &currentPosition)
 
virtual void translate (const Coord &mouvement)
 
- Public Member Functions inherited from tlp::GlRect
 GlRect (const Coord &topLeftPos, const Coord &bottomRightPos, const Color &topLeftCol, const Color &bottomRightCol, bool filled=true, bool outlined=false)
 
 GlRect (const Coord &center, const float width, const float height, const Color &fillColor, const Color &outlineColor)
 
 GlRect (bool filled=true, bool outlined=false)
 
virtual ~GlRect ()
 
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 const Coord & point (const unsigned int i) const
 
virtual Coord & point (const unsigned int i)
 
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 ()
 
virtual ~GlSimpleEntity ()
 
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
 

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 whan a simple 2D rectangle with normal coordinates use GlRect class

See Also
GlRect

Definition at line 37 of file Gl2DRect.h.

Constructor & Destructor Documentation

tlp::Gl2DRect::Gl2DRect ( )

Don't use this constructor.

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
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
virtual tlp::Gl2DRect::~Gl2DRect ( )
inlinevirtual

Destructor.

Definition at line 77 of file Gl2DRect.h.

Member Function Documentation

virtual void tlp::Gl2DRect::draw ( float  lod,
Camera camera 
)
virtual

Draw function.

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

Reimplemented from tlp::GlRect.

virtual BoundingBox tlp::Gl2DRect::getBoundingBox ( )
virtual

Return the entity boundingbox.

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

Reimplemented from tlp::GlSimpleEntity.

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

Get texture.

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

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.

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

Set coordinates of rectangle.

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

Set texture.

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

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.