From 55e8c742248f812cfb57bff722341be012ce01ab Mon Sep 17 00:00:00 2001 From: ggetz Date: Tue, 11 Jul 2017 15:01:46 -0400 Subject: [PATCH 1/5] Cesium3DTilesInspector attaches to first tileset on hover --- .../Sandcastle/gallery/3D Tiles Inspector.html | 1 - .../Cesium3DTilesInspectorViewModel.js | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Apps/Sandcastle/gallery/3D Tiles Inspector.html b/Apps/Sandcastle/gallery/3D Tiles Inspector.html index c212d98c1908..2ed6d579def0 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Inspector.html +++ b/Apps/Sandcastle/gallery/3D Tiles Inspector.html @@ -34,7 +34,6 @@ var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: 'https://beta.cesium.com/api/assets/1461?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYWJmM2MzNS02OWM5LTQ3OWItYjEyYS0xZmNlODM5ZDNkMTYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjFdLCJpYXQiOjE0OTkyNjQ3NDN9.vuR75SqPDKcggvUrG_vpx0Av02jdiAxnnB1fNf-9f7s' })); -inspectorViewModel.tileset = tileset; tileset.readyPromise.then(function() { var boundingSphere = tileset.boundingSphere; diff --git a/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js b/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js index 087e97918e5f..36d9d15a7ca5 100644 --- a/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js +++ b/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js @@ -38,6 +38,19 @@ define([ }; } + function selectTilesetOnHover (viewModel, value) { + if (value) { + viewModel._eventHandler.setInputAction(function(e) { + var pick = viewModel._scene.pick(e.endPosition); + if (defined(pick) && pick.primitive instanceof Cesium3DTileset) { + viewModel.tileset = pick.primitive; + } + }, ScreenSpaceEventType.MOUSE_MOVE); + } else { + viewModel._eventHandler.removeInputAction(ScreenSpaceEventType.MOUSE_MOVE); + } + } + var stringOptions = { maximumFractionDigits : 3 }; @@ -821,6 +834,10 @@ define([ this._removePostRenderEvent = scene.postRender.addEventListener(function() { that._update(); }); + + if (!defined(this._tileset)) { + selectTilesetOnHover(this, true); + } } defineProperties(Cesium3DTilesInspectorViewModel.prototype, { @@ -953,6 +970,7 @@ define([ this._statisticsText = getStatistics(tileset, false); this._pickStatisticsText = getStatistics(tileset, true); + selectTilesetOnHover(this, false); } }, From 2a010c26d3a7eab899b7ca97554b061aa1d238d8 Mon Sep 17 00:00:00 2001 From: ggetz Date: Tue, 11 Jul 2017 15:09:04 -0400 Subject: [PATCH 2/5] Updated CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 2cd1c2c0c442..f884ada59f65 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ Change Log * Fixed a bug where a Model's compressed textures were not being displayed. [#5596](https://github.com/AnalyticalGraphicsInc/cesium/pull/5596) * Fixed a bug where jsep was undefined when using webpack [#5593](https://github.com/AnalyticalGraphicsInc/cesium/issues/5593) +* Added behavior to Cesium3DTilesetInspector that selects the first tileset hovered over if no tilest is specified. [#5139](https://github.com/AnalyticalGraphicsInc/cesium/issues/5139) ### 1.35 - 2017-07-05 From daa6c0db1e0f6886b419f87bac5bc4e445676771 Mon Sep 17 00:00:00 2001 From: ggetz Date: Tue, 11 Jul 2017 15:53:14 -0400 Subject: [PATCH 3/5] Fix CHANGES.md --- CHANGES.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 62b59ba0c097..d6328bf1455f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,14 +1,15 @@ Change Log ========== +### 1.36 - 2017-08-01 +* Added behavior to `Cesium3DTilesInspector` that selects the first tileset hovered over if no tilest is specified. [#5139](https://github.com/AnalyticalGraphicsInc/cesium/issues/5139) + ### 1.35.2 - 2017-07-11 * This is an npm-only release to fix an issue with using Cesium in Node.js. * Fixed a bug where Cesium would fail to load under Node.js and some webpack configurations. [#5593](https://github.com/AnalyticalGraphicsInc/cesium/issues/5593) * Fixed a bug where a Model's compressed textures were not being displayed. [#5596](https://github.com/AnalyticalGraphicsInc/cesium/pull/5596) -* Fixed a bug where jsep was undefined when using webpack [#5593](https://github.com/AnalyticalGraphicsInc/cesium/issues/5593) * Fixed documentation for `OrthographicFrustum`. [#5586](https://github.com/AnalyticalGraphicsInc/cesium/issues/5586) -* Added behavior to `Cesium3DTilesInspector` that selects the first tileset hovered over if no tilest is specified. [#5139](https://github.com/AnalyticalGraphicsInc/cesium/issues/5139) ### 1.35.1 - 2017-07-05 From 725950adc534646bcffe7a980e8a7a5fc7d6dbed Mon Sep 17 00:00:00 2001 From: ggetz Date: Wed, 12 Jul 2017 10:43:21 -0400 Subject: [PATCH 4/5] Re-enable hover-over selection after selecting tileset --- .../Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js b/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js index a5dc08d6fe66..64242f77f456 100644 --- a/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js +++ b/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js @@ -48,6 +48,9 @@ define([ }, ScreenSpaceEventType.MOUSE_MOVE); } else { viewModel._eventHandler.removeInputAction(ScreenSpaceEventType.MOUSE_MOVE); + + // Restore hover-over selection to its current value + viewModel.picking = viewModel.picking; } } From c2ead265430fc70f392b39df14064d684a099066 Mon Sep 17 00:00:00 2001 From: ggetz Date: Wed, 12 Jul 2017 15:51:48 -0400 Subject: [PATCH 5/5] Remove .idea files --- .idea/markdown-exported-files.xml | 8 --- .idea/markdown-navigator.xml | 68 ------------------- .../markdown-navigator/profiles_settings.xml | 3 - 3 files changed, 79 deletions(-) delete mode 100644 .idea/markdown-exported-files.xml delete mode 100644 .idea/markdown-navigator.xml delete mode 100644 .idea/markdown-navigator/profiles_settings.xml diff --git a/.idea/markdown-exported-files.xml b/.idea/markdown-exported-files.xml deleted file mode 100644 index 5d1f1293cf7e..000000000000 --- a/.idea/markdown-exported-files.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/markdown-navigator.xml b/.idea/markdown-navigator.xml deleted file mode 100644 index 5ae5ad38c00f..000000000000 --- a/.idea/markdown-navigator.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/markdown-navigator/profiles_settings.xml b/.idea/markdown-navigator/profiles_settings.xml deleted file mode 100644 index 674a5916f945..000000000000 --- a/.idea/markdown-navigator/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file