Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Dome.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_CANVAS_DOME_H_
21 #define OMNI_CANVAS_DOME_H_
22 
23 #include <omni/geometry/Vertex.h>
24 #include <omni/visual/Sphere.h>
25 #include <omni/canvas/Envelope.h>
26 
27 namespace omni {
28  namespace canvas {
29  /// A basic dome canvas width a radius/diameter and offset
30  class Dome : public Envelope {
31  public:
32 
33  Dome();
34  virtual ~Dome();
35 
36  /// Return radius (10.0m by default)
37  qreal radius() const;
38 
39  /// Set radius in meter
40  void setRadius(qreal);
41 
42  /// Return diameter in meter
43  qreal diameter() const;
44 
45  /// Set diameter in meter
46  void setDiameter(qreal);
47 
48  /// Return internally cached bounding box
49  Box bounds() const;
50 
51  /// Draw dome sphere
52  virtual void draw() const;
53 
54  /// Draw auxiliary elements
55  virtual void drawAux() const;
56 
57  /// Update dome mesh
58  virtual void update();
59 
60  /// Serialize to stream
61  virtual void toPropertyMap(PropertyMap&) const;
62 
63  /// Deserialize from stream
64  virtual void fromPropertyMap(PropertyMap const&);
65 
66  protected:
67  /// Sphere visualizer
69 
70  private:
71  QVector3D center_;
72  };
73  }
74 }
75 
76 #endif /* OMNI_CANVAS_DOME_H_ */
qreal diameter() const
Return diameter in meter.
Definition: Dome.cpp:56
qreal radius() const
Return radius (10.0m by default)
Definition: Dome.cpp:44
virtual void fromPropertyMap(PropertyMap const &)
Deserialize from stream.
Definition: Dome.cpp:87
virtual void update()
Update dome mesh.
Definition: Dome.cpp:71
Dome()
Definition: Dome.cpp:26
visual::Sphere sphere_
Sphere visualizer.
Definition: Dome.h:68
virtual void drawAux() const
Draw auxiliary elements.
Definition: Dome.cpp:41
A basic dome canvas width a radius/diameter and offset.
Definition: Dome.h:30
QVector3D center_
Definition: Dome.h:71
Box bounds() const
Return internally cached bounding box.
Definition: Dome.cpp:66
virtual void draw() const
Draw dome sphere.
Definition: Dome.cpp:34
An enveloped canvas can enclose the viewer and can be projected from.
Definition: Envelope.h:29
void setRadius(qreal)
Set radius in meter.
Definition: Dome.cpp:49
Draw Handler for visualizing a centered sphere.
Definition: Sphere.h:31
void setDiameter(qreal)
Set diameter in meter.
Definition: Dome.cpp:61
virtual void toPropertyMap(PropertyMap &) const
Serialize to stream.
Definition: Dome.cpp:81
virtual ~Dome()
Definition: Dome.cpp:31