Tulip  4.6.0
Better Visualization Through Research
library/tulip-ogl/include/tulip/GlPolygon.h
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 
00020 
00021 #ifndef GLPOLYGON_H
00022 #define GLPOLYGON_H
00023 
00024 #include <vector>
00025 
00026 #include <tulip/Color.h>
00027 #include <tulip/Coord.h>
00028 #include <tulip/tulipconf.h>
00029 #include <tulip/GlAbstractPolygon.h>
00030 
00031 namespace tlp {
00032 /**
00033  * @ingroup OpenGL
00034  * @brief Class to create a polygon GlEntity
00035  *
00036  */
00037 class TLP_GL_SCOPE GlPolygon : public GlAbstractPolygon {
00038 public:
00039   /**
00040    * @brief Constructor where specify if the polygon is filled, is outlines the texture name and the outline size
00041    */
00042   GlPolygon(const bool filled = true,
00043             const bool outlined= true,
00044             const std::string &textureName="",
00045             const float outlineSize = 1);
00046   /**
00047    * @brief Constructor with a vector of point, a vector of fill color, a vector of outline color and if the polygon is filled, is outlined and the outline size
00048    */
00049   GlPolygon(const std::vector<Coord> &points,
00050             const std::vector<Color> &fillColors,
00051             const std::vector<Color> &outlineColors,
00052             const bool filled,
00053             const bool outlined,
00054             const std::string &textureName="",
00055             const float outlineSize = 1);
00056   /**
00057    * @brief Constructor with a number of point, a number of fill color, a number of outline color and if the polygon is filled, outlined and the ouline size
00058    */
00059   GlPolygon(const unsigned int nbPoints,
00060             const unsigned int nbFillColors,
00061             const unsigned int nbOutlineColors,
00062             const bool filled = true,
00063             const bool outlined = true,
00064             const std::string &textureName="",
00065             const float outlineSize = 1);
00066   virtual ~GlPolygon();
00067 
00068   /**
00069    * @brief Change number of point of the polygon
00070    */
00071   virtual void resizePoints(const unsigned int nbPoints);
00072   /**
00073    * @brief Change number of colors of the polygon
00074    */
00075   virtual void resizeColors(const unsigned int nbColors);
00076 
00077   /**
00078    * @brief return the ith point
00079    */
00080   virtual const Coord& point(const unsigned int i) const;
00081   /**
00082    * @brief return the ith point
00083    */
00084   virtual Coord& point(const unsigned int i);
00085 };
00086 
00087 }
00088 #endif
 All Classes Files Functions Variables Enumerations Enumerator Properties