MCPcopy Create free account
hub / github.com/PDAL/PDAL / computeBoundingBox

Method computeBoundingBox

filters/private/csf/point_cloud.cpp:21–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21void 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}

Callers 1

do_filteringMethod · 0.80

Calls 3

PointClass · 0.70
emptyFunction · 0.50
sizeFunction · 0.50

Tested by

no test coverage detected