From 48203901894b8b7d8eb65db8ac3d2f3272fe898b Mon Sep 17 00:00:00 2001
From: hpinkos 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.
*
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.rULi8x#89y0(#qCE z!(T#^<1VcEMN!$!@9(Jw8(AD$%j)OGhz3ogPr?E9RfaRBbo@C|#^FuL<2M8i&HVCP z0a%))-!n2jvl2g_`e($t(@!8BbIrm9)|WXKh*fajjCQ>HupQ)<0Us+4Nx$yj{UHu{ zgLZALUc*YR;i7<64P#qYp^bl#r=QMWiPfV>W?<=l*4SS|EDJFZ%$KoRGKVnMjV@Dj zP{An?ILG<3ni z_ (e3lyp*dZlnd5q_@3n@b$1{bi=E&wIm-R5YUHJQ=Y4yxTF!&QJly^~~? z`0|DOGQaLaB4Pn-`o;h)&38gKVtm9vO;aAI++(SdMql`et$HnnjQuFcR_F0R_X~i4 z;_jR%i{p;!40inyG3$GN8zT^t)r8z6)FgG<>v3dDCAB^4LK3tbfDy^?9@bBEh(*J2v#e;GTKkEE z2l#EeCDJ^tzywb2cp8|zf(%;@>gR~u2Hqzkl=8(I_HV1ho80!MqfSt~bot{4F`cFh z6P#~Dni3fR`YVBe{~GqcM)ceG2M0i)prWA@L1GXyA(N0Y3lY8zap*TP2n6W!(CEem z3e%iB?M0#inlMQd0o8W?CEVo@soEoH72#Dj7w^6T@98{Q#(pfS;0_0^;)hLThkRf| zzKcYF0~XQUPJZikcN~=!Jvji1BG*ofB>1~FQAe;02@S}S@nm9l3!o9tMBXaPpdE$T zm@n$ =ibLGp}Tj#>1t>Z#&g`BiHZr`%+(IRW1Tdy+U;S={Q#uv!? zQo>peqM^M;C3ni*!LN9;WAuU>mJ9oX-L+7W?FbBckLM{TueKpnL3_1&f!SOwB=GN7 z>_><+$vF8gRaX4Ac Sr*mAKP$*#gGIxU1y@TrCQmFg_g~eb0yJp+ zlKjTaHyLVp9c$<7mVlJOC)A0k5D9^GJ$f?bEUo9EoGFnz#pGmm8eLgm@Ev2KYq*{@ zB$#dET-ciwboFVAMWn^2p|6G=6Q_2B$O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FbdA-3;~3q L&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 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...
-- - - 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_Opacity- -~}rr8<7X__8Wlk_Be!C0Kk9O1E32tGJnhAyp?^A@BmP6 z3gO@KX>ZT3^!ACr>A&A)ENBU(4Q 5NK-?DpYxY26C+~|$RFO!>ni~8FHZ%A^%ttlj7*%|j4a$tEQE|)+-#iO ztStYr?jO(O7h3 DtpMO 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}qzp9vF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MvssWsNR^OA+SN2Z50>bYIF67m~`v9vz16f=o#A=~; @uzrwPhJLpl8piNSWJOu<_{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;~3q L&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 enableddiff --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: hpinkosDate: 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: hpinkosDate: 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 HunterDate: 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 \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;nLoading...
0&&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;o 0&&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;s 0?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&&a 1?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]&&n t.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.gzindex d&&(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.gzindex d&&(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,v 2;)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<