Example #1
0
        public void TestFruchtermanReingold()
        {
            FruchtermanReingoldLayout layout = new FruchtermanReingoldLayout(10);

            layout.Init(2000d, 1000d, network);
            layout.DoLayout();
            foreach (Vertex v in network.Vertices)
            {
                try {
                    NETGen.Visualization.Vector3 pos = layout.GetPositionOfNode(v);
                    Assert.AreNotEqual(pos, new NETGen.Visualization.Vector3());
                }
                catch (Exception ex)
                {
                    Assert.Fail(ex.Message);
                }
            }
        }
Example #2
0
        public void TestHuForceDirected()
        {
            HuForceDirectedLayout layout = new HuForceDirectedLayout(20);

            layout.Init(2000d, 1000d, network);
            Assert.IsTrue(layout.CUDAEnabled);
            layout.DoLayout();

            foreach (Vertex v in network.Vertices)
            {
                try {
                    NETGen.Visualization.Vector3 pos = layout.GetPositionOfNode(v);
                    Assert.AreNotEqual(pos, new NETGen.Visualization.Vector3());
                }
                catch (Exception ex)
                {
                    Assert.Fail(ex.Message);
                }
            }
        }