namespace MIConvexHull { /// /// A class representing an (undirected) edge of the Voronoi graph. /// /// /// public class VoronoiEdge where TVertex : IVertex where TCell : TriangulationCell { /// /// Source of the edge. /// public TCell Source { get; internal set; } /// /// Target of the edge. /// public TCell Target { get; internal set; } /// /// ... /// /// /// public override bool Equals(object obj) { var other = obj as VoronoiEdge; if (other == null) return false; if (object.ReferenceEquals(this, other)) return true; return (Source == other.Source && Target == other.Target) || (Source == other.Target && Target == other.Source); } /// /// ... /// /// public override int GetHashCode() { int hash = 23; hash = hash * 31 + Source.GetHashCode(); return hash * 31 + Target.GetHashCode(); } /// /// Create an instance of the edge. /// public VoronoiEdge() { } /// /// Create an instance of the edge. /// public VoronoiEdge(TCell source, TCell target) { this.Source = source; this.Target = target; } } }