Exemplo n.º 1
0
		public void SaveGraphToFile(RoutingEngineGraphData data, int width, int height, string filename)
		{
			Graph gleeGraph = CreateGraph(data);

			var renderer = new GraphRenderer(gleeGraph);
			renderer.CalculateLayout();

			var bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb);
			renderer.Render(bitmap);

			bitmap.Save(filename, ImageFormat.Png);
		}
        public void SaveGraphToFile(RoutingEngineGraphData data, int width, int height, string filename)
        {
            Graph gleeGraph = CreateGraph(data);

            var renderer = new GraphRenderer(gleeGraph);

            renderer.CalculateLayout();

            var bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb);

            renderer.Render(bitmap);

            bitmap.Save(filename, ImageFormat.Png);
        }
        public Graph CreateGraph(RoutingEngineGraphData data)
        {
            var graph = new AdjacencyGraph <Vertex, Edge <Vertex> >();

            data.Vertices.Each(x => graph.AddVertex(x));
            data.Edges.Each(x => graph.AddEdge(new Edge <Vertex>(x.From, x.To)));

            GleeGraphPopulator <Vertex, Edge <Vertex> > glee = graph.CreateGleePopulator();

            glee.NodeAdded += NodeStyler;
            glee.EdgeAdded += EdgeStyler;
            glee.Compute();

            Graph gleeGraph = glee.GleeGraph;

            return(gleeGraph);
        }
Exemplo n.º 4
0
		public Graph CreateGraph(RoutingEngineGraphData data)
		{
			var graph = new AdjacencyGraph<Vertex, Edge<Vertex>>();

			data.Vertices.Each(x => graph.AddVertex(x));
			data.Edges.Each(x => graph.AddEdge(new Edge<Vertex>(x.From, x.To)));

			GleeGraphPopulator<Vertex, Edge<Vertex>> glee = graph.CreateGleePopulator();

			glee.NodeAdded += NodeStyler;
			glee.EdgeAdded += EdgeStyler;
			glee.Compute();

			Graph gleeGraph = glee.GleeGraph;

			return gleeGraph;
		}
Exemplo n.º 5
0
        public override void GetData(object target, Stream outgoingData)
        {
            if (target == null)
            {
                return;
            }

            if (!typeof(RoutingEngine).IsAssignableFrom(target.GetType()))
            {
                return;
            }

            var engine = (RoutingEngine)target;

            RoutingEngineGraphData data = engine.GetGraphData();

            base.GetData(data, outgoingData);
        }
Exemplo n.º 6
0
		public static void Show(RoutingEngineGraphData data)
		{
			var visualizerHost = new VisualizerDevelopmentHost(data, typeof(RoutingEngineDebugVisualizer));
			visualizerHost.ShowVisualizer();
		}
Exemplo n.º 7
0
        public static void Show(RoutingEngineGraphData data)
        {
            var visualizerHost = new VisualizerDevelopmentHost(data, typeof(RoutingEngineDebugVisualizer));

            visualizerHost.ShowVisualizer();
        }
Exemplo n.º 8
0
        public static void Show(RoutingEngine engine)
        {
            RoutingEngineGraphData graphData = engine.GetGraphData();

            Show(graphData);
        }