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