示例#1
0
        public void EdgeCount()
        {
            var f0 = new HBFace();

            var v0 = new HBVertex();
            var v1 = new HBVertex();
            var v2 = new HBVertex();

            var e0 = new HBEdge();
            var e1 = new HBEdge();
            var e2 = new HBEdge();

            Assert.AreEqual(0, f0.EdgeCount);

            f0.Edge = e0;
            v0.Edge = e0;
            v1.Edge = e1;
            v2.Edge = e2;

            e0.Set(v0, f0, null, null, null);
            Assert.AreEqual(1, e0.EdgeCount);

            e0.Next = e1;
            e1.Set(v0, f0, e0, null, null);
            Assert.AreEqual(2, e0.EdgeCount);

            e1.Next = e2;
            e2.Set(v0, f0, e1, e0, null);
            Assert.AreEqual(3, e0.EdgeCount);
        }
示例#2
0
        public void IsClosed()
        {
            var f0 = new HBFace();

            var v0 = new HBVertex();
            var v1 = new HBVertex();
            var v2 = new HBVertex();

            var e0 = new HBEdge();
            var e1 = new HBEdge();
            var e2 = new HBEdge();

            Assert.AreEqual(0, f0.EdgeCount);

            f0.Edge = e0;
            v0.Edge = e0;
            v1.Edge = e1;
            v2.Edge = e2;

            e0.Set(v0, f0, null, null, null);
            Assert.IsFalse(e0.IsClosed);

            e0.Next = e1;
            e1.Set(v0, f0, e0, null, null);
            Assert.IsFalse(e0.IsClosed);

            e1.Next = e2;
            e2.Set(v0, f0, e1, e0, null);
            Assert.IsTrue(e0.IsClosed);
        }