00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00061 #ifndef __vtkArrayExtents_h
00062 #define __vtkArrayExtents_h
00063
00064 #include "vtkSystemIncludes.h"
00065 #include "vtkArrayRange.h"
00066 #include <vtksys/stl/vector>
00067
00068 class vtkArrayCoordinates;
00069
00070 class VTK_COMMON_EXPORT vtkArrayExtents
00071 {
00072 public:
00074 vtkArrayExtents();
00075
00077
00079 explicit vtkArrayExtents(const vtkIdType i);
00080
00081
00082 explicit vtkArrayExtents(const vtkArrayRange& i);
00084
00086
00088 vtkArrayExtents(const vtkIdType i, const vtkIdType j);
00089
00090
00091 vtkArrayExtents(const vtkArrayRange& i, const vtkArrayRange& j);
00093
00095
00098 vtkArrayExtents(const vtkIdType i, const vtkIdType j, const vtkIdType k);
00099
00100
00101 vtkArrayExtents(const vtkArrayRange& i, const vtkArrayRange& j, const vtkArrayRange& k);
00103
00106 static const vtkArrayExtents Uniform(vtkIdType n, vtkIdType m);
00107
00110 void Append(const vtkArrayRange& extent);
00111
00113 vtkIdType GetDimensions() const;
00114
00118 vtkIdType GetSize() const;
00119
00124 void SetDimensions(vtkIdType dimensions);
00125
00127 vtkArrayRange& operator[](vtkIdType i);
00128
00130 const vtkArrayRange& operator[](vtkIdType i) const;
00131
00133 bool operator==(const vtkArrayExtents& rhs) const;
00134
00136 bool operator!=(const vtkArrayExtents& rhs) const;
00137
00144 bool ZeroBased() const;
00145
00149 bool SameShape(const vtkArrayExtents& rhs) const;
00150
00152
00158 void GetLeftToRightCoordinatesN(vtkIdType n, vtkArrayCoordinates& coordinates) const;
00159
00160
00161
00162
00163
00164
00165 void GetRightToLeftCoordinatesN(vtkIdType n, vtkArrayCoordinates& coordinates) const;
00167
00172 bool Contains(const vtkArrayExtents& extents) const;
00173
00179 bool Contains(const vtkArrayCoordinates& coordinates) const;
00180
00181 VTK_COMMON_EXPORT friend ostream& operator<<(
00182 ostream& stream, const vtkArrayExtents& rhs);
00183
00184 private:
00185 vtksys_stl::vector<vtkArrayRange> Storage;
00186 };
00187
00188 #endif
00189