Tulip  4.2.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
GlCircle.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 GLCIRCLE_H
22 #define GLCIRCLE_H
23 
24 #include <tulip/Color.h>
25 #include <tulip/Coord.h>
26 
27 #include <tulip/GlRegularPolygon.h>
28 
29 namespace tlp {
30 
31 /**
32  * @ingroup OpenGL
33  * @brief Class used to render circles as GlEntity.
34  *
35  * If you want a circle : use this class
36  */
37 class TLP_GL_SCOPE GlCircle : public GlRegularPolygon {
38 public:
39  /**
40  * @brief Constructor
41  *
42  * @param startAngle if start angle is equal to 0, the circle construction begin with the top center point
43  * @param segment number of triangle used to render the circle
44  */
45  GlCircle(const Coord &center = Coord(0,0,0),
46  float radius = 1.,
47  const Color &outlineColor = Color(255, 0 , 0 , 255),
48  const Color &fillColor = Color (0, 0, 255,255),
49  bool filled = false,
50  bool outlined = true,
51  float startAngle = 0.0,
52  unsigned int segments = 10);
53 
54  /**
55  * @brief Write-acess Accessor to the center, the radius and the startAngle of the circle.
56  */
57  void set(const Coord &center, float radius, float startAngle);
58 
59  /**
60  * @brief Function to export data in XML
61  */
62  virtual void getXML(std::string &outString);
63 };
64 
65 }
66 
67 #endif