VoxelBlur
Depth-of-field volume rendering
|
A GLWindow that uses the VolumeRenderer for drawing, and provides some interaction with it. More...
#include <volumerenderwindow.h>
Public Member Functions | |
VolumeRenderWindow (VolumeRenderer *renderer, QWindow *parent=nullptr) | |
Constructs a new VolumeRenderWindow. More... | |
bool | initialize () override |
Calls VolumeRenderer::initialize and checks for errors. | |
void | render () override |
Calls VolumeRenderer::drawCurrent. | |
VolumeRenderer * | getRenderer () const |
Returns the VolumeRenderer used. | |
void | resizeEvent (QResizeEvent *ev) override |
Notifies the renderer that the size has changed. More... | |
void | mouseMoveEvent (QMouseEvent *ev) override |
Changes the renderer rotation parameters. | |
void | wheelEvent (QWheelEvent *ev) override |
void | mousePressEvent (QMouseEvent *ev) override |
Needed for mouse tracking. | |
Public Member Functions inherited from GLWindow | |
GLWindow (QWindow *parent=nullptr) | |
QWidget * | createWindowContainer (QWidget *parent=nullptr, Qt::WindowFlags flags=nullptr) |
Creates a window container from this GLWindow . More... | |
bool | isAnimating () const |
Gets if the window is currently in animation mode. More... | |
QSurfaceFormat | format () const override |
Returns the currently used surface format. More... | |
Private Slots | |
void | rendererWantsDraw () |
Slot for the renderer to notify the VolumeRenderWindow of changes. | |
void | rendererUpdated () |
Slot for the renderer to notify the VolumeRenderWindow of changes. | |
Private Attributes | |
VolumeRenderer * | m_renderer |
QPoint | m_lastMousePos |
Additional Inherited Members | |
Public Slots inherited from GLWindow | |
void | setAnimating (bool animating) |
Enables/disables animation mode. More... | |
void | renderLater () |
Queues a render request using the Qt event queue, to be executed at a later time. More... | |
void | renderNow () |
Makes sure everything is correctly initialized, calls render and does buffer-swapping afterwards. More... | |
Signals inherited from GLWindow | |
void | initializeFailed (const QString &error) |
This signal is sent when the context creation has failed, or the initialize function returned an error. More... | |
Protected Member Functions inherited from GLWindow | |
bool | event (QEvent *event) override |
void | exposeEvent (QExposeEvent *event) override |
Protected Attributes inherited from GLWindow | |
bool | m_error |
Set to true if error occured making rendering impossible. | |
QOpenGLContext * | m_context |
The OpenGL context used for this window. More... | |
A GLWindow that uses the VolumeRenderer for drawing, and provides some interaction with it.
The VolumeRenderer also defines the requested QSurfaceFormat
of the window, so you don't have to set it manually.
|
explicit |
Constructs a new VolumeRenderWindow.
The supplied renderer defines the surface format used (using VolumeRenderer::getDesiredFormat).
renderer | The VolumeRenderer to use. Must not be NULL . The window does take ownership of the renderer! |
parent | See QWindow constructor. |
|
override |
Notifies the renderer that the size has changed.
Used for projection and glViewport
.