Example #1
0
        internal static void ShowRectangles(IEnumerable <VariableDef> variableDefs, IEnumerable <ClusterDef> clusterDefs)
        {
            if (!ShowRects)
            {
                return;
            }

#if TEST_MSAGL
            var variableDebugCurves = new List <DebugCurve>();
            var clusterDebugCurves  = new List <DebugCurve>();

            if (variableDefs != null)
            {
                variableDebugCurves.AddRange(variableDefs.Select(v => new Rectangle(v.Left, v.Top, v.Right, v.Bottom)).Select(
                                                 rect => new DebugCurve(0.1, "black", CurveFactory.CreateRectangle(rect))));
            }
            if (clusterDefs != null)
            {
                clusterDebugCurves.AddRange(clusterDefs.Select(v => new Rectangle(v.Left, v.Top, v.Right, v.Bottom)).Select(
                                                rect => new DebugCurve(0.1, "green", CurveFactory.CreateRectangle(rect))));
            }

            System.Diagnostics.Debug.WriteLine("ShowRectangles: there are {0} variables and {1} clusters",
                                               variableDebugCurves.Count, clusterDebugCurves.Count);
            SugiyamaLayoutSettings.ShowDebugCurvesEnumeration(variableDebugCurves.Concat(clusterDebugCurves));
#else  // TEST_MSAGL
            System.Diagnostics.Debug.WriteLine("-show* options require TEST mode");
#endif // TEST_MSAGL
        }
Example #2
0
        internal static void ShowInitialRectangles(IEnumerable <VariableDef> variableDefs)
        {
            if (!ShowInitialRects)
            {
                return;
            }

#if TEST_MSAGL
            var debugCurves = new List <DebugCurve>();
            debugCurves.AddRange(variableDefs.Select(
                                     v => new Rectangle(v.InitialLeft, v.InitialTop, v.InitialRight, v.InitialBottom)).Select(
                                     rect => new DebugCurve(0.1, "black", CurveFactory.CreateRectangle(rect))));
            SugiyamaLayoutSettings.ShowDebugCurvesEnumeration(debugCurves);
#else  // TEST_MSAGL
            System.Diagnostics.Debug.WriteLine("-show* options require TEST mode");
#endif // TEST_MSAGL
        }