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 virtual void showEvent(QShowEvent*);
138 virtual QPaintEngine* paintEngine()
const;
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 virtual void resizeEvent(QResizeEvent* event);
214 virtual void moveEvent(QMoveEvent* event);
216 virtual void paintEvent(QPaintEvent* event);
219 virtual void mousePressEvent(QMouseEvent* event);
221 virtual void mouseMoveEvent(QMouseEvent* event);
223 virtual void mouseReleaseEvent(QMouseEvent* event);
225 virtual void keyPressEvent(QKeyEvent* event);
227 virtual void keyReleaseEvent(QKeyEvent* event);
229 virtual void enterEvent(QEvent*);
231 virtual void leaveEvent(QEvent*);
232 #ifndef QT_NO_WHEELEVENT
234 virtual void wheelEvent(QWheelEvent*);
237 virtual void focusInEvent(QFocusEvent*);
239 virtual void focusOutEvent(QFocusEvent*);
241 bool event( QEvent* e );
244 virtual void contextMenuEvent(QContextMenuEvent*);
246 virtual void dragEnterEvent(QDragEnterEvent*);
248 virtual void dragMoveEvent(QDragMoveEvent*);
250 virtual void dragLeaveEvent(QDragLeaveEvent*);
252 virtual void dropEvent(QDropEvent*);
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.