Exemplo n.º 1
0
        static bool AddLevel(LgData lgData, IZoomLevelCalculator nodeZoomLevelCalculator, int nodeCountOnLevel, LgEdgeInfo[] edgeInfos)
        {
            var zoomLevel        = (int)nodeZoomLevelCalculator.SortedLgNodeInfos[nodeCountOnLevel - 1].ZoomLevel;
            var edgeInfosOfLevel = edgeInfos.TakeWhile(ei => ei.ZoomLevel <= zoomLevel).ToList();

            lgData.AddLevel();
            return(edgeInfosOfLevel.Count() == lgData.GeometryEdgesToLgEdgeInfos.Count);
        }
Exemplo n.º 2
0
        static bool RouteEdgesOnLevel(LgData lgData, IZoomLevelCalculator nodeZoomLevelCalculator,
                                      LgLayoutSettings lgLayoutSettings, int nodeCountOnLevel, LgEdgeInfo[] edgeInfos, GeometryGraph mainGeomGraph)
        {
            var zoomLevel        = (int)nodeZoomLevelCalculator.SortedLgNodeInfos[nodeCountOnLevel - 1].ZoomLevel;
            var edgeInfosOfLevel = edgeInfos.TakeWhile(ei => ei.ZoomLevel <= zoomLevel).ToList();

            var tmpGraphForRouting = CreateTmpGraphForRouting(lgData, edgeInfosOfLevel, zoomLevel);

            //LayoutAlgorithmSettings.ShowGraph(tmpGraphForRouting);

            var level = lgData.AddLevel(zoomLevel);

            RouteEdges(lgLayoutSettings, tmpGraphForRouting, lgData, level);
            //lgData.ExtractRailsFromRouting(tmpGraphForRouting.Edges, zoomLevel);
            return(edgeInfosOfLevel.Count() == lgData.GeometryEdgesToLgEdgeInfos.Count);
        }
 static bool AddLevel(LgData lgData, IZoomLevelCalculator nodeZoomLevelCalculator, int nodeCountOnLevel, LgEdgeInfo[] edgeInfos) {
     var zoomLevel = (int) nodeZoomLevelCalculator.SortedLgNodeInfos[nodeCountOnLevel - 1].ZoomLevel;
     var edgeInfosOfLevel = edgeInfos.TakeWhile(ei => ei.ZoomLevel <= zoomLevel).ToList();
     lgData.AddLevel();
     return edgeInfosOfLevel.Count() == lgData.GeometryEdgesToLgEdgeInfos.Count;
 }