void HexGrid::findShape(Hexagon *hex) { if (!hex) throw hexer_error("hexagon was null!"); Path *p = new Path(this, CLOCKWISE); Segment first(hex, 0); Segment cur(first); do { cleanPossibleRoot(cur, p); p->push_back(cur); Segment next = cur.leftClockwise(this); if (!next.hex()->dense()) next = cur.rightClockwise(this); cur = next; } while (cur != first); m_paths.push_back(p); }
void HexGrid::findShape(Hexagon *hex) { Path *p = new Path(CLOCKWISE); Segment first(hex, 0); Segment cur(first); do { cleanPossibleRoot(cur, p); p->push_back(cur); m_draw.drawSegment(cur); Segment next = cur.leftClockwise(this); if ( !next.hex()->dense() ) { next = cur.rightClockwise(this); } cur = next; } while (cur != first); m_paths.push_back(p); }