Tulip
4.1.0
Better Visualization Through Research
|
#include <GlComplexPolygon.h>
Inherits tlp::GlSimpleEntity.
Public Member Functions | |
GlComplexPolygon () | |
GlComplexPolygon (const std::vector< Coord > &coords, Color fcolor, int polygonEdgesType=0, const std::string &textureName="") | |
GlComplexPolygon (const std::vector< Coord > &coords, Color fcolor, Color ocolor, int polygonEdgesType=0, const std::string &textureName="") | |
GlComplexPolygon (const std::vector< std::vector< Coord > > &coords, Color fcolor, int polygonEdgesType=0, const std::string &textureName="") | |
GlComplexPolygon (const std::vector< std::vector< Coord > > &coords, Color fcolor, Color ocolor, int polygonEdgesType=0, const std::string &textureName="") | |
void | activateQuadBorder (const float borderWidth, const Color &color, const std::string &texture="", const int position=1, const float texCoordFactor=1.f, const int polygonId=0) |
void | desactivateQuadBorder (const int polygonId=0) |
virtual void | draw (float lod, Camera *camera) |
Color | getFillColor () const |
Color | getOutlineColor () const |
const std::vector< std::vector < Coord > > & | getPolygonSides () const |
std::string | getTextureName () |
float | getTextureZoom () |
virtual void | getXML (std::string &outString) |
virtual void | getXMLOnlyData (std::string &outString) |
QStringList | propertiesNames () const |
QVariantList | propertiesQVariant () const |
void | setFillColor (const Color &color) |
void | setOutlineColor (const Color &color) |
void | setOutlineMode (const bool) |
void | setOutlineSize (double size) |
void | setProperty (const QString &name, const QVariant &value) |
void | setTextureName (const std::string &name) |
void | setTextureZoom (float zoom) |
virtual void | setWithXML (const std::string &inString, unsigned int ¤tPosition) |
virtual void | translate (const Coord &mouvement) |
Public Member Functions inherited from tlp::GlSimpleEntity | |
GlSimpleEntity () | |
virtual | ~GlSimpleEntity () |
virtual BoundingBox | getBoundingBox () |
int | getStencil () |
bool | isVisible () const |
virtual void | setStencil (int stencil) |
virtual void | setVisible (bool visible) |
Protected Member Functions | |
virtual void | addPoint (const Coord &point) |
void | addVertex (const Coord &vertexCoord, const Vec2f &vertexTexCoord) |
VERTEX * | allocateNewVertex () |
virtual void | beginNewHole () |
void | createPolygon (const std::vector< Coord > &coords, int polygonEdgesType) |
void | endPrimitive () |
void | runTesselation () |
void | startPrimitive (GLenum primitive) |
Protected Attributes | |
std::vector< VERTEX * > | allocatedVertices |
GLenum | currentPrimitive |
int | currentVector |
Color | fillColor |
int | nbPrimitiveVertices |
Color | outlineColor |
bool | outlined |
double | outlineSize |
std::vector< std::vector< Coord > > | points |
std::vector< std::vector < GLfloat > > | pointsIdx |
std::set< GLenum > | primitivesSet |
std::vector< bool > | quadBorderActivated |
std::vector< Color > | quadBorderColor |
std::vector< int > | quadBorderPosition |
std::vector< float > | quadBorderTexFactor |
std::vector< std::string > | quadBorderTexture |
std::vector< float > | quadBorderWidth |
std::map< GLenum, std::vector < int > > | startIndicesMap |
std::map< GLenum, std::vector < Vec2f > > | texCoordsMap |
std::string | textureName |
float | textureZoom |
std::map< GLenum, std::vector < int > > | verticesCountMap |
std::map< GLenum, std::vector < Coord > > | verticesMap |
Protected Attributes inherited from tlp::GlSimpleEntity | |
BoundingBox | boundingBox |
std::vector< GlComposite * > | parents |
int | stencil |
bool | visible |
Class to create a complex polygon (concave polygon or polygon with hole) If you want to create a complex polygon you have 4 constructors : Constructors with vector of coords : to create a complex polygon without hole.
Constructors with vector of vector of Coords : to create a complex polygon with hole
In constructors you can specify the polygon border style : polygonEdgesType parameter (0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) You can also specify the texture name if you want to create a textured complex polygon
In complex polygon you can add a smooth border : see activateQuadBorder(..) function And you can specify the texture zoom : see setTextureZoom(...) function
Definition at line 101 of file GlComplexPolygon.h.
|
inline |
Default constructor.
Definition at line 114 of file GlComplexPolygon.h.
tlp::GlComplexPolygon::GlComplexPolygon | ( | const std::vector< Coord > & | coords, |
Color | fcolor, | ||
int | polygonEdgesType = 0 , |
||
const std::string & | textureName = "" |
||
) |
Constructor with a vector of coords, a fill color, a polygon edges type(0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) and a textureName if you want.
tlp::GlComplexPolygon::GlComplexPolygon | ( | const std::vector< Coord > & | coords, |
Color | fcolor, | ||
Color | ocolor, | ||
int | polygonEdgesType = 0 , |
||
const std::string & | textureName = "" |
||
) |
Constructor with a vector of coords, a fill color, an outline color, a polygon edges type(0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) and a textureName if you want.
tlp::GlComplexPolygon::GlComplexPolygon | ( | const std::vector< std::vector< Coord > > & | coords, |
Color | fcolor, | ||
int | polygonEdgesType = 0 , |
||
const std::string & | textureName = "" |
||
) |
Constructor with a vector of vector of coords (the first vector of coord is the polygon and others vectors are holes in polygon), a fill color, a polygon edges type(0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) and a textureName if you want.
tlp::GlComplexPolygon::GlComplexPolygon | ( | const std::vector< std::vector< Coord > > & | coords, |
Color | fcolor, | ||
Color | ocolor, | ||
int | polygonEdgesType = 0 , |
||
const std::string & | textureName = "" |
||
) |
Constructor with a vector of vector of coords (the first vector of coord is the polygon and others vectors are holes in polygon), a fill color, an outline color a polygon edges type(0 -> straight lines, 1 -> catmull rom curves, 2 -> bezier curves) and a textureName if you want.
void tlp::GlComplexPolygon::activateQuadBorder | ( | const float | borderWidth, |
const Color & | color, | ||
const std::string & | texture = "" , |
||
const int | position = 1 , |
||
const float | texCoordFactor = 1.f , |
||
const int | polygonId = 0 |
||
) |
Draw a thick (textured) border around the polygon.
The graphic card must support geometry shader to make this feature to work. The position parameter determines the way the border is drawn (depending on the polygon points ordering):
The texCoordFactor parameter determines the way the texture is applied : if < 1, the texture will be expanded and > 1, the texture will be compressed The polygonId parameter determines on which contour of the polygon, the border will be applied
|
protectedvirtual |
Add a new point in polygon.
|
protectedvirtual |
Begin a new hole in the polygon.
void tlp::GlComplexPolygon::desactivateQuadBorder | ( | const int | polygonId = 0 | ) |
Desactivate the textured quad border.
|
virtual |
Draw the complex polygon.
Implements tlp::GlSimpleEntity.
|
inline |
Get fill color of GlComplexPolygon.
Definition at line 152 of file GlComplexPolygon.h.
|
inline |
Get outline color of GlComplexPolygon.
Definition at line 166 of file GlComplexPolygon.h.
std::string tlp::GlComplexPolygon::getTextureName | ( | ) |
Get the textureName.
|
inline |
Get the texture zoom factor.
Definition at line 180 of file GlComplexPolygon.h.
|
virtual |
Function to export data and type outString (in XML format)
Implements tlp::GlSimpleEntity.
|
virtual |
Function to export data in outString (in XML format)
|
inline |
Set fill color of GlComplexPolygon.
Definition at line 159 of file GlComplexPolygon.h.
|
inline |
Set outline color of GlComplexPolygon.
Definition at line 173 of file GlComplexPolygon.h.
void tlp::GlComplexPolygon::setOutlineMode | ( | const bool | ) |
Set if the polygon is outlined or not.
void tlp::GlComplexPolygon::setOutlineSize | ( | double | size | ) |
Set size of outline.
void tlp::GlComplexPolygon::setTextureName | ( | const std::string & | name | ) |
Set the textureName.
|
inline |
Set the texture zoom factor.
By default if you have a polygon with a size bigger than (1,1,0) the texture will be repeated If you want to don't have this texture repeat you have to modify texture zoom For example if you have a polygon with coords ((0,0,0),(5,0,0),(5,5,0),(0,5,0)) you can set texture zoom to 5. to don't have texture repeat
Definition at line 191 of file GlComplexPolygon.h.
|
virtual |
Function to set data with inString (in XML format)
Implements tlp::GlSimpleEntity.
|
virtual |
Translate entity.