18 BoundingBox::BoundingBox()
19 : m_minPt(
Vec3::ZERO),
24 BoundingBox::BoundingBox(
const Vec3 &minBBoxPt,
const Vec3 &maxBBoxPt)
30 BoundingBox::~BoundingBox()
34 double BoundingBox::getVolume()
const
36 Vec3 diff(m_maxPt-m_minPt);
37 return diff.X()*diff.Y()*diff.Z();
40 const Vec3 &BoundingBox::getMinPt()
const
45 const Vec3 &BoundingBox::getMaxPt()
const
50 bool BoundingBox::operator==(
const BoundingBox &bbox)
const
54 (getMinPt() == bbox.getMinPt())
56 (getMaxPt() == bbox.getMaxPt())
60 bool BoundingBox::contains(
const Vec3 &pt,
double tolerance)
const
64 (getMinPt().X() <= (pt.X() + tolerance))
66 (getMinPt().Y() <= (pt.Y() + tolerance))
68 (getMinPt().Z() <= (pt.Z() + tolerance))
70 (getMaxPt().X() >= (pt.X() - tolerance))
72 (getMaxPt().Y() >= (pt.Y() - tolerance))
74 (getMaxPt().Z() >= (pt.Z() - tolerance))
78 Vec3 BoundingBox::getSizes()
const
80 return (getMaxPt() - getMinPt());
83 std::ostream &operator<<(std::ostream &oStream,
const BoundingBox &bbox)
85 oStream << bbox.getMinPt() <<
" " << bbox.getMaxPt();