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 protected:
00042 void CollectRevisions(ostream& os);
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 typedef T ValueType;
00092 protected:
00093 vtkArrayIteratorTemplate();
00094 ~vtkArrayIteratorTemplate();
00095
00096 T* Pointer;
00097 private:
00098 vtkArrayIteratorTemplate(const vtkArrayIteratorTemplate&);
00099 void operator=(const vtkArrayIteratorTemplate&);
00100
00101 void SetArray(vtkAbstractArray*);
00102 vtkAbstractArray* Array;
00103 };
00104
00105 #if !defined(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
00106 # define VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(T) \
00107 template class VTK_COMMON_EXPORT vtkArrayIteratorTemplate< T >
00108 #else
00109 # include "vtkArrayIteratorTemplateImplicit.txx"
00110 # define VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(T)
00111 #endif // !defined(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
00112
00113 #endif // !defined(__vtkArrayIteratorTemplate_h)
00114
00115
00116
00117
00118 #if defined(VTK_ARRAY_ITERATOR_TEMPLATE_TYPE)
00119 # if defined(VTK_BUILD_SHARED_LIBS) && defined(_MSC_VER)
00120 # pragma warning (push)
00121 # pragma warning (disable: 4091) // warning C4091: 'extern ' :
00122
00123 # pragma warning (disable: 4231) // Compiler-specific extension warning.
00124
00125
00126 extern VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(VTK_ARRAY_ITERATOR_TEMPLATE_TYPE);
00127 # pragma warning (pop)
00128 # endif
00129 # undef VTK_ARRAY_ITERATOR_TEMPLATE_TYPE
00130 #endif
00131