Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File 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)

Definition at line 84 of file vtkScalars.h.


Constructor & Destructor Documentation

vtkScalars::vtkScalars (    )  [protected]
 

vtkScalars::~vtkScalars (    )  [protected]
 

vtkScalars::vtkScalars (  const vtkScalars &    )  [inline, protected]
 

Definition at line 196 of file vtkScalars.h.


Member Function Documentation

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.

Referenced by MakeObject().

vtkScalars* vtkScalars::New (  int    dataType,
int    numComp = 1
)  [static]
 

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.

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.

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.

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.

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.

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

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

Reimplemented from vtkAttributeData.

Reimplemented in vtkFloatScalars.

Referenced by vtkFloatScalars::SetData().

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

Create a copy of this object.

Reimplemented from vtkAttributeData.

Definition at line 223 of file vtkScalars.h.

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.

Definition at line 102 of file vtkScalars.h.

int vtkScalars::GetNumberOfScalars (    )  [inline]
 

Return number of scalars in the array.

Definition at line 105 of file vtkScalars.h.

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

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

Definition at line 234 of file vtkScalars.h.

Referenced by vtkStructuredGrid::IsPointVisible().

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

Definition at line 239 of file vtkScalars.h.

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

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

Definition at line 244 of file vtkScalars.h.

int vtkScalars::InsertNextScalar (  float    s )  [inline]
 

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

Definition at line 249 of file vtkScalars.h.

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

Specify/Get the number of components in scalar data.

Definition at line 228 of file vtkScalars.h.

int vtkScalars::GetNumberOfComponents (    )  [inline]
 

Definition at line 125 of file vtkScalars.h.

Referenced by MakeObject().

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

virtual int vtkScalars::GetActiveComponent (    )  [virtual]
 

void vtkScalars::ComputeRange (    ) 
 

Determine (rmin,rmax) range of scalar values.

float* vtkScalars::GetRange (    ) 
 

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

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

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

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

double vtkScalars::GetDataTypeMin (    ) 
 

double vtkScalars::GetDataTypeMax (    ) 
 

virtual void vtkScalars::CreateDefaultLookupTable (    )  [virtual]
 

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

void vtkScalars::SetLookupTable (  vtkLookupTable *    lut ) 
 

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

virtual vtkLookupTable* vtkScalars::GetLookupTable (    )  [virtual]
 

void vtkScalars::GetScalars (  vtkIdList *    ptIds,
vtkScalars *    fv
) 
 

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

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.

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

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.

Definition at line 182 of file vtkScalars.h.

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

For legacy compatibility. Do not use.

Definition at line 187 of file vtkScalars.h.

void vtkScalars::GetScalars (  int    p1,
int    p2,
vtkScalars &    fs
)  [inline]
 

Definition at line 189 of file vtkScalars.h.

void vtkScalars::operator= (  const vtkScalars &    )  [inline, protected]
 

Definition at line 197 of file vtkScalars.h.

unsigned char* vtkScalars::PassRGBA (  int    id )  [protected]
 

unsigned char* vtkScalars::PassRGB (  int    id )  [protected]
 

unsigned char* vtkScalars::PassIA (  int    id )  [protected]
 

unsigned char* vtkScalars::PassI (  int    id )  [protected]
 

unsigned char* vtkScalars::CompositeRGBA (  int    id )  [protected]
 

unsigned char* vtkScalars::CompositeIA (  int    id )  [protected]
 

unsigned char* vtkScalars::CompositeMapThroughLookupTable (  int    id )  [protected]
 

unsigned char* vtkScalars::MapThroughLookupTable (  int    id )  [protected]
 

unsigned char* vtkScalars::Luminance (  int    id )  [protected]
 


Member Data Documentation

float vtkScalars::Range[8] [protected]
 

Definition at line 199 of file vtkScalars.h.

vtkTimeStamp vtkScalars::ComputeTime [protected]
 

Definition at line 200 of file vtkScalars.h.

vtkLookupTable* vtkScalars::LookupTable [protected]
 

Definition at line 201 of file vtkScalars.h.

int vtkScalars::ActiveComponent [protected]
 

Definition at line 202 of file vtkScalars.h.

float vtkScalars::CurrentAlpha [protected]
 

Definition at line 205 of file vtkScalars.h.

vtkScalarsToColors* vtkScalars::CurrentLookupTable [protected]
 

Definition at line 206 of file vtkScalars.h.

unsigned char*(vtkScalars::* vtkScalars::CurrentColorFunction)(int id) [protected]
 

vtkUnsignedCharArray* vtkScalars::Colors [protected]
 

Definition at line 218 of file vtkScalars.h.

unsigned char vtkScalars::RGBA[4] [protected]
 

Definition at line 219 of file vtkScalars.h.


The documentation for this class was generated from the following file:
Generated on Wed Nov 21 12:59:59 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001