[vtkusers] QT and vtkMouse interaction
Alex Malyushytskyy
alexmalvtk at gmail.com
Tue Oct 2 19:30:41 EDT 2012
Override interactor style most suitable for you and set it to
QVTKWidget interactor
If you need to get pointer to interactor,
use QVTKWidget GetRenderWindow()->GetInteractor():
this->GetRenderWindow()->GetInteractor()->SetInteractorStyle(
m_ViewModelInteractorStyle );
You may find vtkEventQtSlotConnect useful if you want qt slot be
called as a result of vtk event
vtkSmartPointer<vtkEventQtSlotConnect> Connections;
....
Connections = vtkSmartPointer<vtkEventQtSlotConnect>::New();
// connect window enter event to radio button slot
Connections->Connect( this->GetRenderWindow()->GetInteractor(),
vtkCommand::EndPickEvent, this, SLOT( onEndPickEvent() ));
Connections->Connect( this->GetRenderWindow()->GetInteractor(),
vtkCommand::StartPickEvent, this, SLOT( onStartPickEvent() ));
Connections->Connect(
this->GetRenderWindow()->GetInteractor()->GetInteractorStyle(),
InteractionModeSetStartEvent, this, SLOT(
onInteractionModeChangedByInteractor() ));
Connections->Connect(
this->GetRenderWindow()->GetInteractor()->GetInteractorStyle(),
BoxZoomEndEvent, this, SLOT( onEndZoomEvent() ));
Or you can use callbacks if you prefer non C++ mechanics as usually.
Alex
On Tue, Oct 2, 2012 at 4:46 AM, cerina <cerine-baratelli at hotmail.fr> wrote:
> Hi all,
> Is there any body, who succeeded in using the vtkMouseInteraction in a QT
> application!!! i want to use it in this vtk example:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance
> <http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance>
>
> Well, i didn't know where shall i make the MouseInteractorStyle class
> exactly in order to call it in the definition of the
> vtkRenderWindowInteractor.
>
> Thanks for every suggestion
>
> Regards.
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/QT-and-vtkMouse-interaction-tp5716395.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list