[vtkusers] VTK language Wrapping
Andre Barros
andre.cbarros at yahoo.com
Wed Oct 14 08:54:53 EDT 2009
Hi,
I'm trying to fix (it is not working for me, at least) octaviz so that I can use vtk on octave. Digging a bit, I have found that it more or less follow the vtkWrapTcl.c code, but is probably derived from an old version.
Think that it would be wonderful to have bindings for other languages, aside the ones you already provide, i.e. java, c/c++, tcl and python. To accomplish that more easily, it would be nice to have a template where the vtk parse type IDs have a more sensible meanings. For exmaple, I created a small shell script that translate some IDs to what make me more aware of what they really are (see below).
#!/bin/sh
cat $1 | \
sed \
-e 's:\b0x2\b:VTKp_VOID:g' \
-e 's:\b0x3\b:VTKp_CHAR:g' \
-e 's:\b0x13\b:VTKp_UNSIGNED_CHAR:g' \
-e 's:\b0x5\b:VTKp_SHORT:g' \
-e 's:\b0x15\b:VTKp_UNSIGNED_SHORT:g' \
-e 's:\b0x4\b:VTKp_INT:g' \
-e 's:\b0x14\b:VTKp_UNSIGNED_INT:g' \
-e 's:\b0x6\b:VTKp_LONG:g' \
-e 's:\b0x16\b:VTKp_UNSIGNED_LONG:g' \
-e 's:\b0x1\b:VTKp_FLOAT:g' \
-e 's:\b0x7\b:VTKp_DOUBLE:g' \
-e 's:\b0x[Aa]\b:VTKp_ID_TYPE:g' \
-e 's:\b0x1[Aa]\b:VTKp_UNSIGNED + VTKp_ID_TYPE:g' \
-e 's:\b0x[Dd]\b:VTKp_SIGNED_CHAR:g' \
-e 's:\b0x[Bb]\b:VTKp_LONG_LONG:g' \
-e 's:\b0x1[Bb]\b:VTKp_UNSIGNED_LONG_LONG:g' \
-e 's:\b0x[Cc]\b:VTKp___INT64:g' \
-e 's:\b0x1[Cc]\b:VTKp_UNSIGNED___INT64:g' \
-e 's:\b0x[Ee]\b:VTKp_BOOLEAN:g' \
\
-e 's:\b0x\([369]\)02\b:VTK__\1_ + VTKp_VOID:g' \
-e 's:\b0x\([369]\)03\b:VTK__\1_ + VTKp_CHAR:g' \
-e 's:\b0x\([369]\)13\b:VTK__\1_ + VTKp_UNSIGNED_CHAR:g' \
-e 's:\b0x\([369]\)05\b:VTK__\1_ + VTKp_SHORT:g' \
-e 's:\b0x\([369]\)15\b:VTK__\1_ + VTKp_UNSIGNED_SHORT:g' \
-e 's:\b0x\([369]\)04\b:VTK__\1_ + VTKp_INT:g' \
-e 's:\b0x\([369]\)14\b:VTK__\1_ + VTKp_UNSIGNED_INT:g' \
-e 's:\b0x\([369]\)06\b:VTK__\1_ + VTKp_LONG:g' \
-e 's:\b0x\([369]\)16\b:VTK__\1_ + VTKp_UNSIGNED_LONG:g' \
-e 's:\b0x\([369]\)01\b:VTK__\1_ + VTKp_FLOAT:g' \
-e 's:\b0x\([369]\)07\b:VTK__\1_ + VTKp_DOUBLE:g' \
-e 's:\b0x\([369]\)0[Aa]\b:VTK__\1_ + VTKp_ID_TYPE:g' \
-e 's:\b0x\([369]\)1[Aa]\b:VTK__\1_ + VTKp_UNSIGNED + VTKp_ID_TYPE:g' \
-e 's:\b0x\([369]\)0[Dd]\b:VTK__\1_ + VTKp_SIGNED_CHAR:g' \
-e 's:\b0x\([369]\)0[Bb]\b:VTK__\1_ + VTKp_LONG_LONG:g' \
-e 's:\b0x\([369]\)1[Bb]\b:VTK__\1_ + VTKp_UNSIGNED_LONG_LONG:g' \
-e 's:\b0x\([369]\)0[Cc]\b:VTK__\1_ + VTKp___INT64:g' \
-e 's:\b0x\([369]\)1[Cc]\b:VTK__\1_ + VTKp_UNSIGNED___INT64:g' \
-e 's:\b0x\([369]\)0[Ee]\b:VTK__\1_ + VTKp_BOOLEAN:g' \
-e 's:VTK__3_:VTKp_VECTOR:g; s:VTK__6_:VTKp_MATRIX:g; s:VTK__9_:VTKp_TENSOR:g;'
Note: I'm using VKTp_* and not VTK_* (as found on vtkType.h). The numerical hex values I took from vtParse.y .
I'm still working on it (octaviz fix) but, of course, would prefer to work on a kind of "official" template, if available, where the ID values could be grabbed from a "stable" include file.
Suggestions?
Best regards,
Andre
More information about the vtkusers
mailing list