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

Represent a continuous scalar range of values. More...

#include <Range.h>

Public Member Functions

VTKM_EXEC_CONT Range ()
 
 Range (const Range &)=default
 
 Range (Range &&)=default
 
template<typename T1 , typename T2 >
VTKM_EXEC_CONT Range (const T1 &min, const T2 &max)
 
vtkm::Rangeoperator= (const vtkm::Range &src)=default
 
vtkm::Rangeoperator= (vtkm::Range &&src)=default
 
VTKM_EXEC_CONT bool IsNonEmpty () const
 Determine if the range is valid (i.e. More...
 
template<typename T >
VTKM_EXEC_CONT bool Contains (const T &value) const
 Determines if a value is within the range. More...
 
VTKM_EXEC_CONT vtkm::Float64 Length () const
 Returns the length of the range. More...
 
VTKM_EXEC_CONT vtkm::Float64 Center () const
 Returns the center of the range. More...
 
template<typename T >
VTKM_EXEC_CONT void Include (const T &value)
 Expand range to include a value. More...
 
VTKM_EXEC_CONT void Include (const vtkm::Range &range)
 Expand range to include other range. More...
 
VTKM_EXEC_CONT vtkm::Range Union (const vtkm::Range &otherRange) const
 Return the union of this and another range. More...
 
VTKM_EXEC_CONT vtkm::Range operator+ (const vtkm::Range &otherRange) const
 Operator for union More...
 
VTKM_EXEC_CONT bool operator== (const vtkm::Range &otherRange) const
 
VTKM_EXEC_CONT bool operator!= (const vtkm::Range &otherRange) const
 

Public Attributes

vtkm::Float64 Min
 
vtkm::Float64 Max
 

Detailed Description

Represent a continuous scalar range of values.

vtkm::Range is a helper class for representing a range of floating point values from a minimum value to a maximum value. This is specified simply enough with a Min and Max value.

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

Constructor & Destructor Documentation

VTKM_EXEC_CONT vtkm::Range::Range ( )
inline
vtkm::Range::Range ( const Range )
default
vtkm::Range::Range ( Range &&  )
default
template<typename T1 , typename T2 >
VTKM_EXEC_CONT vtkm::Range::Range ( const T1 &  min,
const T2 &  max 
)
inline

Member Function Documentation

VTKM_EXEC_CONT vtkm::Float64 vtkm::Range::Center ( ) const
inline

Returns the center of the range.

Center computes the middle value of the range. If the range is empty, NaN is returned.

template<typename T >
VTKM_EXEC_CONT bool vtkm::Range::Contains ( const T &  value) const
inline

Determines if a value is within the range.

Contains returns true if the give value is within the range, false otherwise. Contains treats the min and max as inclusive. That is, if the value is exactly the min or max, true is returned.

template<typename T >
VTKM_EXEC_CONT void vtkm::Range::Include ( const T &  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.

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

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

Determine if the range is valid (i.e.

has at least one valid point).

IsNonEmpty return true if the range contains some valid values between Min and Max. If Max is less than Min, then no values satisfy the range and IsNonEmpty returns false. Otherwise, return true.

IsNonEmpty assumes Min and Max are inclusive. That is, if they are equal then true is returned.

VTKM_EXEC_CONT vtkm::Float64 vtkm::Range::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.

VTKM_EXEC_CONT bool vtkm::Range::operator!= ( const vtkm::Range otherRange) const
inline
VTKM_EXEC_CONT vtkm::Range vtkm::Range::operator+ ( const vtkm::Range otherRange) const
inline

Operator for union

vtkm::Range& vtkm::Range::operator= ( const vtkm::Range src)
default
vtkm::Range& vtkm::Range::operator= ( vtkm::Range &&  src)
default
VTKM_EXEC_CONT bool vtkm::Range::operator== ( const vtkm::Range otherRange) const
inline
VTKM_EXEC_CONT vtkm::Range vtkm::Range::Union ( const vtkm::Range otherRange) const
inline

Return the union of this and another range.

This is a nondestructive form of Include.

Member Data Documentation

vtkm::Float64 vtkm::Range::Max
vtkm::Float64 vtkm::Range::Min

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