[vtkusers] How can I get mouse position using vtk for displaying DICOM files ??

David Cole david.cole at kitware.com
Mon Aug 8 10:41:29 EDT 2005


There are several ways you could go about getting mouse move events from 
the VTK render window, but here's what you should probably do first:

Look at the code in this file and learn how the AddObserver mechanism works:
Examples/GUI/Win32/vtkMFC/vtkDLG/vtkDLGDlg.cpp

Then use AddObserver with MouseMoveEvent in your MDI application to 
receive a callback when the mouse moves over the vtk window... Your view 
is completely filled with a child window, which is why the normal MFC 
message mapping doesn't apply.


Hope this helps,
David

Łukasz Tutaj wrote:

> Hi vtk Users.
>
> My software displays on a screen DICOM files. I use MFC supporting 
> document/view architecture to provide GUI. I have a problem with 
> getting mouse position in places where picture from DICOM file is 
> displayed. In other places there is no problem because I use standard 
> MFC OnMouseMove function, but when a mouse cursor is above picture 
> there is no response about mouse position. My implementation is very 
> similar to example /Examples/GUI/Win32/vtkMFC/vtkMDI/vtkMDIView.cpp 
> http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/GUI/Win32/vtkMFC/vtkMDI/vtkMDIView.cpp?root=VTK&content-type=text/plain, 
> I only added some code handling DICOM files displaying.
> Thanks from any help.
>
> Łukasz
>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the 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