Skip to content

Commit

Permalink
Merge pull request #4857 from austinEng/cesiumInspector
Browse files Browse the repository at this point in the history
Improve knockout usage with the Cesium Inspector
  • Loading branch information
Hannah authored Jan 12, 2017
2 parents bc2d859 + 6496d2c commit 65f8749
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 162 deletions.
30 changes: 15 additions & 15 deletions Source/Widgets/CesiumInspector/CesiumInspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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'));

Expand All @@ -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'));

Expand All @@ -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'));

Expand Down Expand Up @@ -185,15 +185,15 @@ 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'));

var refFrame = document.createElement('div');
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'));

Expand All @@ -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'));

Expand All @@ -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';
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -301,39 +301,39 @@ 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'));

var renderTile = document.createElement('div');
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'));

var wireframe = document.createElement('div');
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'));

var suspendUpdates = document.createElement('div');
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'));

var tileCoords = document.createElement('div');
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'));

Expand Down
Loading

0 comments on commit 65f8749

Please sign in to comment.