Exemplo n.º 1
0
void Whiteout::DoWhiteout(
        Space space,
        Rectangle rect,
        Point starting,
        Mask mask,
        bool clockwise, bool viral)
{
    unsigned int depth;
    PointVector pv;

    // Loop around the outside of the rectangle. Call whiteout helper at each
    // pixel.
    for (OutsideRectangleIterator it(space, rect, starting); it.More();)
    {
        depth = 0;
        if (!WhiteoutHelper(viral, mask, depth, pv, it.GetCurrent()) &&
            !viral)
        {
            return;
        }

        while (!pv.empty())
        {
            Point vpoint = pv.front();
            pv.pop_front();

            depth = 0;
            if (!WhiteoutHelper(viral, mask, depth, pv, vpoint) && 
                !viral)
            {
                return;
            }
        }

        // Move either clockwise or counter clockwise.
        if (clockwise)
        {
            it++;
        }
        else
        {
            it--;
        }
    }
}