Пример #1
0
 private void EnqueueEdge(GridEdge edge, bool reversedNormal)
 {
     _queuedEdge.Enqueue(new QueuedEdgeInfo {
         Edge = edge, ReversedNormal = reversedNormal
     });
     _queuedEdgeSet.Add(edge.GetEdgeLong(_size));
 }
Пример #2
0
 private void EnqueueAdjacent(GridEdge e)
 {
     for (var axis = 0; axis < 3; ++axis)
     {
         for (var i = 0; i < 4; ++i)
         {
             GridEdge newEdge = new GridEdge(e.Coord + _findAdjacentEdgeList[e.Axis * 12 + axis * 4 + i], axis);
             if (_queuedEdgeSet.Contains(newEdge.GetEdgeLong(_size)))
             {
                 continue;
             }
             var lowVal  = _cache.EvaluateAtGrid(newEdge.Low, GridCoordinate.Zero);
             var highVal = _cache.EvaluateAtGrid(newEdge.High, GridCoordinate.Zero);
             if (lowVal > 0 && highVal < 0)
             {
                 EnqueueEdge(newEdge, false);
             }
             else if (lowVal < 0 && highVal > 0)
             {
                 EnqueueEdge(newEdge, true);
             }
         }
     }
 }