Molecule Visualizer
 All Classes Namespaces Files Functions Enumerations Enumerator Macros Groups Pages
window.h
Go to the documentation of this file.
1 
7 #ifndef WINDOW_H
8 #define WINDOW_H
9 
10 #include "abstractscene.h"
11 
12 #include <QWindow>
13 #include <QWheelEvent>
17 class QOpenGLContext;
18 
19 class Window : public QWindow
20 {
21  Q_OBJECT
22 public:
26  explicit Window();
27 
31  ~Window();
32 
37  void compileShader();
38 
39  QScopedPointer<AbstractScene> mScene;
40 
41 signals:
42 
43 public slots:
49  void loadModelFromPath(const std::string absoluteFilePath);
50 
51 protected slots:
52 
57  void resizeGl();
58 
63  void paintGl();
64 
69  void updateScene();
70 
76  virtual void mouseMoveEvent(QMouseEvent *event);
77 
83  virtual void mousePressEvent(QMouseEvent *event);
84 
90  virtual void mouseReleaseEvent( QMouseEvent *event);
91 
97  virtual void wheelEvent( QWheelEvent *event);
98 
99 private:
100 
101  QOpenGLContext *mContext;
102 
103  bool mLeftMouseButton;
104  bool mRightMouseButton;
105  float mMousePosX;
106  float mMousePosY;
107 
112  void initializeGl();
113 };
114 
115 #endif // WINDOW_H
Definition: window.h:19
void paintGl()
A protected slot member function to paint the OpenGL context.
Definition: window.cpp:59
void updateScene()
A protected slot member function to update the scene.
Definition: window.cpp:72
virtual void mousePressEvent(QMouseEvent *event)
A virtual member function to process mouse press events.
Definition: window.cpp:78
void resizeGl()
A protected slot member function to resize the OpenGL context.
Definition: window.cpp:66
~Window()
Destructor.
Definition: window.cpp:44
Abstract class for a scene.
void compileShader()
A member function to call a GLSL shader compile during runtime.
Definition: window.cpp:48
virtual void mouseReleaseEvent(QMouseEvent *event)
A virtual member function to process mouse release events.
Definition: window.cpp:91
virtual void mouseMoveEvent(QMouseEvent *event)
A virtual member function to process mouse move events.
Definition: window.cpp:106
Window()
Default constructor.
Definition: window.cpp:9
virtual void wheelEvent(QWheelEvent *event)
A virtual member function to process mouse wheel events.
Definition: window.cpp:101
void loadModelFromPath(const std::string absoluteFilePath)
A public slot member function to load a model from an absolute file path.
Definition: window.cpp:127