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