[vtkusers] Using ProgrammableSource with new dataset types

David Duke D.Duke at bath.ac.uk
Fri Aug 17 12:05:44 EDT 2001


Hi,

I've been working with graphs (as in sets of nodes and edges), represented 
in the pipeline as vtkPolyData objects.  I can read graph data from a file 
using vtkProgrammableSource, and that works fine.  However, I've created a 
subtype of PolyData to provide higher-level interfaces and graph 
operations.  What I'd *like* to do is continue to use the 
ProgrammableSource callback with a Tcl procedure, but with the new object 
type, along these lines:

vtkProgrammableSource reader
   reader SetExecuteMethod readGraph

proc readGraph {} {
   vtkGraph theGraph
   # read and initialise the graph structure
   # ....

   reader SetPolyDataOutput theGraph
}

This makes sense in my context, as downstream modules that know about 
graphs can downcast, and modules that work on PolyData can treat the graph 
as PolyData.

The problem is that vtkProgrammableSource doesn't provide "Set...Output" 
methods.  So you are limited to working with the basic dataset types that 
it supports via its "Get...Output" interface.   Of course it is easy to 
make a subtype of ProgrammableSource and implement the appropriate method, 
but it seemed like the kind of thing that you might want the Programmable 
modules to support.  I wondered if anyone had a better suggestion, or had 
encountered a similar problem.

thanks,
David



----
Dr David Duke                   Department of Computer Science
                                 University of Bath, Bath, BA2 7AY
tel:    +44 1225 323 407        United Kingdom
fax     +44 1225 323 493
email:  D.Duke at bath.ac.uk       web:   http://www.bath.ac.uk/~masdad/





More information about the vtkusers mailing list