vtkProgrammableSource Class Reference

#include <vtkProgrammableSource.h>

Inheritance diagram for vtkProgrammableSource:

Inheritance graph
[legend]
Collaboration diagram for vtkProgrammableSource:

Collaboration graph
[legend]

List of all members.


Detailed Description

generate source dataset via a user-specified function

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.

See also:
vtkProgrammableFilter vtkProgrammableAttributeDataFilter vtkProgrammableDataObjectSource
Examples:
vtkProgrammableSource (Examples)
Tests:
vtkProgrammableSource (Tests)

Definition at line 54 of file vtkProgrammableSource.h.


Public Types

typedef vtkDataSetAlgorithm Superclass
typedef void(* ProgrammableMethodCallbackType )(void *arg)

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void SetExecuteMethod (void(*f)(void *), void *arg)
void SetExecuteMethodArgDelete (void(*f)(void *))
void SetRequestInformationMethod (void(*f)(void *))
vtkPolyDataGetPolyDataOutput ()
vtkStructuredPointsGetStructuredPointsOutput ()
vtkStructuredGridGetStructuredGridOutput ()
vtkUnstructuredGridGetUnstructuredGridOutput ()
vtkRectilinearGridGetRectilinearGridOutput ()

Static Public Member Functions

static vtkProgrammableSourceNew ()
static int IsTypeOf (const char *type)
static vtkProgrammableSourceSafeDownCast (vtkObject *o)

Protected Member Functions

 vtkProgrammableSource ()
 ~vtkProgrammableSource ()
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int RequestDataObject (vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *)

Protected Attributes

ProgrammableMethodCallbackType ExecuteMethod
ProgrammableMethodCallbackType ExecuteMethodArgDelete
void * ExecuteMethodArg
ProgrammableMethodCallbackType RequestInformationMethod
vtkTimeStamp ExecuteTime
int RequestedDataType

Member Typedef Documentation

Reimplemented from vtkDataSetAlgorithm.

Definition at line 58 of file vtkProgrammableSource.h.

Signature definition for programmable method callbacks. Methods passed to SetExecuteMethod, SetExecuteMethodArgDelete or SetRequestInformationMethod must conform to this signature. The presence of this typedef is useful for reference and for external analysis tools, but it cannot be used in the method signatures in these header files themselves because it prevents the internal VTK wrapper generators from wrapping these methods.


Constructor & Destructor Documentation

vtkProgrammableSource::vtkProgrammableSource (  )  [protected]

vtkProgrammableSource::~vtkProgrammableSource (  )  [protected]


Member Function Documentation

static vtkProgrammableSource* vtkProgrammableSource::New (  )  [static]

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkDataSetAlgorithm.

virtual const char* vtkProgrammableSource::GetClassName (  )  [virtual]

Reimplemented from vtkDataSetAlgorithm.

static int vtkProgrammableSource::IsTypeOf ( const char *  name  )  [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkDataSetAlgorithm.

virtual int vtkProgrammableSource::IsA ( const char *  name  )  [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkDataSetAlgorithm.

static vtkProgrammableSource* vtkProgrammableSource::SafeDownCast ( vtkObject o  )  [static]

Reimplemented from vtkDataSetAlgorithm.

void vtkProgrammableSource::SetExecuteMethod ( void(*)(void *)  f,
void *  arg 
)

Specify the function to use to generate the source data. Note that the function takes a single (void *) argument.

void vtkProgrammableSource::SetExecuteMethodArgDelete ( void(*)(void *)  f  ) 

Set the arg delete method. This is used to free user memory.

void vtkProgrammableSource::SetRequestInformationMethod ( void(*)(void *)  f  ) 

Specify the function to use to fill in information about the source data.

vtkPolyData* vtkProgrammableSource::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.

Reimplemented from vtkDataSetAlgorithm.

vtkStructuredPoints* vtkProgrammableSource::GetStructuredPointsOutput (  ) 

Get the output as a concrete type.

Reimplemented from vtkDataSetAlgorithm.

vtkStructuredGrid* vtkProgrammableSource::GetStructuredGridOutput (  ) 

Get the output as a concrete type.

Reimplemented from vtkDataSetAlgorithm.

vtkUnstructuredGrid* vtkProgrammableSource::GetUnstructuredGridOutput (  ) 

Get the output as a concrete type.

Reimplemented from vtkDataSetAlgorithm.

vtkRectilinearGrid* vtkProgrammableSource::GetRectilinearGridOutput (  ) 

Get the output as a concrete type.

Reimplemented from vtkDataSetAlgorithm.

virtual int vtkProgrammableSource::RequestData ( vtkInformation ,
vtkInformationVector **  ,
vtkInformationVector  
) [protected, virtual]

This is called within ProcessRequest when a request asks the algorithm to do its work. This is the method you should override to do whatever the algorithm is designed to do. This happens during the fourth pass in the pipeline execution process.

Reimplemented from vtkDataSetAlgorithm.

virtual int vtkProgrammableSource::RequestDataObject ( vtkInformation request,
vtkInformationVector **  inputVector,
vtkInformationVector outputVector 
) [protected, virtual]

This is called within ProcessRequest to when a request asks the algorithm to create empty output data objects. This typically happens early on in the execution of the pipeline. The default behavior is to create an output DataSet of the same type as the input for each output port. This method can be overridden to change the output data type of an algorithm. This happens in the third pass of the pipeline execution.

Reimplemented from vtkDataSetAlgorithm.

virtual int vtkProgrammableSource::RequestInformation ( vtkInformation ,
vtkInformationVector **  ,
vtkInformationVector  
) [protected, virtual]

This is called within ProcessRequest when a request asks for Information. Typically an algorithm provides whatever lightweight information about its output that it can here without doing any lengthy computations. This happens in the first pass of the pipeline execution.

Reimplemented from vtkDataSetAlgorithm.


Member Data Documentation

Definition at line 106 of file vtkProgrammableSource.h.

Definition at line 107 of file vtkProgrammableSource.h.

Definition at line 108 of file vtkProgrammableSource.h.

Definition at line 109 of file vtkProgrammableSource.h.

Definition at line 111 of file vtkProgrammableSource.h.

Definition at line 112 of file vtkProgrammableSource.h.


The documentation for this class was generated from the following file:

Generated on Wed Aug 24 11:58:17 2011 for VTK by  doxygen 1.5.6