/// <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; }
/// <summary> /// Sets and end point for the edge /// </summary> /// <param name="vertex">The vertex that represents the end point</param> /// <param name="edgeType">The edge type of this vertex is (left or right) </param> public void SetEndpoint(VoronoiDiagramVertex <T> vertex, VoronoiDiagramEdgeType edgeType) { if (edgeType == VoronoiDiagramEdgeType.None) { throw new Exception("edgeType == VoronoiDiagramEdgeType.None"); } if (edgeType == VoronoiDiagramEdgeType.Left) { LeftEndPoint = vertex; } else { RightEndPoint = vertex; } }