Ejemplo n.º 1
0
        public SKPath GetPath(Point startPt, Point endPt)
        {
            this.ResetTable();

            var startLoc = new CellLocation(startPt.Y, startPt.X).Scale(1.0 / PageRenderOptions.GridSize);
            var endLoc   = new CellLocation(endPt.Y, endPt.X).Scale(1.0 / PageRenderOptions.GridSize);

            var startCell = this.Table[startLoc.Row, startLoc.Col];
            var endCell   = this.Table[endLoc.Row, endLoc.Col];

            startCell.IsOpen = true;
            endCell.IsOpen   = true;

            endCell.Parent = startCell;

            return(this.GetPath(startCell, endCell));
        }
Ejemplo n.º 2
0
        public GraphicsPath GetPath(Point startPt, Point endPt)
        {
            this.Session = Guid.NewGuid();

            var startLoc = new CellLocation(startPt.Y, startPt.X).Scale(1.0 / PageRenderOptions.GridSize);
            var endLoc   = new CellLocation(endPt.Y, endPt.X).Scale(1.0 / PageRenderOptions.GridSize);

            var startCell = this.Table[startLoc.Row, startLoc.Col];
            var endCell   = this.Table[endLoc.Row, endLoc.Col];

            startCell.IsOpen = true;
            endCell.IsOpen   = true;

            endCell.Parent = startCell;

            var path = this.GetPath(startCell, endCell);

            path.AddLine(startPt, startPt);
            path.Reverse();
            path.AddLine(endPt, endPt);

            return(path);
        }
Ejemplo n.º 3
0
 public int GetColEffort(CellLocation other)
 {
     return(Math.Abs(this.Col - other.Col));
 }
Ejemplo n.º 4
0
 public int GetRowEffort(CellLocation other)
 {
     return(Math.Abs(this.Row - other.Row));
 }