Exemplo n.º 1
0
 public Graph(Nodes n, Edges e)
 {
     nodes = n;
     edges = e;
     home = null;
     destination = null;
 }
Exemplo n.º 2
0
 public Node(Stroke stroke)
 {
     this.stroke = stroke;
     this.id = stroke.Id;
     Rectangle r = stroke.GetBoundingBox();
     //Determine whether this node is a rectangle or not
     isRect = r.Width*Math.PI < StrokeManager.StrokeLength(stroke);
     centerPoint = new Point(r.X + r.Width/2, r.Y + r.Height/2);
     fillColor = DEFAULT;
     edges = new Edges();
     textColor = TEXT_DEFAULT;
     text = "";
     //Set initial distance to infinity (max int)
     distance = Int32.MaxValue;
 }
Exemplo n.º 3
0
 //Gets the edges corresponding to the given strokes
 public Edges getEdges(Strokes strokes)
 {
     Edges found = new Edges();
     for(int i=0; i<strokes.Count; i++)
     {
         Edge e = getEdge(strokes[i]);
         if(e != null)
         {
             found.Add(e);
         }
     }
     return found;
 }