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 
60 #ifndef vtkArrayExtents_h
61 #define vtkArrayExtents_h
62 
63 #include "vtkArrayRange.h"
64 #include "vtkCommonCoreModule.h" // For export macro
65 #include "vtkSystemIncludes.h"
66 #include <vector> // STL Header
67 
68 class VTKCOMMONCORE_EXPORT vtkArrayExtents
69 {
70 public:
73  typedef vtkTypeUInt64 SizeT;
74 
79 
84  explicit vtkArrayExtents(const CoordinateT i);
88  explicit vtkArrayExtents(const vtkArrayRange& i);
89 
94  vtkArrayExtents(const CoordinateT i, const CoordinateT j);
98  vtkArrayExtents(const vtkArrayRange& i, const vtkArrayRange& j);
99 
105  vtkArrayExtents(const CoordinateT i, const CoordinateT j, const CoordinateT k);
109  vtkArrayExtents(const vtkArrayRange& i, const vtkArrayRange& j, const vtkArrayRange& k);
110 
115  static vtkArrayExtents Uniform(DimensionT n, CoordinateT m);
116 
121  void Append(const vtkArrayRange& extent);
122 
126  DimensionT GetDimensions() const;
127 
133  SizeT GetSize() const;
134 
141  void SetDimensions(DimensionT dimensions);
142 
146  vtkArrayRange& operator[](DimensionT i);
147 
151  const vtkArrayRange& operator[](DimensionT i) const;
152 
156  vtkArrayRange GetExtent(DimensionT i) const;
157 
161  void SetExtent(DimensionT i, const vtkArrayRange&);
162 
166  bool operator==(const vtkArrayExtents& rhs) const;
167 
171  bool operator!=(const vtkArrayExtents& rhs) const;
172 
181  bool ZeroBased() const;
182 
189  bool SameShape(const vtkArrayExtents& rhs) const;
190 
199  void GetLeftToRightCoordinatesN(SizeT n, vtkArrayCoordinates& coordinates) const;
200 
209  void GetRightToLeftCoordinatesN(SizeT n, vtkArrayCoordinates& coordinates) const;
210 
217  bool Contains(const vtkArrayExtents& extents) const;
218 
226  bool Contains(const vtkArrayCoordinates& coordinates) const;
227 
228  VTKCOMMONCORE_EXPORT friend ostream& operator<<(ostream& stream, const vtkArrayExtents& rhs);
229 
230 private:
231  std::vector<vtkArrayRange> Storage;
232 };
233 
234 #endif
235 // VTK-HeaderTest-Exclude: vtkArrayExtents.h
vtkArrayExtents::SizeT
vtkTypeUInt64 SizeT
Definition: vtkArrayExtents.h:73
vtkArrayRange
Stores a half-open range of array coordinates.
Definition: vtkArrayRange.h:45
operator==
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
operator<<
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkIndent &o)
vtkArrayRange.h
vtkArrayCoordinates::DimensionT
vtkIdType DimensionT
Definition: vtkArrayCoordinates.h:55
vtkX3D::extent
Definition: vtkX3D.h:351
operator!=
VTKCOMMONCORE_EXPORT bool operator!=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
vtkArrayCoordinates::CoordinateT
vtkIdType CoordinateT
Definition: vtkArrayCoordinates.h:54
vtkArrayExtents::DimensionT
vtkArrayCoordinates::DimensionT DimensionT
Definition: vtkArrayExtents.h:71
vtkArrayExtents
Stores the number of dimensions and valid coordinate ranges along each dimension for vtkArray.
Definition: vtkArrayExtents.h:68
vtkArrayCoordinates
Stores coordinate into an N-way array.
Definition: vtkArrayCoordinates.h:51
vtkArrayExtents::CoordinateT
vtkArrayCoordinates::CoordinateT CoordinateT
Definition: vtkArrayExtents.h:72
vtkSystemIncludes.h