Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Projector.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_PROJECTOR
21 #define OMNI_VISUAL_PROJECTOR
22 
23 #include <memory>
24 #include <QColor>
25 #include <QVector3D>
26 #include <QOpenGLShaderProgram>
27 #include <omni/visual/Interface.h>
28 #include <omni/proj/Projector.h>
30 
31 namespace omni
32 {
33  namespace visual
34  {
35  /// Visualizer for drawing a projector with halo
36  class Projector : public Interface
37  {
38  public:
39  Projector(const proj::Projector&);
41 
42  void update();
43 
44  /// Return size of drawn projector
45  qreal size() const;
46  /// Set size
47  void setSize(qreal);
48 
49  /// Halo is bright if projector is selected
50  bool isSelected() const;
51 
52  /// Set boolean if projector is selected
53  void setSelected(bool);
54 
55  /// Return drawn color
56  QColor color() const;
57 
58  /// Set color if drawn projector
59  void setColor(QColor);
60 
61  /// Draw projector line
62  void draw() const;
63 
64  /// Draw projector value
65  void drawHalo() const;
66 
67  /// Draw positioning of projector with center point
68  void drawPositioning(QVector3D const& _center) const;
69 
70  private:
72 
73  bool selected_ = false;
74  float size_ = 2.0;
75 
76  QColor color_;
78 
80  };
81  }
82 }
83 
84 #endif /* OMNI_VISUAL_PROJECTOR */
A projector with a transformation matrix and setup.
Definition: Projector.h:32
void draw() const
Draw projector line.
Definition: Projector.cpp:81
QColor color_
Definition: Projector.h:76
proj::Projector const & proj_
Definition: Projector.h:71
QVector3D topRight_
Definition: Projector.h:77
qreal size() const
Return size of drawn projector.
Definition: Projector.cpp:36
Visualizer for drawing a projector with halo.
Definition: Projector.h:36
bool selected_
Definition: Projector.h:73
QVector3D bottomRight_
Definition: Projector.h:77
void drawHalo() const
Draw projector value.
Definition: Projector.cpp:143
bool isSelected() const
Halo is bright if projector is selected.
Definition: Projector.cpp:47
static ContextBoundPtr< QOpenGLShaderProgram > haloShader_
Definition: Projector.h:79
Basic visual interface.
Definition: Interface.h:28
void setSize(qreal)
Set size.
Definition: Projector.cpp:41
float size_
Definition: Projector.h:74
~Projector()
Definition: Projector.h:40
Projector(const proj::Projector &)
Definition: Projector.cpp:30
void update()
Update geometry.
Definition: Projector.cpp:67
QVector3D bottomLeft_
Definition: Projector.h:77
void setSelected(bool)
Set boolean if projector is selected.
Definition: Projector.cpp:52
QVector3D eye_
Definition: Projector.h:77
void setColor(QColor)
Set color if drawn projector.
Definition: Projector.cpp:62
void drawPositioning(QVector3D const &_center) const
Draw positioning of projector with center point.
Definition: Projector.cpp:110
QColor color() const
Return drawn color.
Definition: Projector.cpp:57
QVector3D topLeft_
Definition: Projector.h:77