Skip to content
Snippets Groups Projects
Select Git revision
  • 3212cb57407a9f35aae8d74d9e293ffe47df50f1
  • 5.5 default
  • feat/ProximityGazing
  • 5.4
  • 5.3
  • ViveProEye
  • deprecated/4.26
  • v1.2
  • v1.1
  • v1.0
10 results

SFGameInstance.cpp

Blame
  • GraphVisualizer.cs 676 B
    using Microsoft.Msagl.Drawing;
    
    namespace FlowForge;
    
    public class GraphVisualizer
    {
        public static Graph ConvertToMsaglGraph(FlowGraph flowGraph)
        {
            Graph msaglGraph = new Graph();
    
            foreach (var vertex in flowGraph.Graph.Vertices)
            {
                var msaglNode = msaglGraph.AddNode(vertex.Id);
                msaglNode.LabelText = vertex.Label; // Use the label from FlowNode
            }
    
            foreach (var edge in flowGraph.Graph.Edges)
            {
                var msaglEdge = msaglGraph.AddEdge(edge.Source.Id, edge.Target.Id);
                msaglEdge.LabelText = $"{edge.CurrentFlow}/{edge.MaxFlow}";
            }
    
            return msaglGraph;
        }
    }