vtkImageWindowInteractor ?

Roland Schwarz roland.schwarz at telecom.at
Tue Sep 21 13:56:25 EDT 1999


Hello Goodwin,
>
>As far as I can see, there is no comfortable way to user interaction
>with vtkImageWindow. Before I try to patch vtkRenderWindowInteractor
>-- can anybody tell me if I am right?
>
>I need to obtain mouse positions in an image window when the user
>presses a button.
>


I have ran into the same kind of question. As I am developing for
MS-Windows I choosed to make the vtkImageWindow GDI compatible.

What I mean is this: GDI has a scaling and panning mode. (ViewportOrg,
WindowOrg, ViewportExt and WindowExt). This is also known as logical and
device coordinate system. What I did is overriding vtkOpenGLImageWindow,
vtkOpenGLImager and vtkOpenGLImageMapper to evaluate the device
context, set up a OpenGL compatible (temporary) device context and set
the sacling mode of OpenGL in such a way, that vtkImages are drawn
using this transformation.

The effect is such that you can ImageWindow->Render(), and after that use
the same coordinate system to use GDI draw commands to draw over this
surface. Also setting ViewportOrg and ViewportExt,... results in a scaled
and
panned vtk-image. Mouse positions simply reflect image coordinates by
passing them through the windows DPtoLP() function.

I have successfully used the MFC CScrollView class to interact with the
image
window.

The main question is wether my interface design is good. You mentioned
vtkImageWindowInteractor butI think this is only part of the story. All
coordinate
calculation is done in vtkImageMapper and vtkImager (and derived) classes.
So this is really what must be modified.

I would like to  see an operating system independent implementation.

If you like we can further discuss this topic and/or share code.

Regards,
Roland Schwarz
Business Email: RSchwarz at riegl.co.at
Private Email: roland.schwarz at telecom.at




-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list