Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #15 from oterral/c2c_patches_cesium_1.24
Browse files Browse the repository at this point in the history
Update to cesium 1.24
  • Loading branch information
gberaudo authored Sep 1, 2016
2 parents e76dd56 + e688887 commit 3f04a17
Show file tree
Hide file tree
Showing 228 changed files with 32,184 additions and 5,609 deletions.
Binary file modified Apps/SampleData/models/CesiumAir/Cesium_Air.glb
Binary file not shown.
510 changes: 510 additions & 0 deletions Apps/SampleData/models/CesiumBalloon/CesiumBalloon.dae

Large diffs are not rendered by default.

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Apps/SampleData/models/CesiumBalloon/FlameGrate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Apps/SampleData/models/CesiumGround/Cesium_Ground.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/CesiumMan/Cesium_Man.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb
Binary file not shown.
70 changes: 33 additions & 37 deletions Apps/Sandcastle/CesiumSandcastle.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ require({
location : '../ThirdParty/codemirror-4.6'
}]
}, [
"dijit/Dialog",
"dijit/form/Button",
"dijit/form/Form",
"dijit/form/Textarea",
'CodeMirror/lib/codemirror',
'dijit/layout/ContentPane',
'dijit/popup',
Expand All @@ -38,10 +42,6 @@ require({
'dojo/query',
'dojo/when',
'Sandcastle/LinkButton',
"dijit/Dialog",
"dijit/form/Form",
"dijit/form/Textarea",
"dijit/form/Button",
'Source/Cesium',
'CodeMirror/addon/hint/show-hint',
'CodeMirror/addon/hint/javascript-hint',
Expand All @@ -63,6 +63,10 @@ require({
'dijit/ToolbarSeparator',
'dojo/domReady!'
], function(
Dialog,
Button,
Form,
TextArea,
CodeMirror,
ContentPane,
popup,
Expand All @@ -81,20 +85,12 @@ require({
query,
when,
LinkButton,
Dialog,
Form,
TextArea,
Button,
Cesium) {
'use strict';

//In order for CodeMirror auto-complete to work, Cesium needs to be defined as a global.
window.Cesium = Cesium;

function defined(value) {
return value !== undefined;
}

parser.parse();

fx.fadeOut({
Expand Down Expand Up @@ -212,7 +208,7 @@ require({
}

function openDocTab(title, link) {
if (!defined(docTabs[title])) {
if (!Cesium.defined(docTabs[title])) {
docTabs[title] = new ContentPane({
title : title,
focused : true,
Expand Down Expand Up @@ -269,7 +265,7 @@ require({

function onCursorActivity() {
docNode.style.left = '-999px';
if (defined(docTimer)) {
if (Cesium.defined(docTimer)) {
window.clearTimeout(docTimer);
}
docTimer = window.setTimeout(showDocPopup, 500);
Expand All @@ -293,7 +289,7 @@ require({
}

function closeGalleryTooltip() {
if (defined(activeGalleryTooltipDemo)) {
if (Cesium.defined(activeGalleryTooltipDemo)) {
popup.close(demoTooltips[activeGalleryTooltipDemo.name]);
activeGalleryTooltipDemo = undefined;
}
Expand All @@ -310,7 +306,7 @@ require({
suffix = 'searchDemo';
}

if (defined(activeGalleryTooltipDemo)) {
if (Cesium.defined(activeGalleryTooltipDemo)) {
popup.open({
popup : demoTooltips[activeGalleryTooltipDemo.name],
around : dom.byId(activeGalleryTooltipDemo.name + suffix),
Expand All @@ -322,7 +318,7 @@ require({
function scheduleGalleryTooltip(demo) {
if (demo !== activeGalleryTooltipDemo) {
activeGalleryTooltipDemo = demo;
if (defined(galleryTooltipTimer)) {
if (Cesium.defined(galleryTooltipTimer)) {
window.clearTimeout(galleryTooltipTimer);
}
galleryTooltipTimer = window.setTimeout(openGalleryTooltip, 220);
Expand Down Expand Up @@ -369,7 +365,7 @@ require({
var hints = JSHINT.errors;
for (i = 0, len = hints.length; i < len; ++i) {
var hint = hints[i];
if (hint !== null && defined(hint.reason) && hint.line > 0) {
if (hint !== null && Cesium.defined(hint.reason) && hint.line > 0) {
line = jsEditor.setGutterMarker(scriptLineToEditorLine(hint.line), 'hintGutter', makeLineLabel(hint.reason, 'hintMarker'));
jsEditor.addLineClass(line, 'text', 'hintLine');
errorLines.push(line);
Expand All @@ -379,22 +375,22 @@ require({
}

function scheduleHint() {
if (defined(hintTimer)) {
if (Cesium.defined(hintTimer)) {
window.clearTimeout(hintTimer);
}
hintTimer = setTimeout(clearErrorsAddHints, 550);
highlightRun();
}

function scheduleHintNoChange() {
if (defined(hintTimer)) {
if (Cesium.defined(hintTimer)) {
window.clearTimeout(hintTimer);
}
hintTimer = setTimeout(clearErrorsAddHints, 550);
}

function scrollToLine(lineNumber) {
if (defined(lineNumber)) {
if (Cesium.defined(lineNumber)) {
jsEditor.setCursor(lineNumber);
// set selection twice in order to force the editor to scroll
// to this location if the cursor is already there
Expand Down Expand Up @@ -453,13 +449,13 @@ require({
function registerScroll(demoContainer) {
if (document.onmousewheel !== undefined) {
demoContainer.addEventListener('mousewheel', function(e) {
if (defined(e.wheelDelta) && e.wheelDelta) {
if (Cesium.defined(e.wheelDelta) && e.wheelDelta) {
demoContainer.scrollLeft -= e.wheelDelta * 70 / 120;
}
}, false);
} else {
demoContainer.addEventListener('DOMMouseScroll', function(e) {
if (defined(e.detail) && e.detail) {
if (Cesium.defined(e.detail) && e.detail) {
demoContainer.scrollLeft += e.detail * 70 / 3;
}
}, false);
Expand Down Expand Up @@ -657,7 +653,7 @@ require({
function loadBucket(bucketName) {
if (local.bucketName !== bucketName) {
local.bucketName = bucketName;
if (defined(bucketTypes[bucketName])) {
if (Cesium.defined(bucketTypes[bucketName])) {
local.headers = bucketTypes[bucketName];
} else {
local.headers = '<html><head></head><body data-sandcastle-bucket-loaded="no">';
Expand All @@ -681,13 +677,13 @@ require({
var gistId = ioQuery.queryToObject(window.location.search.substring(1)).gist;
if (window.location.search) {
queryObject = ioQuery.queryToObject(window.location.search.substring(1));
if (defined(gistId)) {
if (Cesium.defined(gistId)) {
queryObject.gistId = gistId;
}
} else {
queryObject.src = 'Hello World.html';
queryObject.label = 'Showcases';
if (defined(gistId)) {
if (Cesium.defined(gistId)) {
queryObject.gistId = gistId;
}
}
Expand Down Expand Up @@ -725,7 +721,7 @@ require({
var scriptCode = scriptMatch[1];
demoJs = scriptCode.replace(/\s/g, '');

if (defined(queryObject.gistId)) {
if (Cesium.defined(queryObject.gistId)) {
Cesium.loadJsonp('https://api.github.com/gists/' + queryObject.gistId + '?access_token=dd8f755c2e5d9bbb26806bb93eaa2291f2047c60')
.then(function(data) {
var files = data.data.files;
Expand Down Expand Up @@ -798,14 +794,14 @@ require({
appendConsole('consoleError', 'Error loading gallery, please run the build script.', true);
}
}
} else if (defined(e.data.log)) {
} else if (Cesium.defined(e.data.log)) {
// Console log messages from the iframe display in Sandcastle.
appendConsole('consoleLog', e.data.log, false);
} else if (defined(e.data.error)) {
} else if (Cesium.defined(e.data.error)) {
// Console error messages from the iframe display in Sandcastle
var errorMsg = e.data.error;
var lineNumber = e.data.lineNumber;
if (defined(lineNumber)) {
if (Cesium.defined(lineNumber)) {
errorMsg += ' (on line ';

if (e.data.url) {
Expand All @@ -820,10 +816,10 @@ require({
}
}
appendConsole('consoleError', errorMsg, true);
} else if (defined(e.data.warn)) {
} else if (Cesium.defined(e.data.warn)) {
// Console warning messages from the iframe display in Sandcastle.
appendConsole('consoleWarn', e.data.warn, true);
} else if (defined(e.data.highlight)) {
} else if (Cesium.defined(e.data.highlight)) {
// Hovering objects in the embedded Cesium window.
highlightLine(e.data.highlight);
}
Expand Down Expand Up @@ -1070,15 +1066,15 @@ require({
demo.label = labels ? labels : '';

// Select the demo to load upon opening based on the query parameter.
if (defined(queryObject.src)) {
if (Cesium.defined(queryObject.src)) {
var gistDemo = {
name : 'Gist Import',
code : demo.code,
description: 'Code imported from GitHub Gist'
};
if (demo.name === queryObject.src.replace('.html', '')) {
loadFromGallery(demo).then(function() {
if (defined(queryObject.gistId)) {
if (Cesium.defined(queryObject.gistId)) {
window.history.replaceState(gistDemo, gistDemo.name, '?src=Hello World.html&label=' + queryObject.label + '&gist=' + queryObject.gistId);
document.title = 'Gist Import - Cesium Sandcastle';
} else {
Expand All @@ -1103,7 +1099,7 @@ require({

var loading = true;
function setSubtab(tabName) {
currentTab = defined(tabName) && !loading ? tabName : queryObject.label;
currentTab = Cesium.defined(tabName) && !loading ? tabName : queryObject.label;
queryObject.label = tabName;
loading = false;
}
Expand Down Expand Up @@ -1146,7 +1142,7 @@ require({
function createGalleryButton(index, tab, tabName) {
var demo = gallery_demos[index];
var imgSrc = 'templates/Gallery_tile.jpg';
if (defined(demo.img)) {
if (Cesium.defined(demo.img)) {
imgSrc = 'gallery/' + demo.img;
}

Expand Down Expand Up @@ -1198,7 +1194,7 @@ require({
}

var promise;
if (!defined(gallery_demos)) {
if (!Cesium.defined(gallery_demos)) {
galleryErrorMsg.textContent = 'No demos found, please run the build script.';
galleryErrorMsg.style.display = 'inline-block';
} else {
Expand Down
12 changes: 11 additions & 1 deletion Apps/Sandcastle/Sandcastle-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
return value !== undefined;
}

function print(value) {
if (value === null) {
return 'null';
} else if (defined(value)) {
return value.toString();
} else {
return 'undefined';
}
}

console.originalLog = console.log;
console.log = function(d1) {
console.originalLog.apply(console, arguments);
window.parent.postMessage({
'log' : defined(d1) ? d1.toString() : 'undefined'
'log' : print(d1)
}, '*');
};

Expand Down
5 changes: 5 additions & 0 deletions Apps/Sandcastle/gallery/3D Models.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
onselect : function() {
createModel('../../SampleData/models/CesiumGround/Cesium_Ground.glb', 0);
}
}, {
text : 'Hot Air Balloon',
onselect : function() {
createModel('../../SampleData/models/CesiumBalloon/CesiumBalloon.glb', 1000.0);
}
}, {
text : 'Milk truck',
onselect : function() {
Expand Down
56 changes: 27 additions & 29 deletions Apps/Sandcastle/gallery/CZML Billboard and Label.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,54 +26,52 @@

<script id="cesium_sandcastle_script">
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var czml = [
{
'use strict';
//Sandcastle_Begin
var czml = [{
"id" : "document",
"name" : "Basic CZML billboard and label",
"version" : "1.0"
}, {
}, {
"id" : "some-unique-id",
"name" : "AGI",
"description" : "<p><a href='http://www.agi.com' target='_blank'>Analytical Graphics, Inc.</a> (AGI) founded Cesium.</p>",
"billboard" : {
"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACvSURBVDhPrZDRDcMgDAU9GqN0lIzijw6SUbJJygUeNQgSqepJTyHG91LVVpwDdfxM3T9TSl1EXZvDwii471fivK73cBFFQNTT/d2KoGpfGOpSIkhUpgUMxq9DFEsWv4IXhlyCnhBFnZcFEEuYqbiUlNwWgMTdrZ3JbQFoEVG53rd8ztG9aPJMnBUQf/VFraBJeWnLS0RfjbKyLJA8FkT5seDYS1Qwyv8t0B/5C2ZmH2/eTGNNBgMmAAAAAElFTkSuQmCC",
"scale" : 1.5
"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACvSURBVDhPrZDRDcMgDAU9GqN0lIzijw6SUbJJygUeNQgSqepJTyHG91LVVpwDdfxM3T9TSl1EXZvDwii471fivK73cBFFQNTT/d2KoGpfGOpSIkhUpgUMxq9DFEsWv4IXhlyCnhBFnZcFEEuYqbiUlNwWgMTdrZ3JbQFoEVG53rd8ztG9aPJMnBUQf/VFraBJeWnLS0RfjbKyLJA8FkT5seDYS1Qwyv8t0B/5C2ZmH2/eTGNNBgMmAAAAAElFTkSuQmCC",
"scale" : 1.5
},
"label" : {
"fillColor" : {
"rgba" : [0, 255, 255, 255]
},
"font" : "11pt Lucida Console",
"horizontalOrigin" : "LEFT",
"outlineColor" : {
"rgba":[0, 0, 0, 255]
},
"outlineWidth" : 2,
"pixelOffset" : {
"cartesian2" : [12, 0]
},
"style" : "FILL_AND_OUTLINE",
"text" : "AGI"
"fillColor" : {
"rgba" : [0, 255, 255, 255]
},
"font" : "11pt Lucida Console",
"horizontalOrigin" : "LEFT",
"outlineColor" : {
"rgba":[0, 0, 0, 255]
},
"outlineWidth" : 2,
"pixelOffset" : {
"cartesian2" : [12, 0]
},
"style" : "FILL_AND_OUTLINE",
"text" : "AGI"
},
"position" : {
"cartesian" : [
1216469.9357990976, -4736121.71856379, 4081386.8856866374
]
"cartesian":[
1216361.4096947117, -4736253.175342511, 4081267.4865667094
]
}
}
];
}];

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.CzmlDataSource.load(czml));
//Sandcastle_End
Sandcastle.finishedLoading();
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
require(["Cesium"], startup);
}
</script>
</body>
Expand Down
Loading

0 comments on commit 3f04a17

Please sign in to comment.