35 #ifndef Q_VTK_WIDGET_H 36 #define Q_VTK_WIDGET_H 38 #include "vtkGUISupportQtModule.h" 46 #include <vtkConfigure.h> 47 #include <vtkToolkits.h> 50 #include "vtkTDxConfigure.h" 56 # if defined(QT_MAC_USE_COCOA) && defined(VTK_USE_COCOA) 57 # define QVTK_USE_COCOA 58 # elif defined(VTK_USE_COCOA) 59 # error "VTK configured to use Cocoa, but Qt configured to use Carbon" 66 class VTKGUISUPPORTQT_EXPORT
QVTKWidget :
public QWidget
70 Q_PROPERTY(
bool automaticImageCacheEnabled
71 READ isAutomaticImageCacheEnabled
72 WRITE setAutomaticImageCacheEnabled)
73 Q_PROPERTY(
double maxRenderRateForImageCache
74 READ maxRenderRateForImageCache
75 WRITE setMaxRenderRateForImageCache)
76 Q_PROPERTY(
bool deferRenderInPaintEvent
77 READ deferRenderInPaintEvent
78 WRITE setDeferRenderInPaintEvent)
82 VTK_LEGACY(
QVTKWidget(QWidget *parent =
nullptr, Qt::WindowFlags f = 0));
113 virtual void setAutomaticImageCacheEnabled(
bool flag);
114 virtual bool isAutomaticImageCacheEnabled()
const;
124 virtual void setMaxRenderRateForImageCache(
double rate);
125 virtual double maxRenderRateForImageCache()
const;
134 void showEvent(QShowEvent*)
override;
136 QPaintEngine* paintEngine()
const override;
145 void SetUseTDx(
bool useTDx);
146 bool GetUseTDx()
const;
158 void setDeferRenderInPaintEvent(
bool val);
159 bool deferRenderInPaintEvent()
const;
165 void mouseEvent(QMouseEvent* event);
170 void cachedImageDirty();
174 void cachedImageClean();
183 void markCachedImageAsDirty();
188 void saveImageToCache();
194 void setDevice(vtkTDxDevice *device);
202 virtual void deferRender();
206 virtual void doDeferredRender();
210 void resizeEvent(QResizeEvent* event)
override;
212 void moveEvent(QMoveEvent* event)
override;
214 void paintEvent(QPaintEvent* event)
override;
217 void mousePressEvent(QMouseEvent* event)
override;
219 void mouseMoveEvent(QMouseEvent* event)
override;
221 void mouseReleaseEvent(QMouseEvent* event)
override;
223 void keyPressEvent(QKeyEvent* event)
override;
225 void keyReleaseEvent(QKeyEvent* event)
override;
227 void enterEvent(QEvent*)
override;
229 void leaveEvent(QEvent*)
override;
230 #ifndef QT_NO_WHEELEVENT 232 void wheelEvent(QWheelEvent*)
override;
235 void focusInEvent(QFocusEvent*)
override;
237 void focusOutEvent(QFocusEvent*)
override;
239 bool event( QEvent* e )
override;
242 void contextMenuEvent(QContextMenuEvent*)
override;
244 void dragEnterEvent(QDragEnterEvent*)
override;
246 void dragMoveEvent(QDragMoveEvent*)
override;
248 void dragLeaveEvent(QDragLeaveEvent*)
override;
250 void dropEvent(QDropEvent*)
override;
255 virtual bool paintCachedImage();
266 void x11_setup_window();
268 #if defined(Q_OS_WIN) 269 bool winEvent(MSG* msg,
long* result);
271 bool nativeEvent(
const QByteArray& eventType,
void* message,
long* result);
288 unsigned long renderEventCallbackObserverId;
293 void renderEventCallback();
294 QTimer mDeferedRenderTimer;
an interactor for QVTKOpenGLNativeWidget (and QVTKWiget).
topologically and geometrically regular array of data
create a window for renderers to draw into