Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SceneGLView.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_UI_SCENEGLVIEW_H_
21 #define OMNI_UI_SCENEGLVIEW_H_
22 
23 #include <omni/ui/GLView.h>
24 #include <omni/visual/Grid.h>
26 #include <omni/visual/Session.h>
27 
28 namespace omni {
29  namespace ui {
30  /**@brief An OpenGL view for visualizing the scene of a session
31  **/
32  class SceneGLView :
33  public GLView,
34  public mixin::SharedDataModel<Session>
35  {
36  Q_OBJECT
38 
39  public:
40  SceneGLView(QWidget *_parent = nullptr);
41  ~SceneGLView();
42 
43  public slots:
44  void changeZoom(int _value);
45  signals:
46  void dataModelChanged();
47 
48  protected:
49  virtual void paintGL();
50 
51  /// Change zoom on mouse wheel event
52  virtual void wheelEvent(QWheelEvent *event);
53  virtual void keyPressEvent(QKeyEvent *event);
54  virtual void mouseMoveEvent(QMouseEvent *event);
55  virtual void showEvent(QShowEvent* event);
56 
57  private:
58  virtual void dataToFrontend();
59  inline virtual bool frontendToData() {
60  return false;
61  }
62 
63  bool initialize();
64  };
65  }
66 }
67 
68 #endif /* OMNI_UI_SCENEGLVIEW_H_ */
virtual void keyPressEvent(QKeyEvent *event)
Definition: SceneGLView.cpp:118
A session consists of a canvas, a mapping, a list of tunings and one or several inputs.
Definition: Session.h:41
#define OMNI_UI_SHARED_DATAMODEL(MODEL)
Definition: DataModel.h:216
virtual void paintGL()
Paint GL routine.
Definition: SceneGLView.cpp:62
virtual void wheelEvent(QWheelEvent *event)
Change zoom on mouse wheel event.
Definition: SceneGLView.cpp:102
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: SceneGLView.cpp:121
SceneGLView(QWidget *_parent=nullptr)
Definition: SceneGLView.cpp:28
virtual bool frontendToData()
Return true if data has changed by front end.
Definition: SceneGLView.h:59
void changeZoom(int _value)
Definition: SceneGLView.cpp:146
virtual void showEvent(QShowEvent *event)
Definition: SceneGLView.cpp:49
An OpenGL view for visualizing the scene of a session.
Definition: SceneGLView.h:32
Holds a specific data model with frontend update mechanism.
Definition: DataModel.h:87
~SceneGLView()
Definition: SceneGLView.cpp:32
GLView for visualizing tunings or session Holds shared_ptr to session as data model.
Definition: GLView.h:35
virtual void dataToFrontend()
Pure virtual method which determines how data model is represented in frontend.
Definition: SceneGLView.cpp:158
bool initialize()
Pure virtual function to initialize GL contents.
Definition: SceneGLView.cpp:35