VTK-m  2.2
Public Member Functions | Public Attributes | List of all members
vtkm::RangeId3 Struct Reference

Represent 3D integer range. More...

#include <RangeId3.h>

Public Member Functions

 RangeId3 ()=default
 Construct an empty 3D range. More...
 
 RangeId3 (const vtkm::RangeId &xrange, const vtkm::RangeId &yrange, const vtkm::RangeId &zrange)
 Construct a range with the given x, y, and z directions. More...
 
 RangeId3 (vtkm::Id minX, vtkm::Id maxX, vtkm::Id minY, vtkm::Id maxY, vtkm::Id minZ, vtkm::Id maxZ)
 Construct a range with the given minimum (inclusive) and maximum (exclusive) points. More...
 
 RangeId3 (const vtkm::Id range[6])
 Initialize range with an array of 6 values in the order xmin, xmax, ymin, ymax, zmin, zmax. More...
 
 RangeId3 (const vtkm::Id3 &min, const vtkm::Id3 &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::Id3 &val) const
 Determines if an Id3 value is within the range. More...
 
vtkm::Id3 Center () const
 Returns the center of the range. More...
 
vtkm::Id3 Dimensions () const
 
template<typename T >
void Include (const vtkm::Vec< T, 3 > &point)
 Expand range to include a value. More...
 
void Include (const vtkm::RangeId3 &range)
 Expand range to include other range. More...
 
vtkm::RangeId3 Union (const vtkm::RangeId3 &other) const
 Return the union of this and another range. More...
 
vtkm::RangeId3 operator+ (const vtkm::RangeId3 &other) const
 Operator for union More...
 
bool operator== (const vtkm::RangeId3 &range) const
 
bool operator!= (const vtkm::RangeId3 &range) const
 
vtkm::RangeIdoperator[] (IdComponent c) noexcept
 
const vtkm::RangeIdoperator[] (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...
 
vtkm::RangeId Z
 The range of values in the Z direction. More...
 

Detailed Description

Represent 3D integer range.

vtkm::RangeId3 is a helper class for representing a 3D range of integer values. The typical use of this class is to express a box of indices in the x, y, and z directions.

RangeId3 also contains several helper functions for computing and maintaining the range.

Constructor & Destructor Documentation

◆ RangeId3() [1/5]

vtkm::RangeId3::RangeId3 ( )
default

Construct an empty 3D range.

◆ RangeId3() [2/5]

vtkm::RangeId3::RangeId3 ( const vtkm::RangeId xrange,
const vtkm::RangeId yrange,
const vtkm::RangeId zrange 
)
inline

Construct a range with the given x, y, and z directions.

◆ RangeId3() [3/5]

vtkm::RangeId3::RangeId3 ( vtkm::Id  minX,
vtkm::Id  maxX,
vtkm::Id  minY,
vtkm::Id  maxY,
vtkm::Id  minZ,
vtkm::Id  maxZ 
)
inline

Construct a range with the given minimum (inclusive) and maximum (exclusive) points.

◆ RangeId3() [4/5]

vtkm::RangeId3::RangeId3 ( const vtkm::Id  range[6])
inlineexplicit

Initialize range with an array of 6 values in the order xmin, xmax, ymin, ymax, zmin, zmax.

◆ RangeId3() [5/5]

vtkm::RangeId3::RangeId3 ( const vtkm::Id3 min,
const vtkm::Id3 max 
)
inline

Initialize range with the minimum and the maximum corners.

Member Function Documentation

◆ Center()

vtkm::Id3 vtkm::RangeId3::Center ( ) const
inline

Returns the center of the range.

Center computes the middle of the range.

◆ Contains()

bool vtkm::RangeId3::Contains ( const vtkm::Id3 val) const
inline

Determines if an Id3 value is within the range.

◆ Dimensions()

vtkm::Id3 vtkm::RangeId3::Dimensions ( ) const
inline

◆ Include() [1/2]

void vtkm::RangeId3::Include ( const vtkm::RangeId3 range)
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.

◆ Include() [2/2]

template<typename T >
void vtkm::RangeId3::Include ( const vtkm::Vec< T, 3 > &  point)
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.

◆ IsNonEmpty()

bool vtkm::RangeId3::IsNonEmpty ( ) const
inline

Determine if the range is non-empty.

IsNonEmpty returns true if the range is non-empty.

◆ operator!=()

bool vtkm::RangeId3::operator!= ( const vtkm::RangeId3 range) const
inline

◆ operator+()

vtkm::RangeId3 vtkm::RangeId3::operator+ ( const vtkm::RangeId3 other) const
inline

Operator for union

◆ operator==()

bool vtkm::RangeId3::operator== ( const vtkm::RangeId3 range) const
inline

◆ operator[]() [1/2]

const vtkm::RangeId& vtkm::RangeId3::operator[] ( IdComponent  c) const
inlinenoexcept

◆ operator[]() [2/2]

vtkm::RangeId& vtkm::RangeId3::operator[] ( IdComponent  c)
inlinenoexcept

◆ Union()

vtkm::RangeId3 vtkm::RangeId3::Union ( const vtkm::RangeId3 other) const
inline

Return the union of this and another range.

This is a nondestructive form of Include.

Member Data Documentation

◆ X

vtkm::RangeId vtkm::RangeId3::X

The range of values in the X direction.

The vtkm::RangeId struct provides the minimum and maximum along that axis.

◆ Y

vtkm::RangeId vtkm::RangeId3::Y

The range of values in the Y direction.

The vtkm::RangeId struct provides the minimum and maximum along that axis.

◆ Z

vtkm::RangeId vtkm::RangeId3::Z

The range of values in the Z direction.

The vtkm::RangeId struct provides the minimum and maximum along that axis.


The documentation for this struct was generated from the following file: