本文整理汇总了C#中Microsoft.Msagl.Core.Layout.Node.AddOutEdge方法的典型用法代码示例。如果您正苦于以下问题:C# Node.AddOutEdge方法的具体用法?C# Node.AddOutEdge怎么用?C# Node.AddOutEdge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Msagl.Core.Layout.Node
的用法示例。
在下文中一共展示了Node.AddOutEdge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static GeometryGraph Create()
{
GeometryGraph graph = new GeometryGraph();
var nodeA0 = new Node();
graph.Nodes.Add(nodeA0);
var nodeA1 = new Node();
graph.Nodes.Add(nodeA1);
var nodeA2 = new Node();
graph.Nodes.Add(nodeA2);
var nodeA3 = new Node();
graph.Nodes.Add(nodeA3);
var edgeA0A1 = new Edge(nodeA0, nodeA1);
edgeA0A1.EdgeGeometry = new EdgeGeometry() { TargetArrowhead = new Arrowhead() };
nodeA0.AddOutEdge(edgeA0A1);
nodeA1.AddInEdge(edgeA0A1);
graph.Edges.Add(edgeA0A1);
var edgeA0A2 = new Edge(nodeA0, nodeA2);
edgeA0A2.EdgeGeometry = new EdgeGeometry() { TargetArrowhead = new Arrowhead() };
nodeA0.AddOutEdge(edgeA0A2);
nodeA2.AddInEdge(edgeA0A2);
graph.Edges.Add(edgeA0A2);
var edgeA2A1 = new Edge(nodeA2, nodeA1);
edgeA2A1.EdgeGeometry = new EdgeGeometry() { TargetArrowhead = new Arrowhead() };
nodeA2.AddOutEdge(edgeA2A1);
nodeA1.AddInEdge(edgeA2A1);
graph.Edges.Add(edgeA2A1);
var edgeA0A3 = new Edge(nodeA0, nodeA3);
edgeA0A3.EdgeGeometry = new EdgeGeometry() { TargetArrowhead = new Arrowhead() };
nodeA0.AddOutEdge(edgeA0A3);
nodeA3.AddInEdge(edgeA0A3);
graph.Edges.Add(edgeA0A3);
graph.RootCluster.AddChild(nodeA0);
graph.RootCluster.AddChild(nodeA3);
var cluster = new Cluster();
graph.RootCluster.AddChild(cluster);
cluster.AddChild(nodeA1);
cluster.AddChild(nodeA2);
// This is where I add the edge connecting to a cluster.
var edgeA0cluster = new Edge(nodeA0, cluster);
edgeA0cluster.EdgeGeometry = new EdgeGeometry() { TargetArrowhead = new Arrowhead() };
nodeA0.AddOutEdge(edgeA0cluster);
cluster.AddInEdge(edgeA0cluster);
graph.Edges.Add(edgeA0cluster);
var nodeA01 = new Node();
graph.Nodes.Add(nodeA01);
graph.RootCluster.AddChild(nodeA01);
var nodeA02 = new Node();
graph.Nodes.Add(nodeA02);
graph.RootCluster.AddChild(nodeA02);
var nodeA03 = new Node();
graph.Nodes.Add(nodeA03);
graph.RootCluster.AddChild(nodeA03);
var edgeA0A01 = new Edge(nodeA0, nodeA01);
edgeA0A01.EdgeGeometry = new EdgeGeometry() { TargetArrowhead = new Arrowhead() };
nodeA0.AddOutEdge(edgeA0A01);
nodeA01.AddInEdge(edgeA0A01);
graph.Edges.Add(edgeA0A01);
var edgeA01A02 = new Edge(nodeA01, nodeA02);
edgeA01A02.EdgeGeometry = new EdgeGeometry() { TargetArrowhead = new Arrowhead() };
nodeA01.AddOutEdge(edgeA01A02);
nodeA02.AddInEdge(edgeA01A02);
graph.Edges.Add(edgeA01A02);
var edgeA02A03 = new Edge(nodeA02, nodeA03);
edgeA02A03.EdgeGeometry = new EdgeGeometry() { TargetArrowhead = new Arrowhead() };
nodeA02.AddOutEdge(edgeA02A03);
nodeA03.AddInEdge(edgeA02A03);
graph.Edges.Add(edgeA02A03);
return graph;
}
示例2: AddNode
internal void AddNode(Node label)
{
liveLabels.Insert(label);
var loc = new Node(
CurveFactory.CreateEllipse(this.locationRadius, this.locationRadius, label.Center), label.UserData + "_");
loc.Center = label.Center;
label.AddOutEdge(new Edge(label, loc));
this.locations.Insert(loc);
AddNodeToTree(fixedTree, loc, Pad(loc.BoundingBox, this.labelSeparation / 2 + this.locationRadius));
}
示例3: CreateSimple
public static GeometryGraph CreateSimple()
{
GeometryGraph graph = new GeometryGraph();
var nodeA0 = new Node();
graph.Nodes.Add(nodeA0);
var nodeA1 = new Node();
graph.Nodes.Add(nodeA1);
graph.RootCluster.AddChild(nodeA0);
var cluster = new Cluster();
graph.RootCluster.AddChild(cluster);
cluster.AddChild(nodeA1);
// This is where I add the edge connecting to a cluster.
var edgeA0cluster = new Edge(nodeA0, cluster);
edgeA0cluster.EdgeGeometry = new EdgeGeometry() { TargetArrowhead = new Arrowhead() };
nodeA0.AddOutEdge(edgeA0cluster);
cluster.AddInEdge(edgeA0cluster);
graph.Edges.Add(edgeA0cluster);
return graph;
}