VTK
|
manipulate attribute (cell and point) data via a user-specified function More...
#include <vtkProgrammableAttributeDataFilter.h>
manipulate attribute (cell and point) data via a user-specified function
vtkProgrammableAttributeDataFilter is a filter that allows you to write a custom procedure to manipulate attribute data - either point or cell data. For example, you could generate scalars based on a complex formula; convert vectors to normals; compute scalar values as a function of vectors, texture coords, and/or any other point data attribute; and so on. The filter takes multiple inputs (input plus an auxiliary input list), so you can write procedures that combine several dataset point attributes. Note that the output of the filter is the same type (topology/geometry) as the input.
The filter works as follows. It operates like any other filter (i.e., checking and managing modified and execution times, processing Update() and Execute() methods, managing release of data, etc.), but the difference is that the Execute() method simply invokes a user-specified function with an optional (void *) argument (typically the "this" pointer in C++). It is also possible to specify a function to delete the argument via ExecuteMethodArgDelete().
To use the filter, you write a procedure to process the input datasets, process the data, and generate output data. Typically, this means grabbing the input point or cell data (using GetInput() and maybe GetInputList()), operating on it (creating new point and cell attributes such as scalars, vectors, etc.), and then setting the point and/or cell attributes in the output dataset (you'll need to use GetOutput() to access the output). (Note: besides C++, it is possible to do the same thing in Tcl, Java, or other languages that wrap the C++ core.) Remember, proper filter protocol requires that you don't modify the input data - you create new output data from the input.
Definition at line 87 of file vtkProgrammableAttributeDataFilter.h.
Reimplemented from vtkDataSetAlgorithm.
Definition at line 91 of file vtkProgrammableAttributeDataFilter.h.
typedef void(* vtkProgrammableAttributeDataFilter::ProgrammableMethodCallbackType)(void *arg) |
Signature definition for programmable method callbacks. Methods passed to SetExecuteMethod or SetExecuteMethodArgDelete 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 110 of file vtkProgrammableAttributeDataFilter.h.
static vtkProgrammableAttributeDataFilter* vtkProgrammableAttributeDataFilter::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkDataSetAlgorithm.
static int vtkProgrammableAttributeDataFilter::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 vtkProgrammableAttributeDataFilter::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 vtkProgrammableAttributeDataFilter* vtkProgrammableAttributeDataFilter::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkDataSetAlgorithm.
virtual vtkObjectBase* vtkProgrammableAttributeDataFilter::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkDataSetAlgorithm.
Reimplemented from vtkDataSetAlgorithm.
void vtkProgrammableAttributeDataFilter::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkDataSetAlgorithm.
void vtkProgrammableAttributeDataFilter::AddInput | ( | vtkDataSet * | in | ) |
Add a dataset to the list of data to process.
Remove a dataset from the list of data to process.
Return the list of inputs.
Definition at line 101 of file vtkProgrammableAttributeDataFilter.h.
void vtkProgrammableAttributeDataFilter::SetExecuteMethod | ( | void(*)(void *) | f, |
void * | arg | ||
) |
Specify the function to use to operate on the point attribute data. Note that the function takes a single (void *) argument.
void vtkProgrammableAttributeDataFilter::SetExecuteMethodArgDelete | ( | void(*)(void *) | f | ) |
Set the arg delete method. This is used to free user memory.
int vtkProgrammableAttributeDataFilter::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 void vtkProgrammableAttributeDataFilter::ReportReferences | ( | vtkGarbageCollector * | ) | [protected, virtual] |
Reimplemented from vtkAlgorithm.
Definition at line 124 of file vtkProgrammableAttributeDataFilter.h.
Definition at line 125 of file vtkProgrammableAttributeDataFilter.h.
ProgrammableMethodCallbackType vtkProgrammableAttributeDataFilter::ExecuteMethodArgDelete [protected] |
Definition at line 126 of file vtkProgrammableAttributeDataFilter.h.
void* vtkProgrammableAttributeDataFilter::ExecuteMethodArg [protected] |
Definition at line 127 of file vtkProgrammableAttributeDataFilter.h.