Esempio n. 1
0
const R3Point R3Box::
ClosestPoint(const R3Point& point) const
{
    // Return closest point in box
    R3Point closest(point);
    if (closest.X() < XMin()) closest[RN_X] = XMin();
    else if (closest.X() > XMax()) closest[RN_X] = XMax();
    if (closest.Y() < YMin()) closest[RN_Y] = YMin();
    else if (closest.Y() > YMax()) closest[RN_Y] = YMax();
    if (closest.Z() < ZMin()) closest[RN_Z] = ZMin();
    else if (closest.Z() > ZMax()) closest[RN_Z] = ZMax();
    return closest;
}
Esempio n. 2
0
bool Box::Contains( Box const& other ) const
{
    return ( XMin() <= other.XMin() &&
        XMax() >= other.XMax() &&
        YMin() <= other.YMin() &&
        YMax() >= other.YMax() );
}