36 #ifndef Q_VTK_WIDGET_H 37 #define Q_VTK_WIDGET_H 39 #include "vtkGUISupportQtModule.h" 47 #include <vtkConfigure.h> 48 #include <vtkToolkits.h> 51 #include "vtkTDxConfigure.h" 57 # if defined(QT_MAC_USE_COCOA) && defined(VTK_USE_COCOA) 58 # define QVTK_USE_COCOA 59 # elif defined(VTK_USE_COCOA) 60 # error "VTK configured to use Cocoa, but Qt configured to use Carbon" 68 class VTKGUISUPPORTQT_EXPORT
QVTKWidget :
public QWidget
72 Q_PROPERTY(
bool automaticImageCacheEnabled
73 READ isAutomaticImageCacheEnabled
74 WRITE setAutomaticImageCacheEnabled)
75 Q_PROPERTY(
double maxRenderRateForImageCache
76 READ maxRenderRateForImageCache
77 WRITE setMaxRenderRateForImageCache)
78 Q_PROPERTY(
bool deferRenderInPaintEvent
79 READ deferRenderInPaintEvent
80 WRITE setDeferRenderInPaintEvent)
84 QVTKWidget(QWidget* parent = NULL, Qt::WindowFlags f = 0);
115 virtual void setAutomaticImageCacheEnabled(
bool flag);
116 virtual bool isAutomaticImageCacheEnabled()
const;
126 virtual void setMaxRenderRateForImageCache(
double rate);
127 virtual double maxRenderRateForImageCache()
const;
136 void showEvent(QShowEvent*) VTK_OVERRIDE;
138 QPaintEngine* paintEngine() const VTK_OVERRIDE;
147 void SetUseTDx(
bool useTDx);
148 bool GetUseTDx() const;
160 void setDeferRenderInPaintEvent(
bool val);
161 bool deferRenderInPaintEvent() const;
167 void mouseEvent(QMouseEvent* event);
172 void cachedImageDirty();
176 void cachedImageClean();
185 void markCachedImageAsDirty();
190 void saveImageToCache();
204 virtual void deferRender();
208 virtual void doDeferredRender();
212 void resizeEvent(QResizeEvent* event) VTK_OVERRIDE;
214 void moveEvent(QMoveEvent* event) VTK_OVERRIDE;
216 void paintEvent(QPaintEvent* event) VTK_OVERRIDE;
219 void mousePressEvent(QMouseEvent* event) VTK_OVERRIDE;
221 void mouseMoveEvent(QMouseEvent* event) VTK_OVERRIDE;
223 void mouseReleaseEvent(QMouseEvent* event) VTK_OVERRIDE;
225 void keyPressEvent(QKeyEvent* event) VTK_OVERRIDE;
227 void keyReleaseEvent(QKeyEvent* event) VTK_OVERRIDE;
229 void enterEvent(QEvent*) VTK_OVERRIDE;
231 void leaveEvent(QEvent*) VTK_OVERRIDE;
232 #ifndef QT_NO_WHEELEVENT 234 void wheelEvent(QWheelEvent*) VTK_OVERRIDE;
237 void focusInEvent(QFocusEvent*) VTK_OVERRIDE;
239 void focusOutEvent(QFocusEvent*) VTK_OVERRIDE;
241 bool event( QEvent* e ) VTK_OVERRIDE;
244 void contextMenuEvent(QContextMenuEvent*) VTK_OVERRIDE;
246 void dragEnterEvent(QDragEnterEvent*) VTK_OVERRIDE;
248 void dragMoveEvent(QDragMoveEvent*) VTK_OVERRIDE;
250 void dragLeaveEvent(QDragLeaveEvent*) VTK_OVERRIDE;
252 void dropEvent(QDropEvent*) VTK_OVERRIDE;
257 virtual bool paintCachedImage();
268 void x11_setup_window();
270 #if defined(Q_OS_WIN) 271 bool winEvent(MSG* msg,
long* result);
273 #if QT_VERSION >= 0x050000 274 bool nativeEvent(
const QByteArray& eventType,
void* message,
long* result);
294 unsigned long renderEventCallbackObserverId;
299 void renderEventCallback();
300 QTimer mDeferedRenderTimer;
vtkRenderWindow * GetRenderWindow()
virtual void SetRenderWindow(vtkRenderWindow *renwin)
topologically and geometrically regular array of data
create a window for renderers to draw into
API to access a 3DConnexion input device.