コード例 #1
0
        public void Connects_GetDirectedEdges_EdgesWithoutArrowsAreBidirectional()
        {
            var page1 = this.GetNewPage();
            var shapes = this.draw_standard_shapes(page1);

            this.connect(shapes[0], shapes[1], false, false);
            this.connect(shapes[1], shapes[2], false, false);

            var edges1 = VACONNECT.PathAnalysis.GetDirectedEdges(page1, VACONNECT.ConnectorEdgeHandling.Arrow_TreatConnectorsWithoutArrowsAsBidirectional);
            var map1 = new ConnectivityMap(edges1);
            Assert.AreEqual(3, map1.CountFromNodes());
            Assert.IsTrue(map1.HasConnectionFromTo("A", "B"));
            Assert.IsTrue(map1.HasConnectionFromTo("B", "A"));
            Assert.IsTrue(map1.HasConnectionFromTo("B", "C"));
            Assert.IsTrue(map1.HasConnectionFromTo("C", "B"));
            Assert.AreEqual(1, map1.CountConnectionsFrom("A"));
            Assert.AreEqual(2, map1.CountConnectionsFrom("B"));
            Assert.AreEqual(1, map1.CountConnectionsFrom("C"));

            var edges2 = VACONNECT.PathAnalysis.GetTransitiveClosure(page1, VACONNECT.ConnectorEdgeHandling.Arrow_TreatConnectorsWithoutArrowsAsBidirectional);
            var map2 = new ConnectivityMap(edges2);
            Assert.AreEqual(3, map2.CountFromNodes());
            Assert.IsTrue(map2.HasConnectionFromTo("A", "B"));
            Assert.IsTrue(map2.HasConnectionFromTo("B", "A"));
            Assert.IsTrue(map2.HasConnectionFromTo("B", "C"));
            Assert.IsTrue(map2.HasConnectionFromTo("C", "B"));
            Assert.IsTrue(map2.HasConnectionFromTo("A", "C"));
            Assert.IsTrue(map2.HasConnectionFromTo("C", "A"));

            Assert.AreEqual(2, map2.CountConnectionsFrom("A"));
            Assert.AreEqual(2, map2.CountConnectionsFrom("B"));
            Assert.AreEqual(2, map2.CountConnectionsFrom("C"));

            page1.Delete(0);
        }
コード例 #2
0
        public void Connects_GetDirectedEdges_EdgesWithoutArrowsAreExcluded_withArrowHeads1()
        {
            var page1  = this.GetNewPage();
            var shapes = this.draw_standard_shapes(page1);

            this.connect(shapes[0], shapes[1], true, false);
            this.connect(shapes[1], shapes[2], true, false);

            var edges1 = VACONNECT.PathAnalysis.GetDirectedEdges(page1, VACONNECT.ConnectorEdgeHandling.Arrow_ExcludeConnectorsWithoutArrows);
            var map1   = new ConnectivityMap(edges1);

            Assert.AreEqual(2, map1.CountFromNodes());
            Assert.IsTrue(map1.HasConnectionFromTo("B", "A"));
            Assert.IsTrue(map1.HasConnectionFromTo("C", "B"));
            Assert.AreEqual(1, map1.CountConnectionsFrom("B"));
            Assert.AreEqual(1, map1.CountConnectionsFrom("C"));


            var edges2 = VACONNECT.PathAnalysis.GetTransitiveClosure(page1, VACONNECT.ConnectorEdgeHandling.Arrow_TreatConnectorsWithoutArrowsAsBidirectional);
            var map2   = new ConnectivityMap(edges1);

            Assert.AreEqual(2, map2.CountFromNodes());
            Assert.IsTrue(map2.HasConnectionFromTo("B", "A"));
            Assert.IsTrue(map2.HasConnectionFromTo("C", "B"));
            Assert.AreEqual(1, map2.CountConnectionsFrom("B"));
            Assert.AreEqual(1, map2.CountConnectionsFrom("C"));


            page1.Delete(0);
        }
コード例 #3
0
        public void PathAnalysis_GetDirectEdgesRaw()
        {
            var page1 = this.GetNewPage();
            var shapes = this.draw_standard_shapes(page1);

            this.connect(shapes[0], shapes[1], false, false);
            this.connect(shapes[1], shapes[2], false, false);

            var edges = VACONNECT.PathAnalysis.GetDirectedEdges(page1, VACONNECT.ConnectorEdgeHandling.Raw);
            var map = new ConnectivityMap(edges);
            Assert.AreEqual(2, map.CountFromNodes());
            Assert.IsTrue(map.HasConnectionFromTo("A","B"));
            Assert.IsTrue(map.HasConnectionFromTo("B", "C"));
            Assert.AreEqual(1, map.CountConnectionsFrom("A"));
            Assert.AreEqual(1, map.CountConnectionsFrom("B"));
            page1.Delete(0);
        }
コード例 #4
0
        public void PathAnalysis_GetDirectEdgesRaw()
        {
            var page1  = this.GetNewPage();
            var shapes = this.draw_standard_shapes(page1);

            this.connect(shapes[0], shapes[1], false, false);
            this.connect(shapes[1], shapes[2], false, false);

            var edges = VACONNECT.PathAnalysis.GetDirectedEdges(page1, VACONNECT.ConnectorEdgeHandling.Raw);
            var map   = new ConnectivityMap(edges);

            Assert.AreEqual(2, map.CountFromNodes());
            Assert.IsTrue(map.HasConnectionFromTo("A", "B"));
            Assert.IsTrue(map.HasConnectionFromTo("B", "C"));
            Assert.AreEqual(1, map.CountConnectionsFrom("A"));
            Assert.AreEqual(1, map.CountConnectionsFrom("B"));
            page1.Delete(0);
        }