Exemplo n.º 1
0
        public void Render_DrawSmoothMesh_ForVertexBasedResult()
        {
            ShellSecState state = Utilities.MakeState_VertexBased();

            ShellSec_RendererInfo info = new ShellSec_RendererInfo_Displacement();

            info.DisplayResults = new Dictionary <ShellSecResult, bool> {
                { ShellSecResult.X, true }
            };
            info.ScaleResults = new Dictionary <ShellSecResult, double> {
                { ShellSecResult.X, 1.0 }
            };
            info.DisplaySmooth  = true;
            info.DisplayMesh    = true;
            info.BaseMeshObject = ShellSec_BaseObj.Vertex;

            var expectedVertices = new Point3[]
            {
                new Point3(0, 0, 1),
                new Point3(0, 0, 0),
                new Point3(0.5, 0, 2),
                new Point3(0.5, 0, 0),
                new Point3(1, 0, 3),
                new Point3(1, 0, 0),
            };
            var expectedFaces = new List <Face3>()
            {
                new Face3(0, 1, 3, 2),
                new Face3(2, 3, 5, 4)
            };



            var sut = new ShellSec_MeshRenderer();

            sut.Render(state, info);
            List <IMesh> output = sut.RenderedMeshes;



            Assert.AreEqual(output.Count, 1);
            Assert.That(output[0].Vertices.ToArray, Is.EqualTo(expectedVertices));
            Assert.That(output[0].Faces, Is.EqualTo(expectedFaces));
        }