104#ifndef QQuickVTKRenderWindow_h
105#define QQuickVTKRenderWindow_h
112#include <QOpenGLFunctions>
116#include "vtkGUISupportQtQuickModule.h"
123VTK_ABI_NAMESPACE_BEGIN
136 ,
protected QOpenGLFunctions
139 typedef QQuickItem Superclass;
265 bool m_initialized =
false;
268 bool m_screenshotScheduled =
false;
273#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
274 void geometryChanged(
const QRectF& newGeometry,
const QRectF& oldGeometry)
override;
276 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.
~QQuickVTKRenderWindow() override
Destructor.
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.
virtual void mapToViewport(const QRectF &rect, double viewport[4])
Map a Qt item rect to viewport coordinates.
virtual void setRenderWindow(vtkRenderWindow *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 setRenderWindow(vtkGenericOpenGLRenderWindow *renWin)
Set/Get the vtkRenderWindow for the view.
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
Allocate and hold a VTK object.
create a window for renderers to draw into
abstract specification for renderers
Hold a reference to a vtkObjectBase instance.
Use a vtkWindow as input to image pipeline.
#define VTK_DEPRECATED_IN_9_3_0(reason)