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

Represent a range of vtkm::Id values. More...

#include <RangeId.h>

Public Member Functions

VTKM_EXEC_CONT RangeId ()
 
VTKM_EXEC_CONT RangeId (vtkm::Id min, vtkm::Id max)
 
VTKM_EXEC_CONT bool IsNonEmpty () const
 Determine if the range is valid. More...
 
VTKM_EXEC_CONT bool Contains (vtkm::Id value) const
 Determines if a value is within the range. More...
 
VTKM_EXEC_CONT vtkm::Id Length () const
 Returns the length of the range. More...
 
VTKM_EXEC_CONT vtkm::Id Center () const
 Returns the center of the range. More...
 
VTKM_EXEC_CONT void Include (vtkm::Id value)
 Expand range to include a value. More...
 
VTKM_EXEC_CONT void Include (const vtkm::RangeId &range)
 Expand range to include other range. More...
 
VTKM_EXEC_CONT vtkm::RangeId Union (const vtkm::RangeId &other) const
 Return the union of this and another range. More...
 
VTKM_EXEC_CONT vtkm::RangeId operator+ (const vtkm::RangeId &other) const
 Operator for union More...
 
VTKM_EXEC_CONT bool operator== (const vtkm::RangeId &other) const
 
VTKM_EXEC_CONT bool operator!= (const vtkm::RangeId &other) const
 

Public Attributes

vtkm::Id Min
 
vtkm::Id Max
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RangeId() [1/2]

VTKM_EXEC_CONT vtkm::RangeId::RangeId ( )
inline

◆ RangeId() [2/2]

VTKM_EXEC_CONT vtkm::RangeId::RangeId ( vtkm::Id  min,
vtkm::Id  max 
)
inline

Member Function Documentation

◆ Center()

VTKM_EXEC_CONT vtkm::Id vtkm::RangeId::Center ( ) const
inline

Returns the center of the range.

Center computes the middle value of the range.

◆ Contains()

VTKM_EXEC_CONT bool vtkm::RangeId::Contains ( vtkm::Id  value) const
inline

Determines if a value is within the range.

Contains returns true if the give value is within the range, false otherwise.

◆ Include() [1/2]

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

◆ Include() [2/2]

VTKM_EXEC_CONT void vtkm::RangeId::Include ( vtkm::Id  value)
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.

◆ IsNonEmpty()

VTKM_EXEC_CONT bool vtkm::RangeId::IsNonEmpty ( ) const
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.

◆ Length()

VTKM_EXEC_CONT vtkm::Id vtkm::RangeId::Length ( ) const
inline

Returns the length of the range.

Length computes the distance between the min and max. If the range is empty, 0 is returned.

◆ operator!=()

VTKM_EXEC_CONT bool vtkm::RangeId::operator!= ( const vtkm::RangeId other) const
inline

◆ operator+()

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

Operator for union

◆ operator==()

VTKM_EXEC_CONT bool vtkm::RangeId::operator== ( const vtkm::RangeId other) const
inline

◆ Union()

VTKM_EXEC_CONT vtkm::RangeId vtkm::RangeId::Union ( const vtkm::RangeId other) const
inline

Return the union of this and another range.

This is a nondestructive form of Include.

Member Data Documentation

◆ Max

vtkm::Id vtkm::RangeId::Max

◆ Min

vtkm::Id vtkm::RangeId::Min

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