예제 #1
0
파일: HexGrid.cpp 프로젝트: hobu/hexer
// A debugging function that can be used to make a particular hexagon
// dense.
void HexGrid::addDenseHexagon(int x, int y)
{
    Hexagon *h = getHexagon(x, y);
    if (!h->dense())
    {
        h->setCount(m_dense_limit);
        h->setDense();
        m_miny = std::min(m_miny, h->y() - 1);
        if (h->possibleRoot())
            m_pos_roots.insert(h);
        markNeighborBelow(h);
    }
}
예제 #2
0
파일: HexGrid.cpp 프로젝트: mweisman/PDAL
void HexGrid::addPoint(Point p)
{
    Hexagon *h = findHexagon(p);
    if (!h->dense())
    {
        h->increment();
        if (dense(h))
        {
            h->setDense();
            m_miny = std::min(m_miny, h->y() - 1);
            if (h->possibleRoot())
            {
                m_pos_roots.insert(h);
            }
            markNeighborBelow(h);
        }
    }
}
예제 #3
0
파일: HexGrid.cpp 프로젝트: hobu/hexer
void HexGrid::addPoint(Point p)
{
    if (m_width < 0)
    {
        m_sample.push_back(p);
        if (m_sample.size() >= m_maxSample)
            processSample();
        return;
    }

    Hexagon *h = findHexagon(p);
    h->increment();
    if (!h->dense())
    {
        if (dense(h))
        {
            h->setDense();
            m_miny = std::min(m_miny, h->y() - 1);
            if (h->possibleRoot())
                m_pos_roots.insert(h);
            markNeighborBelow(h);
        }
    }
}