[vtkusers] VTK Interactor problem

Phys1k3r florian.schiffers at physik.uni-erlangen.de
Tue Aug 20 08:59:36 EDT 2013


Hello,

I have written a vtk-programm that allows me to display a 3D data set (VTK
and QT). Additonally you can interact with the 3D Data with
'RightButtonPressEvent' and 'MiddleButtonPressEvent'. Both interaction are
point picker interactions.

My problem is, that for example, when I press the 'RightButton' two things
happen at once:

1. Point on 3D Data get's picked
2. Camera is zooming in/out (only when I move mouse during picking, but this
happens from time to time)

The same happens with 'MiddleButtonPressEvent', the objects just get moved
instead.

So basically I want a button on my GUI, where I can choose:
 1. Either Zoom in/out
 2. or pick a point 

As an alternative I would be satisfied with something like this:
 1. Just OnLeftButtonDown() -> Just Zoom/Pan/Spin
 2. OnLeftButtonDown() + KeePressEvent -> Don't zoom, pick point instead

This is how I implemented the 'MiddleButtonPressEventHandling' by now:



I know, this is not the best way, but it worked so far. I propably will
implement it this way in the near future:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MouseEventsObserver

But even when I use the MouseEventsObserver I still have no Idea how
suppress the Zoom/Pan/Spin Events...

Than I thought of this method instead:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MouseEvents

First of all, I don't need (and also don't want) all the features of the
vtkInteractorStyle class like Keypressevents for p, r, s, u, v e (as you can
find them here:
http://www.vtk.org/doc/nightly/html/classvtkInteractorStyle.html at Detailed
Description)

I just need to overwrite 'OnLeftButtonDown', 'OnMiddleButtonDown',
'OnRightButtonDown' etc.

So basically I tried things like this, but they don't work, of course:




Honestly I have no idea how to solve my problem... I also haven't found much
documentary besides the examples.

Thank you for your help, I really appreciate it
Phys1k3r



--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-Interactor-problem-tp5722887.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list