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:
[legend]Collaboration diagram for vtkScalars:
[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] |
|
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] |
|
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::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] |
|
void vtkScalars::SetScalar |
( |
int |
id, |
|
|
float |
s |
|
) |
[inline] |
|
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] |
|
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. |
|
Set/get the lookup table associated with this scalar data, if any. |
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] |
|
void vtkScalars::operator= |
( |
const vtkScalars & |
|
) |
[inline, protected] |
|
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]
|
|
int vtkScalars::ActiveComponent [protected]
|
|
float vtkScalars::CurrentAlpha [protected]
|
|
unsigned char*(vtkScalars::* vtkScalars::CurrentColorFunction)(int id) [protected]
|
|
unsigned char vtkScalars::RGBA[4] [protected]
|
|
The documentation for this class was generated from the following file:
Generated on Wed Nov 21 12:59:59 2001 for VTK by
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001