| 985 | } |
| 986 | |
| 987 | void LASquadtree::intersect_rectangle_with_cells_adaptive(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) |
| 988 | { |
| 989 | volatile float cell_mid_x; |
| 990 | volatile float cell_mid_y; |
| 991 | U32 cell_index = get_cell_index(level_index, level); |
| 992 | U32 adaptive_pos = cell_index/32; |
| 993 | U32 adaptive_bit = ((U32)1) << (cell_index%32); |
| 994 | if ((level < levels) && (adaptive[adaptive_pos] & adaptive_bit)) |
| 995 | { |
| 996 | level++; |
| 997 | level_index <<= 2; |
| 998 | |
| 999 | cell_mid_x = (cell_min_x + cell_max_x)/2; |
| 1000 | cell_mid_y = (cell_min_y + cell_max_y)/2; |
| 1001 | |
| 1002 | if (r_max_x <= cell_mid_x) |
| 1003 | { |
| 1004 | // cell_max_x = cell_mid_x; |
| 1005 | if (r_max_y <= cell_mid_y) |
| 1006 | { |
| 1007 | // cell_max_y = cell_mid_y; |
| 1008 | intersect_rectangle_with_cells_adaptive(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); |
| 1009 | } |
| 1010 | else if (!(r_min_y < cell_mid_y)) |
| 1011 | { |
| 1012 | // cell_min_y = cell_mid_y; |
| 1013 | // level_index |= 1; |
| 1014 | intersect_rectangle_with_cells_adaptive(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); |
| 1015 | } |
| 1016 | else |
| 1017 | { |
| 1018 | intersect_rectangle_with_cells_adaptive(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); |
| 1019 | intersect_rectangle_with_cells_adaptive(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); |
| 1020 | } |
| 1021 | } |
| 1022 | else if (!(r_min_x < cell_mid_x)) |
| 1023 | { |
| 1024 | // cell_min_x = cell_mid_x; |
| 1025 | // level_index |= 1; |
| 1026 | if (r_max_y <= cell_mid_y) |
| 1027 | { |
| 1028 | // cell_max_y = cell_mid_y; |
| 1029 | intersect_rectangle_with_cells_adaptive(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); |
| 1030 | } |
| 1031 | else if (!(r_min_y < cell_mid_y)) |
| 1032 | { |
| 1033 | // cell_min_y = cell_mid_y; |
| 1034 | // level_index |= 1; |
| 1035 | intersect_rectangle_with_cells_adaptive(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); |
| 1036 | } |
| 1037 | else |
| 1038 | { |
| 1039 | intersect_rectangle_with_cells_adaptive(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); |
| 1040 | intersect_rectangle_with_cells_adaptive(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); |
| 1041 | } |
| 1042 | } |
| 1043 | else |
| 1044 | { |
nothing calls this directly
no outgoing calls
no test coverage detected