Skip to content

Zoom2: Adding zoom specific `cell_getid` functions.

William Roper requested to merge zoom_cellid_funcs into zoom_merge

This PR adds the functions and logic to get the cell IDs of various cells in the cell hierarchy when running with the zoom code enabled.

Specifically:

  • Cell types and subtypes are introduced. Along with names which previously didn't exist.
  • cell_getid_pos is introduced. This replaces every instance of cell_getid in the code where a position is multiplied by the inverse width of a cell. Instead, this function takes the positions as arguments and in a non-zoom case simply abstracts the multiplication by the inverse cell width. However, in a zoom case, it calls cell_getid_zoom with the positions.
  • cell_getid_zoom is introduced. This function uses cell types to identify which level of the hierarchy should be returned. It starts at the background level and then moves down a level if the cell subtype is empty or void, accounting for grid boundaries as it goes.
  • cell_getid_offset is introduced to make getting buffer and background cell IDs from i j k coordinates a bit cleaner.

Merge request reports