[vtkusers] Wrapping VTK

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Thu Apr 12 20:02:27 EDT 2001


>
> > My Tcl/Tk code currently calls the vtktcl.dll using the "Load" command and
> > works
> > fine in an "un-wrapped" state.  However, the research I've done says this
> > won't work
> > for a wrapped application, but I'm not sure how it should be done.  The
> > users manual

There are two functions vtkTclInit and vtkTkAppInit (names might be 
slightly different, I'm writing from memory) which are called when you
catch load vtkdll.dll or vtktcl.dll
These functions create the "commands" which tcl sees as c++ objects and 
members etc.
What you have to do, is load the vtk and tcl dlls yourself. Then init them 
by forcing these functions to be called. Look at the file vtktcl.cxx 
generated by PCmaker (and BvtkCxxWizard).

This does a tclCreateCommand .... for every vtkObject derivative thats 
wrapped and hey presto off you go.

There are a load of support functions embedded in the vtk tcl stuff which 
maintain lists of created objects and names etc, but the main one is to 
create the commands. Once that's done, you can start writing scripts and 
calling vtk objects.

JB





More information about the vtkusers mailing list