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

Represent 2D integer range. More...

#include <RangeId2.h>

Public Member Functions

 RangeId2 ()=default
 
VTKM_EXEC_CONT RangeId2 (const vtkm::RangeId &xrange, const vtkm::RangeId &yrange)
 
VTKM_EXEC_CONT RangeId2 (vtkm::Id minX, vtkm::Id maxX, vtkm::Id minY, vtkm::Id maxY)
 
VTKM_EXEC_CONT RangeId2 (const vtkm::Id range[4])
 Initialize range with an array of 6 values in the order xmin, xmax, ymin, ymax, zmin, zmax. More...
 
VTKM_EXEC_CONT RangeId2 (const vtkm::Id2 &min, const vtkm::Id2 &max)
 Initialize range with the minimum and the maximum corners. More...
 
VTKM_EXEC_CONT bool IsNonEmpty () const
 Determine if the range is non-empty. More...
 
VTKM_EXEC_CONT bool Contains (const vtkm::Id2 &val) const
 Determines if an Id2 value is within the range. More...
 
VTKM_EXEC_CONT vtkm::Id2 Center () const
 Returns the center of the range. More...
 
VTKM_EXEC_CONT vtkm::Id2 Dimensions () const
 
template<typename T >
VTKM_EXEC_CONT void Include (const vtkm::Vec< T, 2 > &point)
 Expand range to include a value. More...
 
VTKM_EXEC_CONT void Include (const vtkm::RangeId2 &range)
 Expand range to include other range. More...
 
VTKM_EXEC_CONT vtkm::RangeId2 Union (const vtkm::RangeId2 &other) const
 Return the union of this and another range. More...
 
VTKM_EXEC_CONT vtkm::RangeId2 operator+ (const vtkm::RangeId2 &other) const
 Operator for union More...
 
VTKM_EXEC_CONT bool operator== (const vtkm::RangeId2 &range) const
 
VTKM_EXEC_CONT bool operator!= (const vtkm::RangeId2 &range) const
 
VTKM_EXEC_CONT vtkm::RangeIdoperator[] (IdComponent c) noexcept
 
const VTKM_EXEC_CONT vtkm::RangeIdoperator[] (IdComponent c) const noexcept
 

Public Attributes

vtkm::RangeId X
 
vtkm::RangeId Y
 

Detailed Description

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, y, and z directions.

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

Constructor & Destructor Documentation

◆ RangeId2() [1/5]

vtkm::RangeId2::RangeId2 ( )
default

◆ RangeId2() [2/5]

VTKM_EXEC_CONT vtkm::RangeId2::RangeId2 ( const vtkm::RangeId xrange,
const vtkm::RangeId yrange 
)
inline

◆ RangeId2() [3/5]

VTKM_EXEC_CONT vtkm::RangeId2::RangeId2 ( vtkm::Id  minX,
vtkm::Id  maxX,
vtkm::Id  minY,
vtkm::Id  maxY 
)
inline

◆ RangeId2() [4/5]

VTKM_EXEC_CONT vtkm::RangeId2::RangeId2 ( const vtkm::Id  range[4])
inlineexplicit

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

◆ RangeId2() [5/5]

VTKM_EXEC_CONT vtkm::RangeId2::RangeId2 ( const vtkm::Id2 min,
const vtkm::Id2 max 
)
inline

Initialize range with the minimum and the maximum corners.

Member Function Documentation

◆ Center()

VTKM_EXEC_CONT vtkm::Id2 vtkm::RangeId2::Center ( ) const
inline

Returns the center of the range.

Center computes the middle of the range.

◆ Contains()

VTKM_EXEC_CONT bool vtkm::RangeId2::Contains ( const vtkm::Id2 val) const
inline

Determines if an Id2 value is within the range.

◆ Dimensions()

VTKM_EXEC_CONT vtkm::Id2 vtkm::RangeId2::Dimensions ( ) const
inline

◆ Include() [1/2]

VTKM_EXEC_CONT void vtkm::RangeId2::Include ( const vtkm::RangeId2 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 >
VTKM_EXEC_CONT void vtkm::RangeId2::Include ( const vtkm::Vec< T, 2 > &  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()

VTKM_EXEC_CONT bool vtkm::RangeId2::IsNonEmpty ( ) const
inline

Determine if the range is non-empty.

IsNonEmpty returns true if the range is non-empty.

◆ operator!=()

VTKM_EXEC_CONT bool vtkm::RangeId2::operator!= ( const vtkm::RangeId2 range) const
inline

◆ operator+()

VTKM_EXEC_CONT vtkm::RangeId2 vtkm::RangeId2::operator+ ( const vtkm::RangeId2 other) const
inline

Operator for union

◆ operator==()

VTKM_EXEC_CONT bool vtkm::RangeId2::operator== ( const vtkm::RangeId2 range) const
inline

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ Union()

VTKM_EXEC_CONT vtkm::RangeId2 vtkm::RangeId2::Union ( const vtkm::RangeId2 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::RangeId2::X

◆ Y

vtkm::RangeId vtkm::RangeId2::Y

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