WFMath  1.0.2
Public Member Functions | Friends | List of all members
WFMath::AxisBox< dim > Class Template Reference

A dim dimensional axis-aligned box. More...

#include <axisbox.h>

Public Member Functions

 AxisBox ()
 Construct an uninitialized box.
 
 AxisBox (const Point< dim > &p1, const Point< dim > &p2, bool ordered=false)
 Construct a box with opposite corners p1 and p2.
 
 AxisBox (const AxisBox &a)
 Construct a copy of a box.
 
 AxisBox (const AtlasInType &a)
 Construct a box from an object passed by Atlas.
 
AtlasOutType toAtlas () const
 Create an Atlas object from the box.
 
void fromAtlas (const AtlasInType &a)
 Set the box's value to that given by an Atlas object.
 
const Point< dim > & lowCorner () const
 Get a reference to corner 0.
 
const Point< dim > & highCorner () const
 Get a reference to corner (2^dim)-1.
 
CoordType lowerBound (const int axis) const
 Get the lower bound of the box on the i'th axis.
 
CoordType upperBound (const int axis) const
 Get the upper bound of the box on the i'th axis.
 
AxisBoxsetCorners (const Point< dim > &p1, const Point< dim > &p2, bool ordered=false)
 Set the box to have opposite corners p1 and p2. More...
 

Friends

bool Intersection (const AxisBox &a1, const AxisBox &a2, AxisBox &out)
 Return true if the boxes intersect, and set 'out' to their intersection.
 
AxisBox Union (const AxisBox &a1, const AxisBox &a2)
 Get the minimal box that contains a1 and a2.
 

Detailed Description

template<int dim = 3>
class WFMath::AxisBox< dim >

A dim dimensional axis-aligned box.

This class implements the full shape interface, as described in the fake class Shape, with the exception of the rotation functions.

Member Function Documentation

◆ setCorners()

template<int dim>
AxisBox< dim > & WFMath::AxisBox< dim >::setCorners ( const Point< dim > &  p1,
const Point< dim > &  p2,
bool  ordered = false 
)

Set the box to have opposite corners p1 and p2.

The 'ordered' variable may be set to true if p1[i] <= p2[i] for all i. It is always safe to leave 'ordered' as false, it is a speed optimization primarily intended for use inside the library.

References WFMath::Point< dim >::setValid().

Referenced by WFMath::AxisBox< dim >::AxisBox().


The documentation for this class was generated from the following files: