vtkWrapMacro

John Biddiscombe j.biddiscombe at rl.ac.uk
Mon Apr 3 11:05:36 EDT 2000


>Basically,
>it needs a complete re-write.   I wanted to generate microsoft
>project files instead of nmake files.  If I had the time, I think
>it would only take a week or so.

I've rewritten the whole thing as a Borland CBuilder project. it outputs
MAKE compatible files (at least compatible with borland). It's intended for
my own wrapping as I'm adding automatic GUI generation to all the concrete
classes and tcl scripts will be intercepted to return graphical
pipelines...but there is a chunk which
scans makefile.in files
make list of classes
uses a 
struct sourcefile {
...
}
which has flags for concrete/header etc etc

and then calls a makefile generator which is general purpose. (acccepts
list of dependency files and list of include dirs and list of lib dirs etc
etc)

Absolutely not Microsoft project compatible so I doubt you can use any of
the nice GUI, but the core may be useful.

 
>Please do not check in your typemacro.   It uses the ansi typeid stuff,

No no. See below

>I do have one question about it, where does the thisClass come from?
>I thought that the typeid stuff needed an object pointer.  Right now
>in VTK if you have a pointer to an object you can ask if it inherits
>from another object.

the function is static
static thisClass::InheritsFrom("Classname");

it can be used to say
"Does vtkCell descend from vtkObject"

pointers to actual instances are never touched. It's standard C++. No Ansi
typeid used. Its useful to me because each drag/drop point in my graphical
pipeline will accept a certain type...(eg locator). if a filter output is
undefined currently I have to do

if (droptype==POINTSET) {
	if (drag==VTK_POLYDATA) || (drag==VTK_UNSTRUCTREDGRID)....etc etc
very tedious for vtkDataSet!

instead I can pass the address of 
	InheritsFromFunction = @vtkPolyData::InheritsFrom

with the dragging object and in the drop zone test
if InheritsFromFunction("vtkPointSet");

which will work for All descendents of vtkPointset with a single call. No
actual object pointers are used, just a class member address which is
called to test compatibility.
It makes it easier for me to mix drag/drop of
datasets/locators/PathprofileGenerators/TestPointGenerators and many more
of my own filter types. 
[ really I'd like to make Processes derive from DataObject!!! Now that
would be real fun - filters that generate locators and filters and not just
datasets - I'll get my coat]

---

>1. getclasses/pcmaker needs a re-write with changes so the Makefiles and
>not hard coded lists of classes from getclasses.cxx determine X11 or Win32 
>files.  If you are interested, I can work on this redesign with you.
>As I have already started the design,  but have not had time to 
>implement the it, I would welcome some help.

Well, I've pretty much already done it. Except that I use manual entering
of info rather than fetching it all from the makefil.in files. I would
welcome changes which improve this (hence my original post).

I'll post again in a while when I've got it all working smoothly. I'm still
a bit muddled down with all the tcl wrapping and need to tidy some stuff
up. I'm using the wrapping provided by the vtk wrap tcl exe in pcmaker, but
bodging it into my own makefiles and I'd like to interface the code in the
wrapping stuff directly to my shell because I dont' want to wrap any non
concrete classes and I get the impresion it currently does. I also need to
intercept the CommandNew() functions to create the GUI boxes and jam the
process into them.


>2. The typeid stuff can not go into VTK because of older compilers.

no problemo. I wasn't intending to add my macro, just wondering if it was
useful beyond my scope...


ttfn

John B




More information about the vtk-developers mailing list