| 1240 | } |
| 1241 | |
| 1242 | void LASquadtree::intersect_circle_with_cells(const F64 center_x, const F64 center_y, const F64 radius, const F64 r_min_x, const F64 r_min_y, const F64 r_max_x, const F64 r_max_y, const F32 cell_min_x, const F32 cell_max_x, const F32 cell_min_y, const F32 cell_max_y, U32 level, U32 level_index) |
| 1243 | { |
| 1244 | volatile float cell_mid_x; |
| 1245 | volatile float cell_mid_y; |
| 1246 | if (level) |
| 1247 | { |
| 1248 | level--; |
| 1249 | level_index <<= 2; |
| 1250 | |
| 1251 | cell_mid_x = (cell_min_x + cell_max_x)/2; |
| 1252 | cell_mid_y = (cell_min_y + cell_max_y)/2; |
| 1253 | |
| 1254 | if (r_max_x <= cell_mid_x) |
| 1255 | { |
| 1256 | // cell_max_x = cell_mid_x; |
| 1257 | if (r_max_y <= cell_mid_y) |
| 1258 | { |
| 1259 | // cell_max_y = cell_mid_y; |
| 1260 | intersect_circle_with_cells(center_x, center_y, radius, r_min_x, r_min_y, r_max_x, r_max_y, cell_min_x, cell_mid_x, cell_min_y, cell_mid_y, level, level_index); |
| 1261 | } |
| 1262 | else if (!(r_min_y < cell_mid_y)) |
| 1263 | { |
| 1264 | // cell_min_y = cell_mid_y; |
| 1265 | // level_index |= 1; |
| 1266 | intersect_circle_with_cells(center_x, center_y, radius, r_min_x, r_min_y, r_max_x, r_max_y, cell_min_x, cell_mid_x, cell_mid_y, cell_max_y, level, level_index | 2); |
| 1267 | } |
| 1268 | else |
| 1269 | { |
| 1270 | intersect_circle_with_cells(center_x, center_y, radius, r_min_x, r_min_y, r_max_x, r_max_y, cell_min_x, cell_mid_x, cell_min_y, cell_mid_y, level, level_index); |
| 1271 | intersect_circle_with_cells(center_x, center_y, radius, r_min_x, r_min_y, r_max_x, r_max_y, cell_min_x, cell_mid_x, cell_mid_y, cell_max_y, level, level_index | 2); |
| 1272 | } |
| 1273 | } |
| 1274 | else if (!(r_min_x < cell_mid_x)) |
| 1275 | { |
| 1276 | // cell_min_x = cell_mid_x; |
| 1277 | // level_index |= 1; |
| 1278 | if (r_max_y <= cell_mid_y) |
| 1279 | { |
| 1280 | // cell_max_y = cell_mid_y; |
| 1281 | intersect_circle_with_cells(center_x, center_y, radius, r_min_x, r_min_y, r_max_x, r_max_y, cell_mid_x, cell_max_x, cell_min_y, cell_mid_y, level, level_index | 1); |
| 1282 | } |
| 1283 | else if (!(r_min_y < cell_mid_y)) |
| 1284 | { |
| 1285 | // cell_min_y = cell_mid_y; |
| 1286 | // level_index |= 1; |
| 1287 | intersect_circle_with_cells(center_x, center_y, radius, r_min_x, r_min_y, r_max_x, r_max_y, cell_mid_x, cell_max_x, cell_mid_y, cell_max_y, level, level_index | 3); |
| 1288 | } |
| 1289 | else |
| 1290 | { |
| 1291 | intersect_circle_with_cells(center_x, center_y, radius, r_min_x, r_min_y, r_max_x, r_max_y, cell_mid_x, cell_max_x, cell_min_y, cell_mid_y, level, level_index | 1); |
| 1292 | intersect_circle_with_cells(center_x, center_y, radius, r_min_x, r_min_y, r_max_x, r_max_y, cell_mid_x, cell_max_x, cell_mid_y, cell_max_y, level, level_index | 3); |
| 1293 | } |
| 1294 | } |
| 1295 | else |
| 1296 | { |
| 1297 | if (r_max_y <= cell_mid_y) |
| 1298 | { |
| 1299 | // cell_max_y = cell_mid_y; |
nothing calls this directly
no outgoing calls
no test coverage detected