예제 #1
0
파일: HexGrid.cpp 프로젝트: hobu/hexer
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);
}
예제 #2
0
파일: HexGrid.cpp 프로젝트: mweisman/PDAL
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);
}