Esempio n. 1
0
        public void RunTest6() {
            Point bl = new Point(0, 0);
            Point p1 = new Point(0.5, 1.5);
            Point p2 = new Point(9.5, 10.1);

            GridTraversal grid = new GridTraversal(new Rectangle(bl, bl + new Point(20, 15)), 2);
            var tiles = grid.GetTilesIntersectedByLineSeg(p1, p2);

#if DEBUG
            Microsoft.Msagl.GraphViewerGdi.DisplayGeometryGraph.SetShowFunctions(); 
            ShowTiles(tiles, grid, p1, p2);
#endif
        }
Esempio n. 2
0
        public void RunTest7() {
            Point p1 = new Point(-497.12352212078628, 1689.84931190121);
            Point p2 = new Point(198.64235142705752, 2139.4677380013277);
            Point bl = new Point(-5191.0147700187063, -4395.7850131819132);
            double gridSize = 553.23948409846571;

            GridTraversal grid = new GridTraversal(new Rectangle(bl, bl + new Point(gridSize, gridSize)), 20);
            var tiles = grid.GetTilesIntersectedByLineSeg(p1, p2);
#if DEBUG
            Microsoft.Msagl.GraphViewerGdi.DisplayGeometryGraph.SetShowFunctions();
            ShowTiles(tiles, grid, p1, p2);
#endif
        }
 List<Tuple<int, int>> GetIntersectedTiles(Point p1, Point p2,  GridTraversal grid) {
     return grid.GetTilesIntersectedByLineSeg(p1, p2);
 }