Пример #1
0
        public void TestDcelVertex()
        {
            Assert.AreEqual(Vector3F.Zero, new DcelVertex().Position);
            Assert.AreEqual(0, new DcelVertex().Tag);
            Assert.AreEqual(null, new DcelVertex().Edge);

            DcelEdge edge = new DcelEdge();

            Assert.AreEqual(new Vector3F(3, 2, 1), new DcelVertex(new Vector3F(3, 2, 1), edge).Position);
            Assert.AreEqual(0, new DcelVertex(new Vector3F(3, 2, 1), edge).Tag);
            Assert.AreEqual(edge, new DcelVertex(new Vector3F(3, 2, 1), edge).Edge);
        }
Пример #2
0
        public void TestDcelMeshDirty()
        {
            DcelMesh mesh = new DcelMesh();

            DcelVertex v0 = new DcelVertex();
            DcelVertex v1 = new DcelVertex();
            DcelVertex v2 = new DcelVertex();

            DcelEdge e0 = new DcelEdge();
            DcelEdge e1 = new DcelEdge();
            DcelEdge e2 = new DcelEdge();

            DcelFace f = new DcelFace();

            // Link features
            v0.Edge     = e0;
            e0.Origin   = v0;
            mesh.Vertex = v0;

            Assert.AreEqual(1, mesh.Vertices.Count);
            Assert.AreEqual(1, mesh.Edges.Count);
            Assert.AreEqual(0, mesh.Faces.Count);

            // Link more
            e0.Next    = e1;
            e1.Next    = e2;
            mesh.Dirty = true;
            Assert.AreEqual(3, mesh.Edges.Count);

            e1.Origin  = v1;
            e2.Origin  = v2;
            mesh.Dirty = true;
            Assert.AreEqual(3, mesh.Vertices.Count);

            e0.Face    = f;
            f.Boundary = e1;
            mesh.Dirty = true;
            Assert.AreEqual(1, mesh.Faces.Count);
        }
Пример #3
0
        public void TestDcelVertex()
        {
            Assert.AreEqual(Vector3F.Zero, new DcelVertex().Position);
              Assert.AreEqual(0, new DcelVertex().Tag);
              Assert.AreEqual(null, new DcelVertex().Edge);

              DcelEdge edge = new DcelEdge();

              Assert.AreEqual(new Vector3F(3, 2, 1), new DcelVertex(new Vector3F(3, 2, 1), edge).Position);
              Assert.AreEqual(0, new DcelVertex(new Vector3F(3, 2, 1), edge).Tag);
              Assert.AreEqual(edge, new DcelVertex(new Vector3F(3, 2, 1), edge).Edge);
        }
Пример #4
0
        public void TestDcelMeshDirty()
        {
            DcelMesh mesh = new DcelMesh();

              DcelVertex v0 = new DcelVertex();
              DcelVertex v1 = new DcelVertex();
              DcelVertex v2 = new DcelVertex();

              DcelEdge e0 = new DcelEdge();
              DcelEdge e1 = new DcelEdge();
              DcelEdge e2 = new DcelEdge();

              DcelFace f = new DcelFace();

              // Link features
              v0.Edge = e0;
              e0.Origin = v0;
              mesh.Vertex = v0;

              Assert.AreEqual(1, mesh.Vertices.Count);
              Assert.AreEqual(1, mesh.Edges.Count);
              Assert.AreEqual(0, mesh.Faces.Count);

              // Link more
              e0.Next = e1;
              e1.Next = e2;
              mesh.Dirty = true;
              Assert.AreEqual(3, mesh.Edges.Count);

              e1.Origin = v1;
              e2.Origin = v2;
              mesh.Dirty = true;
              Assert.AreEqual(3, mesh.Vertices.Count);

              e0.Face = f;
              f.Boundary = e1;
              mesh.Dirty = true;
              Assert.AreEqual(1, mesh.Faces.Count);
        }
Пример #5
0
 public void TestDcelFace()
 {
     DcelEdge edge = new DcelEdge();
       Assert.AreEqual(edge, new DcelFace(edge).Boundary);
 }
Пример #6
0
        public void TestDcelFace()
        {
            DcelEdge edge = new DcelEdge();

            Assert.AreEqual(edge, new DcelFace(edge).Boundary);
        }