NAME
vtkUnsignedCharArray - dynamic, self-adjusting unsigned character array
SYNOPSIS
#include "/opt/vtk-c++/common/vtkUnsignedCharArray.h"
class VTK_EXPORT vtkUnsignedCharArray : public vtkReferenceCount
vtkUnsignedCharArray():Array(NULL),Size(0),MaxId(-1),Extend(1000) {};
int Allocate(const int sz, const int ext=1000);
void Initialize();
vtkUnsignedCharArray(const int sz, const int ext=1000);
vtkUnsignedCharArray(const vtkUnsignedCharArray& ia);
~vtkUnsignedCharArray();
static vtkUnsignedCharArray *New() {return new vtkUnsignedCharArray;};
const char *GetClassName() {return "vtkUnsignedCharArray";};
void PrintSelf(ostream& os, vtkIndent indent);
unsigned char GetValue(const int id);
void SetNumberOfValues(const int number);
void SetValue(const int id, const unsigned char value);
vtkUnsignedCharArray &InsertValue(const int id, const unsigned char c);
int InsertNextValue(const unsigned char c);
unsigned char *GetPointer(const int id);
unsigned char *WritePointer(const int id, const int number);
vtkUnsignedCharArray &operator=(const vtkUnsignedCharArray& ia);
void operator+=(const vtkUnsignedCharArray& ia);
void operator+=(const unsigned char c);
void Squeeze();
int GetSize();
int GetMaxId();
void Reset();
DESCRIPTION
vtkUnsignedCharArray is an array of unsigned character values. It provides methods for insertion and retrieval of characters, and will automatically resize itself to hold new data.
SUMMARY
unsigned char 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 unsigned char value) Set the data at a particular index. Does not do range checking. Make sure you use the method
SetNumberOfValues() before inserting data.
unsigned char *GetPointer(const int id)
Get the address of a particular data index.
unsigned char *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.
vtkUnsignedCharArray& InsertValue(const int id, const unsigned char c)
Insert data at a specified position in the array.
int InsertNextValue(const unsigned char c)
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. Objects appears like 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.
vtkUnsignedCharArray(const int sz, const int ext)
Construct with specified storage size and extend value.
vtkUnsignedCharArray(const vtkUnsignedCharArray& ia)
Construct array from another array. Copy each element of other array.
vtkUnsignedCharArray& operator=(const vtkUnsignedCharArray& ia)
Deep copy of another array.
void operator+=(const vtkUnsignedCharArray& ia)
Append one array onto the end of this array.