/// <summary>
 /// Creates a new half edge
 /// </summary>
 /// <param name="edge">The edge of the new half edge</param>
 /// <param name="edgeType">The edge type that this half edge represents (left or right).  The only half edges that should be "None" are the buckets in the priority queue.</param>
 public VoronoiDiagramHalfEdge(VoronoiDiagramEdge <T> edge, VoronoiDiagramEdgeType edgeType)
 {
     Edge                = edge;
     EdgeType            = edgeType;
     Vertex              = null;
     StarY               = 0f;
     EdgeListLeft        = null;
     EdgeListRight       = null;
     NextInPriorityQueue = null;
 }
예제 #2
0
        /// <summary>
        /// Returns the right region in relation to a half edge
        /// </summary>
        /// <param name="halfEdge">The half edge to calculate from</param>
        /// <returns>The right region</returns>
        private VoronoiDiagramSite <T> GetRightRegion(VoronoiDiagramHalfEdge <T> halfEdge)
        {
            if (halfEdge.Edge == null)
            {
                return(_bottomMostSite);
            }

            if (halfEdge.EdgeType == VoronoiDiagramEdgeType.Left)
            {
                return(halfEdge.Edge.RightSite);
            }
            else
            {
                return(halfEdge.Edge.LeftSite);
            }
        }