Tulip  4.3.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
tlp::GlRegularPolygon Class Reference

#include <GlRegularPolygon.h>

Inherits tlp::GlPolygon.

Inherited by tlp::GlCircle, tlp::GlHexagon, tlp::GlPentagon, and tlp::GlTriangle.

Public Member Functions

 GlRegularPolygon (const Coord &position, const Size &size, unsigned int numberOfSides, const Color &outlineColor=Color(255, 0, 0, 255), const Color &fillColor=Color(0, 0, 255, 255), bool filled=true, bool outlined=true, const std::string &textureName="", float outlineSize=1.)
 
virtual ~GlRegularPolygon ()
 
unsigned int getNumberOfSides ()
 
void resizePoints (const unsigned int number)
 
void setNumberOfSides (unsigned int number)
 
void setStartAngle (float angle)
 
- 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)
 
- 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 ()
 
virtual void draw (float lod, Camera *camera)=0
 
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
 

Protected Member Functions

void computePolygon ()
 

Protected Attributes

unsigned int numberOfSides
 
Coord position
 
Size size
 
float startAngle
 

Detailed Description

class to create a regular polygon

Definition at line 32 of file GlRegularPolygon.h.

Constructor & Destructor Documentation

tlp::GlRegularPolygon::GlRegularPolygon ( const Coord &  position,
const Size &  size,
unsigned int  numberOfSides,
const Color &  outlineColor = Color(255, 0, 0, 255),
const Color &  fillColor = Color(0, 0, 255, 255),
bool  filled = true,
bool  outlined = true,
const std::string &  textureName = "",
float  outlineSize = 1. 
)

Constructor.

The outline is the border of the regular polygon

The fill is inside the regular polygon

virtual tlp::GlRegularPolygon::~GlRegularPolygon ( )
virtual

Destructor.

Member Function Documentation

unsigned int tlp::GlRegularPolygon::getNumberOfSides ( )

Get the number of Sides.

void tlp::GlRegularPolygon::resizePoints ( const unsigned int  number)
virtual

Set the number of sides (use setNumberOfSides)

Reimplemented from tlp::GlPolygon.

void tlp::GlRegularPolygon::setNumberOfSides ( unsigned int  number)

Set the number of sides.

void tlp::GlRegularPolygon::setStartAngle ( float  angle)

Set the start angle in degree.

If the start angle is 0 : the regular polygon begin at the top middle point