Hi,

I highly recommend to use the MITK interaction instead [1]. All the interaction 
in the MITK Workbench is done like this and it blends in well with all the 
other interactions in the application. You can easily access the mouse position 
through mitk::InteractionPositionEvent. Find some examples in the MITK source 
code. Look for the "resource/Interactions" and "src/Interactions" directories 
of modules, i. e. the BoundingShape module contains all the interaction for the 
Image Cropper plugin, in which you can modify and move a box in the render 
windows. There should be much smaller examples in the MITK source code as well.


Best,

Stefan


[1] http://docs.mitk.org/2016.11/DataInteractionPage.html

________________________________
Von: LOPEZ VELAZCO, ROCIO <rocio.lo...@upf.edu>
Gesendet: Montag, 19. Februar 2018 13:00
An: mitk-users@lists.sourceforge.net
Betreff: [mitk-users] vtkRenderWindowInteractor and LeftButtonPressEvent

Hello,

I am trying to simulate a virtual camera in a QmitkRenderWindow, the camera is 
fixed to the tip of a pointer object. I would like to modify the 
vtkRenderWindowInteractor so that  modify the position of my object (and thus 
the camera as well) only by using the 2D coordinates the mouse sends(left 
button clicked), let's call it mouse navigation.

I can access the vtkRenderWindowInteractor, but I don't know how to access the 
mouse clicked event and most important take the positions in the 3D world 
coordinates. I read about this in Display Geometry 
Interactor<http://mitk.org/wiki/Display_Geometry_Interaction_Project>, and 
looking at the RenderWindowInteractor 
documentation<https://www.vtk.org/doc/nightly/html/classvtkRenderWindowInteractor.html#ac0824fe498c523664ef739202cfc679f>
 I saw 
LeftButtonPressEvent<https://www.vtk.org/doc/nightly/html/classvtkRenderWindowInteractor.html#ac0824fe498c523664ef739202cfc679f>
 () that needs SetEventInformation() call.

I am not sure how to use SetEventInformation() funcion... I guess I have to 
pass it the x and y display positions once clicked but if it "should be called 
just prior to" 
LeftButtonPressEvent<https://www.vtk.org/doc/nightly/html/classvtkRenderWindowInteractor.html#ac0824fe498c523664ef739202cfc679f>
 () it confuses me.
Once I got the x and y positions I would do my computations so that move my 
object and the camera.

I would be grateful if you could give me some tip! I don't know if this is the 
best way to achieve my objective or there is a better one.

If it is not clear what I am asking feel free to make any question :)

Thank you very much in advance.

Best regards,

Rocío

--

Rocío López Velazco

SimbioSYS group, BCN MedTech

UniversityPompeu Fabra

Department of Information and Communication Technologies
Roc Boronat, 122 (Tànger Building),  08018 Barcelona
Office 55 119
https://bcn-medtech.upf.edu/


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to