[vtkusers] Chart: coordinate conversions

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Dec 24 11:41:27 EST 2010


On Fri, Dec 24, 2010 at 2:11 AM, nclemeur <nclemeur at gmail.com> wrote:
>
> Hello,
>
> Is there an easy way to convert the coordinate contained in a
> vtkContextMouseEvent into the world coordinate for a vtkChartXY. I have
> tried using the static method
> vtkInteractorObserver::ComputeDisplayToWorld(...) which seemd to be the
> recommended way for normal 3D object. But it does not seems to work (ie the
> value are not really the ones I am expecting).
>
I am not clear about which world coordinates you mean - pixel
coordinates in screen space? The vtkContextMouseEvent object contains
the item position (Pos), then the Scene and Screen positions, see,

http://www.vtk.org/doc/nightly/html/classvtkContextMouseEvent.html

It also contains the last position of each of the above. You can of
course use the 2D transforms, but in many cases there is no need.

Marcus



More information about the vtkusers mailing list