Exemplo n.º 1
0
        public void BoundingVolumeTest()
        {
            // arrange
            var bounds = new BoundingBox3D(0, 0, 0, 10, 10, 10);
            var expectedBoundingVolume = new Boundingvolume()
            {
                box = new double[] { 5, 5, 5, 5, 0, 0, 0, 5, 0, 0, 0, 100 }
            };

            // act
            var boundingvolume = bounds.GetBoundingVolume();

            // assert
            Assert.IsTrue(boundingvolume.box.Length == expectedBoundingVolume.box.Length);
            for (var i = 0; i < boundingvolume.box.Length; i++)
            {
                Assert.IsTrue(boundingvolume.box[i] == expectedBoundingVolume.box[i]);
            }
        }
Exemplo n.º 2
0
        public static TileSetJson GetSuperTileSet(BoundingBox3D rootBounds, List <SuperTileSetJson> tilesets, List <double> geometricErrors)
        {
            var tileset = new TileSetJson
            {
                asset = new Asset()
                {
                    version = "1.0", generator = "i3dm.export"
                }
            };

            tileset.geometricError = geometricErrors[0];


            var boundingVolume = rootBounds.GetBoundingVolume();

            var root = new Root
            {
                refine         = "ADD",
                boundingVolume = boundingVolume,
                geometricError = geometricErrors[0]
            };

            var children = new List <Child>();


            foreach (var ts in tilesets)
            {
                var child = new Child();
                child.geometricError = geometricErrors[0];
                child.boundingVolume = ts.Bounds.GetBoundingVolume();
                var content = new Content();
                content.uri   = ts.FileName;
                child.content = content;
                children.Add(child);
            }

            tileset.root          = root;
            tileset.root.children = children;
            return(tileset);
        }