当前位置: 首页>>代码示例>>C#>>正文


C# Node.AddOutEdge方法代码示例

本文整理汇总了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;
        }
开发者ID:mrkcass,项目名称:SuffixTreeExplorer,代码行数:73,代码来源:GeometryTest.cs

示例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));
 }
开发者ID:mrkcass,项目名称:SuffixTreeExplorer,代码行数:10,代码来源:IncrementalLabeler.cs

示例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;
        }
开发者ID:mrkcass,项目名称:SuffixTreeExplorer,代码行数:22,代码来源:GeometryTest.cs


注:本文中的Microsoft.Msagl.Core.Layout.Node.AddOutEdge方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。