[vtkusers] Implementing an Activiz derived class

Sean Larkin sean.larkin at lickenbrocktech.com
Thu Jun 2 13:21:34 EDT 2011


I am using Activiz and would like to derive a class from
vtkInteractorStyleTrackballCamera.  I am familiar with how to create a
dericed class in C#, but it doesn't appear to work with Activiz.  For any
member function that I'd like to override I using this syntax:

 

        public override void Rotate()

        {

            if (bRotate)

                base.Rotate();

            else

                base.Spin();

        }

 

In this example I would like to overide the Rotate function and add a switch
to determine whetheror not to rotate or spin.  I think this part of my code
is correct.  The problem that I'm having is the constructor.  If I set up a
default constructor and then call it in my main code with "new", is the
.New() method of the base class called?  I don't think that it is, but I
can't tell.  How could I set up my constructor to call the base classes
New() method?  It seems I need some kind of macro, but I don't think it is
available in Activiz.  If I use the following code in my main class (i.e.
Form1) the Rotate() override method is never called.

 

vStyle = new myClass();

vInteractor.SetInteractorStyle(vStyle);

 

where vInteractor is an instance of vtkRenderWindowInteractor.  Anyone have
any ideas why this doesn't work or how to make it work?

 

Thanks,

Sean

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110602/c54bc28f/attachment.htm>


More information about the vtkusers mailing list