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

Represent an axis-aligned 3D bounds in space. More...

#include <Bounds.h>

Collaboration diagram for vtkm::Bounds:
Collaboration graph
[legend]

Public Member Functions

VTKM_EXEC_CONT Bounds ()
 
 Bounds (const Bounds &)=default
 
VTKM_EXEC_CONT Bounds (const vtkm::Range &xRange, const vtkm::Range &yRange, const vtkm::Range &zRange)
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
VTKM_EXEC_CONT Bounds (const T1 &minX, const T2 &maxX, const T3 &minY, const T4 &maxY, const T5 &minZ, const T6 &maxZ)
 
template<typename T >
VTKM_EXEC_CONT Bounds (const T bounds[6])
 Initialize bounds with an array of 6 values in the order xmin, xmax, ymin, ymax, zmin, zmax. More...
 
template<typename T >
VTKM_EXEC_CONT Bounds (const vtkm::Vec< T, 3 > &minPoint, const vtkm::Vec< T, 3 > &maxPoint)
 Initialize bounds with the minimum corner point and the maximum corner point. More...
 
vtkm::Boundsoperator= (const vtkm::Bounds &src)=default
 
VTKM_EXEC_CONT bool IsNonEmpty () const
 Determine if the bounds are valid (i.e. More...
 
template<typename T >
VTKM_EXEC_CONT bool Contains (const vtkm::Vec< T, 3 > &point) const
 Determines if a point coordinate is within the bounds. More...
 
VTKM_EXEC_CONT vtkm::Vec3f_64 Center () const
 Returns the center of the range. More...
 
template<typename T >
VTKM_EXEC_CONT void Include (const vtkm::Vec< T, 3 > &point)
 Expand bounds to include a point. More...
 
VTKM_EXEC_CONT void Include (const vtkm::Bounds &bounds)
 Expand bounds to include other bounds. More...
 
VTKM_EXEC_CONT vtkm::Bounds Union (const vtkm::Bounds &otherBounds) const
 Return the union of this and another bounds. More...
 
VTKM_EXEC_CONT vtkm::Bounds operator+ (const vtkm::Bounds &otherBounds) const
 Operator for union More...
 
VTKM_EXEC_CONT bool operator== (const vtkm::Bounds &bounds) const
 
VTKM_EXEC_CONT bool operator!= (const vtkm::Bounds &bounds) const
 

Public Attributes

vtkm::Range X
 
vtkm::Range Y
 
vtkm::Range Z
 

Detailed Description

Represent an axis-aligned 3D bounds in space.

vtkm::Bounds is a helper class for representing the axis-aligned box representing some region in space. The typical use of this class is to express the containing box of some geometry. The box is specified as ranges in the x, y, and z directions.

Bounds also contains several helper functions for computing and maintaining the bounds.

Constructor & Destructor Documentation

VTKM_EXEC_CONT vtkm::Bounds::Bounds ( )
inline
vtkm::Bounds::Bounds ( const Bounds )
default
VTKM_EXEC_CONT vtkm::Bounds::Bounds ( const vtkm::Range xRange,
const vtkm::Range yRange,
const vtkm::Range zRange 
)
inline
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
VTKM_EXEC_CONT vtkm::Bounds::Bounds ( const T1 &  minX,
const T2 &  maxX,
const T3 &  minY,
const T4 &  maxY,
const T5 &  minZ,
const T6 &  maxZ 
)
inline
template<typename T >
VTKM_EXEC_CONT vtkm::Bounds::Bounds ( const T  bounds[6])
inlineexplicit

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

template<typename T >
VTKM_EXEC_CONT vtkm::Bounds::Bounds ( const vtkm::Vec< T, 3 > &  minPoint,
const vtkm::Vec< T, 3 > &  maxPoint 
)
inline

Initialize bounds with the minimum corner point and the maximum corner point.

Member Function Documentation

VTKM_EXEC_CONT vtkm::Vec3f_64 vtkm::Bounds::Center ( ) const
inline

Returns the center of the range.

Center computes the point at the middle of the bounds. If the bounds are empty, the results are undefined.

template<typename T >
VTKM_EXEC_CONT bool vtkm::Bounds::Contains ( const vtkm::Vec< T, 3 > &  point) const
inline

Determines if a point coordinate is within the bounds.

template<typename T >
VTKM_EXEC_CONT void vtkm::Bounds::Include ( const vtkm::Vec< T, 3 > &  point)
inline

Expand bounds to include a point.

This version of Include expands the bounds just enough to include the given point coordinates. If the bounds already include this point, then nothing is done.

VTKM_EXEC_CONT void vtkm::Bounds::Include ( const vtkm::Bounds bounds)
inline

Expand bounds to include other bounds.

This version of Include expands these bounds just enough to include that of another bounds. Essentially it is the union of the two bounds.

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

Determine if the bounds are valid (i.e.

has at least one valid point).

IsNonEmpty returns true if the bounds contain some valid points. If the bounds are any real region, even if a single point or it expands to infinity, true is returned.

VTKM_EXEC_CONT bool vtkm::Bounds::operator!= ( const vtkm::Bounds bounds) const
inline
VTKM_EXEC_CONT vtkm::Bounds vtkm::Bounds::operator+ ( const vtkm::Bounds otherBounds) const
inline

Operator for union

vtkm::Bounds& vtkm::Bounds::operator= ( const vtkm::Bounds src)
default
VTKM_EXEC_CONT bool vtkm::Bounds::operator== ( const vtkm::Bounds bounds) const
inline
VTKM_EXEC_CONT vtkm::Bounds vtkm::Bounds::Union ( const vtkm::Bounds otherBounds) const
inline

Return the union of this and another bounds.

This is a nondestructive form of Include.

Member Data Documentation

vtkm::Range vtkm::Bounds::X
vtkm::Range vtkm::Bounds::Y
vtkm::Range vtkm::Bounds::Z

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