From 1108d51ff7c545e2d1df1f2c71f530009f8561b6 Mon Sep 17 00:00:00 2001 From: Patrick Cozzi Date: Fri, 15 Jan 2016 07:27:40 -0500 Subject: [PATCH 1/2] Inherit refine from parent --- Source/Scene/Cesium3DTile.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Scene/Cesium3DTile.js b/Source/Scene/Cesium3DTile.js index 63a86c6655e3..6d4354c53cbc 100644 --- a/Source/Scene/Cesium3DTile.js +++ b/Source/Scene/Cesium3DTile.js @@ -96,13 +96,20 @@ define([ */ this.geometricError = header.geometricError; -// TODO: use default for a smaller tree.json? Or inherit from parent. Same for "type" and others. + var refine; + if (defined(header.refine)) { + refine = (header.refine === 'replace') ? Cesium3DTileRefine.REPLACE : Cesium3DTileRefine.ADD; + } else if (defined(parent)) { + // Inherit from parent tile if omitted. + refine = parent.refine; + } + /** * DOC_TBA * * @readonly */ - this.refine = (header.refine === 'replace') ? Cesium3DTileRefine.REPLACE : Cesium3DTileRefine.ADD; + this.refine = refine; /** * DOC_TBA From 2f15f1ef9ef57c3c7c2ffc4217d9ea768cf52835 Mon Sep 17 00:00:00 2001 From: Patrick Cozzi Date: Fri, 15 Jan 2016 07:27:57 -0500 Subject: [PATCH 2/2] Update 3D Tiles test data --- Specs/Data/Cesium3DTiles/Batched/BatchedNoBuildings/tiles.json | 1 + .../Data/Cesium3DTiles/Batched/BatchedWithBatchTable/tiles.json | 1 + .../Cesium3DTiles/Batched/BatchedWithoutBatchTable/tiles.json | 1 + Specs/Data/Cesium3DTiles/Composite/Composite/tiles.json | 1 + .../Cesium3DTiles/Composite/CompositeOfComposite/tiles.json | 1 + .../Cesium3DTiles/Instanced/InstancedGltfEmbedded/tiles.json | 1 + .../Cesium3DTiles/Instanced/InstancedGltfExternal/tiles.json | 1 + .../Cesium3DTiles/Instanced/InstancedWithBatchTable/tiles.json | 1 + .../Instanced/InstancedWithoutBatchTable/tiles.json | 1 + Specs/Data/Cesium3DTiles/Points/Points/tiles.json | 1 + Specs/Data/Cesium3DTiles/Tilesets/Tileset/tiles.json | 1 + Specs/Data/Cesium3DTiles/Tilesets/TilesetEmptyRoot/tiles.json | 1 + Specs/Data/Cesium3DTiles/Tilesets/TilesetInvalid/tiles.json | 1 + Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles.json | 1 + Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles2.json | 1 + Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles3.json | 1 + .../Data/Cesium3DTiles/Tilesets/TilesetReplacement1/tiles.json | 2 ++ .../Data/Cesium3DTiles/Tilesets/TilesetReplacement2/tiles.json | 1 + 18 files changed, 19 insertions(+) diff --git a/Specs/Data/Cesium3DTiles/Batched/BatchedNoBuildings/tiles.json b/Specs/Data/Cesium3DTiles/Batched/BatchedNoBuildings/tiles.json index d9aeed2d8455..10b2438cc0ef 100644 --- a/Specs/Data/Cesium3DTiles/Batched/BatchedNoBuildings/tiles.json +++ b/Specs/Data/Cesium3DTiles/Batched/BatchedNoBuildings/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "batchedNoBuildings.b3dm" } diff --git a/Specs/Data/Cesium3DTiles/Batched/BatchedWithBatchTable/tiles.json b/Specs/Data/Cesium3DTiles/Batched/BatchedWithBatchTable/tiles.json index 3988f0e4cf57..fbfd0c3c30a6 100644 --- a/Specs/Data/Cesium3DTiles/Batched/BatchedWithBatchTable/tiles.json +++ b/Specs/Data/Cesium3DTiles/Batched/BatchedWithBatchTable/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "batchedWithBatchTable.b3dm" } diff --git a/Specs/Data/Cesium3DTiles/Batched/BatchedWithoutBatchTable/tiles.json b/Specs/Data/Cesium3DTiles/Batched/BatchedWithoutBatchTable/tiles.json index 75c6b9705672..b53af38b2f34 100644 --- a/Specs/Data/Cesium3DTiles/Batched/BatchedWithoutBatchTable/tiles.json +++ b/Specs/Data/Cesium3DTiles/Batched/BatchedWithoutBatchTable/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "batchedWithoutBatchTable.b3dm" } diff --git a/Specs/Data/Cesium3DTiles/Composite/Composite/tiles.json b/Specs/Data/Cesium3DTiles/Composite/Composite/tiles.json index 06af37b1acca..168e9cdeb172 100644 --- a/Specs/Data/Cesium3DTiles/Composite/Composite/tiles.json +++ b/Specs/Data/Cesium3DTiles/Composite/Composite/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "composite.cmpt" } diff --git a/Specs/Data/Cesium3DTiles/Composite/CompositeOfComposite/tiles.json b/Specs/Data/Cesium3DTiles/Composite/CompositeOfComposite/tiles.json index c0071515616e..af33227b6908 100644 --- a/Specs/Data/Cesium3DTiles/Composite/CompositeOfComposite/tiles.json +++ b/Specs/Data/Cesium3DTiles/Composite/CompositeOfComposite/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "compositeOfComposite.cmpt" } diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/tiles.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/tiles.json index 7c4d0c245d82..d6622665c9e6 100644 --- a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/tiles.json +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfEmbedded/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "instancedGltfEmbedded.i3dm" } diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/tiles.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/tiles.json index 43424af21847..7136029e8f02 100644 --- a/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/tiles.json +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedGltfExternal/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "instancedGltfExternal.i3dm" } diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/tiles.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/tiles.json index cccc0f411b04..12a0d3e773e6 100644 --- a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/tiles.json +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "instancedWithBatchTable.i3dm" } diff --git a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/tiles.json b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/tiles.json index 08efcbc2e2df..e5a1b1c09725 100644 --- a/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/tiles.json +++ b/Specs/Data/Cesium3DTiles/Instanced/InstancedWithoutBatchTable/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "instancedWithoutBatchTable.i3dm" } diff --git a/Specs/Data/Cesium3DTiles/Points/Points/tiles.json b/Specs/Data/Cesium3DTiles/Points/Points/tiles.json index bd282b98ab0d..91d7aaa4c6cb 100644 --- a/Specs/Data/Cesium3DTiles/Points/Points/tiles.json +++ b/Specs/Data/Cesium3DTiles/Points/Points/tiles.json @@ -10,6 +10,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "points.pnts" } diff --git a/Specs/Data/Cesium3DTiles/Tilesets/Tileset/tiles.json b/Specs/Data/Cesium3DTiles/Tilesets/Tileset/tiles.json index 3b352b2e2a6d..222e1dcd4b4a 100644 --- a/Specs/Data/Cesium3DTiles/Tilesets/Tileset/tiles.json +++ b/Specs/Data/Cesium3DTiles/Tilesets/Tileset/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 70, + "refine": "add", "content": { "url": "parent.b3dm", "boundingVolume": { diff --git a/Specs/Data/Cesium3DTiles/Tilesets/TilesetEmptyRoot/tiles.json b/Specs/Data/Cesium3DTiles/Tilesets/TilesetEmptyRoot/tiles.json index 2b29564e42e7..b41163bc9028 100644 --- a/Specs/Data/Cesium3DTiles/Tilesets/TilesetEmptyRoot/tiles.json +++ b/Specs/Data/Cesium3DTiles/Tilesets/TilesetEmptyRoot/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 70, + "refine": "add", "children": [ { "boundingVolume": { diff --git a/Specs/Data/Cesium3DTiles/Tilesets/TilesetInvalid/tiles.json b/Specs/Data/Cesium3DTiles/Tilesets/TilesetInvalid/tiles.json index 5e0f733edf22..392a82b9610d 100644 --- a/Specs/Data/Cesium3DTiles/Tilesets/TilesetInvalid/tiles.json +++ b/Specs/Data/Cesium3DTiles/Tilesets/TilesetInvalid/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 70, + "refine": "add", "content": { "url": "parent.b3dm", "boundingVolume": { diff --git a/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles.json b/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles.json index f6301c510800..cb6a75a86608 100644 --- a/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles.json +++ b/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles.json @@ -18,6 +18,7 @@ ] }, "geometricError": 70, + "refine": "add", "content": { "url": "tiles2.json" } diff --git a/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles2.json b/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles2.json index edeecd1805ed..d91ad33c7cc3 100644 --- a/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles2.json +++ b/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles2.json @@ -27,6 +27,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "tiles3.json" } diff --git a/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles3.json b/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles3.json index a84b36efb13d..c935ef99d55b 100644 --- a/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles3.json +++ b/Specs/Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tiles3.json @@ -11,6 +11,7 @@ ] }, "geometricError": 0, + "refine": "add", "content": { "url": "ll.b3dm" } diff --git a/Specs/Data/Cesium3DTiles/Tilesets/TilesetReplacement1/tiles.json b/Specs/Data/Cesium3DTiles/Tilesets/TilesetReplacement1/tiles.json index a35c2df3ee54..e94b4b703c68 100644 --- a/Specs/Data/Cesium3DTiles/Tilesets/TilesetReplacement1/tiles.json +++ b/Specs/Data/Cesium3DTiles/Tilesets/TilesetReplacement1/tiles.json @@ -46,6 +46,7 @@ ] }, "geometricError": 70, + "refine": "add", "children": [ { "boundingVolume": { @@ -93,6 +94,7 @@ ] }, "geometricError": 70, + "refine": "add", "children": [ { "boundingVolume": { diff --git a/Specs/Data/Cesium3DTiles/Tilesets/TilesetReplacement2/tiles.json b/Specs/Data/Cesium3DTiles/Tilesets/TilesetReplacement2/tiles.json index 2c95941685a4..69d30fc1f54a 100644 --- a/Specs/Data/Cesium3DTiles/Tilesets/TilesetReplacement2/tiles.json +++ b/Specs/Data/Cesium3DTiles/Tilesets/TilesetReplacement2/tiles.json @@ -6,6 +6,7 @@ } }, "geometricError": 240, + "refine": "add", "root": { "boundingVolume": { "region": [