#include <CompositeBox.h>
Public Member Functions | |
template<typename RandomAccessIterator> | |
CompositeBox (RandomAccessIterator start, int dim, int num_u, int num_v) | |
Constructor using setFromArray(). | |
CompositeBox (const Point &low, const Point &high) | |
Creates a CompositeBox with the Point low specifying the lower bound in all dimensions and high specifying the upper bound. | |
~CompositeBox () | |
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 RandomAccessIterator> | |
void | setFromArray (RandomAccessIterator start, int dim, int num_u, int num_v) |
Given an array of dim-dimensional points stored as doubles or floats, makes the smallest composite box containing all points in the array. | |
void | read (std::istream &is) |
Read a composite box from a standard istream. | |
void | write (std::ostream &os) const |
Write a composite box to a standard ostream. | |
int | dimension () const |
The dimension of the composite box. | |
Point | low (double toli=0.0, double tole=0.0) const |
The lower bound of the composite box. | |
Point | high (double toli=0.0, double tole=0.0) const |
The upper bound of the composite box. | |
const BoundingBox & | inner () const |
The inner box. | |
const BoundingBox & | edge () const |
The edge box. | |
bool | containsPoint (const Point &pt, double toli=0.0, double tole=0.0) const |
Returns true if the point pt is inside the box, up to tolerances. | |
bool | overlaps (const CompositeBox &box, double toli=0.0, double tole=0.0) const |
Returns true if the two boxes overlap, up to tolerances. | |
bool | getOverlap (const CompositeBox &box, double &overlap, double toli=0.0, double tole=0.0) const |
Get the overlap between the two boxes. | |
bool | containsBox (const CompositeBox &box, double toli=0.0, double tole=0.0) const |
Returns true if this box contain the box passed as a parameter,up to tolerances. |
The inner box is supposed to be a bounding box for the interior of an object, while the edge box bounds the outer edges. When requests are made, the CompositeBox is treated as a single axis-aligned box, but tolerances can be given for both sub-boxes separately. A CompositeBox object can have any number of dimensions.
Definition at line 53 of file CompositeBox.h.
Creates a CompositeBox with the Point low specifying the lower bound in all dimensions and high specifying the upper bound.
The inner and edge boxes are equal.
Definition at line 69 of file CompositeBox.h.
void Go::CompositeBox::setFromArray | ( | RandomAccessIterator | start, | |
int | dim, | |||
int | num_u, | |||
int | num_v | |||
) | [inline] |
Given an array of dim-dimensional points stored as doubles or floats, makes the smallest composite box containing all points in the array.
The array must be like a control point grid, with num_u points in the fastest running direction, and num_v points in the other direction. For curves, use num_v = 1.
Definition at line 92 of file CompositeBox.h.
References Go::BoundingBox::high(), Go::BoundingBox::low(), Go::BoundingBox::setFromArray(), and Go::BoundingBox::setFromPoints().
Referenced by CompositeBox().
bool Go::CompositeBox::containsPoint | ( | const Point & | pt, | |
double | toli = 0.0 , |
|||
double | tole = 0.0 | |||
) | const |
Returns true if the point pt is inside the box, up to tolerances.
Tolerances may be specified separately for inner and edge boxes.
bool Go::CompositeBox::overlaps | ( | const CompositeBox & | box, | |
double | toli = 0.0 , |
|||
double | tole = 0.0 | |||
) | const |
Returns true if the two boxes overlap, up to tolerances.
Tolerances may be specified separately for inner and edge boxes.
bool Go::CompositeBox::getOverlap | ( | const CompositeBox & | box, | |
double & | overlap, | |||
double | toli = 0.0 , |
|||
double | tole = 0.0 | |||
) | const |
Get the overlap between the two boxes.
Tolerances may be specified separately for inner and edge boxes.
bool Go::CompositeBox::containsBox | ( | const CompositeBox & | box, | |
double | toli = 0.0 , |
|||
double | tole = 0.0 | |||
) | const |
Returns true if this box contain the box passed as a parameter,up to tolerances.
Tolerances may be specified separately for inner and edge boxes.