[vtkusers] vtk and python - some questions.

David Gobbi dgobbi at irus.rri.on.ca
Wed Oct 25 09:59:02 EDT 2000

On Tue, 24 Oct 2000, Sebastien BARRE wrote:
> For example, it'd be nice to include some typedef's in VTK so that 
> functions could provide semantic clues about their parameters.
> Say, for example :
>    void SetColor(rgbcolor c)
>    void SetAngle(angle_d a)
> instead of :
>    void SetColor(float a[3])
>    void SetAngle(float a)
> where rgbcolor would be something like a typedef to an array of 3 float, 
> and angle_d just a typedef to a float.
> The idea behind this is to provide a wrapper or a parser that would dump an 
> XML description of the VTK API. This XML tree would include the fact that 
> these functions manipulate RGB colors or angle in degrees (a kind of hint). 
> I guess this would for example greatly help making GUI's : instead of hand 
> coding the numerous cases where a function should use a specific widget 
> (color chooser, or angle representation) this could be generated automatically.
> I introduced this XML wrapper idea some time ago in the "GUI [demo]" 
> discussion, but I had no time to work on it, sorry.
> This also imply a lot of search/replace stuff :) I'm not sure VTK authors 
> are very permissive about massive changes :)) (as we get no feedback 
> regarding the 3 or 4 lines that one could add to each VTK .cxx files to 
> speed up compilation time by a factor of 2 or 3 using precompiled headers).

I brought up a similar suggestion a few months ago, but using typedefs for
return types (i.e. 'vtkfloat4' instead of just 'float *'), specifically so
that the 'hints' file could be eliminated.  The feeling I got from Ken
Martin was that large changes like that were fine as long as 1) they were
well thought-out and 2) a large number of people agreed that the change
was a good idea.  

I, for one, think that typedefs are a good idea as they are applied _very
consistently_, i.e. someone has to put together a detailed list of all
the typedefs that will be used (as well as rules for adding new ones in
the future) and a bunch of us have to agree on them.

 - David

More information about the vtkusers mailing list