Viskores  1.0
Public Member Functions | Public Attributes | List of all members
viskores::Bounds Struct Reference

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

#include <Bounds.h>

Public Member Functions

 Bounds ()
 Construct an empty bounds. More...
 
 Bounds (const Bounds &)=default
 
 Bounds (const viskores::Range &xRange, const viskores::Range &yRange, const viskores::Range &zRange)
 Construct a bounds with a given range in the x, y, and z dimensions. More...
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
 Bounds (const T1 &minX, const T2 &maxX, const T3 &minY, const T4 &maxY, const T5 &minZ, const T6 &maxZ)
 Construct a bounds with the minimum and maximum coordinates in the x, y, and z directions. More...
 
template<typename T >
 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 >
 Bounds (const viskores::Vec< T, 3 > &minPoint, const viskores::Vec< T, 3 > &maxPoint)
 Initialize bounds with the minimum corner point and the maximum corner point. More...
 
viskores::Boundsoperator= (const viskores::Bounds &src)=default
 
bool IsNonEmpty () const
 Determine if the bounds are valid (i.e. More...
 
template<typename T >
bool Contains (const viskores::Vec< T, 3 > &point) const
 Determines if a point coordinate is within the bounds. More...
 
viskores::Float64 Volume () const
 Returns the volume of the bounds. More...
 
viskores::Float64 Area () const
 Returns the area of the bounds in the X-Y-plane. More...
 
viskores::Vec3f_64 Center () const
 Returns the center of the range. More...
 
viskores::Vec3f_64 MinCorner () const
 Returns the min point of the bounds More...
 
viskores::Vec3f_64 MaxCorner () const
 Returns the max point of the bounds More...
 
template<typename T >
void Include (const viskores::Vec< T, 3 > &point)
 Expand bounds to include a point. More...
 
void Include (const viskores::Bounds &bounds)
 Expand bounds to include other bounds. More...
 
viskores::Bounds Union (const viskores::Bounds &otherBounds) const
 Return the union of this and another bounds. More...
 
viskores::Bounds Intersection (const viskores::Bounds &otherBounds) const
 Return the intersection of this and another range. More...
 
viskores::Bounds operator+ (const viskores::Bounds &otherBounds) const
 Operator for union More...
 
bool operator== (const viskores::Bounds &bounds) const
 
bool operator!= (const viskores::Bounds &bounds) const
 

Public Attributes

viskores::Range X
 The range of values in the X direction. More...
 
viskores::Range Y
 The range of values in the Y direction. More...
 
viskores::Range Z
 The range of values in the Z direction. More...
 

Detailed Description

Represent an axis-aligned 3D bounds in space.

viskores::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

◆ Bounds() [1/6]

viskores::Bounds::Bounds ( )
inline

Construct an empty bounds.

The bounds will represent no space until otherwise modified.

◆ Bounds() [2/6]

viskores::Bounds::Bounds ( const Bounds )
default

◆ Bounds() [3/6]

viskores::Bounds::Bounds ( const viskores::Range xRange,
const viskores::Range yRange,
const viskores::Range zRange 
)
inline

Construct a bounds with a given range in the x, y, and z dimensions.

◆ Bounds() [4/6]

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
viskores::Bounds::Bounds ( const T1 &  minX,
const T2 &  maxX,
const T3 &  minY,
const T4 &  maxY,
const T5 &  minZ,
const T6 &  maxZ 
)
inline

Construct a bounds with the minimum and maximum coordinates in the x, y, and z directions.

◆ Bounds() [5/6]

template<typename T >
viskores::Bounds::Bounds ( const T  bounds[6])
inlineexplicit

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

◆ Bounds() [6/6]

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

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

Member Function Documentation

◆ Area()

viskores::Float64 viskores::Bounds::Area ( ) const
inline

Returns the area of the bounds in the X-Y-plane.

Area computes the product of the lengths of the ranges in dimensions X and Y. If the bounds are empty, 0 is returned.

◆ Center()

viskores::Vec3f_64 viskores::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.

◆ Contains()

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

Determines if a point coordinate is within the bounds.

◆ Include() [1/2]

void viskores::Bounds::Include ( const viskores::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.

◆ Include() [2/2]

template<typename T >
void viskores::Bounds::Include ( const viskores::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.

◆ Intersection()

viskores::Bounds viskores::Bounds::Intersection ( const viskores::Bounds otherBounds) const
inline

Return the intersection of this and another range.

◆ IsNonEmpty()

bool viskores::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.

◆ MaxCorner()

viskores::Vec3f_64 viskores::Bounds::MaxCorner ( ) const
inline

Returns the max point of the bounds

MaxCorder returns the minium point of the bounds.If the bounds are empty, the results are undefined.

◆ MinCorner()

viskores::Vec3f_64 viskores::Bounds::MinCorner ( ) const
inline

Returns the min point of the bounds

MinCorder returns the minium point of the bounds.If the bounds are empty, the results are undefined.

◆ operator!=()

bool viskores::Bounds::operator!= ( const viskores::Bounds bounds) const
inline

◆ operator+()

viskores::Bounds viskores::Bounds::operator+ ( const viskores::Bounds otherBounds) const
inline

Operator for union

◆ operator=()

viskores::Bounds& viskores::Bounds::operator= ( const viskores::Bounds src)
default

◆ operator==()

bool viskores::Bounds::operator== ( const viskores::Bounds bounds) const
inline

◆ Union()

viskores::Bounds viskores::Bounds::Union ( const viskores::Bounds otherBounds) const
inline

Return the union of this and another bounds.

This is a nondestructive form of Include.

◆ Volume()

viskores::Float64 viskores::Bounds::Volume ( ) const
inline

Returns the volume of the bounds.

Volume computes the product of the lengths of the ranges in each dimension. If the bounds are empty, 0 is returned.

Member Data Documentation

◆ X

viskores::Range viskores::Bounds::X

The range of values in the X direction.

The viskores::Range struct provides the minimum and maximum along that axis.

◆ Y

viskores::Range viskores::Bounds::Y

The range of values in the Y direction.

The viskores::Range struct provides the minimum and maximum along that axis.

◆ Z

viskores::Range viskores::Bounds::Z

The range of values in the Z direction.

The viskores::Range struct provides the minimum and maximum along that axis.


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