Go::BoundingBox Class Reference
['utils' - a collection of useful math and programming tools]

Axis-aligned bounding box. More...

#include <BoundingBox.h>

List of all members.

Public Member Functions

 BoundingBox ()
 The default constructor makes an uninitialized object, with dimension zero.
 BoundingBox (int dim)
 Creates a BoundingBox of the specified dimension, but apart from that still uninitialized.
 BoundingBox (const Point &low, const Point &high)
 Creates a BoundingBox with the Point low specifying the lower bound in all dimensions and high specifying the upper bound.
 ~BoundingBox ()
 Do not inherit from this class -- nonvirtual destructor.
void setFromPoints (const Point &low, const Point &high)
 Makes the bounding box have lower bounds as specified in low and upper bounds as specified in high.
template<typename FloatType>
void setFromArray (const FloatType *start, const FloatType *end, int dim)
 Given an array of dim-dimensional points stored as doubles or floats, makes the smallest bounding box containing all points in the array.
template<typename ForwardIterator>
void setFromArray (ForwardIterator start, ForwardIterator end, int dim)
 Given an array of dim-dimensional points stored as doubles or floats, makes the smallest bounding box containing all points in the array.
void setFromPoints (const std::vector< Point > &points)
 Given a vector of dim-dimensional points, makes the smallest bounding box containing all points in the array.
void read (std::istream &is)
 Read a bounding box from a standard istream.
void write (std::ostream &os) const
 Write a bounding box to a standard ostream.
int dimension () const
 The dimension of the bounding box.
const Pointlow () const
 The lower bound of the bounding box.
const Pointhigh () const
 The upper bound of the bounding box.
bool containsPoint (const Point &pt, double tol=0.0) const
 Returns true if the point pt is inside the box, or within tol of the boundary.
bool overlaps (const BoundingBox &box, double tol=0.0) const
 Returns true if the two boxes overlap, or are a distance less than tol apart.
bool containsBox (const BoundingBox &box, double tol=0.0) const
 Returns true if this box contain the box passed as a parameter, if enlarged by tol in all directions.
void addUnionWith (const Point &pt)
 After the call, the bounding box will contain both this box and the given point.
void addUnionWith (const BoundingBox &box)
 After the call, the bounding box will contain both initial boxes.
bool valid () const
 Is the bounding box initialized?
void check () const
 Check that box validity.


Detailed Description

Axis-aligned bounding box.

A BoundingBox object can be an axis-aligned box in any number of dimensions.

Definition at line 51 of file BoundingBox.h.


Member Function Documentation

void Go::BoundingBox::check (  )  const

Check that box validity.

Call valid() to find out if check succeeded.

Referenced by BoundingBox(), setFromArray(), and setFromPoints().


The documentation for this class was generated from the following file:
Generated on Mon Jun 11 14:48:18 2007 for GoTools Core Library by  doxygen 1.5.1