MCPcopy Create free account
hub / github.com/LASzip/LASzip / intersect_rectangle_with_cells

Method intersect_rectangle_with_cells

src/lasquadtree.cpp:904–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

902}
903
904void LASquadtree::intersect_rectangle_with_cells(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)
905{
906 volatile float cell_mid_x;
907 volatile float cell_mid_y;
908 if (level)
909 {
910 level--;
911 level_index <<= 2;
912
913 cell_mid_x = (cell_min_x + cell_max_x)/2;
914 cell_mid_y = (cell_min_y + cell_max_y)/2;
915
916 if (r_max_x <= cell_mid_x)
917 {
918 // cell_max_x = cell_mid_x;
919 if (r_max_y <= cell_mid_y)
920 {
921 // cell_max_y = cell_mid_y;
922 intersect_rectangle_with_cells(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);
923 }
924 else if (!(r_min_y < cell_mid_y))
925 {
926 // cell_min_y = cell_mid_y;
927 // level_index |= 1;
928 intersect_rectangle_with_cells(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);
929 }
930 else
931 {
932 intersect_rectangle_with_cells(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);
933 intersect_rectangle_with_cells(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);
934 }
935 }
936 else if (!(r_min_x < cell_mid_x))
937 {
938 // cell_min_x = cell_mid_x;
939 // level_index |= 1;
940 if (r_max_y <= cell_mid_y)
941 {
942 // cell_max_y = cell_mid_y;
943 intersect_rectangle_with_cells(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);
944 }
945 else if (!(r_min_y < cell_mid_y))
946 {
947 // cell_min_y = cell_mid_y;
948 // level_index |= 1;
949 intersect_rectangle_with_cells(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);
950 }
951 else
952 {
953 intersect_rectangle_with_cells(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);
954 intersect_rectangle_with_cells(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);
955 }
956 }
957 else
958 {
959 if (r_max_y <= cell_mid_y)
960 {
961 // cell_max_y = cell_mid_y;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected