Man Page for vtkFloatArray
Table of Contents

NAME

vtkFloatArray - dynamic, self-adjusting floating point array

SYNOPSIS


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

class VTK_EXPORT vtkFloatArray : public vtkReferenceCount

vtkFloatArray():Array(NULL),Size(0),MaxId(-1),Extend(1000) {};
int Allocate(const int sz, const int ext=1000);
void Initialize();
vtkFloatArray(const int sz, const int ext=1000);
vtkFloatArray(const vtkFloatArray& fa);
~vtkFloatArray();
static vtkFloatArray *New() {return new vtkFloatArray;};
const char *GetClassName() {return "vtkFloatArray";};
void PrintSelf(ostream& os, vtkIndent indent);
float GetValue(const int id);
void SetNumberOfValues(const int number);
void SetValue(const int id, const float value);
vtkFloatArray &InsertValue(const int id, const float f);
int InsertNextValue(const float f);
float *GetPointer(const int id);
float *WritePointer(const int id, const int number);
vtkFloatArray &operator=(const vtkFloatArray& fa);
void operator+=(const vtkFloatArray& fa);
void operator+=(const float f);
void Squeeze();
int GetSize();
int GetMaxId();
void Reset();

DESCRIPTION

vtkFloatArray is an array of floating point numbers. It provides methods for insertion and retrieval of floating point values, and will automatically resize itself to hold new data.

SUMMARY

float GetValue(const int id)
Get the data at a particular index.

void SetNumberOfValues(const int number)
Specify the number of values for this object to hold. Does an allocation as well as setting the MaxId ivar. Used in conjunction with SetValue() method for fast insertion.

void SetValue(const int id, const float value)
Set the data at a particular index. Does not do range checking. Make sure you use the method SetNumberOfValues() before inserting data.

float *GetPointer(const int id)
Get the address of a particular data index.

float *WritePointer(const int id, const int number)
Get the address of a particular data index. Make sure data is allocated for the number of items requested. Set MaxId according to the number of data values requested.

vtkFloatArray& InsertValue(const int id, const float f) Insert data at a specified position in the array.

int InsertNextValue(const float f)
Insert data at the end of the array. Return its location in the array.

void Squeeze()
Resize object to just fit data requirement. Reclaims extra memory.

int GetSize()
Get the allocated size of the object in terms of number of data items.

int GetMaxId()
Returning the maximum index of data inserted so far.

void Reset()
Reuse the memory allocated by this object. Object appears as if no data has been previously inserted.

int Allocate(const int sz, const int ext)
Allocate memory for this array. Delete old storage only if necessary.

void Initialize()
Release storage and reset array to initial state.

vtkFloatArray(const int sz, const int ext)
Construct with specified storage and extend value.

vtkFloatArray(const vtkFloatArray& fa)
Construct array from another array. Copy each element of other array.

vtkFloatArray& operator=(const vtkFloatArray& fa)
Deep copy of another array.

void operator+=(const vtkFloatArray& fa)
Append one array onto the end of this array.


Table of Contents