VTK  9.4.20241222
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
31VTK_ABI_NAMESPACE_BEGIN
32class VTKCOMMONCORE_EXPORT vtkArrayRange
33{
34public:
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
88private:
92 CoordinateT Begin;
93
95
98 CoordinateT End;
100};
101
102VTK_ABI_NAMESPACE_END
103#endif
104// VTK-HeaderTest-Exclude: vtkArrayRange.h
Stores a half-open range of array coordinates.
vtkArrayRange()
Creates an empty range.
VTKCOMMONCORE_EXPORT friend bool operator==(const vtkArrayRange &lhs, const vtkArrayRange &rhs)
Equality comparisons.
VTKCOMMONCORE_EXPORT friend ostream & operator<<(ostream &stream, const vtkArrayRange &rhs)
Serialization.
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