VTK
Public Member Functions | Protected Member Functions | List of all members
vtkDataSetAttributesFieldList Class Reference

helps manage arrays from multiple vtkDataSetAttributes. More...

#include <vtkDataSetAttributesFieldList.h>

Public Member Functions

 vtkDataSetAttributesFieldList (int number_of_inputs=0)
 number_of_inputs parameter is not required and only provided for backwards compatibility. More...
 
virtual ~vtkDataSetAttributesFieldList ()
 
void PrintSelf (ostream &os, vtkIndent indent)
 
void Reset ()
 Initializes the field list to empty. More...
 
void InitializeFieldList (vtkDataSetAttributes *dsa)
 Initialize the field list. More...
 
void IntersectFieldList (vtkDataSetAttributes *dsa)
 Update the field list for an intersection of arrays registered so far and those in dsa. More...
 
void UnionFieldList (vtkDataSetAttributes *dsa)
 Update the field list for an union of arrays registered so far and those in dsa. More...
 
void TransformData (int inputIndex, vtkDataSetAttributes *input, vtkDataSetAttributes *output, std::function< void(vtkAbstractArray *, vtkAbstractArray *)> op) const
 Use this method to provide a custom callback function to invoke for each array in the input and corresponding array in the output. More...
 
void CopyAllocate (vtkDataSetAttributes *output, int ctype, vtkIdType sz, vtkIdType ext) const
 These methods can called to generate and update the output vtkDataSetAttributes. More...
 
void CopyData (int inputIndex, vtkDataSetAttributes *input, vtkIdType fromId, vtkDataSetAttributes *output, vtkIdType toId) const
 These methods can called to generate and update the output vtkDataSetAttributes. More...
 
void CopyData (int inputIdx, vtkDataSetAttributes *input, vtkIdType inputStart, vtkIdType numValues, vtkDataSetAttributes *output, vtkIdType outStart) const
 These methods can called to generate and update the output vtkDataSetAttributes. More...
 
void InterpolatePoint (int inputIdx, vtkDataSetAttributes *input, vtkIdList *inputIds, double *weights, vtkDataSetAttributes *output, vtkIdType toId) const
 These methods can called to generate and update the output vtkDataSetAttributes. More...
 
int IsAttributePresent (int attrType) const
 vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK. More...
 
int GetNumberOfFields () const
 vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK. More...
 
int GetFieldIndex (int i) const
 vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK. More...
 
const char * GetFieldName (int i) const
 vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK. More...
 
int GetFieldComponents (int i) const
 vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK. More...
 
int GetDSAIndex (int index, int i) const
 vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK. More...
 

Protected Member Functions

virtual vtkSmartPointer< vtkAbstractArrayCreateArray (int type) const
 Called to create an output array for the given type. More...
 

Detailed Description

helps manage arrays from multiple vtkDataSetAttributes.

vtkDataSetAttributesFieldList, also called vtkDataSetAttributes::FieldList, is used to help with filters when dealing with arrays from multiple vtkDataSetAttributes instances, potentially from multiple inputs.

Consider a filter that appends multiple inputs, e.g. vtkAppendPolyData. Besides appending mesh elements, such a filter also needs to combine field arrays (point, and cell data) from inputs to pass on to the output. Now if all the inputs had exactly the same set of arrays, we're all set. However, more often than not, the inputs will have different sets of arrays. The filter will need to match up from various inputs to combine together, potentially dropping arrays not in all inputs. Furthermore, it needs to ensure arrays in the output are flagged as attributes consistently. All of this can be done using vtkDataSetAttributesFieldList.

Usage

Typical usage is as follows:

  1. call IntersectFieldList or UnionFieldList for all input vtkDataSetAttributes instances,
  2. allocate arrays for the output vtkDataSetAttributes by using CopyAllocate,
  3. call CopyData per input (preserving the input order used in step 1) to copy tuple(s) from input to the output.

vtkDataSetAttributes::InitializeFieldList is provided for API compatibility with previous implementation of this class and it not required to be called. Simply calling UnionFieldList or IntersectFieldList for the first vtkDataSetAttributes instance is sufficient.

CopyAllocate,CopyData, andInterpolatePoint` methods on this class are called by similarly named variants on vtkDataSetAttributes that take in a FieldList instance as an argument. Hence, either forms may be used.

Calls to UnionFieldList and IntersectFieldList cannot be mixed. Use Reset or InitializeFieldList to change mode and start reinitialization.

Definition at line 70 of file vtkDataSetAttributesFieldList.h.

Constructor & Destructor Documentation

vtkDataSetAttributesFieldList::vtkDataSetAttributesFieldList ( int  number_of_inputs = 0)

number_of_inputs parameter is not required and only provided for backwards compatibility.

virtual vtkDataSetAttributesFieldList::~vtkDataSetAttributesFieldList ( )
virtual

Member Function Documentation

void vtkDataSetAttributesFieldList::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
void vtkDataSetAttributesFieldList::Reset ( )

Initializes the field list to empty.

void vtkDataSetAttributesFieldList::InitializeFieldList ( vtkDataSetAttributes dsa)

Initialize the field list.

This also adds the first input. Calling this method is optional. The first call to IntersectFieldList or UnionFieldList on a new instance or after calling Reset() will have the same effect.

void vtkDataSetAttributesFieldList::IntersectFieldList ( vtkDataSetAttributes dsa)

Update the field list for an intersection of arrays registered so far and those in dsa.

void vtkDataSetAttributesFieldList::UnionFieldList ( vtkDataSetAttributes dsa)

Update the field list for an union of arrays registered so far and those in dsa.

void vtkDataSetAttributesFieldList::CopyAllocate ( vtkDataSetAttributes output,
int  ctype,
vtkIdType  sz,
vtkIdType  ext 
) const

These methods can called to generate and update the output vtkDataSetAttributes.

These match corresponding API on vtkDataSetAttributes and can be called via the output vtkDataSetAttributes instance instead as well.

void vtkDataSetAttributesFieldList::CopyData ( int  inputIndex,
vtkDataSetAttributes input,
vtkIdType  fromId,
vtkDataSetAttributes output,
vtkIdType  toId 
) const

These methods can called to generate and update the output vtkDataSetAttributes.

These match corresponding API on vtkDataSetAttributes and can be called via the output vtkDataSetAttributes instance instead as well.

void vtkDataSetAttributesFieldList::CopyData ( int  inputIdx,
vtkDataSetAttributes input,
vtkIdType  inputStart,
vtkIdType  numValues,
vtkDataSetAttributes output,
vtkIdType  outStart 
) const

These methods can called to generate and update the output vtkDataSetAttributes.

These match corresponding API on vtkDataSetAttributes and can be called via the output vtkDataSetAttributes instance instead as well.

void vtkDataSetAttributesFieldList::InterpolatePoint ( int  inputIdx,
vtkDataSetAttributes input,
vtkIdList inputIds,
double weights,
vtkDataSetAttributes output,
vtkIdType  toId 
) const

These methods can called to generate and update the output vtkDataSetAttributes.

These match corresponding API on vtkDataSetAttributes and can be called via the output vtkDataSetAttributes instance instead as well.

void vtkDataSetAttributesFieldList::TransformData ( int  inputIndex,
vtkDataSetAttributes input,
vtkDataSetAttributes output,
std::function< void(vtkAbstractArray *, vtkAbstractArray *)>  op 
) const

Use this method to provide a custom callback function to invoke for each array in the input and corresponding array in the output.

int vtkDataSetAttributesFieldList::IsAttributePresent ( int  attrType) const

vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK.

This exposes that API for legacy applications.

Using these methods should be avoided in new code and should be replaced in old code as these methods can be slow.

Deprecated:
VTK 8.2
int vtkDataSetAttributesFieldList::GetNumberOfFields ( ) const

vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK.

This exposes that API for legacy applications.

Using these methods should be avoided in new code and should be replaced in old code as these methods can be slow.

Deprecated:
VTK 8.2
int vtkDataSetAttributesFieldList::GetFieldIndex ( int  i) const

vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK.

This exposes that API for legacy applications.

Using these methods should be avoided in new code and should be replaced in old code as these methods can be slow.

Deprecated:
VTK 8.2
const char* vtkDataSetAttributesFieldList::GetFieldName ( int  i) const

vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK.

This exposes that API for legacy applications.

Using these methods should be avoided in new code and should be replaced in old code as these methods can be slow.

Deprecated:
VTK 8.2
int vtkDataSetAttributesFieldList::GetFieldComponents ( int  i) const

vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK.

This exposes that API for legacy applications.

Using these methods should be avoided in new code and should be replaced in old code as these methods can be slow.

Deprecated:
VTK 8.2
int vtkDataSetAttributesFieldList::GetDSAIndex ( int  index,
int  i 
) const

vtkDataSetAttributes::FieldList used a different internal data structure in older versions of VTK.

This exposes that API for legacy applications.

Using these methods should be avoided in new code and should be replaced in old code as these methods can be slow.

Deprecated:
VTK 8.2
virtual vtkSmartPointer<vtkAbstractArray> vtkDataSetAttributesFieldList::CreateArray ( int  type) const
protectedvirtual

Called to create an output array for the given type.

Default implementation calls vtkAbstractArray::CreateArray().


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