package { import flash.geom.Point; /** * Represents a Voronoi Site; i.e. one of the points in a set of points * in the plane used to construct the Voronoi Diagram. * @author Chad Nelson */ public class VoronoiSite extends Point { public var edges : Vector. = new Vector.(); public var name : String; public function VoronoiSite(name:String, x:Number = 0, y:Number = 0) { super(x, y); this.name = name; } public override function toString():String { var index : String = "c" + name; var edge : String = "e"; var e1 : String = "?"; var e2 : String = "?"; if (edges.length > 0) { if (edges[0].node1 != null) e1 = edges[0].node1.name; if (edges[0].node2 != null) e2 = edges[0].node2.name; } return index + " nil e" + e1 + "," + e2 + "\n"; } } }