DataSetAttributes
Introduction
vtkDataSetAttributes is a class that is used to represent and manipulate attribute data (e.g., scalars, vectors, normals, texture coordinates, tensors, global ids, pedigree ids, and field data).
This adds to vtkFieldData the ability to pick one of the arrays from the field as the currently active array for each attribute type. In other words, you pick one array to be called "THE" Scalars, and then filters down the pipeline will treat that array specially. For example vtkContourFilter will contour "THE" Scalar array unless a different array is asked for.
Additionally vtkDataSetAttributes provides methods that filters call to pass data through, copy data into, and interpolate from Fields. PassData passes entire arrays from the source to the destination. Copy passes through some subset of the tuples from the source to the destination. Interpolate interpolates from the chosen tuple(s) in the source data, using the provided weights, to produce new tuples in the destination. Each attribute type has pass, copy and interpolate "copy" flags that can be set in the destination to choose which attribute arrays will be transferred from the source to the destination.
Finally this class provides a mechanism to determine which attributes a group of sources have in common, and to copy tuples from a source into the destination, for only those attributes that are held by all.
Methods
checkNumberOfComponents
| Argument | Type | Required | Description |
|---|---|---|---|
x | Yes |
copyGlobalIdsOff
copyGlobalIdsOn
copyNormalsOff
copyNormalsOn
copyPedigreeIdsOff
copyPedigreeIdsOn
copyScalarsOff
copyScalarsOn
copyTCoordsOff
copyTCoordsOn
copyTensorsOff
copyTensorsOn
copyVectorsOff
copyVectorsOn
extend
Method used to decorate a given object (publicAPI+model) with vtkDataSetAttributes characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IDataSetAttributesInitialValues | No | (default: {}) |
getActiveAttribute
| Argument | Type | Required | Description |
|---|---|---|---|
attType | string | Yes |
getActiveGlobalIds
getActiveNormals
getActivePedigreeIds
getActiveScalars
getActiveTCoords
getActiveTensors
getActiveVectors
getAttributes
Get a list of attribute names that the given array is for this vtkDataSetAttributes.
| Argument | Type | Required | Description |
|---|---|---|---|
arr | vtkDataArray | Yes |
Returns
| Type | Description |
|---|---|
| Array[String] |
getGlobalIds
Get the global id data.
getNormals
Get the normal data.
getPedigreeIds
Get the pedigree id data.
getScalars
Get the scalar data.
getTCoords
Get the texture coordinate data.
getTensors
Get the tensors data.
getVectors
Get the vectors data.
initializeAttributeCopyFlags
Called when initialize() is called.
newInstance
Method used to create a new instance of vtkDataSetAttributes.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IDataSetAttributesInitialValues | No | for pre-setting some of its content |
removeAllArrays
Override to allow proper handling of active attributes
removeArray
Override to allow proper handling of active attributes
| Argument | Type | Required | Description |
|---|---|---|---|
arrayName | string | Yes | The name of the array. |
removeArrayByIndex
Override to allow proper handling of active attributes
| Argument | Type | Required | Description |
|---|---|---|---|
arrayIdx | Number | Yes | The index of the array. |
setActiveAttributeByIndex
| Argument | Type | Required | Description |
|---|---|---|---|
arrayIdx | Number | Yes | |
uncleanAttType | Yes |
setActiveAttributeByName
| Argument | Type | Required | Description |
|---|---|---|---|
arrayName | string | Yes | |
attType | Yes |
setActiveGlobalIds
| Argument | Type | Required | Description |
|---|---|---|---|
arrayName | string | Yes | The name of the array to activate. |
setActiveGlobalIds
| Argument | Type | Required | Description |
|---|---|---|---|
activeGlobalIds | Number | Yes |
setActiveNormals
| Argument | Type | Required | Description |
|---|---|---|---|
arrayName | string | Yes | The name of the array to activate. |
setActiveNormals
| Argument | Type | Required | Description |
|---|---|---|---|
activeNormals | Number | Yes |
setActivePedigreeIds
| Argument | Type | Required | Description |
|---|---|---|---|
arrayName | string | Yes | The name of the array to activate. |
setActivePedigreeIds
| Argument | Type | Required | Description |
|---|---|---|---|
activePedigreeIds | Number | Yes |
setActiveScalars
| Argument | Type | Required | Description |
|---|---|---|---|
arrayName | string | Yes | The name of the array to activate. |
setActiveScalars
| Argument | Type | Required | Description |
|---|---|---|---|
activeScalars | Number | Yes |
setActiveTCoords
| Argument | Type | Required | Description |
|---|---|---|---|
arrayName | string | Yes | The name of the array to activate. |
setActiveTCoords
| Argument | Type | Required | Description |
|---|---|---|---|
activeTCoords | Number | Yes |
setActiveTensors
| Argument | Type | Required | Description |
|---|---|---|---|
arrayName | string | Yes | The name of the array to activate. |
setActiveTensors
| Argument | Type | Required | Description |
|---|---|---|---|
activeTensors | Number | Yes |
setActiveVectors
| Argument | Type | Required | Description |
|---|---|---|---|
arrayName | string | Yes | The name of the array to activate. |
setActiveVectors
| Argument | Type | Required | Description |
|---|---|---|---|
activeVectors | Number | Yes |
setAttribute
| Argument | Type | Required | Description |
|---|---|---|---|
arr | Yes | ||
uncleanAttType | Yes |
setGlobalIds
Set the global id data.
| Argument | Type | Required | Description |
|---|---|---|---|
globalIds | vtkDataArray | Yes | The global id data. |
setNormals
Set the normal data.
| Argument | Type | Required | Description |
|---|---|---|---|
normals | vtkDataArray | Yes | The normal data. |
setPedigreeIds
Set the pedigree id data.
| Argument | Type | Required | Description |
|---|---|---|---|
pedigreeids | vtkDataArray | Yes | The pedigree id data. |
setScalars
Set the scalar data.
| Argument | Type | Required | Description |
|---|---|---|---|
scalars | vtkDataArray | Yes | The scalar data. |
setTCoords
Set the texture coordinate data.
| Argument | Type | Required | Description |
|---|---|---|---|
tcoords | vtkDataArray | Yes | The texture coordinate data. |
setTensors
Set the tensor data.
| Argument | Type | Required | Description |
|---|---|---|---|
tensors | vtkDataArray | Yes | The tensor data. |
setVectors
Set the vector data.
| Argument | Type | Required | Description |
|---|---|---|---|
vectors | vtkDataArray | Yes | The vector data. |
shallowCopy
Try to copy the state of the other to ourselves by just using references.
| Argument | Type | Required | Description |
|---|---|---|---|
other | Yes | instance to copy the reference from | |
debug | Yes | (default: false) if true feedback will be provided when mismatch happen |