VTK  9.2.6
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 
63 #ifndef vtkArrayExtents_h
64 #define vtkArrayExtents_h
65 
66 #include "vtkArrayRange.h"
67 #include "vtkCommonCoreModule.h" // For export macro
68 #include "vtkSystemIncludes.h"
69 #include <vector> // STL Header
70 
71 class VTKCOMMONCORE_EXPORT vtkArrayExtents
72 {
73 public:
76  typedef vtkTypeUInt64 SizeT;
77 
82 
87  explicit vtkArrayExtents(const CoordinateT i);
91  explicit vtkArrayExtents(const vtkArrayRange& i);
92 
97  vtkArrayExtents(const CoordinateT i, const CoordinateT j);
101  vtkArrayExtents(const vtkArrayRange& i, const vtkArrayRange& j);
102 
108  vtkArrayExtents(const CoordinateT i, const CoordinateT j, const CoordinateT k);
112  vtkArrayExtents(const vtkArrayRange& i, const vtkArrayRange& j, const vtkArrayRange& k);
113 
118  static vtkArrayExtents Uniform(DimensionT n, CoordinateT m);
119 
124  void Append(const vtkArrayRange& extent);
125 
129  DimensionT GetDimensions() const;
130 
136  SizeT GetSize() const;
137 
144  void SetDimensions(DimensionT dimensions);
145 
149  vtkArrayRange& operator[](DimensionT i);
150 
154  const vtkArrayRange& operator[](DimensionT i) const;
155 
159  vtkArrayRange GetExtent(DimensionT i) const;
160 
164  void SetExtent(DimensionT i, const vtkArrayRange&);
165 
169  bool operator==(const vtkArrayExtents& rhs) const;
170 
174  bool operator!=(const vtkArrayExtents& rhs) const;
175 
184  bool ZeroBased() const;
185 
192  bool SameShape(const vtkArrayExtents& rhs) const;
193 
202  void GetLeftToRightCoordinatesN(SizeT n, vtkArrayCoordinates& coordinates) const;
203 
212  void GetRightToLeftCoordinatesN(SizeT n, vtkArrayCoordinates& coordinates) const;
213 
220  bool Contains(const vtkArrayExtents& extents) const;
221 
229  bool Contains(const vtkArrayCoordinates& coordinates) const;
230 
231  VTKCOMMONCORE_EXPORT friend ostream& operator<<(ostream& stream, const vtkArrayExtents& rhs);
232 
233 private:
234  std::vector<vtkArrayRange> Storage;
235 };
236 
237 #endif
238 // 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...
bool VTKCOMMONDATAMODEL_EXPORT operator!=(vtkEdgeBase e1, vtkEdgeBase e2)
Stores a half-open range of array coordinates.
Definition: vtkArrayRange.h:48
bool VTKCOMMONDATAMODEL_EXPORT operator==(vtkEdgeBase e1, vtkEdgeBase e2)
vtkTypeUInt64 SizeT
vtkArrayCoordinates::CoordinateT CoordinateT
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkIndent &o)
vtkArrayCoordinates::DimensionT DimensionT