Tulip  4.2.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
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 1 and Inria Bordeaux - Sud Ouest
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 
30 #include <tulip/GlAbstractPolygon.h>
31 
32 namespace tlp {
33 /**
34  * @ingroup OpenGL
35  * @brief Class to create a polygon GlEntity
36  *
37  */
38 class TLP_GL_SCOPE GlPolygon : public GlAbstractPolygon {
39 public:
40  /**
41  * @brief Constructor where specify if the polygon is filled, is outlines the texture name and the outline size
42  */
43  GlPolygon(const bool filled = true,
44  const bool outlined= true,
45  const std::string &textureName="",
46  const float outlineSize = 1);
47  /**
48  * @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
49  */
50  GlPolygon(const std::vector<Coord> &points,
51  const std::vector<Color> &fillColors,
52  const std::vector<Color> &outlineColors,
53  const bool filled,
54  const bool outlined,
55  const std::string &textureName="",
56  const float outlineSize = 1);
57  /**
58  * @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
59  */
60  GlPolygon(const unsigned int nbPoints,
61  const unsigned int nbFillColors,
62  const unsigned int nbOutlineColors,
63  const bool filled = true,
64  const bool outlined = true,
65  const std::string &textureName="",
66  const float outlineSize = 1);
67  virtual ~GlPolygon();
68 
69  /**
70  * @brief Change number of point of the polygon
71  */
72  virtual void resizePoints(const unsigned int nbPoints);
73  /**
74  * @brief Change number of colors of the polygon
75  */
76  virtual void resizeColors(const unsigned int nbColors);
77 
78  /**
79  * @brief return the ith point
80  */
81  virtual const Coord& point(const unsigned int i) const;
82  /**
83  * @brief return the ith point
84  */
85  virtual Coord& point(const unsigned int i);
86 };
87 
88 }
89 #endif