| 240 | } |
| 241 | |
| 242 | I32 EPToctree::compute_max_depth(const LASheader& header, U64 max_points_per_octant) |
| 243 | { |
| 244 | // strategy to regulate the maximum depth of the octree |
| 245 | F64 xsize = header.max_x - header.min_x; |
| 246 | F64 ysize = header.max_y - header.min_y; |
| 247 | F64 zsize = header.max_z - header.min_z; |
| 248 | F64 size = MAX3(xsize, ysize, zsize); |
| 249 | U64 npts = MAX3((U64)header.number_of_point_records, header.extended_number_of_point_records, 0); |
| 250 | I32 max_depth = 0; |
| 251 | |
| 252 | while (npts > max_points_per_octant) |
| 253 | { |
| 254 | if (xsize >= size) { npts /= 2; } |
| 255 | if (ysize >= size) { npts /= 2; } |
| 256 | if (zsize >= size) { npts /= 2; } |
| 257 | size /= 2; |
| 258 | max_depth++; |
| 259 | } |
| 260 | |
| 261 | return max_depth; |
| 262 | } |
| 263 | |
| 264 | EPTkey EPToctree::get_key(const LASpoint* p, const I32 depth) const |
| 265 | { |
nothing calls this directly
no outgoing calls
no test coverage detected