示例#1
0
        public void Collect_1MeshSupplierWith1Mesh_1MeshIsFound()
        {
            var scene         = new OperatorPart(Guid.NewGuid(), new Utilities.ValueFunction());
            var mesh1Supplier = new OperatorPart(Guid.NewGuid(), new MeshSupplier1Mesh());

            scene.Connections.Add(mesh1Supplier);

            var meshCollector = new MeshCollector(_parentFunc);

            meshCollector.Collect(scene);

            Assert.AreEqual(1, meshCollector.NumberOfCollectedMeshes);
        }
示例#2
0
        public void Collect_1MeshSupplier_TransformEntryIsIdentity()
        {
            var scene         = new OperatorPart(Guid.NewGuid(), new Utilities.ValueFunction());
            var mesh1Supplier = new OperatorPart(Guid.NewGuid(), new MeshSupplier1Mesh());

            scene.Connections.Add(mesh1Supplier);

            var meshCollector = new MeshCollector(_parentFunc);

            meshCollector.Collect(scene);

            Assert.AreEqual(Matrix.Identity, meshCollector.CollectedMeshes.First().Key);
        }
示例#3
0
        public void Collect_1MeshSupplierWithTransformX100Before_TransformEntryIsX100()
        {
            var scene         = new OperatorPart(Guid.NewGuid(), new Utilities.ValueFunction());
            var mesh1Supplier = new OperatorPart(Guid.NewGuid(), new MeshSupplier1Mesh());
            var transformX100 = new OperatorPart(Guid.NewGuid(), new TransformX100());

            scene.Connections.Add(transformX100);
            transformX100.Connections.Add(mesh1Supplier);

            var meshCollector = new MeshCollector(_parentFunc);

            meshCollector.Collect(scene);

            Assert.AreEqual(Matrix.Translation(100, 0, 0), meshCollector.CollectedMeshes.First().Key);
        }
示例#4
0
        public void Collect_2MeshSupplierFirstWith1MeshSecondWith2Meshes_3MeshesAreFound()
        {
            var scene         = new OperatorPart(Guid.NewGuid(), new Utilities.ValueFunction());
            var mesh1Supplier = new OperatorPart(Guid.NewGuid(), new MeshSupplier1Mesh());
            var mesh2Supplier = new OperatorPart(Guid.NewGuid(), new MeshSupplier2Meshes());

            scene.Connections.Add(mesh1Supplier);
            scene.Connections.Add(mesh2Supplier);

            var meshCollector = new MeshCollector(_parentFunc);

            meshCollector.Collect(scene);

            Assert.AreEqual(3, meshCollector.NumberOfCollectedMeshes);
        }
示例#5
0
        public void Collect_2MeshSupplierWith3MeshesOneWithTransformBefore_2TransformEntriesAreFound()
        {
            var scene         = new OperatorPart(Guid.NewGuid(), new Utilities.ValueFunction());
            var mesh1Supplier = new OperatorPart(Guid.NewGuid(), new MeshSupplier1Mesh());
            var mesh2Supplier = new OperatorPart(Guid.NewGuid(), new MeshSupplier2Meshes());
            var transformX100 = new OperatorPart(Guid.NewGuid(), new TransformX100());

            scene.Connections.Add(mesh2Supplier);
            scene.Connections.Add(transformX100);
            transformX100.Connections.Add(mesh1Supplier);

            var meshCollector = new MeshCollector(_parentFunc);

            meshCollector.Collect(scene);

            Assert.AreEqual(2, meshCollector.CollectedMeshes.Count);
        }