VTK  9.2.20230606
vtkArrayRange.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkArrayRange.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 vtkArrayRange_h
61 #define vtkArrayRange_h
62 
63 #include "vtkArrayCoordinates.h"
64 #include "vtkCommonCoreModule.h" // For export macro
65 #include "vtkSystemIncludes.h"
66 
67 VTK_ABI_NAMESPACE_BEGIN
68 class VTKCOMMONCORE_EXPORT vtkArrayRange
69 {
70 public:
72 
77 
84 
89 
94 
99 
104  bool Contains(const vtkArrayRange& range) const;
105 
109  bool Contains(CoordinateT coordinate) const;
110 
112 
115  VTKCOMMONCORE_EXPORT friend bool operator==(const vtkArrayRange& lhs, const vtkArrayRange& rhs);
116  VTKCOMMONCORE_EXPORT friend bool operator!=(const vtkArrayRange& lhs, const vtkArrayRange& rhs);
118 
122  VTKCOMMONCORE_EXPORT friend ostream& operator<<(ostream& stream, const vtkArrayRange& rhs);
123 
124 private:
128  CoordinateT Begin;
129 
131 
134  CoordinateT End;
136 };
137 
138 VTK_ABI_NAMESPACE_END
139 #endif
140 // VTK-HeaderTest-Exclude: vtkArrayRange.h
Stores a half-open range of array coordinates.
Definition: vtkArrayRange.h:69
vtkArrayRange()
Creates an empty range.
VTKCOMMONCORE_EXPORT friend bool operator==(const vtkArrayRange &lhs, const vtkArrayRange &rhs)
Equality comparisons.
bool Contains(CoordinateT coordinate) const
Returns true iff the given coordinate falls within this range.
CoordinateT GetBegin() const
Returns the beginning of the range.
CoordinateT GetSize() const
Returns the size of the range (the distance End - Begin).
VTKCOMMONCORE_EXPORT friend bool operator!=(const vtkArrayRange &lhs, const vtkArrayRange &rhs)
Equality comparisons.
vtkArrayRange(CoordinateT begin, CoordinateT end)
Creates a half-open range [begin, end).
bool Contains(const vtkArrayRange &range) const
Returns true iff the given range is a non-overlapping subset of this range.
CoordinateT GetEnd() const
Returns one-past-the-end of the range.
vtkArrayCoordinates::CoordinateT CoordinateT
Definition: vtkArrayRange.h:71
VTKCOMMONCORE_EXPORT friend ostream & operator<<(ostream &stream, const vtkArrayRange &rhs)
Serialization.
@ range
Definition: vtkX3D.h:250