VTK-m
2.2
|
Represent 2D integer range. More...
#include <RangeId2.h>
Public Member Functions | |
RangeId2 ()=default | |
Construct an empty 2D range. More... | |
RangeId2 (const vtkm::RangeId &xrange, const vtkm::RangeId &yrange) | |
Construct a range with the given x and y directions. More... | |
RangeId2 (vtkm::Id minX, vtkm::Id maxX, vtkm::Id minY, vtkm::Id maxY) | |
Construct a range with the given minimum (inclusive) and maximum (exclusive) points. More... | |
RangeId2 (const vtkm::Id range[4]) | |
Initialize range with an array of 4 values in the order xmin, xmax, ymin, ymax. More... | |
RangeId2 (const vtkm::Id2 &min, const vtkm::Id2 &max) | |
Initialize range with the minimum and the maximum corners. More... | |
bool | IsNonEmpty () const |
Determine if the range is non-empty. More... | |
bool | Contains (const vtkm::Id2 &val) const |
Determines if an Id2 value is within the range. More... | |
vtkm::Id2 | Center () const |
Returns the center of the range. More... | |
vtkm::Id2 | Dimensions () const |
template<typename T > | |
void | Include (const vtkm::Vec< T, 2 > &point) |
Expand range to include a value. More... | |
void | Include (const vtkm::RangeId2 &range) |
Expand range to include other range. More... | |
vtkm::RangeId2 | Union (const vtkm::RangeId2 &other) const |
Return the union of this and another range. More... | |
vtkm::RangeId2 | operator+ (const vtkm::RangeId2 &other) const |
Operator for union More... | |
bool | operator== (const vtkm::RangeId2 &range) const |
bool | operator!= (const vtkm::RangeId2 &range) const |
vtkm::RangeId & | operator[] (IdComponent c) noexcept |
const vtkm::RangeId & | operator[] (IdComponent c) const noexcept |
Public Attributes | |
vtkm::RangeId | X |
The range of values in the X direction. More... | |
vtkm::RangeId | Y |
The range of values in the Y direction. More... | |
Represent 2D integer range.
vtkm::RangeId2
is a helper class for representing a 2D range of integer values. The typical use of this class is to express a box of indices in the x and y directions.
RangeId2
also contains several helper functions for computing and maintaining the range.
|
default |
Construct an empty 2D range.
|
inline |
Construct a range with the given x and y directions.
Construct a range with the given minimum (inclusive) and maximum (exclusive) points.
|
inlineexplicit |
Initialize range with an array of 4 values in the order xmin, xmax, ymin, ymax.
Initialize range with the minimum and the maximum corners.
|
inline |
Returns the center of the range.
Center
computes the middle of the range.
|
inline |
Determines if an Id2 value is within the range.
|
inline |
|
inline |
Expand range to include other range.
This version of Include
expands the range just enough to include the other 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 include this value, then nothing is done.
|
inline |
Determine if the range is non-empty.
IsNonEmpty
returns true if the range is non-empty.
|
inline |
|
inline |
Operator for union
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Return the union of this and another range.
This is a nondestructive form of Include
.
vtkm::RangeId vtkm::RangeId2::X |
The range of values in the X direction.
The vtkm::RangeId
struct provides the minimum and maximum along that axis.
vtkm::RangeId vtkm::RangeId2::Y |
The range of values in the Y direction.
The vtkm::RangeId
struct provides the minimum and maximum along that axis.