FreeMat
vtkProgrammableSource

Section: Visualization Toolkit Graphics Classes

Usage

vtkProgrammableSource is a source object that is programmable by the user. To use this object, you must specify a function that creates the output. It is possible to generate an output dataset of any (concrete) type; it is up to the function to properly initialize and define the output. Typically, you use one of the methods to get a concrete output type (e.g., GetPolyDataOutput() or GetStructuredPointsOutput()), and then manipulate the output in the user-specified function.

Example use of this include writing a function to read a data file or interface to another system. (You might want to do this in favor of deriving a new class.) Another important use of this class is that it allows users of interpreters (e.g., Tcl or Java) the ability to write source objects without having to recompile C++ code or generate new libraries.

To create an instance of class vtkProgrammableSource, simply invoke its constructor as follows

  obj = vtkProgrammableSource

Methods

The class vtkProgrammableSource has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, obj is an instance of the vtkProgrammableSource class.

  • string = obj.GetClassName ()
  • int = obj.IsA (string name)
  • vtkProgrammableSource = obj.NewInstance ()
  • vtkProgrammableSource = obj.SafeDownCast (vtkObject o)
  • vtkPolyData = obj.GetPolyDataOutput () - Get the output as a concrete type. This method is typically used by the writer of the source function to get the output as a particular type (i.e., it essentially does type casting). It is the users responsibility to know the correct type of the output data.
  • vtkStructuredPoints = obj.GetStructuredPointsOutput () - Get the output as a concrete type.
  • vtkStructuredGrid = obj.GetStructuredGridOutput () - Get the output as a concrete type.
  • vtkUnstructuredGrid = obj.GetUnstructuredGridOutput () - Get the output as a concrete type.
  • vtkRectilinearGrid = obj.GetRectilinearGridOutput () - Get the output as a concrete type.