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