Documentation for vtkScalars

vtkScalars - represent and manipulate scalar data

Super Class: vtkAttributeData

Description:

vtkScalars provides an interface to scalar data. The data model for vtkScalars is an array accessible by point or cell id. Scalar data is represented by a subclass of vtkDataArray, and may be any any type of data, although generic operations on scalar data is performed using floating point values. Scalars typically provide a single value per point. However, there are types of scalars that have multiple values or components. (For example, scalars that represent (RGB) color information, etc.) In this case, the ActiveComponent instance variable is used to indicate which component value is to be used for scalar data. Because of the close relationship between scalars and colors, scalars also maintain an internal lookup table. If provided, this table is used to map scalars into colors, rather than the lookup table that the vtkMapper objects are associated with.

 

See Also:

vtkDataArray vtkAttributeData vtkPointData vtkCellData

 

Methods:

void vtkScalars (int ,int )
void vtkScalars ()
static vtkScalars *New (int ,int )
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
void SetData (vtkDataArray *)
vtkAttributeData *MakeObject ()
void SetNumberOfScalars (int )
int GetNumberOfScalars ()
float GetScalar (int )
void SetScalar (int ,float )
void InsertScalar (int ,float )
int InsertNextScalar (float )
void SetNumberOfComponents (int )
int GetNumberOfComponents ()
void SetActiveComponent (int )
int GetActiveComponent ()
void ComputeRange ()
float *GetRange ()
void GetRange (float )
void GetDataTypeRange (double )
double GetDataTypeMin ()
double GetDataTypeMax ()
void CreateDefaultLookupTable ()
void SetLookupTable (vtkLookupTable *)
vtkLookupTable *GetLookupTable ()
void GetScalars (vtkIdList * ,vtkScalars *)
void GetScalars (int ,int ,vtkScalars *)
int InitColorTraversal (float ,vtkLookupTable * ,int )
unsigned char *GetColor (int )
void GetScalars (vtkIdList & ,vtkScalars &)
void GetScalars (int ,int ,vtkScalars &)

 

Detailed Method Descriptions:

Set the data for this object. The tuple dimension must be consistent with the object.

void SetData (vtkDataArray *)

Create a copy of this object.

vtkAttributeData *MakeObject ()

Specify the number of scalars for this object to hold. Make sure that you set the number of components in texture first.

void SetNumberOfScalars (int )

Return number of scalars in the array.

int GetNumberOfScalars ()

Return the scalar value as a float for a specific id.

float GetScalar (int )

Insert Scalar into object. No range checking performed (fast!). Make sure you use SetNumberOfScalars() to allocate memory prior to using SetScalar().

void SetScalar (int ,float )

Insert Scalar into object. Range checking performed and memory allocated as necessary.

void InsertScalar (int ,float )

Insert Scalar at end of array and return its location (id) in the array.

int InsertNextScalar (float )

Specify/Get the number of components in scalar data.

void SetNumberOfComponents (int )

Set/Get the active scalar component. This ivar specifies which value (or component) to use with multivalued scalars. Currently, a scalar can have at most four components (assumed RGBA).

int GetNumberOfComponents ()
void SetActiveComponent (int )
int GetActiveComponent ()

Determine (rmin,rmax) range of scalar values.

void ComputeRange ()

Return the range of scalar values. Data returned as pointer to float array of length 2.

float *GetRange ()

Return the range of scalar values. Range copied into array provided.

void GetRange (float )

These methods return the Min and Max possible range of the native data type. For example if a vtkScalars consists of unsigned char data these will return (0,255).

void GetDataTypeRange (double )
double GetDataTypeMin ()
double GetDataTypeMax ()

Create default lookup table. Generally used to create one when none is available.

void CreateDefaultLookupTable ()

Set/get the lookup table associated with this scalar data, if any.

void SetLookupTable (vtkLookupTable *)
vtkLookupTable *GetLookupTable ()

Given a list of point ids, return an array of scalar values.

void GetScalars (vtkIdList * ,vtkScalars *)

Get the scalar values for the range of points ids specified (i.e., p1->p2 inclusive). You must insure that the vtkScalars has been previously allocated with enough space to hold the data.

void GetScalars (int ,int ,vtkScalars *)

Initialize the traversal of the scalar data to generate colors (typically used during the rendering process). The method takes an alpha opacity value and returns a flag indicating whether alpha blending will occur. Also takes a lookup table used to map the scalar data. The color mode parameter controls how the scalar data is mapped to colors (see vtkMapper::ColorMode methods for a definition).

int InitColorTraversal (float ,vtkLookupTable * ,int )

Get the color value at a particular id. Returns a pointer to a 4-byte array of rgba. Make sure you call InitColorTraversal() before invoking this method.

unsigned char *GetColor (int )

For legacy compatibility. Do not use.

void GetScalars (vtkIdList & ,vtkScalars &)