00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00043 #ifndef __vtkAbstractArray_h
00044 #define __vtkAbstractArray_h
00045
00046 #include "vtkObject.h"
00047
00048 class vtkIdList;
00049 class vtkIdTypeArray;
00050 class vtkDataArray;
00051
00052 #define VTK_MAXIMUM_NUMBER_OF_CACHED_COMPONENT_RANGES 11
00053
00054 class VTK_COMMON_EXPORT vtkAbstractArray : public vtkObject
00055 {
00056 public:
00057 vtkTypeRevisionMacro(vtkAbstractArray,vtkObject);
00058 void PrintSelf(ostream& os, vtkIndent indent);
00059
00062 virtual int Allocate(vtkIdType sz, vtkIdType ext=1000) = 0;
00063
00065 virtual void Initialize() = 0;
00066
00069 virtual int GetDataType() = 0;
00070
00072
00075 virtual int GetDataTypeSize() = 0;
00076 static unsigned long GetDataTypeSize(int type);
00078
00083 virtual void GetValues(vtkIdList *indices, vtkAbstractArray *output) = 0;
00084
00089 virtual void GetValues(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output) = 0;
00090
00095 virtual int GetNumberOfElementComponents() = 0;
00096
00101 virtual int GetElementComponentSize() = 0;
00102
00105 virtual void *GetVoidPointer(vtkIdType id) = 0;
00106
00109 virtual void DeepCopy(vtkAbstractArray *da) = 0;
00110
00112
00113 virtual void CopyValue(int toIndex, int fromIndex,
00114 vtkAbstractArray *sourceArray) = 0;
00116
00119 virtual void Squeeze() = 0;
00120
00122 virtual int Resize(vtkIdType numTuples) = 0;
00123
00125
00126 void Reset()
00127 {this->MaxId = -1;}
00129
00131
00132 vtkIdType GetSize()
00133 {return this->Size;}
00135
00137
00138 vtkIdType GetMaxId()
00139 {return this->MaxId;}
00141
00143
00149 virtual void SetVoidArray(void *vtkNotUsed(array),
00150 vtkIdType vtkNotUsed(size),
00151 int vtkNotUsed(save)) {};
00153
00160 virtual unsigned long GetActualMemorySize() = 0;
00161
00163
00164 void SetName(const char* name);
00165 const char* GetName();
00167
00169
00171 virtual const char *GetDataTypeAsString( void )
00172 { return vtkImageScalarTypeNameMacro( this->GetDataType() ); }
00174
00175
00176
00177
00178
00179
00186
00187
00190 virtual bool IsNumeric() = 0;
00191
00204 virtual void ConvertToContiguous(vtkDataArray **Data, vtkIdTypeArray **Offsets) = 0;
00205
00207 virtual void ConvertFromContiguous(vtkDataArray *Data, vtkIdTypeArray *Offsets) = 0;
00208
00209 protected:
00210
00211 vtkAbstractArray(vtkIdType numComp=1);
00212 ~vtkAbstractArray();
00213
00214 vtkIdType Size;
00215 vtkIdType MaxId;
00216
00217 char* Name;
00218
00219 int DataType;
00220
00221
00222 private:
00223 vtkAbstractArray(const vtkAbstractArray&);
00224 void operator=(const vtkAbstractArray&);
00225 };
00226
00227 #endif