Tulip  6.0.0
Large graphs analysis and drawing
GlPolygon.h
1 /*
2  *
3  * This file is part of Tulip (https://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 
20 #ifndef GLPOLYGON_H
21 #define GLPOLYGON_H
22 
23 #include <vector>
24 
25 #include <tulip/Color.h>
26 #include <tulip/Coord.h>
27 #include <tulip/tulipconf.h>
28 #include <tulip/GlAbstractPolygon.h>
29 
30 namespace tlp {
31 /**
32  * @ingroup OpenGL
33  * @brief Class to create a polygon GlEntity
34  *
35  */
36 class TLP_GL_SCOPE GlPolygon : public GlAbstractPolygon {
37 public:
38  /**
39  * @brief Constructor where specify if the polygon is filled, is outlines the texture name and the
40  * outline size
41  */
42  GlPolygon(const bool filled = true, const bool outlined = true,
43  const std::string &textureName = "", const float outlineSize = 1);
44  /**
45  * @brief Constructor with a vector of point, a vector of fill color, a vector of outline color
46  * and if the polygon is filled, is outlined and the outline size
47  */
48  GlPolygon(const std::vector<Coord> &points, const std::vector<Color> &fillColors,
49  const std::vector<Color> &outlineColors, const bool filled, const bool outlined,
50  const std::string &textureName = "", const float outlineSize = 1);
51  /**
52  * @brief Constructor with a number of point, a number of fill color, a number of outline color
53  * and if the polygon is filled, outlined and the ouline size
54  */
55  GlPolygon(const unsigned int nbPoints, const unsigned int nbFillColors,
56  const unsigned int nbOutlineColors, const bool filled = true,
57  const bool outlined = true, const std::string &textureName = "",
58  const float outlineSize = 1);
59  ~GlPolygon() override;
60 
61  /**
62  * @brief Change number of point of the polygon
63  */
64  virtual void resizePoints(const unsigned int nbPoints);
65  /**
66  * @brief Change number of colors of the polygon
67  */
68  virtual void resizeColors(const unsigned int nbColors);
69 
70  /**
71  * @brief return the ith point
72  */
73  virtual const Coord &point(const unsigned int i) const;
74  /**
75  * @brief return the ith point
76  */
77  virtual Coord &point(const unsigned int i);
78 };
79 } // namespace tlp
80 #endif
class to create a abstract polygon
Class to create a polygon GlEntity.
Definition: GlPolygon.h:36
virtual void resizeColors(const unsigned int nbColors)
Change number of colors of the polygon.
GlPolygon(const bool filled=true, const bool outlined=true, const std::string &textureName="", const float outlineSize=1)
Constructor where specify if the polygon is filled, is outlines the texture name and the outline size...
virtual Coord & point(const unsigned int i)
return the ith point
virtual const Coord & point(const unsigned int i) const
return the ith point
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)
Constructor with a vector of point, a vector of fill color, a vector of outline color and if the poly...
virtual void resizePoints(const unsigned int nbPoints)
Change number of point of the polygon.
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)
Constructor with a number of point, a number of fill color, a number of outline color and if the poly...