VTK
vtkArrayExtents.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkArrayExtents.h
5 
6 -------------------------------------------------------------------------
7  Copyright 2008 Sandia Corporation.
8  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9  the U.S. Government retains certain rights in this software.
10 -------------------------------------------------------------------------
11 
12  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13  All rights reserved.
14  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15 
16  This software is distributed WITHOUT ANY WARRANTY; without even
17  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18  PURPOSE. See the above copyright notice for more information.
19 
20 =========================================================================*/
21 
65 #ifndef vtkArrayExtents_h
66 #define vtkArrayExtents_h
67 
68 #include "vtkCommonCoreModule.h" // For export macro
69 #include "vtkSystemIncludes.h"
70 #include "vtkArrayRange.h"
71 #include <vector> // STL Header
72 
74 {
75 public:
78  typedef vtkTypeUInt64 SizeT;
79 
82 
85  explicit vtkArrayExtents(const CoordinateT i);
87  explicit vtkArrayExtents(const vtkArrayRange& i);
88 
92  vtkArrayExtents(const CoordinateT i, const CoordinateT j);
94  vtkArrayExtents(const vtkArrayRange& i, const vtkArrayRange& j);
95 
99  vtkArrayExtents(const CoordinateT i, const CoordinateT j, const CoordinateT k);
101  vtkArrayExtents(const vtkArrayRange& i, const vtkArrayRange& j, const vtkArrayRange& k);
102 
105  static const vtkArrayExtents Uniform(DimensionT n, CoordinateT m);
106 
109  void Append(const vtkArrayRange& extent);
110 
112  DimensionT GetDimensions() const;
113 
117  SizeT GetSize() const;
118 
123  void SetDimensions(DimensionT dimensions);
124 
126  vtkArrayRange& operator[](DimensionT i);
127 
129  const vtkArrayRange& operator[](DimensionT i) const;
130 
132  vtkArrayRange GetExtent(DimensionT i) const;
133 
135  void SetExtent(DimensionT i, const vtkArrayRange&);
136 
138  bool operator==(const vtkArrayExtents& rhs) const;
139 
141  bool operator!=(const vtkArrayExtents& rhs) const;
142 
149  bool ZeroBased() const;
150 
154  bool SameShape(const vtkArrayExtents& rhs) const;
155 
162  void GetLeftToRightCoordinatesN(SizeT n, vtkArrayCoordinates& coordinates) const;
163 
170  void GetRightToLeftCoordinatesN(SizeT n, vtkArrayCoordinates& coordinates) const;
171 
176  bool Contains(const vtkArrayExtents& extents) const;
177 
183  bool Contains(const vtkArrayCoordinates& coordinates) const;
184 
185  VTKCOMMONCORE_EXPORT friend ostream& operator<<(
186  ostream& stream, const vtkArrayExtents& rhs);
187 
188 private:
189  //BTX
190  std::vector<vtkArrayRange> Storage;
191  //ETX
192 };
193 
194 #endif
195 // VTK-HeaderTest-Exclude: vtkArrayExtents.h
Stores coordinate into an N-way array.
Stores the number of dimensions and valid coordinate ranges along each dimension for vtkArray...
#define VTKCOMMONCORE_EXPORT
Stores a half-open range of array coordinates.
Definition: vtkArrayRange.h:50
vtkTypeUInt64 SizeT
vtkArrayCoordinates::CoordinateT CoordinateT
VTKCOMMONCORE_EXPORT bool operator!=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkIndent &o)
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
vtkArrayCoordinates::DimensionT DimensionT