[vtkusers] How to Change Interaction Styles?

David Doria daviddoria at gmail.com
Mon Apr 30 13:05:29 EDT 2012


On Mon, Apr 30, 2012 at 12:43 PM, yarram <somasekhar.vit at gmail.com> wrote:
>
> Hi, I have a render window consisting of objects of VtkVolume and
> VtkAssembly. Intially I set the interaction style to "TrackBall Camera". Now
> what I want is: When I interact with VtkAssembly object alone, interaction
> style should be "TrackBall Actor". Please help me..........
>
> Thanks in advance.......


In this repository: https://github.com/daviddoria/InteractiveBestPatches

I switch between CustomImageStyle and CustomTrackballStyle. Surely
there are many ways to do this, but in this case I store a pointer to
the other style in each one, and switch them (
this->Interactor->SetInteractorStyle(this->OtherStyle);) when
appropriate.

You could also see if you find anything useful in this class:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/StyleSwitch

Good luck,

David



More information about the vtkusers mailing list