VoxelBlur
Depth-of-field volume rendering
 All Classes Files Functions Variables Enumerations Enumerator
volumerenderwindow.h
Go to the documentation of this file.
1 #ifndef VOLUMERENDERWINDOW_H
2 #define VOLUMERENDERWINDOW_H
3 
4 #include "glwindow.h"
5 #include "volumerenderer.h"
6 
17 {
18  Q_OBJECT
19 
20 public:
27  explicit VolumeRenderWindow(VolumeRenderer* renderer, QWindow* parent = nullptr);
29 
33  bool initialize() override;
37  void render() override;
38 
42  VolumeRenderer* getRenderer() const { return m_renderer; }
43 
47  void resizeEvent(QResizeEvent* ev) override;
48 
52  void mouseMoveEvent(QMouseEvent* ev) override;
53 
54  /*
55  Changes renderer distance parameter.
56  */
57  void wheelEvent(QWheelEvent* ev) override;
58 
62  void mousePressEvent(QMouseEvent* ev) override;
63 
64 private slots:
68  void rendererWantsDraw();
69 
73  void rendererUpdated();
74 
75 private:
76  VolumeRenderer* m_renderer;
77  QPoint m_lastMousePos;
78 };
79 
80 #endif // VOLUMERENDERWINDOW_H
void rendererWantsDraw()
Slot for the renderer to notify the VolumeRenderWindow of changes.
Definition: volumerenderwindow.cpp:94
VolumeRenderWindow(VolumeRenderer *renderer, QWindow *parent=nullptr)
Constructs a new VolumeRenderWindow.
Definition: volumerenderwindow.cpp:4
void mouseMoveEvent(QMouseEvent *ev) override
Changes the renderer rotation parameters.
Definition: volumerenderwindow.cpp:63
A state-based OpenGL renderer for simple volume rendering.
Definition: volumerenderer.h:17
void render() override
Calls VolumeRenderer::drawCurrent.
Definition: volumerenderwindow.cpp:40
This includes the public VolumeRenderer class.
bool initialize() override
Calls VolumeRenderer::initialize and checks for errors.
Definition: volumerenderwindow.cpp:23
A GLWindow that uses the VolumeRenderer for drawing, and provides some interaction with it...
Definition: volumerenderwindow.h:16
void resizeEvent(QResizeEvent *ev) override
Notifies the renderer that the size has changed.
Definition: volumerenderwindow.cpp:45
void rendererUpdated()
Slot for the renderer to notify the VolumeRenderWindow of changes.
Definition: volumerenderwindow.cpp:87
Contains the GLWindow class.
void mousePressEvent(QMouseEvent *ev) override
Needed for mouse tracking.
Definition: volumerenderwindow.cpp:82
VolumeRenderer * getRenderer() const
Returns the VolumeRenderer used.
Definition: volumerenderwindow.h:42
A QWindow derivative capable of OpenGL drawing.
Definition: glwindow.h:23