[vtkusers] VTK Wrapping Problems (once again)

kent williams nkwmailinglists at gmail.com
Wed May 13 11:10:07 EDT 2009


Thanks David.  It's what I guessed.

It didn't matter so much when all VTK wrapping was of VTK classes, and
wasn't really the concern of VTK users.  But with KWWidgets becoming
more commonly in use, isn't it about time there was at least a short
WIKI summary of how VTK Wrapping works?

Whenever I have a problem with the VTK wrapping, I google "vtk tcl
wrap" to try and find some help, and about 1/2 of the pages google
finds are my posts to VTK-Users, asking questions about VTK Wrapping!

On Wed, May 13, 2009 at 9:39 AM, David Cole <david.cole at kitware.com> wrote:
> 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
>
>



More information about the vtkusers mailing list