[vtkusers] VTK Interactor problem

Alex Malyushytskyy alexmalvtk at gmail.com
Tue Aug 20 22:04:37 EDT 2013


I just want to add thet currently set . vtkInteractorStyle is defining
which events are handled and how.
So subclassing and overriding appropriate functionality is way to go.
Also you can create multiple vtkInteractorStyle and set them active
according to your needs.

Hope this helps.

Alex


On Tue, Aug 20, 2013 at 4:08 PM, Alex Malyushytskyy <alexmalvtk at gmail.com>wrote:

> Subclass vtkInteractorStyle (or derived class ) you are using.
>
> All the operations: rotation, calls as results on Keypressevents are
> initiated there.
> Depending on the actual subclass of vtkInteractorStyle things what you
> need to do are different,
> For example to suppress Keypressevents for vtkInteractorStyleRubberBand
> subclass you can just override
> void vtkInteractorStyleRubberBand::OnChar() to do nothing.
>
> Regards,
>      Alex
>
>
> On Tue, Aug 20, 2013 at 5:59 AM, Phys1k3r <
> florian.schiffers at physik.uni-erlangen.de> wrote:
>
>> 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.
>> _______________________________________________
>> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130820/0458384a/attachment.htm>


More information about the vtkusers mailing list