Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Circle.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2015 "Omnidome" by cr8tr
2  * Dome Mapping Projection Software (http://omnido.me).
3  * Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
4  *
5  * This file is part of Omnidome.
6  *
7  * Omnidome is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Affero General Public License for more details.
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OMNI_VISUAL_CIRCLE_H_
21 #define OMNI_VISUAL_CIRCLE_H_
22 
23 #include <array>
24 #include <omni/visual/VBO.h>
25 
26 namespace omni {
27  namespace visual {
28  /// Visualizer for drawing a circle with VBO
29  class Circle {
30  public:
31  Circle();
32 
33  /// Standard number of segments
34  static constexpr std::size_t numberSegments = 32;
35 
36  /// Draw lined circle
37  void drawLine(QPointF const& _pos,
38  float _rX,
39  float _rY) const;
40 
41  /// Draw filled circle with triangle fan
42  void drawFill(QPointF const& _pos,
43  float _rX,
44  float _rY) const;
45 
46  /// Update circle mesh
47  void update();
48 
49  private:
51  std::array<QVector2D, numberSegments + 2> vertices_;
52  };
53  }
54 }
55 
56 
57 #endif /* OMNI_VISUAL_CIRCLE_H_ */
A small Vertex Buffer Object class.
Definition: VBO.h:29
void drawLine(QPointF const &_pos, float _rX, float _rY) const
Draw lined circle.
Definition: Circle.cpp:30
std::array< QVector2D, numberSegments+2 > vertices_
Definition: Circle.h:51
Circle()
Definition: Circle.cpp:25
VBO vertexVbo_
Definition: Circle.h:50
void update()
Update circle mesh.
Definition: Circle.cpp:67
static constexpr std::size_t numberSegments
Standard number of segments.
Definition: Circle.h:34
Visualizer for drawing a circle with VBO.
Definition: Circle.h:29
void drawFill(QPointF const &_pos, float _rX, float _rY) const
Draw filled circle with triangle fan.
Definition: Circle.cpp:48