Tulip  5.0.0
Large graphs analysis and drawing
GlPolygon.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
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 
21 #ifndef GLPOLYGON_H
22 #define GLPOLYGON_H
23 
24 #include <vector>
25 
26 #include <tulip/Color.h>
27 #include <tulip/Coord.h>
28 #include <tulip/tulipconf.h>
29 #include <tulip/GlAbstractPolygon.h>
30 
31 namespace tlp {
32 /**
33  * @ingroup OpenGL
34  * @brief Class to create a polygon GlEntity
35  *
36  */
37 class TLP_GL_SCOPE GlPolygon : public GlAbstractPolygon {
38 public:
39  /**
40  * @brief Constructor where specify if the polygon is filled, is outlines the texture name and the outline size
41  */
42  GlPolygon(const bool filled = true,
43  const bool outlined= true,
44  const std::string &textureName="",
45  const float outlineSize = 1);
46  /**
47  * @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
48  */
49  GlPolygon(const std::vector<Coord> &points,
50  const std::vector<Color> &fillColors,
51  const std::vector<Color> &outlineColors,
52  const bool filled,
53  const bool outlined,
54  const std::string &textureName="",
55  const float outlineSize = 1);
56  /**
57  * @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
58  */
59  GlPolygon(const unsigned int nbPoints,
60  const unsigned int nbFillColors,
61  const unsigned int nbOutlineColors,
62  const bool filled = true,
63  const bool outlined = true,
64  const std::string &textureName="",
65  const float outlineSize = 1);
66  virtual ~GlPolygon();
67 
68  /**
69  * @brief Change number of point of the polygon
70  */
71  virtual void resizePoints(const unsigned int nbPoints);
72  /**
73  * @brief Change number of colors of the polygon
74  */
75  virtual void resizeColors(const unsigned int nbColors);
76 
77  /**
78  * @brief return the ith point
79  */
80  virtual const Coord& point(const unsigned int i) const;
81  /**
82  * @brief return the ith point
83  */
84  virtual Coord& point(const unsigned int i);
85 };
86 
87 }
88 #endif
Class to create a polygon GlEntity.
Definition: GlPolygon.h:37
class to create a abstract polygon