PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ hexagon_state_next()

static void hexagon_state_next ( HexagonGridState state)
static

Definition at line 145 of file lwgeom_generate_grid.c.

146{
147 if (!state || state->done) return;
148 /* Move up one row */
149 state->j++;
150 /* Off the end, increment column counter, reset row counter back to (appropriate) minimum */
151 if (state->j > ((state->i % 2) ? state->row_max_odd : state->row_max_even))
152 {
153 state->i++;
154 state->j = ((state->i % 2) ? state->row_min_odd : state->row_min_even);
155 }
156 /* Column counter over max means we have used up all combinations */
157 if (state->i > state->column_max)
158 {
159 state->done = true;
160 }
161}

References HexagonGridState::column_max, HexagonGridState::done, HexagonGridState::i, HexagonGridState::j, HexagonGridState::row_max_even, HexagonGridState::row_max_odd, HexagonGridState::row_min_even, and HexagonGridState::row_min_odd.

Referenced by ST_ShapeGrid().

Here is the caller graph for this function: