本文整理汇总了C#中Microsoft.Msagl.Drawing.Graph.AddPrecalculatedEdge方法的典型用法代码示例。如果您正苦于以下问题:C# Graph.AddPrecalculatedEdge方法的具体用法?C# Graph.AddPrecalculatedEdge怎么用?C# Graph.AddPrecalculatedEdge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Msagl.Drawing.Graph
的用法示例。
在下文中一共展示了Graph.AddPrecalculatedEdge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDrawingGraph
public static Graph CreateDrawingGraph(GeometryGraph gg)
{
counter = 0;
localMap = new Dictionary<GeometryNode,Node>();
dg = new Graph(counter++.ToString()) { GeometryGraph = gg };
foreach (GeometryNode n in gg.Nodes)
{
Node node = new Node(counter++.ToString());
node.Attr.Shape = Shape.Ellipse;
node.GeometryNode = n;
dg.AddNode(node);
localMap[n]=node;
}
Subgraph cluster = new Subgraph(counter++.ToString());
cluster.GeometryNode = gg.RootCluster;
dg.RootSubgraph = cluster;
PopulateClusters(cluster, gg.RootCluster);
foreach (GeometryEdge e in gg.Edges)
{
Edge edge = new Edge(localMap[e.Source], localMap[e.Target], ConnectionToGraph.Disconnected);
edge.Attr.ArrowheadAtSource = e.ArrowheadAtSource ? ArrowStyle.Normal : ArrowStyle.None;
edge.Attr.ArrowheadAtTarget = e.ArrowheadAtTarget ? ArrowStyle.Normal : ArrowStyle.None;
edge.GeometryEdge = e;
dg.AddPrecalculatedEdge(edge);
}
//PopulateClusterEdges(dg.RootSubgraph, gg.RootCluster);
return dg;
}
示例2: ProcessLine
static void ProcessLine(Graph graph, string str) {
if (String.IsNullOrEmpty(str))
return;
if (str[0] == '*') return;
var arrayStr = str.Split(new []{' '},StringSplitOptions.RemoveEmptyEntries).ToArray();
if (arrayStr.Length == 0)
return;
var source = graph.AddNode(arrayStr[0]);
for (int i = 1; i < arrayStr.Length; i++) {
var e = new Edge(source, graph.AddNode(arrayStr[i]), ConnectionToGraph.Connected);
graph.AddPrecalculatedEdge(e);
}
}