Пример #1
0
        public void readTest()
        {
            FileStream file = new FileStream ("resources/brunnen.ctm", FileMode.Open);
            CtmFileReader reader = new CtmFileReader (file);

            Mesh m = reader.decode ();

            m.checkIntegrity ();
        }
Пример #2
0
        private void testEncoder(MeshEncoder encoder)
        {
            MemoryStream memory = new MemoryStream ();
            CtmFileWriter writer = new CtmFileWriter (memory, encoder);
            writer.encode (quad, null);

            memory.Seek (0, SeekOrigin.Begin);
            Stream readMemory = new MemoryStream (memory.ToArray ());
            CtmFileReader reader = new CtmFileReader (readMemory);
            Mesh m = reader.decode ();

            m.checkIntegrity ();

            MG2Encoder mg2 = encoder as MG2Encoder;

            if (mg2 == null)
                Assert.AreEqual (quad, m);
            else {
                MG2MeshEqualsTest (mg2, quad, m);
            }
        }