Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members   Related Pages  

vtkScalars Class Reference

represent and manipulate scalar data. More...

#include <vtkScalars.h>

Inheritance diagram for vtkScalars:

Inheritance graph
[legend]
Collaboration diagram for vtkScalars:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void SetData (vtkDataArray *)
vtkAttributeData * MakeObject ()
void SetNumberOfScalars (int number)
int GetNumberOfScalars ()
float GetScalar (int id)
void SetScalar (int id, float s)
void InsertScalar (int id, float s)
int InsertNextScalar (float s)
void SetNumberOfComponents (int num)
int GetNumberOfComponents ()
virtual void SetActiveComponent (int)
virtual int GetActiveComponent ()
void ComputeRange ()
float * GetRange ()
void GetRange (float range[2])
void GetDataTypeRange (double range[2])
double GetDataTypeMin ()
double GetDataTypeMax ()
virtual void CreateDefaultLookupTable ()
void SetLookupTable (vtkLookupTable *lut)
virtual vtkLookupTable * GetLookupTable ()
void GetScalars (vtkIdList *ptIds, vtkScalars *fv)
void GetScalars (int p1, int p2, vtkScalars *fs)
int InitColorTraversal (float alpha, vtkScalarsToColors *lut, int colorMode=VTK_COLOR_MODE_DEFAULT)
unsigned char * GetColor (int id)
void GetScalars (vtkIdList &ptIds, vtkScalars &fv)
void GetScalars (int p1, int p2, vtkScalars &fs)

Static Public Methods

vtkScalars * New ()
vtkScalars * New (int dataType, int numComp=1)
int IsTypeOf (const char *type)
vtkScalars * SafeDownCast (vtkObject *o)

Protected Methods

 vtkScalars ()
 ~vtkScalars ()
 vtkScalars (const vtkScalars &)
void operator= (const vtkScalars &)
unsigned char * PassRGBA (int id)
unsigned char * PassRGB (int id)
unsigned char * PassIA (int id)
unsigned char * PassI (int id)
unsigned char * CompositeRGBA (int id)
unsigned char * CompositeIA (int id)
unsigned char * CompositeMapThroughLookupTable (int id)
unsigned char * MapThroughLookupTable (int id)
unsigned char * Luminance (int id)

Protected Attributes

float Range [8]
vtkTimeStamp ComputeTime
vtkLookupTable * LookupTable
int ActiveComponent
float CurrentAlpha
vtkScalarsToColors * CurrentLookupTable
unsigned char *(vtkScalars::* CurrentColorFunction )(int id)
vtkUnsignedCharArray * Colors
unsigned char RGBA [4]

Detailed Description

represent and manipulate scalar data.

Date:
2000/12/10 20:08:17
Revision:
1.67

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
Examples:
vtkScalars (examples)


Member Function Documentation

void vtkScalars::ComputeRange (    ) 
 

Determine (rmin,rmax) range of scalar values.

virtual void vtkScalars::CreateDefaultLookupTable (    )  [virtual]
 

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

virtual const char* vtkScalars::GetClassName (    )  [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkAttributeData.

unsigned char* vtkScalars::GetColor (  int    id )  [inline]
 

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.

void vtkScalars::GetDataTypeRange (  double    range[2] ) 
 

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).

int vtkScalars::GetNumberOfScalars (    )  [inline]
 

Return number of scalars in the array.

void vtkScalars::GetRange (  float    range[2] ) 
 

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

float* vtkScalars::GetRange (    ) 
 

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

float vtkScalars::GetScalar (  int    id )  [inline]
 

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

void vtkScalars::GetScalars (  vtkIdList &    ptIds,
vtkScalars &    fv
)  [inline]
 

For legacy compatibility. Do not use.

void vtkScalars::GetScalars (  int    p1,
int    p2,
vtkScalars *    fs
) 
 

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 vtkScalars::GetScalars (  vtkIdList *    ptIds,
vtkScalars *    fv
) 
 

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

int vtkScalars::InitColorTraversal (  float    alpha,
vtkScalarsToColors *    lut,
int    colorMode = VTK_COLOR_MODE_DEFAULT
) 
 

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 vtkScalars::InsertNextScalar (  float    s )  [inline]
 

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

void vtkScalars::InsertScalar (  int    id,
float    s
)  [inline]
 

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

virtual int vtkScalars::IsA (  const char *    type )  [virtual]
 

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkAttributeData.

int vtkScalars::IsTypeOf (  const char *    type )  [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkAttributeData.

vtkAttributeData * vtkScalars::MakeObject (    )  [inline, virtual]
 

Create a copy of this object.

Implements vtkAttributeData.

vtkScalars* vtkScalars::New (    )  [static]
 

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

Reimplemented in vtkFloatScalars.

void vtkScalars::PrintSelf (  ostream &    os,
vtkIndent    indent
)  [virtual]
 

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkAttributeData.

vtkScalars* vtkScalars::SafeDownCast (  vtkObject *    o )  [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkAttributeData.

virtual void vtkScalars::SetActiveComponent (  int    )  [virtual]
 

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).

void vtkScalars::SetData (  vtkDataArray *    )  [virtual]
 

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

Reimplemented from vtkAttributeData.

Reimplemented in vtkFloatScalars.

void vtkScalars::SetLookupTable (  vtkLookupTable *    lut ) 
 

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

void vtkScalars::SetNumberOfComponents (  int    num )  [inline]
 

Specify/Get the number of components in scalar data.

void vtkScalars::SetNumberOfScalars (  int    number )  [inline]
 

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

void vtkScalars::SetScalar (  int    id,
float    s
)  [inline]
 

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


The documentation for this class was generated from the following file:
Generated on Tue Mar 19 13:32:49 2002 for VTK by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002