Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Session.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_SESSION_H_
21 #define OMNI_VISUAL_SESSION_H_
22 
23 #include <list>
24 #include <omni/Session.h>
26 #include <omni/visual/Projector.h>
27 #include <omni/visual/WarpGrid.h>
28 
29 
30 namespace omni {
31  namespace visual {
32  /// Base class for drawing a session
33  class Session {
34  public:
35  /// Construct with reference to session
36  Session(omni::Session const&);
37 
38  /// Return const ref to session
39  omni::Session const& session() const;
40 
41  /// Draw canvas with given output mode and optional grayscale toggle
42  void drawCanvas(
44  bool _grayscale = false) const;
45 
46 
47  void drawCanvasWireframe() const;
48 
49  /// Draw canvas for scene view
50  void drawCanvasFor3DView();
51 
52  /// Canvas with frustum intersection of all projectors
54 
55  /// Draw frustum canvas intersection
57  QColor const&) const;
58 
59  /// Update projectors and canvas
60  void update();
61 
62  /**@brief Draw projectors.
63  @detail If _selectedOnly true, only currently selected projector is drawn
64  **/
66 
67  /**@brief Draw projector halos.
68  @detail If _selectedOnly true, only currently selected projector is drawn
69  **/
71 
72  /// Returns true if an update is required
73  bool needsUpdate() const;
74 
75  private:
76  /// Draw canvas transform with matrix
77  void drawCanvasWithMatrix() const;
78 
79  template<typename F>
81 
84 
85  std::list<visual::Projector> projectors_;
86  bool needsUpdate_ = true;
87  };
88  }
89 }
90 
91 #endif /* OMNI_VISUAL_SESSION_H_ */
A projector with a transformation matrix and setup.
Definition: Projector.h:32
void drawFrustumIntersection(proj::Projector const &, QColor const &) const
Draw frustum canvas intersection.
Definition: Session.cpp:188
std::list< visual::Projector > projectors_
Definition: Session.h:85
A session consists of a canvas, a mapping, a list of tunings and one or several inputs.
Definition: Session.h:41
Session(omni::Session const &)
Construct with reference to session.
Definition: Session.cpp:30
void drawCanvasFor3DView()
Draw canvas for scene view.
Definition: Session.cpp:78
omni::Session const & session_
Definition: Session.h:82
bool needsUpdate() const
Returns true if an update is required.
Definition: Session.cpp:217
omni::Session const & session() const
Return const ref to session.
Definition: Session.cpp:34
bool needsUpdate_
Definition: Session.h:86
void drawProjectorHalos(ProjectorSelectionMode=ProjectorSelectionMode::ALL) const
Draw projector halos. If _selectedOnly true, only currently selected projector is drawn...
Definition: Session.cpp:271
OutputMode
Definition: Interface.h:42
void drawCanvasWireframe() const
Definition: Session.cpp:53
Base class for drawing a session.
Definition: Session.h:33
void update()
Update projectors and canvas.
Definition: Session.cpp:282
ProjectorSelectionMode
Definition: Scene.h:55
void drawCanvas(mapping::OutputMode=mapping::OutputMode::MAPPED_INPUT, bool _grayscale=false) const
Draw canvas with given output mode and optional grayscale toggle.
Definition: Session.cpp:147
void drawCanvasWithFrustumIntersections(ProjectorSelectionMode) const
Canvas with frustum intersection of all projectors.
Definition: Session.cpp:178
void projectorDrawFunction(ProjectorSelectionMode, F f) const
Definition: Session.cpp:223
static ContextBoundPtr< QOpenGLShaderProgram > frustumShader_
Definition: Session.h:83
void drawCanvasWithMatrix() const
Draw canvas transform with matrix.
Definition: Session.cpp:39
void drawProjectors(ProjectorSelectionMode=ProjectorSelectionMode::ALL) const
Draw projectors. If _selectedOnly true, only currently selected projector is drawn.
Definition: Session.cpp:247