| 19 | |
| 20 | |
| 21 | void csf::PointCloud::computeBoundingBox(Point& bbMin, Point& bbMax) { |
| 22 | if (empty()) { |
| 23 | bbMin = bbMax = Point(); |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | bbMin = bbMax = at(0); |
| 28 | |
| 29 | for (std::size_t i = 1; i < size(); i++) { // zwm |
| 30 | const csf::Point& P = at(i); |
| 31 | |
| 32 | for (int d = 0; d < 3; ++d) { |
| 33 | if (P.u[d] < bbMin.u[d]) { |
| 34 | bbMin.u[d] = P.u[d]; |
| 35 | } else if (P.u[d] > bbMax.u[d]) { |
| 36 | bbMax.u[d] = P.u[d]; |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | } |
no test coverage detected