diff --git a/Source/Widgets/CesiumInspector/CesiumInspector.js b/Source/Widgets/CesiumInspector/CesiumInspector.js index eef05ee615be..923ead6b0980 100644 --- a/Source/Widgets/CesiumInspector/CesiumInspector.js +++ b/Source/Widgets/CesiumInspector/CesiumInspector.js @@ -84,10 +84,10 @@ define([ generalSection.appendChild(debugShowFrustums); var frustumStats = document.createElement('div'); frustumStats.className = 'cesium-cesiumInspector-frustumStats'; - frustumStats.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText'); + frustumStats.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText'); var frustumsCheckbox = document.createElement('input'); frustumsCheckbox.type = 'checkbox'; - frustumsCheckbox.setAttribute('data-bind', 'checked: frustums, click: showFrustums'); + frustumsCheckbox.setAttribute('data-bind', 'checked: frustums'); debugShowFrustums.appendChild(frustumsCheckbox); debugShowFrustums.appendChild(document.createTextNode('Show Frustums')); debugShowFrustums.appendChild(frustumStats); @@ -96,7 +96,7 @@ define([ generalSection.appendChild(performanceDisplay); var pdCheckbox = document.createElement('input'); pdCheckbox.type = 'checkbox'; - pdCheckbox.setAttribute('data-bind', 'checked: performance, click: showPerformance'); + pdCheckbox.setAttribute('data-bind', 'checked: performance'); performanceDisplay.appendChild(pdCheckbox); performanceDisplay.appendChild(document.createTextNode('Performance Display')); @@ -112,7 +112,7 @@ define([ generalSection.appendChild(globeDepth); var gCheckbox = document.createElement('input'); gCheckbox.type = 'checkbox'; - gCheckbox.setAttribute('data-bind', 'checked: globeDepth, click: showGlobeDepth'); + gCheckbox.setAttribute('data-bind', 'checked: globeDepth'); globeDepth.appendChild(gCheckbox); globeDepth.appendChild(document.createTextNode('Show globe depth')); @@ -123,7 +123,7 @@ define([ generalSection.appendChild(pickDepth); var pCheckbox = document.createElement('input'); pCheckbox.type = 'checkbox'; - pCheckbox.setAttribute('data-bind', 'checked: pickDepth, click: showPickDepth'); + pCheckbox.setAttribute('data-bind', 'checked: pickDepth'); pickDepth.appendChild(pCheckbox); pickDepth.appendChild(document.createTextNode('Show pick depth')); @@ -185,7 +185,7 @@ define([ pickPrimRequired.appendChild(debugSphere); var bsCheckbox = document.createElement('input'); bsCheckbox.type = 'checkbox'; - bsCheckbox.setAttribute('data-bind', 'checked: primitiveBoundingSphere, click: showPrimitiveBoundingSphere, enable: hasPickedPrimitive'); + bsCheckbox.setAttribute('data-bind', 'checked: primitiveBoundingSphere, enable: hasPickedPrimitive'); debugSphere.appendChild(bsCheckbox); debugSphere.appendChild(document.createTextNode('Show bounding sphere')); @@ -193,7 +193,7 @@ define([ pickPrimRequired.appendChild(refFrame); var rfCheckbox = document.createElement('input'); rfCheckbox.type = 'checkbox'; - rfCheckbox.setAttribute('data-bind', 'checked: primitiveReferenceFrame, click: showPrimitiveReferenceFrame, enable: hasPickedPrimitive'); + rfCheckbox.setAttribute('data-bind', 'checked: primitiveReferenceFrame, enable: hasPickedPrimitive'); refFrame.appendChild(rfCheckbox); refFrame.appendChild(document.createTextNode('Show reference frame')); @@ -202,7 +202,7 @@ define([ pickPrimRequired.appendChild(primitiveOnly); var primitiveOnlyCheckbox = document.createElement('input'); primitiveOnlyCheckbox.type = 'checkbox'; - primitiveOnlyCheckbox.setAttribute('data-bind', 'checked: filterPrimitive, click: doFilterPrimitive, enable: hasPickedPrimitive'); + primitiveOnlyCheckbox.setAttribute('data-bind', 'checked: filterPrimitive, enable: hasPickedPrimitive'); primitiveOnly.appendChild(primitiveOnlyCheckbox); primitiveOnly.appendChild(document.createTextNode('Show only selected')); @@ -218,7 +218,7 @@ define([ var terrainSection = document.createElement('div'); terrainSection.className = 'cesium-cesiumInspector-section'; - terrainSection.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'); + terrainSection.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'); panel.appendChild(terrainSection); var pickTileRequired = document.createElement('div'); pickTileRequired.className = 'cesium-cesiumInspector-pickSection'; @@ -264,7 +264,7 @@ define([ tileText.className = 'cesium-cesiumInspector-tileText'; tileInfo.className = 'cesium-cesiumInspector-frustumStats'; tileInfo.appendChild(tileText); - tileInfo.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'); + tileInfo.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'); tileText.setAttribute('data-bind', 'html: tileText'); var relativeText = document.createElement('div'); @@ -301,7 +301,7 @@ define([ pickTileRequired.appendChild(tileBoundingSphere); var tbsCheck = document.createElement('input'); tbsCheck.type = 'checkbox'; - tbsCheck.setAttribute('data-bind', 'checked: tileBoundingSphere, enable: hasPickedTile, click: showTileBoundingSphere'); + tbsCheck.setAttribute('data-bind', 'checked: tileBoundingSphere, enable: hasPickedTile'); tileBoundingSphere.appendChild(tbsCheck); tileBoundingSphere.appendChild(document.createTextNode('Show bounding volume')); @@ -309,7 +309,7 @@ define([ pickTileRequired.appendChild(renderTile); var rCheck = document.createElement('input'); rCheck.type = 'checkbox'; - rCheck.setAttribute('data-bind', 'checked: filterTile, enable: hasPickedTile, click: doFilterTile'); + rCheck.setAttribute('data-bind', 'checked: filterTile, enable: hasPickedTile'); renderTile.appendChild(rCheck); renderTile.appendChild(document.createTextNode('Show only selected')); @@ -317,7 +317,7 @@ define([ terrainSection.appendChild(wireframe); var wCheckbox = document.createElement('input'); wCheckbox.type = 'checkbox'; - wCheckbox.setAttribute('data-bind', 'checked: wireframe, click: showWireframe'); + wCheckbox.setAttribute('data-bind', 'checked: wireframe'); wireframe.appendChild(wCheckbox); wireframe.appendChild(document.createTextNode('Wireframe')); @@ -325,7 +325,7 @@ define([ terrainSection.appendChild(suspendUpdates); var upCheckbox = document.createElement('input'); upCheckbox.type = 'checkbox'; - upCheckbox.setAttribute('data-bind', 'checked: suspendUpdates, click: doSuspendUpdates'); + upCheckbox.setAttribute('data-bind', 'checked: suspendUpdates'); suspendUpdates.appendChild(upCheckbox); suspendUpdates.appendChild(document.createTextNode('Suspend LOD update')); @@ -333,7 +333,7 @@ define([ terrainSection.appendChild(tileCoords); var coordCheck = document.createElement('input'); coordCheck.type = 'checkbox'; - coordCheck.setAttribute('data-bind', 'checked: tileCoordinates, click: showTileCoordinates'); + coordCheck.setAttribute('data-bind', 'checked: tileCoordinates'); tileCoords.appendChild(coordCheck); tileCoords.appendChild(document.createTextNode('Show tile coordinates')); diff --git a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js index 107e0368e755..8eb93556173a 100644 --- a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js +++ b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js @@ -185,13 +185,6 @@ define([ this.depthFrustum = 1; this._numberOfFrustums = 1; - /** - * Gets or sets the index of the depth frustum text. This property is observable. - * @type {String} - * @default '1 of 1' - */ - this.depthFrustumText = '1 of 1'; - /** * Gets or sets the suspend updates state. This property is observable. * @type {Boolean} @@ -211,7 +204,7 @@ define([ * @type {String} * @default '' */ - this.frustumStatisticText = ''; + this.frustumStatisticText = false; /** * Gets or sets the selected tile information text. This property is observable. @@ -239,7 +232,7 @@ define([ * @type {Boolean} * @default false */ - this.pickPimitiveActive = false; + this.pickPrimitiveActive = false; /** * Gets if the picking tile command is active. This property is observable. @@ -277,30 +270,66 @@ define([ this.terrainVisible = false; /** - * Gets or sets if the text on the general section expand button. This property is observable. + * Gets or sets the index of the depth frustum text. This property is observable. + * @type {String} + * @default '' + */ + this.depthFrustumText = ''; + + /** + * Gets the text on the general section expand button. This property is computed. * @type {String} * @default '-' */ - this.generalSwitchText = '-'; + this.generalSwitchText = knockout.pureComputed(function() { + return that.generalVisible ? '-' : '+'; + }); /** - * Gets or sets if the text on the primitive section expand button. This property is observable. + * Gets the text on the primitives section expand button. This property is computed. * @type {String} * @default '+' */ - this.primitivesSwitchText = '+'; + this.primitivesSwitchText = knockout.pureComputed(function() { + return that.primitivesVisible ? '-' : '+'; + }); /** - * Gets or sets if the text on the terrain section expand button. This property is observable. + * Gets the text on the terrain section expand button. This property is computed. * @type {String} * @default '+' */ - this.terrainSwitchText = '+'; + this.terrainSwitchText = knockout.pureComputed(function() { + return that.terrainVisible ? '-' : '+'; + }); - knockout.track(this, ['filterTile', 'suspendUpdates', 'dropDownVisible', 'shaderCacheText', 'frustums', - 'frustumStatisticText', 'pickTileActive', 'pickPrimitiveActive', 'hasPickedPrimitive', - 'hasPickedTile', 'tileText', 'generalVisible', 'generalSwitchText', - 'primitivesVisible', 'primitivesSwitchText', 'terrainVisible', 'terrainSwitchText', 'depthFrustumText']); + knockout.track(this, [ + 'frustums', + 'performance', + 'shaderCacheText', + 'primitiveBoundingSphere', + 'primitiveReferenceFrame', + 'filterPrimitive', + 'tileBoundingSphere', + 'filterTile', + 'wireframe', + 'globeDepth', + 'pickDepth', + 'depthFrustum', + 'suspendUpdates', + 'tileCoordinates', + 'frustumStatisticText', + 'tileText', + 'hasPickedPrimitive', + 'hasPickedTile', + 'pickPrimitiveActive', + 'pickTileActive', + 'dropDownVisible', + 'generalVisible', + 'primitivesVisible', + 'terrainVisible', + 'depthFrustumText' + ]); this._toggleDropDown = createCommand(function() { that.dropDownVisible = !that.dropDownVisible; @@ -308,37 +337,28 @@ define([ this._toggleGeneral = createCommand(function() { that.generalVisible = !that.generalVisible; - that.generalSwitchText = that.generalVisible ? '-' : '+'; }); this._togglePrimitives = createCommand(function() { that.primitivesVisible = !that.primitivesVisible; - that.primitivesSwitchText = that.primitivesVisible ? '-' : '+'; }); this._toggleTerrain = createCommand(function() { that.terrainVisible = !that.terrainVisible; - that.terrainSwitchText = that.terrainVisible ? '-' : '+'; }); - this._showFrustums = createCommand(function() { - if (that.frustums) { - that._scene.debugShowFrustums = true; - } else { - that._scene.debugShowFrustums = false; - } - return true; + this._frustumsSubscription = knockout.getObservable(this, 'frustums').subscribe(function(val) { + that._scene.debugShowFrustums = val; }); - this._showPerformance = createCommand(function() { - if (that.performance) { + this._performanceSubscription = knockout.getObservable(this, 'performance').subscribe(function(val) { + if (val) { that._performanceDisplay = new PerformanceDisplay({ container : that._performanceContainer }); } else { that._performanceContainer.innerHTML = ''; } - return true; }); this._showPrimitiveBoundingSphere = createCommand(function() { @@ -346,6 +366,10 @@ define([ return true; }); + this._primitiveBoundingSphereSubscription = knockout.getObservable(this, 'primitiveBoundingSphere').subscribe(function() { + that._showPrimitiveBoundingSphere(); + }); + this._showPrimitiveReferenceFrame = createCommand(function() { if (that.primitiveReferenceFrame) { var modelMatrix = that._primitive.modelMatrix; @@ -360,6 +384,10 @@ define([ return true; }); + this._primitiveReferenceFrameSubscription = knockout.getObservable(this, 'primitiveReferenceFrame').subscribe(function() { + that._showPrimitiveReferenceFrame(); + }); + this._doFilterPrimitive = createCommand(function() { if (that.filterPrimitive) { that._scene.debugCommandFilter = function(command) { @@ -376,41 +404,43 @@ define([ return true; }); - this._showWireframe = createCommand(function() { - globe._surface.tileProvider._debug.wireframe = that.wireframe; - return true; + this._filterPrimitiveSubscription = knockout.getObservable(this, 'filterPrimitive').subscribe(function() { + that._doFilterPrimitive(); }); - this._showGlobeDepth = createCommand(function() { - that._scene.debugShowGlobeDepth = that.globeDepth; - return true; + this._wireframeSubscription = knockout.getObservable(this, 'wireframe').subscribe(function(val) { + globe._surface.tileProvider._debug.wireframe = val; }); - this._showPickDepth = createCommand(function() { - that._scene.debugShowPickDepth = that.pickDepth; - return true; + this._globeDepthSubscription = knockout.getObservable(this, 'globeDepth').subscribe(function(val) { + that._scene.debugShowGlobeDepth = val; + }); + + this._pickDepthSubscription = knockout.getObservable(this, 'pickDepth').subscribe(function(val) { + that._scene.debugShowPickDepth = val; + }); + + this._depthFrustumSubscription = knockout.getObservable(this, 'depthFrustum').subscribe(function(val) { + that.scene.debugShowDepthFrustum = val; }); this._incrementDepthFrustum = createCommand(function() { var next = that.depthFrustum + 1; that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next); - that.scene.debugShowDepthFrustum = that.depthFrustum; return true; }); this._decrementDepthFrustum = createCommand(function() { var next = that.depthFrustum - 1; that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next); - that.scene.debugShowDepthFrustum = that.depthFrustum; return true; }); - this._doSuspendUpdates = createCommand(function() { - globe._surface._debug.suspendLodUpdate = that.suspendUpdates; - if (!that.suspendUpdates) { + this._suspendUpdatesSubscription = knockout.getObservable(this, 'suspendUpdates').subscribe(function(val) { + globe._surface._debug.suspendLodUpdate = val; + if (!val) { that.filterTile = false; } - return true; }); var tileBoundariesLayer; @@ -426,6 +456,14 @@ define([ return true; }); + this._tileCoordinatesSubscription = knockout.getObservable(this, 'tileCoordinates').subscribe(function() { + that._showTileCoordinates(); + }); + + this._tileBoundingSphereSubscription = knockout.getObservable(this, 'tileBoundingSphere').subscribe(function() { + that._showTileBoundingSphere(); + }); + this._showTileBoundingSphere = createCommand(function() { if (that.tileBoundingSphere) { globe._surface.tileProvider._debug.boundingSphereTile = that._tile; @@ -438,10 +476,8 @@ define([ this._doFilterTile = createCommand(function() { if (!that.filterTile) { that.suspendUpdates = false; - that.doSuspendUpdates(); } else { that.suspendUpdates = true; - that.doSuspendUpdates(); globe._surface._tilesToRender = []; @@ -452,9 +488,11 @@ define([ return true; }); + this._filterTileSubscription = knockout.getObservable(this, 'filterTile').subscribe(function() { + that.doFilterTile(); + }); + function pickPrimitive(e) { - eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); - that.pickPrimitiveActive = false; var newPick = that._scene.pick({ x : e.position.x, y : e.position.y @@ -462,10 +500,16 @@ define([ if (defined(newPick)) { that.primitive = defined(newPick.collection) ? newPick.collection : newPick.primitive; } + + that.pickPrimitiveActive = false; } + this._pickPrimitive = createCommand(function() { that.pickPrimitiveActive = !that.pickPrimitiveActive; - if (that.pickPrimitiveActive) { + }); + + this._pickPrimitiveActiveSubscription = knockout.getObservable(this, 'pickPrimitiveActive').subscribe(function(val) { + if (val) { eventHandler.setInputAction(pickPrimitive, ScreenSpaceEventType.LEFT_CLICK); } else { eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); @@ -500,13 +544,15 @@ define([ that.tile = selectedTile; - eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); that.pickTileActive = false; } + this._pickTile = createCommand(function() { that.pickTileActive = !that.pickTileActive; + }); - if (that.pickTileActive) { + this._pickTileActiveSubscription = knockout.getObservable(this, 'pickTileActive').subscribe(function(val) { + if (val) { eventHandler.setInputAction(selectTile, ScreenSpaceEventType.LEFT_CLICK); } else { eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); @@ -551,29 +597,6 @@ define([ } }, - /** - * Gets the command to toggle {@link Scene.debugShowFrustums} - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - showFrustums : { - get : function() { - return this._showFrustums; - } - }, - - /** - * Gets the command to toggle the visibility of the performance display. - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - showPerformance : { - get : function() { - return this._showPerformance; - } - }, /** * Gets the command to toggle the visibility of a BoundingSphere for a primitive @@ -611,41 +634,6 @@ define([ } }, - /** - * Gets the command to toggle the view of the Globe as a wireframe - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - showWireframe : { - get : function() { - return this._showWireframe; - } - }, - - /** - * Gets the command to toggle the view of the Globe depth buffer - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - showGlobeDepth : { - get : function() { - return this._showGlobeDepth; - } - }, - - /** - * Gets the command to toggle the view of the pick depth buffer - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - showPickDepth : { - get : function() { - return this._showPickDepth; - } - }, /** * Gets the command to increment the depth frustum index to be shown @@ -671,17 +659,6 @@ define([ } }, - /** - * Gets the command to toggle whether to suspend tile updates - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - doSuspendUpdates : { - get : function() { - return this._doSuspendUpdates; - } - }, /** * Gets the command to toggle the visibility of tile coordinates @@ -932,11 +909,9 @@ define([ var numberOfFrustums = that._scene.numberOfFrustums; that._numberOfFrustums = numberOfFrustums; // Bound the frustum to be displayed. - var depthFrustum = boundDepthFrustum(1, numberOfFrustums, that.depthFrustum); - that.depthFrustum = depthFrustum; - that.scene.debugShowDepthFrustum = depthFrustum; + that.depthFrustum = boundDepthFrustum(1, numberOfFrustums, that.depthFrustum); // Update the displayed text. - that.depthFrustumText = depthFrustum + ' of ' + numberOfFrustums; + that.depthFrustumText = that.depthFrustum + ' of ' + numberOfFrustums; if (that.performance) { that._performanceDisplay.update(); @@ -964,6 +939,21 @@ define([ */ CesiumInspectorViewModel.prototype.destroy = function() { this._eventHandler.destroy(); + this._frustumsSubscription.dispose(); + this._performanceSubscription.dispose(); + this._primitiveBoundingSphereSubscription.dispose(); + this._primitiveReferenceFrameSubscription.dispose(); + this._filterPrimitiveSubscription.dispose(); + this._wireframeSubscription.dispose(); + this._globeDepthSubscription.dispose(); + this._pickDepthSubscription.dispose(); + this._depthFrustumSubscription.dispose(); + this._suspendUpdatesSubscription.dispose(); + this._tileCoordinatesSubscription.dispose(); + this._tileBoundingSphereSubscription.dispose(); + this._filterTileSubscription.dispose(); + this._pickPrimitiveActiveSubscription.dispose(); + this._pickTileActiveSubscription.dispose(); return destroyObject(this); }; diff --git a/Specs/Widgets/CesiumInspector/CesiumInspectorViewModelSpec.js b/Specs/Widgets/CesiumInspector/CesiumInspectorViewModelSpec.js index 943895de0fc1..c064b02449d9 100644 --- a/Specs/Widgets/CesiumInspector/CesiumInspectorViewModelSpec.js +++ b/Specs/Widgets/CesiumInspector/CesiumInspectorViewModelSpec.js @@ -89,11 +89,9 @@ defineSuite([ it('show frustums', function() { var viewModel = new CesiumInspectorViewModel(scene, performanceContainer); viewModel.frustums = true; - viewModel.showFrustums(); expect(viewModel.scene.debugShowFrustums).toBe(true); setTimeout(function(){ viewModel.frustums = false; - viewModel.showFrustums(); expect(viewModel.scene.debugShowFrustums).toBe(false); }, 250); }); @@ -101,12 +99,10 @@ defineSuite([ it('show performance', function() { var viewModel = new CesiumInspectorViewModel(scene, performanceContainer); viewModel.performance = true; - viewModel.showPerformance(); scene.render(); expect(performanceContainer.innerHTML).not.toEqual(''); viewModel.performance = false; - viewModel.showPerformance(); scene.render(); expect(performanceContainer.innerHTML).toEqual(''); }); @@ -122,11 +118,9 @@ defineSuite([ scene.render(); viewModel.primitive = p; viewModel.primitiveBoundingSphere = true; - viewModel.showPrimitiveBoundingSphere(); expect(p.debugShowBoundingVolume).toEqual(true); viewModel.primitiveBoundingSphere = false; - viewModel.showPrimitiveBoundingSphere(); scene.render(); expect(p.debugShowBoundingVolume).toEqual(false); }); @@ -149,13 +143,11 @@ defineSuite([ scene.render(); viewModel.primitive = p; viewModel.filterPrimitive = true; - viewModel.doFilterPrimitive(); expect(defined(scene.debugCommandFilter)).toEqual(true); expect(scene.debugCommandFilter({owner: p})).toEqual(true); expect(scene.debugCommandFilter({owner: q})).toEqual(false); viewModel.filterPrimitive = false; - viewModel.doFilterPrimitive(); expect(defined(scene.debugCommandFilter)).toEqual(false); }); @@ -171,11 +163,9 @@ defineSuite([ scene.render(); viewModel.primitive = p; viewModel.primitiveReferenceFrame = true; - viewModel.showPrimitiveReferenceFrame(); expect(scene.primitives.length).toEqual(2); viewModel.primitiveReferenceFrame = false; - viewModel.showPrimitiveReferenceFrame(); scene.render(); expect(scene.primitives.length).toEqual(1); }); @@ -183,22 +173,18 @@ defineSuite([ it('show wireframe', function() { var viewModel = new CesiumInspectorViewModel(scene, performanceContainer); viewModel.wireframe = true; - viewModel.showWireframe(); expect(viewModel.scene.globe._surface.tileProvider._debug.wireframe).toBe(true); viewModel.wireframe = false; - viewModel.showWireframe(); expect(viewModel.scene.globe._surface.tileProvider._debug.wireframe).toBe(false); }); it('suspend updates', function() { var viewModel = new CesiumInspectorViewModel(scene, performanceContainer); viewModel.suspendUpdates = true; - viewModel.doSuspendUpdates(); expect(viewModel.scene.globe._surface._debug.suspendLodUpdate).toBe(true); viewModel.suspendUpdates = false; - viewModel.doSuspendUpdates(); expect(viewModel.scene.globe._surface._debug.suspendLodUpdate).toBe(false); }); @@ -207,11 +193,9 @@ defineSuite([ expect(viewModel.scene.imageryLayers.length).toBe(0); viewModel.tileCoordinates = true; - viewModel.showTileCoordinates(); expect(viewModel.scene.imageryLayers.length).toBe(1); viewModel.tileCoordinates = false; - viewModel.showTileCoordinates(); expect(viewModel.scene.imageryLayers.length).toBe(0); }); @@ -222,11 +206,9 @@ defineSuite([ viewModel.tile = tile; viewModel.tileBoundingSphere = true; - viewModel.showTileBoundingSphere(); expect(viewModel.scene.globe._surface.tileProvider._debug.boundingSphereTile).toBe(tile); viewModel.tileBoundingSphere = false; - viewModel.showTileBoundingSphere(); expect(viewModel.scene.globe._surface.tileProvider._debug.boundingSphereTile).toBe(undefined); }); @@ -237,12 +219,10 @@ defineSuite([ viewModel.tile = tile; viewModel.filterTile = true; - viewModel.doFilterTile(); expect(viewModel.scene.globe._surface._tilesToRender[0]).toBe(tile); expect(viewModel.suspendUpdates).toBe(true); viewModel.filterTile = false; - viewModel.doFilterTile(); expect(viewModel.suspendUpdates).toBe(false); });