VTK
|
display a vtkGenericOpenGLRenderWindow in a Qt QOpenGLWindow. More...
#include <QVTKOpenGLWindow.h>
Inherits QOpenGLWindow.
Public Slots | |
virtual void | MakeCurrent () |
slot to make this vtk render window current More... | |
virtual void | IsCurrent (vtkObject *caller, unsigned long vtk_event, void *client_data, void *call_data) |
slot called when vtk wants to know if the context is current More... | |
virtual void | Frame () |
slot called when vtk wants to frame the window More... | |
virtual void | Start () |
slot called when vtk wants to start the render More... | |
virtual void | End () |
slot called when vtk wants to end the render More... | |
virtual void | IsDirect (vtkObject *caller, unsigned long vtk_event, void *client_data, void *call_data) |
slot called when vtk wants to know if a window is direct More... | |
virtual void | SupportsOpenGL (vtkObject *caller, unsigned long vtk_event, void *client_data, void *call_data) |
slot called when vtk wants to know if a window supports OpenGL More... | |
virtual void | UpdateStereoType (vtkObject *caller, unsigned long vtk_event, void *client_data, void *call_data) |
slot called when the stereo type of the render window changed More... | |
virtual void | ChangeCursor (vtkObject *caller, unsigned long vtk_event, void *client_data, void *call_data) |
virtual void | widgetEvent (QEvent *e) |
slot to process events coming from the widget containing this window More... | |
virtual bool | isValid () |
Returns true if the internal QOpenGLWindow's is valid, i.e. More... | |
virtual bool | isCurrent () |
Returns true if the internal OpenGL contect is the actual current OpenGL context, false otherwise. More... | |
Signals | |
void | windowEvent (QEvent *e) |
Signal emitted when a QMouseEvent has been receive, with the corresponding event as argument. More... | |
Public Member Functions | |
QVTKOpenGLWindow () | |
QVTKOpenGLWindow (vtkGenericOpenGLRenderWindow *w, QOpenGLContext *shareContext=QOpenGLContext::currentContext(), UpdateBehavior updateBehavior=NoPartialUpdate, QWindow *parent=Q_NULLPTR) | |
QVTKOpenGLWindow (QOpenGLContext *shareContext, UpdateBehavior updateBehavior=NoPartialUpdate, QWindow *parent=Q_NULLPTR) | |
~QVTKOpenGLWindow () | |
virtual void | SetRenderWindow (vtkGenericOpenGLRenderWindow *) |
Set the VTK render window used for rendering. More... | |
virtual vtkGenericOpenGLRenderWindow * | GetRenderWindow () |
Get the VTK render window used for rendering. More... | |
virtual QVTKInteractorAdapter * | GetInteractorAdapter () |
Get the QEvent to VTK events translator. More... | |
virtual void | setEnableHiDPI (bool enable) |
Enable or disable support for HiDPI displays. More... | |
bool | ProcessEvent (QEvent *e) |
Process a QEvent and send it to the internal render window interactor returns whether the event was recognized and processed. More... | |
Static Public Member Functions | |
static void | copyFromFormat (const QSurfaceFormat &format, vtkRenderWindow *win) |
Sets up vtkRenderWindow ivars using QSurfaceFormat. More... | |
static void | copyToFormat (vtkRenderWindow *win, QSurfaceFormat &format) |
Using the vtkRenderWindow, setup QSurfaceFormat. More... | |
static QSurfaceFormat | defaultFormat () |
Returns a typical QSurfaceFormat suitable for most applications using QVTKOpenGLWidget. More... | |
Protected Member Functions | |
virtual void | initializeGL () |
Override event handler. More... | |
virtual void | paintGL () |
virtual void | moveEvent (QMoveEvent *event) |
virtual bool | event (QEvent *e) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | enterEvent (QEvent *) |
virtual void | leaveEvent (QEvent *) |
virtual void | wheelEvent (QWheelEvent *) |
display a vtkGenericOpenGLRenderWindow in a Qt QOpenGLWindow.
QVTKOpenGLWindow provides a way to display VTK data in a Qt OpenGL context.
QVTKOpenGLWindow extends QOpenGLWindow to make it work with a vtkGenericOpenGLRenderWindow. This is akin to QVTKOpenGLNativeWidget except the OpenGL context is created and managed by QOpenGLWindow (added in Qt 5.4).
While QVTKOpenGLWindow is intended to be a replacement for QVTKOpenGLNativeWidget, there are a few difference between both. Unlike QVTKOpenGLNativeWidget, QVTKOpenGLWindow can target multiple framebuffers and thus allows for stereo-capable applications. QVTKOpenGLWindow API was adapted from deprecated QVTKWidget2.
Since QVTKOpenGLWindow uses QOpenGLWindow to create the OpenGL context, it uses QSurfaceFormat (set using QOpenGLWidget::setFormat
or QSurfaceFormat::setDefaultFormat
)to create appropriate window and context.
Since QOpenGLWindow (superclass for QVTKOpenGLWindow) is not a subclass of QWidget, a typical usage for QVTKOpenGLWindow is as follows:
QVTKOpenGLWidget provides a wrapper around QVTKOpenGLWindow to manipulate a QVTKOpenGLWindow object as a QWidget instance, it is recommended to use QVTKOpenGLWidget instead of using this class directly.
QVTKOpenGLWindow is targeted for Qt version 5.9 and above.
Definition at line 78 of file QVTKOpenGLWindow.h.
QVTKOpenGLWindow::QVTKOpenGLWindow | ( | ) |
QVTKOpenGLWindow::QVTKOpenGLWindow | ( | vtkGenericOpenGLRenderWindow * | w, |
QOpenGLContext * | shareContext = QOpenGLContext::currentContext() , |
||
UpdateBehavior | updateBehavior = NoPartialUpdate , |
||
QWindow * | parent = Q_NULLPTR |
||
) |
QVTKOpenGLWindow::QVTKOpenGLWindow | ( | QOpenGLContext * | shareContext, |
UpdateBehavior | updateBehavior = NoPartialUpdate , |
||
QWindow * | parent = Q_NULLPTR |
||
) |
QVTKOpenGLWindow::~QVTKOpenGLWindow | ( | ) |
|
virtual |
Set the VTK render window used for rendering.
|
virtual |
Get the VTK render window used for rendering.
|
static |
Sets up vtkRenderWindow ivars using QSurfaceFormat.
|
static |
Using the vtkRenderWindow, setup QSurfaceFormat.
|
static |
Returns a typical QSurfaceFormat suitable for most applications using QVTKOpenGLWidget.
Note that this is not the QSurfaceFormat that gets used if none is specified. That is set using QSurfaceFormat::setDefaultFormat
.
|
virtual |
Get the QEvent to VTK events translator.
|
virtual |
Enable or disable support for HiDPI displays.
bool QVTKOpenGLWindow::ProcessEvent | ( | QEvent * | e | ) |
Process a QEvent and send it to the internal render window interactor returns whether the event was recognized and processed.
|
signal |
Signal emitted when a QMouseEvent has been receive, with the corresponding event as argument.
|
virtualslot |
slot to make this vtk render window current
|
virtualslot |
slot called when vtk wants to know if the context is current
|
virtualslot |
slot called when vtk wants to frame the window
|
virtualslot |
slot called when vtk wants to start the render
|
inlinevirtualslot |
slot called when vtk wants to end the render
Definition at line 171 of file QVTKOpenGLWindow.h.
|
virtualslot |
slot called when vtk wants to know if a window is direct
|
virtualslot |
slot called when vtk wants to know if a window supports OpenGL
|
virtualslot |
slot called when the stereo type of the render window changed
|
virtualslot |
|
virtualslot |
slot to process events coming from the widget containing this window
|
virtualslot |
Returns true if the internal QOpenGLWindow's is valid, i.e.
if OpenGL resources, like the context, have been successfully initialized.
|
virtualslot |
Returns true if the internal OpenGL contect is the actual current OpenGL context, false otherwise.
|
protectedvirtual |
Override event handler.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |