void R3Box:: Transform (const R3Matrix& matrix) { // Do not transform empty box if (IsEmpty()) return; // Transform box R3Box tmp = R3null_box; tmp.Union(matrix * Corner(0,0,0)); tmp.Union(matrix * Corner(0,0,1)); tmp.Union(matrix * Corner(0,1,0)); tmp.Union(matrix * Corner(0,1,1)); tmp.Union(matrix * Corner(1,0,0)); tmp.Union(matrix * Corner(1,0,1)); tmp.Union(matrix * Corner(1,1,0)); tmp.Union(matrix * Corner(1,1,1)); *this = tmp; }
void R3Box:: Transform (const R3Transformation& transformation) { // Do not transform empty box if (IsEmpty()) return; // Transform box ??? R3Box tmp = R3null_box; for (RNOctant octant = 0; octant < RN_NUM_OCTANTS; octant++) { R3Point corner(Corner(octant)); corner.Transform(transformation); tmp.Union(corner); } *this = tmp; }