Esempio n. 1
0
        void ShowAxisEdges()
        {
            // ReSharper restore UnusedMember.Local
            var dd = new List <DebugCurve>(GetObstacleBoundaries("black"));
            int i  = 0;

            foreach (var axisEdge in AxisEdges)
            {
                var color = DebugCurve.Colors[i];
                dd.Add(new DebugCurve(200, 1, color,
                                      new LineSegment(axisEdge.Source.Point, axisEdge.Target.Point)));
                Point perp = axisEdge.Direction == Directions.East ? new Point(0, 1) : new Point(-1, 0);
                if (axisEdge.LeftBound != double.NegativeInfinity)
                {
                    dd.Add(new DebugCurve(200, 0.5, color,
                                          new LineSegment(axisEdge.Source.Point + axisEdge.LeftBound * perp, axisEdge.Target.Point + axisEdge.LeftBound * perp)));
                }
                if (axisEdge.RightBound != double.PositiveInfinity)
                {
                    dd.Add(new DebugCurve(200, 0.5, color,
                                          new LineSegment(axisEdge.Source.Point - axisEdge.RightBound * perp, axisEdge.Target.Point - axisEdge.RightBound * perp)));
                }
                i = (i + 1) % DebugCurve.Colors.Length;
            }
            DebugCurveCollection.WriteToFile(dd, "c:/tmp/ae");
            LayoutAlgorithmSettings.ShowDebugCurvesEnumeration(dd);
        }
Esempio n. 2
0
        static internal void Test_DumpScanSegments(ObstacleTree obstacleTree, ScanSegmentTree hSegs, ScanSegmentTree vSegs)
        {
            var debugCurves = Test_GetObstacleDebugCurves(obstacleTree);

            debugCurves.AddRange(Test_GetScanSegmentCurves(hSegs));
            debugCurves.AddRange(Test_GetScanSegmentCurves(vSegs));
            DebugCurveCollection.WriteToFile(debugCurves, GetDumpFileName("ScanSegments"));
        }
Esempio n. 3
0
        static internal void Test_DumpVisibilityGraph(ObstacleTree obstacleTree, VisibilityGraph vg)
        {
#if TEST_MSAGL
            var debugCurves = Test_GetObstacleDebugCurves(obstacleTree);
            debugCurves.AddRange(Test_GetVisibilityGraphDebugCurves(vg));
            DebugCurveCollection.WriteToFile(debugCurves, GetDumpFileName("VisibilityGraph"));
#endif // TEST
        }
        static internal void Test_DumpPathsAfterNudging(ObstacleTree obstacleTree, IEnumerable <Path> edgePaths)
        {
#if TEST_MSAGL
            var debugCurves = Test_GetObstacleDebugCurves(obstacleTree);
            debugCurves.AddRange(Test_GetPostNudgedPathDebugCurves(edgePaths));
            DebugCurveCollection.WriteToFile(debugCurves, GetDumpFileName("PostNudgedPaths"));
#endif // TEST
        }
        void ShowLongSegsWithIdealPositions(Directions dir)
        {
            // ReSharper restore UnusedMember.Local
            var debCurves = GetObstacleBoundaries(Obstacles, "black");
            int i         = 0;

            debCurves.AddRange(LongestNudgedSegs.Select(ls => DebugCurveOfLongSeg(ls, DebugCurve.Colors[i++ % DebugCurve.Colors.Length], dir)));

            DebugCurveCollection.WriteToFile(debCurves, "c:/tmp/longSegs");

            LayoutAlgorithmSettings.ShowDebugCurvesEnumeration(debCurves);
        }
        static void BClick(object sender, EventArgs e)
        {
            var     button  = sender as Button;
            GViewer gViewer = null;

            foreach (var f in (button.Parent as Form).Controls)
            {
                gViewer = f as GViewer;
                if (gViewer != null)
                {
                    break;
                }
            }
            if (gViewer == null)
            {
                MessageBox.Show("need to fix the debugging tool, sorry");
                return;
            }

            if (gViewer.Graph == null)
            {
                MessageBox.Show("graph is not set");
                return;
            }
            if (gViewer.Graph.DebugCurves == null)
            {
                MessageBox.Show("DebugCurves are not set");
                return;
            }

            var fileDialog = new SaveFileDialog();

            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                DebugCurveCollection.WriteToFile(gViewer.Graph.DebugCurves, fileDialog.FileName);
            }
        }
Esempio n. 7
0
        internal void Test_DumpScanLine()
        {
#if TEST_MSAGL
            DebugCurveCollection.WriteToFile(Test_GetScanLineDebugCurves(), StaticGraphUtility.GetDumpFileName("ScanLine"));
#endif // TEST
        }
 internal void Test_DumpScanLine()
 {
     DebugCurveCollection.WriteToFile(Test_GetScanLineDebugCurves(), StaticGraphUtility.GetDumpFileName("ScanLine"));
 }