public void FirstWriteTest() { // arrange var stream = File.OpenRead("testfixtures/sanfrico.bin"); var i3s = I3sParser.ParseI3s(stream); // act var dir = TestContext.CurrentContext.TestDirectory; var file = I3sWriter.WriteI3s(dir + @"test1.bin", i3s); var stream1 = File.OpenRead(dir + "test1.bin"); var i3s_new = I3sParser.ParseI3s(stream1); // assert Assert.IsTrue(i3s.VertexCount == i3s_new.VertexCount); Assert.IsTrue(i3s.FeatureCount == i3s_new.FeatureCount); Assert.IsTrue(i3s.FeatureVertices.Count == i3s_new.FeatureVertices.Count); Assert.IsTrue(i3s.FeatureVertices[0] == i3s_new.FeatureVertices[0]); Assert.IsTrue(i3s.Normals.Count == i3s_new.Normals.Count); Assert.IsTrue(i3s.Normals[0] == i3s_new.Normals[0]); Assert.IsTrue(i3s.Uv0s.Count == i3s_new.Uv0s.Count); Assert.IsTrue(i3s.Uv0s[0] == i3s_new.Uv0s[0]); Assert.IsTrue(i3s.Colors.Count == i3s_new.Colors.Count); Assert.IsTrue(i3s.Colors[0] == i3s_new.Colors[0]); Assert.IsTrue(i3s.FeatureIds.Count == i3s_new.FeatureIds.Count); Assert.IsTrue(i3s.FeatureIds[0] == i3s_new.FeatureIds[0]); Assert.IsTrue(i3s.FaceRanges.Count == i3s_new.FaceRanges.Count); Assert.IsTrue(i3s.FaceRanges[0][0] == i3s_new.FaceRanges[0][0]); Assert.IsTrue(i3s.FaceRanges[0][1] == i3s_new.FaceRanges[0][1]); }
public void ParseFirstTest() { var i3s = I3sParser.ParseI3s(stream); Assert.IsTrue(i3s != null); Assert.IsTrue(i3s.VertexCount == 66207); Assert.IsTrue(i3s.FeatureCount == 302); Assert.IsTrue(i3s.FeatureVertices.Count == i3s.VertexCount); Assert.IsTrue(i3s.Normals.Count == i3s.VertexCount); Assert.IsTrue(i3s.Uv0s.Count == i3s.VertexCount); Assert.IsTrue(i3s.Colors.Count == i3s.VertexCount); Assert.IsTrue(i3s.FeatureIds.Count == i3s.FeatureCount); Assert.IsTrue(i3s.FaceRanges.Count == i3s.FeatureCount); }
static void Info(string file) { Console.WriteLine("i3s file: " + file); var stream = File.OpenRead(file); var i3s = I3sParser.ParseI3s(stream); Console.WriteLine("Vertices: " + i3s.VertexCount); Console.WriteLine("Feaatures: " + i3s.FeatureCount); Console.WriteLine("FeatureVertices: " + i3s.FeatureVertices.Count); Console.WriteLine("Normals: " + i3s.Normals.Count); Console.WriteLine("Uv0s: " + i3s.Uv0s.Count); Console.WriteLine("Colors: " + i3s.Colors.Count); Console.WriteLine("FeatureIds: " + i3s.FeatureIds.Count); Console.WriteLine("FaceRanges: " + i3s.FaceRanges.Count); }