Man Page for vtkScalars
Table of Contents

NAME

vtkScalars - abstract interface to array of scalar data

SYNOPSIS


#include "/opt/vtk-c++/common/vtkScalars.h"

class VTK_EXPORT vtkScalars : public vtkReferenceCount

vtkScalars();
virtual ~vtkScalars();
const char *GetClassName() {return "vtkScalars";};
void PrintSelf(ostream& os, vtkIndent indent);
virtual int Allocate(const int sz, const int ext=1000) = 0;
virtual void *GetVoidPtr(const int id) {(void)(id); return NULL;};
virtual vtkScalars *MakeObject(int sze, int ext=1000) = 0;
virtual char *GetDataType() = 0;
virtual void GetDataTypeRange(float*) = 0;
virtual float GetDataTypeMin() = 0;
virtual float GetDataTypeMax() = 0;
virtual char *GetScalarType() {return "SingleValued";};
virtual int GetNumberOfValuesPerScalar() {return 1;};
virtual int GetNumberOfScalars() = 0;
virtual float GetScalar(int id) = 0;
virtual void SetNumberOfScalars(int number) = 0;
virtual void SetScalar(int id, float s) = 0;
virtual void InsertScalar(int id, float s) = 0;
virtual int InsertNextScalar(float s) = 0;
virtual void Squeeze() = 0;
virtual void GetScalars(vtkIdList& ptIds, vtkFloatScalars& fs);
virtual void GetScalars(int p1, int p2, vtkFloatScalars& fs);
virtual void ComputeRange();
float *GetRange();
void GetRange(float range[2]);
virtual void CreateDefaultLookupTable();
void SetLookupTable(vtkLookupTable *lut);
vtkLookupTable *GetLookupTable();

DESCRIPTION

vtkScalars provides an abstract interface to an array of scalar data. The data model for vtkScalars is an array accessible by point id. The subclasses of vtkScalars are concrete data types (float, int, etc.) that implement the interface of vtkScalars.

Scalars typically provide a single value per point. However, there are types of scalars that have multiple values per point (e.g., vtkPixmap or vtkAPixmap that provide three and four values per point, respectively). These are used when reading data in rgb and rgba form (e.g., images and volumes).

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

vtkBitScalars vtkColorScalars vtkFloatScalars vtkIntScalars vtkShortScalars vtkUnsignedCharScalars

DEFINED MACROS

VTK_FLOAT_MIN -1.0e+38F
VTK_FLOAT_MAX 1.0e+38F
VTK_INT_MIN (-2147483647-1)
VTK_INT_MAX 2147483647
VTK_SHORT_MIN -32768
VTK_SHORT_MAX 32767
VTK_UNSIGNED_SHORT_MIN 0
VTK_UNSIGNED_SHORT_MAX 65535
VTK_UNSIGNED_CHAR_MIN 0
VTK_UNSIGNED_CHAR_MAX 255

SUMMARY

virtual vtkScalars *MakeObject(int sze, int ext=1000) = 0; Create a copy of this object.

virtual char *GetDataType() = 0;
Return data type. One of "bit", "unsigned char", "short", "int", "float", or "double".

virtual void GetDataTypeRange(float*) = 0;
Return data type range (min and max values) in the array provided by the client.

virtual float GetDataTypeMin() = 0;
Return data type min value.

virtual float GetDataTypeMax() = 0;
Return data type max value.

virtual char *GetScalarType() {return "SingleValued";}; Return the type of scalar. Want to differentiate between single-valued scalars and multiple-valued (e.g., "color" scalars). Returns either "SingleValued" or "ColorScalar".

virtual int GetNumberOfValuesPerScalar() {return 1;};
Return the number of values per scalar. Should range between (1,4).

virtual int GetNumberOfScalars() = 0;
Return number of scalars in this object.

virtual float GetScalar(int id) = 0;
Return a float scalar value for a particular point id.

virtual void SetNumberOfScalars(int number) = 0;
Specify the number of scalars for this object to hold. Does an allocation as well as setting the MaxId ivar. Used in conjunction with SetScalar() method for fast insertion.

virtual void SetScalar(int id, float s) = 0;
Insert scalar into array. No range checking performed (fast!). Make sure you use SetNumberOfScalars() to allocate memory prior to using SetScalar().

virtual void InsertScalar(int id, float s) = 0;
Insert scalar into array. Range checking performed and memory allocated as necessary.

virtual int InsertNextScalar(float s) = 0;
Insert scalar into next available slot. Returns point id of slot.

virtual void Squeeze() = 0;
Reclaim any extra memory.

virtual void GetScalars(vtkIdList& ptIds, vtkFloatScalars& fs);
Get the scalar values for the point ids specified.

virtual void GetScalars(int p1, int p2, vtkFloatScalars& fs);
Get the scalar values for the range of points ids specified (i.e., p1->p2 inclusive). You must insure that the vtkFloatScalars has been previously allocated with enough space to hold the data.

virtual void CreateDefaultLookupTable();
Create default lookup table. Generally used to create one when none is available.

void GetScalars(vtkIdList& ptId, vtkFloatScalars& fs)
Given a list of point ids, return an array of scalar values.

void GetScalars(int p1, int p2, vtkFloatScalars& fs)
Given a range of point ids [p1,p2], return an array of scalar values. Make sure enough space has been allocated in the vtkFloatScalars object to hold all the values.

void ComputeRange()
Determine (rmin,rmax) range of scalar values.

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

void GetRange(float range[2])
Return the range of scalar values. Range copied into array provided.


Table of Contents