From 48203901894b8b7d8eb65db8ac3d2f3272fe898b Mon Sep 17 00:00:00 2001 From: hpinkos Date: Tue, 27 Feb 2018 17:51:14 -0500 Subject: [PATCH 01/38] Add caching to sampleTerrain --- Source/Core/DoublyLinkedList.js | 29 +++++++++++ Source/Core/LRUCache.js | 77 ++++++++++++++++++++++++++++++ Source/Core/sampleTerrain.js | 31 ++++++++++-- Specs/Core/DoublyLinkedListSpec.js | 71 +++++++++++++++++++++++++++ Specs/Core/LRUCacheSpec.js | 77 ++++++++++++++++++++++++++++++ 5 files changed, 281 insertions(+), 4 deletions(-) create mode 100644 Source/Core/LRUCache.js create mode 100644 Specs/Core/LRUCacheSpec.js diff --git a/Source/Core/DoublyLinkedList.js b/Source/Core/DoublyLinkedList.js index c73ff464338c..c39a7d58aba9 100644 --- a/Source/Core/DoublyLinkedList.js +++ b/Source/Core/DoublyLinkedList.js @@ -46,6 +46,35 @@ define([ return node; }; + DoublyLinkedList.prototype.addFront = function(item) { + var node = new DoublyLinkedListNode(item, undefined, this.head); + + if (defined(this.head)) { + this.head.previous = node; + this.head = node; + } else { + // Insert into empty linked list + this.head = node; + this.tail = node; + } + + ++this._length; + + return node; + }; + + DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.head === node) { + return; + } + + remove(this, node); + node.next = this.head; + node.previous = undefined; + this.head.previous = node; + this.head = node; + }; + function remove(list, node) { if (defined(node.previous) && defined(node.next)) { node.previous.next = node.next; diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js new file mode 100644 index 000000000000..ab3fa32c7e60 --- /dev/null +++ b/Source/Core/LRUCache.js @@ -0,0 +1,77 @@ +define([ + './defined', + './DeveloperError', + './DoublyLinkedList' +], function( + defined, + DeveloperError, + DoublyLinkedList) { + 'use strict'; + + /** + * A cache for storing key-value pairs + * @param {Number} [capacity] The capacity of the cache. If undefined, the size will be unlimited. + * @alias AssociativeArray + * @constructor + */ + function LRUCache(capacity) { + this._list = new DoublyLinkedList(); + this._hash = {}; + this._hasCapacity = defined(capacity); + this._capacity = capacity; + } + + /** + * Retrieves the value associated with the provided key. + * + * @param {String|Number} key The key whose value is to be retrieved. + * @returns {Object} The associated value, or undefined if the key does not exist in the collection. + */ + LRUCache.prototype.get = function(key) { + //>>includeStart('debug', pragmas.debug); + if (typeof key !== 'string' && typeof key !== 'number') { + throw new DeveloperError('key is required to be a string or number.'); + } + //>>includeEnd('debug'); + var list = this._list; + var node = this._hash[key]; + if (defined(node)) { + list.moveToFront(node); + return node.item; + } + }; + + /** + * Associates the provided key with the provided value. If the key already + * exists, it is overwritten with the new value. + * + * @param {String|Number} key A unique identifier. + * @param {Object} value The value to associate with the provided key. + */ + LRUCache.prototype.set = function(key, value) { + //>>includeStart('debug', pragmas.debug); + if (typeof key !== 'string' && typeof key !== 'number') { + throw new DeveloperError('key is required to be a string or number.'); + } + //>>includeEnd('debug'); + var hash = this._hash; + var list = this._list; + + var node = hash[key]; + if (!defined(node)) { + node = list.addFront(value); + node._key = key; + hash[key] = node; + if (this._hasCapacity && list.length > this._capacity) { + var tail = list.tail; + delete this._hash[tail._key]; + list.remove(tail); + } + } else { + node.item = value; + list.moveToFront(node); + } + }; + + return LRUCache; +}); diff --git a/Source/Core/sampleTerrain.js b/Source/Core/sampleTerrain.js index 08b1bea181d4..cc03f1ca5172 100644 --- a/Source/Core/sampleTerrain.js +++ b/Source/Core/sampleTerrain.js @@ -1,11 +1,17 @@ define([ '../ThirdParty/when', - './Check' + './defined', + './Check', + './LRUCache' ], function( when, - Check) { + defined, + Check, + LRUCache) { 'use strict'; + var cache = new LRUCache(100); + /** * Initiates a terrain height query for an array of {@link Cartographic} positions by * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation @@ -86,8 +92,18 @@ define([ var tilePromises = []; for (i = 0; i < tileRequests.length; ++i) { var tileRequest = tileRequests[i]; - var requestPromise = tileRequest.terrainProvider.requestTileGeometry(tileRequest.x, tileRequest.y, tileRequest.level); - var tilePromise = when(requestPromise, createInterpolateFunction(tileRequest), createMarkFailedFunction(tileRequest)); + var cacheKey = tileRequest.x + '-' + tileRequest.y + '-' + tileRequest.level; + var requestPromise; + var cachedTile = cache.get(cacheKey); + if (defined(cachedTile)) { + requestPromise = cachedTile; + } else { + requestPromise = tileRequest.terrainProvider.requestTileGeometry(tileRequest.x, tileRequest.y, tileRequest.level) + .then(setCache(cacheKey)); + } + var tilePromise = when(requestPromise) + .then(createInterpolateFunction(tileRequest)) + .otherwise(createMarkFailedFunction(tileRequest)); tilePromises.push(tilePromise); } @@ -96,6 +112,13 @@ define([ }); } + function setCache(cacheKey) { + return function(terrainData) { + cache.set(cacheKey, terrainData); + return terrainData; + }; + } + function createInterpolateFunction(tileRequest) { var tilePositions = tileRequest.positions; var rectangle = tileRequest.tilingScheme.tileXYToRectangle(tileRequest.x, tileRequest.y, tileRequest.level); diff --git a/Specs/Core/DoublyLinkedListSpec.js b/Specs/Core/DoublyLinkedListSpec.js index 1874ccc7fff4..fd22c7d4de51 100644 --- a/Specs/Core/DoublyLinkedListSpec.js +++ b/Specs/Core/DoublyLinkedListSpec.js @@ -63,6 +63,77 @@ defineSuite([ expect(node2.next).toEqual(node3); }); + it('adds to the front of the list', function() { + var list = new DoublyLinkedList(); + var node = list.addFront(1); + + // node + // ^ ^ + // | | + // head tail + expect(list.head).toEqual(node); + expect(list.tail).toEqual(node); + expect(list.length).toEqual(1); + + expect(node).toBeDefined(); + expect(node.item).toEqual(1); + expect(node.previous).not.toBeDefined(); + expect(node.next).not.toBeDefined(); + + var node2 = list.addFront(2); + + // node2 <-> node + // ^ ^ + // | | + // head tail + expect(list.head).toEqual(node2); + expect(list.tail).toEqual(node); + expect(list.length).toEqual(2); + + expect(node2).toBeDefined(); + expect(node2.item).toEqual(2); + expect(node2.previous).toBeUndefined(); + expect(node2.next).toBe(node); + + expect(node.previous).toBe(node2); + expect(node.next).toBeUndefined(node2); + + var node3 = list.addFront(3); + + // node3 <-> node2 <-> node + // ^ ^ + // | | + // head tail + expect(list.head).toEqual(node3); + expect(list.tail).toEqual(node); + expect(list.length).toEqual(3); + + expect(node3).toBeDefined(); + expect(node3.item).toEqual(3); + expect(node3.previous).toBeUndefined(); + expect(node3.next).toBe(node2); + + expect(node2.previous).toEqual(node3); + expect(node2.next).toEqual(node); + }); + + it('moves node to the front of the list', function() { + var list = new DoublyLinkedList(); + var node = list.add(1); + var node2 = list.add(2); + var node3 = list.add(3); + var node4 = list.add(4); + + list.moveToFront(node); + expectOrder(list, [node, node2, node3, node4]); + + list.moveToFront(node4); + expectOrder(list, [node4, node, node2, node3]); + + list.moveToFront(node2); + expectOrder(list, [node2, node4, node, node3]); + }); + it('removes from a list with one item', function() { var list = new DoublyLinkedList(); var node = list.add(1); diff --git a/Specs/Core/LRUCacheSpec.js b/Specs/Core/LRUCacheSpec.js new file mode 100644 index 000000000000..8061569b246b --- /dev/null +++ b/Specs/Core/LRUCacheSpec.js @@ -0,0 +1,77 @@ +defineSuite([ + 'Core/LRUCache' +], function( + LRUCache) { + 'use strict'; + + it('can manipulate values', function() { + var cache = new LRUCache(); + + expect(cache.get('key1')).toBeUndefined(); + + cache.set('key1', 1); + cache.set('key2', 2); + cache.set('key3', 3); + + expect(cache.get('key1')).toEqual(1); + expect(cache.get('key2')).toEqual(2); + expect(cache.get('key3')).toEqual(3); + + cache.set('key2', 4); + expect(cache.get('key2')).toEqual(4); + }); + + it('set throws with undefined key', function() { + var associativeArray = new LRUCache(); + expect(function() { + associativeArray.set(undefined, 1); + }).toThrowDeveloperError(); + }); + + it('get throws with undefined key', function() { + var associativeArray = new LRUCache(); + expect(function() { + associativeArray.get(undefined); + }).toThrowDeveloperError(); + }); + + it('Overflows correctly when capacity is set', function() { + var cache = new LRUCache(3); + + expect(cache.get('key1')).toBeUndefined(); + + cache.set('key1', 1); + cache.set('key2', 2); + cache.set('key3', 3); + + expect(cache.get('key1')).toEqual(1); //[3, 2, 1] + expect(cache.get('key2')).toEqual(2); + expect(cache.get('key3')).toEqual(3); + + cache.set('key4', 4); //[4, 3, 2] + expect(cache.get('key1')).toBeUndefined(); + expect(cache.get('key2')).toEqual(2); + expect(cache.get('key3')).toEqual(3); + expect(cache.get('key4')).toEqual(4); + + //set moves to the front of the list + cache.set('key2', 22); //[2, 4, 3] + expect(cache.get('key3')).toEqual(3); + expect(cache.get('key2')).toEqual(22); + expect(cache.get('key4')).toEqual(4); + + cache.set('key3', 3); //[3, 2, 4] + expect(cache.get('key1')).toBeUndefined(); + expect(cache.get('key2')).toEqual(22); + expect(cache.get('key3')).toEqual(3); + expect(cache.get('key4')).toEqual(4); + + //get moves to the front of the list + cache.get('key4'); //[4, 3, 2] + cache.set('key1', 1); //[1, 3, 4] + expect(cache.get('key1')).toEqual(1); + expect(cache.get('key2')).toBeUndefined(); + expect(cache.get('key3')).toEqual(3); + expect(cache.get('key4')).toEqual(4); + }); +}); From 26892f1c3db77405bfec70390ac355eb72151337 Mon Sep 17 00:00:00 2001 From: hpinkos Date: Fri, 9 Mar 2018 11:37:30 -0500 Subject: [PATCH 02/38] LRUCache expiration --- Source/Core/DoublyLinkedList.js | 74 ++++++++++++++++++++++++++---- Source/Core/LRUCache.js | 63 ++++++++++++++++++++++--- Source/Core/sampleTerrain.js | 23 ++++------ Source/Scene/Scene.js | 3 ++ Specs/Core/DoublyLinkedListSpec.js | 56 ++++++++++++++++++++++ Specs/Core/LRUCacheSpec.js | 45 +++++++++++++++++- 6 files changed, 234 insertions(+), 30 deletions(-) diff --git a/Source/Core/DoublyLinkedList.js b/Source/Core/DoublyLinkedList.js index c39a7d58aba9..36bc64966bde 100644 --- a/Source/Core/DoublyLinkedList.js +++ b/Source/Core/DoublyLinkedList.js @@ -1,11 +1,17 @@ define([ - '../Core/defined', - '../Core/defineProperties' + './defined', + './defineProperties' ], function( defined, defineProperties) { 'use strict'; + function DoublyLinkedListNode(item, previous, next) { + this.item = item; + this.previous = previous; + this.next = next; + } + /** * @private */ @@ -23,12 +29,11 @@ define([ } }); - function DoublyLinkedListNode(item, previous, next) { - this.item = item; - this.previous = previous; - this.next = next; - } - + /** + * Adds the item to the end of the list + * @param {Object} [item] + * @return {DoublyLinkedListNode} + */ DoublyLinkedList.prototype.add = function(item) { var node = new DoublyLinkedListNode(item, this.tail, undefined); @@ -46,6 +51,11 @@ define([ return node; }; + /** + * Adds the item to the front of the list + * @param {Object} [item] + * @return {DoublyLinkedListNode} + */ DoublyLinkedList.prototype.addFront = function(item) { var node = new DoublyLinkedListNode(item, undefined, this.head); @@ -63,8 +73,12 @@ define([ return node; }; + /** + * Moves the given node to the front of the list + * @param {DoublyLinkedListNode} node + */ DoublyLinkedList.prototype.moveToFront = function(node) { - if (this.head === node) { + if (!defined(node) || this.head === node) { return; } @@ -97,6 +111,10 @@ define([ node.previous = undefined; } + /** + * Removes the given node from the list + * @param {DoublyLinkedListNode} node + */ DoublyLinkedList.prototype.remove = function(node) { if (!defined(node)) { return; @@ -107,6 +125,44 @@ define([ --this._length; }; + /** + * Removes all nodes after the start index (inclusive) + * @param {Number} startIndex The index of the first node to remove + */ + DoublyLinkedList.prototype.removeAfter = function(startIndex) { + var currentLength = this._length; + if (!defined(startIndex) || startIndex >= currentLength) { + return; + } + + if (startIndex === 0) { + this.head = undefined; + this.tail = undefined; + this._length = 0; + return; + } + + if (startIndex === currentLength - 1) { + this.remove(this.tail); + return; + } + + var i; + var node = this.head; + for (i = 0; i < startIndex; i++) { + node = node.next; + } + + node.previous.next = undefined; + this.tail = node.previous; + this._length = startIndex; + }; + + /** + * Moves nextNode after node + * @param {DoublyLinkedListNode} node + * @param {DoublyLinkedListNode} nextNode + */ DoublyLinkedList.prototype.splice = function(node, nextNode) { if (node === nextNode) { return; diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index ab3fa32c7e60..a0aa6f04e531 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -1,24 +1,39 @@ define([ './defined', + './getTimestamp', './DeveloperError', './DoublyLinkedList' ], function( defined, + getTimestamp, DeveloperError, DoublyLinkedList) { 'use strict'; + function Item (key, value) { + this.key = key; + this.value = value; + this.timestamp = getTimestamp(); + } + + Item.prototype.touch = function() { + this.timestamp = getTimestamp(); + }; + /** * A cache for storing key-value pairs * @param {Number} [capacity] The capacity of the cache. If undefined, the size will be unlimited. + * @param {Number} [expiration] The number of milliseconds before an item in the cache expires and will be discarded when LRUCache.prune is called. If undefined, items do not expire. * @alias AssociativeArray * @constructor */ - function LRUCache(capacity) { + function LRUCache(capacity, expiration) { this._list = new DoublyLinkedList(); this._hash = {}; this._hasCapacity = defined(capacity); this._capacity = capacity; + this._hasExpiration = defined(expiration); + this._expiration = expiration; } /** @@ -37,7 +52,9 @@ define([ var node = this._hash[key]; if (defined(node)) { list.moveToFront(node); - return node.item; + var item = node.item; + item.touch(); + return item.value; } }; @@ -58,20 +75,54 @@ define([ var list = this._list; var node = hash[key]; + var item; if (!defined(node)) { - node = list.addFront(value); - node._key = key; + item = new Item(key, value); + node = list.addFront(item); hash[key] = node; if (this._hasCapacity && list.length > this._capacity) { var tail = list.tail; - delete this._hash[tail._key]; + delete this._hash[tail.item.key]; list.remove(tail); } } else { - node.item = value; + item = node.item; + item.value = value; + item.touch(); list.moveToFront(node); } }; + /** + * Removes expired items from the cache. + */ + LRUCache.prototype.prune = function() { + if (!this._hasExpiration || this._list.length === 0) { + return; + } + + var currentTime = getTimestamp(); + var pruneAfter = currentTime - this._expiration; + + var list = this._list; + var node = list.head; + var index = 0; + while (defined(node) && node.item.timestamp > pruneAfter) { + node = node.next; + index++; + } + + if (!defined(node)) { + return; + } + + list.removeAfter(index); + + while(defined(node)) { + delete this._hash[node.item.key]; + node = node.next; + } + }; + return LRUCache; }); diff --git a/Source/Core/sampleTerrain.js b/Source/Core/sampleTerrain.js index cc03f1ca5172..6ada1ba8f1a0 100644 --- a/Source/Core/sampleTerrain.js +++ b/Source/Core/sampleTerrain.js @@ -10,7 +10,7 @@ define([ LRUCache) { 'use strict'; - var cache = new LRUCache(100); + var cache = new LRUCache(100, 60000); /** * Initiates a terrain height query for an array of {@link Cartographic} positions by @@ -58,6 +58,10 @@ define([ return terrainProvider.readyPromise.then(function() { return doSampling(terrainProvider, level, positions); }); } + sampleTerrain._update = function() { + cache.prune(); + }; + function doSampling(terrainProvider, level, positions) { var tilingScheme = terrainProvider.tilingScheme; @@ -94,12 +98,12 @@ define([ var tileRequest = tileRequests[i]; var cacheKey = tileRequest.x + '-' + tileRequest.y + '-' + tileRequest.level; var requestPromise; - var cachedTile = cache.get(cacheKey); - if (defined(cachedTile)) { - requestPromise = cachedTile; + var cachedTilePromise = cache.get(cacheKey); + if (defined(cachedTilePromise)) { + requestPromise = cachedTilePromise; } else { - requestPromise = tileRequest.terrainProvider.requestTileGeometry(tileRequest.x, tileRequest.y, tileRequest.level) - .then(setCache(cacheKey)); + requestPromise = tileRequest.terrainProvider.requestTileGeometry(tileRequest.x, tileRequest.y, tileRequest.level); + cache.set(cacheKey, requestPromise); } var tilePromise = when(requestPromise) .then(createInterpolateFunction(tileRequest)) @@ -112,13 +116,6 @@ define([ }); } - function setCache(cacheKey) { - return function(terrainData) { - cache.set(cacheKey, terrainData); - return terrainData; - }; - } - function createInterpolateFunction(tileRequest) { var tilePositions = tileRequest.positions; var rectangle = tileRequest.tilingScheme.tileXYToRectangle(tileRequest.x, tileRequest.y, tileRequest.level); diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 09f66661d748..1ab5c1107f87 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -34,6 +34,7 @@ define([ '../Core/PerspectiveOffCenterFrustum', '../Core/PixelFormat', '../Core/RequestScheduler', + '../Core/sampleTerrain', '../Core/ShowGeometryInstanceAttribute', '../Core/TaskProcessor', '../Core/Transforms', @@ -113,6 +114,7 @@ define([ PerspectiveOffCenterFrustum, PixelFormat, RequestScheduler, + sampleTerrain, ShowGeometryInstanceAttribute, TaskProcessor, Transforms, @@ -2964,6 +2966,7 @@ define([ } frameState.creditDisplay.update(); + sampleTerrain._update(); } function render(scene, time) { diff --git a/Specs/Core/DoublyLinkedListSpec.js b/Specs/Core/DoublyLinkedListSpec.js index fd22c7d4de51..da5ba6b7bcf6 100644 --- a/Specs/Core/DoublyLinkedListSpec.js +++ b/Specs/Core/DoublyLinkedListSpec.js @@ -193,6 +193,62 @@ defineSuite([ expect(list.length).toEqual(1); }); + it('removeAfter removes nothing', function() { + var list = new DoublyLinkedList(); + var node = list.add(1); + + list.removeAfter(undefined); + + expect(list.head).toEqual(node); + expect(list.tail).toEqual(node); + expect(list.length).toEqual(1); + + list.removeAfter(list.length); + + expect(list.head).toEqual(node); + expect(list.tail).toEqual(node); + expect(list.length).toEqual(1); + }); + + it('removeAfter removes all', function() { + var list = new DoublyLinkedList(); + list.add(1); + list.add(2); + + list.removeAfter(0); + + expect(list.head).toBeUndefined(); + expect(list.tail).toBeUndefined(); + expect(list.length).toEqual(0); + }); + + it('removeAfter removes tail', function() { + var list = new DoublyLinkedList(); + var node = list.add(1); + list.add(2); + + list.removeAfter(1); + + expect(list.head).toEqual(node); + expect(list.tail).toEqual(node); + expect(list.length).toEqual(1); + }); + + it('removeAfter removes nodes after index (inclusive)', function() { + var list = new DoublyLinkedList(); + var node1 = list.add(1); + var node2 = list.add(2); + list.add(3); + list.add(4); + list.add(5); + + list.removeAfter(2); + + expect(list.head).toEqual(node1); + expect(list.tail).toEqual(node2); + expect(list.length).toEqual(2); + }); + function expectOrder(list, nodes) { // Assumes at least one node is in the list var length = nodes.length; diff --git a/Specs/Core/LRUCacheSpec.js b/Specs/Core/LRUCacheSpec.js index 8061569b246b..1799702073d6 100644 --- a/Specs/Core/LRUCacheSpec.js +++ b/Specs/Core/LRUCacheSpec.js @@ -1,7 +1,9 @@ defineSuite([ - 'Core/LRUCache' + 'Core/LRUCache', + 'Core/getTimestamp' ], function( - LRUCache) { + LRUCache, + getTimestamp) { 'use strict'; it('can manipulate values', function() { @@ -74,4 +76,43 @@ defineSuite([ expect(cache.get('key3')).toEqual(3); expect(cache.get('key4')).toEqual(4); }); + + function spinWait(milliseconds) { + var endTime = getTimestamp() + milliseconds; + /*eslint-disable no-empty*/ + while (getTimestamp() < endTime) { + } + /*eslint-enable no-empty*/ + } + + it('prune has no effect when no expiration is set', function() { + var cache = new LRUCache(3); + cache.set('key1', 1); + cache.set('key2', 2); + cache.set('key3', 3); + + spinWait(3); + + cache.prune(); + + expect(cache.get('key1')).toEqual(1); + expect(cache.get('key2')).toEqual(2); + expect(cache.get('key3')).toEqual(3); + }); + + it('prune removes expired entries', function() { + var cache = new LRUCache(3, 10); + cache.set('key1', 1); + cache.set('key2', 2); + spinWait(10); + cache.set('key3', 3); + + cache.prune(); + + expect(cache.get('key1')).toBeUndefined(); + expect(cache.get('key2')).toBeUndefined(); + expect(cache.get('key3')).toEqual(3); + + expect(cache._list.length).toBe(1); + }); }); From f615296b83ae5b8fc8bc6734ea17489981276f9e Mon Sep 17 00:00:00 2001 From: hpinkos Date: Fri, 9 Mar 2018 13:27:03 -0500 Subject: [PATCH 03/38] cleanup --- Source/Core/LRUCache.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index a0aa6f04e531..0250fdb39833 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -105,23 +105,24 @@ define([ var pruneAfter = currentTime - this._expiration; var list = this._list; - var node = list.head; - var index = 0; - while (defined(node) && node.item.timestamp > pruneAfter) { - node = node.next; - index++; + var node = list.tail; + var index = list.length; + while (defined(node) && node.item.timestamp < pruneAfter) { + node = node.previous; + index--; } if (!defined(node)) { return; } - list.removeAfter(index); - + node = node.next; while(defined(node)) { delete this._hash[node.item.key]; node = node.next; } + + list.removeAfter(index); }; return LRUCache; From 8212a8e8a1366ac0fc8bbe407d51aee3676b36fe Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Mon, 12 Mar 2018 15:54:16 -0400 Subject: [PATCH 04/38] PR comments --- .../development/Many Clipping Planes.html | 9 ++- Source/Core/Cartesian4.js | 1 + Source/Core/ClippingPlane.js | 15 +++-- Source/Core/ClippingPlaneCollection.js | 61 +++++++++++-------- Source/Scene/BatchTable.js | 23 ++----- Source/Scene/Cesium3DTile.js | 2 +- Source/Scene/Cesium3DTileset.js | 5 +- Source/Scene/GlobeSurfaceShaderSet.js | 2 +- Source/Scene/GlobeSurfaceTileProvider.js | 2 +- Source/Scene/Model.js | 17 ++---- Source/Scene/PointCloud3DTileContent.js | 11 +--- Source/Scene/getClipAndStyleCode.js | 36 +++++++++++ Source/Scene/getClippingFunction.js | 18 +++--- Source/Scene/getUnpackFloatFunction.js | 42 ------------- .../Builtin/Functions/transformPlane.glsl | 2 +- .../Builtin/Functions/unpackDepth.glsl | 6 +- .../Builtin/Functions/unpackFloat.glsl | 30 +++++++++ Specs/Core/ClippingPlaneCollectionSpec.js | 16 ++--- Specs/Renderer/BuiltinFunctionsSpec.js | 2 +- 19 files changed, 153 insertions(+), 147 deletions(-) create mode 100644 Source/Scene/getClipAndStyleCode.js delete mode 100644 Source/Scene/getUnpackFloatFunction.js create mode 100644 Source/Shaders/Builtin/Functions/unpackFloat.glsl diff --git a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html index 09bb82d8b791..c46ca113fafa 100644 --- a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html +++ b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html @@ -114,7 +114,7 @@ } function computePlanes() { - var stepDegrees = 6.28319 / steps; + var stepDegrees = Cesium.Math.TWO_PI / steps; clippingPlanes = []; for (var i = 0; i < steps; i++) { @@ -122,15 +122,14 @@ var dir = new Cesium.Cartesian3(); dir.x = 1.0; dir.y = Math.tan(angle); - if (angle > 1.57079632679) { + if (angle > Cesium.Math.PI_OVER_TWO) { dir.x = -1.0; dir.y *= -1.0; } - if (angle > 3.14159265359) { + if (angle > Cesium.Math.PI) { dir.x = -1.0; - dir.y = dir.y; } - if (angle > 4.71238898038) { + if (angle > (Cesium.Math.PI_OVER_TWO * 3)) { dir.x = 1.0; dir.y = -dir.y; } diff --git a/Source/Core/Cartesian4.js b/Source/Core/Cartesian4.js index 479ce4d1f517..f4ab5ac8cde6 100644 --- a/Source/Core/Cartesian4.js +++ b/Source/Core/Cartesian4.js @@ -880,6 +880,7 @@ define([ * * @param {Cartesian4} packedFloat A Cartesian4 containing a float packed to 4 values representable using uint8. * @returns {Number} The unpacked float. + * @private */ Cartesian4.unpackFloat = function(packedFloat) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/ClippingPlane.js b/Source/Core/ClippingPlane.js index 08b652212cc4..8868f6f6248d 100644 --- a/Source/Core/ClippingPlane.js +++ b/Source/Core/ClippingPlane.js @@ -11,8 +11,8 @@ define([ 'use strict'; /** - * A Plane in Hessian Normal form to be used with ClippingPlaneCollection. - * Compatible with mathematics functions in Plane.js + * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}. + * Compatible with mathematics functions in {@link Plane} * * @alias ClippingPlane * @constructor @@ -25,6 +25,9 @@ define([ * opposite to the normal; if zero, the plane passes through the origin. */ function ClippingPlane(normal, distance) { + Check.typeOf.object('normal', normal); + Check.typeOf.number('distance', distance); + this._distance = distance; this._normal = new UpdateChangedCartesian3(normal, this); this.onChangeCallback = undefined; @@ -128,7 +131,7 @@ define([ this._cartesian3 = Cartesian3.clone(normal); } - function makeGetterStter(key) { + function makeGetterSetter(key) { return { get : function() { return this._cartesian3[key]; @@ -146,9 +149,9 @@ define([ } defineProperties(UpdateChangedCartesian3.prototype, { - x : makeGetterStter('x'), - y : makeGetterStter('y'), - z : makeGetterStter('z') + x : makeGetterSetter('x'), + y : makeGetterSetter('y'), + z : makeGetterSetter('z') }); return ClippingPlane; diff --git a/Source/Core/ClippingPlaneCollection.js b/Source/Core/ClippingPlaneCollection.js index b1ca230c41d8..2616cbcb0221 100644 --- a/Source/Core/ClippingPlaneCollection.js +++ b/Source/Core/ClippingPlaneCollection.js @@ -78,7 +78,7 @@ define([ // Do partial texture updates if just one plane is dirty. // If many planes are dirty, refresh the entire texture. this._dirtyIndex = -1; - this._manyDirtyPlanes = false; + this._multipleDirtyPlanes = false; // Add each plane to check if it's actually a Plane object instead of a ClippingPlane. // Use of Plane objects will be deprecated. @@ -90,8 +90,7 @@ define([ } } - this._enabled = false; - this.enabled = defaultValue(options.enabled, true); // set using setter + this._enabled = defaultValue(options.enabled, true); /** * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes @@ -122,9 +121,9 @@ define([ // This is because in a Cesium3DTileset multiple models may reference the tileset's ClippingPlaneCollection. this._owner = undefined; - this._testIntersection = undefined; - this._unionClippingRegions = undefined; - this.unionClippingRegions = defaultValue(options.unionClippingRegions, false); // set using setter + var unionClippingRegions = defaultValue(options.unionClippingRegions, false); + this._unionClippingRegions = unionClippingRegions; + this._testIntersection = unionClippingRegions ? unionIntersectFunction : defaultIntersectFunction; this._uint8View = undefined; this._float32View = undefined; @@ -221,13 +220,30 @@ define([ get : function() { return this._owner; } + }, + + /** + * Returns a Number encapsulating the state for this ClippingPlaneCollection. + * + * Clipping mode is encoded in the sign of the number, which is just the plane count. + * Used for checking if shader regeneration is necessary. + * + * @memberof ClippingPlaneCollection.prototype + * @returns {Number} A Number that describes the ClippingPlaneCollection's state. + * @readonly + * @private + */ + clippingPlanesState : { + get : function() { + return this._unionClippingRegions ? this._planes.length : -this._planes.length; + } } }); function setIndexDirty(collection, index) { // If there's already a different _dirtyIndex set, more than one plane has changed since update. // Entire texture must be reloaded - collection._manyDirtyPlanes = collection._manyDirtyPlanes || (collection._dirtyIndex !== -1 && collection._dirtyIndex !== index); + collection._multipleDirtyPlanes = collection._multipleDirtyPlanes || (collection._dirtyIndex !== -1 && collection._dirtyIndex !== index); collection._dirtyIndex = index; } @@ -336,7 +352,7 @@ define([ } // Indicate planes texture is dirty - this._manyDirtyPlanes = true; + this._multipleDirtyPlanes = true; planes.length = length; return true; @@ -359,7 +375,7 @@ define([ plane.index = -1; } } - this._manyDirtyPlanes = true; + this._multipleDirtyPlanes = true; this._planes = []; }; @@ -453,7 +469,11 @@ define([ if (defined(clippingPlanesTexture)) { var currentPixelCount = clippingPlanesTexture.width * clippingPlanesTexture.height; - // Recreate the texture if it isn't big enough or is 4 times larger than it needs to be + // Recreate the texture to double current requirement if it isn't big enough or is 4 times larger than it needs to be. + // Optimization note: this isn't exactly the classic resizeable array algorithm + // * not necessarily checking for resize after each add/remove operation + // * random-access deletes instead of just pops + // * alloc ops likely more expensive than demonstrable via big-O analysis if (currentPixelCount < pixelsNeeded || pixelsNeeded < 0.25 * currentPixelCount) { clippingPlanesTexture.destroy(); @@ -497,12 +517,12 @@ define([ } this._clippingPlanesTexture = clippingPlanesTexture; - this._manyDirtyPlanes = true; + this._multipleDirtyPlanes = true; } // Use of Plane objects will be deprecated. // But until then, we have no way of telling if they changed since last frame, so we have to do a full udpate. - var refreshFullTexture = this._manyDirtyPlanes || this._containsUntrackablePlanes; + var refreshFullTexture = this._multipleDirtyPlanes || this._containsUntrackablePlanes; var dirtyIndex = this._dirtyIndex; if (!refreshFullTexture && dirtyIndex === -1) { @@ -544,7 +564,7 @@ define([ }); } - this._manyDirtyPlanes = false; + this._multipleDirtyPlanes = false; this._dirtyIndex = -1; }; @@ -636,19 +656,6 @@ define([ return intersection; }; - /** - * Returns a Number encapsulating the state for this ClippingPlaneCollection. - * - * Clipping mode is encoded in the sign of the number, which is just the plane count. - * Used for checking if shader regeneration is necessary. - * - * @returns {Number} A Number that describes the ClippingPlaneCollection's state. - * @private - */ - ClippingPlaneCollection.prototype.clippingPlanesState = function() { - return this._unionClippingRegions ? this._planes.length : -this._planes.length; - }; - /** * Sets the owner for the input ClippingPlaneCollection if there wasn't another owner. * Destroys the owner's previous ClippingPlaneCollection if setting is successful. @@ -658,7 +665,7 @@ define([ * @param {String} key The Key for the Object to reference the ClippingPlaneCollection * @private */ - ClippingPlaneCollection.setOwnership = function(clippingPlaneCollection, owner, key) { + ClippingPlaneCollection.setOwner = function(clippingPlaneCollection, owner, key) { // Don't destroy the ClippingPlaneCollection if it is already owned by newOwner if (clippingPlaneCollection === owner[key]) { return; diff --git a/Source/Scene/BatchTable.js b/Source/Scene/BatchTable.js index bbe799c529c9..480719d55e78 100644 --- a/Source/Scene/BatchTable.js +++ b/Source/Scene/BatchTable.js @@ -16,8 +16,7 @@ define([ '../Renderer/Sampler', '../Renderer/Texture', '../Renderer/TextureMagnificationFilter', - '../Renderer/TextureMinificationFilter', - './getUnpackFloatFunction' + '../Renderer/TextureMinificationFilter' ], function( Cartesian2, Cartesian3, @@ -36,8 +35,7 @@ define([ Sampler, Texture, TextureMagnificationFilter, - TextureMinificationFilter, - getUnpackFloatFunction) { + TextureMinificationFilter) { 'use strict'; /** @@ -462,14 +460,6 @@ define([ '} \n'; } - function getGlslUnpackFloat(batchTable) { - if (!batchTable._packFloats) { - return ''; - } - - return getUnpackFloatFunction('unpackFloat'); - } - function getComponentType(componentsPerAttribute) { if (componentsPerAttribute === 1) { return 'float'; @@ -506,10 +496,10 @@ define([ if (batchTable._packFloats && attribute.componentDatatype !== PixelDatatype.UNSIGNED_BYTE) { glslFunction += 'vec4 textureValue; \n' + - 'textureValue.x = unpackFloat(texture2D(batchTexture, st)); \n' + - 'textureValue.y = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \n' + - 'textureValue.z = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \n' + - 'textureValue.w = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n'; + 'textureValue.x = czm_unpackFloat(texture2D(batchTexture, st)); \n' + + 'textureValue.y = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \n' + + 'textureValue.z = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \n' + + 'textureValue.w = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n'; } else { glslFunction += ' vec4 textureValue = texture2D(batchTexture, st); \n'; @@ -544,7 +534,6 @@ define([ var batchTableShader = 'uniform sampler2D batchTexture; \n'; batchTableShader += getGlslComputeSt(this) + '\n'; - batchTableShader += getGlslUnpackFloat(this) + '\n'; var length = attributes.length; for (var i = 0; i < length; ++i) { diff --git a/Source/Scene/Cesium3DTile.js b/Source/Scene/Cesium3DTile.js index e386a997586b..18101211d979 100644 --- a/Source/Scene/Cesium3DTile.js +++ b/Source/Scene/Cesium3DTile.js @@ -1067,7 +1067,7 @@ define([ var clippingPlanes = tileset.clippingPlanes; var currentClippingPlanesState = 0; if (defined(clippingPlanes) && tile._isClipped && clippingPlanes.enabled) { - currentClippingPlanesState = clippingPlanes.clippingPlanesState(); + currentClippingPlanesState = clippingPlanes.clippingPlanesState; } // If clippingPlaneState for tile changed, mark clippingPlanesDirty so content can update if (currentClippingPlanesState !== tile._clippingPlanesState) { diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index ddfbdcab4d21..18b43bc509f2 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -822,7 +822,7 @@ define([ return this._clippingPlanes; }, set : function(value) { - ClippingPlaneCollection.setOwnership(value, this, '_clippingPlanes'); + ClippingPlaneCollection.setOwner(value, this, '_clippingPlanes'); } }, @@ -1944,10 +1944,7 @@ define([ * @see Cesium3DTileset#isDestroyed */ Cesium3DTileset.prototype.destroy = function() { - // Destroy debug labels this._tileDebugLabels = this._tileDebugLabels && this._tileDebugLabels.destroy(); - - // Destroy clipping plane collection this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy(); // Traverse the tree and destroy all tiles diff --git a/Source/Scene/GlobeSurfaceShaderSet.js b/Source/Scene/GlobeSurfaceShaderSet.js index 85c775b1c00c..a0276dce5a1f 100644 --- a/Source/Scene/GlobeSurfaceShaderSet.js +++ b/Source/Scene/GlobeSurfaceShaderSet.js @@ -100,7 +100,7 @@ define([ var currentClippingShaderState = 0; if (defined(clippingPlanes)) { - currentClippingShaderState = enableClippingPlanes ? clippingPlanes.clippingPlanesState() : 0; + currentClippingShaderState = enableClippingPlanes ? clippingPlanes.clippingPlanesState : 0; } var surfaceShader = surfaceTile.surfaceShader; if (defined(surfaceShader) && diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js index 9d9ea96e7e7b..82c76019818c 100644 --- a/Source/Scene/GlobeSurfaceTileProvider.js +++ b/Source/Scene/GlobeSurfaceTileProvider.js @@ -315,7 +315,7 @@ define([ return this._clippingPlanes; }, set : function(value) { - ClippingPlaneCollection.setOwnership(value, this, '_clippingPlanes'); + ClippingPlaneCollection.setOwner(value, this, '_clippingPlanes'); } } }); diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index efdc3966523e..d173ebb846d0 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -64,6 +64,7 @@ define([ './BlendingState', './ColorBlendMode', './DracoLoader', + './getClipAndStyleCode', './getClippingFunction', './HeightReference', './JobType', @@ -142,6 +143,7 @@ define([ BlendingState, ColorBlendMode, DracoLoader, + getClipAndStyleCode, getClippingFunction, HeightReference, JobType, @@ -1027,7 +1029,7 @@ define([ return; } // Handle destroying, checking of unknown, checking for existing ownership - ClippingPlaneCollection.setOwnership(value, this, '_clippingPlanes'); + ClippingPlaneCollection.setOwner(value, this, '_clippingPlanes'); } } }); @@ -3860,19 +3862,12 @@ define([ shader += Model._getClippingFunction(clippingPlaneCollection) + '\n'; shader += 'uniform sampler2D gltf_clippingPlanes; \n' + - 'uniform vec4 gltf_clippingPlanesEdgeStyle; \n' + 'uniform mat4 gltf_clippingPlanesMatrix; \n' + + 'uniform vec4 gltf_clippingPlanesEdgeStyle; \n' + 'void main() \n' + '{ \n' + ' gltf_clip_main(); \n' + - ' float clipDistance = clip(gl_FragCoord, gltf_clippingPlanes, gltf_clippingPlanesMatrix);' + - ' vec4 clippingPlanesEdgeColor = vec4(1.0); \n' + - ' clippingPlanesEdgeColor.rgb = gltf_clippingPlanesEdgeStyle.rgb; \n' + - ' float clippingPlanesEdgeWidth = gltf_clippingPlanesEdgeStyle.a; \n' + - ' if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n' + - ' { \n' + - ' gl_FragColor = clippingPlanesEdgeColor;\n' + - ' } \n' + + getClipAndStyleCode('gltf_clippingPlanes', 'gltf_clippingPlanesMatrix', 'gltf_clippingPlanesEdgeStyle') + '} \n'; return shader; } @@ -4365,7 +4360,7 @@ define([ var currentClippingPlanesState = 0; if (defined(clippingPlanes) && clippingPlanes.enabled) { Matrix4.multiply(context.uniformState.view3D, modelMatrix, this._modelViewMatrix); - currentClippingPlanesState = clippingPlanes.clippingPlanesState(); + currentClippingPlanesState = clippingPlanes.clippingPlanesState; } var shouldRegenerateShaders = this._clippingPlanesState !== currentClippingPlanesState; diff --git a/Source/Scene/PointCloud3DTileContent.js b/Source/Scene/PointCloud3DTileContent.js index d50eb6507733..dd25bc758151 100644 --- a/Source/Scene/PointCloud3DTileContent.js +++ b/Source/Scene/PointCloud3DTileContent.js @@ -35,6 +35,7 @@ define([ './Cesium3DTileBatchTable', './Cesium3DTileFeature', './Cesium3DTileFeatureTable', + './getClipAndStyleCode', './getClippingFunction', './SceneMode', './ShadowMode' @@ -75,6 +76,7 @@ define([ Cesium3DTileBatchTable, Cesium3DTileFeature, Cesium3DTileFeatureTable, + getClipAndStyleCode, getClippingFunction, SceneMode, ShadowMode) { @@ -1133,14 +1135,7 @@ define([ ' gl_FragColor = v_color; \n'; if (hasClippedContent) { - fs += ' float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\n' + - ' vec4 clippingPlanesEdgeColor = vec4(1.0); \n' + - ' clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; \n' + - ' float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; \n' + - ' if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n' + - ' { \n' + - ' gl_FragColor = clippingPlanesEdgeColor; \n' + - ' } \n'; + fs += getClipAndStyleCode('u_clippingPlanes', 'u_clippingPlanesMatrix', 'u_clippingPlanesEdgeStyle'); } fs += '} \n'; diff --git a/Source/Scene/getClipAndStyleCode.js b/Source/Scene/getClipAndStyleCode.js new file mode 100644 index 000000000000..a04cb5f51373 --- /dev/null +++ b/Source/Scene/getClipAndStyleCode.js @@ -0,0 +1,36 @@ +define([ + '../Core/Check' + ], function( + Check) { + 'use strict'; + + /** + * Gets a GLSL snippet that clips a fragment using the `clip` function from {@link getClippingFunction} and styles it. + * + * @param {String} samplerUniformName Name of the uniform for the clipping planes texture sampler. + * @param {String} matrixUniformName Name of the uniform for the clipping planes matrix. + * @param {String} styleUniformName Name of the uniform for the clipping planes style, a vec4. + * @returns {String} A string containing GLSL that clips and styles the current fragment. + * @private + */ + function getClipAndStyleCode(samplerUniformName, matrixUniformName, styleUniformName) { + //>>includeStart('debug', pragmas.debug); + Check.typeOf.string('samplerUniformName', samplerUniformName); + Check.typeOf.string('matrixUniformName', matrixUniformName); + Check.typeOf.string('styleUniformName', styleUniformName); + //>>includeEnd('debug'); + + var shaderCode = + ' float clipDistance = clip(gl_FragCoord, ' + samplerUniformName + ', ' + matrixUniformName + '); \n' + + ' vec4 clippingPlanesEdgeColor = vec4(1.0); \n' + + ' clippingPlanesEdgeColor.rgb = ' + styleUniformName + '.rgb; \n' + + ' float clippingPlanesEdgeWidth = ' + styleUniformName + '.a; \n' + + ' if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n' + + ' { \n' + + ' gl_FragColor = clippingPlanesEdgeColor;\n' + + ' } \n'; + return shaderCode; + } + + return getClipAndStyleCode; +}); diff --git a/Source/Scene/getClippingFunction.js b/Source/Scene/getClippingFunction.js index 495700e3eb87..8407acdefec7 100644 --- a/Source/Scene/getClippingFunction.js +++ b/Source/Scene/getClippingFunction.js @@ -1,18 +1,16 @@ define([ '../Core/Check', - '../Renderer/PixelDatatype', - './getUnpackFloatFunction' + '../Renderer/PixelDatatype' ], function( Check, - PixelDatatype, - getUnpackFloatFunction) { + PixelDatatype) { 'use strict'; /** - * Gets the glsl functions needed to retrieve clipping planes from a ClippingPlaneCollection's texture. + * Gets the GLSL functions needed to retrieve clipping planes from a ClippingPlaneCollection's texture. * * @param {ClippingPlaneCollection} clippingPlaneCollection ClippingPlaneCollection with a defined texture. - * @returns {String} A string containing glsl functions for retrieving clipping planes. + * @returns {String} A string containing GLSL functions for retrieving clipping planes. * @private */ function getClippingFunction(clippingPlaneCollection) { @@ -123,7 +121,7 @@ define([ ' float u = (float(pixX) + 0.5) * ' + pixelWidthString + ';\n' + // sample from center of pixel ' float v = (float(pixY) + 0.5) * ' + pixelHeightString + ';\n' + ' vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n' + - ' return czm_transformPlane(transform, plane);\n' + + ' return czm_transformPlane(plane, transform);\n' + '}\n'; return functionString; } @@ -142,8 +140,6 @@ define([ } var functionString = - getUnpackFloatFunction('unpackFloatDistance') + - '\n' + 'vec4 getClippingPlane(sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n' + '{\n' + ' int clippingPlaneStartIndex = clippingPlaneNumber * 2;\n' + // clipping planes are two pixels each @@ -157,9 +153,9 @@ define([ ' vec4 plane;\n' + ' plane.xyz = czm_octDecode(oct, 65535.0);\n' + - ' plane.w = unpackFloatDistance(texture2D(packedClippingPlanes, vec2(u + ' + pixelWidthString + ', v)));\n' + + ' plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + ' + pixelWidthString + ', v)));\n' + - ' return czm_transformPlane(transform, plane);\n' + + ' return czm_transformPlane(plane, transform);\n' + '}\n'; return functionString; } diff --git a/Source/Scene/getUnpackFloatFunction.js b/Source/Scene/getUnpackFloatFunction.js deleted file mode 100644 index dae8fb286cab..000000000000 --- a/Source/Scene/getUnpackFloatFunction.js +++ /dev/null @@ -1,42 +0,0 @@ -define([ - '../Core/defined' - ], function( - defined) { - 'use strict'; - - var SHIFT_RIGHT_8 = 1.0 / 256.0; - var SHIFT_RIGHT_16 = 1.0 / 65536.0; - var SHIFT_RIGHT_24 = 1.0 / 16777216.0; - - var BIAS = 38.0; - - /** - * Gets a glsl function that takes a vec4 representing a float packed to Uint8 RGBA and returns the unpacked float. - * - * @param {String} [functionName='unpackFloat'] An optional name for the glsl function. - * @returns {String} A string containing a glsl function that takes a vec4 and returns a float. - * @private - * @see Cartesian4#packFloat - */ - function getUnpackFloatFunction(functionName) { - if (!defined(functionName)) { - functionName = 'unpackFloat'; - } - return 'float ' + functionName + '(vec4 value) \n' + - '{ \n' + - ' value *= 255.0; \n' + - ' float temp = value.w / 2.0; \n' + - ' float exponent = floor(temp); \n' + - ' float sign = (temp - exponent) * 2.0; \n' + - ' exponent = exponent - float(' + BIAS + '); \n' + - ' sign = sign * 2.0 - 1.0; \n' + - ' sign = -sign; \n' + - ' float unpacked = sign * value.x * float(' + SHIFT_RIGHT_8 + '); \n' + - ' unpacked += sign * value.y * float(' + SHIFT_RIGHT_16 + '); \n' + - ' unpacked += sign * value.z * float(' + SHIFT_RIGHT_24 + '); \n' + - ' return unpacked * pow(10.0, exponent); \n' + - '} \n'; - } - - return getUnpackFloatFunction; -}); diff --git a/Source/Shaders/Builtin/Functions/transformPlane.glsl b/Source/Shaders/Builtin/Functions/transformPlane.glsl index 3f0412c891cb..6838805a827b 100644 --- a/Source/Shaders/Builtin/Functions/transformPlane.glsl +++ b/Source/Shaders/Builtin/Functions/transformPlane.glsl @@ -1,4 +1,4 @@ -vec4 czm_transformPlane(mat4 transform, vec4 clippingPlane) { +vec4 czm_transformPlane(vec4 clippingPlane, mat4 transform) { vec3 transformedDirection = normalize((transform * vec4(clippingPlane.xyz, 0.0)).xyz); vec3 transformedPosition = (transform * vec4(clippingPlane.xyz * -clippingPlane.w, 1.0)).xyz; vec4 transformedPlane; diff --git a/Source/Shaders/Builtin/Functions/unpackDepth.glsl b/Source/Shaders/Builtin/Functions/unpackDepth.glsl index d122e70b9179..b6a7ef75cc9f 100644 --- a/Source/Shaders/Builtin/Functions/unpackDepth.glsl +++ b/Source/Shaders/Builtin/Functions/unpackDepth.glsl @@ -1,12 +1,12 @@ /** - * Unpacks a vec3 depth depth value to a float. + * Unpacks a vec4 depth value to a float in [0, 1) range. * * @name czm_unpackDepth * @glslFunction * - * @param {vec3} packedDepth The packed depth. + * @param {vec4} packedDepth The packed depth. * - * @returns {float} The floating-point depth. + * @returns {float} The floating-point depth in [0, 1) range. */ float czm_unpackDepth(vec4 packedDepth) { diff --git a/Source/Shaders/Builtin/Functions/unpackFloat.glsl b/Source/Shaders/Builtin/Functions/unpackFloat.glsl new file mode 100644 index 000000000000..f13ce3c451a4 --- /dev/null +++ b/Source/Shaders/Builtin/Functions/unpackFloat.glsl @@ -0,0 +1,30 @@ +#define SHIFT_RIGHT_8 0.00390625 //1.0 / 256.0 +#define SHIFT_RIGHT_16 0.00001525878 //1.0 / 65536.0 +#define SHIFT_RIGHT_24 5.960464477539063e-8//1.0 / 16777216.0 + +#define BIAS 38.0 + +/** + * Unpacks a vec4 value containing values expressable as uint8 to an arbitrary float. + * + * @name czm_unpackFloat + * @glslFunction + * + * @param {vec4} packedFloat The packed float. + * + * @returns {float} The floating-point depth in arbitrary range. + */ + float czm_unpackFloat(vec4 packedFloat) +{ + packedFloat *= 255.0; + float temp = packedFloat.w / 2.0; + float exponent = floor(temp); + float sign = (temp - exponent) * 2.0; + exponent = exponent - float(BIAS); + sign = sign * 2.0 - 1.0; + sign = -sign; + float unpacked = sign * packedFloat.x * float(SHIFT_RIGHT_8); + unpacked += sign * packedFloat.y * float(SHIFT_RIGHT_16); + unpacked += sign * packedFloat.z * float(SHIFT_RIGHT_24); + return unpacked * pow(10.0, exponent); +} diff --git a/Specs/Core/ClippingPlaneCollectionSpec.js b/Specs/Core/ClippingPlaneCollectionSpec.js index 9c41233a59ce..efba1b95bca4 100644 --- a/Specs/Core/ClippingPlaneCollectionSpec.js +++ b/Specs/Core/ClippingPlaneCollectionSpec.js @@ -454,7 +454,7 @@ defineSuite([ modelMatrix : transform }); - ClippingPlaneCollection.setOwnership(clippingPlanes1, clippedObject1, 'clippingPlanes'); + ClippingPlaneCollection.setOwner(clippingPlanes1, clippedObject1, 'clippingPlanes'); expect(clippedObject1.clippingPlanes).toBe(clippingPlanes1); expect(clippingPlanes1._owner).toBe(clippedObject1); @@ -466,16 +466,16 @@ defineSuite([ }); // Expect detached clipping planes to be destroyed - ClippingPlaneCollection.setOwnership(clippingPlanes2, clippedObject1, 'clippingPlanes'); + ClippingPlaneCollection.setOwner(clippingPlanes2, clippedObject1, 'clippingPlanes'); expect(clippingPlanes1.isDestroyed()).toBe(true); // Expect setting the same ClippingPlaneCollection again to not destroy the ClippingPlaneCollection - ClippingPlaneCollection.setOwnership(clippingPlanes2, clippedObject1, 'clippingPlanes'); + ClippingPlaneCollection.setOwner(clippingPlanes2, clippedObject1, 'clippingPlanes'); expect(clippingPlanes2.isDestroyed()).toBe(false); // Expect failure when attaching one ClippingPlaneCollection to two objects expect(function() { - ClippingPlaneCollection.setOwnership(clippingPlanes2, clippedObject2, 'clippingPlanes'); + ClippingPlaneCollection.setOwner(clippingPlanes2, clippedObject2, 'clippingPlanes'); }).toThrowDeveloperError(); }); @@ -604,16 +604,16 @@ defineSuite([ clippingPlanes = new ClippingPlaneCollection(); clippingPlanes.add(new ClippingPlane(Cartesian3.UNIT_X, -1.0)); - expect(clippingPlanes.clippingPlanesState()).toEqual(-1); + expect(clippingPlanes.clippingPlanesState).toEqual(-1); var holdThisPlane = new ClippingPlane(Cartesian3.UNIT_X, -1.0); clippingPlanes.add(holdThisPlane); - expect(clippingPlanes.clippingPlanesState()).toEqual(-2); + expect(clippingPlanes.clippingPlanesState).toEqual(-2); clippingPlanes.unionClippingRegions = true; - expect(clippingPlanes.clippingPlanesState()).toEqual(2); + expect(clippingPlanes.clippingPlanesState).toEqual(2); clippingPlanes.remove(holdThisPlane); - expect(clippingPlanes.clippingPlanesState()).toEqual(1); + expect(clippingPlanes.clippingPlanesState).toEqual(1); }); }); diff --git a/Specs/Renderer/BuiltinFunctionsSpec.js b/Specs/Renderer/BuiltinFunctionsSpec.js index 623bab8ff0e6..f84ecf8145f6 100644 --- a/Specs/Renderer/BuiltinFunctionsSpec.js +++ b/Specs/Renderer/BuiltinFunctionsSpec.js @@ -374,7 +374,7 @@ defineSuite([ ' 0.0, 2.0, 0.0, 0.0,' + ' 0.0, 0.0, 2.0, 0.0,' + ' 0.0, 0.0, 0.0, 1.0);' + - ' gl_FragColor = vec4(all(equal(czm_transformPlane(uniformScale2, vec4(1.0, 0.0, 0.0, 10.0)), vec4(1.0, 0.0, 0.0, 20.0))));' + + ' gl_FragColor = vec4(all(equal(czm_transformPlane(vec4(1.0, 0.0, 0.0, 10.0), uniformScale2), vec4(1.0, 0.0, 0.0, 20.0))));' + '}'; expect({ context : context, From 40f9a5166dac72bffdf1cbe7551e8ed2926cedc5 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Mon, 12 Mar 2018 16:04:32 -0400 Subject: [PATCH 05/38] moved ClippingPlaneCollection to Scene --- Source/Scene/Cesium3DTileset.js | 2 +- .../ClippingPlaneCollection.js | 38 +++++++++---------- Source/Scene/GlobeSurfaceShaderSet.js | 2 +- Source/Scene/GlobeSurfaceTileProvider.js | 2 +- Source/Scene/Model.js | 2 +- Source/Scene/PointCloud3DTileContent.js | 2 +- Specs/DataSources/ModelGraphicsSpec.js | 2 +- Specs/DataSources/ModelVisualizerSpec.js | 2 +- .../Scene/Batched3DModel3DTileContentSpec.js | 2 +- Specs/Scene/Cesium3DTilesetSpec.js | 2 +- .../ClippingPlaneCollectionSpec.js | 2 +- Specs/Scene/GlobeSurfaceTileProviderSpec.js | 2 +- .../Instanced3DModel3DTileContentSpec.js | 2 +- Specs/Scene/ModelSpec.js | 2 +- Specs/Scene/PointCloud3DTileContentSpec.js | 2 +- 15 files changed, 33 insertions(+), 33 deletions(-) rename Source/{Core => Scene}/ClippingPlaneCollection.js (98%) rename Specs/{Core => Scene}/ClippingPlaneCollectionSpec.js (99%) diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 18b43bc509f2..9b23c5da21c1 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -3,7 +3,7 @@ define([ '../Core/Cartesian3', '../Core/Cartographic', '../Core/Check', - '../Core/ClippingPlaneCollection', + '../Scene/ClippingPlaneCollection', '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', diff --git a/Source/Core/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js similarity index 98% rename from Source/Core/ClippingPlaneCollection.js rename to Source/Scene/ClippingPlaneCollection.js index 2616cbcb0221..edcfc67e8df7 100644 --- a/Source/Core/ClippingPlaneCollection.js +++ b/Source/Scene/ClippingPlaneCollection.js @@ -1,23 +1,23 @@ define([ - './AttributeCompression', - './Cartesian2', - './Cartesian3', - './Cartesian4', - './Math', - './Check', - './ClippingPlane', - './Color', - './defaultValue', - './defined', - './defineProperties', - './deprecationWarning', - './destroyObject', - './DeveloperError', - './FeatureDetection', - './Intersect', - './Matrix4', - './PixelFormat', - './Plane', + '../Core/AttributeCompression', + '../Core/Cartesian2', + '../Core/Cartesian3', + '../Core/Cartesian4', + '../Core/Math', + '../Core/Check', + '../Core/ClippingPlane', + '../Core/Color', + '../Core/defaultValue', + '../Core/defined', + '../Core/defineProperties', + '../Core/deprecationWarning', + '../Core/destroyObject', + '../Core/DeveloperError', + '../Core/FeatureDetection', + '../Core/Intersect', + '../Core/Matrix4', + '../Core/PixelFormat', + '../Core/Plane', '../Renderer/ContextLimits', '../Renderer/PixelDatatype', '../Renderer/Sampler', diff --git a/Source/Scene/GlobeSurfaceShaderSet.js b/Source/Scene/GlobeSurfaceShaderSet.js index a0276dce5a1f..baef062fa93a 100644 --- a/Source/Scene/GlobeSurfaceShaderSet.js +++ b/Source/Scene/GlobeSurfaceShaderSet.js @@ -1,5 +1,5 @@ define([ - '../Core/ClippingPlaneCollection', + '../Scene/ClippingPlaneCollection', '../Core/defined', '../Core/destroyObject', '../Core/TerrainQuantization', diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js index 82c76019818c..573f090deddc 100644 --- a/Source/Scene/GlobeSurfaceTileProvider.js +++ b/Source/Scene/GlobeSurfaceTileProvider.js @@ -4,7 +4,7 @@ define([ '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', - '../Core/ClippingPlaneCollection', + '../Scene/ClippingPlaneCollection', '../Core/Color', '../Core/ColorGeometryInstanceAttribute', '../Core/combine', diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index d173ebb846d0..ff0dd7855e50 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -4,7 +4,7 @@ define([ '../Core/Cartesian3', '../Core/Cartesian4', '../Core/Cartographic', - '../Core/ClippingPlaneCollection', + '../Scene/ClippingPlaneCollection', '../Core/clone', '../Core/Color', '../Core/combine', diff --git a/Source/Scene/PointCloud3DTileContent.js b/Source/Scene/PointCloud3DTileContent.js index dd25bc758151..786fd232a67a 100644 --- a/Source/Scene/PointCloud3DTileContent.js +++ b/Source/Scene/PointCloud3DTileContent.js @@ -2,7 +2,7 @@ define([ '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', - '../Core/ClippingPlaneCollection', + '../Scene/ClippingPlaneCollection', '../Core/Color', '../Core/combine', '../Core/ComponentDatatype', diff --git a/Specs/DataSources/ModelGraphicsSpec.js b/Specs/DataSources/ModelGraphicsSpec.js index fbcaf606ffc1..f4c9049fb514 100644 --- a/Specs/DataSources/ModelGraphicsSpec.js +++ b/Specs/DataSources/ModelGraphicsSpec.js @@ -1,7 +1,7 @@ defineSuite([ 'DataSources/ModelGraphics', 'Core/Cartesian3', - 'Core/ClippingPlaneCollection', + 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/DistanceDisplayCondition', 'Core/JulianDate', diff --git a/Specs/DataSources/ModelVisualizerSpec.js b/Specs/DataSources/ModelVisualizerSpec.js index 1ef89c237d74..84950e0bd818 100644 --- a/Specs/DataSources/ModelVisualizerSpec.js +++ b/Specs/DataSources/ModelVisualizerSpec.js @@ -3,7 +3,7 @@ defineSuite([ 'Core/BoundingSphere', 'Core/Cartesian3', 'Core/ClippingPlane', - 'Core/ClippingPlaneCollection', + 'Scene/ClippingPlaneCollection', 'Core/defined', 'Core/DistanceDisplayCondition', 'Core/JulianDate', diff --git a/Specs/Scene/Batched3DModel3DTileContentSpec.js b/Specs/Scene/Batched3DModel3DTileContentSpec.js index 5f2be35499d9..524c332b2a41 100644 --- a/Specs/Scene/Batched3DModel3DTileContentSpec.js +++ b/Specs/Scene/Batched3DModel3DTileContentSpec.js @@ -2,7 +2,7 @@ defineSuite([ 'Scene/Batched3DModel3DTileContent', 'Core/Cartesian3', 'Core/ClippingPlane', - 'Core/ClippingPlaneCollection', + 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/HeadingPitchRange', 'Core/HeadingPitchRoll', diff --git a/Specs/Scene/Cesium3DTilesetSpec.js b/Specs/Scene/Cesium3DTilesetSpec.js index ce63efab7177..e6aedc4e9669 100644 --- a/Specs/Scene/Cesium3DTilesetSpec.js +++ b/Specs/Scene/Cesium3DTilesetSpec.js @@ -2,7 +2,7 @@ defineSuite([ 'Scene/Cesium3DTileset', 'Core/Cartesian3', 'Core/ClippingPlane', - 'Core/ClippingPlaneCollection', + 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/CullingVolume', 'Core/getAbsoluteUri', diff --git a/Specs/Core/ClippingPlaneCollectionSpec.js b/Specs/Scene/ClippingPlaneCollectionSpec.js similarity index 99% rename from Specs/Core/ClippingPlaneCollectionSpec.js rename to Specs/Scene/ClippingPlaneCollectionSpec.js index efba1b95bca4..9439912cfd4a 100644 --- a/Specs/Core/ClippingPlaneCollectionSpec.js +++ b/Specs/Scene/ClippingPlaneCollectionSpec.js @@ -1,5 +1,5 @@ defineSuite([ - 'Core/ClippingPlaneCollection', + 'Scene/ClippingPlaneCollection', 'Core/AttributeCompression', 'Core/BoundingSphere', 'Core/Cartesian2', diff --git a/Specs/Scene/GlobeSurfaceTileProviderSpec.js b/Specs/Scene/GlobeSurfaceTileProviderSpec.js index 380e907415ba..d61a6158a3b1 100644 --- a/Specs/Scene/GlobeSurfaceTileProviderSpec.js +++ b/Specs/Scene/GlobeSurfaceTileProviderSpec.js @@ -3,7 +3,7 @@ defineSuite([ 'Core/Cartesian3', 'Core/CesiumTerrainProvider', 'Core/ClippingPlane', - 'Core/ClippingPlaneCollection', + 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/Credit', 'Core/defined', diff --git a/Specs/Scene/Instanced3DModel3DTileContentSpec.js b/Specs/Scene/Instanced3DModel3DTileContentSpec.js index 0da44e7f15e9..7a6819d52da2 100644 --- a/Specs/Scene/Instanced3DModel3DTileContentSpec.js +++ b/Specs/Scene/Instanced3DModel3DTileContentSpec.js @@ -1,7 +1,7 @@ defineSuite([ 'Core/Cartesian3', 'Core/ClippingPlane', - 'Core/ClippingPlaneCollection', + 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/HeadingPitchRange', 'Core/HeadingPitchRoll', diff --git a/Specs/Scene/ModelSpec.js b/Specs/Scene/ModelSpec.js index a8ee41ed6f18..6b178bd554c3 100644 --- a/Specs/Scene/ModelSpec.js +++ b/Specs/Scene/ModelSpec.js @@ -4,7 +4,7 @@ defineSuite([ 'Core/Cartesian4', 'Core/CesiumTerrainProvider', 'Core/ClippingPlane', - 'Core/ClippingPlaneCollection', + 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/combine', 'Core/defaultValue', diff --git a/Specs/Scene/PointCloud3DTileContentSpec.js b/Specs/Scene/PointCloud3DTileContentSpec.js index 2b5b31cc6cd2..ec464ddacbf7 100644 --- a/Specs/Scene/PointCloud3DTileContentSpec.js +++ b/Specs/Scene/PointCloud3DTileContentSpec.js @@ -1,7 +1,7 @@ defineSuite([ 'Core/Cartesian3', 'Core/ClippingPlane', - 'Core/ClippingPlaneCollection', + 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/ComponentDatatype', 'Core/defined', From 63c58e67880738f74f1956ad3ab60875cf7dac03 Mon Sep 17 00:00:00 2001 From: GRMWeb Date: Tue, 13 Mar 2018 00:54:23 -0700 Subject: [PATCH 06/38] Removed "@returns {undefined} --- Source/Core/ClippingPlaneCollection.js | 2 +- Source/Core/ScreenSpaceEventHandler.js | 2 -- Source/Core/TaskProcessor.js | 2 -- Source/DataSources/DataSourceCollection.js | 2 -- Source/DataSources/DataSourceDisplay.js | 2 -- Source/DataSources/EntityCluster.js | 2 -- Source/Scene/BatchTable.js | 2 -- Source/Scene/BillboardCollection.js | 2 -- Source/Scene/CameraEventAggregator.js | 2 -- Source/Scene/Cesium3DTileContent.js | 2 -- Source/Scene/Cesium3DTileset.js | 2 -- Source/Scene/ClassificationPrimitive.js | 2 -- Source/Scene/CreditDisplay.js | 2 -- Source/Scene/DebugCameraPrimitive.js | 2 -- Source/Scene/DebugModelMatrixPrimitive.js | 2 -- Source/Scene/DeviceOrientationCameraController.js | 2 -- Source/Scene/EllipsoidPrimitive.js | 2 -- Source/Scene/FrameRateMonitor.js | 2 -- Source/Scene/Globe.js | 2 -- Source/Scene/GlobeSurfaceTileProvider.js | 2 -- Source/Scene/GroundPrimitive.js | 2 -- Source/Scene/ImageryLayer.js | 2 -- Source/Scene/ImageryLayerCollection.js | 2 -- Source/Scene/LabelCollection.js | 2 -- Source/Scene/Material.js | 2 -- Source/Scene/Model.js | 2 -- Source/Scene/Moon.js | 2 -- Source/Scene/ParticleSystem.js | 2 -- Source/Scene/PointCloudEyeDomeLighting.js | 2 -- Source/Scene/PointPrimitiveCollection.js | 2 -- Source/Scene/PolylineCollection.js | 2 -- Source/Scene/Primitive.js | 2 -- Source/Scene/PrimitiveCollection.js | 2 -- Source/Scene/QuadtreePrimitive.js | 2 -- Source/Scene/QuadtreeTileProvider.js | 2 -- Source/Scene/Scene.js | 2 -- Source/Scene/ScreenSpaceCameraController.js | 2 -- Source/Scene/SkyAtmosphere.js | 2 -- Source/Scene/SkyBox.js | 2 -- Source/Scene/Sun.js | 2 -- Source/Scene/TextureAtlas.js | 2 -- Source/Scene/Vector3DTileGeometry.js | 2 -- Source/Scene/Vector3DTilePoints.js | 2 -- Source/Scene/Vector3DTilePolygons.js | 2 -- Source/Scene/Vector3DTilePolylines.js | 2 -- Source/Scene/Vector3DTilePrimitive.js | 2 -- Source/Scene/ViewportQuad.js | 2 -- Source/ThirdParty/protobuf-minimal.js | 7 ------- 48 files changed, 1 insertion(+), 100 deletions(-) diff --git a/Source/Core/ClippingPlaneCollection.js b/Source/Core/ClippingPlaneCollection.js index b1ca230c41d8..934778e54647 100644 --- a/Source/Core/ClippingPlaneCollection.js +++ b/Source/Core/ClippingPlaneCollection.js @@ -720,7 +720,7 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} + * * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * diff --git a/Source/Core/ScreenSpaceEventHandler.js b/Source/Core/ScreenSpaceEventHandler.js index 7a56624cae60..8b6be308ad7c 100644 --- a/Source/Core/ScreenSpaceEventHandler.js +++ b/Source/Core/ScreenSpaceEventHandler.js @@ -767,8 +767,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Core/TaskProcessor.js b/Source/Core/TaskProcessor.js index 0846180e1bf7..76809ccc3a09 100644 --- a/Source/Core/TaskProcessor.js +++ b/Source/Core/TaskProcessor.js @@ -264,8 +264,6 @@ define([ *

* Once an object is destroyed, it should not be used; calling any function other than * isDestroyed will result in a {@link DeveloperError} exception. - * - * @returns {undefined} */ TaskProcessor.prototype.destroy = function() { if (defined(this._worker)) { diff --git a/Source/DataSources/DataSourceCollection.js b/Source/DataSources/DataSourceCollection.js index 05b9d8ac9d37..3dc03d305cc7 100644 --- a/Source/DataSources/DataSourceCollection.js +++ b/Source/DataSources/DataSourceCollection.js @@ -197,8 +197,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/DataSources/DataSourceDisplay.js b/Source/DataSources/DataSourceDisplay.js index 6ba39af29ba2..9fc1c0d125bd 100644 --- a/Source/DataSources/DataSourceDisplay.js +++ b/Source/DataSources/DataSourceDisplay.js @@ -168,8 +168,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/DataSources/EntityCluster.js b/Source/DataSources/EntityCluster.js index 277f399dd0b9..6dddfde31ed8 100644 --- a/Source/DataSources/EntityCluster.js +++ b/Source/DataSources/EntityCluster.js @@ -778,8 +778,6 @@ define([ * Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed * from a data source collection and added to another. *

- * - * @returns {undefined} */ EntityCluster.prototype.destroy = function() { this._labelCollection = this._labelCollection && this._labelCollection.destroy(); diff --git a/Source/Scene/BatchTable.js b/Source/Scene/BatchTable.js index bbe799c529c9..c8278569df1b 100644 --- a/Source/Scene/BatchTable.js +++ b/Source/Scene/BatchTable.js @@ -581,8 +581,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @see BatchTable#isDestroyed diff --git a/Source/Scene/BillboardCollection.js b/Source/Scene/BillboardCollection.js index 2f5737f4558b..5a17cddcf2bb 100644 --- a/Source/Scene/BillboardCollection.js +++ b/Source/Scene/BillboardCollection.js @@ -1842,8 +1842,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/CameraEventAggregator.js b/Source/Scene/CameraEventAggregator.js index 5391377a99b0..002fd244205f 100644 --- a/Source/Scene/CameraEventAggregator.js +++ b/Source/Scene/CameraEventAggregator.js @@ -494,8 +494,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/Cesium3DTileContent.js b/Source/Scene/Cesium3DTileContent.js index 509220253ceb..a4466e35fe0d 100644 --- a/Source/Scene/Cesium3DTileContent.js +++ b/Source/Scene/Cesium3DTileContent.js @@ -326,8 +326,6 @@ define([ * not part of the public Cesium API. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @example diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index ddfbdcab4d21..8edddc35ca43 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -1934,8 +1934,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @example diff --git a/Source/Scene/ClassificationPrimitive.js b/Source/Scene/ClassificationPrimitive.js index bd76d4f405da..dc6546b71dc6 100644 --- a/Source/Scene/ClassificationPrimitive.js +++ b/Source/Scene/ClassificationPrimitive.js @@ -981,8 +981,6 @@ define([ * assign the return value (undefined) to the object as done in the example. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @example diff --git a/Source/Scene/CreditDisplay.js b/Source/Scene/CreditDisplay.js index 11ef26593f44..ef9e850ca97b 100644 --- a/Source/Scene/CreditDisplay.js +++ b/Source/Scene/CreditDisplay.js @@ -528,8 +528,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. */ CreditDisplay.prototype.destroy = function() { diff --git a/Source/Scene/DebugCameraPrimitive.js b/Source/Scene/DebugCameraPrimitive.js index 02f990da1353..cce6d7011e13 100644 --- a/Source/Scene/DebugCameraPrimitive.js +++ b/Source/Scene/DebugCameraPrimitive.js @@ -246,8 +246,6 @@ define([ * assign the return value (undefined) to the object as done in the example. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @example diff --git a/Source/Scene/DebugModelMatrixPrimitive.js b/Source/Scene/DebugModelMatrixPrimitive.js index 1113374a2896..6f58d389aa59 100644 --- a/Source/Scene/DebugModelMatrixPrimitive.js +++ b/Source/Scene/DebugModelMatrixPrimitive.js @@ -219,8 +219,6 @@ define([ * assign the return value (undefined) to the object as done in the example. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @example diff --git a/Source/Scene/DeviceOrientationCameraController.js b/Source/Scene/DeviceOrientationCameraController.js index 710d1c1b8fe9..f06463247572 100644 --- a/Source/Scene/DeviceOrientationCameraController.js +++ b/Source/Scene/DeviceOrientationCameraController.js @@ -120,8 +120,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. */ DeviceOrientationCameraController.prototype.destroy = function() { diff --git a/Source/Scene/EllipsoidPrimitive.js b/Source/Scene/EllipsoidPrimitive.js index cd4ceff8f342..ae455d5347d7 100644 --- a/Source/Scene/EllipsoidPrimitive.js +++ b/Source/Scene/EllipsoidPrimitive.js @@ -455,8 +455,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/FrameRateMonitor.js b/Source/Scene/FrameRateMonitor.js index ab51f3b42fc3..f0f7f2746d15 100644 --- a/Source/Scene/FrameRateMonitor.js +++ b/Source/Scene/FrameRateMonitor.js @@ -267,8 +267,6 @@ define([ * * @memberof FrameRateMonitor * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @see FrameRateMonitor#isDestroyed diff --git a/Source/Scene/Globe.js b/Source/Scene/Globe.js index 5d391dbebf31..456d5a30aecd 100644 --- a/Source/Scene/Globe.js +++ b/Source/Scene/Globe.js @@ -694,8 +694,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js index 9d9ea96e7e7b..18ccd1056655 100644 --- a/Source/Scene/GlobeSurfaceTileProvider.js +++ b/Source/Scene/GlobeSurfaceTileProvider.js @@ -673,8 +673,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/GroundPrimitive.js b/Source/Scene/GroundPrimitive.js index c8a68f040822..bc2defd39e78 100644 --- a/Source/Scene/GroundPrimitive.js +++ b/Source/Scene/GroundPrimitive.js @@ -847,8 +847,6 @@ define([ * assign the return value (undefined) to the object as done in the example. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @example diff --git a/Source/Scene/ImageryLayer.js b/Source/Scene/ImageryLayer.js index c2f924dd164d..02350f6e274f 100644 --- a/Source/Scene/ImageryLayer.js +++ b/Source/Scene/ImageryLayer.js @@ -402,8 +402,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/ImageryLayerCollection.js b/Source/Scene/ImageryLayerCollection.js index f1407dd6b1d5..ab9f386ca57f 100644 --- a/Source/Scene/ImageryLayerCollection.js +++ b/Source/Scene/ImageryLayerCollection.js @@ -507,8 +507,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/LabelCollection.js b/Source/Scene/LabelCollection.js index b50118b57d04..0d88e4d859cb 100644 --- a/Source/Scene/LabelCollection.js +++ b/Source/Scene/LabelCollection.js @@ -847,8 +847,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/Material.js b/Source/Scene/Material.js index 830a3a7acf0f..d9852fefbde8 100644 --- a/Source/Scene/Material.js +++ b/Source/Scene/Material.js @@ -539,8 +539,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index efdc3966523e..716d761b76d0 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -4561,8 +4561,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/Moon.js b/Source/Scene/Moon.js index ec9235296fa1..f8ff09af63c9 100644 --- a/Source/Scene/Moon.js +++ b/Source/Scene/Moon.js @@ -169,8 +169,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/ParticleSystem.js b/Source/Scene/ParticleSystem.js index df789f55a72d..6ce7467f73ca 100644 --- a/Source/Scene/ParticleSystem.js +++ b/Source/Scene/ParticleSystem.js @@ -807,8 +807,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @see ParticleSystem#isDestroyed diff --git a/Source/Scene/PointCloudEyeDomeLighting.js b/Source/Scene/PointCloudEyeDomeLighting.js index 880b1775ac08..e7b2982b8e83 100644 --- a/Source/Scene/PointCloudEyeDomeLighting.js +++ b/Source/Scene/PointCloudEyeDomeLighting.js @@ -343,8 +343,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * @example diff --git a/Source/Scene/PointPrimitiveCollection.js b/Source/Scene/PointPrimitiveCollection.js index aa42b0394272..6ef137937a75 100644 --- a/Source/Scene/PointPrimitiveCollection.js +++ b/Source/Scene/PointPrimitiveCollection.js @@ -1119,8 +1119,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/PolylineCollection.js b/Source/Scene/PolylineCollection.js index fc60c0fab733..936744c6ae0b 100644 --- a/Source/Scene/PolylineCollection.js +++ b/Source/Scene/PolylineCollection.js @@ -747,8 +747,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/Primitive.js b/Source/Scene/Primitive.js index 59455919c3cb..fb5cafcb962b 100644 --- a/Source/Scene/Primitive.js +++ b/Source/Scene/Primitive.js @@ -1993,8 +1993,6 @@ define([ * assign the return value (undefined) to the object as done in the example. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/PrimitiveCollection.js b/Source/Scene/PrimitiveCollection.js index e2f38bcc6854..ee4ab3276e53 100644 --- a/Source/Scene/PrimitiveCollection.js +++ b/Source/Scene/PrimitiveCollection.js @@ -392,8 +392,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/QuadtreePrimitive.js b/Source/Scene/QuadtreePrimitive.js index 9be66c8071df..c0b44e083d06 100644 --- a/Source/Scene/QuadtreePrimitive.js +++ b/Source/Scene/QuadtreePrimitive.js @@ -414,8 +414,6 @@ define([ * * @memberof QuadtreePrimitive * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/QuadtreeTileProvider.js b/Source/Scene/QuadtreeTileProvider.js index b9ebabb8fc78..3e167f8c6b95 100644 --- a/Source/Scene/QuadtreeTileProvider.js +++ b/Source/Scene/QuadtreeTileProvider.js @@ -207,8 +207,6 @@ define([ * * @memberof QuadtreeTileProvider * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 09f66661d748..5fa9f8c15c63 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -3742,8 +3742,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/ScreenSpaceCameraController.js b/Source/Scene/ScreenSpaceCameraController.js index 6a503930d742..89fd9be0825e 100644 --- a/Source/Scene/ScreenSpaceCameraController.js +++ b/Source/Scene/ScreenSpaceCameraController.js @@ -1995,8 +1995,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/SkyAtmosphere.js b/Source/Scene/SkyAtmosphere.js index e37242aaddb1..3ea52c8b4037 100644 --- a/Source/Scene/SkyAtmosphere.js +++ b/Source/Scene/SkyAtmosphere.js @@ -298,8 +298,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/SkyBox.js b/Source/Scene/SkyBox.js index d64c5952c1f0..c2c9ed8b26ef 100644 --- a/Source/Scene/SkyBox.js +++ b/Source/Scene/SkyBox.js @@ -231,8 +231,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/Sun.js b/Source/Scene/Sun.js index cd948ab45d84..383001aa558f 100644 --- a/Source/Scene/Sun.js +++ b/Source/Scene/Sun.js @@ -329,8 +329,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/TextureAtlas.js b/Source/Scene/TextureAtlas.js index 608be3d218f0..7f649e5c984d 100644 --- a/Source/Scene/TextureAtlas.js +++ b/Source/Scene/TextureAtlas.js @@ -450,8 +450,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/Scene/Vector3DTileGeometry.js b/Source/Scene/Vector3DTileGeometry.js index 594304602ba9..762b543d7767 100644 --- a/Source/Scene/Vector3DTileGeometry.js +++ b/Source/Scene/Vector3DTileGeometry.js @@ -467,8 +467,6 @@ define([ * assign the return value (undefined) to the object as done in the example. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. */ Vector3DTileGeometry.prototype.destroy = function() { diff --git a/Source/Scene/Vector3DTilePoints.js b/Source/Scene/Vector3DTilePoints.js index 95c444db3e65..9a3e2938ad57 100644 --- a/Source/Scene/Vector3DTilePoints.js +++ b/Source/Scene/Vector3DTilePoints.js @@ -496,8 +496,6 @@ define([ * assign the return value (undefined) to the object as done in the example. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. */ Vector3DTilePoints.prototype.destroy = function() { diff --git a/Source/Scene/Vector3DTilePolygons.js b/Source/Scene/Vector3DTilePolygons.js index 24cc861df2c2..a19e411eade6 100644 --- a/Source/Scene/Vector3DTilePolygons.js +++ b/Source/Scene/Vector3DTilePolygons.js @@ -445,8 +445,6 @@ define([ * assign the return value (undefined) to the object as done in the example. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. */ Vector3DTilePolygons.prototype.destroy = function() { diff --git a/Source/Scene/Vector3DTilePolylines.js b/Source/Scene/Vector3DTilePolylines.js index fa7dcac36a8b..d6bd69bce4b0 100644 --- a/Source/Scene/Vector3DTilePolylines.js +++ b/Source/Scene/Vector3DTilePolylines.js @@ -605,8 +605,6 @@ define([ * assign the return value (undefined) to the object as done in the example. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. */ Vector3DTilePolylines.prototype.destroy = function() { diff --git a/Source/Scene/Vector3DTilePrimitive.js b/Source/Scene/Vector3DTilePrimitive.js index 4b1e64a39b56..0b850231013b 100644 --- a/Source/Scene/Vector3DTilePrimitive.js +++ b/Source/Scene/Vector3DTilePrimitive.js @@ -1171,8 +1171,6 @@ define([ * assign the return value (undefined) to the object as done in the example. *

* - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. */ Vector3DTilePrimitive.prototype.destroy = function() { diff --git a/Source/Scene/ViewportQuad.js b/Source/Scene/ViewportQuad.js index 6762b940ac9c..4a9cb6c6451e 100644 --- a/Source/Scene/ViewportQuad.js +++ b/Source/Scene/ViewportQuad.js @@ -176,8 +176,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * @returns {undefined} - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * diff --git a/Source/ThirdParty/protobuf-minimal.js b/Source/ThirdParty/protobuf-minimal.js index 7719d7e6c2bb..e8246a9ec968 100644 --- a/Source/ThirdParty/protobuf-minimal.js +++ b/Source/ThirdParty/protobuf-minimal.js @@ -502,7 +502,6 @@ protobuf.configure = configure; /* istanbul ignore next */ /** * Reconfigures the library according to the environment. - * @returns {undefined} */ function configure() { protobuf.Reader._configure(protobuf.BufferReader); @@ -1065,7 +1064,6 @@ var rpc = exports; * @param {Method|rpc.ServiceMethod} method Reflected or static method being called * @param {Uint8Array} requestData Request data * @param {RPCImplCallback} callback Callback function - * @returns {undefined} * @example * function rpcImpl(method, requestData, callback) { * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code @@ -1082,7 +1080,6 @@ var rpc = exports; * @type {function} * @param {?Error} error Error, if any, otherwise `null` * @param {?Uint8Array} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} */ rpc.Service = require(11); @@ -1104,7 +1101,6 @@ var util = require(13); * @type {function} * @param {?Error} error Error, if any * @param {?Message} [response] Response message - * @returns {undefined} */ /** @@ -1171,7 +1167,6 @@ function Service(rpcImpl, requestDelimited, responseDelimited) { * @param {function} responseCtor Response constructor * @param {Message|Object.} request Request message or plain object * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} */ Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { @@ -1752,7 +1747,6 @@ util.oneOfSetter = function setOneOf(fieldNames) { /** * @param {string} name Field name - * @returns {undefined} * @this Object * @ignore */ @@ -1767,7 +1761,6 @@ util.oneOfSetter = function setOneOf(fieldNames) { * Lazily resolves fully qualified type names against the specified root. * @param {Root} root Root instanceof * @param {Object.} lazyTypes Type names - * @returns {undefined} */ util.lazyResolve = function lazyResolve(root, lazyTypes) { for (var i = 0; i < lazyTypes.length; ++i) { From 6546a106b3b1c23a29406d6ba95d290fa591217a Mon Sep 17 00:00:00 2001 From: gabriel-macario Date: Tue, 13 Mar 2018 01:24:34 -0700 Subject: [PATCH 07/38] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bc6872cb7891..dfb1c7467694 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -172,3 +172,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Y.Selim Abidin](https://github.com/SelimAbidin) * [Tamar Cohen](https://github.com/tamarmot) * [Stephen Wiseman](https://github.com/srwiseman) +* [Gabriel Macario](https://githubc.com/gabriel-macario) From 60a64b287a306520e8856cc14aff40891d7a6292 Mon Sep 17 00:00:00 2001 From: gabriel-macario Date: Tue, 13 Mar 2018 01:24:59 -0700 Subject: [PATCH 08/38] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index dfb1c7467694..a02f46bd13fd 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -172,4 +172,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Y.Selim Abidin](https://github.com/SelimAbidin) * [Tamar Cohen](https://github.com/tamarmot) * [Stephen Wiseman](https://github.com/srwiseman) -* [Gabriel Macario](https://githubc.com/gabriel-macario) +* [Gabriel Macario](https://github.com/gabriel-macario) From 939bed51fe43a959a0a2d9a68e1184396a6df32a Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Tue, 13 Mar 2018 10:01:39 -0400 Subject: [PATCH 09/38] add draw clipping planes sandcastle --- .../gallery/Draw Clipping Planes.html | 235 ++++++++++++++++++ .../gallery/Draw Clipping Planes.jpg | Bin 0 -> 22141 bytes .../development/Many Clipping Planes.html | 8 +- Source/Scene/ClippingPlaneCollection.js | 4 +- 4 files changed, 239 insertions(+), 8 deletions(-) create mode 100644 Apps/Sandcastle/gallery/Draw Clipping Planes.html create mode 100644 Apps/Sandcastle/gallery/Draw Clipping Planes.jpg diff --git a/Apps/Sandcastle/gallery/Draw Clipping Planes.html b/Apps/Sandcastle/gallery/Draw Clipping Planes.html new file mode 100644 index 000000000000..ed7d5732b73d --- /dev/null +++ b/Apps/Sandcastle/gallery/Draw Clipping Planes.html @@ -0,0 +1,235 @@ + + + + + + + + + Cesium Demo + + + + + + +
+

Loading...

+
+
Opacity
+ +
+ + + diff --git a/Apps/Sandcastle/gallery/Draw Clipping Planes.jpg b/Apps/Sandcastle/gallery/Draw Clipping Planes.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8dd766c52709f4aee6469ef93a31c7f48a5d07ff GIT binary patch literal 22141 zcmeEuWmufcmTu$j5S-xd?ry=|9U2MlPH=Y*9^Bn6IKd&fyF+k-b4j+GGc)J8&)na4 z7yZ#ywWL?SWvf;dye_~}rr8<7X__8Wlk_Be!C0Kk9O1E32tGJnhAyp?^A@BmP6 z3gO@KX>ZT3^!ACr>A&A)ENBU(4Q5N&#K-?DpYxY26C+~|$RFO!>ni~8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CIvM!|b)J8~?Cnj=+_qsO1DfA71XBYcMZc`?AlP}3p^n?GMr8CbbFUn_(s zJR~5Ug~r(r6`!|^V?}QpK|`}k-)>(xjB84H*Q~6b(GpAVo;8VFX$SJS^l&pGbUT_p z`}c@R$wCT+O@#f}(jJ4rrH&*iV;X1*7<$EY2^}u!=2L!gJp?_MQs~!Wxo#XP?t~yu Tm%xTF8ZziVGuad0{xAR8xz)IM literal 0 HcmV?d00001 diff --git a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html index c46ca113fafa..11638e78348a 100644 --- a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html +++ b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html @@ -49,14 +49,10 @@ infoBox: false, selectionIndicator: false, shouldAnimate : true, - projectionPicker : true + projectionPicker : true, + terrainProvider: Cesium.createWorldTerrain() }); -viewer.terrainProvider = new Cesium.CesiumTerrainProvider({ - url : 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles', - requestWaterMask : true, - requestVertexNormals : true -}); viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin); var globe = viewer.scene.globe; diff --git a/Source/Scene/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js index edcfc67e8df7..b18b07809c77 100644 --- a/Source/Scene/ClippingPlaneCollection.js +++ b/Source/Scene/ClippingPlaneCollection.js @@ -442,8 +442,8 @@ define([ var maxSize = ContextLimits.maximumTextureSize; var width = Math.min(pixelsNeeded, maxSize); var height = Math.ceil(pixelsNeeded / width); - result.x = width; - result.y = height; + result.x = Math.max(width, 1); + result.y = Math.max(height, 1); return result; } From f2c46ae86f03541dfefc6b236cb58e9ec9e51a3b Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Tue, 13 Mar 2018 10:50:42 -0400 Subject: [PATCH 10/38] move oct encoding to 4xuint8 to AttributeCompression --- Source/Core/AttributeCompression.js | 59 +++++++++++- Source/Scene/ClippingPlaneCollection.js | 17 +--- Specs/Core/AttributeCompressionSpec.js | 103 +++++++++++++++++++++ Specs/Scene/ClippingPlaneCollectionSpec.js | 4 +- 4 files changed, 162 insertions(+), 21 deletions(-) diff --git a/Source/Core/AttributeCompression.js b/Source/Core/AttributeCompression.js index ed4c4a88c5d2..9aa8c2ee64b8 100644 --- a/Source/Core/AttributeCompression.js +++ b/Source/Core/AttributeCompression.js @@ -14,6 +14,9 @@ define([ CesiumMath) { 'use strict'; + var RIGHT_SHIFT = 1.0 / 256.0; + var LEFT_SHIFT = 256.0; + /** * Attribute compression and decompression functions. * @@ -80,6 +83,31 @@ define([ return AttributeCompression.octEncodeInRange(vector, 255, result); }; + var octEncodeScratch = new Cartesian2(); + var uint8ForceArray = new Uint8Array(1); + function forceUint8(value) { + uint8ForceArray[0] = value; + return uint8ForceArray[0]; + } + /** + * @param {Cartesian3} vector The normalized vector to be compressed into 2 byte 'oct' encoding. + * @param {Cartesian4} result The 4 byte oct-encoded unit length vector. + * @returns {Cartesian4} The 4 byte oct-encoded unit length vector. + * + * @exception {DeveloperError} vector must be normalized. + * + * @see AttributeCompression.octEncodeInRange + * @see AttributeCompression.octDecodeFromCartesian4 + */ + AttributeCompression.octEncodeToCartesian4 = function(vector, result) { + AttributeCompression.octEncodeInRange(vector, 65535, octEncodeScratch); + result.x = forceUint8(octEncodeScratch.x * RIGHT_SHIFT); + result.y = forceUint8(octEncodeScratch.x); + result.z = forceUint8(octEncodeScratch.y * RIGHT_SHIFT); + result.w = forceUint8(octEncodeScratch.y); + return result; + }; + /** * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component vector. * @@ -89,7 +117,7 @@ define([ * @param {Cartesian3} result The decoded and normalized vector * @returns {Cartesian3} The decoded and normalized vector. * - * @exception {DeveloperError} x and y must be an unsigned normalized integer between 0 and rangeMax. + * @exception {DeveloperError} x and y must be unsigned normalized integers between 0 and rangeMax. * * @see AttributeCompression.octEncodeInRange */ @@ -97,7 +125,7 @@ define([ //>>includeStart('debug', pragmas.debug); Check.defined('result', result); if (x < 0 || x > rangeMax || y < 0 || y > rangeMax) { - throw new DeveloperError('x and y must be a signed normalized integer between 0 and ' + rangeMax); + throw new DeveloperError('x and y must be unsigned normalized integers between 0 and ' + rangeMax); } //>>includeEnd('debug'); @@ -131,6 +159,33 @@ define([ return AttributeCompression.octDecodeInRange(x, y, 255, result); }; + /** + * Decodes a unit-length vector in 4 byte 'oct' encoding to a normalized 3-component vector. + * + * @param {Number} x The x component of the oct-encoded unit length vector. + * @param {Number} y The y component of the oct-encoded unit length vector. + * @param {Number} z The z component of the oct-encoded unit length vector. + * @param {Number} w The w component of the oct-encoded unit length vector. + * @param {Cartesian3} result The decoded and normalized vector. + * @returns {Cartesian3} The decoded and normalized vector. + * + * @exception {DeveloperError} x, y, z, and w must be unsigned normalized integers between 0 and 255. + * + * @see AttributeCompression.octDecodeInRange + * @see AttributeCompression.octEncodeToCartesian4 + */ + AttributeCompression.octDecodeFromCartesian4 = function(x, y, z, w, result) { + //>>includeStart('debug', pragmas.debug); + if (x < 0 || x > 255 || y < 0 || y > 255 || z < 0 || z > 255 || w < 0 || w > 255) { + throw new DeveloperError('x, y, z, and w must be unsigned normalized integers between 0 and 255'); + } + //>>includeEnd('debug'); + + var xOct16 = x * LEFT_SHIFT + y; + var yOct16 = z * LEFT_SHIFT + w; + return AttributeCompression.octDecodeInRange(xOct16, yOct16, 65535, result); + }; + /** * Packs an oct encoded vector into a single floating-point number. * diff --git a/Source/Scene/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js index b18b07809c77..2e6507c27fb7 100644 --- a/Source/Scene/ClippingPlaneCollection.js +++ b/Source/Scene/ClippingPlaneCollection.js @@ -379,21 +379,6 @@ define([ this._planes = []; }; - var octEncodeScratch = new Cartesian2(); - var rightShift = 1.0 / 256.0; - /** - * Encodes a normalized vector into 4 SNORM values in the range [0-255] following the 'oct' encoding. - * oct32 precision is higher than the default oct16, hence the additional 2 uint16 values. - */ - function oct32EncodeNormal(vector, result) { - AttributeCompression.octEncodeInRange(vector, 65535, octEncodeScratch); - result.x = octEncodeScratch.x * rightShift; - result.y = octEncodeScratch.x; - result.z = octEncodeScratch.y * rightShift; - result.w = octEncodeScratch.y; - return result; - } - var distanceEncodeScratch = new Cartesian4(); var oct32EncodeScratch = new Cartesian4(); function packPlanesAsUint8(clippingPlaneCollection, startIndex, endIndex) { @@ -403,7 +388,7 @@ define([ for (var i = startIndex; i < endIndex; ++i) { var plane = planes[i]; - var oct32Normal = oct32EncodeNormal(plane.normal, oct32EncodeScratch); + var oct32Normal = AttributeCompression.octEncodeToCartesian4(plane.normal, oct32EncodeScratch); uint8View[byteIndex] = oct32Normal.x; uint8View[byteIndex + 1] = oct32Normal.y; uint8View[byteIndex + 2] = oct32Normal.z; diff --git a/Specs/Core/AttributeCompressionSpec.js b/Specs/Core/AttributeCompressionSpec.js index fc710e4e8a30..fe0160833e24 100644 --- a/Specs/Core/AttributeCompressionSpec.js +++ b/Specs/Core/AttributeCompressionSpec.js @@ -2,12 +2,14 @@ defineSuite([ 'Core/AttributeCompression', 'Core/Cartesian2', 'Core/Cartesian3', + 'Core/Cartesian4', 'Core/defined', 'Core/Math' ], function( AttributeCompression, Cartesian2, Cartesian3, + Cartesian4, defined, CesiumMath) { 'use strict'; @@ -31,6 +33,18 @@ defineSuite([ expect(result).toEqual(new Cartesian2(128, 128)); }); + it('oct encode(0, 0, -1) to 4 components', function() { + var result = new Cartesian4(); + AttributeCompression.octEncodeToCartesian4(negativeUnitZ, result); + expect(result).toEqual(new Cartesian4(255, 255, 255, 255)); + }); + + it('oct encode(0, 0, 1) to 4 components', function() { + var result = new Cartesian4(); + AttributeCompression.octEncodeToCartesian4(Cartesian3.UNIT_Z, result); + expect(result).toEqual(new Cartesian4(128, 0, 128, 0)); + }); + it('oct extents are equal', function() { var result = new Cartesian3(); // lower left @@ -98,6 +112,25 @@ defineSuite([ }).toThrowDeveloperError(); }); + it('throws 4-component oct decode out of bounds', function() { + var result = new Cartesian3(); + expect(function() { + AttributeCompression.octDecodeFromCartesian4(256, 0, 0, 0, result); + }).toThrowDeveloperError(); + + expect(function() { + AttributeCompression.octDecodeFromCartesian4(0, 256, 0, 0, result); + }).toThrowDeveloperError(); + + expect(function() { + AttributeCompression.octDecodeFromCartesian4(0, 0, 256, 0, result); + }).toThrowDeveloperError(); + + expect(function() { + AttributeCompression.octDecodeFromCartesian4(0, 0, 0, 256, result); + }).toThrowDeveloperError(); + }); + it('oct encoding', function() { var epsilon = CesiumMath.EPSILON1; @@ -239,6 +272,76 @@ defineSuite([ expect(AttributeCompression.octDecodeInRange(encoded.x, encoded.y, rangeMax, result)).toEqualEpsilon(normal, epsilon); }); + it('oct encoding to 4 components', function() { + var epsilon = CesiumMath.EPSILON1; + + var encoded = new Cartesian4(); + var result = new Cartesian3(); + var normal = new Cartesian3(0.0, 0.0, 1.0); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(0.0, 0.0, -1.0); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(0.0, 1.0, 0.0); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(0.0, -1.0, 0.0); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(1.0, 0.0, 0.0); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(-1.0, 0.0, 0.0); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(1.0, 1.0, 1.0); + Cartesian3.normalize(normal, normal); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(1.0, -1.0, 1.0); + Cartesian3.normalize(normal, normal); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(-1.0, -1.0, 1.0); + Cartesian3.normalize(normal, normal); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(-1.0, 1.0, 1.0); + Cartesian3.normalize(normal, normal); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(1.0, 1.0, -1.0); + Cartesian3.normalize(normal, normal); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(1.0, -1.0, -1.0); + Cartesian3.normalize(normal, normal); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(-1.0, 1.0, -1.0); + Cartesian3.normalize(normal, normal); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + + normal = new Cartesian3(-1.0, -1.0, -1.0); + Cartesian3.normalize(normal, normal); + AttributeCompression.octEncodeToCartesian4(normal, encoded); + expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + }); + it('octFloat encoding', function() { var epsilon = CesiumMath.EPSILON1; diff --git a/Specs/Scene/ClippingPlaneCollectionSpec.js b/Specs/Scene/ClippingPlaneCollectionSpec.js index 9439912cfd4a..5b6451315753 100644 --- a/Specs/Scene/ClippingPlaneCollectionSpec.js +++ b/Specs/Scene/ClippingPlaneCollectionSpec.js @@ -49,9 +49,7 @@ defineSuite([ function decodeUint8Plane(pixel1, pixel2) { // expect pixel1 to be the normal - var xOct16 = pixel1.x * 256 + pixel1.y; - var yOct16 = pixel1.z * 256 + pixel1.w; - var normal = AttributeCompression.octDecodeInRange(xOct16, yOct16, 65535, new Cartesian3()); + var normal = AttributeCompression.octDecodeFromCartesian4(pixel1.x, pixel1.y, pixel1.z, pixel1.w, new Cartesian3()); // expect pixel2 to be the distance var distance = Cartesian4.unpackFloat(pixel2); From 38b54f02e34784b2debeb213aab3736448173a41 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Tue, 13 Mar 2018 11:03:37 -0400 Subject: [PATCH 11/38] update CHANGES.md --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 9bbaa229c836..562e66bc1bb2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,8 @@ Change Log * Added a `ClippingPlane` object to be used with `ClippingPlaneCollection`. * Updated `WebMapServiceImageryProvider` so it can take an srs or crs string to pass to the resource query parameters based on the WMS version. [#6223](https://github.com/AnalyticalGraphicsInc/cesium/issues/6223) * Added a multi-part CZML example to Sandcastle. [#6320](https://github.com/AnalyticalGraphicsInc/cesium/pull/6320) +* Added `AttributeCompression.octEncodeToCartesian4` and `AttributeCompression.octDecodeFromCartesian4` which will encode and decode unit-length normal vectors using 4 `uint8` components in a `Cartesian4`. +* Added a Sandcastle example for drawing convex polygons of clipping planes on terrain. ##### Fixes :wrench: * Fixed support of glTF-supplied tangent vectors. [#6302](https://github.com/AnalyticalGraphicsInc/cesium/pull/6302) From b739b7e1d105679a5a9c9d995f90fdcbfe869cc5 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Tue, 13 Mar 2018 12:30:05 -0400 Subject: [PATCH 12/38] move 3D Tiles + terrain clipping planes to Terrain Clipping Planes, move ClippingPlane to Scene --- .../gallery/Draw Clipping Planes.html | 235 ------------------ .../gallery/Draw Clipping Planes.jpg | Bin 22141 -> 0 bytes .../gallery/Terrain Clipping Planes.html | 183 +++++++++++--- .../development/Many Clipping Planes.html | 2 +- CHANGES.md | 2 +- Source/{Core => Scene}/ClippingPlane.js | 8 +- Source/Scene/ClippingPlaneCollection.js | 2 +- Specs/DataSources/ModelVisualizerSpec.js | 2 +- .../Scene/Batched3DModel3DTileContentSpec.js | 2 +- Specs/Scene/Cesium3DTilesetSpec.js | 2 +- Specs/Scene/ClippingPlaneCollectionSpec.js | 2 +- Specs/{Core => Scene}/ClippingPlaneSpec.js | 2 +- Specs/Scene/GlobeSurfaceTileProviderSpec.js | 2 +- .../Instanced3DModel3DTileContentSpec.js | 2 +- Specs/Scene/ModelSpec.js | 2 +- Specs/Scene/PointCloud3DTileContentSpec.js | 2 +- 16 files changed, 162 insertions(+), 288 deletions(-) delete mode 100644 Apps/Sandcastle/gallery/Draw Clipping Planes.html delete mode 100644 Apps/Sandcastle/gallery/Draw Clipping Planes.jpg rename Source/{Core => Scene}/ClippingPlane.js (97%) rename Specs/{Core => Scene}/ClippingPlaneSpec.js (99%) diff --git a/Apps/Sandcastle/gallery/Draw Clipping Planes.html b/Apps/Sandcastle/gallery/Draw Clipping Planes.html deleted file mode 100644 index ed7d5732b73d..000000000000 --- a/Apps/Sandcastle/gallery/Draw Clipping Planes.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - - Cesium Demo - - - - - - -
-

Loading...

-
-
Opacity
- -
- - - diff --git a/Apps/Sandcastle/gallery/Draw Clipping Planes.jpg b/Apps/Sandcastle/gallery/Draw Clipping Planes.jpg deleted file mode 100644 index 8dd766c52709f4aee6469ef93a31c7f48a5d07ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22141 zcmeEuWmufcmTu$j5S-xd?ry=|9U2MlPH=Y*9^Bn6IKd&fyF+k-b4j+GGc)J8&)na4 z7yZ#ywWL?SWvf;dye_~}rr8<7X__8Wlk_Be!C0Kk9O1E32tGJnhAyp?^A@BmP6 z3gO@KX>ZT3^!ACr>A&A)ENBU(4Q5N&#K-?DpYxY26C+~|$RFO!>ni~8FHZ%A^%ttlj7*%|j4a$tEQE|)+-#iO ztStYr?jO(O7h3DtpMO z7<*V6bD2;G@Wb-Dal2XDSp%I63Eix%Y#h1W_$YoW=YGros%D^gV{$Mt^veQ5LS7SNZes_ap_8q{ui_v2 zl!5lY3xAZXEcpLD=EKYI%j~zx-|W8&fAaG({1;_^F#elu{}+4T!1~+Z|JV+H82iS? zE%M7+py=Df|I6W{V`QOYVo~|a;iG3_X5nS{Z+ves{kHReXAAHxu=byg`9=BNEB>(N zSCLyo3Fv5R<@^hKehy|{hW}Cd3*_IGn*WLO-z)#-{1>CDjfE5c2ODGaKNbHs%HI+~ z4o()1PXDc)et+tpl)pJO6oj0e%->r3zqaWgX8%R|n_I!q#N;i`_l7h(BcYMI6VQ>+ z*~SEDYGDI3Av7^`GW^r7zxe(Z6nn!)4d~$b3zlDb!aoay%=Aou%KSUa-*Ug&RmH*@ zDDPnLHrfoWez);|bL#(;{~xUXLy72{4krr_pvnJ2%fER4R-^1}qzp9vFV-;q)x!UQ z_8;W_rSv}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pl8piNSWJOu<_{DTep#3%CZG6JtD7 zkoYE$fZpyaEd$lu4#u$Cxz_D}CtaM-73Pl5#Wx zR2(KVl#ZR(srvK-#!~q(tZrjSAHGyh5BQQaob*628z5(fa+M%DB<8Ndbj`REv|nO< z=$E3SSE0=0x`2b_U+?pjdTB0mu@w;{O&1U?z9I`A_LX6jf%`oY5zrWG*_ zCLsqy&Vb+P>ui5h2xy1KS=TUD8m$ygLVV{Dtn!Elf?Ce<3JB(yJ4NQk$U0qzAWJF zY$+Gq9GJDs94OYcOz=l$=8U9Ve#9C}0RdUtyImK_gzgG&qp4jJ;7sBmQg5a{*XI&i zfT|m*zt|s#PER|42!SavvvPvfLNA^+2q7S_CpG4+p6(#Nm}{eFsP3a0J6KQhSo}i1 zr8yH&YCrF8iqZ}90R{0$(u5J7P%D`Mv|W!Wz`cfO$mVN?>S=VoQ$5NWAnx=yUr=OD zu@qevXFbdA-3;~3qL&zok#uRW z@?JFO2eCIvM!|b)J8~?Cnj=+_qsO1DfA71XBYcMZc`?AlP}3p^n?GMr8CbbFUn_(s zJR~5Ug~r(r6`!|^V?}QpK|`}k-)>(xjB84H*Q~6b(GpAVo;8VFX$SJS^l&pGbUT_p z`}c@R$wCT+O@#f}(jJ4rrH&*iV;X1*7<$EY2^}u!=2L!gJp?_MQs~!Wxo#XP?t~yu Tm%xTF8ZziVGuad0{xAR8xz)IM diff --git a/Apps/Sandcastle/gallery/Terrain Clipping Planes.html b/Apps/Sandcastle/gallery/Terrain Clipping Planes.html index ecfa7394c8b0..edfdeafbfd09 100644 --- a/Apps/Sandcastle/gallery/Terrain Clipping Planes.html +++ b/Apps/Sandcastle/gallery/Terrain Clipping Planes.html @@ -33,7 +33,9 @@

Loading...

+ Globe clipping planes enabled + Edge styling enabled
diff --git a/CHANGES.md b/CHANGES.md index 562e66bc1bb2..839412622e7e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,7 +16,7 @@ Change Log * Updated `WebMapServiceImageryProvider` so it can take an srs or crs string to pass to the resource query parameters based on the WMS version. [#6223](https://github.com/AnalyticalGraphicsInc/cesium/issues/6223) * Added a multi-part CZML example to Sandcastle. [#6320](https://github.com/AnalyticalGraphicsInc/cesium/pull/6320) * Added `AttributeCompression.octEncodeToCartesian4` and `AttributeCompression.octDecodeFromCartesian4` which will encode and decode unit-length normal vectors using 4 `uint8` components in a `Cartesian4`. -* Added a Sandcastle example for drawing convex polygons of clipping planes on terrain. +* Added 3D Tiles use-case to Terrain Clipping Planes Sandcastle ##### Fixes :wrench: * Fixed support of glTF-supplied tangent vectors. [#6302](https://github.com/AnalyticalGraphicsInc/cesium/pull/6302) diff --git a/Source/Core/ClippingPlane.js b/Source/Scene/ClippingPlane.js similarity index 97% rename from Source/Core/ClippingPlane.js rename to Source/Scene/ClippingPlane.js index 8868f6f6248d..cd68abd23e8e 100644 --- a/Source/Core/ClippingPlane.js +++ b/Source/Scene/ClippingPlane.js @@ -1,8 +1,8 @@ define([ - './Cartesian3', - './Check', - './defined', - './defineProperties' + '../Core/Cartesian3', + '../Core/Check', + '../Core/defined', + '../Core/defineProperties' ], function( Cartesian3, Check, diff --git a/Source/Scene/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js index 2e6507c27fb7..5c083e852b71 100644 --- a/Source/Scene/ClippingPlaneCollection.js +++ b/Source/Scene/ClippingPlaneCollection.js @@ -5,7 +5,7 @@ define([ '../Core/Cartesian4', '../Core/Math', '../Core/Check', - '../Core/ClippingPlane', + '../Scene/ClippingPlane', '../Core/Color', '../Core/defaultValue', '../Core/defined', diff --git a/Specs/DataSources/ModelVisualizerSpec.js b/Specs/DataSources/ModelVisualizerSpec.js index 84950e0bd818..88d9be4df2f6 100644 --- a/Specs/DataSources/ModelVisualizerSpec.js +++ b/Specs/DataSources/ModelVisualizerSpec.js @@ -2,7 +2,7 @@ defineSuite([ 'DataSources/ModelVisualizer', 'Core/BoundingSphere', 'Core/Cartesian3', - 'Core/ClippingPlane', + 'Scene/ClippingPlane', 'Scene/ClippingPlaneCollection', 'Core/defined', 'Core/DistanceDisplayCondition', diff --git a/Specs/Scene/Batched3DModel3DTileContentSpec.js b/Specs/Scene/Batched3DModel3DTileContentSpec.js index 524c332b2a41..6e474e9180de 100644 --- a/Specs/Scene/Batched3DModel3DTileContentSpec.js +++ b/Specs/Scene/Batched3DModel3DTileContentSpec.js @@ -1,7 +1,7 @@ defineSuite([ 'Scene/Batched3DModel3DTileContent', 'Core/Cartesian3', - 'Core/ClippingPlane', + 'Scene/ClippingPlane', 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/HeadingPitchRange', diff --git a/Specs/Scene/Cesium3DTilesetSpec.js b/Specs/Scene/Cesium3DTilesetSpec.js index e6aedc4e9669..a9673e2620a0 100644 --- a/Specs/Scene/Cesium3DTilesetSpec.js +++ b/Specs/Scene/Cesium3DTilesetSpec.js @@ -1,7 +1,7 @@ defineSuite([ 'Scene/Cesium3DTileset', 'Core/Cartesian3', - 'Core/ClippingPlane', + 'Scene/ClippingPlane', 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/CullingVolume', diff --git a/Specs/Scene/ClippingPlaneCollectionSpec.js b/Specs/Scene/ClippingPlaneCollectionSpec.js index 5b6451315753..c247d944de4c 100644 --- a/Specs/Scene/ClippingPlaneCollectionSpec.js +++ b/Specs/Scene/ClippingPlaneCollectionSpec.js @@ -5,7 +5,7 @@ defineSuite([ 'Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartesian4', - 'Core/ClippingPlane', + 'Scene/ClippingPlane', 'Core/Color', 'Core/Math', 'Core/PixelFormat', diff --git a/Specs/Core/ClippingPlaneSpec.js b/Specs/Scene/ClippingPlaneSpec.js similarity index 99% rename from Specs/Core/ClippingPlaneSpec.js rename to Specs/Scene/ClippingPlaneSpec.js index 2aa6e569daf9..f21e3d3faddd 100644 --- a/Specs/Core/ClippingPlaneSpec.js +++ b/Specs/Scene/ClippingPlaneSpec.js @@ -1,5 +1,5 @@ defineSuite([ - 'Core/ClippingPlane', + 'Scene/ClippingPlane', 'Core/Cartesian3', 'Core/Math', 'Core/Matrix3', diff --git a/Specs/Scene/GlobeSurfaceTileProviderSpec.js b/Specs/Scene/GlobeSurfaceTileProviderSpec.js index d61a6158a3b1..dbaa8025d00b 100644 --- a/Specs/Scene/GlobeSurfaceTileProviderSpec.js +++ b/Specs/Scene/GlobeSurfaceTileProviderSpec.js @@ -2,7 +2,7 @@ defineSuite([ 'Scene/GlobeSurfaceTileProvider', 'Core/Cartesian3', 'Core/CesiumTerrainProvider', - 'Core/ClippingPlane', + 'Scene/ClippingPlane', 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/Credit', diff --git a/Specs/Scene/Instanced3DModel3DTileContentSpec.js b/Specs/Scene/Instanced3DModel3DTileContentSpec.js index 7a6819d52da2..e5b28e8f24d3 100644 --- a/Specs/Scene/Instanced3DModel3DTileContentSpec.js +++ b/Specs/Scene/Instanced3DModel3DTileContentSpec.js @@ -1,6 +1,6 @@ defineSuite([ 'Core/Cartesian3', - 'Core/ClippingPlane', + 'Scene/ClippingPlane', 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/HeadingPitchRange', diff --git a/Specs/Scene/ModelSpec.js b/Specs/Scene/ModelSpec.js index 6b178bd554c3..fd8a41efa64b 100644 --- a/Specs/Scene/ModelSpec.js +++ b/Specs/Scene/ModelSpec.js @@ -3,7 +3,7 @@ defineSuite([ 'Core/Cartesian3', 'Core/Cartesian4', 'Core/CesiumTerrainProvider', - 'Core/ClippingPlane', + 'Scene/ClippingPlane', 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/combine', diff --git a/Specs/Scene/PointCloud3DTileContentSpec.js b/Specs/Scene/PointCloud3DTileContentSpec.js index ec464ddacbf7..cadd4d6946a0 100644 --- a/Specs/Scene/PointCloud3DTileContentSpec.js +++ b/Specs/Scene/PointCloud3DTileContentSpec.js @@ -1,6 +1,6 @@ defineSuite([ 'Core/Cartesian3', - 'Core/ClippingPlane', + 'Scene/ClippingPlane', 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/ComponentDatatype', From a2b7a280182c90da6c19d1b092884c7b1dc336c4 Mon Sep 17 00:00:00 2001 From: hpinkos Date: Tue, 13 Mar 2018 14:27:17 -0400 Subject: [PATCH 13/38] use `requestRenderFrame` instead of tying in to scene render loop [ci skip] --- Source/Core/LRUCache.js | 99 ++++++++++++++++++++++++------------ Source/Core/sampleTerrain.js | 6 +-- Source/Scene/Scene.js | 3 -- 3 files changed, 67 insertions(+), 41 deletions(-) diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index 0250fdb39833..bd402c193db2 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -1,16 +1,62 @@ define([ './defined', + './defineProperties', './getTimestamp', + './requestAnimationFrame', './DeveloperError', './DoublyLinkedList' ], function( defined, + defineProperties, getTimestamp, + requestAnimationFrame, DeveloperError, DoublyLinkedList) { 'use strict'; - function Item (key, value) { + function prune(cache) { + var currentTime = getTimestamp(); + var pruneAfter = currentTime - cache._expiration; + + var list = cache._list; + var node = list.tail; + var index = list.length; + while (defined(node) && node.item.timestamp < pruneAfter) { + node = node.previous; + index--; + } + + if (!defined(node)) { + return; + } + + node = node.next; + while (defined(node)) { + delete cache._hash[node.item.key]; + node = node.next; + } + + list.removeAfter(index); + } + + function checkExpiration(cache) { + if (!cache._hasExpiration || cache.length === 0) { + cache._expirationLoopRunning = false; + return; + } + + cache._expirationLoopRunning = true; + + prune(cache); + + if (cache.length > 0) { + requestAnimationFrame(checkExpiration); + } else { + cache._expirationLoopRunning = false; + } + } + + function Item(key, value) { this.key = key; this.value = value; this.timestamp = getTimestamp(); @@ -32,10 +78,26 @@ define([ this._hash = {}; this._hasCapacity = defined(capacity); this._capacity = capacity; + this._hasExpiration = defined(expiration); this._expiration = expiration; + this._expirationLoopRunning = false; } + defineProperties(LRUCache.prototype, { + /** + * Gets the cache length + * @memeberof LRUCache.prototype + * @type {Number} + * @readonly + */ + length : { + get : function() { + return this._list.length; + } + } + }); + /** * Retrieves the value associated with the provided key. * @@ -80,6 +142,9 @@ define([ item = new Item(key, value); node = list.addFront(item); hash[key] = node; + if (this._hasExpiration && !this._expirationLoopRunning) { + checkExpiration(this); + } if (this._hasCapacity && list.length > this._capacity) { var tail = list.tail; delete this._hash[tail.item.key]; @@ -93,37 +158,5 @@ define([ } }; - /** - * Removes expired items from the cache. - */ - LRUCache.prototype.prune = function() { - if (!this._hasExpiration || this._list.length === 0) { - return; - } - - var currentTime = getTimestamp(); - var pruneAfter = currentTime - this._expiration; - - var list = this._list; - var node = list.tail; - var index = list.length; - while (defined(node) && node.item.timestamp < pruneAfter) { - node = node.previous; - index--; - } - - if (!defined(node)) { - return; - } - - node = node.next; - while(defined(node)) { - delete this._hash[node.item.key]; - node = node.next; - } - - list.removeAfter(index); - }; - return LRUCache; }); diff --git a/Source/Core/sampleTerrain.js b/Source/Core/sampleTerrain.js index 6ada1ba8f1a0..86c57423806e 100644 --- a/Source/Core/sampleTerrain.js +++ b/Source/Core/sampleTerrain.js @@ -10,7 +10,7 @@ define([ LRUCache) { 'use strict'; - var cache = new LRUCache(100, 60000); + var cache = new LRUCache(256, 30000); /** * Initiates a terrain height query for an array of {@link Cartographic} positions by @@ -58,10 +58,6 @@ define([ return terrainProvider.readyPromise.then(function() { return doSampling(terrainProvider, level, positions); }); } - sampleTerrain._update = function() { - cache.prune(); - }; - function doSampling(terrainProvider, level, positions) { var tilingScheme = terrainProvider.tilingScheme; diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 1ab5c1107f87..09f66661d748 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -34,7 +34,6 @@ define([ '../Core/PerspectiveOffCenterFrustum', '../Core/PixelFormat', '../Core/RequestScheduler', - '../Core/sampleTerrain', '../Core/ShowGeometryInstanceAttribute', '../Core/TaskProcessor', '../Core/Transforms', @@ -114,7 +113,6 @@ define([ PerspectiveOffCenterFrustum, PixelFormat, RequestScheduler, - sampleTerrain, ShowGeometryInstanceAttribute, TaskProcessor, Transforms, @@ -2966,7 +2964,6 @@ define([ } frameState.creditDisplay.update(); - sampleTerrain._update(); } function render(scene, time) { From f8f2fa9a3a76e32295aafe103d49ceddaeb40c2f Mon Sep 17 00:00:00 2001 From: hpinkos Date: Tue, 13 Mar 2018 14:39:38 -0400 Subject: [PATCH 14/38] fix loop, change cache expiration [ci skip] --- Source/Core/LRUCache.js | 23 +++++++++++++---------- Source/Core/sampleTerrain.js | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index bd402c193db2..7372d7ed955b 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -40,20 +40,23 @@ define([ } function checkExpiration(cache) { - if (!cache._hasExpiration || cache.length === 0) { - cache._expirationLoopRunning = false; - return; - } + function loop() { + if (!cache._hasExpiration || cache.length === 0) { + cache._expirationLoopRunning = false; + return; + } - cache._expirationLoopRunning = true; + cache._expirationLoopRunning = true; - prune(cache); + prune(cache); - if (cache.length > 0) { - requestAnimationFrame(checkExpiration); - } else { - cache._expirationLoopRunning = false; + if (cache.length > 0) { + requestAnimationFrame(loop); + } else { + cache._expirationLoopRunning = false; + } } + loop(); } function Item(key, value) { diff --git a/Source/Core/sampleTerrain.js b/Source/Core/sampleTerrain.js index 86c57423806e..ce8358c00b3c 100644 --- a/Source/Core/sampleTerrain.js +++ b/Source/Core/sampleTerrain.js @@ -10,7 +10,7 @@ define([ LRUCache) { 'use strict'; - var cache = new LRUCache(256, 30000); + var cache = new LRUCache(256, 10000); /** * Initiates a terrain height query for an array of {@link Cartographic} positions by From 20f673fa038ac91bfe09970c7d2d655ef94650c7 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Tue, 13 Mar 2018 15:01:53 -0400 Subject: [PATCH 15/38] fix console error in 3D Tiles Clipping Planes sandcastle --- Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html | 1 + 1 file changed, 1 insertion(+) diff --git a/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html b/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html index df2f4e429d3e..6270030f6cbe 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html +++ b/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html @@ -258,6 +258,7 @@ viewer.scene.primitives.removeAll(); planeEntities = []; targetY = 0.0; + tileset = undefined; } //Sandcastle_End From 5d8d2403e6704af99ca4079552ccfbcabf68faa3 Mon Sep 17 00:00:00 2001 From: hpinkos Date: Tue, 13 Mar 2018 15:19:12 -0400 Subject: [PATCH 16/38] fix specs --- Source/Core/LRUCache.js | 15 ++++++++++++--- Specs/Core/LRUCacheSpec.js | 8 ++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index 7372d7ed955b..b81fdf6a3d4b 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -26,11 +26,16 @@ define([ index--; } - if (!defined(node)) { + if (node === list.tail) { return; } - node = node.next; + if (!defined(node)) { + node = list.head; + } else { + node = node.next; + } + while (defined(node)) { delete cache._hash[node.item.key]; node = node.next; @@ -146,7 +151,7 @@ define([ node = list.addFront(item); hash[key] = node; if (this._hasExpiration && !this._expirationLoopRunning) { - checkExpiration(this); + LRUCache._checkExpiration(this); } if (this._hasCapacity && list.length > this._capacity) { var tail = list.tail; @@ -161,5 +166,9 @@ define([ } }; + //exposed for testing + LRUCache._checkExpiration = checkExpiration; + LRUCache._prune = prune; + return LRUCache; }); diff --git a/Specs/Core/LRUCacheSpec.js b/Specs/Core/LRUCacheSpec.js index 1799702073d6..4045734095f0 100644 --- a/Specs/Core/LRUCacheSpec.js +++ b/Specs/Core/LRUCacheSpec.js @@ -93,7 +93,7 @@ defineSuite([ spinWait(3); - cache.prune(); + LRUCache._prune(cache); expect(cache.get('key1')).toEqual(1); expect(cache.get('key2')).toEqual(2); @@ -101,13 +101,17 @@ defineSuite([ }); it('prune removes expired entries', function() { + spyOn(LRUCache, '_checkExpiration'); + var cache = new LRUCache(3, 10); cache.set('key1', 1); cache.set('key2', 2); + spinWait(10); + cache.set('key3', 3); - cache.prune(); + LRUCache._prune(cache); expect(cache.get('key1')).toBeUndefined(); expect(cache.get('key2')).toBeUndefined(); From e95ce176f2005e8b0c4268396801e5182ac443e6 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Tue, 13 Mar 2018 15:32:52 -0400 Subject: [PATCH 17/38] move many clipping planes out of showcases/beginner --- Apps/Sandcastle/gallery/development/Many Clipping Planes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html index 4fe078600a8a..c6d28dfa42e8 100644 --- a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html +++ b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html @@ -5,7 +5,7 @@ - + Cesium Demo From 0b7455849cbf6adc1f96921b1003d1a07e7220ae Mon Sep 17 00:00:00 2001 From: hpinkos Date: Wed, 14 Mar 2018 09:32:55 -0400 Subject: [PATCH 18/38] fix doc --- Source/Core/LRUCache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index b81fdf6a3d4b..25cf6febde14 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -95,7 +95,7 @@ define([ defineProperties(LRUCache.prototype, { /** * Gets the cache length - * @memeberof LRUCache.prototype + * @memberof LRUCache.prototype * @type {Number} * @readonly */ From adc8cccf28b8321f266a0deda818eee336e8a176 Mon Sep 17 00:00:00 2001 From: Scott Hunter Date: Wed, 14 Mar 2018 09:35:49 -0400 Subject: [PATCH 19/38] Add additional query parameter options to CesiumViewer. sourceType=czml/geojson/kml specifies the type of data to allow loading URLs which don't have a file extension (such as a web service). flyTo=false optionally disables the automatic flyTo after loading data. --- Apps/CesiumViewer/CesiumViewer.js | 49 +++++++++++++++++++++---------- CHANGES.md | 3 ++ 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/Apps/CesiumViewer/CesiumViewer.js b/Apps/CesiumViewer/CesiumViewer.js index b862541b7a30..96ec66366227 100644 --- a/Apps/CesiumViewer/CesiumViewer.js +++ b/Apps/CesiumViewer/CesiumViewer.js @@ -32,20 +32,28 @@ define([ 'use strict'; /* - * 'debug' : true/false, // Full WebGL error reporting at substantial performance cost. - * 'lookAt' : CZML id, // The CZML ID of the object to track at startup. - * 'source' : 'file.czml', // The relative URL of the CZML file to load at startup. - * 'stats' : true, // Enable the FPS performance display. - * 'theme' : 'lighter', // Use the dark-text-on-light-background theme. - * 'scene3DOnly' : false // Enable 3D only mode - * 'view' : longitude,latitude,[height,heading,pitch,roll] - * // Using degrees and meters - * // [height,heading,pitch,roll] default is looking straight down, [300,0,-90,0] + Options parsed from query string: + source=url The URL of a CZML/GeoJSON/KML data source to load at startup. + Automatic data type detection uses file extension. + sourceType=czml/geojson/kml + Override data type detection for source. + flyTo=false Don't automatically fly to the loaded source. + tmsImageryUrl=url Automatically use a TMS imagery provider. + lookAt=id The ID of the entity to track at startup. + stats=true Enable the FPS performance display. + inspector=true Enable the inspector widget. + debug=true Full WebGL error reporting at substantial performance cost. + theme=lighter Use the dark-text-on-light-background theme. + scene3DOnly=true Enable 3D only mode. + view=longitude,latitude,[height,heading,pitch,roll] + Automatically set a camera view. Values in degrees and meters. + [height,heading,pitch,roll] default is looking straight down, [300,0,-90,0] + saveCamera=false Don't automatically update the camera view in the URL when it changes. */ var endUserOptions = queryToObject(window.location.search.substring(1)); var imageryProvider; - if (endUserOptions.tmsImageryUrl) { + if (defined(endUserOptions.tmsImageryUrl)) { imageryProvider = createTileMapServiceImageryProvider({ url : endUserOptions.tmsImageryUrl }); @@ -108,13 +116,24 @@ define([ var view = endUserOptions.view; var source = endUserOptions.source; if (defined(source)) { - var loadPromise; + var sourceType = endUserOptions.sourceType; + if (!defined(sourceType)) { + // autodetect using file extension if not specified + if (/\.czml$/i.test(source)) { + sourceType = 'czml'; + } else if (/\.geojson$/i.test(source) || /\.json$/i.test(source) || /\.topojson$/i.test(source)) { + sourceType = 'geojson'; + } else if (/\.kml$/i.test(source) || /\.kmz$/i.test(source)) { + sourceType = 'kml'; + } + } - if (/\.czml$/i.test(source)) { + var loadPromise; + if (sourceType === 'czml') { loadPromise = CzmlDataSource.load(source); - } else if (/\.geojson$/i.test(source) || /\.json$/i.test(source) || /\.topojson$/i.test(source)) { + } else if (sourceType === 'geojson') { loadPromise = GeoJsonDataSource.load(source); - } else if (/\.kml$/i.test(source) || /\.kmz$/i.test(source)) { + } else if (sourceType === 'kml') { loadPromise = KmlDataSource.load(source, { camera: scene.camera, canvas: scene.canvas @@ -134,7 +153,7 @@ define([ var error = 'No entity with id "' + lookAt + '" exists in the provided data source.'; showLoadError(source, error); } - } else if (!defined(view)) { + } else if (!defined(view) && endUserOptions.flyTo !== 'false') { viewer.flyTo(dataSource); } }).otherwise(function(error) { diff --git a/CHANGES.md b/CHANGES.md index ada7ebfa448b..cc7151c7b0cc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,9 @@ Change Log * Added support for Internet Explorer. * Added a `ClippingPlane` object to be used with `ClippingPlaneCollection`. * Updated `WebMapServiceImageryProvider` so it can take an srs or crs string to pass to the resource query parameters based on the WMS version. [#6223](https://github.com/AnalyticalGraphicsInc/cesium/issues/6223) +* Added additional query parameter options to the CesiumViewer demo application: + * sourceType specifies the type of data source if the URL doesn't have a known file extension. + * flyTo=false optionally disables the automatic flyTo after loading the data source. * Added a multi-part CZML example to Sandcastle. [#6320](https://github.com/AnalyticalGraphicsInc/cesium/pull/6320) ##### Fixes :wrench: From ce35098b9af6b2344a9ec2f3eb943a7ba69868df Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Wed, 14 Mar 2018 21:09:58 -0400 Subject: [PATCH 20/38] PR feedback --- .../gallery/Terrain Clipping Planes.html | 26 +++++----- CHANGES.md | 1 - Source/Core/AttributeCompression.js | 17 ++++--- Source/Scene/Cesium3DTileset.js | 4 +- Source/Scene/ClippingPlane.js | 48 ++++++++++++++----- Source/Scene/ClippingPlaneCollection.js | 2 +- Source/Scene/GlobeSurfaceShaderSet.js | 4 +- Source/Scene/GlobeSurfaceTileProvider.js | 4 +- Source/Scene/Model.js | 6 +-- Source/Scene/PointCloud3DTileContent.js | 4 +- Source/Scene/getClippingFunction.js | 4 +- Specs/Core/AttributeCompressionSpec.js | 36 +++++++------- Specs/DataSources/ModelGraphicsSpec.js | 4 +- Specs/DataSources/ModelVisualizerSpec.js | 8 ++-- Specs/Renderer/BuiltinFunctionsSpec.js | 15 ++++++ .../Scene/Batched3DModel3DTileContentSpec.js | 8 ++-- Specs/Scene/Cesium3DTilesetSpec.js | 8 ++-- Specs/Scene/ClippingPlaneCollectionSpec.js | 2 +- Specs/Scene/GlobeSurfaceTileProviderSpec.js | 8 ++-- .../Instanced3DModel3DTileContentSpec.js | 8 ++-- Specs/Scene/ModelSpec.js | 8 ++-- Specs/Scene/PointCloud3DTileContentSpec.js | 8 ++-- 22 files changed, 139 insertions(+), 94 deletions(-) diff --git a/Apps/Sandcastle/gallery/Terrain Clipping Planes.html b/Apps/Sandcastle/gallery/Terrain Clipping Planes.html index edfdeafbfd09..1a041061c4b7 100644 --- a/Apps/Sandcastle/gallery/Terrain Clipping Planes.html +++ b/Apps/Sandcastle/gallery/Terrain Clipping Planes.html @@ -50,10 +50,10 @@ }); var globe = viewer.scene.globe; -var demos = ['Cesium Man', 'St. Helens']; +var exampleTypes = ['Cesium Man', 'St. Helens']; var viewModel = { - exampleTypes : demos, - currentExampleType : demos[0], + exampleTypes : exampleTypes, + currentExampleType : exampleTypes[0], clippingPlanesEnabled : true, edgeStylingEnabled : true }; @@ -61,7 +61,7 @@ Cesium.knockout.track(viewModel); Cesium.knockout.applyBindings(viewModel, toolbar); -// For tracking state when switching demos +// For tracking state when switching exampleTypes var clippingPlanesEnabled = true; var edgeStylingEnabled = true; @@ -104,7 +104,8 @@ new Cesium.ClippingPlane(new Cesium.Cartesian3( 0.0, -1.0, 0.0), -700.0) ], edgeWidth: edgeStylingEnabled ? 1.0 : 0.0, - edgeColor: Cesium.Color.WHITE + edgeColor: Cesium.Color.WHITE, + enabled : clippingPlanesEnabled }); viewer.trackedEntity = entity; @@ -129,12 +130,12 @@ new Cesium.Cartesian3(-2358539.5426236596, -3742680.720902901, 4581692.0260975715) ]; - var pointCount = points.length; + var pointsLength = points.length; - // Create centerpoints for each clipping plane + // Create center points for each clipping plane var clippingPlanes = []; - for (var i = 0; i < pointCount; i++) { - var nextIndex = (i + 1) % pointCount; + for (var i = 0; i < pointsLength; ++i) { + var nextIndex = (i + 1) % pointsLength; var midpoint = Cesium.Cartesian3.add(points[i], points[nextIndex], new Cesium.Cartesian3()); midpoint = Cesium.Cartesian3.multiplyByScalar(midpoint, 0.5, midpoint); @@ -154,7 +155,8 @@ globe.clippingPlanes = new Cesium.ClippingPlaneCollection({ planes : clippingPlanes, edgeWidth: edgeStylingEnabled ? 1.0 : 0.0, - edgeColor: Cesium.Color.WHITE + edgeColor: Cesium.Color.WHITE, + enabled : clippingPlanesEnabled }); // Load tileset @@ -197,9 +199,9 @@ Cesium.knockout.getObservable(viewModel, 'currentExampleType').subscribe(function(newValue) { reset(); - if (newValue === demos[0]) { + if (newValue === exampleTypes[0]) { loadCesiumMan(); - } else if (newValue === demos[1]) { + } else if (newValue === exampleTypes[1]) { loadStHelens(); } }); diff --git a/CHANGES.md b/CHANGES.md index 839412622e7e..61de7eecedb9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,7 +15,6 @@ Change Log * Added a `ClippingPlane` object to be used with `ClippingPlaneCollection`. * Updated `WebMapServiceImageryProvider` so it can take an srs or crs string to pass to the resource query parameters based on the WMS version. [#6223](https://github.com/AnalyticalGraphicsInc/cesium/issues/6223) * Added a multi-part CZML example to Sandcastle. [#6320](https://github.com/AnalyticalGraphicsInc/cesium/pull/6320) -* Added `AttributeCompression.octEncodeToCartesian4` and `AttributeCompression.octDecodeFromCartesian4` which will encode and decode unit-length normal vectors using 4 `uint8` components in a `Cartesian4`. * Added 3D Tiles use-case to Terrain Clipping Planes Sandcastle ##### Fixes :wrench: diff --git a/Source/Core/AttributeCompression.js b/Source/Core/AttributeCompression.js index 9aa8c2ee64b8..3d47633b81b9 100644 --- a/Source/Core/AttributeCompression.js +++ b/Source/Core/AttributeCompression.js @@ -90,7 +90,7 @@ define([ return uint8ForceArray[0]; } /** - * @param {Cartesian3} vector The normalized vector to be compressed into 2 byte 'oct' encoding. + * @param {Cartesian3} vector The normalized vector to be compressed into 4 byte 'oct' encoding. * @param {Cartesian4} result The 4 byte oct-encoded unit length vector. * @returns {Cartesian4} The 4 byte oct-encoded unit length vector. * @@ -162,10 +162,7 @@ define([ /** * Decodes a unit-length vector in 4 byte 'oct' encoding to a normalized 3-component vector. * - * @param {Number} x The x component of the oct-encoded unit length vector. - * @param {Number} y The y component of the oct-encoded unit length vector. - * @param {Number} z The z component of the oct-encoded unit length vector. - * @param {Number} w The w component of the oct-encoded unit length vector. + * @param {Cartesian4} encoded The oct-encoded unit length vector. * @param {Cartesian3} result The decoded and normalized vector. * @returns {Cartesian3} The decoded and normalized vector. * @@ -174,7 +171,15 @@ define([ * @see AttributeCompression.octDecodeInRange * @see AttributeCompression.octEncodeToCartesian4 */ - AttributeCompression.octDecodeFromCartesian4 = function(x, y, z, w, result) { + AttributeCompression.octDecodeFromCartesian4 = function(encoded, result) { + //>>includeStart('debug', pragmas.debug); + Check.typeOf.object('encoded', encoded); + Check.typeOf.object('result', result); + //>>includeEnd('debug'); + var x = encoded.x; + var y = encoded.y; + var z = encoded.z; + var w = encoded.w; //>>includeStart('debug', pragmas.debug); if (x < 0 || x > 255 || y < 0 || y > 255 || z < 0 || z > 255 || w < 0 || w > 255) { throw new DeveloperError('x, y, z, and w must be unsigned normalized integers between 0 and 255'); diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 9b23c5da21c1..1bb3f0db1a02 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -3,7 +3,6 @@ define([ '../Core/Cartesian3', '../Core/Cartographic', '../Core/Check', - '../Scene/ClippingPlaneCollection', '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', @@ -34,6 +33,7 @@ define([ './Cesium3DTilesetTraversal', './Cesium3DTileStyleEngine', './ClassificationType', + './ClippingPlaneCollection', './LabelCollection', './PointCloudShading', './PointCloudEyeDomeLighting', @@ -47,7 +47,6 @@ define([ Cartesian3, Cartographic, Check, - ClippingPlaneCollection, defaultValue, defined, defineProperties, @@ -78,6 +77,7 @@ define([ Cesium3DTilesetTraversal, Cesium3DTileStyleEngine, ClassificationType, + ClippingPlaneCollection, LabelCollection, PointCloudShading, PointCloudEyeDomeLighting, diff --git a/Source/Scene/ClippingPlane.js b/Source/Scene/ClippingPlane.js index cd68abd23e8e..4a2fd18427d1 100644 --- a/Source/Scene/ClippingPlane.js +++ b/Source/Scene/ClippingPlane.js @@ -25,8 +25,10 @@ define([ * opposite to the normal; if zero, the plane passes through the origin. */ function ClippingPlane(normal, distance) { + //>>includeStart('debug', pragmas.debug); Check.typeOf.object('normal', normal); Check.typeOf.number('distance', distance); + //>>includeEnd('debug'); this._distance = distance; this._normal = new UpdateChangedCartesian3(normal, this); @@ -131,27 +133,49 @@ define([ this._cartesian3 = Cartesian3.clone(normal); } - function makeGetterSetter(key) { - return { + defineProperties(UpdateChangedCartesian3.prototype, { + x : { get : function() { - return this._cartesian3[key]; + return this._cartesian3.x; }, set : function(value) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number('value', value); //>>includeEnd('debug'); - if (defined(this._clippingPlane.onChangeCallback) && value !== this._cartesian3[key]) { + if (defined(this._clippingPlane.onChangeCallback) && value !== this._cartesian3.x) { this._clippingPlane.onChangeCallback(this._clippingPlane.index); } - this._cartesian3[key] = value; + this._cartesian3.x = value; } - }; - } - - defineProperties(UpdateChangedCartesian3.prototype, { - x : makeGetterSetter('x'), - y : makeGetterSetter('y'), - z : makeGetterSetter('z') + }, + y : { + get : function() { + return this._cartesian3.y; + }, + set : function(value) { + //>>includeStart('debug', pragmas.debug); + Check.typeOf.number('value', value); + //>>includeEnd('debug'); + if (defined(this._clippingPlane.onChangeCallback) && value !== this._cartesian3.y) { + this._clippingPlane.onChangeCallback(this._clippingPlane.index); + } + this._cartesian3.y = value; + } + }, + z : { + get : function() { + return this._cartesian3.z; + }, + set : function(value) { + //>>includeStart('debug', pragmas.debug); + Check.typeOf.number('value', value); + //>>includeEnd('debug'); + if (defined(this._clippingPlane.onChangeCallback) && value !== this._cartesian3.z) { + this._clippingPlane.onChangeCallback(this._clippingPlane.index); + } + this._cartesian3.z = value; + } + } }); return ClippingPlane; diff --git a/Source/Scene/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js index 5c083e852b71..f618463bbd8d 100644 --- a/Source/Scene/ClippingPlaneCollection.js +++ b/Source/Scene/ClippingPlaneCollection.js @@ -181,7 +181,7 @@ define([ * * @memberof ClippingPlaneCollection.prototype * @type {Boolean} - * @default false + * @default true */ enabled : { get : function() { diff --git a/Source/Scene/GlobeSurfaceShaderSet.js b/Source/Scene/GlobeSurfaceShaderSet.js index baef062fa93a..0c6e9659006d 100644 --- a/Source/Scene/GlobeSurfaceShaderSet.js +++ b/Source/Scene/GlobeSurfaceShaderSet.js @@ -1,18 +1,18 @@ define([ - '../Scene/ClippingPlaneCollection', '../Core/defined', '../Core/destroyObject', '../Core/TerrainQuantization', '../Renderer/ShaderProgram', '../Scene/SceneMode', + './ClippingPlaneCollection', './getClippingFunction' ], function( - ClippingPlaneCollection, defined, destroyObject, TerrainQuantization, ShaderProgram, SceneMode, + ClippingPlaneCollection, getClippingFunction) { 'use strict'; diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js index 573f090deddc..cc816c68ad40 100644 --- a/Source/Scene/GlobeSurfaceTileProvider.js +++ b/Source/Scene/GlobeSurfaceTileProvider.js @@ -4,7 +4,6 @@ define([ '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', - '../Scene/ClippingPlaneCollection', '../Core/Color', '../Core/ColorGeometryInstanceAttribute', '../Core/combine', @@ -40,6 +39,7 @@ define([ '../Scene/DepthFunction', '../Scene/PerInstanceColorAppearance', '../Scene/Primitive', + './ClippingPlaneCollection', './GlobeSurfaceTile', './ImageryLayer', './QuadtreeTileLoadState', @@ -51,7 +51,6 @@ define([ Cartesian2, Cartesian3, Cartesian4, - ClippingPlaneCollection, Color, ColorGeometryInstanceAttribute, combine, @@ -87,6 +86,7 @@ define([ DepthFunction, PerInstanceColorAppearance, Primitive, + ClippingPlaneCollection, GlobeSurfaceTile, ImageryLayer, QuadtreeTileLoadState, diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index ff0dd7855e50..30545a63b873 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -4,7 +4,6 @@ define([ '../Core/Cartesian3', '../Core/Cartesian4', '../Core/Cartographic', - '../Scene/ClippingPlaneCollection', '../Core/clone', '../Core/Color', '../Core/combine', @@ -62,6 +61,7 @@ define([ './AttributeType', './Axis', './BlendingState', + './ClippingPlaneCollection', './ColorBlendMode', './DracoLoader', './getClipAndStyleCode', @@ -83,7 +83,6 @@ define([ Cartesian3, Cartesian4, Cartographic, - ClippingPlaneCollection, clone, Color, combine, @@ -141,6 +140,7 @@ define([ AttributeType, Axis, BlendingState, + ClippingPlaneCollection, ColorBlendMode, DracoLoader, getClipAndStyleCode, @@ -518,7 +518,7 @@ define([ */ this.colorBlendAmount = defaultValue(options.colorBlendAmount, 0.5); - this._colorShadingEnabled = isColorShadingEnabled(this); + this._colorShadingEnabled = false; this._clippingPlanes = undefined; this.clippingPlanes = options.clippingPlanes; diff --git a/Source/Scene/PointCloud3DTileContent.js b/Source/Scene/PointCloud3DTileContent.js index 786fd232a67a..78638b9d62d3 100644 --- a/Source/Scene/PointCloud3DTileContent.js +++ b/Source/Scene/PointCloud3DTileContent.js @@ -2,7 +2,6 @@ define([ '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', - '../Scene/ClippingPlaneCollection', '../Core/Color', '../Core/combine', '../Core/ComponentDatatype', @@ -35,6 +34,7 @@ define([ './Cesium3DTileBatchTable', './Cesium3DTileFeature', './Cesium3DTileFeatureTable', + './ClippingPlaneCollection', './getClipAndStyleCode', './getClippingFunction', './SceneMode', @@ -43,7 +43,6 @@ define([ Cartesian2, Cartesian3, Cartesian4, - ClippingPlaneCollection, Color, combine, ComponentDatatype, @@ -76,6 +75,7 @@ define([ Cesium3DTileBatchTable, Cesium3DTileFeature, Cesium3DTileFeatureTable, + ClippingPlaneCollection, getClipAndStyleCode, getClippingFunction, SceneMode, diff --git a/Source/Scene/getClippingFunction.js b/Source/Scene/getClippingFunction.js index 8407acdefec7..902eb9b87b7e 100644 --- a/Source/Scene/getClippingFunction.js +++ b/Source/Scene/getClippingFunction.js @@ -109,7 +109,7 @@ define([ pixelWidthString += '.0'; } var pixelHeightString = pixelHeight + ''; - if (pixelHeightString.indexOf('.' === -1)) { + if (pixelHeightString.indexOf('.') === -1) { pixelHeightString += '.0'; } @@ -135,7 +135,7 @@ define([ pixelWidthString += '.0'; } var pixelHeightString = pixelHeight + ''; - if (pixelHeightString.indexOf('.' === -1)) { + if (pixelHeightString.indexOf('.') === -1) { pixelHeightString += '.0'; } diff --git a/Specs/Core/AttributeCompressionSpec.js b/Specs/Core/AttributeCompressionSpec.js index fe0160833e24..4addf8add446 100644 --- a/Specs/Core/AttributeCompressionSpec.js +++ b/Specs/Core/AttributeCompressionSpec.js @@ -115,19 +115,19 @@ defineSuite([ it('throws 4-component oct decode out of bounds', function() { var result = new Cartesian3(); expect(function() { - AttributeCompression.octDecodeFromCartesian4(256, 0, 0, 0, result); + AttributeCompression.octDecodeFromCartesian4(new Cartesian4(256, 0, 0, 0), result); }).toThrowDeveloperError(); expect(function() { - AttributeCompression.octDecodeFromCartesian4(0, 256, 0, 0, result); + AttributeCompression.octDecodeFromCartesian4(new Cartesian4(0, 256, 0, 0), result); }).toThrowDeveloperError(); expect(function() { - AttributeCompression.octDecodeFromCartesian4(0, 0, 256, 0, result); + AttributeCompression.octDecodeFromCartesian4(new Cartesian4(0, 0, 256, 0), result); }).toThrowDeveloperError(); expect(function() { - AttributeCompression.octDecodeFromCartesian4(0, 0, 0, 256, result); + AttributeCompression.octDecodeFromCartesian4(new Cartesian4(0, 0, 0, 256), result); }).toThrowDeveloperError(); }); @@ -279,67 +279,67 @@ defineSuite([ var result = new Cartesian3(); var normal = new Cartesian3(0.0, 0.0, 1.0); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, 0.0, -1.0); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, 1.0, 0.0); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(0.0, -1.0, 0.0); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 0.0, 0.0); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 0.0, 0.0); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 1.0, 1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, -1.0, 1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, -1.0, 1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 1.0, 1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, 1.0, -1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(1.0, -1.0, -1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, 1.0, -1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); normal = new Cartesian3(-1.0, -1.0, -1.0); Cartesian3.normalize(normal, normal); AttributeCompression.octEncodeToCartesian4(normal, encoded); - expect(AttributeCompression.octDecodeFromCartesian4(encoded.x, encoded.y, encoded.z, encoded.w, result)).toEqualEpsilon(normal, epsilon); + expect(AttributeCompression.octDecodeFromCartesian4(encoded, result)).toEqualEpsilon(normal, epsilon); }); it('octFloat encoding', function() { diff --git a/Specs/DataSources/ModelGraphicsSpec.js b/Specs/DataSources/ModelGraphicsSpec.js index f4c9049fb514..f7d49e004a70 100644 --- a/Specs/DataSources/ModelGraphicsSpec.js +++ b/Specs/DataSources/ModelGraphicsSpec.js @@ -1,7 +1,6 @@ defineSuite([ 'DataSources/ModelGraphics', 'Core/Cartesian3', - 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/DistanceDisplayCondition', 'Core/JulianDate', @@ -9,13 +8,13 @@ defineSuite([ 'DataSources/ConstantProperty', 'DataSources/NodeTransformationProperty', 'DataSources/PropertyBag', + 'Scene/ClippingPlaneCollection', 'Scene/ColorBlendMode', 'Scene/HeightReference', 'Scene/ShadowMode' ], function( ModelGraphics, Cartesian3, - ClippingPlaneCollection, Color, DistanceDisplayCondition, JulianDate, @@ -23,6 +22,7 @@ defineSuite([ ConstantProperty, NodeTransformationProperty, PropertyBag, + ClippingPlaneCollection, ColorBlendMode, HeightReference, ShadowMode) { diff --git a/Specs/DataSources/ModelVisualizerSpec.js b/Specs/DataSources/ModelVisualizerSpec.js index 88d9be4df2f6..a7de662b5482 100644 --- a/Specs/DataSources/ModelVisualizerSpec.js +++ b/Specs/DataSources/ModelVisualizerSpec.js @@ -2,8 +2,6 @@ defineSuite([ 'DataSources/ModelVisualizer', 'Core/BoundingSphere', 'Core/Cartesian3', - 'Scene/ClippingPlane', - 'Scene/ClippingPlaneCollection', 'Core/defined', 'Core/DistanceDisplayCondition', 'Core/JulianDate', @@ -17,6 +15,8 @@ defineSuite([ 'DataSources/EntityCollection', 'DataSources/ModelGraphics', 'DataSources/NodeTransformationProperty', + 'Scene/ClippingPlane', + 'Scene/ClippingPlaneCollection', 'Scene/Globe', 'Specs/createScene', 'Specs/pollToPromise' @@ -24,8 +24,6 @@ defineSuite([ ModelVisualizer, BoundingSphere, Cartesian3, - ClippingPlane, - ClippingPlaneCollection, defined, DistanceDisplayCondition, JulianDate, @@ -39,6 +37,8 @@ defineSuite([ EntityCollection, ModelGraphics, NodeTransformationProperty, + ClippingPlane, + ClippingPlaneCollection, Globe, createScene, pollToPromise) { diff --git a/Specs/Renderer/BuiltinFunctionsSpec.js b/Specs/Renderer/BuiltinFunctionsSpec.js index f84ecf8145f6..19545dd3bd0c 100644 --- a/Specs/Renderer/BuiltinFunctionsSpec.js +++ b/Specs/Renderer/BuiltinFunctionsSpec.js @@ -1,6 +1,7 @@ defineSuite([ 'Core/BoundingRectangle', 'Core/Cartesian3', + 'Core/Cartesian4', 'Core/EncodedCartesian3', 'Specs/createCamera', 'Specs/createContext', @@ -8,6 +9,7 @@ defineSuite([ ], 'Renderer/BuiltinFunctions', function( BoundingRectangle, Cartesian3, + Cartesian4, EncodedCartesian3, createCamera, createContext, @@ -382,4 +384,17 @@ defineSuite([ }).contextToRender(); }); + it('has czm_unpackFloat', function() { + var packed = Cartesian4.packFloat(1); + var vec4 = 'vec4(' + packed.x + ', ' + packed.y + ', ' + packed.z + ', ' + packed.w + ')'; + var fs = + 'void main() { ' + + ' gl_FragColor = vec4(czm_unpackFloat(' + vec4 + '));' + + '}'; + expect({ + context : context, + fragmentShader : fs + }).contextToRender(); + }); + }, 'WebGL'); diff --git a/Specs/Scene/Batched3DModel3DTileContentSpec.js b/Specs/Scene/Batched3DModel3DTileContentSpec.js index 6e474e9180de..667affdd5ec2 100644 --- a/Specs/Scene/Batched3DModel3DTileContentSpec.js +++ b/Specs/Scene/Batched3DModel3DTileContentSpec.js @@ -1,26 +1,26 @@ defineSuite([ 'Scene/Batched3DModel3DTileContent', 'Core/Cartesian3', - 'Scene/ClippingPlane', - 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/HeadingPitchRange', 'Core/HeadingPitchRoll', 'Core/Transforms', 'Specs/Cesium3DTilesTester', 'Specs/createScene', + 'Scene/ClippingPlane', + 'Scene/ClippingPlaneCollection', 'Scene/Model' ], function( Batched3DModel3DTileContent, Cartesian3, - ClippingPlane, - ClippingPlaneCollection, Color, HeadingPitchRange, HeadingPitchRoll, Transforms, Cesium3DTilesTester, createScene, + ClippingPlane, + ClippingPlaneCollection, Model) { 'use strict'; diff --git a/Specs/Scene/Cesium3DTilesetSpec.js b/Specs/Scene/Cesium3DTilesetSpec.js index a9673e2620a0..ce9f61a122cb 100644 --- a/Specs/Scene/Cesium3DTilesetSpec.js +++ b/Specs/Scene/Cesium3DTilesetSpec.js @@ -1,8 +1,6 @@ defineSuite([ 'Scene/Cesium3DTileset', 'Core/Cartesian3', - 'Scene/ClippingPlane', - 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/CullingVolume', 'Core/getAbsoluteUri', @@ -23,6 +21,8 @@ defineSuite([ 'Scene/Cesium3DTileContentState', 'Scene/Cesium3DTileRefine', 'Scene/Cesium3DTileStyle', + 'Scene/ClippingPlane', + 'Scene/ClippingPlaneCollection', 'Scene/CullFace', 'Specs/Cesium3DTilesTester', 'Specs/createScene', @@ -31,8 +31,6 @@ defineSuite([ ], function( Cesium3DTileset, Cartesian3, - ClippingPlane, - ClippingPlaneCollection, Color, CullingVolume, getAbsoluteUri, @@ -53,6 +51,8 @@ defineSuite([ Cesium3DTileContentState, Cesium3DTileRefine, Cesium3DTileStyle, + ClippingPlane, + ClippingPlaneCollection, CullFace, Cesium3DTilesTester, createScene, diff --git a/Specs/Scene/ClippingPlaneCollectionSpec.js b/Specs/Scene/ClippingPlaneCollectionSpec.js index c247d944de4c..06f1ea3099a7 100644 --- a/Specs/Scene/ClippingPlaneCollectionSpec.js +++ b/Specs/Scene/ClippingPlaneCollectionSpec.js @@ -49,7 +49,7 @@ defineSuite([ function decodeUint8Plane(pixel1, pixel2) { // expect pixel1 to be the normal - var normal = AttributeCompression.octDecodeFromCartesian4(pixel1.x, pixel1.y, pixel1.z, pixel1.w, new Cartesian3()); + var normal = AttributeCompression.octDecodeFromCartesian4(pixel1, new Cartesian3()); // expect pixel2 to be the distance var distance = Cartesian4.unpackFloat(pixel2); diff --git a/Specs/Scene/GlobeSurfaceTileProviderSpec.js b/Specs/Scene/GlobeSurfaceTileProviderSpec.js index dbaa8025d00b..fd672b422cca 100644 --- a/Specs/Scene/GlobeSurfaceTileProviderSpec.js +++ b/Specs/Scene/GlobeSurfaceTileProviderSpec.js @@ -2,8 +2,6 @@ defineSuite([ 'Scene/GlobeSurfaceTileProvider', 'Core/Cartesian3', 'Core/CesiumTerrainProvider', - 'Scene/ClippingPlane', - 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/Credit', 'Core/defined', @@ -16,6 +14,8 @@ defineSuite([ 'Renderer/ContextLimits', 'Renderer/RenderState', 'Scene/BlendingState', + 'Scene/ClippingPlane', + 'Scene/ClippingPlaneCollection', 'Scene/Fog', 'Scene/Globe', 'Scene/GlobeSurfaceShaderSet', @@ -33,8 +33,6 @@ defineSuite([ GlobeSurfaceTileProvider, Cartesian3, CesiumTerrainProvider, - ClippingPlane, - ClippingPlaneCollection, Color, Credit, defined, @@ -47,6 +45,8 @@ defineSuite([ ContextLimits, RenderState, BlendingState, + ClippingPlane, + ClippingPlaneCollection, Fog, Globe, GlobeSurfaceShaderSet, diff --git a/Specs/Scene/Instanced3DModel3DTileContentSpec.js b/Specs/Scene/Instanced3DModel3DTileContentSpec.js index e5b28e8f24d3..4f3521bbbb85 100644 --- a/Specs/Scene/Instanced3DModel3DTileContentSpec.js +++ b/Specs/Scene/Instanced3DModel3DTileContentSpec.js @@ -1,7 +1,5 @@ defineSuite([ 'Core/Cartesian3', - 'Scene/ClippingPlane', - 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/HeadingPitchRange', 'Core/HeadingPitchRoll', @@ -9,11 +7,11 @@ defineSuite([ 'Scene/TileBoundingSphere', 'Specs/Cesium3DTilesTester', 'Specs/createScene', + 'Scene/ClippingPlane', + 'Scene/ClippingPlaneCollection', 'Scene/Model' ], 'Scene/Instanced3DModel3DTileContent', function( Cartesian3, - ClippingPlane, - ClippingPlaneCollection, Color, HeadingPitchRange, HeadingPitchRoll, @@ -21,6 +19,8 @@ defineSuite([ TileBoundingSphere, Cesium3DTilesTester, createScene, + ClippingPlane, + ClippingPlaneCollection, Model) { 'use strict'; diff --git a/Specs/Scene/ModelSpec.js b/Specs/Scene/ModelSpec.js index fd8a41efa64b..ef402d3f9d58 100644 --- a/Specs/Scene/ModelSpec.js +++ b/Specs/Scene/ModelSpec.js @@ -3,8 +3,6 @@ defineSuite([ 'Core/Cartesian3', 'Core/Cartesian4', 'Core/CesiumTerrainProvider', - 'Scene/ClippingPlane', - 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/combine', 'Core/defaultValue', @@ -28,6 +26,8 @@ defineSuite([ 'Renderer/RenderState', 'Renderer/ShaderSource', 'Scene/Axis', + 'Scene/ClippingPlane', + 'Scene/ClippingPlaneCollection', 'Scene/ColorBlendMode', 'Scene/DracoLoader', 'Scene/HeightReference', @@ -40,8 +40,6 @@ defineSuite([ Cartesian3, Cartesian4, CesiumTerrainProvider, - ClippingPlane, - ClippingPlaneCollection, Color, combine, defaultValue, @@ -65,6 +63,8 @@ defineSuite([ RenderState, ShaderSource, Axis, + ClippingPlane, + ClippingPlaneCollection, ColorBlendMode, DracoLoader, HeightReference, diff --git a/Specs/Scene/PointCloud3DTileContentSpec.js b/Specs/Scene/PointCloud3DTileContentSpec.js index cadd4d6946a0..bb4064d13c22 100644 --- a/Specs/Scene/PointCloud3DTileContentSpec.js +++ b/Specs/Scene/PointCloud3DTileContentSpec.js @@ -1,7 +1,5 @@ defineSuite([ 'Core/Cartesian3', - 'Scene/ClippingPlane', - 'Scene/ClippingPlaneCollection', 'Core/Color', 'Core/ComponentDatatype', 'Core/defined', @@ -13,6 +11,8 @@ defineSuite([ 'Core/Transforms', 'Renderer/Pass', 'Scene/Cesium3DTileStyle', + 'Scene/ClippingPlane', + 'Scene/ClippingPlaneCollection', 'Scene/Expression', 'Specs/Cesium3DTilesTester', 'Specs/createCanvas', @@ -20,8 +20,6 @@ defineSuite([ 'ThirdParty/when' ], 'Scene/PointCloud3DTileContent', function( Cartesian3, - ClippingPlane, - ClippingPlaneCollection, Color, ComponentDatatype, defined, @@ -33,6 +31,8 @@ defineSuite([ Transforms, Pass, Cesium3DTileStyle, + ClippingPlane, + ClippingPlaneCollection, Expression, Cesium3DTilesTester, createCanvas, From afc6f86560c1b9b22273ec4233a785eb25e0165c Mon Sep 17 00:00:00 2001 From: hpinkos Date: Thu, 15 Mar 2018 10:26:45 -0400 Subject: [PATCH 21/38] Fix specs --- Specs/Core/ClippingPlaneCollectionSpec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Specs/Core/ClippingPlaneCollectionSpec.js b/Specs/Core/ClippingPlaneCollectionSpec.js index 9c41233a59ce..d740d3273a94 100644 --- a/Specs/Core/ClippingPlaneCollectionSpec.js +++ b/Specs/Core/ClippingPlaneCollectionSpec.js @@ -259,6 +259,9 @@ defineSuite([ // One RGBA uint8 clipping plane consume 2 pixels of texture, allocation to be double that expect(packedTexture.width).toEqual(4); expect(packedTexture.height).toEqual(1); + + clippingPlanes.destroy(); + scene.destroyForSpecs(); }); }); @@ -388,6 +391,9 @@ defineSuite([ // One RGBA float clipping plane consume 1 pixels of texture, allocation to be double that expect(packedTexture.width).toEqual(2); expect(packedTexture.height).toEqual(1); + + clippingPlanes.destroy(); + scene.destroyForSpecs(); }); }); From 345ea4ea3758375fc37c4f6eb73fdd1c47dcc951 Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Thu, 15 Mar 2018 10:31:16 -0400 Subject: [PATCH 22/38] Model instancing demo should animate. --- .../development/3D Models Instancing.html | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Apps/Sandcastle/gallery/development/3D Models Instancing.html b/Apps/Sandcastle/gallery/development/3D Models Instancing.html index d2596f92bc42..b759bbcc51d7 100644 --- a/Apps/Sandcastle/gallery/development/3D Models Instancing.html +++ b/Apps/Sandcastle/gallery/development/3D Models Instancing.html @@ -2,7 +2,7 @@ - + @@ -10,10 +10,12 @@ @@ -27,8 +29,9 @@ function startup(Cesium) { 'use strict'; //Sandcastle_Begin - -var viewer = new Cesium.Viewer('cesiumContainer'); +var viewer = new Cesium.Viewer('cesiumContainer', { + shouldAnimate: true +}); var scene = viewer.scene; var context = scene.context; var camera = viewer.camera; @@ -247,7 +250,7 @@ }); //Sandcastle_End -Sandcastle.finishedLoading(); + Sandcastle.finishedLoading(); } if (typeof Cesium !== "undefined") { startup(Cesium); From 996cd2b66a5e8c6cf69caa9b46fc7570770f55dc Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Thu, 15 Mar 2018 11:28:07 -0400 Subject: [PATCH 23/38] cleanup some requires that were missed --- CHANGES.md | 2 +- Source/Scene/ClippingPlaneCollection.js | 8 ++++---- Source/Scene/GlobeSurfaceShaderSet.js | 8 ++++---- Specs/Scene/ClippingPlaneCollectionSpec.js | 8 ++++---- Specs/Scene/SceneSpec.js | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 61de7eecedb9..3df57249cb55 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,9 +13,9 @@ Change Log * Removed the 6-clipping-plane limit. * Added support for Internet Explorer. * Added a `ClippingPlane` object to be used with `ClippingPlaneCollection`. + * Added 3D Tiles use-case to Terrain Clipping Planes Sandcastle * Updated `WebMapServiceImageryProvider` so it can take an srs or crs string to pass to the resource query parameters based on the WMS version. [#6223](https://github.com/AnalyticalGraphicsInc/cesium/issues/6223) * Added a multi-part CZML example to Sandcastle. [#6320](https://github.com/AnalyticalGraphicsInc/cesium/pull/6320) -* Added 3D Tiles use-case to Terrain Clipping Planes Sandcastle ##### Fixes :wrench: * Fixed support of glTF-supplied tangent vectors. [#6302](https://github.com/AnalyticalGraphicsInc/cesium/pull/6302) diff --git a/Source/Scene/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js index f618463bbd8d..e74efca68519 100644 --- a/Source/Scene/ClippingPlaneCollection.js +++ b/Source/Scene/ClippingPlaneCollection.js @@ -5,7 +5,6 @@ define([ '../Core/Cartesian4', '../Core/Math', '../Core/Check', - '../Scene/ClippingPlane', '../Core/Color', '../Core/defaultValue', '../Core/defined', @@ -24,7 +23,8 @@ define([ '../Renderer/Texture', '../Renderer/TextureMagnificationFilter', '../Renderer/TextureMinificationFilter', - '../Renderer/TextureWrap' + '../Renderer/TextureWrap', + './ClippingPlane' ], function( AttributeCompression, Cartesian2, @@ -32,7 +32,6 @@ define([ Cartesian4, CesiumMath, Check, - ClippingPlane, Color, defaultValue, defined, @@ -51,7 +50,8 @@ define([ Texture, TextureMagnificationFilter, TextureMinificationFilter, - TextureWrap) { + TextureWrap, + ClippingPlane) { 'use strict'; /** diff --git a/Source/Scene/GlobeSurfaceShaderSet.js b/Source/Scene/GlobeSurfaceShaderSet.js index 0c6e9659006d..8bf8b1716215 100644 --- a/Source/Scene/GlobeSurfaceShaderSet.js +++ b/Source/Scene/GlobeSurfaceShaderSet.js @@ -3,17 +3,17 @@ define([ '../Core/destroyObject', '../Core/TerrainQuantization', '../Renderer/ShaderProgram', - '../Scene/SceneMode', './ClippingPlaneCollection', - './getClippingFunction' + './getClippingFunction', + './SceneMode' ], function( defined, destroyObject, TerrainQuantization, ShaderProgram, - SceneMode, ClippingPlaneCollection, - getClippingFunction) { + getClippingFunction, + SceneMode) { 'use strict'; function GlobeSurfaceShader(numberOfDayTextures, flags, material, shaderProgram, clippingShaderState) { diff --git a/Specs/Scene/ClippingPlaneCollectionSpec.js b/Specs/Scene/ClippingPlaneCollectionSpec.js index 06f1ea3099a7..7aabe0d4d971 100644 --- a/Specs/Scene/ClippingPlaneCollectionSpec.js +++ b/Specs/Scene/ClippingPlaneCollectionSpec.js @@ -5,7 +5,6 @@ defineSuite([ 'Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartesian4', - 'Scene/ClippingPlane', 'Core/Color', 'Core/Math', 'Core/PixelFormat', @@ -16,7 +15,8 @@ defineSuite([ 'Specs/createScene', 'Renderer/TextureMagnificationFilter', 'Renderer/TextureMinificationFilter', - 'Renderer/TextureWrap' + 'Renderer/TextureWrap', + 'Scene/ClippingPlane' ], function( ClippingPlaneCollection, AttributeCompression, @@ -24,7 +24,6 @@ defineSuite([ Cartesian2, Cartesian3, Cartesian4, - ClippingPlane, Color, CesiumMath, PixelFormat, @@ -35,7 +34,8 @@ defineSuite([ createScene, TextureMagnificationFilter, TextureMinificationFilter, - TextureWrap) { + TextureWrap, + ClippingPlane) { 'use strict'; var clippingPlanes; diff --git a/Specs/Scene/SceneSpec.js b/Specs/Scene/SceneSpec.js index 43783f889c5b..37e8ed40d8e2 100644 --- a/Specs/Scene/SceneSpec.js +++ b/Specs/Scene/SceneSpec.js @@ -1,4 +1,5 @@ defineSuite([ + 'Scene/Scene', 'Core/BoundingSphere', 'Core/Cartesian2', 'Core/Cartesian3', @@ -34,7 +35,6 @@ defineSuite([ 'Scene/Material', 'Scene/Primitive', 'Scene/PrimitiveCollection', - 'Scene/Scene', 'Scene/SceneTransforms', 'Scene/ScreenSpaceCameraController', 'Scene/TweenCollection', @@ -42,7 +42,8 @@ defineSuite([ 'Specs/createScene', 'Specs/pollToPromise', 'Specs/render' - ], 'Scene/Scene', function( + ], function( + Scene, BoundingSphere, Cartesian2, Cartesian3, @@ -78,7 +79,6 @@ defineSuite([ Material, Primitive, PrimitiveCollection, - Scene, SceneTransforms, ScreenSpaceCameraController, TweenCollection, From e5f2e7baf641210ac58ee15d44ee58c928bf2c0d Mon Sep 17 00:00:00 2001 From: hpinkos Date: Thu, 15 Mar 2018 16:08:45 -0400 Subject: [PATCH 24/38] cleanup after review --- Source/Core/DoublyLinkedList.js | 17 +++++------- Source/Core/LRUCache.js | 48 ++++++++++++++++----------------- Source/Core/sampleTerrain.js | 2 +- Specs/Core/LRUCacheSpec.js | 18 ++++++------- 4 files changed, 41 insertions(+), 44 deletions(-) diff --git a/Source/Core/DoublyLinkedList.js b/Source/Core/DoublyLinkedList.js index 36bc64966bde..fe3ef7c67aad 100644 --- a/Source/Core/DoublyLinkedList.js +++ b/Source/Core/DoublyLinkedList.js @@ -6,12 +6,6 @@ define([ defineProperties) { 'use strict'; - function DoublyLinkedListNode(item, previous, next) { - this.item = item; - this.previous = previous; - this.next = next; - } - /** * @private */ @@ -29,6 +23,12 @@ define([ } }); + function DoublyLinkedListNode(item, previous, next) { + this.item = item; + this.previous = previous; + this.next = next; + } + /** * Adds the item to the end of the list * @param {Object} [item] @@ -41,7 +41,6 @@ define([ this.tail.next = node; this.tail = node; } else { - // Insert into empty linked list this.head = node; this.tail = node; } @@ -63,7 +62,6 @@ define([ this.head.previous = node; this.head = node; } else { - // Insert into empty linked list this.head = node; this.tail = node; } @@ -147,9 +145,8 @@ define([ return; } - var i; var node = this.head; - for (i = 0; i < startIndex; i++) { + for (var i = 0; i < startIndex; ++i) { node = node.next; } diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index 25cf6febde14..84815ce281ee 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -1,17 +1,15 @@ define([ - './defined', - './defineProperties', - './getTimestamp', - './requestAnimationFrame', - './DeveloperError', - './DoublyLinkedList' -], function( - defined, - defineProperties, - getTimestamp, - requestAnimationFrame, - DeveloperError, - DoublyLinkedList) { + './defined', + './defineProperties', + './getTimestamp', + './DeveloperError', + './DoublyLinkedList' + ], function( + defined, + defineProperties, + getTimestamp, + DeveloperError, + DoublyLinkedList) { 'use strict'; function prune(cache) { @@ -45,23 +43,24 @@ define([ } function checkExpiration(cache) { + if (defined(cache._interval)) { + return; + } function loop() { if (!cache._hasExpiration || cache.length === 0) { - cache._expirationLoopRunning = false; + clearInterval(cache._interval); + cache._interval = undefined; return; } - cache._expirationLoopRunning = true; - prune(cache); - if (cache.length > 0) { - requestAnimationFrame(loop); - } else { - cache._expirationLoopRunning = false; + if (cache.length === 0) { + clearInterval(cache._interval); + cache._interval = undefined; } } - loop(); + cache._interval = setInterval(loop, 1000); } function Item(key, value) { @@ -78,8 +77,9 @@ define([ * A cache for storing key-value pairs * @param {Number} [capacity] The capacity of the cache. If undefined, the size will be unlimited. * @param {Number} [expiration] The number of milliseconds before an item in the cache expires and will be discarded when LRUCache.prune is called. If undefined, items do not expire. - * @alias AssociativeArray + * @alias LRUCache * @constructor + * @private */ function LRUCache(capacity, expiration) { this._list = new DoublyLinkedList(); @@ -89,7 +89,7 @@ define([ this._hasExpiration = defined(expiration); this._expiration = expiration; - this._expirationLoopRunning = false; + this._interval = undefined; } defineProperties(LRUCache.prototype, { @@ -150,7 +150,7 @@ define([ item = new Item(key, value); node = list.addFront(item); hash[key] = node; - if (this._hasExpiration && !this._expirationLoopRunning) { + if (this._hasExpiration) { LRUCache._checkExpiration(this); } if (this._hasCapacity && list.length > this._capacity) { diff --git a/Source/Core/sampleTerrain.js b/Source/Core/sampleTerrain.js index ce8358c00b3c..3d2d9e8af403 100644 --- a/Source/Core/sampleTerrain.js +++ b/Source/Core/sampleTerrain.js @@ -101,7 +101,7 @@ define([ requestPromise = tileRequest.terrainProvider.requestTileGeometry(tileRequest.x, tileRequest.y, tileRequest.level); cache.set(cacheKey, requestPromise); } - var tilePromise = when(requestPromise) + var tilePromise = requestPromise .then(createInterpolateFunction(tileRequest)) .otherwise(createMarkFailedFunction(tileRequest)); tilePromises.push(tilePromise); diff --git a/Specs/Core/LRUCacheSpec.js b/Specs/Core/LRUCacheSpec.js index 4045734095f0..c53c723fbc5a 100644 --- a/Specs/Core/LRUCacheSpec.js +++ b/Specs/Core/LRUCacheSpec.js @@ -1,9 +1,9 @@ defineSuite([ - 'Core/LRUCache', - 'Core/getTimestamp' -], function( - LRUCache, - getTimestamp) { + 'Core/LRUCache', + 'Core/getTimestamp' + ], function( + LRUCache, + getTimestamp) { 'use strict'; it('can manipulate values', function() { @@ -24,16 +24,16 @@ defineSuite([ }); it('set throws with undefined key', function() { - var associativeArray = new LRUCache(); + var cache = new LRUCache(); expect(function() { - associativeArray.set(undefined, 1); + cache.set(undefined, 1); }).toThrowDeveloperError(); }); it('get throws with undefined key', function() { - var associativeArray = new LRUCache(); + var cache = new LRUCache(); expect(function() { - associativeArray.get(undefined); + cache.get(undefined); }).toThrowDeveloperError(); }); From fd1bc9963b2f7e4653f08cbfa486ede3a9bb6488 Mon Sep 17 00:00:00 2001 From: Hannah Date: Thu, 15 Mar 2018 16:29:39 -0400 Subject: [PATCH 25/38] move private functions --- Source/Core/LRUCache.js | 124 ++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index 84815ce281ee..a72012b8073e 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -12,67 +12,6 @@ define([ DoublyLinkedList) { 'use strict'; - function prune(cache) { - var currentTime = getTimestamp(); - var pruneAfter = currentTime - cache._expiration; - - var list = cache._list; - var node = list.tail; - var index = list.length; - while (defined(node) && node.item.timestamp < pruneAfter) { - node = node.previous; - index--; - } - - if (node === list.tail) { - return; - } - - if (!defined(node)) { - node = list.head; - } else { - node = node.next; - } - - while (defined(node)) { - delete cache._hash[node.item.key]; - node = node.next; - } - - list.removeAfter(index); - } - - function checkExpiration(cache) { - if (defined(cache._interval)) { - return; - } - function loop() { - if (!cache._hasExpiration || cache.length === 0) { - clearInterval(cache._interval); - cache._interval = undefined; - return; - } - - prune(cache); - - if (cache.length === 0) { - clearInterval(cache._interval); - cache._interval = undefined; - } - } - cache._interval = setInterval(loop, 1000); - } - - function Item(key, value) { - this.key = key; - this.value = value; - this.timestamp = getTimestamp(); - } - - Item.prototype.touch = function() { - this.timestamp = getTimestamp(); - }; - /** * A cache for storing key-value pairs * @param {Number} [capacity] The capacity of the cache. If undefined, the size will be unlimited. @@ -127,7 +66,7 @@ define([ return item.value; } }; - + /** * Associates the provided key with the provided value. If the key already * exists, it is overwritten with the new value. @@ -165,6 +104,67 @@ define([ list.moveToFront(node); } }; + + function prune(cache) { + var currentTime = getTimestamp(); + var pruneAfter = currentTime - cache._expiration; + + var list = cache._list; + var node = list.tail; + var index = list.length; + while (defined(node) && node.item.timestamp < pruneAfter) { + node = node.previous; + index--; + } + + if (node === list.tail) { + return; + } + + if (!defined(node)) { + node = list.head; + } else { + node = node.next; + } + + while (defined(node)) { + delete cache._hash[node.item.key]; + node = node.next; + } + + list.removeAfter(index); + } + + function checkExpiration(cache) { + if (defined(cache._interval)) { + return; + } + function loop() { + if (!cache._hasExpiration || cache.length === 0) { + clearInterval(cache._interval); + cache._interval = undefined; + return; + } + + prune(cache); + + if (cache.length === 0) { + clearInterval(cache._interval); + cache._interval = undefined; + } + } + cache._interval = setInterval(loop, 1000); + } + + function Item(key, value) { + this.key = key; + this.value = value; + this.timestamp = getTimestamp(); + } + + Item.prototype.touch = function() { + this.timestamp = getTimestamp(); + }; //exposed for testing LRUCache._checkExpiration = checkExpiration; From b0c757598b9e229f2785f4cfafafe46b42907946 Mon Sep 17 00:00:00 2001 From: Hannah Date: Thu, 15 Mar 2018 16:30:07 -0400 Subject: [PATCH 26/38] fix indent --- Source/Core/LRUCache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index a72012b8073e..cc19d535b25a 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -105,7 +105,7 @@ define([ } }; - function prune(cache) { + function prune(cache) { var currentTime = getTimestamp(); var pruneAfter = currentTime - cache._expiration; From 4ec3576a1af33b8a8b07584b9f080123d56cf7f2 Mon Sep 17 00:00:00 2001 From: Hannah Date: Thu, 15 Mar 2018 17:08:38 -0400 Subject: [PATCH 27/38] fix eslint --- Source/Core/LRUCache.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index cc19d535b25a..9478801d6146 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -66,7 +66,7 @@ define([ return item.value; } }; - + /** * Associates the provided key with the provided value. If the key already * exists, it is overwritten with the new value. @@ -104,7 +104,7 @@ define([ list.moveToFront(node); } }; - + function prune(cache) { var currentTime = getTimestamp(); var pruneAfter = currentTime - cache._expiration; From a231a5e2668ba753197bf70637f8dcb65eb5f9c2 Mon Sep 17 00:00:00 2001 From: GRMWeb Date: Fri, 16 Mar 2018 00:26:09 -0700 Subject: [PATCH 28/38] Undid changes to protbuf-minimal.js --- Source/ThirdParty/protobuf-minimal.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/ThirdParty/protobuf-minimal.js b/Source/ThirdParty/protobuf-minimal.js index e8246a9ec968..1cb8e3c8aa6f 100644 --- a/Source/ThirdParty/protobuf-minimal.js +++ b/Source/ThirdParty/protobuf-minimal.js @@ -502,6 +502,7 @@ protobuf.configure = configure; /* istanbul ignore next */ /** * Reconfigures the library according to the environment. + * @returns {undefined} */ function configure() { protobuf.Reader._configure(protobuf.BufferReader); @@ -1064,6 +1065,7 @@ var rpc = exports; * @param {Method|rpc.ServiceMethod} method Reflected or static method being called * @param {Uint8Array} requestData Request data * @param {RPCImplCallback} callback Callback function + * @returns {undefined} * @example * function rpcImpl(method, requestData, callback) { * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code @@ -1080,6 +1082,7 @@ var rpc = exports; * @type {function} * @param {?Error} error Error, if any, otherwise `null` * @param {?Uint8Array} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} */ rpc.Service = require(11); @@ -1101,6 +1104,7 @@ var util = require(13); * @type {function} * @param {?Error} error Error, if any * @param {?Message} [response] Response message + * @returns {undefined} */ /** @@ -1167,6 +1171,7 @@ function Service(rpcImpl, requestDelimited, responseDelimited) { * @param {function} responseCtor Response constructor * @param {Message|Object.} request Request message or plain object * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} */ Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { @@ -1747,6 +1752,7 @@ util.oneOfSetter = function setOneOf(fieldNames) { /** * @param {string} name Field name + * @returns {undefined} * @this Object * @ignore */ @@ -1761,6 +1767,7 @@ util.oneOfSetter = function setOneOf(fieldNames) { * Lazily resolves fully qualified type names against the specified root. * @param {Root} root Root instanceof * @param {Object.} lazyTypes Type names + * @returns {undefined} */ util.lazyResolve = function lazyResolve(root, lazyTypes) { for (var i = 0; i < lazyTypes.length; ++i) { From a045e3f1e966b7db227096cbc3799a0564330b22 Mon Sep 17 00:00:00 2001 From: gabriel-macario Date: Tue, 13 Mar 2018 01:24:34 -0700 Subject: [PATCH 29/38] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bc6872cb7891..dfb1c7467694 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -172,3 +172,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Y.Selim Abidin](https://github.com/SelimAbidin) * [Tamar Cohen](https://github.com/tamarmot) * [Stephen Wiseman](https://github.com/srwiseman) +* [Gabriel Macario](https://githubc.com/gabriel-macario) From dc0d99702df35ce7213ec32b548e55d4e033c4e6 Mon Sep 17 00:00:00 2001 From: gabriel-macario Date: Tue, 13 Mar 2018 01:24:59 -0700 Subject: [PATCH 30/38] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index dfb1c7467694..a02f46bd13fd 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -172,4 +172,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu * [Y.Selim Abidin](https://github.com/SelimAbidin) * [Tamar Cohen](https://github.com/tamarmot) * [Stephen Wiseman](https://github.com/srwiseman) -* [Gabriel Macario](https://githubc.com/gabriel-macario) +* [Gabriel Macario](https://github.com/gabriel-macario) From 910b6eefdf5b6fcec86d09380f30e7c065bba43a Mon Sep 17 00:00:00 2001 From: GRMWeb Date: Fri, 16 Mar 2018 00:45:19 -0700 Subject: [PATCH 31/38] Removed an errant space. Undid changes to protobuf-minimal.js. --- Source/ThirdParty/protobuf-minimal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ThirdParty/protobuf-minimal.js b/Source/ThirdParty/protobuf-minimal.js index 1cb8e3c8aa6f..7719d7e6c2bb 100644 --- a/Source/ThirdParty/protobuf-minimal.js +++ b/Source/ThirdParty/protobuf-minimal.js @@ -1171,7 +1171,7 @@ function Service(rpcImpl, requestDelimited, responseDelimited) { * @param {function} responseCtor Response constructor * @param {Message|Object.} request Request message or plain object * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} + * @returns {undefined} */ Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { From 7ecbbc048c032632460e82c303ff9415c43c369a Mon Sep 17 00:00:00 2001 From: Hannah Date: Fri, 16 Mar 2018 13:48:12 -0400 Subject: [PATCH 32/38] whitespace --- Source/Scene/ClippingPlaneCollection.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/Scene/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js index 32f82faee55f..4f89ca439d7d 100644 --- a/Source/Scene/ClippingPlaneCollection.js +++ b/Source/Scene/ClippingPlaneCollection.js @@ -712,8 +712,6 @@ define([ * isDestroyed will result in a {@link DeveloperError} exception. Therefore, * assign the return value (undefined) to the object as done in the example. * - * - * * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called. * * From 30c047ed67e2e736560d24abe971d1e6ec507884 Mon Sep 17 00:00:00 2001 From: Scott Hunter Date: Fri, 16 Mar 2018 15:27:18 -0400 Subject: [PATCH 33/38] Share Sandcastle code using URL instead of gists. Anonymous gist creation will be removed - #6232 Instead of publishing gists, when we share we now encode the code into the URL fragment, in compressed Base64 encoded form. (see code comments for the exact format) Existing gists still load as before. --- Apps/Sandcastle/CesiumSandcastle.js | 197 +++++++++----------- Apps/Sandcastle/ThirdParty/clipboard.min.js | 7 + Apps/Sandcastle/ThirdParty/pako.LICENSE | 21 +++ Apps/Sandcastle/ThirdParty/pako.min.js | 1 + Apps/Sandcastle/gallery/3D Models.html | 12 +- Apps/Sandcastle/index.html | 9 +- 6 files changed, 129 insertions(+), 118 deletions(-) create mode 100644 Apps/Sandcastle/ThirdParty/clipboard.min.js create mode 100644 Apps/Sandcastle/ThirdParty/pako.LICENSE create mode 100644 Apps/Sandcastle/ThirdParty/pako.min.js diff --git a/Apps/Sandcastle/CesiumSandcastle.js b/Apps/Sandcastle/CesiumSandcastle.js index 23101ff5285d..451edefc6d86 100644 --- a/Apps/Sandcastle/CesiumSandcastle.js +++ b/Apps/Sandcastle/CesiumSandcastle.js @@ -3,26 +3,29 @@ /*global hello_world_index*/// defined in gallery/gallery-index.js, created by build /*global sandcastleJsHintOptions*/// defined by jsHintOptions.js, created by build require({ - baseUrl : '../../Source', - packages : [{ - name : 'dojo', - location : '../ThirdParty/dojo-release-1.10.4/dojo' + baseUrl: '../../Source', + packages: [{ + name: 'dojo', + location: '../ThirdParty/dojo-release-1.10.4/dojo' }, { - name : 'dijit', - location : '../ThirdParty/dojo-release-1.10.4/dijit' + name: 'dijit', + location: '../ThirdParty/dojo-release-1.10.4/dijit' }, { - name : 'Sandcastle', - location : '../Apps/Sandcastle' + name: 'Sandcastle', + location: '../Apps/Sandcastle' }, { - name : 'Source', - location : '.' + name: 'Source', + location: '.' }, { name: 'CesiumUnminified', - location : '../Build/CesiumUnminified', + location: '../Build/CesiumUnminified', main: 'Cesium' }, { - name : 'CodeMirror', - location : '../ThirdParty/codemirror-4.6' + name: 'CodeMirror', + location: '../ThirdParty/codemirror-4.6' + }, { + name: 'ThirdParty', + location: '../Apps/Sandcastle/ThirdParty' }] }, [ "dijit/Dialog", @@ -48,9 +51,10 @@ require({ 'dojo/when', 'Sandcastle/LinkButton', 'Source/Core/defined', - 'Source/Core/getBaseUri', 'Source/Core/Resource', 'Source/Cesium', + 'ThirdParty/pako.min', + 'ThirdParty/clipboard.min', 'CodeMirror/addon/hint/show-hint', 'CodeMirror/addon/hint/javascript-hint', 'CodeMirror/mode/javascript/javascript', @@ -94,12 +98,16 @@ require({ when, LinkButton, defined, - getBaseUri, Resource, - Cesium + Cesium, + pako, + ClipboardJS ) { 'use strict'; + // attach clipboard handling to our Copy button + var clipboardjs = new ClipboardJS('.copyButton'); + //In order for CodeMirror auto-complete to work, Cesium needs to be defined as a global. if (!defined(window.Cesium)) { window.Cesium = Cesium; @@ -176,12 +184,6 @@ require({ var newDemo; var demoHtml = ''; var demoCode = ''; - var previousCode = ''; - var previousHtml = ''; - var runGist = false; - var gistCode; - var gistHtml; - var sandcastleUrl = ''; var defaultHtml = '\n
\n

Loading...

\n
'; @@ -696,18 +698,14 @@ require({ } var queryObject = {}; - 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)) { - queryObject.gistId = gistId; - } - } else { + } + if (!defined(queryObject.src)) { queryObject.src = 'Hello World.html'; + } + if (!defined(queryObject.label)) { queryObject.label = 'Showcases'; - if (defined(gistId)) { - queryObject.gistId = gistId; - } } function loadFromGallery(demo) { @@ -716,13 +714,6 @@ require({ registry.byId('description').set('value', decodeHTML(demo.description).replace(/\\n/g, '\n')); registry.byId('label').set('value', decodeHTML(demo.label).replace(/\\n/g, '\n')); - if (demo.name === 'Gist Import') { - jsEditor.setValue(gistCode); - htmlEditor.setValue(gistHtml); - document.title = 'Gist Import - Cesium Sandcastle'; - CodeMirror.commands.runCesium(jsEditor); - return; - } return requestDemo(demo.name).then(function(value) { demo.code = value; @@ -744,45 +735,52 @@ require({ var scriptCode = scriptMatch[1]; demoCode = scriptCode.replace(/\s/g, ''); - if (defined(queryObject.gistId)) { - Resource.fetchJsonp('https://api.github.com/gists/' + queryObject.gistId + '?access_token=dd8f755c2e5d9bbb26806bb93eaa2291f2047c60') + function applyLoadedDemo(code, html) { + jsEditor.setValue(code); + htmlEditor.setValue(html); + demoCode = code.replace(/\s/g, ''); + demoHtml = html.replace(/\s/g, ''); + CodeMirror.commands.runCesium(jsEditor); + clearRun(); + } + + var json, code, html; + if (defined(queryObject.gist)) { + Resource.fetchJsonp('https://api.github.com/gists/' + queryObject.gist + '?access_token=dd8f755c2e5d9bbb26806bb93eaa2291f2047c60') .then(function(data) { var files = data.data.files; var code = files['Cesium-Sandcastle.js'].content; var htmlFile = files['Cesium-Sandcastle.html']; var html = defined(htmlFile) ? htmlFile.content : defaultHtml; // Use the default html for old gists - jsEditor.setValue(code); - htmlEditor.setValue(html); - demoCode = code.replace(/\s/g, ''); - demoHtml = html.replace(/\s/g, ''); - gistCode = code; - gistHtml = html; - previousCode = code; - previousHtml = html; - sandcastleUrl = getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&gist=' + gistId; - CodeMirror.commands.runCesium(jsEditor); - clearRun(); + applyLoadedDemo(code, html); }).otherwise(function(error) { - appendConsole('consoleError', 'Unable to GET from GitHub API. This could be due to too many request, try again in an hour or copy and paste the code from the gist: https://gist.github.com/' + gistId , true); + appendConsole('consoleError', 'Unable to GET from GitHub API. This could be due to too many request, try again in an hour or copy and paste the code from the gist: https://gist.github.com/' + queryObject.gist , true); console.log(error); }); } else if (defined(queryObject.code)) { //The code query parameter is a Base64 encoded JSON string with `code` and `html` properties. - var json = JSON.parse(window.atob(queryObject.code)); - var code = json.code; - var html = json.html; - - jsEditor.setValue(code); - htmlEditor.setValue(html); - demoCode = code.replace(/\s/g, ''); - demoHtml = html.replace(/\s/g, ''); - gistCode = code; - gistHtml = html; - previousCode = code; - previousHtml = html; - sandcastleUrl = getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&code=' + code; - CodeMirror.commands.runCesium(jsEditor); - clearRun(); + json = JSON.parse(window.atob(queryObject.code)); + code = json.code; + html = json.html; + + applyLoadedDemo(code, html); + } else if (window.location.hash.indexOf('#c=') === 0) { + // data stored in the hash as: + // Base64 encoded, raw DEFLATE compressed JSON array where index 0 is code, index 1 is html + var base64String = window.location.hash.substr(3); + // restore padding + while (base64String.length % 4 !== 0) { + base64String += '='; + } + var jsonString = pako.inflate(atob(base64String), { raw: true, to: 'string' }); + // we save a few bytes by omitting the leading [" and trailing "] since they are always the same + jsonString = '["' + jsonString + '"]'; + json = JSON.parse(jsonString); + // index 0 is code, index 1 is html + code = json[0]; + html = json[1]; + + applyLoadedDemo(code, html); } else { jsEditor.setValue(scriptCode); } @@ -932,49 +930,36 @@ require({ } } + function getBaseUrl() { + // omits query string and hash + return location.protocol + '//' + location.host + location.pathname; + } + registry.byId('buttonShareDrop').on('click', function() { - var textArea = document.getElementById('link'); - textArea.value = '\n\n'; var code = jsEditor.getValue(); var html = htmlEditor.getValue(); - if (code === previousCode && html === previousHtml) { - textArea.value = sandcastleUrl; - textArea.select(); - return; - } - previousCode = code; - previousHtml = html; - var data = { - public : true, - files : { - 'Cesium-Sandcastle.js' : { - content : code - }, - 'Cesium-Sandcastle.html' : { - content : html - } - } - }; - var resource = new Resource('https://api.github.com/gists'); - return resource.post(JSON.stringify(data)).then(function(content) { - sandcastleUrl = getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&gist=' + JSON.parse(content).id; - textArea.value = sandcastleUrl; - textArea.select(); - }).otherwise(function(error) { - appendConsole('consoleError', 'Unable to POST to GitHub API. This could be due to too many POST requests, try again in an hour.', true); - console.log(error); - }); + // data stored in the hash as: + // Base64 encoded, raw DEFLATE compressed JSON array where index 0 is code, index 1 is html + var jsonString = JSON.stringify([code, html]); + // we save a few bytes by omitting the leading [" and trailing "] since they are always the same + jsonString = jsonString.substr(2, jsonString.length - 4); + var base64String = btoa(pako.deflate(jsonString, { raw: true, to: 'string', level: 9 })); + base64String = base64String.replace(/\=+$/, ''); // remove padding + + var shareUrlBox = document.getElementById('shareUrl'); + shareUrlBox.value = getBaseUrl() + '#c=' + base64String; + shareUrlBox.select(); }); registry.byId('buttonImport').on('click', function() { - gistId = document.getElementById("gistId").value; + var gistId = document.getElementById("gistId").value; var gistParameter = '&gist='; var gistIndex = gistId.indexOf(gistParameter); if (gistIndex !== -1) { gistId = gistId.substring(gistIndex + gistParameter.length); } - window.location.href = getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&gist=' + gistId; + window.location.href = getBaseUrl() + '?gist=' + gistId; }); registry.byId('buttonNew').on('click', function() { @@ -1002,7 +987,6 @@ require({ }); // Clicking the 'Run' button simply reloads the iframe. registry.byId('buttonRun').on('click', function() { - runGist = true; CodeMirror.commands.runCesium(jsEditor); }); @@ -1021,7 +1005,7 @@ require({ } registry.byId('dropDownSaveAs').on('show', function() { - var currentDemoName = ioQuery.queryToObject(window.location.search.substring(1)).src; + var currentDemoName = queryObject.src; currentDemoName = currentDemoName.replace('.html', ''); var description = encodeHTML(registry.byId('description').get('value').replace(/\n/g, '\\n')).replace(/\"/g, '"'); var label = encodeHTML(registry.byId('label').get('value').replace(/\n/g, '\\n')).replace(/\"/g, '"'); @@ -1122,18 +1106,11 @@ require({ // Select the demo to load upon opening based on the query parameter. if (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)) { - window.history.replaceState(gistDemo, gistDemo.name, '?src=Hello World.html&label=' + queryObject.label + '&gist=' + queryObject.gistId); + if (defined(queryObject.gist)) { document.title = 'Gist Import - Cesium Sandcastle'; } else { - window.history.replaceState(demo, demo.name, '?src=' + demo.name + '.html&label=' + queryObject.label); document.title = demo.name + ' - Cesium Sandcastle'; } }); @@ -1222,8 +1199,6 @@ require({ if (mouse.isMiddle(e)) { window.open('gallery/' + demo.name + '.html'); } else { - delete queryObject.gistId; - delete queryObject.code; var htmlText = (htmlEditor.getValue()).replace(/\s/g, ''); var jsText = (jsEditor.getValue()).replace(/\s/g, ''); var confirmChange = true; @@ -1231,6 +1206,10 @@ require({ confirmChange = window.confirm('You have unsaved changes. Are you sure you want to navigate away from this demo?'); } if (confirmChange) { + delete queryObject.gist; + delete queryObject.code; + history.replaceState(null, document.title, window.location.pathname + window.location.search); + loadFromGallery(demo).then(function() { var demoSrc = demo.name + '.html'; if (demoSrc !== window.location.search.substring(1)) { diff --git a/Apps/Sandcastle/ThirdParty/clipboard.min.js b/Apps/Sandcastle/ThirdParty/clipboard.min.js new file mode 100644 index 000000000000..b00ee5153525 --- /dev/null +++ b/Apps/Sandcastle/ThirdParty/clipboard.min.js @@ -0,0 +1,7 @@ +/*! + * clipboard.js v2.0.0 + * https://zenorocha.github.io/clipboard.js + * + * Licensed MIT © Zeno Rocha + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){var o,r,i;!function(a,c){r=[t,n(7)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(t){return t&&t.__esModule?t:{default:t}}(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return r(t,e,n);if(c.nodeList(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function r(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function i(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return u(document.body,t,e,n)}var c=n(6),u=n(5);t.exports=o},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){r.off(t,o),e.apply(n,arguments)}var r=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;for(o;o0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(s.default);t.exports=p})},function(t,e){function n(t,e){for(;t&&t.nodeType!==o;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var o=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}t.exports=n},function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function r(t,e,n,r,i){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,n,r,i)}))}function i(t,e,n,o){return function(n){n.delegateTarget=a(n.target,e),n.delegateTarget&&o.call(t,n)}}var a=n(4);t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e){function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}t.exports=n}])}); \ No newline at end of file diff --git a/Apps/Sandcastle/ThirdParty/pako.LICENSE b/Apps/Sandcastle/ThirdParty/pako.LICENSE new file mode 100644 index 000000000000..a934ef8db478 --- /dev/null +++ b/Apps/Sandcastle/ThirdParty/pako.LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Apps/Sandcastle/ThirdParty/pako.min.js b/Apps/Sandcastle/ThirdParty/pako.min.js new file mode 100644 index 000000000000..73024f7a68ca --- /dev/null +++ b/Apps/Sandcastle/ThirdParty/pako.min.js @@ -0,0 +1 @@ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=t()}}(function(){return function t(e,a,i){function n(s,o){if(!a[s]){if(!e[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(r)return r(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var d=a[s]={exports:{}};e[s][0].call(d.exports,function(t){var a=e[s][1][t];return n(a||t)},d,d.exports,t,e,a,i)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var a=r.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==f)throw new Error(l[a]);if(e.header&&r.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===d.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=r.deflateSetDictionary(this.strm,n))!==f)throw new Error(l[a]);this._dict_set=!0}}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg||l[a.err];return a.result}var r=t("./zlib/deflate"),s=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/messages"),h=t("./zlib/zstream"),d=Object.prototype.toString,f=0,_=-1,u=0,c=8;i.prototype.push=function(t,e){var a,i,n=this.strm,l=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:!0===e?4:0,"string"==typeof t?n.input=o.string2buf(t):"[object ArrayBuffer]"===d.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new s.Buf8(l),n.next_out=0,n.avail_out=l),1!==(a=r.deflate(n,i))&&a!==f)return this.onEnd(a),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(o.buf2binstring(s.shrinkBuf(n.output,n.next_out))):this.onData(s.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&1!==a);return 4===i?(a=r.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===f):2!==i||(this.onEnd(f),n.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===f&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=i,a.deflate=n,a.deflateRaw=function(t,e){return e=e||{},e.raw=!0,n(t,e)},a.gzip=function(t,e){return e=e||{},e.gzip=!0,n(t,e)}},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var a=r.inflateInit2(this.strm,e.windowBits);if(a!==l.Z_OK)throw new Error(h[a]);this.header=new f,r.inflateGetHeader(this.strm,this.header)}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg||h[a.err];return a.result}var r=t("./zlib/inflate"),s=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/constants"),h=t("./zlib/messages"),d=t("./zlib/zstream"),f=t("./zlib/gzheader"),_=Object.prototype.toString;i.prototype.push=function(t,e){var a,i,n,h,d,f,u=this.strm,c=this.options.chunkSize,b=this.options.dictionary,g=!1;if(this.ended)return!1;i=e===~~e?e:!0===e?l.Z_FINISH:l.Z_NO_FLUSH,"string"==typeof t?u.input=o.binstring2buf(t):"[object ArrayBuffer]"===_.call(t)?u.input=new Uint8Array(t):u.input=t,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new s.Buf8(c),u.next_out=0,u.avail_out=c),(a=r.inflate(u,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&b&&(f="string"==typeof b?o.string2buf(b):"[object ArrayBuffer]"===_.call(b)?new Uint8Array(b):b,a=r.inflateSetDictionary(this.strm,f)),a===l.Z_BUF_ERROR&&!0===g&&(a=l.Z_OK,g=!1),a!==l.Z_STREAM_END&&a!==l.Z_OK)return this.onEnd(a),this.ended=!0,!1;u.next_out&&(0!==u.avail_out&&a!==l.Z_STREAM_END&&(0!==u.avail_in||i!==l.Z_FINISH&&i!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(n=o.utf8border(u.output,u.next_out),h=u.next_out-n,d=o.buf2string(u.output,n),u.next_out=h,u.avail_out=c-h,h&&s.arraySet(u.output,u.output,n,h,0),this.onData(d)):this.onData(s.shrinkBuf(u.output,u.next_out)))),0===u.avail_in&&0===u.avail_out&&(g=!0)}while((u.avail_in>0||0===u.avail_out)&&a!==l.Z_STREAM_END);return a===l.Z_STREAM_END&&(i=l.Z_FINISH),i===l.Z_FINISH?(a=r.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===l.Z_OK):i!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),u.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Inflate=i,a.inflate=n,a.inflateRaw=function(t,e){return e=e||{},e.raw=!0,n(t,e)},a.ungzip=n},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(t,e,a){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;a.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(var n in a)i(a,n)&&(t[n]=a[n])}}return t},a.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,a,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(a,a+i),n);else for(var r=0;r=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;o[254]=o[254]=1,a.string2buf=function(t){var e,a,i,r,s,o=t.length,l=0;for(r=0;r>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return i(t,t.length)},a.binstring2buf=function(t){for(var e=new n.Buf8(t.length),a=0,i=e.length;a4)h[n++]=65533,a+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&a1?h[n++]=65533:r<65536?h[n++]=r:(r-=65536,h[n++]=55296|r>>10&1023,h[n++]=56320|1023&r)}return i(h,n)},a.utf8border=function(t,e){var a;for((e=e||t.length)>t.length&&(e=t.length),a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0?e:0===a?e:a+o[t[a]]>e?a:e}},{"./common":3}],5:[function(t,e,a){"use strict";e.exports=function(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(n=n+e[i++]|0)|0}while(--s);n%=65521,r%=65521}return n|r<<16|0}},{}],6:[function(t,e,a){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],7:[function(t,e,a){"use strict";var i=function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}();e.exports=function(t,e,a,n){var r=i,s=n+a;t^=-1;for(var o=n;o>>8^r[255&(t^e[o])];return-1^t}},{}],8:[function(t,e,a){"use strict";function i(t,e){return t.msg=A[e],e}function n(t){return(t<<1)-(t>4?9:0)}function r(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(z.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function o(t,e){B._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function d(t,e,a,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,z.arraySet(e,t.input,t.next_in,n,a),1===t.state.wrap?t.adler=S(t.adler,e,n,a):2===t.state.wrap&&(t.adler=E(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)}function f(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-it?t.strstart-(t.w_size-it):0,h=t.window,d=t.w_mask,f=t.prev,_=t.strstart+at,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<_);if(i=at-(_-r),r=_-at,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}}while((e=f[e&d])>l&&0!=--n);return s<=t.lookahead?s:t.lookahead}function _(t){var e,a,i,n,r,s=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-it)){z.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{i=t.head[--e],t.head[e]=i>=s?i-s:0}while(--a);e=a=s;do{i=t.prev[--e],t.prev[e]=i>=s?i-s:0}while(--a);n+=s}if(0===t.strm.avail_in)break;if(a=d(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=a,t.lookahead+t.insert>=et)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<=et&&(t.ins_h=(t.ins_h<=et)if(i=B._tr_tally(t,t.strstart-t.match_start,t.match_length-et),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=et){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=et&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=et-1)),t.prev_length>=et&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-et,i=B._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-et),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<=et&&t.strstart>0&&(n=t.strstart-1,(i=s[n])===s[++n]&&i===s[++n]&&i===s[++n])){r=t.strstart+at;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=et?(a=B._tr_tally(t,1,t.match_length-et),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=B._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(o(t,!1),0===t.strm.avail_out))return _t}return t.insert=0,e===N?(o(t,!0),0===t.strm.avail_out?ct:bt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?_t:ut}function g(t,e){for(var a;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(e===Z)return _t;break}if(t.match_length=0,a=B._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(o(t,!1),0===t.strm.avail_out))return _t}return t.insert=0,e===N?(o(t,!0),0===t.strm.avail_out?ct:bt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?_t:ut}function m(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}function w(t){t.window_size=2*t.w_size,r(t.head),t.max_lazy_match=x[t.level].max_lazy,t.good_match=x[t.level].good_length,t.nice_match=x[t.level].nice_length,t.max_chain_length=x[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=et-1,t.match_available=0,t.ins_h=0}function p(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=q,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new z.Buf16(2*$),this.dyn_dtree=new z.Buf16(2*(2*Q+1)),this.bl_tree=new z.Buf16(2*(2*V+1)),r(this.dyn_ltree),r(this.dyn_dtree),r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new z.Buf16(tt+1),this.heap=new z.Buf16(2*J+1),r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new z.Buf16(2*J+1),r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Y,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?rt:dt,t.adler=2===e.wrap?0:1,e.last_flush=Z,B._tr_init(e),D):i(t,U)}function k(t){var e=v(t);return e===D&&w(t.state),e}function y(t,e,a,n,r,s){if(!t)return U;var o=1;if(e===L&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>G||a!==q||n<8||n>15||e<0||e>9||s<0||s>M)return i(t,U);8===n&&(n=9);var l=new p;return t.state=l,l.strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&e===Z)return _t;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,o(t,!1),0===t.strm.avail_out))return _t;if(t.strstart-t.block_start>=t.w_size-it&&(o(t,!1),0===t.strm.avail_out))return _t}return t.insert=0,e===N?(o(t,!0),0===t.strm.avail_out?ct:bt):(t.strstart>t.block_start&&(o(t,!1),t.strm.avail_out),_t)}),new m(4,4,8,4,u),new m(4,5,16,8,u),new m(4,6,32,32,u),new m(4,4,16,16,c),new m(8,16,32,32,c),new m(8,16,128,128,c),new m(8,32,128,256,c),new m(32,128,258,1024,c),new m(32,258,258,4096,c)],a.deflateInit=function(t,e){return y(t,e,q,X,W,P)},a.deflateInit2=y,a.deflateReset=k,a.deflateResetKeep=v,a.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?U:(t.state.gzhead=e,D):U},a.deflate=function(t,e){var a,o,d,f;if(!t||!t.state||e>O||e<0)return t?i(t,U):U;if(o=t.state,!t.output||!t.input&&0!==t.avail_in||o.status===ft&&e!==N)return i(t,0===t.avail_out?F:U);if(o.strm=t,a=o.last_flush,o.last_flush=e,o.status===rt)if(2===o.wrap)t.adler=0,l(o,31),l(o,139),l(o,8),o.gzhead?(l(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),l(o,255&o.gzhead.time),l(o,o.gzhead.time>>8&255),l(o,o.gzhead.time>>16&255),l(o,o.gzhead.time>>24&255),l(o,9===o.level?2:o.strategy>=j||o.level<2?4:0),l(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(l(o,255&o.gzhead.extra.length),l(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=E(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=st):(l(o,0),l(o,0),l(o,0),l(o,0),l(o,0),l(o,9===o.level?2:o.strategy>=j||o.level<2?4:0),l(o,gt),o.status=dt);else{var _=q+(o.w_bits-8<<4)<<8;_|=(o.strategy>=j||o.level<2?0:o.level<6?1:6===o.level?2:3)<<6,0!==o.strstart&&(_|=nt),_+=31-_%31,o.status=dt,h(o,_),0!==o.strstart&&(h(o,t.adler>>>16),h(o,65535&t.adler)),t.adler=1}if(o.status===st)if(o.gzhead.extra){for(d=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending!==o.pending_buf_size));)l(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=ot)}else o.status=ot;if(o.status===ot)if(o.gzhead.name){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexd&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.gzindex=0,o.status=lt)}else o.status=lt;if(o.status===lt)if(o.gzhead.comment){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexd&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.status=ht)}else o.status=ht;if(o.status===ht&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(t),o.pending+2<=o.pending_buf_size&&(l(o,255&t.adler),l(o,t.adler>>8&255),t.adler=0,o.status=dt)):o.status=dt),0!==o.pending){if(s(t),0===t.avail_out)return o.last_flush=-1,D}else if(0===t.avail_in&&n(e)<=n(a)&&e!==N)return i(t,F);if(o.status===ft&&0!==t.avail_in)return i(t,F);if(0!==t.avail_in||0!==o.lookahead||e!==Z&&o.status!==ft){var u=o.strategy===j?g(o,e):o.strategy===K?b(o,e):x[o.level].func(o,e);if(u!==ct&&u!==bt||(o.status=ft),u===_t||u===ct)return 0===t.avail_out&&(o.last_flush=-1),D;if(u===ut&&(e===R?B._tr_align(o):e!==O&&(B._tr_stored_block(o,0,0,!1),e===C&&(r(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(t),0===t.avail_out))return o.last_flush=-1,D}return e!==N?D:o.wrap<=0?I:(2===o.wrap?(l(o,255&t.adler),l(o,t.adler>>8&255),l(o,t.adler>>16&255),l(o,t.adler>>24&255),l(o,255&t.total_in),l(o,t.total_in>>8&255),l(o,t.total_in>>16&255),l(o,t.total_in>>24&255)):(h(o,t.adler>>>16),h(o,65535&t.adler)),s(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?D:I)},a.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==rt&&e!==st&&e!==ot&&e!==lt&&e!==ht&&e!==dt&&e!==ft?i(t,U):(t.state=null,e===dt?i(t,T):D):U},a.deflateSetDictionary=function(t,e){var a,i,n,s,o,l,h,d,f=e.length;if(!t||!t.state)return U;if(a=t.state,2===(s=a.wrap)||1===s&&a.status!==rt||a.lookahead)return U;for(1===s&&(t.adler=S(t.adler,e,f,0)),a.wrap=0,f>=a.w_size&&(0===s&&(r(a.head),a.strstart=0,a.block_start=0,a.insert=0),d=new z.Buf8(a.w_size),z.arraySet(d,e,f-a.w_size,a.w_size,0),e=d,f=a.w_size),o=t.avail_in,l=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,_(a);a.lookahead>=et;){i=a.strstart,n=a.lookahead-(et-1);do{a.ins_h=(a.ins_h<>>24,u>>>=v,c-=v,0===(v=p>>>16&255))S[r++]=65535&p;else{if(!(16&v)){if(0==(64&v)){p=b[(65535&p)+(u&(1<>>=v,c-=v),c<15&&(u+=B[i++]<>>24,u>>>=v,c-=v,!(16&(v=p>>>16&255))){if(0==(64&v)){p=g[(65535&p)+(u&(1<l){t.msg="invalid distance too far back",a.mode=30;break t}if(u>>>=v,c-=v,v=r-s,y>v){if((v=y-v)>d&&a.sane){t.msg="invalid distance too far back",a.mode=30;break t}if(x=0,z=_,0===f){if(x+=h-v,v2;)S[r++]=z[x++],S[r++]=z[x++],S[r++]=z[x++],k-=3;k&&(S[r++]=z[x++],k>1&&(S[r++]=z[x++]))}else{x=r-y;do{S[r++]=S[x++],S[r++]=S[x++],S[r++]=S[x++],k-=3}while(k>2);k&&(S[r++]=S[x++],k>1&&(S[r++]=S[x++]))}break}}break}}while(i>3,u&=(1<<(c-=k<<3))-1,t.next_in=i,t.next_out=r,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new u.Buf16(320),this.work=new u.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=N,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new u.Buf32(dt),e.distcode=e.distdyn=new u.Buf32(ft),e.sane=1,e.back=-1,z):E}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,r(t)):E}function o(t,e){var a,i;return t&&t.state?(i=t.state,e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?E:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,s(t))):E}function l(t,e){var a,i;return t?(i=new n,t.state=i,i.window=null,(a=o(t,e))!==z&&(t.state=null),a):E}function h(t){if(ut){var e;for(f=new u.Buf32(512),_=new u.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(m(p,t.lens,0,288,f,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;m(v,t.lens,0,32,_,0,t.work,{bits:5}),ut=!1}t.lencode=f,t.lenbits=9,t.distcode=_,t.distbits=5}function d(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<=r.wsize?(u.arraySet(r.window,e,a-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((n=r.wsize-r.wnext)>i&&(n=i),u.arraySet(r.window,e,a-i,n,r.wnext),(i-=n)?(u.arraySet(r.window,e,a-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,a.check=b(a.check,Et,2,0),_=0,dt=0,a.mode=O;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&_)<<8)+(_>>8))%31){t.msg="incorrect header check",a.mode=ot;break}if((15&_)!==C){t.msg="unknown compression method",a.mode=ot;break}if(_>>>=4,dt-=4,yt=8+(15&_),0===a.wbits)a.wbits=yt;else if(yt>a.wbits){t.msg="invalid window size",a.mode=ot;break}a.dmax=1<>8&1),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=b(a.check,Et,2,0)),_=0,dt=0,a.mode=D;case D:for(;dt<32;){if(0===l)break t;l--,_+=n[s++]<>>8&255,Et[2]=_>>>16&255,Et[3]=_>>>24&255,a.check=b(a.check,Et,4,0)),_=0,dt=0,a.mode=I;case I:for(;dt<16;){if(0===l)break t;l--,_+=n[s++]<>8),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=b(a.check,Et,2,0)),_=0,dt=0,a.mode=U;case U:if(1024&a.flags){for(;dt<16;){if(0===l)break t;l--,_+=n[s++]<>>8&255,a.check=b(a.check,Et,2,0)),_=0,dt=0}else a.head&&(a.head.extra=null);a.mode=T;case T:if(1024&a.flags&&((ut=a.length)>l&&(ut=l),ut&&(a.head&&(yt=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),u.arraySet(a.head.extra,n,s,ut,yt)),512&a.flags&&(a.check=b(a.check,n,ut,s)),l-=ut,s+=ut,a.length-=ut),a.length))break t;a.length=0,a.mode=F;case F:if(2048&a.flags){if(0===l)break t;ut=0;do{yt=n[s+ut++],a.head&&yt&&a.length<65536&&(a.head.name+=String.fromCharCode(yt))}while(yt&&ut>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=M;break;case j:for(;dt<32;){if(0===l)break t;l--,_+=n[s++]<>>=7&dt,dt-=7&dt,a.mode=nt;break}for(;dt<3;){if(0===l)break t;l--,_+=n[s++]<>>=1,dt-=1,3&_){case 0:a.mode=Y;break;case 1:if(h(a),a.mode=Q,e===x){_>>>=2,dt-=2;break t}break;case 2:a.mode=X;break;case 3:t.msg="invalid block type",a.mode=ot}_>>>=2,dt-=2;break;case Y:for(_>>>=7&dt,dt-=7&dt;dt<32;){if(0===l)break t;l--,_+=n[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=ot;break}if(a.length=65535&_,_=0,dt=0,a.mode=q,e===x)break t;case q:a.mode=G;case G:if(ut=a.length){if(ut>l&&(ut=l),ut>f&&(ut=f),0===ut)break t;u.arraySet(r,n,s,ut,o),l-=ut,s+=ut,f-=ut,o+=ut,a.length-=ut;break}a.mode=M;break;case X:for(;dt<14;){if(0===l)break t;l--,_+=n[s++]<>>=5,dt-=5,a.ndist=1+(31&_),_>>>=5,dt-=5,a.ncode=4+(15&_),_>>>=4,dt-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=ot;break}a.have=0,a.mode=W;case W:for(;a.have>>=3,dt-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=m(w,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=ot;break}a.have=0,a.mode=J;case J:for(;a.have>>24,mt=St>>>16&255,wt=65535&St,!(gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>>=gt,dt-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;dt>>=gt,dt-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=ot;break}yt=a.lens[a.have-1],ut=3+(3&_),_>>>=2,dt-=2}else if(17===wt){for(Bt=gt+3;dt>>=gt)),_>>>=3,dt-=3}else{for(Bt=gt+7;dt>>=gt)),_>>>=7,dt-=7}if(a.have+ut>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=ot;break}for(;ut--;)a.lens[a.have++]=yt}}if(a.mode===ot)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=ot;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=m(p,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=ot;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=m(v,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=ot;break}if(a.mode=Q,e===x)break t;case Q:a.mode=V;case V:if(l>=6&&f>=258){t.next_out=o,t.avail_out=f,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=dt,g(t,_t),o=t.next_out,r=t.output,f=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,dt=a.bits,a.mode===M&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>>=pt,dt-=pt,a.back+=pt}if(_>>>=gt,dt-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=it;break}if(32&mt){a.back=-1,a.mode=M;break}if(64&mt){t.msg="invalid literal/length code",a.mode=ot;break}a.extra=15&mt,a.mode=$;case $:if(a.extra){for(Bt=a.extra;dt>>=a.extra,dt-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=tt;case tt:for(;St=a.distcode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>>=pt,dt-=pt,a.back+=pt}if(_>>>=gt,dt-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=ot;break}a.offset=wt,a.extra=15&mt,a.mode=et;case et:if(a.extra){for(Bt=a.extra;dt>>=a.extra,dt-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=ot;break}a.mode=at;case at:if(0===f)break t;if(ut=_t-f,a.offset>ut){if((ut=a.offset-ut)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=ot;break}ut>a.wnext?(ut-=a.wnext,ct=a.wsize-ut):ct=a.wnext-ut,ut>a.length&&(ut=a.length),bt=a.window}else bt=r,ct=o-a.offset,ut=a.length;ut>f&&(ut=f),f-=ut,a.length-=ut;do{r[o++]=bt[ct++]}while(--ut);0===a.length&&(a.mode=V);break;case it:if(0===f)break t;r[o++]=a.length,f--,a.mode=V;break;case nt:if(a.wrap){for(;dt<32;){if(0===l)break t;l--,_|=n[s++]<=1&&0===I[S];S--);if(E>S&&(E=S),0===S)return h[d++]=20971520,h[d++]=20971520,_.bits=1,0;for(B=1;B0&&(0===t||1!==S))return-1;for(U[1]=0,x=1;x<15;x++)U[x+1]=U[x]+I[x];for(z=0;z852||2===t&&C>592)return 1;for(;;){p=x-Z,f[z]w?(v=T[F+f[z]],k=O[D+f[z]]):(v=96,k=0),u=1<>Z)+(c-=u)]=p<<24|v<<16|k|0}while(0!==c);for(u=1<>=1;if(0!==u?(N&=u-1,N+=u):N=0,z++,0==--I[x]){if(x===S)break;x=e[a+f[z]]}if(x>E&&(N&g)!==b){for(0===Z&&(Z=E),m+=B,R=1<<(A=x-Z);A+Z852||2===t&&C>592)return 1;h[b=N&g]=E<<24|A<<16|m-d|0}}return 0!==N&&(h[m+N]=x-Z<<24|64<<16|0),_.bits=E,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?et[t]:et[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>M-a?(t.bi_buf|=e<>M-t.bi_valid,t.bi_valid+=a-M):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=K;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;ac&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)(n=t.heap[--a])>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(K+1),s=0;for(i=1;i<=K;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(K+1);for(a=0,i=0;i>=7;i8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),A.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]>1;a>=1;a--)p(t,r,a);n=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o=3&&0===t.bl_tree[2*V[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return R;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return C;for(e=32;e0?(t.strm.data_type===N&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,(r=t.static_len+3+7>>>3)<=n&&(n=r)):n=r=a+5,a+4<=n&&-1!==e?E(t,e,a,i):t.strategy===Z||r===n?(l(t,(D<<1)+(i?1:0),3),v(t,$,tt)):(l(t,(I<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)},a._tr_tally=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(at[a]+T+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1},a._tr_align=function(t){l(t,D<<1,3),h(t,Y,$),f(t)}},{"../utils/common":3}],15:[function(t,e,a){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/":[function(t,e,a){"use strict";var i={};(0,t("./lib/utils/common").assign)(i,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=i},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")}); diff --git a/Apps/Sandcastle/gallery/3D Models.html b/Apps/Sandcastle/gallery/3D Models.html index 0384b95187ff..ee45d75686f1 100644 --- a/Apps/Sandcastle/gallery/3D Models.html +++ b/Apps/Sandcastle/gallery/3D Models.html @@ -10,10 +10,12 @@ @@ -86,7 +88,7 @@ Sandcastle.addToolbarMenu(options); //Sandcastle_End -Sandcastle.finishedLoading(); + Sandcastle.finishedLoading(); } if (typeof Cesium !== "undefined") { startup(Cesium); diff --git a/Apps/Sandcastle/index.html b/Apps/Sandcastle/index.html index 2f40003d957e..0dcaac49fc97 100644 --- a/Apps/Sandcastle/index.html +++ b/Apps/Sandcastle/index.html @@ -82,11 +82,12 @@
Share + Be sure to re-share if you make any changes. +
+ +
+
Import Gist From ff32aaa9228025d07a85d3c6cf438aa665522287 Mon Sep 17 00:00:00 2001 From: Scott Hunter Date: Fri, 16 Mar 2018 15:51:48 -0400 Subject: [PATCH 34/38] add clipboard.js to LICENSE third-party section --- LICENSE.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/LICENSE.md b/LICENSE.md index 8c32b6e919b3..31245d76d8e4 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -751,6 +751,19 @@ http://codemirror.net/ > > Please note that some subdirectories of the CodeMirror distribution include their own LICENSE files, and are released under different licences. +### clipboard.js + +https://clipboardjs.com/ + +> The MIT License (MIT) +> Copyright © 2018 Zeno Rocha +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + ### JSHint http://www.jshint.com/ From f260c5fbab5e1ab3a9890e448e722917cb0c5c5d Mon Sep 17 00:00:00 2001 From: Scott Hunter Date: Fri, 16 Mar 2018 15:58:01 -0400 Subject: [PATCH 35/38] update CHANGES --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index ab5c47c2dda3..53393336c438 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ Change Log * Added a `ClippingPlane` object to be used with `ClippingPlaneCollection`. * Added 3D Tiles use-case to Terrain Clipping Planes Sandcastle * Updated `WebMapServiceImageryProvider` so it can take an srs or crs string to pass to the resource query parameters based on the WMS version. [#6223](https://github.com/AnalyticalGraphicsInc/cesium/issues/6223) +* Sharing Sandcastle examples now works by storing the full example directly in the URL instead of creating GitHub gists, because anonymous gist creation was removed by GitHub. Loading existing gists will still work. [#6342](https://github.com/AnalyticalGraphicsInc/cesium/pull/6342) * Added additional query parameter options to the CesiumViewer demo application: * sourceType specifies the type of data source if the URL doesn't have a known file extension. * flyTo=false optionally disables the automatic flyTo after loading the data source. From 3b4fd70bc677d2fb7ae475df3f11ebe3324dd42c Mon Sep 17 00:00:00 2001 From: hpinkos Date: Fri, 16 Mar 2018 16:03:10 -0400 Subject: [PATCH 36/38] wrap fit for running tests in karma --- Specs/spec-main.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Specs/spec-main.js b/Specs/spec-main.js index 46c12265d79b..62db1ae04b4f 100644 --- a/Specs/spec-main.js +++ b/Specs/spec-main.js @@ -148,6 +148,19 @@ }, timeout, categories); }; + var originalFit = window.fit; + + window.fit = function(description, f, timeout, categories) { + originalFit(description, function(done) { + var result = f(); + when(result, function() { + done(); + }, function(e) { + done.fail('promise rejected: ' + e.toString()); + }); + }, timeout, categories); + }; + var originalBeforeEach = window.beforeEach; window.beforeEach = function(f) { From ea11d8a0cb5570dce09f23b9cb56b96ba3ecb3a8 Mon Sep 17 00:00:00 2001 From: Scott Hunter Date: Fri, 16 Mar 2018 17:09:48 -0400 Subject: [PATCH 37/38] Fix issue with loading HTML from URL. The code path for loading a demo from the gallery was still being run after we loaded from the URL, clobbering the URL data. The gist codepath only worked because the jsonp request made it so the gallery demo load was then overwritten by the correct data. Now we only parse and load from the demo if we actually need it. --- Apps/Sandcastle/CesiumSandcastle.js | 68 ++++++++++++++--------------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/Apps/Sandcastle/CesiumSandcastle.js b/Apps/Sandcastle/CesiumSandcastle.js index 451edefc6d86..b0299d1f51e6 100644 --- a/Apps/Sandcastle/CesiumSandcastle.js +++ b/Apps/Sandcastle/CesiumSandcastle.js @@ -717,27 +717,15 @@ require({ return requestDemo(demo.name).then(function(value) { demo.code = value; - var parser = new DOMParser(); - var doc = parser.parseFromString(demo.code, 'text/html'); - - var script = doc.querySelector('script[id="cesium_sandcastle_script"]'); - if (!script) { - appendConsole('consoleError', 'Error reading source file: ' + demo.name, true); - return; - } - - var scriptMatch = scriptCodeRegex.exec(script.textContent); - if (!scriptMatch) { - appendConsole('consoleError', 'Error reading source file: ' + demo.name, true); - return; + if (typeof demo.bucket === 'string') { + loadBucket(demo.bucket); } - var scriptCode = scriptMatch[1]; - demoCode = scriptCode.replace(/\s/g, ''); - function applyLoadedDemo(code, html) { jsEditor.setValue(code); + jsEditor.clearHistory(); htmlEditor.setValue(html); + htmlEditor.clearHistory(); demoCode = code.replace(/\s/g, ''); demoHtml = html.replace(/\s/g, ''); CodeMirror.commands.runCesium(jsEditor); @@ -754,9 +742,9 @@ require({ var html = defined(htmlFile) ? htmlFile.content : defaultHtml; // Use the default html for old gists applyLoadedDemo(code, html); }).otherwise(function(error) { - appendConsole('consoleError', 'Unable to GET from GitHub API. This could be due to too many request, try again in an hour or copy and paste the code from the gist: https://gist.github.com/' + queryObject.gist , true); + appendConsole('consoleError', 'Unable to GET from GitHub API. This could be due to too many request, try again in an hour or copy and paste the code from the gist: https://gist.github.com/' + queryObject.gist, true); console.log(error); - }); + }); } else if (defined(queryObject.code)) { //The code query parameter is a Base64 encoded JSON string with `code` and `html` properties. json = JSON.parse(window.atob(queryObject.code)); @@ -782,26 +770,34 @@ require({ applyLoadedDemo(code, html); } else { - jsEditor.setValue(scriptCode); - } - jsEditor.clearHistory(); - - var htmlText = ''; - var childIndex = 0; - var childNode = doc.body.childNodes[childIndex]; - while (childIndex < doc.body.childNodes.length && childNode !== script) { - htmlText += childNode.nodeType === 1 ? childNode.outerHTML : childNode.nodeValue; - childNode = doc.body.childNodes[++childIndex]; - } - htmlText = htmlText.replace(/^\s+/, ''); - demoHtml = htmlText.replace(/\s/g, ''); - htmlEditor.setValue(htmlText); - htmlEditor.clearHistory(); + var parser = new DOMParser(); + var doc = parser.parseFromString(demo.code, 'text/html'); - if (typeof demo.bucket === 'string') { - loadBucket(demo.bucket); + var script = doc.querySelector('script[id="cesium_sandcastle_script"]'); + if (!script) { + appendConsole('consoleError', 'Error reading source file: ' + demo.name, true); + return; + } + + var scriptMatch = scriptCodeRegex.exec(script.textContent); + if (!scriptMatch) { + appendConsole('consoleError', 'Error reading source file: ' + demo.name, true); + return; + } + + var scriptCode = scriptMatch[1]; + + var htmlText = ''; + var childIndex = 0; + var childNode = doc.body.childNodes[childIndex]; + while (childIndex < doc.body.childNodes.length && childNode !== script) { + htmlText += childNode.nodeType === 1 ? childNode.outerHTML : childNode.nodeValue; + childNode = doc.body.childNodes[++childIndex]; + } + htmlText = htmlText.replace(/^\s+/, ''); + + applyLoadedDemo(scriptCode, htmlText); } - CodeMirror.commands.runCesium(jsEditor); }); } From 61cde1e4135adb08c2c0c4fb78887a9a460dd5ef Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Sat, 17 Mar 2018 10:19:04 -0400 Subject: [PATCH 38/38] Run sortRequires --- Apps/Sandcastle/CesiumSandcastle.js | 11 +- Source/Core/BingMapsApi.js | 10 +- Source/Core/BoundingSphere.js | 4 +- Source/Core/Credit.js | 18 +-- Source/Core/IonResource.js | 8 +- Source/Core/LRUCache.js | 8 +- Source/Core/MapboxApi.js | 10 +- Source/Core/Resource.js | 105 +++++++-------- Source/Core/Spline.js | 2 +- Source/Core/WeightSpline.js | 2 +- Source/Core/binarySearch.js | 5 +- Source/Core/sampleTerrain.js | 4 +- Source/DataSources/DynamicGeometryBatch.js | 50 +++---- Source/DataSources/DynamicGeometryUpdater.js | 54 ++++---- .../DataSources/EllipsoidGeometryUpdater.js | 4 +- Source/DataSources/GeometryUpdater.js | 66 +++++----- Source/DataSources/GeometryVisualizer.js | 4 +- Source/DataSources/KmlDataSource.js | 32 ++--- Source/DataSources/KmlTour.js | 9 +- Source/DataSources/KmlTourFlyTo.js | 11 +- Source/DataSources/KmlTourWait.js | 3 +- Source/DataSources/PlaneGeometryUpdater.js | 12 +- Source/DataSources/PlaneGraphics.js | 2 +- Source/DataSources/PolylineVisualizer.js | 62 ++++----- Source/Renderer/Context.js | 122 +++++++++--------- Source/Renderer/UniformState.js | 8 +- Source/Renderer/freezeRenderState.js | 3 +- Source/Scene/Cesium3DTileset.js | 4 +- Source/Scene/ClippingPlaneCollection.js | 4 +- Source/Scene/CreditDisplay.js | 22 ++-- Source/Scene/IonImageryProvider.js | 4 +- Source/Scene/Model.js | 4 +- Source/Scene/ModelAnimationCache.js | 8 +- Source/Scene/ParticleEmitter.js | 5 +- Source/Scene/PointCloudEyeDomeLighting.js | 7 +- Source/Workers/createPlaneGeometry.js | 8 +- Source/Workers/createPlaneOutlineGeometry.js | 8 +- Specs/Core/FrustumOutlineGeometrySpec.js | 2 +- Specs/Core/IonResourceSpec.js | 26 ++-- Specs/Core/ResourceSpec.js | 18 +-- Specs/DataSources/BoxGeometryUpdaterSpec.js | 54 ++++---- .../CorridorGeometryUpdaterSpec.js | 4 +- .../DataSources/DynamicGeometryUpdaterSpec.js | 22 ++-- .../DataSources/EllipseGeometryUpdaterSpec.js | 4 +- Specs/DataSources/GeometryUpdaterSpec.js | 18 +-- Specs/DataSources/KmlDataSourceSpec.js | 28 ++-- Specs/DataSources/KmlTourFlyToSpec.js | 11 +- Specs/DataSources/KmlTourSpec.js | 15 +-- Specs/DataSources/PlaneGeometryUpdaterSpec.js | 4 +- .../DataSources/PolygonGeometryUpdaterSpec.js | 4 +- Specs/DataSources/PolylineVisualizerSpec.js | 114 ++++++++-------- .../RectangleGeometryUpdaterSpec.js | 4 +- .../StaticGeometryColorBatchSpec.js | 54 ++++---- .../StaticGeometryPerMaterialBatchSpec.js | 74 +++++------ .../StaticGroundGeometryColorBatchSpec.js | 46 +++---- .../StaticOutlineGeometryBatchSpec.js | 42 +++--- Specs/Renderer/freezeRenderStateSpec.js | 4 +- ...d3DModel3DTileContentClassificationSpec.js | 4 +- .../Scene/Batched3DModel3DTileContentSpec.js | 12 +- Specs/Scene/ClassificationModelSpec.js | 8 +- Specs/Scene/ClippingPlaneCollectionSpec.js | 20 +-- Specs/Scene/CreditDisplaySpec.js | 8 +- ...oogleEarthEnterpriseImageryProviderSpec.js | 8 +- .../Instanced3DModel3DTileContentSpec.js | 16 +-- Specs/Scene/IonImageryProviderSpec.js | 70 +++++----- Specs/Scene/PickSpec.js | 8 +- Specs/Scene/PointCloudEyeDomeLightingSpec.js | 4 +- ...createTileMapServiceImageryProviderSpec.js | 78 +++++------ Specs/createDynamicGeometryUpdaterSpecs.js | 34 ++--- ...reateGeometryUpdaterGroundGeometrySpecs.js | 34 ++--- Specs/createGeometryUpdaterSpecs.js | 62 ++++----- 71 files changed, 807 insertions(+), 810 deletions(-) diff --git a/Apps/Sandcastle/CesiumSandcastle.js b/Apps/Sandcastle/CesiumSandcastle.js index b0299d1f51e6..e7eba8fc4997 100644 --- a/Apps/Sandcastle/CesiumSandcastle.js +++ b/Apps/Sandcastle/CesiumSandcastle.js @@ -50,11 +50,11 @@ require({ 'dojo/query', 'dojo/when', 'Sandcastle/LinkButton', + 'Source/Cesium', 'Source/Core/defined', 'Source/Core/Resource', - 'Source/Cesium', - 'ThirdParty/pako.min', 'ThirdParty/clipboard.min', + 'ThirdParty/pako.min', 'CodeMirror/addon/hint/show-hint', 'CodeMirror/addon/hint/javascript-hint', 'CodeMirror/mode/javascript/javascript', @@ -97,12 +97,11 @@ require({ query, when, LinkButton, + Cesium, defined, Resource, - Cesium, - pako, - ClipboardJS -) { + ClipboardJS, + pako) { 'use strict'; // attach clipboard handling to our Copy button diff --git a/Source/Core/BingMapsApi.js b/Source/Core/BingMapsApi.js index 0f55ac502556..fbca04299f50 100644 --- a/Source/Core/BingMapsApi.js +++ b/Source/Core/BingMapsApi.js @@ -1,9 +1,9 @@ define([ - './Credit', - './defined' -], function( - Credit, - defined) { + './Credit', + './defined' + ], function( + Credit, + defined) { 'use strict'; /** diff --git a/Source/Core/BoundingSphere.js b/Source/Core/BoundingSphere.js index a1549999b480..e799a3166b64 100644 --- a/Source/Core/BoundingSphere.js +++ b/Source/Core/BoundingSphere.js @@ -1,7 +1,6 @@ define([ './Cartesian3', './Cartographic', - './Math', './Check', './defaultValue', './defined', @@ -9,13 +8,13 @@ define([ './GeographicProjection', './Intersect', './Interval', + './Math', './Matrix3', './Matrix4', './Rectangle' ], function( Cartesian3, Cartographic, - CesiumMath, Check, defaultValue, defined, @@ -23,6 +22,7 @@ define([ GeographicProjection, Intersect, Interval, + CesiumMath, Matrix3, Matrix4, Rectangle) { diff --git a/Source/Core/Credit.js b/Source/Core/Credit.js index 71db3ad19f94..596339ef4d70 100644 --- a/Source/Core/Credit.js +++ b/Source/Core/Credit.js @@ -1,13 +1,13 @@ define([ - './defaultValue', - './defined', - './defineProperties', - './DeveloperError' -], function( - defaultValue, - defined, - defineProperties, - DeveloperError) { + './defaultValue', + './defined', + './defineProperties', + './DeveloperError' + ], function( + defaultValue, + defined, + defineProperties, + DeveloperError) { 'use strict'; var nextCreditId = 0; diff --git a/Source/Core/IonResource.js b/Source/Core/IonResource.js index 52aca41d5c9a..329ddba62b3a 100644 --- a/Source/Core/IonResource.js +++ b/Source/Core/IonResource.js @@ -1,4 +1,5 @@ define([ + '../ThirdParty/when', './Check', './Credit', './defaultValue', @@ -6,9 +7,9 @@ define([ './defineProperties', './Ion', './Resource', - './RuntimeError', - '../ThirdParty/when' + './RuntimeError' ], function( + when, Check, Credit, defaultValue, @@ -16,8 +17,7 @@ define([ defineProperties, Ion, Resource, - RuntimeError, - when) { + RuntimeError) { 'use strict'; /** diff --git a/Source/Core/LRUCache.js b/Source/Core/LRUCache.js index 9478801d6146..9512f3b9d487 100644 --- a/Source/Core/LRUCache.js +++ b/Source/Core/LRUCache.js @@ -1,15 +1,15 @@ define([ './defined', './defineProperties', - './getTimestamp', './DeveloperError', - './DoublyLinkedList' + './DoublyLinkedList', + './getTimestamp' ], function( defined, defineProperties, - getTimestamp, DeveloperError, - DoublyLinkedList) { + DoublyLinkedList, + getTimestamp) { 'use strict'; /** diff --git a/Source/Core/MapboxApi.js b/Source/Core/MapboxApi.js index 68aef922d208..1ca3b34368ba 100644 --- a/Source/Core/MapboxApi.js +++ b/Source/Core/MapboxApi.js @@ -1,9 +1,9 @@ define([ - './Credit', - './defined' -], function( - Credit, - defined) { + './Credit', + './defined' + ], function( + Credit, + defined) { 'use strict'; var MapboxApi = {}; diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js index 75ce182e1e79..bb51d17e9cde 100644 --- a/Source/Core/Resource.js +++ b/Source/Core/Resource.js @@ -1,56 +1,57 @@ define([ - './appendForwardSlash', - './Check', - './clone', - './combine', - './defaultValue', - './defined', - './defineProperties', - './deprecationWarning', - './DeveloperError', - './freezeObject', - './getAbsoluteUri', - './getBaseUri', - './getExtensionFromUri', - './isBlobUri', - './isCrossOriginUrl', - './isDataUri', - './objectToQuery', - './queryToObject', - './Request', - './RequestErrorEvent', - './RequestScheduler', - './RequestState', - './RuntimeError', - './TrustedServers', - '../ThirdParty/Uri', - '../ThirdParty/when' -], function(appendForwardSlash, - Check, - clone, - combine, - defaultValue, - defined, - defineProperties, - deprecationWarning, - DeveloperError, - freezeObject, - getAbsoluteUri, - getBaseUri, - getExtensionFromUri, - isBlobUri, - isCrossOriginUrl, - isDataUri, - objectToQuery, - queryToObject, - Request, - RequestErrorEvent, - RequestScheduler, - RequestState, - RuntimeError, - TrustedServers, - Uri, - when) { + '../ThirdParty/Uri', + '../ThirdParty/when', + './appendForwardSlash', + './Check', + './clone', + './combine', + './defaultValue', + './defined', + './defineProperties', + './deprecationWarning', + './DeveloperError', + './freezeObject', + './getAbsoluteUri', + './getBaseUri', + './getExtensionFromUri', + './isBlobUri', + './isCrossOriginUrl', + './isDataUri', + './objectToQuery', + './queryToObject', + './Request', + './RequestErrorEvent', + './RequestScheduler', + './RequestState', + './RuntimeError', + './TrustedServers' + ], function( + Uri, + when, + appendForwardSlash, + Check, + clone, + combine, + defaultValue, + defined, + defineProperties, + deprecationWarning, + DeveloperError, + freezeObject, + getAbsoluteUri, + getBaseUri, + getExtensionFromUri, + isBlobUri, + isCrossOriginUrl, + isDataUri, + objectToQuery, + queryToObject, + Request, + RequestErrorEvent, + RequestScheduler, + RequestState, + RuntimeError, + TrustedServers) { 'use strict'; var xhrBlobSupported = (function() { diff --git a/Source/Core/Spline.js b/Source/Core/Spline.js index 49ccd8f593b3..08bd316990cd 100644 --- a/Source/Core/Spline.js +++ b/Source/Core/Spline.js @@ -4,7 +4,7 @@ define([ './defined', './DeveloperError', './Math' -], function( + ], function( Check, defaultValue, defined, diff --git a/Source/Core/WeightSpline.js b/Source/Core/WeightSpline.js index 4a8ba66f84d8..62c58fd18e31 100644 --- a/Source/Core/WeightSpline.js +++ b/Source/Core/WeightSpline.js @@ -5,7 +5,7 @@ define([ './defineProperties', './DeveloperError', './Spline' -], function( + ], function( Check, defaultValue, defined, diff --git a/Source/Core/binarySearch.js b/Source/Core/binarySearch.js index 7c527f97553b..fad2dffc4c7e 100644 --- a/Source/Core/binarySearch.js +++ b/Source/Core/binarySearch.js @@ -1,6 +1,7 @@ define([ - './Check' -], function(Check) { + './Check' + ], function( + Check) { 'use strict'; /** diff --git a/Source/Core/sampleTerrain.js b/Source/Core/sampleTerrain.js index 3d2d9e8af403..e7abfd4bc12c 100644 --- a/Source/Core/sampleTerrain.js +++ b/Source/Core/sampleTerrain.js @@ -1,12 +1,12 @@ define([ '../ThirdParty/when', - './defined', './Check', + './defined', './LRUCache' ], function( when, - defined, Check, + defined, LRUCache) { 'use strict'; diff --git a/Source/DataSources/DynamicGeometryBatch.js b/Source/DataSources/DynamicGeometryBatch.js index a36d3479bfd0..efa761c7043b 100644 --- a/Source/DataSources/DynamicGeometryBatch.js +++ b/Source/DataSources/DynamicGeometryBatch.js @@ -1,29 +1,29 @@ define([ - '../Core/AssociativeArray', - '../Core/Color', - '../Core/ColorGeometryInstanceAttribute', - '../Core/defined', - '../Core/DistanceDisplayCondition', - '../Core/DistanceDisplayConditionGeometryInstanceAttribute', - '../Core/ShowGeometryInstanceAttribute', - '../Scene/Primitive', - './BoundingSphereState', - './ColorMaterialProperty', - './MaterialProperty', - './Property' -], function( - AssociativeArray, - Color, - ColorGeometryInstanceAttribute, - defined, - DistanceDisplayCondition, - DistanceDisplayConditionGeometryInstanceAttribute, - ShowGeometryInstanceAttribute, - Primitive, - BoundingSphereState, - ColorMaterialProperty, - MaterialProperty, - Property) { + '../Core/AssociativeArray', + '../Core/Color', + '../Core/ColorGeometryInstanceAttribute', + '../Core/defined', + '../Core/DistanceDisplayCondition', + '../Core/DistanceDisplayConditionGeometryInstanceAttribute', + '../Core/ShowGeometryInstanceAttribute', + '../Scene/Primitive', + './BoundingSphereState', + './ColorMaterialProperty', + './MaterialProperty', + './Property' + ], function( + AssociativeArray, + Color, + ColorGeometryInstanceAttribute, + defined, + DistanceDisplayCondition, + DistanceDisplayConditionGeometryInstanceAttribute, + ShowGeometryInstanceAttribute, + Primitive, + BoundingSphereState, + ColorMaterialProperty, + MaterialProperty, + Property) { 'use strict'; /** diff --git a/Source/DataSources/DynamicGeometryUpdater.js b/Source/DataSources/DynamicGeometryUpdater.js index 8129ec288cec..672a5db01d4d 100644 --- a/Source/DataSources/DynamicGeometryUpdater.js +++ b/Source/DataSources/DynamicGeometryUpdater.js @@ -1,31 +1,31 @@ define([ - '../Core/defined', - '../Core/destroyObject', - '../Core/BoundingSphere', - '../Core/Check', - '../Core/DeveloperError', - '../Scene/GroundPrimitive', - '../Scene/MaterialAppearance', - '../Scene/PerInstanceColorAppearance', - '../Scene/Primitive', - './BoundingSphereState', - './ColorMaterialProperty', - './MaterialProperty', - './Property' -], function( - defined, - destroyObject, - BoundingSphere, - Check, - DeveloperError, - GroundPrimitive, - MaterialAppearance, - PerInstanceColorAppearance, - Primitive, - BoundingSphereState, - ColorMaterialProperty, - MaterialProperty, - Property) { + '../Core/BoundingSphere', + '../Core/Check', + '../Core/defined', + '../Core/destroyObject', + '../Core/DeveloperError', + '../Scene/GroundPrimitive', + '../Scene/MaterialAppearance', + '../Scene/PerInstanceColorAppearance', + '../Scene/Primitive', + './BoundingSphereState', + './ColorMaterialProperty', + './MaterialProperty', + './Property' + ], function( + BoundingSphere, + Check, + defined, + destroyObject, + DeveloperError, + GroundPrimitive, + MaterialAppearance, + PerInstanceColorAppearance, + Primitive, + BoundingSphereState, + ColorMaterialProperty, + MaterialProperty, + Property) { 'use strict'; /** diff --git a/Source/DataSources/EllipsoidGeometryUpdater.js b/Source/DataSources/EllipsoidGeometryUpdater.js index f1a03bf342e6..34ecddc475b0 100644 --- a/Source/DataSources/EllipsoidGeometryUpdater.js +++ b/Source/DataSources/EllipsoidGeometryUpdater.js @@ -1,6 +1,6 @@ define([ - '../Core/Check', '../Core/Cartesian3', + '../Core/Check', '../Core/Color', '../Core/ColorGeometryInstanceAttribute', '../Core/defaultValue', @@ -23,8 +23,8 @@ define([ './MaterialProperty', './Property' ], function( - Check, Cartesian3, + Check, Color, ColorGeometryInstanceAttribute, defaultValue, diff --git a/Source/DataSources/GeometryUpdater.js b/Source/DataSources/GeometryUpdater.js index de748fdc270f..0846738c42fc 100644 --- a/Source/DataSources/GeometryUpdater.js +++ b/Source/DataSources/GeometryUpdater.js @@ -1,37 +1,37 @@ define([ - '../Core/Check', - '../Core/Color', - '../Core/defaultValue', - '../Core/defined', - '../Core/defineProperties', - '../Core/destroyObject', - '../Core/DeveloperError', - '../Core/DistanceDisplayCondition', - '../Core/Event', - '../Core/Iso8601', - '../Core/oneTimeWarning', - '../Scene/ClassificationType', - '../Scene/ShadowMode', - './ColorMaterialProperty', - './ConstantProperty', - './Property' -], function( - Check, - Color, - defaultValue, - defined, - defineProperties, - destroyObject, - DeveloperError, - DistanceDisplayCondition, - Event, - Iso8601, - oneTimeWarning, - ClassificationType, - ShadowMode, - ColorMaterialProperty, - ConstantProperty, - Property) { + '../Core/Check', + '../Core/Color', + '../Core/defaultValue', + '../Core/defined', + '../Core/defineProperties', + '../Core/destroyObject', + '../Core/DeveloperError', + '../Core/DistanceDisplayCondition', + '../Core/Event', + '../Core/Iso8601', + '../Core/oneTimeWarning', + '../Scene/ClassificationType', + '../Scene/ShadowMode', + './ColorMaterialProperty', + './ConstantProperty', + './Property' + ], function( + Check, + Color, + defaultValue, + defined, + defineProperties, + destroyObject, + DeveloperError, + DistanceDisplayCondition, + Event, + Iso8601, + oneTimeWarning, + ClassificationType, + ShadowMode, + ColorMaterialProperty, + ConstantProperty, + Property) { 'use strict'; var defaultMaterial = new ColorMaterialProperty(Color.WHITE); diff --git a/Source/DataSources/GeometryVisualizer.js b/Source/DataSources/GeometryVisualizer.js index abe85d68011a..706d46ce814f 100644 --- a/Source/DataSources/GeometryVisualizer.js +++ b/Source/DataSources/GeometryVisualizer.js @@ -11,8 +11,8 @@ define([ '../Scene/MaterialAppearance', '../Scene/PerInstanceColorAppearance', '../Scene/ShadowMode', - './BoxGeometryUpdater', './BoundingSphereState', + './BoxGeometryUpdater', './ColorMaterialProperty', './CorridorGeometryUpdater', './CylinderGeometryUpdater', @@ -41,8 +41,8 @@ define([ MaterialAppearance, PerInstanceColorAppearance, ShadowMode, - BoxGeometryUpdater, BoundingSphereState, + BoxGeometryUpdater, ColorMaterialProperty, CorridorGeometryUpdater, CylinderGeometryUpdater, diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js index 1b31da27bfdb..7386cb470ac1 100644 --- a/Source/DataSources/KmlDataSource.js +++ b/Source/DataSources/KmlDataSource.js @@ -17,6 +17,8 @@ define([ '../Core/Event', '../Core/getExtensionFromUri', '../Core/getFilenameFromUri', + '../Core/HeadingPitchRange', + '../Core/HeadingPitchRoll', '../Core/Iso8601', '../Core/JulianDate', '../Core/Math', @@ -31,8 +33,6 @@ define([ '../Core/RuntimeError', '../Core/TimeInterval', '../Core/TimeIntervalCollection', - '../Core/HeadingPitchRoll', - '../Core/HeadingPitchRange', '../Scene/HeightReference', '../Scene/HorizontalOrigin', '../Scene/LabelStyle', @@ -49,6 +49,11 @@ define([ './Entity', './EntityCluster', './EntityCollection', + './KmlCamera', + './KmlLookAt', + './KmlTour', + './KmlTourFlyTo', + './KmlTourWait', './LabelGraphics', './PathGraphics', './PolygonGraphics', @@ -59,12 +64,7 @@ define([ './SampledPositionProperty', './ScaledPositionProperty', './TimeIntervalCollectionProperty', - './WallGraphics', - './KmlLookAt', - './KmlCamera', - './KmlTour', - './KmlTourFlyTo', - './KmlTourWait' + './WallGraphics' ], function( AssociativeArray, BoundingRectangle, @@ -84,6 +84,8 @@ define([ Event, getExtensionFromUri, getFilenameFromUri, + HeadingPitchRange, + HeadingPitchRoll, Iso8601, JulianDate, CesiumMath, @@ -98,8 +100,6 @@ define([ RuntimeError, TimeInterval, TimeIntervalCollection, - HeadingPitchRoll, - HeadingPitchRange, HeightReference, HorizontalOrigin, LabelStyle, @@ -116,6 +116,11 @@ define([ Entity, EntityCluster, EntityCollection, + KmlCamera, + KmlLookAt, + KmlTour, + KmlTourFlyTo, + KmlTourWait, LabelGraphics, PathGraphics, PolygonGraphics, @@ -126,12 +131,7 @@ define([ SampledPositionProperty, ScaledPositionProperty, TimeIntervalCollectionProperty, - WallGraphics, - KmlLookAt, - KmlCamera, - KmlTour, - KmlTourFlyTo, - KmlTourWait) { + WallGraphics) { 'use strict'; // IE 8 doesn't have a DOM parser and can't run Cesium anyway, so just bail. diff --git a/Source/DataSources/KmlTour.js b/Source/DataSources/KmlTour.js index 7b407595ac28..35408d7c28ed 100644 --- a/Source/DataSources/KmlTour.js +++ b/Source/DataSources/KmlTour.js @@ -1,10 +1,9 @@ define([ - '../Core/Event', - '../Core/defined' + '../Core/defined', + '../Core/Event' ], function( - Event, - defined - ) { + defined, + Event) { 'use strict'; /** * @alias KMLTour diff --git a/Source/DataSources/KmlTourFlyTo.js b/Source/DataSources/KmlTourFlyTo.js index 497f4225fbf9..1f4faae15a63 100644 --- a/Source/DataSources/KmlTourFlyTo.js +++ b/Source/DataSources/KmlTourFlyTo.js @@ -1,14 +1,13 @@ define([ - '../Core/defined', - '../Core/combine', '../Core/BoundingSphere', + '../Core/combine', + '../Core/defined', '../Core/EasingFunction' ], function( - defined, - combine, BoundingSphere, - EasingFunction - ) { + combine, + defined, + EasingFunction) { 'use strict'; /** * @alias KmlTourFlyTo diff --git a/Source/DataSources/KmlTourWait.js b/Source/DataSources/KmlTourWait.js index 13d1a78048fb..359087e8ac8d 100644 --- a/Source/DataSources/KmlTourWait.js +++ b/Source/DataSources/KmlTourWait.js @@ -1,8 +1,7 @@ define([ '../Core/defined' ], function( - defined - ) { + defined) { 'use strict'; /** * @alias KmlTourWait diff --git a/Source/DataSources/PlaneGeometryUpdater.js b/Source/DataSources/PlaneGeometryUpdater.js index 50a231fd9e73..b82289a56337 100644 --- a/Source/DataSources/PlaneGeometryUpdater.js +++ b/Source/DataSources/PlaneGeometryUpdater.js @@ -1,6 +1,4 @@ define([ - '../Core/PlaneGeometry', - '../Core/PlaneOutlineGeometry', '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Check', @@ -12,8 +10,10 @@ define([ '../Core/GeometryInstance', '../Core/Iso8601', '../Core/Matrix4', - '../Core/ShowGeometryInstanceAttribute', + '../Core/PlaneGeometry', + '../Core/PlaneOutlineGeometry', '../Core/Quaternion', + '../Core/ShowGeometryInstanceAttribute', '../Scene/MaterialAppearance', '../Scene/PerInstanceColorAppearance', './ColorMaterialProperty', @@ -21,8 +21,6 @@ define([ './GeometryUpdater', './Property' ], function( - PlaneGeometry, - PlaneOutlineGeometry, Cartesian2, Cartesian3, Check, @@ -34,8 +32,10 @@ define([ GeometryInstance, Iso8601, Matrix4, - ShowGeometryInstanceAttribute, + PlaneGeometry, + PlaneOutlineGeometry, Quaternion, + ShowGeometryInstanceAttribute, MaterialAppearance, PerInstanceColorAppearance, ColorMaterialProperty, diff --git a/Source/DataSources/PlaneGraphics.js b/Source/DataSources/PlaneGraphics.js index 9d30374dc7ce..ef344e672d89 100644 --- a/Source/DataSources/PlaneGraphics.js +++ b/Source/DataSources/PlaneGraphics.js @@ -6,7 +6,7 @@ define([ '../Core/Event', './createMaterialPropertyDescriptor', './createPropertyDescriptor' -], function( + ], function( defaultValue, defined, defineProperties, diff --git a/Source/DataSources/PolylineVisualizer.js b/Source/DataSources/PolylineVisualizer.js index 7c5dd65d0640..b381d2451d51 100644 --- a/Source/DataSources/PolylineVisualizer.js +++ b/Source/DataSources/PolylineVisualizer.js @@ -1,35 +1,35 @@ define([ - '../Core/AssociativeArray', - '../Core/BoundingSphere', - '../Core/Check', - '../Core/defined', - '../Core/destroyObject', - '../Core/DeveloperError', - '../Scene/PolylineColorAppearance', - '../Scene/PolylineMaterialAppearance', - '../Scene/ShadowMode', - './BoundingSphereState', - './ColorMaterialProperty', - './DynamicGeometryBatch', - './PolylineGeometryUpdater', - './StaticGeometryColorBatch', - './StaticGeometryPerMaterialBatch' -], function( - AssociativeArray, - BoundingSphere, - Check, - defined, - destroyObject, - DeveloperError, - PolylineColorAppearance, - PolylineMaterialAppearance, - ShadowMode, - BoundingSphereState, - ColorMaterialProperty, - DynamicGeometryBatch, - PolylineGeometryUpdater, - StaticGeometryColorBatch, - StaticGeometryPerMaterialBatch) { + '../Core/AssociativeArray', + '../Core/BoundingSphere', + '../Core/Check', + '../Core/defined', + '../Core/destroyObject', + '../Core/DeveloperError', + '../Scene/PolylineColorAppearance', + '../Scene/PolylineMaterialAppearance', + '../Scene/ShadowMode', + './BoundingSphereState', + './ColorMaterialProperty', + './DynamicGeometryBatch', + './PolylineGeometryUpdater', + './StaticGeometryColorBatch', + './StaticGeometryPerMaterialBatch' + ], function( + AssociativeArray, + BoundingSphere, + Check, + defined, + destroyObject, + DeveloperError, + PolylineColorAppearance, + PolylineMaterialAppearance, + ShadowMode, + BoundingSphereState, + ColorMaterialProperty, + DynamicGeometryBatch, + PolylineGeometryUpdater, + StaticGeometryColorBatch, + StaticGeometryPerMaterialBatch) { 'use strict'; var emptyArray = []; diff --git a/Source/Renderer/Context.js b/Source/Renderer/Context.js index 2815a53e8582..f3a1902328dd 100644 --- a/Source/Renderer/Context.js +++ b/Source/Renderer/Context.js @@ -1,65 +1,65 @@ define([ - '../Core/Check', - '../Core/clone', - '../Core/Color', - '../Core/ComponentDatatype', - '../Core/createGuid', - '../Core/defaultValue', - '../Core/defined', - '../Core/defineProperties', - '../Core/destroyObject', - '../Core/DeveloperError', - '../Core/Geometry', - '../Core/GeometryAttribute', - '../Core/Matrix4', - '../Core/PrimitiveType', - '../Core/RuntimeError', - '../Core/WebGLConstants', - '../Shaders/ViewportQuadVS', - './BufferUsage', - './ClearCommand', - './ContextLimits', - './CubeMap', - './DrawCommand', - './PassState', - './PickFramebuffer', - './RenderState', - './ShaderCache', - './ShaderProgram', - './Texture', - './UniformState', - './VertexArray' -], function( - Check, - clone, - Color, - ComponentDatatype, - createGuid, - defaultValue, - defined, - defineProperties, - destroyObject, - DeveloperError, - Geometry, - GeometryAttribute, - Matrix4, - PrimitiveType, - RuntimeError, - WebGLConstants, - ViewportQuadVS, - BufferUsage, - ClearCommand, - ContextLimits, - CubeMap, - DrawCommand, - PassState, - PickFramebuffer, - RenderState, - ShaderCache, - ShaderProgram, - Texture, - UniformState, - VertexArray) { + '../Core/Check', + '../Core/clone', + '../Core/Color', + '../Core/ComponentDatatype', + '../Core/createGuid', + '../Core/defaultValue', + '../Core/defined', + '../Core/defineProperties', + '../Core/destroyObject', + '../Core/DeveloperError', + '../Core/Geometry', + '../Core/GeometryAttribute', + '../Core/Matrix4', + '../Core/PrimitiveType', + '../Core/RuntimeError', + '../Core/WebGLConstants', + '../Shaders/ViewportQuadVS', + './BufferUsage', + './ClearCommand', + './ContextLimits', + './CubeMap', + './DrawCommand', + './PassState', + './PickFramebuffer', + './RenderState', + './ShaderCache', + './ShaderProgram', + './Texture', + './UniformState', + './VertexArray' + ], function( + Check, + clone, + Color, + ComponentDatatype, + createGuid, + defaultValue, + defined, + defineProperties, + destroyObject, + DeveloperError, + Geometry, + GeometryAttribute, + Matrix4, + PrimitiveType, + RuntimeError, + WebGLConstants, + ViewportQuadVS, + BufferUsage, + ClearCommand, + ContextLimits, + CubeMap, + DrawCommand, + PassState, + PickFramebuffer, + RenderState, + ShaderCache, + ShaderProgram, + Texture, + UniformState, + VertexArray) { 'use strict'; /*global WebGLRenderingContext*/ diff --git a/Source/Renderer/UniformState.js b/Source/Renderer/UniformState.js index 00eddf4756f3..56951672c099 100644 --- a/Source/Renderer/UniformState.js +++ b/Source/Renderer/UniformState.js @@ -1,5 +1,4 @@ define([ - './Sampler', '../Core/BoundingRectangle', '../Core/Cartesian2', '../Core/Cartesian3', @@ -16,9 +15,9 @@ define([ '../Core/OrthographicFrustum', '../Core/Simon1994PlanetaryPositions', '../Core/Transforms', - '../Scene/SceneMode' + '../Scene/SceneMode', + './Sampler' ], function( - Sampler, BoundingRectangle, Cartesian2, Cartesian3, @@ -35,7 +34,8 @@ define([ OrthographicFrustum, Simon1994PlanetaryPositions, Transforms, - SceneMode) { + SceneMode, + Sampler) { 'use strict'; /** diff --git a/Source/Renderer/freezeRenderState.js b/Source/Renderer/freezeRenderState.js index 01d88b6a77da..702359a34a8c 100644 --- a/Source/Renderer/freezeRenderState.js +++ b/Source/Renderer/freezeRenderState.js @@ -1,7 +1,8 @@ /*global define*/ define([ '../Core/freezeObject' - ], function(freezeObject) { + ], function( + freezeObject) { 'use strict'; /** diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 647ab7ddb44a..e4590a8d60e1 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -35,8 +35,8 @@ define([ './ClassificationType', './ClippingPlaneCollection', './LabelCollection', - './PointCloudShading', './PointCloudEyeDomeLighting', + './PointCloudShading', './SceneMode', './ShadowMode', './TileBoundingRegion', @@ -79,8 +79,8 @@ define([ ClassificationType, ClippingPlaneCollection, LabelCollection, - PointCloudShading, PointCloudEyeDomeLighting, + PointCloudShading, SceneMode, ShadowMode, TileBoundingRegion, diff --git a/Source/Scene/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js index 4f89ca439d7d..d49db4ca419a 100644 --- a/Source/Scene/ClippingPlaneCollection.js +++ b/Source/Scene/ClippingPlaneCollection.js @@ -3,7 +3,6 @@ define([ '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', - '../Core/Math', '../Core/Check', '../Core/Color', '../Core/defaultValue', @@ -14,6 +13,7 @@ define([ '../Core/DeveloperError', '../Core/FeatureDetection', '../Core/Intersect', + '../Core/Math', '../Core/Matrix4', '../Core/PixelFormat', '../Core/Plane', @@ -30,7 +30,6 @@ define([ Cartesian2, Cartesian3, Cartesian4, - CesiumMath, Check, Color, defaultValue, @@ -41,6 +40,7 @@ define([ DeveloperError, FeatureDetection, Intersect, + CesiumMath, Matrix4, PixelFormat, Plane, diff --git a/Source/Scene/CreditDisplay.js b/Source/Scene/CreditDisplay.js index ef9e850ca97b..9eb709c98c11 100644 --- a/Source/Scene/CreditDisplay.js +++ b/Source/Scene/CreditDisplay.js @@ -1,15 +1,15 @@ define([ - '../Core/Check', - '../Core/Credit', - '../Core/defaultValue', - '../Core/defined', - '../Core/destroyObject' -], function( - Check, - Credit, - defaultValue, - defined, - destroyObject) { + '../Core/Check', + '../Core/Credit', + '../Core/defaultValue', + '../Core/defined', + '../Core/destroyObject' + ], function( + Check, + Credit, + defaultValue, + defined, + destroyObject) { 'use strict'; var mobileWidth = 576; diff --git a/Source/Scene/IonImageryProvider.js b/Source/Scene/IonImageryProvider.js index d7130a9d00d0..1dca249c0ca5 100644 --- a/Source/Scene/IonImageryProvider.js +++ b/Source/Scene/IonImageryProvider.js @@ -7,6 +7,7 @@ define([ '../Core/defineProperties', '../Core/DeveloperError', '../Core/Event', + '../Core/IonResource', '../Core/loadJson', '../Core/Resource', '../Core/RuntimeError', @@ -14,7 +15,6 @@ define([ './ArcGisMapServerImageryProvider', './BingMapsImageryProvider', './Cesium3DTileset', - '../Core/IonResource', './createTileMapServiceImageryProvider', './GoogleEarthEnterpriseMapsProvider', './MapboxImageryProvider', @@ -31,6 +31,7 @@ define([ defineProperties, DeveloperError, Event, + IonResource, loadJson, Resource, RuntimeError, @@ -38,7 +39,6 @@ define([ ArcGisMapServerImageryProvider, BingMapsImageryProvider, Cesium3DTileset, - IonResource, createTileMapServiceImageryProvider, GoogleEarthEnterpriseMapsProvider, MapboxImageryProvider, diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index 6e12aec5fa95..891a0c57a719 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -29,9 +29,9 @@ define([ '../Core/PixelFormat', '../Core/Plane', '../Core/PrimitiveType', - '../Core/Resource', '../Core/Quaternion', '../Core/Queue', + '../Core/Resource', '../Core/RuntimeError', '../Core/Transforms', '../Core/WebGLConstants', @@ -108,9 +108,9 @@ define([ PixelFormat, Plane, PrimitiveType, - Resource, Quaternion, Queue, + Resource, RuntimeError, Transforms, WebGLConstants, diff --git a/Source/Scene/ModelAnimationCache.js b/Source/Scene/ModelAnimationCache.js index d9e2d37efee0..5a7c55ab800b 100644 --- a/Source/Scene/ModelAnimationCache.js +++ b/Source/Scene/ModelAnimationCache.js @@ -1,5 +1,4 @@ define([ - './AttributeType', '../Core/Cartesian3', '../Core/ComponentDatatype', '../Core/defaultValue', @@ -11,9 +10,9 @@ define([ '../Core/WebGLConstants', '../Core/WeightSpline', '../ThirdParty/GltfPipeline/getAccessorByteStride', - '../ThirdParty/GltfPipeline/numberOfComponentsForType' + '../ThirdParty/GltfPipeline/numberOfComponentsForType', + './AttributeType' ], function( - AttributeType, Cartesian3, ComponentDatatype, defaultValue, @@ -25,7 +24,8 @@ define([ WebGLConstants, WeightSpline, getAccessorByteStride, - numberOfComponentsForType) { + numberOfComponentsForType, + AttributeType) { 'use strict'; /** diff --git a/Source/Scene/ParticleEmitter.js b/Source/Scene/ParticleEmitter.js index 2970619eedb5..b3a0a580c695 100644 --- a/Source/Scene/ParticleEmitter.js +++ b/Source/Scene/ParticleEmitter.js @@ -1,6 +1,7 @@ define([ - '../Core/DeveloperError' -], function(DeveloperError) { + '../Core/DeveloperError' + ], function( + DeveloperError) { 'use strict'; /** diff --git a/Source/Scene/PointCloudEyeDomeLighting.js b/Source/Scene/PointCloudEyeDomeLighting.js index e7b2982b8e83..bf5809dc9d3a 100644 --- a/Source/Scene/PointCloudEyeDomeLighting.js +++ b/Source/Scene/PointCloudEyeDomeLighting.js @@ -19,8 +19,8 @@ define([ '../Renderer/PixelDatatype', '../Renderer/RenderState', '../Renderer/Sampler', - '../Renderer/ShaderSource', '../Renderer/ShaderProgram', + '../Renderer/ShaderSource', '../Renderer/Texture', '../Renderer/TextureMagnificationFilter', '../Renderer/TextureMinificationFilter', @@ -53,8 +53,8 @@ define([ PixelDatatype, RenderState, Sampler, - ShaderSource, ShaderProgram, + ShaderSource, Texture, TextureMagnificationFilter, TextureMinificationFilter, @@ -65,8 +65,7 @@ define([ BlendingState, StencilFunction, StencilOperation, - PointCloudEyeDomeLightingShader - ) { + PointCloudEyeDomeLightingShader) { 'use strict'; /** diff --git a/Source/Workers/createPlaneGeometry.js b/Source/Workers/createPlaneGeometry.js index 23785ac71d65..eff9382e696b 100644 --- a/Source/Workers/createPlaneGeometry.js +++ b/Source/Workers/createPlaneGeometry.js @@ -1,9 +1,9 @@ define([ - '../Core/PlaneGeometry', - '../Core/defined' + '../Core/defined', + '../Core/PlaneGeometry' ], function( - PlaneGeometry, - defined) { + defined, + PlaneGeometry) { 'use strict'; return function(planeGeometry, offset) { diff --git a/Source/Workers/createPlaneOutlineGeometry.js b/Source/Workers/createPlaneOutlineGeometry.js index c2f5a7a7ff4a..6a03dcd54e43 100644 --- a/Source/Workers/createPlaneOutlineGeometry.js +++ b/Source/Workers/createPlaneOutlineGeometry.js @@ -1,9 +1,9 @@ define([ - '../Core/PlaneOutlineGeometry', - '../Core/defined' + '../Core/defined', + '../Core/PlaneOutlineGeometry' ], function( - PlaneOutlineGeometry, - defined) { + defined, + PlaneOutlineGeometry) { 'use strict'; return function(planeGeometry, offset) { diff --git a/Specs/Core/FrustumOutlineGeometrySpec.js b/Specs/Core/FrustumOutlineGeometrySpec.js index 71a46b75da84..e47e2207d8f0 100644 --- a/Specs/Core/FrustumOutlineGeometrySpec.js +++ b/Specs/Core/FrustumOutlineGeometrySpec.js @@ -7,7 +7,7 @@ defineSuite([ 'Core/VertexFormat', 'Specs/createPackableSpecs' ], function( - FrustumOutlineGeometry, + FrustumOutlineGeometry, Cartesian3, CesiumMath, PerspectiveFrustum, diff --git a/Specs/Core/IonResourceSpec.js b/Specs/Core/IonResourceSpec.js index d03e943e626b..2a961007bf98 100644 --- a/Specs/Core/IonResourceSpec.js +++ b/Specs/Core/IonResourceSpec.js @@ -1,17 +1,17 @@ defineSuite([ - 'Core/IonResource', - 'Core/Ion', - 'Core/RequestErrorEvent', - 'Core/Resource', - 'Core/RuntimeError', - 'ThirdParty/when' -], function( - IonResource, - Ion, - RequestErrorEvent, - Resource, - RuntimeError, - when) { + 'Core/IonResource', + 'Core/Ion', + 'Core/RequestErrorEvent', + 'Core/Resource', + 'Core/RuntimeError', + 'ThirdParty/when' + ], function( + IonResource, + Ion, + RequestErrorEvent, + Resource, + RuntimeError, + when) { 'use strict'; var assetId = 123890213; diff --git a/Specs/Core/ResourceSpec.js b/Specs/Core/ResourceSpec.js index 050e9ba050f7..90a855267735 100644 --- a/Specs/Core/ResourceSpec.js +++ b/Specs/Core/ResourceSpec.js @@ -1,13 +1,13 @@ defineSuite([ - 'Core/Resource', - 'Core/DefaultProxy', - 'Core/Request', - 'ThirdParty/when' -], function( - Resource, - DefaultProxy, - Request, - when) { + 'Core/Resource', + 'Core/DefaultProxy', + 'Core/Request', + 'ThirdParty/when' + ], function( + Resource, + DefaultProxy, + Request, + when) { 'use strict'; it('Constructor sets correct properties', function() { diff --git a/Specs/DataSources/BoxGeometryUpdaterSpec.js b/Specs/DataSources/BoxGeometryUpdaterSpec.js index d088a37cba3e..1a59fa76d025 100644 --- a/Specs/DataSources/BoxGeometryUpdaterSpec.js +++ b/Specs/DataSources/BoxGeometryUpdaterSpec.js @@ -1,31 +1,31 @@ defineSuite([ - 'DataSources/BoxGeometryUpdater', - 'Core/Cartesian3', - 'Core/JulianDate', - 'Core/TimeIntervalCollection', - 'DataSources/BoxGraphics', - 'DataSources/ConstantPositionProperty', - 'DataSources/ConstantProperty', - 'DataSources/Entity', - 'Scene/PrimitiveCollection', - 'Specs/createDynamicGeometryUpdaterSpecs', - 'Specs/createDynamicProperty', - 'Specs/createGeometryUpdaterSpecs', - 'Specs/createScene' -], function( - BoxGeometryUpdater, - Cartesian3, - JulianDate, - TimeIntervalCollection, - BoxGraphics, - ConstantPositionProperty, - ConstantProperty, - Entity, - PrimitiveCollection, - createDynamicGeometryUpdaterSpecs, - createDynamicProperty, - createGeometryUpdaterSpecs, - createScene) { + 'DataSources/BoxGeometryUpdater', + 'Core/Cartesian3', + 'Core/JulianDate', + 'Core/TimeIntervalCollection', + 'DataSources/BoxGraphics', + 'DataSources/ConstantPositionProperty', + 'DataSources/ConstantProperty', + 'DataSources/Entity', + 'Scene/PrimitiveCollection', + 'Specs/createDynamicGeometryUpdaterSpecs', + 'Specs/createDynamicProperty', + 'Specs/createGeometryUpdaterSpecs', + 'Specs/createScene' + ], function( + BoxGeometryUpdater, + Cartesian3, + JulianDate, + TimeIntervalCollection, + BoxGraphics, + ConstantPositionProperty, + ConstantProperty, + Entity, + PrimitiveCollection, + createDynamicGeometryUpdaterSpecs, + createDynamicProperty, + createGeometryUpdaterSpecs, + createScene) { 'use strict'; var scene; diff --git a/Specs/DataSources/CorridorGeometryUpdaterSpec.js b/Specs/DataSources/CorridorGeometryUpdaterSpec.js index 6d3a516d11a4..940a2718d92b 100644 --- a/Specs/DataSources/CorridorGeometryUpdaterSpec.js +++ b/Specs/DataSources/CorridorGeometryUpdaterSpec.js @@ -15,8 +15,8 @@ defineSuite([ 'Scene/PrimitiveCollection', 'Specs/createDynamicGeometryUpdaterSpecs', 'Specs/createDynamicProperty', - 'Specs/createGeometryUpdaterSpecs', 'Specs/createGeometryUpdaterGroundGeometrySpecs', + 'Specs/createGeometryUpdaterSpecs', 'Specs/createScene' ], function( CorridorGeometryUpdater, @@ -35,8 +35,8 @@ defineSuite([ PrimitiveCollection, createDynamicGeometryUpdaterSpecs, createDynamicProperty, - createGeometryUpdaterSpecs, createGeometryUpdaterGroundGeometrySpecs, + createGeometryUpdaterSpecs, createScene) { 'use strict'; diff --git a/Specs/DataSources/DynamicGeometryUpdaterSpec.js b/Specs/DataSources/DynamicGeometryUpdaterSpec.js index 819ea68f6f29..570029923260 100644 --- a/Specs/DataSources/DynamicGeometryUpdaterSpec.js +++ b/Specs/DataSources/DynamicGeometryUpdaterSpec.js @@ -1,15 +1,15 @@ defineSuite([ - 'DataSources/DynamicGeometryUpdater', - 'DataSources/Entity', - 'DataSources/GeometryUpdater', - 'Scene/PrimitiveCollection', - 'Specs/createScene' -], function( - DynamicGeometryUpdater, - Entity, - GeometryUpdater, - PrimitiveCollection, - createScene) { + 'DataSources/DynamicGeometryUpdater', + 'DataSources/Entity', + 'DataSources/GeometryUpdater', + 'Scene/PrimitiveCollection', + 'Specs/createScene' + ], function( + DynamicGeometryUpdater, + Entity, + GeometryUpdater, + PrimitiveCollection, + createScene) { 'use strict'; var scene; diff --git a/Specs/DataSources/EllipseGeometryUpdaterSpec.js b/Specs/DataSources/EllipseGeometryUpdaterSpec.js index d46f9c87b534..27cb00ba0eaa 100644 --- a/Specs/DataSources/EllipseGeometryUpdaterSpec.js +++ b/Specs/DataSources/EllipseGeometryUpdaterSpec.js @@ -12,8 +12,8 @@ defineSuite([ 'Scene/PrimitiveCollection', 'Specs/createDynamicGeometryUpdaterSpecs', 'Specs/createDynamicProperty', - 'Specs/createGeometryUpdaterSpecs', 'Specs/createGeometryUpdaterGroundGeometrySpecs', + 'Specs/createGeometryUpdaterSpecs', 'Specs/createScene' ], function( EllipseGeometryUpdater, @@ -29,8 +29,8 @@ defineSuite([ PrimitiveCollection, createDynamicGeometryUpdaterSpecs, createDynamicProperty, - createGeometryUpdaterSpecs, createGeometryUpdaterGroundGeometrySpecs, + createGeometryUpdaterSpecs, createScene) { 'use strict'; diff --git a/Specs/DataSources/GeometryUpdaterSpec.js b/Specs/DataSources/GeometryUpdaterSpec.js index 2f05a03d6c8f..b9bb32f7252a 100644 --- a/Specs/DataSources/GeometryUpdaterSpec.js +++ b/Specs/DataSources/GeometryUpdaterSpec.js @@ -1,13 +1,13 @@ defineSuite([ - 'DataSources/GeometryUpdater', - 'DataSources/Entity', - 'Scene/PrimitiveCollection', - 'Specs/createScene' -], function( - GeometryUpdater, - Entity, - PrimitiveCollection, - createScene) { + 'DataSources/GeometryUpdater', + 'DataSources/Entity', + 'Scene/PrimitiveCollection', + 'Specs/createScene' + ], function( + GeometryUpdater, + Entity, + PrimitiveCollection, + createScene) { 'use strict'; var scene; diff --git a/Specs/DataSources/KmlDataSourceSpec.js b/Specs/DataSources/KmlDataSourceSpec.js index 909c02ab113f..202d4da998a0 100644 --- a/Specs/DataSources/KmlDataSourceSpec.js +++ b/Specs/DataSources/KmlDataSourceSpec.js @@ -1,10 +1,5 @@ defineSuite([ 'DataSources/KmlDataSource', - 'DataSources/KmlLookAt', - 'DataSources/KmlCamera', - 'DataSources/KmlTour', - 'DataSources/KmlTourWait', - 'DataSources/KmlTourFlyTo', 'Core/BoundingRectangle', 'Core/Cartesian2', 'Core/Cartesian3', @@ -15,6 +10,8 @@ defineSuite([ 'Core/DefaultProxy', 'Core/Ellipsoid', 'Core/Event', + 'Core/HeadingPitchRange', + 'Core/HeadingPitchRoll', 'Core/Iso8601', 'Core/JulianDate', 'Core/Math', @@ -23,11 +20,14 @@ defineSuite([ 'Core/RequestErrorEvent', 'Core/Resource', 'Core/RuntimeError', - 'Core/HeadingPitchRange', - 'Core/HeadingPitchRoll', 'DataSources/ColorMaterialProperty', 'DataSources/EntityCollection', 'DataSources/ImageMaterialProperty', + 'DataSources/KmlCamera', + 'DataSources/KmlLookAt', + 'DataSources/KmlTour', + 'DataSources/KmlTourFlyTo', + 'DataSources/KmlTourWait', 'Scene/Camera', 'Scene/HeightReference', 'Scene/HorizontalOrigin', @@ -38,11 +38,6 @@ defineSuite([ 'ThirdParty/when' ], function( KmlDataSource, - KmlLookAt, - KmlCamera, - KmlTour, - KmlTourWait, - KmlTourFlyTo, BoundingRectangle, Cartesian2, Cartesian3, @@ -53,6 +48,8 @@ defineSuite([ DefaultProxy, Ellipsoid, Event, + HeadingPitchRange, + HeadingPitchRoll, Iso8601, JulianDate, CesiumMath, @@ -61,11 +58,14 @@ defineSuite([ RequestErrorEvent, Resource, RuntimeError, - HeadingPitchRange, - HeadingPitchRoll, ColorMaterialProperty, EntityCollection, ImageMaterialProperty, + KmlCamera, + KmlLookAt, + KmlTour, + KmlTourFlyTo, + KmlTourWait, Camera, HeightReference, HorizontalOrigin, diff --git a/Specs/DataSources/KmlTourFlyToSpec.js b/Specs/DataSources/KmlTourFlyToSpec.js index 49d61154f1ca..ed982b60e271 100644 --- a/Specs/DataSources/KmlTourFlyToSpec.js +++ b/Specs/DataSources/KmlTourFlyToSpec.js @@ -1,22 +1,21 @@ defineSuite([ 'DataSources/KmlTourFlyTo', - 'DataSources/KmlCamera', - 'DataSources/KmlLookAt', 'Core/Cartesian3', 'Core/HeadingPitchRange', 'Core/HeadingPitchRoll', 'Core/Math', + 'DataSources/KmlCamera', + 'DataSources/KmlLookAt', 'Specs/pollToPromise' ], function( KmlTourFlyTo, - KmlCamera, - KmlLookAt, Cartesian3, HeadingPitchRange, HeadingPitchRoll, CesiumMath, - pollToPromise - ) { + KmlCamera, + KmlLookAt, + pollToPromise) { 'use strict'; it('generates camera options for KmlLookAt', function() { diff --git a/Specs/DataSources/KmlTourSpec.js b/Specs/DataSources/KmlTourSpec.js index d9191ebea68f..91994729b047 100644 --- a/Specs/DataSources/KmlTourSpec.js +++ b/Specs/DataSources/KmlTourSpec.js @@ -1,22 +1,21 @@ defineSuite([ 'DataSources/KmlTour', - 'DataSources/KmlTourFlyTo', - 'DataSources/KmlTourWait', - 'DataSources/KmlLookAt', 'Core/Cartesian3', 'Core/HeadingPitchRange', 'Core/Math', + 'DataSources/KmlLookAt', + 'DataSources/KmlTourFlyTo', + 'DataSources/KmlTourWait', 'Specs/pollToPromise' ], function( KmlTour, - KmlTourFlyTo, - KmlTourWait, - KmlLookAt, Cartesian3, HeadingPitchRange, CesiumMath, - pollToPromise - ) { + KmlLookAt, + KmlTourFlyTo, + KmlTourWait, + pollToPromise) { 'use strict'; function getLookAt() { diff --git a/Specs/DataSources/PlaneGeometryUpdaterSpec.js b/Specs/DataSources/PlaneGeometryUpdaterSpec.js index 94e00d69430c..2c761b09b80a 100644 --- a/Specs/DataSources/PlaneGeometryUpdaterSpec.js +++ b/Specs/DataSources/PlaneGeometryUpdaterSpec.js @@ -5,10 +5,10 @@ defineSuite([ 'Core/JulianDate', 'Core/Plane', 'Core/TimeIntervalCollection', - 'DataSources/PlaneGraphics', 'DataSources/ConstantPositionProperty', 'DataSources/ConstantProperty', 'DataSources/Entity', + 'DataSources/PlaneGraphics', 'Scene/PrimitiveCollection', 'Specs/createDynamicGeometryUpdaterSpecs', 'Specs/createDynamicProperty', @@ -21,10 +21,10 @@ defineSuite([ JulianDate, Plane, TimeIntervalCollection, - PlaneGraphics, ConstantPositionProperty, ConstantProperty, Entity, + PlaneGraphics, PrimitiveCollection, createDynamicGeometryUpdaterSpecs, createDynamicProperty, diff --git a/Specs/DataSources/PolygonGeometryUpdaterSpec.js b/Specs/DataSources/PolygonGeometryUpdaterSpec.js index 88563b464b76..1e87f87d4d5a 100644 --- a/Specs/DataSources/PolygonGeometryUpdaterSpec.js +++ b/Specs/DataSources/PolygonGeometryUpdaterSpec.js @@ -14,8 +14,8 @@ defineSuite([ 'Scene/PrimitiveCollection', 'Specs/createDynamicGeometryUpdaterSpecs', 'Specs/createDynamicProperty', - 'Specs/createGeometryUpdaterSpecs', 'Specs/createGeometryUpdaterGroundGeometrySpecs', + 'Specs/createGeometryUpdaterSpecs', 'Specs/createScene' ], function( PolygonGeometryUpdater, @@ -33,8 +33,8 @@ defineSuite([ PrimitiveCollection, createDynamicGeometryUpdaterSpecs, createDynamicProperty, - createGeometryUpdaterSpecs, createGeometryUpdaterGroundGeometrySpecs, + createGeometryUpdaterSpecs, createScene) { 'use strict'; diff --git a/Specs/DataSources/PolylineVisualizerSpec.js b/Specs/DataSources/PolylineVisualizerSpec.js index cc41610a21bb..b213f638c184 100644 --- a/Specs/DataSources/PolylineVisualizerSpec.js +++ b/Specs/DataSources/PolylineVisualizerSpec.js @@ -1,61 +1,61 @@ defineSuite([ - 'DataSources/PolylineVisualizer', - 'Core/BoundingSphere', - 'Core/Cartesian3', - 'Core/Color', - 'Core/ColorGeometryInstanceAttribute', - 'Core/JulianDate', - 'Core/ShowGeometryInstanceAttribute', - 'DataSources/BoundingSphereState', - 'DataSources/CallbackProperty', - 'DataSources/ColorMaterialProperty', - 'DataSources/ConstantPositionProperty', - 'DataSources/ConstantProperty', - 'DataSources/Entity', - 'DataSources/EntityCollection', - 'DataSources/PolylineArrowMaterialProperty', - 'DataSources/PolylineGeometryUpdater', - 'DataSources/PolylineGraphics', - 'DataSources/SampledProperty', - 'DataSources/StaticGeometryColorBatch', - 'DataSources/StaticGeometryPerMaterialBatch', - 'DataSources/StaticGroundGeometryColorBatch', - 'DataSources/StaticOutlineGeometryBatch', - 'Scene/PolylineColorAppearance', - 'Scene/PolylineMaterialAppearance', - 'Scene/ShadowMode', - 'Specs/createDynamicProperty', - 'Specs/createScene', - 'Specs/pollToPromise' -], function( - PolylineVisualizer, - BoundingSphere, - Cartesian3, - Color, - ColorGeometryInstanceAttribute, - JulianDate, - ShowGeometryInstanceAttribute, - BoundingSphereState, - CallbackProperty, - ColorMaterialProperty, - ConstantPositionProperty, - ConstantProperty, - Entity, - EntityCollection, - PolylineArrowMaterialProperty, - PolylineGeometryUpdater, - PolylineGraphics, - SampledProperty, - StaticGeometryColorBatch, - StaticGeometryPerMaterialBatch, - StaticGroundGeometryColorBatch, - StaticOutlineGeometryBatch, - PolylineColorAppearance, - PolylineMaterialAppearance, - ShadowMode, - createDynamicProperty, - createScene, - pollToPromise) { + 'DataSources/PolylineVisualizer', + 'Core/BoundingSphere', + 'Core/Cartesian3', + 'Core/Color', + 'Core/ColorGeometryInstanceAttribute', + 'Core/JulianDate', + 'Core/ShowGeometryInstanceAttribute', + 'DataSources/BoundingSphereState', + 'DataSources/CallbackProperty', + 'DataSources/ColorMaterialProperty', + 'DataSources/ConstantPositionProperty', + 'DataSources/ConstantProperty', + 'DataSources/Entity', + 'DataSources/EntityCollection', + 'DataSources/PolylineArrowMaterialProperty', + 'DataSources/PolylineGeometryUpdater', + 'DataSources/PolylineGraphics', + 'DataSources/SampledProperty', + 'DataSources/StaticGeometryColorBatch', + 'DataSources/StaticGeometryPerMaterialBatch', + 'DataSources/StaticGroundGeometryColorBatch', + 'DataSources/StaticOutlineGeometryBatch', + 'Scene/PolylineColorAppearance', + 'Scene/PolylineMaterialAppearance', + 'Scene/ShadowMode', + 'Specs/createDynamicProperty', + 'Specs/createScene', + 'Specs/pollToPromise' + ], function( + PolylineVisualizer, + BoundingSphere, + Cartesian3, + Color, + ColorGeometryInstanceAttribute, + JulianDate, + ShowGeometryInstanceAttribute, + BoundingSphereState, + CallbackProperty, + ColorMaterialProperty, + ConstantPositionProperty, + ConstantProperty, + Entity, + EntityCollection, + PolylineArrowMaterialProperty, + PolylineGeometryUpdater, + PolylineGraphics, + SampledProperty, + StaticGeometryColorBatch, + StaticGeometryPerMaterialBatch, + StaticGroundGeometryColorBatch, + StaticOutlineGeometryBatch, + PolylineColorAppearance, + PolylineMaterialAppearance, + ShadowMode, + createDynamicProperty, + createScene, + pollToPromise) { 'use strict'; var time = JulianDate.now(); diff --git a/Specs/DataSources/RectangleGeometryUpdaterSpec.js b/Specs/DataSources/RectangleGeometryUpdaterSpec.js index 4cf3474bc57a..2608b931511f 100644 --- a/Specs/DataSources/RectangleGeometryUpdaterSpec.js +++ b/Specs/DataSources/RectangleGeometryUpdaterSpec.js @@ -11,8 +11,8 @@ defineSuite([ 'Scene/PrimitiveCollection', 'Specs/createDynamicGeometryUpdaterSpecs', 'Specs/createDynamicProperty', - 'Specs/createGeometryUpdaterSpecs', 'Specs/createGeometryUpdaterGroundGeometrySpecs', + 'Specs/createGeometryUpdaterSpecs', 'Specs/createScene' ], function( RectangleGeometryUpdater, @@ -27,8 +27,8 @@ defineSuite([ PrimitiveCollection, createDynamicGeometryUpdaterSpecs, createDynamicProperty, - createGeometryUpdaterSpecs, createGeometryUpdaterGroundGeometrySpecs, + createGeometryUpdaterSpecs, createScene) { 'use strict'; diff --git a/Specs/DataSources/StaticGeometryColorBatchSpec.js b/Specs/DataSources/StaticGeometryColorBatchSpec.js index 728ee85ad96a..58c4749896af 100644 --- a/Specs/DataSources/StaticGeometryColorBatchSpec.js +++ b/Specs/DataSources/StaticGeometryColorBatchSpec.js @@ -1,31 +1,31 @@ defineSuite([ - 'DataSources/StaticGeometryColorBatch', - 'Core/Cartesian3', - 'Core/Color', - 'Core/JulianDate', - 'DataSources/CallbackProperty', - 'DataSources/EllipseGeometryUpdater', - 'DataSources/Entity', - 'DataSources/PolylineGeometryUpdater', - 'Scene/PerInstanceColorAppearance', - 'Scene/PolylineColorAppearance', - 'Scene/ShadowMode', - 'Specs/createScene', - 'Specs/pollToPromise' -], function( - StaticGeometryColorBatch, - Cartesian3, - Color, - JulianDate, - CallbackProperty, - EllipseGeometryUpdater, - Entity, - PolylineGeometryUpdater, - PerInstanceColorAppearance, - PolylineColorAppearance, - ShadowMode, - createScene, - pollToPromise) { + 'DataSources/StaticGeometryColorBatch', + 'Core/Cartesian3', + 'Core/Color', + 'Core/JulianDate', + 'DataSources/CallbackProperty', + 'DataSources/EllipseGeometryUpdater', + 'DataSources/Entity', + 'DataSources/PolylineGeometryUpdater', + 'Scene/PerInstanceColorAppearance', + 'Scene/PolylineColorAppearance', + 'Scene/ShadowMode', + 'Specs/createScene', + 'Specs/pollToPromise' + ], function( + StaticGeometryColorBatch, + Cartesian3, + Color, + JulianDate, + CallbackProperty, + EllipseGeometryUpdater, + Entity, + PolylineGeometryUpdater, + PerInstanceColorAppearance, + PolylineColorAppearance, + ShadowMode, + createScene, + pollToPromise) { 'use strict'; var time = JulianDate.now(); diff --git a/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js b/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js index 0dabe8dcbe96..95fe083d9a27 100644 --- a/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js +++ b/Specs/DataSources/StaticGeometryPerMaterialBatchSpec.js @@ -1,41 +1,41 @@ defineSuite([ - 'DataSources/StaticGeometryPerMaterialBatch', - 'Core/Cartesian3', - 'Core/Color', - 'Core/JulianDate', - 'DataSources/ConstantPositionProperty', - 'DataSources/ConstantProperty', - 'DataSources/EllipseGeometryUpdater', - 'DataSources/EllipseGraphics', - 'DataSources/Entity', - 'DataSources/GridMaterialProperty', - 'DataSources/PolylineArrowMaterialProperty', - 'DataSources/PolylineGeometryUpdater', - 'DataSources/PolylineGraphics', - 'Scene/MaterialAppearance', - 'Scene/PolylineMaterialAppearance', - 'Scene/ShadowMode', - 'Specs/createScene', - 'Specs/pollToPromise' -], function( - StaticGeometryPerMaterialBatch, - Cartesian3, - Color, - JulianDate, - ConstantPositionProperty, - ConstantProperty, - EllipseGeometryUpdater, - EllipseGraphics, - Entity, - GridMaterialProperty, - PolylineArrowMaterialProperty, - PolylineGeometryUpdater, - PolylineGraphics, - MaterialAppearance, - PolylineMaterialAppearance, - ShadowMode, - createScene, - pollToPromise) { + 'DataSources/StaticGeometryPerMaterialBatch', + 'Core/Cartesian3', + 'Core/Color', + 'Core/JulianDate', + 'DataSources/ConstantPositionProperty', + 'DataSources/ConstantProperty', + 'DataSources/EllipseGeometryUpdater', + 'DataSources/EllipseGraphics', + 'DataSources/Entity', + 'DataSources/GridMaterialProperty', + 'DataSources/PolylineArrowMaterialProperty', + 'DataSources/PolylineGeometryUpdater', + 'DataSources/PolylineGraphics', + 'Scene/MaterialAppearance', + 'Scene/PolylineMaterialAppearance', + 'Scene/ShadowMode', + 'Specs/createScene', + 'Specs/pollToPromise' + ], function( + StaticGeometryPerMaterialBatch, + Cartesian3, + Color, + JulianDate, + ConstantPositionProperty, + ConstantProperty, + EllipseGeometryUpdater, + EllipseGraphics, + Entity, + GridMaterialProperty, + PolylineArrowMaterialProperty, + PolylineGeometryUpdater, + PolylineGraphics, + MaterialAppearance, + PolylineMaterialAppearance, + ShadowMode, + createScene, + pollToPromise) { 'use strict'; var time = JulianDate.now(); diff --git a/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js b/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js index 97f12c9a4361..d114d32f5342 100644 --- a/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js +++ b/Specs/DataSources/StaticGroundGeometryColorBatchSpec.js @@ -1,27 +1,27 @@ defineSuite([ - 'DataSources/StaticGroundGeometryColorBatch', - 'Core/Color', - 'Core/Cartesian3', - 'Core/JulianDate', - 'DataSources/CallbackProperty', - 'DataSources/EllipseGeometryUpdater', - 'DataSources/Entity', - 'Scene/ClassificationType', - 'Scene/GroundPrimitive', - 'Specs/createScene', - 'Specs/pollToPromise' -], function( - StaticGroundGeometryColorBatch, - Color, - Cartesian3, - JulianDate, - CallbackProperty, - EllipseGeometryUpdater, - Entity, - ClassificationType, - GroundPrimitive, - createScene, - pollToPromise) { + 'DataSources/StaticGroundGeometryColorBatch', + 'Core/Cartesian3', + 'Core/Color', + 'Core/JulianDate', + 'DataSources/CallbackProperty', + 'DataSources/EllipseGeometryUpdater', + 'DataSources/Entity', + 'Scene/ClassificationType', + 'Scene/GroundPrimitive', + 'Specs/createScene', + 'Specs/pollToPromise' + ], function( + StaticGroundGeometryColorBatch, + Cartesian3, + Color, + JulianDate, + CallbackProperty, + EllipseGeometryUpdater, + Entity, + ClassificationType, + GroundPrimitive, + createScene, + pollToPromise) { 'use strict'; var time = JulianDate.now(); diff --git a/Specs/DataSources/StaticOutlineGeometryBatchSpec.js b/Specs/DataSources/StaticOutlineGeometryBatchSpec.js index 88f9ca62088c..feeaccd746ce 100644 --- a/Specs/DataSources/StaticOutlineGeometryBatchSpec.js +++ b/Specs/DataSources/StaticOutlineGeometryBatchSpec.js @@ -1,25 +1,25 @@ defineSuite([ - 'DataSources/StaticOutlineGeometryBatch', - 'Core/Cartesian3', - 'Core/Color', - 'Core/JulianDate', - 'DataSources/CallbackProperty', - 'DataSources/EllipseGeometryUpdater', - 'DataSources/Entity', - 'Scene/ShadowMode', - 'Specs/createScene', - 'Specs/pollToPromise' -], function( - StaticOutlineGeometryBatch, - Cartesian3, - Color, - JulianDate, - CallbackProperty, - EllipseGeometryUpdater, - Entity, - ShadowMode, - createScene, - pollToPromise) { + 'DataSources/StaticOutlineGeometryBatch', + 'Core/Cartesian3', + 'Core/Color', + 'Core/JulianDate', + 'DataSources/CallbackProperty', + 'DataSources/EllipseGeometryUpdater', + 'DataSources/Entity', + 'Scene/ShadowMode', + 'Specs/createScene', + 'Specs/pollToPromise' + ], function( + StaticOutlineGeometryBatch, + Cartesian3, + Color, + JulianDate, + CallbackProperty, + EllipseGeometryUpdater, + Entity, + ShadowMode, + createScene, + pollToPromise) { 'use strict'; var time = JulianDate.now(); diff --git a/Specs/Renderer/freezeRenderStateSpec.js b/Specs/Renderer/freezeRenderStateSpec.js index c12030f324c9..7be321a90428 100644 --- a/Specs/Renderer/freezeRenderStateSpec.js +++ b/Specs/Renderer/freezeRenderStateSpec.js @@ -1,7 +1,7 @@ defineSuite([ 'Renderer/freezeRenderState' - ], function( - freezeRenderState) { + ], function( + freezeRenderState) { 'use strict'; it('works as expected', function() { diff --git a/Specs/Scene/Batched3DModel3DTileContentClassificationSpec.js b/Specs/Scene/Batched3DModel3DTileContentClassificationSpec.js index 79c3fb6f48ea..781642d877dc 100644 --- a/Specs/Scene/Batched3DModel3DTileContentClassificationSpec.js +++ b/Specs/Scene/Batched3DModel3DTileContentClassificationSpec.js @@ -1,5 +1,4 @@ defineSuite([ - 'Scene/Batched3DModel3DTileContent', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color', @@ -14,13 +13,13 @@ defineSuite([ 'Core/RectangleGeometry', 'Core/Transforms', 'Renderer/Pass', + 'Scene/Batched3DModel3DTileContent', 'Scene/ClassificationType', 'Scene/PerInstanceColorAppearance', 'Scene/Primitive', 'Specs/Cesium3DTilesTester', 'Specs/createScene' ], 'Scene/Batched3DModel3DTileContentClassification', function( - Batched3DModel3DTileContent, Cartesian3, Cartographic, Color, @@ -35,6 +34,7 @@ defineSuite([ RectangleGeometry, Transforms, Pass, + Batched3DModel3DTileContent, ClassificationType, PerInstanceColorAppearance, Primitive, diff --git a/Specs/Scene/Batched3DModel3DTileContentSpec.js b/Specs/Scene/Batched3DModel3DTileContentSpec.js index 667affdd5ec2..b1ac299a4efb 100644 --- a/Specs/Scene/Batched3DModel3DTileContentSpec.js +++ b/Specs/Scene/Batched3DModel3DTileContentSpec.js @@ -5,11 +5,11 @@ defineSuite([ 'Core/HeadingPitchRange', 'Core/HeadingPitchRoll', 'Core/Transforms', - 'Specs/Cesium3DTilesTester', - 'Specs/createScene', 'Scene/ClippingPlane', 'Scene/ClippingPlaneCollection', - 'Scene/Model' + 'Scene/Model', + 'Specs/Cesium3DTilesTester', + 'Specs/createScene' ], function( Batched3DModel3DTileContent, Cartesian3, @@ -17,11 +17,11 @@ defineSuite([ HeadingPitchRange, HeadingPitchRoll, Transforms, - Cesium3DTilesTester, - createScene, ClippingPlane, ClippingPlaneCollection, - Model) { + Model, + Cesium3DTilesTester, + createScene) { 'use strict'; var scene; diff --git a/Specs/Scene/ClassificationModelSpec.js b/Specs/Scene/ClassificationModelSpec.js index d941c8a3e447..019ccb253803 100644 --- a/Specs/Scene/ClassificationModelSpec.js +++ b/Specs/Scene/ClassificationModelSpec.js @@ -18,9 +18,9 @@ defineSuite([ 'Scene/ClassificationType', 'Scene/PerInstanceColorAppearance', 'Scene/Primitive', - 'ThirdParty/GltfPipeline/parseBinaryGltf', 'Specs/createScene', - 'Specs/pollToPromise' + 'Specs/pollToPromise', + 'ThirdParty/GltfPipeline/parseBinaryGltf' ], function( ClassificationModel, Cartesian3, @@ -41,9 +41,9 @@ defineSuite([ ClassificationType, PerInstanceColorAppearance, Primitive, - parseBinaryGltf, createScene, - pollToPromise) { + pollToPromise, + parseBinaryGltf) { 'use strict'; var scene; diff --git a/Specs/Scene/ClippingPlaneCollectionSpec.js b/Specs/Scene/ClippingPlaneCollectionSpec.js index a575ac077772..f8e4c0d2434b 100644 --- a/Specs/Scene/ClippingPlaneCollectionSpec.js +++ b/Specs/Scene/ClippingPlaneCollectionSpec.js @@ -6,17 +6,17 @@ defineSuite([ 'Core/Cartesian3', 'Core/Cartesian4', 'Core/Color', - 'Core/Math', - 'Core/PixelFormat', - 'Renderer/PixelDatatype', 'Core/Intersect', + 'Core/Math', 'Core/Matrix4', + 'Core/PixelFormat', 'Core/Plane', - 'Specs/createScene', + 'Renderer/PixelDatatype', 'Renderer/TextureMagnificationFilter', 'Renderer/TextureMinificationFilter', 'Renderer/TextureWrap', - 'Scene/ClippingPlane' + 'Scene/ClippingPlane', + 'Specs/createScene' ], function( ClippingPlaneCollection, AttributeCompression, @@ -25,17 +25,17 @@ defineSuite([ Cartesian3, Cartesian4, Color, - CesiumMath, - PixelFormat, - PixelDatatype, Intersect, + CesiumMath, Matrix4, + PixelFormat, Plane, - createScene, + PixelDatatype, TextureMagnificationFilter, TextureMinificationFilter, TextureWrap, - ClippingPlane) { + ClippingPlane, + createScene) { 'use strict'; var clippingPlanes; diff --git a/Specs/Scene/CreditDisplaySpec.js b/Specs/Scene/CreditDisplaySpec.js index cad6db8f729f..6ab00dfc6f6e 100644 --- a/Specs/Scene/CreditDisplaySpec.js +++ b/Specs/Scene/CreditDisplaySpec.js @@ -1,11 +1,11 @@ defineSuite([ 'Scene/CreditDisplay', - 'Core/defined', - 'Core/Credit' + 'Core/Credit', + 'Core/defined' ], function( CreditDisplay, - defined, - Credit) { + Credit, + defined) { 'use strict'; var container; diff --git a/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js b/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js index ad3691309150..de5a89418d29 100644 --- a/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js +++ b/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js @@ -16,8 +16,8 @@ defineSuite([ 'Scene/ImageryProvider', 'Scene/ImageryState', 'Specs/pollToPromise', - 'ThirdParty/when', - 'ThirdParty/Uri' + 'ThirdParty/Uri', + 'ThirdParty/when' ], function( GoogleEarthEnterpriseImageryProvider, decodeGoogleEarthEnterpriseData, @@ -36,8 +36,8 @@ defineSuite([ ImageryProvider, ImageryState, pollToPromise, - when, - Uri) { + Uri, + when) { 'use strict'; beforeEach(function() { diff --git a/Specs/Scene/Instanced3DModel3DTileContentSpec.js b/Specs/Scene/Instanced3DModel3DTileContentSpec.js index 4f3521bbbb85..c5e409bdc083 100644 --- a/Specs/Scene/Instanced3DModel3DTileContentSpec.js +++ b/Specs/Scene/Instanced3DModel3DTileContentSpec.js @@ -4,24 +4,24 @@ defineSuite([ 'Core/HeadingPitchRange', 'Core/HeadingPitchRoll', 'Core/Transforms', - 'Scene/TileBoundingSphere', - 'Specs/Cesium3DTilesTester', - 'Specs/createScene', 'Scene/ClippingPlane', 'Scene/ClippingPlaneCollection', - 'Scene/Model' + 'Scene/Model', + 'Scene/TileBoundingSphere', + 'Specs/Cesium3DTilesTester', + 'Specs/createScene' ], 'Scene/Instanced3DModel3DTileContent', function( Cartesian3, Color, HeadingPitchRange, HeadingPitchRoll, Transforms, - TileBoundingSphere, - Cesium3DTilesTester, - createScene, ClippingPlane, ClippingPlaneCollection, - Model) { + Model, + TileBoundingSphere, + Cesium3DTilesTester, + createScene) { 'use strict'; var scene; diff --git a/Specs/Scene/IonImageryProviderSpec.js b/Specs/Scene/IonImageryProviderSpec.js index b1b8cd0e62fb..7f33c677d529 100644 --- a/Specs/Scene/IonImageryProviderSpec.js +++ b/Specs/Scene/IonImageryProviderSpec.js @@ -1,39 +1,39 @@ defineSuite([ - 'Scene/IonImageryProvider', - 'Core/IonResource', - 'Core/Credit', - 'Core/defaultValue', - 'Core/RequestScheduler', - 'Core/Resource', - 'Core/RuntimeError', - 'Scene/ArcGisMapServerImageryProvider', - 'Scene/BingMapsImageryProvider', - 'Scene/GoogleEarthEnterpriseMapsProvider', - 'Scene/ImageryProvider', - 'Scene/MapboxImageryProvider', - 'Scene/SingleTileImageryProvider', - 'Scene/UrlTemplateImageryProvider', - 'Scene/WebMapServiceImageryProvider', - 'Scene/WebMapTileServiceImageryProvider', - 'ThirdParty/when' -], function( - IonImageryProvider, - IonResource, - Credit, - defaultValue, - RequestScheduler, - Resource, - RuntimeError, - ArcGisMapServerImageryProvider, - BingMapsImageryProvider, - GoogleEarthEnterpriseMapsProvider, - ImageryProvider, - MapboxImageryProvider, - SingleTileImageryProvider, - UrlTemplateImageryProvider, - WebMapServiceImageryProvider, - WebMapTileServiceImageryProvider, - when) { + 'Scene/IonImageryProvider', + 'Core/Credit', + 'Core/defaultValue', + 'Core/IonResource', + 'Core/RequestScheduler', + 'Core/Resource', + 'Core/RuntimeError', + 'Scene/ArcGisMapServerImageryProvider', + 'Scene/BingMapsImageryProvider', + 'Scene/GoogleEarthEnterpriseMapsProvider', + 'Scene/ImageryProvider', + 'Scene/MapboxImageryProvider', + 'Scene/SingleTileImageryProvider', + 'Scene/UrlTemplateImageryProvider', + 'Scene/WebMapServiceImageryProvider', + 'Scene/WebMapTileServiceImageryProvider', + 'ThirdParty/when' + ], function( + IonImageryProvider, + Credit, + defaultValue, + IonResource, + RequestScheduler, + Resource, + RuntimeError, + ArcGisMapServerImageryProvider, + BingMapsImageryProvider, + GoogleEarthEnterpriseMapsProvider, + ImageryProvider, + MapboxImageryProvider, + SingleTileImageryProvider, + UrlTemplateImageryProvider, + WebMapServiceImageryProvider, + WebMapTileServiceImageryProvider, + when) { 'use strict'; function createTestProvider(endpointData) { diff --git a/Specs/Scene/PickSpec.js b/Specs/Scene/PickSpec.js index e32eeb0d72c1..638b8e51b7f7 100644 --- a/Specs/Scene/PickSpec.js +++ b/Specs/Scene/PickSpec.js @@ -10,8 +10,8 @@ defineSuite([ 'Scene/EllipsoidSurfaceAppearance', 'Scene/Primitive', 'Scene/SceneMode', - 'Specs/createScene', - 'Specs/createCanvas' + 'Specs/createCanvas', + 'Specs/createScene' ], 'Scene/Pick', function( FeatureDetection, GeometryInstance, @@ -24,8 +24,8 @@ defineSuite([ EllipsoidSurfaceAppearance, Primitive, SceneMode, - createScene, - createCanvas) { + createCanvas, + createScene) { 'use strict'; var scene; diff --git a/Specs/Scene/PointCloudEyeDomeLightingSpec.js b/Specs/Scene/PointCloudEyeDomeLightingSpec.js index f2d33a541e44..ceeb8da6113f 100644 --- a/Specs/Scene/PointCloudEyeDomeLightingSpec.js +++ b/Specs/Scene/PointCloudEyeDomeLightingSpec.js @@ -5,8 +5,8 @@ defineSuite([ 'Core/HeadingPitchRange', 'Core/HeadingPitchRoll', 'Core/Math', - 'Core/Transforms', 'Core/PerspectiveFrustum', + 'Core/Transforms', 'Scene/PointCloud3DTileContent', 'Scene/PointCloudEyeDomeLighting', 'Specs/Cesium3DTilesTester', @@ -18,8 +18,8 @@ defineSuite([ HeadingPitchRange, HeadingPitchRoll, CesiumMath, - Transforms, PerspectiveFrustum, + Transforms, PointCloud3DTileContent, PointCloudEyeDomeLighting, Cesium3DTilesTester, diff --git a/Specs/Scene/createTileMapServiceImageryProviderSpec.js b/Specs/Scene/createTileMapServiceImageryProviderSpec.js index cc3a7fed8711..01f0102362bd 100644 --- a/Specs/Scene/createTileMapServiceImageryProviderSpec.js +++ b/Specs/Scene/createTileMapServiceImageryProviderSpec.js @@ -1,43 +1,43 @@ defineSuite([ - 'Scene/createTileMapServiceImageryProvider', - 'Core/Cartesian2', - 'Core/Cartographic', - 'Core/DefaultProxy', - 'Core/GeographicProjection', - 'Core/GeographicTilingScheme', - 'Core/getAbsoluteUri', - 'Core/Math', - 'Core/Rectangle', - 'Core/RequestScheduler', - 'Core/Resource', - 'Core/WebMercatorProjection', - 'Core/WebMercatorTilingScheme', - 'Scene/Imagery', - 'Scene/ImageryLayer', - 'Scene/ImageryState', - 'Scene/UrlTemplateImageryProvider', - 'Specs/pollToPromise', - 'ThirdParty/when' -], function( - createTileMapServiceImageryProvider, - Cartesian2, - Cartographic, - DefaultProxy, - GeographicProjection, - GeographicTilingScheme, - getAbsoluteUri, - CesiumMath, - Rectangle, - RequestScheduler, - Resource, - WebMercatorProjection, - WebMercatorTilingScheme, - Imagery, - ImageryLayer, - ImageryState, - UrlTemplateImageryProvider, - pollToPromise, - when) { + 'Scene/createTileMapServiceImageryProvider', + 'Core/Cartesian2', + 'Core/Cartographic', + 'Core/DefaultProxy', + 'Core/GeographicProjection', + 'Core/GeographicTilingScheme', + 'Core/getAbsoluteUri', + 'Core/Math', + 'Core/Rectangle', + 'Core/RequestScheduler', + 'Core/Resource', + 'Core/WebMercatorProjection', + 'Core/WebMercatorTilingScheme', + 'Scene/Imagery', + 'Scene/ImageryLayer', + 'Scene/ImageryState', + 'Scene/UrlTemplateImageryProvider', + 'Specs/pollToPromise', + 'ThirdParty/when' + ], function( + createTileMapServiceImageryProvider, + Cartesian2, + Cartographic, + DefaultProxy, + GeographicProjection, + GeographicTilingScheme, + getAbsoluteUri, + CesiumMath, + Rectangle, + RequestScheduler, + Resource, + WebMercatorProjection, + WebMercatorTilingScheme, + Imagery, + ImageryLayer, + ImageryState, + UrlTemplateImageryProvider, + pollToPromise, + when) { 'use strict'; beforeEach(function() { diff --git a/Specs/createDynamicGeometryUpdaterSpecs.js b/Specs/createDynamicGeometryUpdaterSpecs.js index 76c46a32c180..e9278ba3fbe1 100644 --- a/Specs/createDynamicGeometryUpdaterSpecs.js +++ b/Specs/createDynamicGeometryUpdaterSpecs.js @@ -1,21 +1,21 @@ define([ - 'Core/BoundingSphere', - 'Core/JulianDate', - 'Core/Math', - 'DataSources/BoundingSphereState', - 'DataSources/EllipsoidGeometryUpdater', - 'Scene/PrimitiveCollection', - 'Specs/createDynamicProperty', - 'Specs/pollToPromise' -], function( - BoundingSphere, - JulianDate, - CesiumMath, - BoundingSphereState, - EllipsoidGeometryUpdater, - PrimitiveCollection, - createDynamicProperty, - pollToPromise) { + 'Core/BoundingSphere', + 'Core/JulianDate', + 'Core/Math', + 'DataSources/BoundingSphereState', + 'DataSources/EllipsoidGeometryUpdater', + 'Scene/PrimitiveCollection', + 'Specs/createDynamicProperty', + 'Specs/pollToPromise' + ], function( + BoundingSphere, + JulianDate, + CesiumMath, + BoundingSphereState, + EllipsoidGeometryUpdater, + PrimitiveCollection, + createDynamicProperty, + pollToPromise) { 'use strict'; function createDynamicGeometryUpdaterSpecs(Updater, geometryPropertyName, createDynamicEntity, getScene) { diff --git a/Specs/createGeometryUpdaterGroundGeometrySpecs.js b/Specs/createGeometryUpdaterGroundGeometrySpecs.js index 0380d6366733..79b5268e9340 100644 --- a/Specs/createGeometryUpdaterGroundGeometrySpecs.js +++ b/Specs/createGeometryUpdaterGroundGeometrySpecs.js @@ -1,21 +1,21 @@ define([ - 'Core/Color', - 'Core/JulianDate', - 'DataSources/ColorMaterialProperty', - 'DataSources/ConstantProperty', - 'DataSources/GridMaterialProperty', - 'DataSources/SampledProperty', - 'Scene/GroundPrimitive', - 'Scene/PrimitiveCollection' -], function( - Color, - JulianDate, - ColorMaterialProperty, - ConstantProperty, - GridMaterialProperty, - SampledProperty, - GroundPrimitive, - PrimitiveCollection) { + 'Core/Color', + 'Core/JulianDate', + 'DataSources/ColorMaterialProperty', + 'DataSources/ConstantProperty', + 'DataSources/GridMaterialProperty', + 'DataSources/SampledProperty', + 'Scene/GroundPrimitive', + 'Scene/PrimitiveCollection' + ], function( + Color, + JulianDate, + ColorMaterialProperty, + ConstantProperty, + GridMaterialProperty, + SampledProperty, + GroundPrimitive, + PrimitiveCollection) { 'use strict'; function createGeometryUpdaterGroundGeometrySpecs(Updater, geometryPropertyName, createEntity, createDynamicEntity, getScene) { diff --git a/Specs/createGeometryUpdaterSpecs.js b/Specs/createGeometryUpdaterSpecs.js index 827fe2cf105f..630384662e43 100644 --- a/Specs/createGeometryUpdaterSpecs.js +++ b/Specs/createGeometryUpdaterSpecs.js @@ -1,35 +1,35 @@ define([ - 'Core/Color', - 'Core/ColorGeometryInstanceAttribute', - 'Core/DistanceDisplayCondition', - 'Core/DistanceDisplayConditionGeometryInstanceAttribute', - 'Core/JulianDate', - 'Core/ShowGeometryInstanceAttribute', - 'Core/TimeInterval', - 'DataSources/ColorMaterialProperty', - 'DataSources/ConstantProperty', - 'DataSources/EllipsoidGeometryUpdater', - 'DataSources/Entity', - 'DataSources/GridMaterialProperty', - 'DataSources/SampledProperty', - 'DataSources/TimeIntervalCollectionProperty', - 'Scene/ShadowMode' -], function( - Color, - ColorGeometryInstanceAttribute, - DistanceDisplayCondition, - DistanceDisplayConditionGeometryInstanceAttribute, - JulianDate, - ShowGeometryInstanceAttribute, - TimeInterval, - ColorMaterialProperty, - ConstantProperty, - EllipsoidGeometryUpdater, - Entity, - GridMaterialProperty, - SampledProperty, - TimeIntervalCollectionProperty, - ShadowMode) { + 'Core/Color', + 'Core/ColorGeometryInstanceAttribute', + 'Core/DistanceDisplayCondition', + 'Core/DistanceDisplayConditionGeometryInstanceAttribute', + 'Core/JulianDate', + 'Core/ShowGeometryInstanceAttribute', + 'Core/TimeInterval', + 'DataSources/ColorMaterialProperty', + 'DataSources/ConstantProperty', + 'DataSources/EllipsoidGeometryUpdater', + 'DataSources/Entity', + 'DataSources/GridMaterialProperty', + 'DataSources/SampledProperty', + 'DataSources/TimeIntervalCollectionProperty', + 'Scene/ShadowMode' + ], function( + Color, + ColorGeometryInstanceAttribute, + DistanceDisplayCondition, + DistanceDisplayConditionGeometryInstanceAttribute, + JulianDate, + ShowGeometryInstanceAttribute, + TimeInterval, + ColorMaterialProperty, + ConstantProperty, + EllipsoidGeometryUpdater, + Entity, + GridMaterialProperty, + SampledProperty, + TimeIntervalCollectionProperty, + ShadowMode) { 'use strict'; function createGeometryUpdaterSpecs(Updater, geometryPropertyName, createEntity, getScene) {