[vtkusers] Troubles with New() and vtkTypeMacro

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


Thanks, you are right. J

 

But that still does not save the issues with the TypeMacro.  Did I
forget to include something?

 

Kirstin

 

 

Von: Siddharth Vikal [mailto:siddharthvikal at gmail.com] 
Gesendet: Freitag, 24. August 2012 14:29
An: Heidler, Kirstin (GE Oil & Gas)
Betreff: Re: [vtkusers] Troubles with New() and vtkTypeMacro

 

I guess its a typo. It should be vtkKeyPressInteractorStyle instead of
KeyPressInteractorStyle in that line of static ...* New();

regards
Siddharth

On Fri, Aug 24, 2012 at 4:59 PM, Heidler, Kirstin (GE Oil & Gas)
<Kirstin.Heidler at ge.com> wrote:

Hello,

 

I am having some troubles with this header file:

 

#ifndef VTKKEYPRESSINTERACTORSTYLE_H

#define VTKKEYPRESSINTERACTORSTYLE_H

#include <vtkInteractorStyleTrackballCamera.h>

#include <vtkSmartPointer.h>

#include <vtkObjectFactory.h>

#include <vtkPolyData.h>

#include <vtkSetGet.h>

#include <vtkObject.h>

class vtkKeyPressInteractorStyle : public
vtkInteractorStyleTrackballCamera

{

public:

    static KeyPressInteractorStyle* New();

        vtkTypeMacro(vtkKeyPressInteractorStyle,
vtkInteractorStyleTrackballActor);

};

#endif // VTKKEYPRESSINTERACTORSTYLE_H

 

The complier says there is an Error with the New() function. Supposedly
there is a ';' missing before the '*'.

I don't get why though. So this cannot be the source of the error.

With the vtkTypeMacto the IDE(qtCreator) says there is a ';' too many
but on the other hand the compiler says a ';' is missing before the
superclass identifier. Also it says types are missing, so it assumes
int.

 

I cannot understand what else I would need to include for this to work?
I tried including vtkSetGet.h because it is supposed to hold the
definition of vtkTypeMacro.

 

I am pretty sure this a really dumb mistake I made. I copied the code
from here: http://www.vtk.org/Wiki/VTK_Coding_Standards: 
 

class VTK_COMMON_EXPORT vtkBox : public vtkImplicitFunction

{

public:

  vtkTypeMacro(vtkBox,vtkImplicitFunction);

  void PrintSelf(ostream& os, vtkIndent indent);

...

}

 

If I do need to add type definitions which types would it be?

 

Thank you very much,

Kirstin


_______________________________________________
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

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

 

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


More information about the vtkusers mailing list