NorMIT-nav
2023.01.05-dev+develop.0da12
An IGT application
|
QVTKWidget displays a VTK window in a Qt window. More...
#include <cxQVTKWidget.h>
Public Types | |
enum | vtkCustomEvents { ContextMenuEvent = QVTKInteractor::ContextMenuEvent, DragEnterEvent = QVTKInteractor::DragEnterEvent, DragMoveEvent = QVTKInteractor::DragMoveEvent, DragLeaveEvent = QVTKInteractor::DragLeaveEvent, DropEvent = QVTKInteractor::DropEvent } |
Signals | |
void | mouseEvent (QMouseEvent *event) |
Public Member Functions | |
CXQVTKWidget (QWidget *parent=NULL, Qt::WindowFlags f=0) | |
constructor More... | |
virtual | ~CXQVTKWidget () |
destructor More... | |
virtual void | SetRenderWindow (vtkRenderWindow *) |
virtual vtkRenderWindow * | GetRenderWindow () |
virtual QVTKInteractor * | GetInteractor () |
virtual void | showEvent (QShowEvent *) |
void | SetUseTDx (bool useTDx) |
bool | GetUseTDx () const |
Protected Member Functions | |
QPaintEngine * | paintEngine () |
virtual void | resizeEvent (QResizeEvent *event) |
virtual void | moveEvent (QMoveEvent *event) |
virtual void | paintEvent (QPaintEvent *event) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | enterEvent (QEvent *) |
virtual void | leaveEvent (QEvent *) |
virtual void | wheelEvent (QWheelEvent *) |
virtual void | focusInEvent (QFocusEvent *) |
virtual void | focusOutEvent (QFocusEvent *) |
bool | event (QEvent *e) |
virtual void | contextMenuEvent (QContextMenuEvent *) |
virtual void | dragEnterEvent (QDragEnterEvent *) |
virtual void | dragMoveEvent (QDragMoveEvent *) |
virtual void | dragLeaveEvent (QDragLeaveEvent *) |
virtual void | dropEvent (QDropEvent *) |
void | x11_setup_window () |
Protected Attributes | |
vtkRenderWindow * | mRenWin |
bool | UseTDx |
QVTKInteractorAdapter * | mIrenAdapter |
QVTKWidget displays a VTK window in a Qt window.
Definition at line 56 of file cxQVTKWidget.h.
Enumerator | |
---|---|
ContextMenuEvent | |
DragEnterEvent | |
DragMoveEvent | |
DragLeaveEvent | |
DropEvent |
Definition at line 81 of file cxQVTKWidget.h.
CXQVTKWidget::CXQVTKWidget | ( | QWidget * | p = NULL , |
Qt::WindowFlags | f = 0 |
||
) |
|
virtual |
|
protectedvirtual |
Definition at line 495 of file cxQVTKWidget.cpp.
|
protectedvirtual |
Definition at line 503 of file cxQVTKWidget.cpp.
|
protectedvirtual |
Definition at line 519 of file cxQVTKWidget.cpp.
|
protectedvirtual |
Definition at line 511 of file cxQVTKWidget.cpp.
|
protectedvirtual |
Definition at line 527 of file cxQVTKWidget.cpp.
|
protectedvirtual |
handle enter event
Definition at line 411 of file cxQVTKWidget.cpp.
|
protected |
overloaded Qt's event handler to capture additional keys that Qt has default behavior for (for example the Tab and Shift-Tab key)
Definition at line 252 of file cxQVTKWidget.cpp.
|
protectedvirtual |
Definition at line 470 of file cxQVTKWidget.cpp.
|
protectedvirtual |
Definition at line 482 of file cxQVTKWidget.cpp.
|
virtual |
get the Qt/VTK interactor
Definition at line 242 of file cxQVTKWidget.cpp.
|
virtual |
get the render window
Definition at line 142 of file cxQVTKWidget.cpp.
bool CXQVTKWidget::GetUseTDx | ( | ) | const |
Definition at line 135 of file cxQVTKWidget.cpp.
|
protectedvirtual |
handle key press event
Definition at line 444 of file cxQVTKWidget.cpp.
|
protectedvirtual |
handle key release event
Definition at line 454 of file cxQVTKWidget.cpp.
|
protectedvirtual |
handle leave event
Definition at line 421 of file cxQVTKWidget.cpp.
|
signal |
|
protectedvirtual |
handle mouse move event
Definition at line 397 of file cxQVTKWidget.cpp.
|
protectedvirtual |
handle paint event / void CXQVTKWidget::paintEvent(QPaintEvent* ) { std::cout << "******************** paintEvent " << this << std::endl; std::cout << " xy= " << this->x() << ", " << this->y() << " \t wh= " << this->width() << ", " << this->height() << std::endl; vtkRenderWindowInteractor* iren = NULL; if(this->mRenWin) { iren = this->mRenWin->GetInteractor(); }
if(!iren || !iren->GetEnabled()) { return; }
std::cout << "******************** paintEvent into" << std::endl;
iren->Render();
// In Qt 4.1+ let's support redirected painting // if redirected, let's grab the image from VTK, and paint it to the device QPaintDevice* device = QPainter::redirected(this); if(device != NULL && device != this) { int w = this->width(); int h = this->height(); QImage img(w, h, QImage::Format_RGB32); vtkUnsignedCharArray* pixels = vtkUnsignedCharArray::New(); pixels->SetArray(img.bits(), w*h*4, 1); this->mRenWin->GetRGBACharPixelData(0, 0, w-1, h-1, 1, pixels); pixels->Delete(); img = img.rgbSwapped(); img = img.mirrored();
QPainter painter(this); painter.drawImage(QPointF(0.0,0.0), img); return; } }
/*! handle mouse press event
Definition at line 382 of file cxQVTKWidget.cpp.
|
protectedvirtual |
handle mouse release event
Definition at line 431 of file cxQVTKWidget.cpp.
|
protectedvirtual |
Definition at line 323 of file cxQVTKWidget.cpp.
|
inlineprotected |
Definition at line 123 of file cxQVTKWidget.h.
|
protectedvirtual |
|
protectedvirtual |
handle resize event
Definition at line 300 of file cxQVTKWidget.cpp.
|
virtual |
set the render window this will bind a VTK window with the Qt window it'll also replace an existing VTK window
Definition at line 159 of file cxQVTKWidget.cpp.
void CXQVTKWidget::SetUseTDx | ( | bool | useTDx | ) |
Definition at line 108 of file cxQVTKWidget.cpp.
|
virtual |
Definition at line 535 of file cxQVTKWidget.cpp.
|
protectedvirtual |
Definition at line 462 of file cxQVTKWidget.cpp.
|
protected |
Definition at line 566 of file cxQVTKWidget.cpp.
|
protected |
Definition at line 182 of file cxQVTKWidget.h.
|
protected |
Definition at line 169 of file cxQVTKWidget.h.
|
protected |
Definition at line 170 of file cxQVTKWidget.h.