[vtkusers] vtkInteractorStyleImage::SetImageOrientation

David Gobbi david.gobbi at gmail.com
Thu Sep 1 12:03:40 EDT 2011


On Thu, Sep 1, 2011 at 9:36 AM, David Doria <daviddoria at gmail.com> wrote:
>
> Hm, is there something wrong with the order I am doing these things
> in? I set the current renderer of the style before adding the style to
> the interactor - is that not correct? The behavior has not seemed to
> change at all:

There are just a couple things out of order:

Move the renderWindowInteractor->SetInteractorStyle( style ); line to
immediately after the line where you create the style.  You shouldn't
be calling any action methods on the style until you have connected it
to the interactor.

Don't call style->SetImageOrientation(leftToRight, bottomToTop); until
after you have called ResetCamera().  The call to ResetCamera() moves
the FocalPoint to the center of the data set, and it is usually best
to do this centering first, before doing anything else to the camera.
Having the data set centered ensures that the clipping range can be
properly computed.

Also the first call to ResetCamera (the one after AddViewProp) can be
removed, since you have added a ResetCamera later in the file.

 - David



More information about the vtkusers mailing list