Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# vtkProgrammableAttributeDataFilter Class Reference

`#include <vtkProgrammableAttributeDataFilter.h>`

Inheritance diagram for vtkProgrammableAttributeDataFilter:

[legend]
Collaboration diagram for vtkProgrammableAttributeDataFilter:

[legend]
List of all members.

## Detailed Description

manipulate attribute (cell and point) data via a user-specified function

Date:
  2002/11/03 22:51:55

Revision:
  1.26

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.

Warning:
  This filter operates on any combination of the filter input plus a list of additional inputs (at a minimum you must set the filter input via SetInput()). It is up to you check whether the input is valid, and to insure that the output is valid. Also, you have to write the control structure for the traversal and operation on the point and cell attribute data.

Warning:
  By default the output point and cell data will be copied through from the input point data (using reference counting). You can control this using the output's CopyAllOff() flag, or by using individual flags for each point data field (i.e., scalars, vectors, etc.)

Warning:
  The output of this filter is the abstract type vtkDataSet, even if your input is a concrete type like vtkPolyData. Thus you may need to use vtkCastToConcrete to obtain the output as a particular concrete type, or one of the special methods of the superclass (e.g., vtkDataSetToDataSetFilter::GetPolyDataOutput) to retrieve output of the correct type.

Warning:
  The filter correctly manages modified time and network execution in most cases. However, if you change the definition of the filter function, you'll want to send a manual Modified() method to the filter to force it to reexecute.

Created by:
  - Schroeder, Will

CVS contributions (if > 5%):
  - Schroeder, Will (66%)
  - Martin, Ken (15%)
  - Lorensen, Bill (7%)

CVS logs (CVSweb):
  - .`h` (`/Graphics/vtkProgrammableAttributeDataFilter.h)`
  - .`cxx` (`/Graphics/vtkProgrammableAttributeDataFilter.cxx)`

Tests:
  vtkProgrammableAttributeDataFilter (Tests)

Definition at line 102 of file vtkProgrammableAttributeDataFilter.h.

## Public Types
typedef vtkDataSetToDataSetFilter | Superclass
## Public Methods
virtual const char * | GetClassName ()
virtual int | IsA (const char *type)
void | PrintSelf (ostream &os, vtkIndent indent)
void | AddInput (vtkDataSet *in)
void | RemoveInput (vtkDataSet *in)
vtkDataSetCollection * | GetInputList ()
void | SetExecuteMethod (void(*f)(void *), void *arg)
void | SetExecuteMethodArgDelete (void(*f)(void *))
## Static Public Methods
vtkProgrammableAttributeDataFilter * | New ()
int | IsTypeOf (const char *type)
vtkProgrammableAttributeDataFilter * | SafeDownCast (vtkObject *o)
## Protected Methods
| vtkProgrammableAttributeDataFilter ()
| ~vtkProgrammableAttributeDataFilter ()
void | Execute ()
## Protected Attributes
vtkDataSetCollection * | InputList
void(* | ExecuteMethod )(void *)
void(* | ExecuteMethodArgDelete )(void *)
void * | ExecuteMethodArg

## Member Typedef Documentation

typedef vtkDataSetToDataSetFilter vtkProgrammableAttributeDataFilter::Superclass

| Reimplemented from vtkDataSetToDataSetFilter. Definition at line 106 of file vtkProgrammableAttributeDataFilter.h.

## Constructor & Destructor Documentation

vtkProgrammableAttributeDataFilter::vtkProgrammableAttributeDataFilter | ( |  | ) | `[protected]`

vtkProgrammableAttributeDataFilter::~vtkProgrammableAttributeDataFilter | ( |  | ) | `[protected]`

## Member Function Documentation

vtkProgrammableAttributeDataFilter* vtkProgrammableAttributeDataFilter::New | ( |  | ) | `[static]`

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

virtual const char* vtkProgrammableAttributeDataFilter::GetClassName | ( |  | ) | `[virtual]`

| Reimplemented from vtkDataSetToDataSetFilter.

int vtkProgrammableAttributeDataFilter::IsTypeOf | ( | const char * | type | ) | `[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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkDataSetToDataSetFilter.

virtual int vtkProgrammableAttributeDataFilter::IsA | ( | const char * | type | ) | `[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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkDataSetToDataSetFilter.

vtkProgrammableAttributeDataFilter* vtkProgrammableAttributeDataFilter::SafeDownCast | ( | vtkObject * | o | ) | `[static]`

| Reimplemented from vtkDataSetToDataSetFilter.

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 vtkDataSetToDataSetFilter.

void vtkProgrammableAttributeDataFilter::AddInput | ( | vtkDataSet * | in | ) |

| Add a dataset to the list of data to process.

void vtkProgrammableAttributeDataFilter::RemoveInput | ( | vtkDataSet * | in | ) |

| Remove a dataset from the list of data to process.

vtkDataSetCollection* vtkProgrammableAttributeDataFilter::GetInputList | ( |  | ) | `[inline]`

| Return the list of inputs. Definition at line 116 of file vtkProgrammableAttributeDataFilter.h.

void vtkProgrammableAttributeDataFilter::SetExecuteMethod | ( | void(* | f)(void *),
|  | 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(* | f)(void *) | ) |

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

void vtkProgrammableAttributeDataFilter::Execute | ( |  | ) | `[protected, virtual]`

| This method is the old style execute method Reimplemented from vtkSource.

## Member Data Documentation

vtkDataSetCollection* vtkProgrammableAttributeDataFilter::InputList`[protected]`

| Definition at line 130 of file vtkProgrammableAttributeDataFilter.h.

void(* vtkProgrammableAttributeDataFilter::ExecuteMethod)(void *)`[protected]`

void(* vtkProgrammableAttributeDataFilter::ExecuteMethodArgDelete)(void *)`[protected]`

void* vtkProgrammableAttributeDataFilter::ExecuteMethodArg`[protected]`

| Definition at line 133 of file vtkProgrammableAttributeDataFilter.h.

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

- Graphics/vtkProgrammableAttributeDataFilter.h