Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3d Tiles Inspector #4872

Merged
merged 42 commits into from
Feb 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5302190
initial model setup and tileset loading
austinEng Jan 13, 2017
d9a2234
port existing debug buttons
austinEng Jan 16, 2017
c74c761
move stats logging to inspector
austinEng Jan 17, 2017
2f43176
fix global define
austinEng Jan 17, 2017
cae2b1f
hide pick panel header when picking disabled
austinEng Jan 17, 2017
480c39e
simplify view model
austinEng Jan 17, 2017
96f7f77
improve styling
austinEng Jan 18, 2017
3a3623b
move click event handling to sandcastle example
austinEng Jan 18, 2017
ec6881c
sync tileset and model on change
austinEng Jan 18, 2017
0e659ef
simple style editor
austinEng Jan 18, 2017
fe571e8
tileset picking
austinEng Jan 19, 2017
b9e618f
add inspector to other examples
austinEng Jan 19, 2017
6fc57f3
update sliders onchange
austinEng Jan 23, 2017
a488333
style editor modifications
austinEng Jan 23, 2017
16e403f
add error message for styles
austinEng Jan 23, 2017
c5dfc14
add color blend mode
austinEng Jan 23, 2017
2a5a768
show tile properties
austinEng Jan 23, 2017
0c5f266
update CHANGES.md
austinEng Jan 23, 2017
903448a
add tests
austinEng Jan 24, 2017
27c23d9
styling improvements
austinEng Jan 24, 2017
b3fe8af
Merge remote-tracking branch 'agi/3d-tiles' into 3d-tiles-inspector
austinEng Jan 24, 2017
e54fc97
load first tileset on sandcastle demo load
austinEng Jan 24, 2017
865df3f
nonlinear density slider
austinEng Jan 24, 2017
2191d14
improve density slider
austinEng Jan 25, 2017
4f2584b
fix stats logging
austinEng Jan 25, 2017
0e674a0
scroll text of error message
austinEng Jan 25, 2017
a3a7a62
remove tileset URL display
austinEng Jan 25, 2017
2dc4b22
update
austinEng Jan 30, 2017
320db2f
Merge remote-tracking branch 'agi/3d-tiles' into 3d-tiles-inspector
austinEng Jan 30, 2017
28f1b7f
rename model to viewModel
austinEng Jan 30, 2017
d79963e
duplicate argument
austinEng Jan 31, 2017
b713d22
improve application of pick coloring
austinEng Jan 31, 2017
64e63bb
style editor tab support
austinEng Jan 31, 2017
11d89a6
always apply styles on compile
austinEng Jan 31, 2017
6e432f6
restore color overlay after pick
austinEng Feb 1, 2017
ff6b6db
Merge remote-tracking branch 'agi/3d-tiles' into 3d-tiles-inspector
austinEng Feb 1, 2017
4d98daf
reapply styles after disabling colorize
austinEng Feb 1, 2017
e495236
Merge remote-tracking branch 'agi/3d-tiles' into 3d-tiles-inspector
austinEng Feb 3, 2017
af6de33
Merge remote-tracking branch 'agi/3d-tiles' into 3d-tiles-inspector
austinEng Feb 3, 2017
e1f4a35
remove debug camera from tileset
austinEng Feb 3, 2017
d114510
remove tests for statistics logging no longer contained in 3DTileset
austinEng Feb 3, 2017
56fbeb9
fix recolor on click
austinEng Feb 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 8 additions & 81 deletions Apps/Sandcastle/gallery/3D Tiles Batch Table Hierarchy.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,15 @@
// * doorknob_name

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);
var inspectorViewModel = viewer.cesium3DTilesInspector.viewModel;

var scene = viewer.scene;
var tilesetUrl = '../../../Specs/Data/Cesium3DTiles/Hierarchy/BatchTableHierarchy';
var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
url : tilesetUrl
}));
inspectorViewModel.tileset = tileset;

function zoomToTileset() {
var boundingSphere = tileset.boundingSphere;
Expand Down Expand Up @@ -186,89 +189,13 @@

var handler = new Cesium.ScreenSpaceEventHandler(canvas);

var pickingEnabled = true;
var flags = {
// Mouse
leftDown : false,
middleDown : false,
rightDown : false
};

handler.setInputAction(function(movement) {
flags.leftDown = true;
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);

handler.setInputAction(function(movement) {
flags.middleDown = true;
}, Cesium.ScreenSpaceEventType.MIDDLE_DOWN);

handler.setInputAction(function(movement) {
flags.rightDown = true;
}, Cesium.ScreenSpaceEventType.RIGHT_DOWN);

handler.setInputAction(function(movement) {
flags.leftDown = false;
}, Cesium.ScreenSpaceEventType.LEFT_UP);

handler.setInputAction(function(movement) {
flags.middleDown = false;
}, Cesium.ScreenSpaceEventType.MIDDLE_UP);

handler.setInputAction(function(movement) {
flags.rightDown = false;
}, Cesium.ScreenSpaceEventType.RIGHT_UP);

var current = {
feature : undefined,
originalColor : new Cesium.Color()
};

var HIGHLIGHT_COLOR = new Cesium.Color(1.0, 1.0, 0.0, 0.4);

// Highlight feature on mouse over
handler.setInputAction(function(movement) {
if (scene.mode === Cesium.SceneMode.MORPHING) {
return;
}

if (!pickingEnabled) {
return;
}

if (flags.leftDown || flags.middleDown || flags.rightDown) {
// Don't highlight when panning and zooming
return;
}

var pickedFeature = scene.pick(movement.endPosition);

if (Cesium.defined(current.feature) && (current.feature !== pickedFeature)) {
// Restore original color to feature that is no longer selected

// This assignment is necessary to work with the set property
current.feature.color = Cesium.Color.clone(current.originalColor, current.feature.color);
current.feature = undefined;
}

if (Cesium.defined(pickedFeature) && (pickedFeature !== current.feature)) {
// For testing re-evaluating a style when a property changes
//pickedFeature.setProperty('id', 1);

current.feature = pickedFeature;
Cesium.Color.clone(pickedFeature.color, current.originalColor);

// Highlight newly selected feature
pickedFeature.color = Cesium.Color.clone(HIGHLIGHT_COLOR, pickedFeature.color);
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);

// When a feature is left clicked, print it's class name and properties
handler.setInputAction(function(movement) {
if (!pickingEnabled) {
if (!inspectorViewModel.picking) {
return;
}

var feature = current.feature;
var feature = inspectorViewModel.feature;
if (Cesium.defined(feature)) {
console.log('Class: ' + feature.getExactClassName());
console.log('Properties:');
Expand All @@ -284,12 +211,12 @@

// When a feature is middle clicked, hide it
handler.setInputAction(function(movement) {
if (!pickingEnabled) {
if (!inspectorViewModel.picking) {
return;
}

if (Cesium.defined(current.feature)) {
current.feature.show = false;
if (Cesium.defined(inspectorViewModel.feature)) {
inspectorViewModel.feature.show = false;
}
}, Cesium.ScreenSpaceEventType.MIDDLE_CLICK);

Expand Down
3 changes: 3 additions & 0 deletions Apps/Sandcastle/gallery/3D Tiles Point Cloud Styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@
//Sandcastle_Begin

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);
var inspectorViewModel = viewer.cesium3DTilesInspector.viewModel;

var scene = viewer.scene;
var url = '../../../Specs/Data/Cesium3DTiles/PointCloud/PointCloudWithPerPointProperties/';

var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
url : url
}));
inspectorViewModel.tileset = tileset;

function zoomToTileset() {
var boundingSphere = tileset.boundingSphere;
Expand Down
Loading