[vtkusers] Instantiation of an InteractorStyle subclass

Cory Quammen cory.quammen at kitware.com
Tue Oct 27 09:55:12 EDT 2015


Lonni,

You probably are missing the vtkStandardNewMacro(<class name>) in the .cxx
file. This defines the New() member function in a vast majority of VTK
classes.

HTH,
Cory

On Tue, Oct 27, 2015 at 9:51 AM, Lonni Besançon <lonni.besancon at gmail.com>
wrote:

> Hello everyone,
>
> While simply trying to re-write one of the classes used in an example code
> of VTK , I decided to subclass vtkInteractorStyle in order to re-create a
> class very similar to vtkInteractorStyleTrackballCamera. Therefore I decide
> to copy/paste the implementation of vtkInteractorStyleTrackballCamera.
>
> However, I noticed in this code that the New() method is not implemented in
> the .cxx file yet the example seems to work just fine. But when I try to
> re-create it with my own version of the trackballcamera I get a Linking
> error on the new method of my own subclass.
>
> I therefore have two questions:
>
> How come the implementation of the New() method is not in the .cxx file?
> How come when I try to do the exact same thing (just copying/pasting and
> changing names) it does not work?
> I am at a loss about these two 'issues'. Hope you can help me figure them
> out.
>
> If you'd rather answer on StackOverflow I created a post  there
> <
> http://stackoverflow.com/questions/33369693/new-implementation-with-vtk-and-subclass
> >
> so you can get rep for your answer.
>
> Thanks in advance,
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Instantiation-of-an-InteractorStyle-subclass-tp5734624.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151027/e20a0951/attachment.html>


More information about the vtkusers mailing list