*
*/
BoundingBox::BoundingBox(const double** pts, const unsigned numPts)
- :_coords(new double[6])
{
- assert(numPts > 0);
-
// initialize with first two points
const double *pt0(pts[0]);
* @param box1 the first box
* @param box2 the second box
*/
- BoundingBox::BoundingBox(const BoundingBox& box1, const BoundingBox& box2)
- : _coords(new double[6])
+ BoundingBox::BoundingBox(const BoundingBox& box1, const BoundingBox& box2)
{
- assert(_coords != 0);
-
for(BoxCoord c = XMIN ; c <= ZMIN ; c = BoxCoord(c + 1))
{
_coords[c] = std::min(box1._coords[c], box2._coords[c]);
assert(isValid());
}
- /**
- * Destructor
- *
- */
- BoundingBox::~BoundingBox()
- {
- delete [] _coords;
- }
-
/**
* Determines if the intersection with a given box is empty
*
BoundingBox(const BoundingBox& box1, const BoundingBox& box2);
- ~BoundingBox();
+ ~BoundingBox() { }
bool isDisjointWith(const BoundingBox& box) const;
/// Vector containing the coordinates of the box
/// interlaced in the order XMIN, YMIN, ZMIN, XMAX, YMAX, ZMAX
- double* _coords;
+ double _coords[6];
};