[vtkusers] Troubles with New() and vtkTypeMacro

Heidler, Kirstin (GE Oil & Gas) Kirstin.Heidler at ge.com
Fri Aug 24 08:59:22 EDT 2012


Tahnk you so much...that was the error.
I hate it when I can't read my own code anymore...  Guess I should go home soon.

-----Ursprüngliche Nachricht-----
Von: David Doria [mailto:daviddoria at gmail.com] 
Gesendet: Freitag, 24. August 2012 14:56
An: Heidler, Kirstin (GE Oil & Gas)
Cc: vtkusers at vtk.org
Betreff: Re: [vtkusers] Troubles with New() and vtkTypeMacro

On Fri, Aug 24, 2012 at 8:33 AM, Heidler, Kirstin (GE Oil & Gas) <Kirstin.Heidler at ge.com> wrote:
> Thanks, you are right. J
>
>
>
> But that still does not save the issues with the TypeMacro.  Did I 
> forget to include something?

You should always try to provide a compilable example of the problem (see http://www.vtk.org/Wiki/VTK/MinimalExample). It helps us debug as quickly as possible. I think the problem here is that you had vtkInteractorStyleTrackballActor in the vtkTypeMacro instead of the parent class vtkInteractorStyleTrackballCamera (see below).

#include <vtkInteractorStyleTrackballCamera.h>
#include <vtkSmartPointer.h>
#include <vtkObjectFactory.h>

class vtkKeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera {
public:
    static vtkKeyPressInteractorStyle* New();
    //vtkTypeMacro(vtkKeyPressInteractorStyle,
vtkInteractorStyleTrackballActor); // errors with this.
    vtkTypeMacro(vtkKeyPressInteractorStyle,
vtkInteractorStyleTrackballCamera); // works correctly };

int main(int , char *[])
{
  return EXIT_SUCCESS;
}

Hope that helps,

David



More information about the vtkusers mailing list