VTK  9.3.20240301
vtkArrayRange.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4 
24 #ifndef vtkArrayRange_h
25 #define vtkArrayRange_h
26 
27 #include "vtkArrayCoordinates.h"
28 #include "vtkCommonCoreModule.h" // For export macro
29 #include "vtkSystemIncludes.h"
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 class VTKCOMMONCORE_EXPORT vtkArrayRange
33 {
34 public:
36 
41 
48 
53 
58 
63 
68  bool Contains(const vtkArrayRange& range) const;
69 
73  bool Contains(CoordinateT coordinate) const;
74 
76 
79  VTKCOMMONCORE_EXPORT friend bool operator==(const vtkArrayRange& lhs, const vtkArrayRange& rhs);
80  VTKCOMMONCORE_EXPORT friend bool operator!=(const vtkArrayRange& lhs, const vtkArrayRange& rhs);
82 
86  VTKCOMMONCORE_EXPORT friend ostream& operator<<(ostream& stream, const vtkArrayRange& rhs);
87 
88 private:
92  CoordinateT Begin;
93 
95 
98  CoordinateT End;
100 };
101 
102 VTK_ABI_NAMESPACE_END
103 #endif
104 // VTK-HeaderTest-Exclude: vtkArrayRange.h
Stores a half-open range of array coordinates.
Definition: vtkArrayRange.h:33
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:35
VTKCOMMONCORE_EXPORT friend ostream & operator<<(ostream &stream, const vtkArrayRange &rhs)
Serialization.
@ range
Definition: vtkX3D.h:238