[vtkusers] vtkInteractorStyle : inherit from two vtkInteractorStyle

David Doria daviddoria at gmail.com
Thu Mar 24 07:47:00 EDT 2011


> For example, for my Rotate() function, if I want to call
> "vtkInteractorStyleTrackballActor::Spin()" AND I'm not inheriting from
> vtkInteractorStyleTrackballActor, I'll have to copy its code manually or is
> there another way to call this function ?

What about something like (and of course, this is really annoying, but
it could be better than the copy and paste solution you suggested):

1) create a vtkInteractorStyleTrackballActor member inside your custom
interactor style
2) deep copy the "this" pointer into the vtkInteractorStyleTrackballActor member
3) call Spin() on the vtkInteractorStyleTrackballActor member
4) deep copy the vtkInteractorStyleTrackballActor member back into "this"

Any better ideas?

David



More information about the vtkusers mailing list