00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00026 #ifndef __vtkArrayIteratorTemplate_h
00027 #define __vtkArrayIteratorTemplate_h
00028
00029 #include "vtkArrayIterator.h"
00030
00031 template <class T>
00032 class VTK_COMMON_EXPORT vtkArrayIteratorTemplate : public vtkArrayIterator
00033 {
00034 public:
00035 static vtkArrayIteratorTemplate<T>* New();
00036 typedef vtkArrayIterator Superclass;
00037 private:
00038 virtual const char* GetClassNameInternal() const
00039 { return "vtkArrayIteratorTemplate"; }
00040
00041 public:
00042 void PrintSelf(ostream& os, vtkIndent indent);
00043
00048 virtual void Initialize(vtkAbstractArray* array);
00049
00051 vtkAbstractArray* GetArray(){ return this->Array; }
00052
00053
00055 T* GetTuple(vtkIdType id);
00056
00058
00059 T& GetValue(vtkIdType id)
00060 { return this->Pointer[id]; }
00062
00064
00067 void SetValue(vtkIdType id, T value)
00068 {
00069 this->Pointer[id] = value;
00070 }
00072
00074 vtkIdType GetNumberOfTuples();
00075
00077 vtkIdType GetNumberOfValues();
00078
00080 int GetNumberOfComponents();
00081
00083 int GetDataType();
00084
00086 int GetDataTypeSize();
00087
00089 typedef T ValueType;
00090 protected:
00091 vtkArrayIteratorTemplate();
00092 ~vtkArrayIteratorTemplate();
00093
00094 T* Pointer;
00095 private:
00096 vtkArrayIteratorTemplate(const vtkArrayIteratorTemplate&);
00097 void operator=(const vtkArrayIteratorTemplate&);
00098
00099 void SetArray(vtkAbstractArray*);
00100 vtkAbstractArray* Array;
00101 };
00102
00103 #if !defined(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
00104 # define VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(T) \
00105 template class VTK_COMMON_EXPORT vtkArrayIteratorTemplate< T >
00106 #else
00107 # include "vtkArrayIteratorTemplateImplicit.txx"
00108 # define VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(T)
00109 #endif // !defined(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
00110
00111 #endif // !defined(__vtkArrayIteratorTemplate_h)
00112
00113
00114
00115
00116 #if defined(VTK_ARRAY_ITERATOR_TEMPLATE_TYPE)
00117 # if defined(VTK_BUILD_SHARED_LIBS) && defined(_MSC_VER)
00118 # pragma warning (push)
00119 # pragma warning (disable: 4091) // warning C4091: 'extern ' :
00120
00121 # pragma warning (disable: 4231) // Compiler-specific extension warning.
00122
00123
00124 extern VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(VTK_ARRAY_ITERATOR_TEMPLATE_TYPE);
00125 # pragma warning (pop)
00126 # endif
00127 # undef VTK_ARRAY_ITERATOR_TEMPLATE_TYPE
00128 #endif
00129