[vtkusers] vtkImageSlice and vtkImageReslice Mapper

Sahithya Wintrich s.prakash at csuohio.edu
Sat Nov 10 09:00:08 EST 2012


I have two styles in my program:
1) vtkInteractorStyleImage and
2) Mouse and KeyPress interactor style.

Setting "SetInteractionModeToImageSlicing()" on the vtkInteractorStyleImage
alone produces the result of what I want. However, adding the mouse and
keypress style overrides the vtkInteractorStyleImage and introduces what
looks like a 2D slice with rotation. I would like to disable that. Would
have my mouse and keypress class inherit from both
vtkInteractorStyleTrackballCamera and vtkInteractorStyleImage solve this
issue? (relevant code below)

   vtkSmartPointer<vtkInteractorStyleImage> style = vtkSmartPointer<
vtkInteractorStyleImage>::New();
   style->SetInteractionModeToImageSlicing();

   //create an instance of the mouse and keypress style interactor
    vtkSmartPointer<Interaction> mouseStyle =
vtkSmartPointer<Interaction>::New();
    mouseStyle->SetDefaultRenderer(renderer);

    iren->SetInteractorStyle(style);
    iren->SetInteractorStyle( mouseStyle );

    renderWindow->SetInteractor(iren);

    renderWindow->Render();

    vtkSmartPointer<vtkCamera> camera = renderer->GetActiveCamera();
    camera->ParallelProjectionOn();

    renderer->ResetCameraClippingRange();
    renderWindow->Render();


    iren->Start();
    return EXIT_SUCCESS;

Sahithya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121110/23cf2f1a/attachment.htm>


More information about the vtkusers mailing list