ZIntCuboidFaceArray ZIntCuboidFace::cropBy( const ZIntCuboidFaceArray &faceArray) const { ZIntCuboidFaceArray result; result.appendValid(*this); for (ZIntCuboidFaceArray::const_iterator iter = faceArray.begin(); iter != faceArray.end(); ++iter) { const ZIntCuboidFace &face = *iter; result = result.cropBy(face); if (result.empty()) { //No need to continue on empty face break; } } return result; }