FreeMat

- Main Page
- Related Pages

vtkGenerateIndexArray

Section: Visualization Toolkit Infovis Classes

# Usage

Generates a new vtkIdTypeArray containing zero-base indices.

vtkGenerateIndexArray operates in one of two distinct "modes". By default, it simply generates an index array containing monotonically-increasing integers in the range [0, N), where N is appropriately sized for the field type that will store the results. This mode is useful for generating a unique ID field for datasets that have none.

The second "mode" uses an existing array from the input data object as a "reference". Distinct values from the reference array are sorted in ascending order, and an integer index in the range [0, N) is assigned to each. The resulting map is used to populate the output index array, mapping each value in the reference array to its corresponding index and storing the result in the output array. This mode is especially useful when generating tensors, since it allows us to "map" from an array with arbitrary contents to an index that can be used as tensor coordinates.

To create an instance of class vtkGenerateIndexArray, simply invoke its constructor as follows

      obj = vtkGenerateIndexArray

# Methods

The class vtkGenerateIndexArray has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkGenerateIndexArray class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkGenerateIndexArray = obj.NewInstance ()`
- `vtkGenerateIndexArray = obj.SafeDownCast (vtkObject o)`
- `obj.SetArrayName (string )` - Control the output index array name. Default: "index".
- `string = obj.GetArrayName ()` - Control the output index array name. Default: "index".
- `obj.SetFieldType (int )` - Control the location where the index array will be stored.
- `int = obj.GetFieldType ()` - Control the location where the index array will be stored.
- `obj.SetReferenceArrayName (string )` - Specifies an optional reference array for index-generation.
- `string = obj.GetReferenceArrayName ()` - Specifies an optional reference array for index-generation.
- `obj.SetPedigreeID (int )` - Specifies whether the index array should be marked as pedigree ids. Default: false.
- `int = obj.GetPedigreeID ()` - Specifies whether the index array should be marked as pedigree ids. Default: false.