[vtkusers] VTK Wrapping Problems (once again)

David Cole david.cole at kitware.com
Wed May 13 10:39:21 EDT 2009


One of the assumptions in VTK wrapping is that the class name is the same as
the header file name and that there is only the one class in the header
file.

If you want both classes wrapped, each should be in its own header file of
the same name.


HTH,
David


On Wed, May 13, 2009 at 10:36 AM, kent williams
<nkwmailinglists at gmail.com>wrote:

> I wouldn't even use VTK wrapping at all if it wasn't integral to
> KWWidgets.  Not that it's horrible, but sometimes I get frustrated by
> how touchy it is, how uninformative its error messages are, and how
> completely un-documented it is.
>
> Below is a header file I'm trying to compile.  As far as I know I'm
> following all the VTK wrapping rules, but it gives me this message:
> *** SYNTAX ERROR found in parsing the header file
> /scratch/kent/BT/BRAINSTracer/vtkBTPointSetWidget.h before line 30 ***
>
> Which is the first line of the second class defined. The only problem
> I can see -- possibly -- is that it objects to trying to wrap two
> classes in one file.  Is THAT not permitted? It seems like I've done
> that before and it worked out.  If I put //BTX-//ETX around the whole
> vtkBTPointWidget class, it doesn't throw the error
>
> And yes, I'm calling these 'Widgets' even though they don't derive
> from vtkAbstractWidget; I'm not sure what I gain by doing that, and
> I'm a little scared about what it might entail to do so directly.
>
> --------------------------------------------------------------------------------------------------vtkBTPointSetWidget.h-----------------------------------------------------------------------------------------------
> #if !defined(vtkBTPointSetWidget_h)
> #define vtkBTPointSetWidget_h
> #include <vtkObject.h>
> #include <string>
>
> class vtkViewImage;
>
> class vtkBTPointWidget : public vtkObject
> {
> public:
> //BTX
>  static vtkBTPointWidget *New();
>  vtkTypeRevisionMacro(vtkBTPointWidget,vtkObject);
>  void SetView(unsigned i,  vtkViewImage *view);
>  std::string GetName();
>  void SetName(const std::string &name);
> //ETX
>  void Create();
>  void Hide();
>  void Show();
>  void Disable();
>  void Enable();
> private:
> //BTX
>  std::string m_Name;
>  vtkViewImage *m_View[4];
> //ETX
> };
>
> class vtkBTPointSetWidget : public vtkObject
> {
> public:
>  //BTX
>  vtkTypeRevisionMacro(vtkBTPointSetWidget,vtkObject);
>  typedef vtkObject SuperClass;
>  const std::string &GetName();
>  void SetName(const std::string &name);
>  //ETX
>  static vtkBTPointSetWidget *New();
>  void Create();
>  void Hide();
>  void Show();
>  void Disable();
>  void Enable();
>  void AddPoint();
>  //BTX
>  void SetView(unsigned i,  vtkViewImage *view);
>  //ETX
> private:
>  //BTX
>  vtkViewImage *m_View[4];
>  std::string m_Name;
>  //ETX
> };
> #endif // vtkBTPointSetWidget_h
> _______________________________________________
> 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/20090513/554cd06c/attachment.htm>


More information about the vtkusers mailing list