VTK-m
2.2
|
Represent a range of vtkm::Id values. More...
#include <RangeId.h>
Public Member Functions | |
RangeId () | |
Construct a range with no indices. More... | |
RangeId (vtkm::Id min, vtkm::Id max) | |
Construct a range with the given minimum (inclusive) and maximum (exclusive) indices. More... | |
bool | IsNonEmpty () const |
Determine if the range is valid. More... | |
bool | Contains (vtkm::Id value) const |
Determines if a value is within the range. More... | |
vtkm::Id | Length () const |
Returns the length of the range. More... | |
vtkm::Id | Center () const |
Returns the center of the range. More... | |
void | Include (vtkm::Id value) |
Expand range to include a value. More... | |
void | Include (const vtkm::RangeId &range) |
Expand range to include other range. More... | |
vtkm::RangeId | Union (const vtkm::RangeId &other) const |
Return the union of this and another range. More... | |
vtkm::RangeId | operator+ (const vtkm::RangeId &other) const |
Operator for union More... | |
bool | operator== (const vtkm::RangeId &other) const |
bool | operator!= (const vtkm::RangeId &other) const |
Public Attributes | |
vtkm::Id | Min |
The minimum index of the range (inclusive). More... | |
vtkm::Id | Max |
The maximum index of the range (exclusive). More... | |
Represent a range of vtkm::Id values.
vtkm::RangeId
is a helper class for representing a range of vtkm::Id values. This is specified simply with a Min
and Max
value, where Max
is exclusive.
RangeId
also contains several helper functions for computing and maintaining the range.
|
inline |
Construct a range with no indices.
Construct a range with the given minimum (inclusive) and maximum (exclusive) indices.
|
inline |
Returns the center of the range.
Center
computes the middle value of the range.
|
inline |
Determines if a value is within the range.
Contains
returns true if the give value is within the range, false otherwise.
|
inline |
Expand range to include other range.
This version of Include
expands this range just enough to include that of another range. Essentially it is the union of the two ranges.
|
inline |
Expand range to include a value.
This version of Include
expands the range just enough to include the given value. If the range already includes this value, then nothing is done.
|
inline |
Determine if the range is valid.
IsNonEmpty
return true if the range contains some valid values between Min
and Max
. If Max
<= Min
, then no values satisfy the range and IsNonEmpty
returns false. Otherwise, return true.
|
inline |
Returns the length of the range.
Length
computes the distance between the min and max. If the range is empty, 0 is returned.
|
inline |
|
inline |
Operator for union
|
inline |
|
inline |
Return the union of this and another range.
This is a nondestructive form of Include
.
vtkm::Id vtkm::RangeId::Max |
The maximum index of the range (exclusive).
vtkm::Id vtkm::RangeId::Min |
The minimum index of the range (inclusive).