Calculate the next dimension index for cyclic selection.
Cycles through non-displayed dimensions in the given direction with
wrap-around at boundaries. Used for Tab/Shift+Tab dimension selection.
If the current dimension is not in the non-displayed list, jumps to
the first (forward) or last (backward) non-displayed dimension.
Calculate the next dimension index for cyclic selection.
Cycles through non-displayed dimensions in the given direction with wrap-around at boundaries. Used for Tab/Shift+Tab dimension selection. If the current dimension is not in the non-displayed list, jumps to the first (forward) or last (backward) non-displayed dimension.