[vtkusers] Interacting with Actor2D?

David Gobbi david.gobbi at gmail.com
Wed Oct 21 19:46:51 EDT 2009


On Wed, Oct 21, 2009 at 5:24 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> I am trying to figure out why someone should use vtkImageViewer2 vs
> just a normal ImageActor. Here are two things that simply load an
> image into a render window:
> http://www.rpi.edu/~doriad/VTK_List/ImageActor/
>
> The only difference is that in the NormalImageActor.cpp case the left
> mouse button rotates the image out of plane, which you both
> recommended fixing by deriving a new style. Is there any advantage of
> one of these over the other? The documentation says ImageViewer2 is
> simply a convenience class, so maybe the function of these two
> examples is identical? Am I using ImageViewer2 properly by giving it a
> RenderWindowInteractor? If that is not provided, both of these methods
> would simply render a static, non-interact-able image to the screen?

AFAIK the only reason to use vtkImageViewer2 is if you want a
quick-and-dirty way to display a static image.  It's used a lot in the
tests and the examples for that reason.  For interaction, though, it's
best to stick with the usual VTK way of doing things: with actors,
renderers, and renderwindows.  That way the same basic paradigms apply
regardless of what kind of data you are dealing with.

   David



More information about the vtkusers mailing list