vtkADDATTRIBUTE Procedure

Collects point attributes for VTK datasets.

Usage

vtkADDATTRIBUTE, attributes

Input Parameters

attributes—List variable containing all of the attributes for a dataset. Passing an undefined variable on the first call to creates the initial list. Using the variable on subsequent calls will add elements to the list. You should never have to create or modify the contents of this variable manually.

Keywords

Note:

At least one keyword must be specified for vtkADDATTRIBUTE. If a keyword is not specified, the following message is displayed:

% VTKADDATTRIBUTE: No attribute specified.

Name—A scalar string specifying a name for this attribute. The default name is the attribute name in lower case.

Lookup_table_name—Only used with scalar attributes. A scalar string specifying the name of the lookup table to be associated with a scalar attribute. The default table is “default.”

One and only one of the following keywords can be used to add an attribute of the selected type:

Scalars—A vector of floating point numbers containing scalar values for each entry in points.

Lookup_table—An array of floating point numbers of size (3, m) containing normalized RGB values.

Vectors—Array of floating point numbers of size (3, n), where n equals the number of Points, containing the x, y, and z components for each vector.

Normals—Array of floating point numbers of size (3, n), where n equals the number of points, containing the x, y, and z components for each normal, where the x, y, and z values are normalized to a unit length of 1.

Color_scalars—An array of floating point numbers of size (m, n), where n equals the number of Points and m is the number of values per color scalar. Values are between 0.0 and 1.0.

Texture_coordinates—An array of floating point numbers of size (m, n), where m is 1, 2, or 3 and n equals the number of points.

Tensors—An array of floating point numbers of size (3, 3, n), where n equals the number of points.

Discussion

This procedure allows a set of attributes to be collected and passed to one of the dataset creation routines: vtkPOLYDATA, vtkSTRUCTUREDPOINTS, vtkSTRUCTUREDGRID, vtkRECTILINIARGRID, or vtkUNSTRUCTUREDGRID. Datasets can have one or more attributes associated with their points, and even more than one attribute of the same type, with the Name assigned to the attribute used to distinguish them. For Scalars, Normals, Color_scalars, Texture_coordinates, and Tensors, the number of supplied attributes must equal the number of points in the dataset to which they will be assigned.