[vtkusers] vtkInteractorStyle : inherit from two vtkInteractorStyle

nsarrasin nsarrasin at phenix-systems.com
Wed Mar 23 13:04:45 EDT 2011


hi all,

I am building my own vtkInteractorStyle for my vtkRenderWindow.

I have first inherited from vtkInteractorStyleTrackballActor to be able to
rotate each actor independently.
Then I call Spin() instead of Rotate() to constrain the rotation to be in
the plane view.

Here is my working code :

class myInteractor : public vtkInteractorStyleTrackballActor
{
  public:
 
    static myInteractor * New();
    vtkTypeRevisionMacro(myInteractor , vtkInteractorStyleTrackballActor);
 
    myInteractor () :
    { 
    }

    virtual void Rotate()
    {
        vtkInteractorStyleTrackballActor::Spin();
    }
};
vtkCxxRevisionMacro(myInteractor , "$Revision: 1.1 $");
vtkStandardNewMacro(myInteractor );

Now I would like to add a "Zoom all the actor together" function.
This function doesn't exist in vtkInteractorStyleTrackballActor (where it is
"Zoom one actor at time") but in other style like
vtkInteractorStyleTrackballCamera for example.

So I was thinking of inheriting from a second InteractorStyle but I don't
know how to proceed with vtkTypeRevisionMacro which only takes two
arguments.

How can I manage my problem ?
Maybe it's not the right way to do ? 

Thanks by advance for reading/helping me.

Nicolas.

--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkInteractorStyle-inherit-from-two-vtkInteractorStyle-tp4259126p4259126.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list