107 #ifndef QVTKOpenGLNativeWidget_h 108 #define QVTKOpenGLNativeWidget_h 110 #include <QOpenGLWidget> 113 #include "vtkGUISupportQtModule.h" 117 class QOpenGLDebugLogger;
118 class QOpenGLFramebufferObject;
121 class QVTKOpenGLNativeWidgetObserver;
127 typedef QOpenGLWidget Superclass;
156 static void copyFromFormat(
const QSurfaceFormat& format,
vtkRenderWindow* win);
161 static void copyToFormat(
vtkRenderWindow* win, QSurfaceFormat& format);
168 static QSurfaceFormat defaultFormat();
173 virtual void setEnableHiDPI(
bool enable);
179 void setQVTKCursor(
const QCursor &cursor);
185 void mouseEvent(QMouseEvent* event);
193 virtual void cleanupContext();
205 void startEventCallback();
211 void cursorChangedCallback(
vtkObject* caller,
unsigned long vtk_event,
212 void* client_data,
void* call_data);
215 bool event(QEvent* evt) Q_DECL_OVERRIDE;
216 void initializeGL() Q_DECL_OVERRIDE;
217 void resizeGL(
int w,
int h) Q_DECL_OVERRIDE;
218 void paintGL() Q_DECL_OVERRIDE;
220 void mousePressEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
221 void mouseMoveEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
222 void mouseReleaseEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
223 void mouseDoubleClickEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
231 void requireRenderWindowInitialization();
253 virtual bool renderVTK();
271 void windowFrameEventCallback();
273 QOpenGLFramebufferObject* FBO;
275 bool DoVTKRenderInPaintGL;
277 friend class QVTKOpenGLNativeWidgetObserver;
278 QOpenGLDebugLogger* Logger;
abstract base class for most VTK objects
an interactor for QVTKOpenGLNativeWidget (and QVTKWiget).
platform independent render window
create a window for renderers to draw into