Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkAbstractArray.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkAbstractArray.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
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   // This function will only make sense once vtkDataArray is
00177   // re-parented to be a subclass of vtkAbstractArray.  It is
00178   // commented out for now.
00179 
00186 //  static vtkAbstractArray* CreateArray(int dataType);
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   // Construct object with default tuple dimension (number of components) of 1.
00211   vtkAbstractArray(vtkIdType numComp=1);
00212   ~vtkAbstractArray();
00213 
00214   vtkIdType Size;      // allocated size of data
00215   vtkIdType MaxId;     // maximum index inserted thus far
00216 
00217   char* Name;
00218 
00219   int DataType; // uses constants in vtkSystemIncludes.h
00220                                           
00221   
00222 private:
00223   vtkAbstractArray(const vtkAbstractArray&);  // Not implemented.
00224   void operator=(const vtkAbstractArray&);  // Not implemented.
00225 };
00226 
00227 #endif

Generated on Mon Jan 21 23:07:16 2008 for VTK by  doxygen 1.4.3-20050530