generateing TCL

Will Schroeder will.schroeder at kitware.com
Fri Mar 10 05:56:49 EST 2000


Hi Christoph-

The wrapper code has to parse C++. This isn't easy, and the wrap code was 
designed to handle the conservative usage of C++ that is the style in vtk. 
For example, the line

>float value_a, value_b;

will not wrap because the wrapper generator expects one variable per line. 
And I'm pretty sure it will not handle templates.

To work around this, we use the escape mechanism to tell the wrapper to 
ignore certain lines. This is done by placing //BTX on a line before the 
code to exclude, and //ETX after. (See graphics/vtkStreamer.h for an 
example.) Like so:

from vtkComplicatedCode.h:
//BTX
wow, real fancy stuff
//ETX

We have talked about going to the open source SWIG wrapper generator. Last 
we checked, there were some issues (handling Set/Get macros, creating 
inheritance information in the wrappers, etc.) In the longer term, this 
might be the way to go, and we would certainly welcome any help here.

Will

At 11:07 AM 3/10/2000 +0100, Christoph Schubert wrote:
> >
> > I finally got vtk to generate a valid Makefile for my local build
> > directory, however, now I'm having trouble because of the fact that vtk
> > can't seem to parse my derived classes to generate the tcl wrappers.  Is
> > there anything special that must be done to allow the vtkWrapTcl binary to
> > do it's job?  Currently it returns just the criptic message:
>
>I had problems with multible variables-declarations in one line, such
>as:
>
>float value_a, value_b;
>
>and templates:
>
>vector<float*> time;
>
>I was able to work around this by using seperate lines of code to
>declare the
>variables und using typedefs for the templates. e.g.
>
>float value_a;
>float value_b;
>
>typedef vector<float*> VecFloat;
>VecFloat time;
>
>
>I hope this may help -- Christoph
>

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list