VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkProgrammableSource Class Reference

generate source dataset via a user-specified function More...

#include <vtkProgrammableSource.h>

Inherits vtkDataSetAlgorithm.

Public Types

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

Public Member Functions

virtual int IsA (const char *type)
 
vtkProgrammableSourceNewInstance () const
 
void SetExecuteMethod (void(*f)(void *), void *arg)
 
void SetExecuteMethodArgDelete (void(*f)(void *))
 
void SetRequestInformationMethod (void(*f)(void *))
 
vtkPolyData * GetPolyDataOutput ()
 
vtkStructuredPoints * GetStructuredPointsOutput ()
 
vtkStructuredGrid * GetStructuredGridOutput ()
 
vtkUnstructuredGrid * GetUnstructuredGridOutput ()
 
vtkRectilinearGrid * GetRectilinearGridOutput ()
 

Static Public Member Functions

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

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 
 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
 

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 55 of file vtkProgrammableSource.h.

Member Typedef Documentation

typedef vtkDataSetAlgorithm vtkProgrammableSource::Superclass

Definition at line 59 of file vtkProgrammableSource.h.

typedef void(* vtkProgrammableSource::ProgrammableMethodCallbackType)(void *arg)

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.

Definition at line 68 of file vtkProgrammableSource.h.

Constructor & Destructor Documentation

vtkProgrammableSource::vtkProgrammableSource ( )
protected
vtkProgrammableSource::~vtkProgrammableSource ( )
protected

Member Function Documentation

static vtkProgrammableSource* vtkProgrammableSource::New ( )
static
static int vtkProgrammableSource::IsTypeOf ( const char *  type)
static
virtual int vtkProgrammableSource::IsA ( const char *  type)
virtual
static vtkProgrammableSource* vtkProgrammableSource::SafeDownCast ( vtkObjectBase *  o)
static
virtual vtkObjectBase* vtkProgrammableSource::NewInstanceInternal ( ) const
protectedvirtual
vtkProgrammableSource* vtkProgrammableSource::NewInstance ( ) const
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.

vtkStructuredPoints* vtkProgrammableSource::GetStructuredPointsOutput ( )

Get the output as a concrete type.

vtkStructuredGrid* vtkProgrammableSource::GetStructuredGridOutput ( )

Get the output as a concrete type.

vtkUnstructuredGrid* vtkProgrammableSource::GetUnstructuredGridOutput ( )

Get the output as a concrete type.

vtkRectilinearGrid* vtkProgrammableSource::GetRectilinearGridOutput ( )

Get the output as a concrete type.

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

Member Data Documentation

ProgrammableMethodCallbackType vtkProgrammableSource::ExecuteMethod
protected

Definition at line 107 of file vtkProgrammableSource.h.

ProgrammableMethodCallbackType vtkProgrammableSource::ExecuteMethodArgDelete
protected

Definition at line 108 of file vtkProgrammableSource.h.

void* vtkProgrammableSource::ExecuteMethodArg
protected

Definition at line 109 of file vtkProgrammableSource.h.

ProgrammableMethodCallbackType vtkProgrammableSource::RequestInformationMethod
protected

Definition at line 110 of file vtkProgrammableSource.h.

vtkTimeStamp vtkProgrammableSource::ExecuteTime
protected

Definition at line 112 of file vtkProgrammableSource.h.

int vtkProgrammableSource::RequestedDataType
protected

Definition at line 113 of file vtkProgrammableSource.h.


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