116#ifndef QQuickVTKRenderWindow_h
117#define QQuickVTKRenderWindow_h
123#include <QOpenGLFunctions>
127#include "vtkGUISupportQtQuickModule.h"
142 ,
protected QOpenGLFunctions
145 typedef QQuickItem Superclass;
271 bool m_initialized =
false;
274 bool m_screenshotScheduled =
false;
279#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
280 void geometryChanged(
const QRectF& newGeometry,
const QRectF& oldGeometry)
override;
282 void geometryChange(
const QRectF& newGeometry,
const QRectF& oldGeometry)
override;
Intermediate class that handles relaying Qt events to VTK.
QQuickItem subclass that manages the vtkRenderWindow and, in turn, the OpenGL context of the QML appl...
vtkNew< vtkWindowToImageFilter > m_screenshotFilter
vtkRenderWindow * renderWindow() const
Set/Get the vtkRenderWindow for the view.
QPointer< QQuickVTKInteractorAdapter > interactorAdapter() const
Get access to the interactor adapter.
vtkSmartPointer< vtkGenericOpenGLRenderWindow > m_renderWindow
virtual vtkSmartPointer< vtkImageData > captureScreenshot(double *viewport)
Capture a screenshot of the window.
~QQuickVTKRenderWindow()
Destructor.
virtual void mapToViewport(const QRectF &rect, double viewport[4])
Map a Qt item rect to viewport coordinates.
void setRenderWindow(vtkRenderWindow *renWin)
Set/Get the vtkRenderWindow for the view.
void setRenderWindow(vtkGenericOpenGLRenderWindow *renWin)
Set/Get the vtkRenderWindow for the view.
bool checkGraphicsBackend()
Check the scenegraph backend and graphics API being used.
virtual void render()
Schedule a scenegraph update.
virtual bool isInitialized() const
Get whether the render window is initialized Used internally to determine if the OpenGL context,...
QQuickVTKRenderWindow(QQuickItem *parent=nullptr)
Constructor Creates a QQuickVTKRenderWindow with:
virtual void handleWindowChanged(QQuickWindow *w)
virtual void sync()
This is the function called on the QtQuick render thread before the scenegraph state is synchronized.
virtual void cleanup()
This is the function called on the QtQuick render thread when the scenegraph is invalidated.
QPointer< QQuickVTKInteractorAdapter > m_interactorAdapter
virtual vtkSmartPointer< vtkImageData > captureScreenshot()
Capture a screenshot of the window.
virtual void init()
Initialize the VTK render window for OpenGL based on the context created by QtQuick.
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
static void setupGraphicsBackend()
Set up the graphics surface format and api.
virtual void renderNow()
Convenience method that schedules a scenegraph update and waits for the update.
vtkNew< vtkRenderer > m_dummyRenderer
virtual void paint()
This is the function called on the QtQuick render thread right before the scenegraph is rendered.
platform independent render window
topologically and geometrically regular array of data
create a window for renderers to draw into
abstract specification for renderers
Use a vtkWindow as input to image pipeline.