cesium 0.21 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/Assets/Textures/moonSmall.jpg +0 -0
  3. data/app/assets/javascripts/Cesium.js +10 -1
  4. data/app/assets/javascripts/Core/Cartesian2.js +28 -0
  5. data/app/assets/javascripts/Core/Cartesian3.js +28 -0
  6. data/app/assets/javascripts/Core/Cartesian4.js +28 -0
  7. data/app/assets/javascripts/Core/CatmullRomSpline.js +3 -3
  8. data/app/assets/javascripts/Core/Clock.js +7 -7
  9. data/app/assets/javascripts/Core/Color.js +1 -1
  10. data/app/assets/javascripts/Core/ComponentDatatype.js +11 -7
  11. data/app/assets/javascripts/Core/CorridorGeometryLibrary.js +23 -29
  12. data/app/assets/javascripts/Core/Ellipsoid.js +6 -0
  13. data/app/assets/javascripts/Core/EllipsoidTangentPlane.js +5 -4
  14. data/app/assets/javascripts/Core/Event.js +2 -1
  15. data/app/assets/javascripts/Core/ExtentGeometry.js +1 -1
  16. data/app/assets/javascripts/Core/ExtentOutlineGeometry.js +1 -1
  17. data/app/assets/javascripts/Core/GeometryAttributes.js +1 -1
  18. data/app/assets/javascripts/Core/GeometryInstance.js +2 -2
  19. data/app/assets/javascripts/Core/GeometryPipeline.js +10 -7
  20. data/app/assets/javascripts/Core/HermiteSpline.js +1 -1
  21. data/app/assets/javascripts/Core/Iau2000Orientation.js +132 -0
  22. data/app/assets/javascripts/Core/IauOrientationAxes.js +98 -0
  23. data/app/assets/javascripts/Core/IauOrientationParameters.js +48 -0
  24. data/app/assets/javascripts/Core/IntersectionTests.js +5 -5
  25. data/app/assets/javascripts/Core/JulianDate.js +27 -5
  26. data/app/assets/javascripts/Core/Math.js +9 -0
  27. data/app/assets/javascripts/Core/Matrix2.js +1 -142
  28. data/app/assets/javascripts/Core/Matrix3.js +168 -153
  29. data/app/assets/javascripts/Core/Matrix4.js +0 -249
  30. data/app/assets/javascripts/Core/NearFarScalar.js +13 -0
  31. data/app/assets/javascripts/Core/PolygonGeometry.js +1 -1
  32. data/app/assets/javascripts/Core/PolygonOutlineGeometry.js +2 -2
  33. data/app/assets/javascripts/Core/PolygonPipeline.js +2 -2
  34. data/app/assets/javascripts/Core/PolylinePipeline.js +7 -3
  35. data/app/assets/javascripts/Core/PolylineVolumeGeometry.js +239 -0
  36. data/app/assets/javascripts/Core/PolylineVolumeGeometryLibrary.js +404 -0
  37. data/app/assets/javascripts/Core/PolylineVolumeOutlineGeometry.js +154 -0
  38. data/app/assets/javascripts/Core/Quaternion.js +37 -10
  39. data/app/assets/javascripts/Core/Shapes.js +26 -2
  40. data/app/assets/javascripts/Core/Simon1994PlanetaryPositions.js +3 -3
  41. data/app/assets/javascripts/Core/TimeInterval.js +28 -17
  42. data/app/assets/javascripts/Core/TimeIntervalCollection.js +30 -0
  43. data/app/assets/javascripts/Core/Transforms.js +5 -5
  44. data/app/assets/javascripts/Core/WallGeometryLibrary.js +2 -2
  45. data/app/assets/javascripts/Core/getFilenameFromUri.js +37 -0
  46. data/app/assets/javascripts/DynamicScene/ColorMaterialProperty.js +2 -2
  47. data/app/assets/javascripts/DynamicScene/CzmlDataSource.js +96 -18
  48. data/app/assets/javascripts/DynamicScene/DataSource.js +8 -0
  49. data/app/assets/javascripts/DynamicScene/DynamicBillboard.js +15 -3
  50. data/app/assets/javascripts/DynamicScene/DynamicBillboardVisualizer.js +6 -1
  51. data/app/assets/javascripts/DynamicScene/DynamicConeVisualizerUsingCustomSensor.js +1 -1
  52. data/app/assets/javascripts/DynamicScene/DynamicLabel.js +12 -1
  53. data/app/assets/javascripts/DynamicScene/DynamicLabelVisualizer.js +5 -0
  54. data/app/assets/javascripts/DynamicScene/DynamicObject.js +44 -17
  55. data/app/assets/javascripts/DynamicScene/DynamicObjectView.js +3 -3
  56. data/app/assets/javascripts/DynamicScene/DynamicPoint.js +12 -1
  57. data/app/assets/javascripts/DynamicScene/DynamicPointVisualizer.js +11 -2
  58. data/app/assets/javascripts/DynamicScene/DynamicPolyline.js +10 -30
  59. data/app/assets/javascripts/DynamicScene/DynamicPolylineVisualizer.js +5 -20
  60. data/app/assets/javascripts/DynamicScene/GeoJsonDataSource.js +26 -8
  61. data/app/assets/javascripts/DynamicScene/GridMaterialProperty.js +2 -2
  62. data/app/assets/javascripts/DynamicScene/ImageMaterialProperty.js +2 -2
  63. data/app/assets/javascripts/DynamicScene/PolylineOutlineMaterialProperty.js +66 -0
  64. data/app/assets/javascripts/DynamicScene/PositionProperty.js +3 -3
  65. data/app/assets/javascripts/DynamicScene/ReferenceProperty.js +1 -1
  66. data/app/assets/javascripts/DynamicScene/SampledProperty.js +14 -8
  67. data/app/assets/javascripts/Renderer/AutomaticUniforms.js +4 -3
  68. data/app/assets/javascripts/Renderer/Context.js +16 -2
  69. data/app/assets/javascripts/Renderer/UniformState.js +14 -14
  70. data/app/assets/javascripts/Scene/Billboard.js +102 -26
  71. data/app/assets/javascripts/Scene/BillboardCollection.js +69 -16
  72. data/app/assets/javascripts/Scene/Camera.js +7 -7
  73. data/app/assets/javascripts/Scene/CameraController.js +23 -12
  74. data/app/assets/javascripts/Scene/CameraFlightPath.js +11 -11
  75. data/app/assets/javascripts/Scene/CentralBodySurface.js +1 -1
  76. data/app/assets/javascripts/Scene/CustomSensorVolume.js +17 -2
  77. data/app/assets/javascripts/Scene/EllipsoidPrimitive.js +79 -24
  78. data/app/assets/javascripts/Scene/ExtentPrimitive.js +17 -1
  79. data/app/assets/javascripts/Scene/Label.js +94 -18
  80. data/app/assets/javascripts/Scene/LabelCollection.js +6 -2
  81. data/app/assets/javascripts/Scene/Moon.js +150 -0
  82. data/app/assets/javascripts/Scene/Polygon.js +18 -1
  83. data/app/assets/javascripts/Scene/Polyline.js +32 -13
  84. data/app/assets/javascripts/Scene/PolylineCollection.js +7 -6
  85. data/app/assets/javascripts/Scene/Primitive.js +2 -2
  86. data/app/assets/javascripts/Scene/RectangularPyramidSensorVolume.js +12 -0
  87. data/app/assets/javascripts/Scene/Scene.js +122 -14
  88. data/app/assets/javascripts/Scene/SceneTransforms.js +2 -2
  89. data/app/assets/javascripts/Scene/SceneTransitioner.js +4 -4
  90. data/app/assets/javascripts/Scene/ScreenSpaceCameraController.js +1 -1
  91. data/app/assets/javascripts/Scene/SkyBox.js +53 -48
  92. data/app/assets/javascripts/Scene/TileMapServiceImageryProvider.js +2 -2
  93. data/app/assets/javascripts/Shaders/BillboardCollectionVS.glsl +36 -14
  94. data/app/assets/javascripts/Shaders/BillboardCollectionVS.js +27 -9
  95. data/app/assets/javascripts/Shaders/Builtin/Functions/phong.glsl +13 -0
  96. data/app/assets/javascripts/Shaders/Builtin/Functions/phong.js +10 -0
  97. data/app/assets/javascripts/Shaders/EllipsoidFS.glsl +24 -0
  98. data/app/assets/javascripts/Shaders/EllipsoidFS.js +21 -1
  99. data/app/assets/javascripts/Widgets/CesiumWidget/CesiumWidget.js +30 -9
  100. data/app/assets/javascripts/Widgets/HomeButton/HomeButtonViewModel.js +6 -5
  101. data/app/assets/javascripts/Widgets/Viewer/Viewer.js +13 -0
  102. data/app/assets/javascripts/Widgets/Viewer/viewerDynamicObjectMixin.js +46 -4
  103. data/app/assets/javascripts/Workers/cesiumWorkerBootstrapper.js +16 -8
  104. data/app/assets/javascripts/Workers/createPolylineVolumeGeometry.js +23 -0
  105. data/app/assets/javascripts/Workers/createPolylineVolumeOutlineGeometry.js +23 -0
  106. data/lib/cesium/version.rb +1 -1
  107. metadata +15 -5
  108. data/test/dummy/tmp/pids/server.pid +0 -1
@@ -127,9 +127,9 @@ define(['Core/Cartesian3', 'Core/defaultValue', 'Core/defined', 'Core/DeveloperE
127
127
  w = 0.5 * root;
128
128
  root = 0.5 / root; // 1/(4w)
129
129
 
130
- x = (matrix[Matrix3.COLUMN2ROW1] - matrix[Matrix3.COLUMN1ROW2]) * root;
131
- y = (matrix[Matrix3.COLUMN0ROW2] - matrix[Matrix3.COLUMN2ROW0]) * root;
132
- z = (matrix[Matrix3.COLUMN1ROW0] - matrix[Matrix3.COLUMN0ROW1]) * root;
130
+ x = (matrix[Matrix3.COLUMN1ROW2] - matrix[Matrix3.COLUMN2ROW1]) * root;
131
+ y = (matrix[Matrix3.COLUMN2ROW0] - matrix[Matrix3.COLUMN0ROW2]) * root;
132
+ z = (matrix[Matrix3.COLUMN0ROW1] - matrix[Matrix3.COLUMN1ROW0]) * root;
133
133
  } else {
134
134
  // |w| <= 1/2
135
135
  var next = fromRotationMatrixNext;
@@ -153,9 +153,9 @@ define(['Core/Cartesian3', 'Core/defaultValue', 'Core/defined', 'Core/DeveloperE
153
153
  quat[j] = (matrix[Matrix3.getElementIndex(j, i)] + matrix[Matrix3.getElementIndex(i, j)]) * root;
154
154
  quat[k] = (matrix[Matrix3.getElementIndex(k, i)] + matrix[Matrix3.getElementIndex(i, k)]) * root;
155
155
 
156
- x = quat[0];
157
- y = quat[1];
158
- z = quat[2];
156
+ x = -quat[0];
157
+ y = -quat[1];
158
+ z = -quat[2];
159
159
  }
160
160
 
161
161
  if (!defined(result)) {
@@ -291,9 +291,7 @@ define(['Core/Cartesian3', 'Core/defaultValue', 'Core/defined', 'Core/DeveloperE
291
291
  if (!defined(result)) {
292
292
  result = new Quaternion();
293
293
  }
294
- sampledQuaternionRotation.x = array[0];
295
- sampledQuaternionRotation.y = array[1];
296
- sampledQuaternionRotation.z = array[2];
294
+ Cartesian3.fromArray(array, 0, sampledQuaternionRotation);
297
295
  var magnitude = Cartesian3.magnitude(sampledQuaternionRotation);
298
296
 
299
297
  Quaternion.unpack(sourceArray, lastIndex * 4, sampledQuaternionQuaternion0);
@@ -304,7 +302,8 @@ define(['Core/Cartesian3', 'Core/defaultValue', 'Core/defined', 'Core/DeveloperE
304
302
  Quaternion.fromAxisAngle(sampledQuaternionRotation, magnitude, sampledQuaternionTempQuaternion);
305
303
  }
306
304
 
307
- return Quaternion.multiply(sampledQuaternionTempQuaternion, sampledQuaternionQuaternion0, result);
305
+ Quaternion.multiply(sampledQuaternionTempQuaternion, sampledQuaternionQuaternion0, result);
306
+ return Quaternion.conjugate(result, result);
308
307
  };
309
308
 
310
309
  /**
@@ -839,6 +838,34 @@ define(['Core/Cartesian3', 'Core/defaultValue', 'Core/defined', 'Core/DeveloperE
839
838
  return Quaternion.clone(this, result);
840
839
  };
841
840
 
841
+ /**
842
+ * Compares this and the provided quaternion componentwise and returns
843
+ * <code>true</code> if they are equal, <code>false</code> otherwise.
844
+ * @memberof Quaternion
845
+ *
846
+ * @param {Quaternion} [right] The right hand side quaternion.
847
+ * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
848
+ */
849
+ Quaternion.prototype.equals = function(right) {
850
+ return Quaternion.equals(this, right);
851
+ };
852
+
853
+ /**
854
+ * Compares this and the provided quaternion componentwise and returns
855
+ * <code>true</code> if they are within the provided epsilon,
856
+ * <code>false</code> otherwise.
857
+ * @memberof Quaternion
858
+ *
859
+ * @param {Quaternion} [right] The right hand side quaternion.
860
+ * @param {Number} epsilon The epsilon to use for equality testing.
861
+ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
862
+ *
863
+ * @exception {DeveloperError} epsilon is required and must be a number.
864
+ */
865
+ Quaternion.prototype.equalsEpsilon = function(right, epsilon) {
866
+ return Quaternion.equalsEpsilon(this, right, epsilon);
867
+ };
868
+
842
869
  /**
843
870
  * Returns a string representing this quaternion in the format (x, y, z, w).
844
871
  * @memberof Quaternion
@@ -1,9 +1,10 @@
1
1
  /*global define*/
2
- define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Math', 'Core/Cartesian3', 'Core/Quaternion', 'Core/Matrix3'], function(
2
+ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Math', 'Core/Cartesian2', 'Core/Cartesian3', 'Core/Quaternion', 'Core/Matrix3'], function(
3
3
  defaultValue,
4
4
  defined,
5
5
  DeveloperError,
6
6
  CesiumMath,
7
+ Cartesian2,
7
8
  Cartesian3,
8
9
  Quaternion,
9
10
  Matrix3) {
@@ -49,7 +50,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Math',
49
50
  var unitQuat = Quaternion.normalize(new Quaternion(rotAxis.x * temp, rotAxis.y * temp, rotAxis.z * temp, Math.cos(angle / 2.0)));
50
51
  var rotMtx = Matrix3.fromQuaternion(unitQuat);
51
52
 
52
- var tmpEllipsePts = rotMtx.multiplyByVector(unitPos);
53
+ var tmpEllipsePts = Matrix3.multiplyByVector(rotMtx, unitPos);
53
54
  var unitCart = Cartesian3.normalize(tmpEllipsePts);
54
55
  tmpEllipsePts = Cartesian3.multiplyByScalar(unitCart, cbRadius);
55
56
  ellipsePts[ellipsePtsIndex] = tmpEllipsePts;
@@ -219,6 +220,29 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Math',
219
220
  ellipsePts.push(Cartesian3.clone(ellipsePts[0])); // Duplicates first and last point for polyline
220
221
 
221
222
  return ellipsePts;
223
+ },
224
+
225
+ /**
226
+ * Computes a 2D circle about the origin.
227
+ *
228
+ * @param {Number} [radius = 1.0] The radius of the circle
229
+ * @param {Number} [granularity = Cesium.RADIANS_PER_DEGREE*2] The radius of the circle
230
+ *
231
+ * @returns The set of points that form the ellipse's boundary.
232
+ *
233
+ * @example
234
+ * var circle = Shapes.compute2DCircle(100000.0);
235
+ */
236
+ compute2DCircle : function(radius, granularity) {
237
+ radius = defaultValue(radius, 1.0);
238
+ granularity = defaultValue(granularity, CesiumMath.RADIANS_PER_DEGREE*2);
239
+ var positions = [];
240
+ var theta = CesiumMath.toRadians(1.0);
241
+ var posCount = Math.PI*2/theta;
242
+ for (var i = 0; i < posCount; i++) {
243
+ positions.push(new Cartesian2(radius * Math.cos(theta * i), radius * Math.sin(theta * i)));
244
+ }
245
+ return positions;
222
246
  }
223
247
  };
224
248
 
@@ -100,7 +100,7 @@ define(['Core/Cartesian3', 'Core/defined', 'Core/DeveloperError', 'Core/JulianDa
100
100
  result.z = 0.0;
101
101
  }
102
102
 
103
- return perifocalToEquatorial.multiplyByVector(result, result);
103
+ return Matrix3.multiplyByVector(perifocalToEquatorial, result, result);
104
104
  }
105
105
 
106
106
  function chooseOrbit(eccentricity, tolerance) {
@@ -485,7 +485,7 @@ define(['Core/Cartesian3', 'Core/defined', 'Core/DeveloperError', 'Core/JulianDa
485
485
  computeSimonEarth(date, translation);
486
486
 
487
487
  Cartesian3.subtract(result, translation, result);
488
- axesTransformation.multiplyByVector(result, result);
488
+ Matrix3.multiplyByVector(axesTransformation, result, result);
489
489
 
490
490
  return result;
491
491
  };
@@ -502,7 +502,7 @@ define(['Core/Cartesian3', 'Core/defined', 'Core/DeveloperError', 'Core/JulianDa
502
502
  date = new JulianDate();
503
503
  }
504
504
  result = computeSimonMoon(date, result);
505
- axesTransformation.multiplyByVector(result, result);
505
+ Matrix3.multiplyByVector(axesTransformation, result, result);
506
506
 
507
507
  return result;
508
508
  };
@@ -105,23 +105,27 @@ define(['Core/defined', 'Core/DeveloperError', 'Core/freezeObject', 'Core/Julian
105
105
  };
106
106
 
107
107
  /**
108
- * Compares the provided TimeIntervals componentwise and returns
108
+ * Compares the provided TimeIntervals and returns
109
109
  * <code>true</code> if they are equal, <code>false</code> otherwise.
110
110
  * @memberof TimeInterval
111
111
  *
112
- * @param {TimeInterval} [left] The first Cartesian.
113
- * @param {TimeInterval} [right] The second Cartesian.
112
+ * @param {TimeInterval} [left] The first interval.
113
+ * @param {TimeInterval} [right] The second interval.
114
+ * @param {Function} [dataComparer] A function which compares the data of the two intervals. If ommitted, reference equality is used.
115
+ *
114
116
  * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
115
117
  */
116
- TimeInterval.equals = function(left, right) {
118
+ TimeInterval.equals = function(left, right, dataComparer) {
117
119
  return left === right ||
118
120
  defined(left) &&
119
121
  defined(right) &&
120
122
  (left.isEmpty && right.isEmpty ||
121
123
  left.isStartIncluded === right.isStartIncluded &&
122
124
  left.isStopIncluded === right.isStopIncluded &&
123
- left.start.equals(right.start) &&
124
- left.stop.equals(right.stop));
125
+ JulianDate.equals(left.start, right.start) &&
126
+ JulianDate.equals(left.stop, right.stop) &&
127
+ (left.data === right.data ||
128
+ (defined(dataComparer) && dataComparer(left.data, right.data))));
125
129
  };
126
130
 
127
131
  /**
@@ -133,12 +137,13 @@ define(['Core/defined', 'Core/DeveloperError', 'Core/freezeObject', 'Core/Julian
133
137
  * @param {TimeInterval} [left] The first TimeInterval.
134
138
  * @param {TimeInterval} [right] The second TimeInterval.
135
139
  * @param {Number} epsilon The epsilon to use for equality testing.
140
+ * @param {Function} [dataComparer] A function which compares the data of the two intervals. If ommitted, reference equality is used.
136
141
  *
137
142
  * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
138
143
  *
139
144
  * @exception {DeveloperError} epsilon is required and must be number.
140
145
  */
141
- TimeInterval.equalsEpsilon = function(left, right, epsilon) {
146
+ TimeInterval.equalsEpsilon = function(left, right, epsilon, dataComparer) {
142
147
  if (typeof epsilon !== 'number') {
143
148
  throw new DeveloperError('epsilon is required and must be a number.');
144
149
  }
@@ -149,8 +154,10 @@ define(['Core/defined', 'Core/DeveloperError', 'Core/freezeObject', 'Core/Julian
149
154
  (left.isEmpty && right.isEmpty ||
150
155
  left.isStartIncluded === right.isStartIncluded &&
151
156
  left.isStopIncluded === right.isStopIncluded &&
152
- left.start.equalsEpsilon(right.start, epsilon) &&
153
- left.stop.equalsEpsilon(right.stop, epsilon));
157
+ JulianDate.equalsEpsilon(left.start, right.start, epsilon) &&
158
+ JulianDate.equalsEpsilon(left.stop, right.stop, epsilon) &&
159
+ (left.data === right.data ||
160
+ (defined(dataComparer) && dataComparer(left.data, right.data))));
154
161
  };
155
162
 
156
163
  /**
@@ -205,14 +212,14 @@ define(['Core/defined', 'Core/DeveloperError', 'Core/freezeObject', 'Core/Julian
205
212
 
206
213
  if (otherStart.greaterThanOrEquals(thisStart) && thisStop.greaterThanOrEquals(otherStart)) {
207
214
 
208
- isStartIncluded = (!otherStart.equals(thisStart) && otherIsStartIncluded) || (thisIsStartIncluded && otherIsStartIncluded);
215
+ isStartIncluded = (!JulianDate.equals(otherStart, thisStart) && otherIsStartIncluded) || (thisIsStartIncluded && otherIsStartIncluded);
209
216
 
210
217
  isStopIncluded = thisIsStopIncluded && otherIsStopIncluded;
211
218
 
212
219
  outputData = defined(mergeCallback) ? mergeCallback(this.data, other.data) : this.data;
213
220
 
214
221
  if (thisStop.greaterThanOrEquals(otherStop)) {
215
- isStopIncluded = isStopIncluded || (!otherStop.equals(thisStop) && otherIsStopIncluded);
222
+ isStopIncluded = isStopIncluded || (!JulianDate.equals(otherStop, thisStop) && otherIsStopIncluded);
216
223
  return new TimeInterval(otherStart, otherStop, isStartIncluded, isStopIncluded, outputData);
217
224
  }
218
225
 
@@ -222,13 +229,13 @@ define(['Core/defined', 'Core/DeveloperError', 'Core/freezeObject', 'Core/Julian
222
229
 
223
230
  if (otherStart.lessThanOrEquals(thisStart) && thisStart.lessThanOrEquals(otherStop)) {
224
231
 
225
- isStartIncluded = (otherStart.equals(thisStart) === false && thisIsStartIncluded) || (thisIsStartIncluded && otherIsStartIncluded);
232
+ isStartIncluded = (JulianDate.equals(otherStart, thisStart) === false && thisIsStartIncluded) || (thisIsStartIncluded && otherIsStartIncluded);
226
233
 
227
234
  isStopIncluded = thisIsStopIncluded && otherIsStopIncluded;
228
235
 
229
236
  outputData = defined(mergeCallback) ? mergeCallback(this.data, other.data) : this.data;
230
237
  if (thisStop.greaterThanOrEquals(otherStop)) {
231
- isStopIncluded = isStopIncluded || (otherStop.equals(thisStop) === false && otherIsStopIncluded);
238
+ isStopIncluded = isStopIncluded || (JulianDate.equals(otherStop, thisStop) === false && otherIsStopIncluded);
232
239
  return new TimeInterval(thisStart, otherStop, isStartIncluded, isStopIncluded, outputData);
233
240
  }
234
241
 
@@ -275,10 +282,12 @@ define(['Core/defined', 'Core/DeveloperError', 'Core/freezeObject', 'Core/Julian
275
282
  * @memberof TimeInterval
276
283
  *
277
284
  * @param {TimeInterval} [right] The right hand side Cartesian.
285
+ * @param {Function} [dataComparer] A function which compares the data of the two intervals. If ommitted, reference equality is used.
286
+ *
278
287
  * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
279
288
  */
280
- TimeInterval.prototype.equals = function(other) {
281
- return TimeInterval.equals(this, other);
289
+ TimeInterval.prototype.equals = function(other, dataComparer) {
290
+ return TimeInterval.equals(this, other, dataComparer);
282
291
  };
283
292
 
284
293
  /**
@@ -289,12 +298,14 @@ define(['Core/defined', 'Core/DeveloperError', 'Core/freezeObject', 'Core/Julian
289
298
  *
290
299
  * @param {TimeInterval} [right] The right hand side Cartesian.
291
300
  * @param {Number} epsilon The epsilon to use for equality testing.
301
+ * @param {Function} [dataComparer] A function which compares the data of the two intervals. If ommitted, reference equality is used.
302
+ *
292
303
  * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
293
304
  *
294
305
  * @exception {DeveloperError} epsilon is required and must be a number.
295
306
  */
296
- TimeInterval.prototype.equalsEpsilon = function(other, epsilon) {
297
- return TimeInterval.equalsEpsilon(this, other, epsilon);
307
+ TimeInterval.prototype.equalsEpsilon = function(other, epsilon, dataComparer) {
308
+ return TimeInterval.equalsEpsilon(this, other, epsilon, dataComparer);
298
309
  };
299
310
 
300
311
  return TimeInterval;
@@ -25,6 +25,36 @@ define(['Core/defined', 'Core/DeveloperError', 'Core/binarySearch', 'Core/TimeIn
25
25
  this._intervals = [];
26
26
  };
27
27
 
28
+ /**
29
+ * Compares the provided TimeIntervalCollections and returns
30
+ * <code>true</code> if they are equal, <code>false</code> otherwise.
31
+ * @memberof TimeIntervalCollection
32
+ *
33
+ * @param {TimeInterval} [right] The right hand side collection.
34
+ * @param {Function} [dataComparer] A function which compares the data for each interval in the collection. If ommitted, reference equality is used.
35
+ * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
36
+ */
37
+ TimeIntervalCollection.prototype.equals = function(right, dataComparer) {
38
+ if (this === right) {
39
+ return true;
40
+ }
41
+ if (!(right instanceof TimeIntervalCollection)) {
42
+ return false;
43
+ }
44
+ var intervals = this._intervals;
45
+ var rightIntervals = right._intervals;
46
+ var length = intervals.length;
47
+ if (length !== rightIntervals.length) {
48
+ return false;
49
+ }
50
+ for ( var i = 0; i < length; i++) {
51
+ if (!TimeInterval.equals(intervals[i], rightIntervals[i], dataComparer)) {
52
+ return false;
53
+ }
54
+ }
55
+ return true;
56
+ };
57
+
28
58
  /**
29
59
  * Gets the interval at the specified index.
30
60
  *
@@ -416,7 +416,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Iau200
416
416
  return undefined;
417
417
  }
418
418
 
419
- return fixedToIcrfMtx.transpose(result);
419
+ return Matrix3.transpose(fixedToIcrfMtx, result);
420
420
  };
421
421
 
422
422
  var xysScratch = new Iau2006XysSample(0.0, 0.0, 0.0);
@@ -449,7 +449,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Iau200
449
449
  * var fixedToIcrf = Transforms.computeIcrfToFixedMatrix(now);
450
450
  * var pointInInertial;
451
451
  * if (defined(fixedToIcrf)) {
452
- * pointInInertial = fixedToIcrf.multiplyByVector(pointInFixed);
452
+ * pointInInertial = Matrix3.multiplyByVector(fixedToIcrf, pointInFixed);
453
453
  * }
454
454
  */
455
455
  Transforms.computeFixedToIcrfMatrix = function(date, result) {
@@ -494,7 +494,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Iau200
494
494
  rotation1[8] = 1 - a * (x * x + y * y);
495
495
 
496
496
  var rotation2 = Matrix3.fromRotationZ(-xys.s, rotation2Scratch);
497
- var matrixQ = rotation1.multiply(rotation2, rotation1Scratch);
497
+ var matrixQ = Matrix3.multiply(rotation1, rotation2, rotation1Scratch);
498
498
 
499
499
  // Similar to TT conversions above
500
500
  // It's possible here that secondTT could roll over 86400
@@ -520,7 +520,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Iau200
520
520
  var earthRotation = Matrix3.fromRotationZ(era, rotation2Scratch);
521
521
 
522
522
  // pseudoFixed to ICRF
523
- var pfToIcrf = matrixQ.multiply(earthRotation, rotation1Scratch);
523
+ var pfToIcrf = Matrix3.multiply(matrixQ, earthRotation, rotation1Scratch);
524
524
 
525
525
  // Compute pole wander matrix
526
526
  var cosxp = Math.cos(eop.xPoleWander);
@@ -547,7 +547,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Iau200
547
547
  fToPfMtx[7] = sinyp * cossp - cosyp * sinxp * sinsp;
548
548
  fToPfMtx[8] = cosyp * cosxp;
549
549
 
550
- return pfToIcrf.multiply(fToPfMtx, result);
550
+ return Matrix3.multiply(pfToIcrf, fToPfMtx, result);
551
551
  };
552
552
 
553
553
  var pointToWindowCoordinatesTemp = new Cartesian4();
@@ -84,7 +84,7 @@ define(['Core/defined', 'Core/Cartographic', 'Core/Cartesian3', 'Core/DeveloperE
84
84
  cleanedTopHeights[i-1] = c1.height;
85
85
  }
86
86
 
87
- c0 = c1.clone(c0);
87
+ Cartographic.clone(c1, c0);
88
88
  }
89
89
 
90
90
  return {
@@ -173,4 +173,4 @@ define(['Core/defined', 'Core/Cartographic', 'Core/Cartesian3', 'Core/DeveloperE
173
173
  };
174
174
 
175
175
  return WallGeometryLibrary;
176
- });
176
+ });
@@ -0,0 +1,37 @@
1
+ /*global define*/
2
+ define(['Core/defined', 'Core/DeveloperError', 'ThirdParty/Uri'], function(
3
+ defined,
4
+ DeveloperError,
5
+ Uri) {
6
+ "use strict";
7
+
8
+ /**
9
+ * Given a URI, returns the last segment of the URI, removing any path or query information.
10
+ * @exports getFilenameFromUri
11
+ *
12
+ * @param {String} uri The Uri.
13
+ * @returns {String} The last segment of the Uri.
14
+ *
15
+ * @exception {DeveloperError} uri is required.
16
+ *
17
+ * @example
18
+ * //fileName will be"simple.czml";
19
+ * var fileName = getFilenameFromUri('/Gallery/simple.czml?value=true&example=false');
20
+ */
21
+ var getFilenameFromUri = function(uri) {
22
+ if (!defined(uri)) {
23
+ throw new DeveloperError('uri is required.');
24
+ }
25
+
26
+ var uriObject = new Uri(uri);
27
+ uriObject.normalize();
28
+ var path = uriObject.path;
29
+ var index = path.lastIndexOf('/');
30
+ if (index !== -1) {
31
+ path = path.substr(index + 1);
32
+ }
33
+ return path;
34
+ };
35
+
36
+ return getFilenameFromUri;
37
+ });
@@ -21,7 +21,7 @@ define(['Core/Color', 'Core/defined', 'DynamicScene/ConstantProperty'], function
21
21
 
22
22
  /**
23
23
  * Gets the {@link Material} type at the provided time.
24
- * @memberof MaterialProperty
24
+ * @memberof ColorMaterialProperty
25
25
  *
26
26
  * @param {JulianDate} time The time for which to retrieve the type.
27
27
  * @type {String} The type of material.
@@ -32,7 +32,7 @@ define(['Core/Color', 'Core/defined', 'DynamicScene/ConstantProperty'], function
32
32
 
33
33
  /**
34
34
  * Gets the value of the property at the provided time.
35
- * @memberof MaterialProperty
35
+ * @memberof ColorMaterialProperty
36
36
  *
37
37
  * @param {JulianDate} time The time for which to retrieve the value.
38
38
  * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.
@@ -1,5 +1,5 @@
1
1
  /*global define*/
2
- define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color', 'Core/ClockRange', 'Core/ClockStep', 'Core/createGuid', 'Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Ellipsoid', 'Core/Event', 'Core/HermitePolynomialApproximation', 'Core/Iso8601', 'Core/JulianDate', 'Core/LagrangePolynomialApproximation', 'Core/LinearApproximation', 'Core/loadJson', 'Core/Math', 'Core/Quaternion', 'Core/ReferenceFrame', 'Core/RuntimeError', 'Core/Spherical', 'Core/TimeInterval', 'Scene/HorizontalOrigin', 'Scene/LabelStyle', 'Scene/VerticalOrigin', 'DynamicScene/CompositeMaterialProperty', 'DynamicScene/CompositePositionProperty', 'DynamicScene/CompositeProperty', 'DynamicScene/ConstantPositionProperty', 'DynamicScene/ConstantProperty', 'DynamicScene/DynamicBillboard', 'DynamicScene/DynamicClock', 'DynamicScene/ColorMaterialProperty', 'DynamicScene/DynamicCone', 'DynamicScene/DynamicLabel', 'DynamicScene/DynamicDirectionsProperty', 'DynamicScene/DynamicEllipse', 'DynamicScene/DynamicEllipsoid', 'DynamicScene/GridMaterialProperty', 'DynamicScene/ImageMaterialProperty', 'DynamicScene/DynamicObjectCollection', 'DynamicScene/DynamicPath', 'DynamicScene/DynamicPoint', 'DynamicScene/DynamicPolyline', 'DynamicScene/DynamicPolygon', 'DynamicScene/DynamicPyramid', 'DynamicScene/DynamicVector', 'DynamicScene/DynamicVertexPositionsProperty', 'DynamicScene/SampledPositionProperty', 'DynamicScene/SampledProperty', 'DynamicScene/TimeIntervalCollectionPositionProperty', 'DynamicScene/TimeIntervalCollectionProperty', 'ThirdParty/Uri', 'ThirdParty/when'], function(
2
+ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color', 'Core/ClockRange', 'Core/ClockStep', 'Core/createGuid', 'Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Ellipsoid', 'Core/Event', 'Core/getFilenameFromUri', 'Core/HermitePolynomialApproximation', 'Core/Iso8601', 'Core/JulianDate', 'Core/LagrangePolynomialApproximation', 'Core/LinearApproximation', 'Core/loadJson', 'Core/Math', 'Core/Quaternion', 'Core/ReferenceFrame', 'Core/RuntimeError', 'Core/Spherical', 'Core/TimeInterval', 'Scene/HorizontalOrigin', 'Scene/LabelStyle', 'Scene/VerticalOrigin', 'DynamicScene/CompositeMaterialProperty', 'DynamicScene/CompositePositionProperty', 'DynamicScene/CompositeProperty', 'DynamicScene/ConstantPositionProperty', 'DynamicScene/ConstantProperty', 'DynamicScene/DynamicBillboard', 'DynamicScene/DynamicClock', 'DynamicScene/ColorMaterialProperty', 'DynamicScene/PolylineOutlineMaterialProperty', 'DynamicScene/DynamicCone', 'DynamicScene/DynamicLabel', 'DynamicScene/DynamicDirectionsProperty', 'DynamicScene/DynamicEllipse', 'DynamicScene/DynamicEllipsoid', 'DynamicScene/GridMaterialProperty', 'DynamicScene/ImageMaterialProperty', 'DynamicScene/DynamicObject', 'DynamicScene/DynamicObjectCollection', 'DynamicScene/DynamicPath', 'DynamicScene/DynamicPoint', 'DynamicScene/DynamicPolyline', 'DynamicScene/DynamicPolygon', 'DynamicScene/DynamicPyramid', 'DynamicScene/DynamicVector', 'DynamicScene/DynamicVertexPositionsProperty', 'DynamicScene/SampledPositionProperty', 'DynamicScene/SampledProperty', 'DynamicScene/TimeIntervalCollectionPositionProperty', 'DynamicScene/TimeIntervalCollectionProperty', 'ThirdParty/Uri', 'ThirdParty/when'], function(
3
3
  Cartesian2,
4
4
  Cartesian3,
5
5
  Cartographic,
@@ -12,6 +12,7 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
12
12
  DeveloperError,
13
13
  Ellipsoid,
14
14
  Event,
15
+ getFilenameFromUri,
15
16
  HermitePolynomialApproximation,
16
17
  Iso8601,
17
18
  JulianDate,
@@ -35,6 +36,7 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
35
36
  DynamicBillboard,
36
37
  DynamicClock,
37
38
  ColorMaterialProperty,
39
+ PolylineOutlineMaterialProperty,
38
40
  DynamicCone,
39
41
  DynamicLabel,
40
42
  DynamicDirectionsProperty,
@@ -42,6 +44,7 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
42
44
  DynamicEllipsoid,
43
45
  GridMaterialProperty,
44
46
  ImageMaterialProperty,
47
+ DynamicObject,
45
48
  DynamicObjectCollection,
46
49
  DynamicPath,
47
50
  DynamicPoint,
@@ -209,12 +212,16 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
209
212
  return HorizontalOrigin[defaultValue(czmlInterval.horizontalOrigin, czmlInterval)];
210
213
  case Image:
211
214
  return unwrapImageInterval(czmlInterval, sourceUri);
215
+ case JulianDate:
216
+ return JulianDate.fromIso8601(defaultValue(czmlInterval.date, czmlInterval));
212
217
  case LabelStyle:
213
218
  return LabelStyle[defaultValue(czmlInterval.labelStyle, czmlInterval)];
214
219
  case Number:
215
- return defaultValue(czmlInterval['number'], czmlInterval);
220
+ return defaultValue(czmlInterval.number, czmlInterval);
216
221
  case String:
217
- return defaultValue(czmlInterval['string'], czmlInterval);
222
+ return defaultValue(czmlInterval.string, czmlInterval);
223
+ case Array:
224
+ return czmlInterval.array;
218
225
  case Quaternion:
219
226
  return czmlInterval.unitQuaternion;
220
227
  case VerticalOrigin:
@@ -256,7 +263,7 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
256
263
  var hasInterval = defined(combinedInterval) && !combinedInterval.equals(Iso8601.MAXIMUM_INTERVAL);
257
264
  var packedLength = defaultValue(type.packedLength, 1);
258
265
  var unwrappedIntervalLength = defaultValue(unwrappedInterval.length, 1);
259
- var isSampled = (typeof unwrappedInterval !== 'string') && unwrappedIntervalLength > packedLength;
266
+ var isSampled = !defined(packetData.array) && (typeof unwrappedInterval !== 'string') && unwrappedIntervalLength > packedLength;
260
267
 
261
268
  //Any time a constant value is assigned, it completely blows away anything else.
262
269
  if (!isSampled && !hasInterval) {
@@ -637,6 +644,10 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
637
644
  }
638
645
  }
639
646
 
647
+ function processName(dynamicObject, packet, dynamicObjectCollection, sourceUri) {
648
+ dynamicObject.name = defaultValue(packet.name, dynamicObject.name);
649
+ }
650
+
640
651
  function processPosition(dynamicObject, packet, dynamicObjectCollection, sourceUri) {
641
652
  var positionData = packet.position;
642
653
  if (defined(positionData)) {
@@ -936,11 +947,39 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
936
947
  dynamicObject.polyline = polyline = new DynamicPolyline();
937
948
  }
938
949
 
939
- processPacketData(Color, polyline, 'color', polylineData.color, interval, sourceUri);
940
- processPacketData(Number, polyline, 'width', polylineData.width, interval, sourceUri);
941
- processPacketData(Color, polyline, 'outlineColor', polylineData.outlineColor, interval, sourceUri);
942
- processPacketData(Number, polyline, 'outlineWidth', polylineData.outlineWidth, interval, sourceUri);
950
+ //Since CZML does not support PolylineOutlineMaterial, we map it's properties into one.
951
+ var materialToProcess = polyline.material;
952
+ if (defined(interval)) {
953
+ var materialInterval;
954
+ var composite = materialToProcess;
955
+ if (!(composite instanceof CompositeMaterialProperty)) {
956
+ composite = new CompositeMaterialProperty();
957
+ polyline.material = composite;
958
+ if (defined(materialToProcess)) {
959
+ materialInterval = Iso8601.MAXIMUM_INTERVAL.clone();
960
+ materialInterval.data = materialToProcess;
961
+ composite.intervals.addInterval(materialInterval);
962
+ }
963
+ }
964
+ materialInterval = composite.intervals.findInterval(interval.start, interval.stop, interval.isStartIncluded, interval.isStopIncluded);
965
+ if (defined(materialInterval)) {
966
+ materialToProcess = materialInterval.data;
967
+ } else {
968
+ materialToProcess = new PolylineOutlineMaterialProperty();
969
+ materialInterval = interval.clone();
970
+ materialInterval.data = materialToProcess;
971
+ composite.intervals.addInterval(materialInterval);
972
+ }
973
+ } else if (!(materialToProcess instanceof PolylineOutlineMaterialProperty)) {
974
+ materialToProcess = new PolylineOutlineMaterialProperty();
975
+ polyline.material = materialToProcess;
976
+ }
977
+
943
978
  processPacketData(Boolean, polyline, 'show', polylineData.show, interval, sourceUri);
979
+ processPacketData(Number, polyline, 'width', polylineData.width, interval, sourceUri);
980
+ processPacketData(Color, materialToProcess, 'color', polylineData.color, interval, sourceUri);
981
+ processPacketData(Color, materialToProcess, 'outlineColor', polylineData.outlineColor, interval, sourceUri);
982
+ processPacketData(Number, materialToProcess, 'outlineWidth', polylineData.outlineWidth, interval, sourceUri);
944
983
  }
945
984
 
946
985
  function processPyramid(dynamicObject, packet, dynamicObjectCollection, sourceUri) {
@@ -998,7 +1037,7 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
998
1037
  processPacketData(Number, vector, 'length', vectorData.length, interval, sourceUri);
999
1038
  }
1000
1039
 
1001
- function processCzmlPacket(packet, dynamicObjectCollection, updaterFunctions, sourceUri) {
1040
+ function processCzmlPacket(packet, dynamicObjectCollection, updaterFunctions, sourceUri, dataSource) {
1002
1041
  var objectId = packet.id;
1003
1042
  if (!defined(objectId)) {
1004
1043
  objectId = createGuid();
@@ -1007,20 +1046,31 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
1007
1046
  if (packet['delete'] === true) {
1008
1047
  dynamicObjectCollection.removeById(objectId);
1009
1048
  } else {
1010
- var object = dynamicObjectCollection.getOrCreateObject(objectId);
1011
- for ( var i = updaterFunctions.length - 1; i > -1; i--) {
1012
- updaterFunctions[i](object, packet, dynamicObjectCollection, sourceUri);
1049
+ var dynamicObject;
1050
+ if (objectId === 'document') {
1051
+ dynamicObject = dataSource._document;
1052
+ } else {
1053
+ dynamicObject = dynamicObjectCollection.getOrCreateObject(objectId);
1054
+ }
1055
+
1056
+ var parentId = packet.parent;
1057
+ if (defined(parentId)) {
1058
+ dynamicObject.parent = dynamicObjectCollection.getOrCreateObject(parentId);
1059
+ }
1060
+
1061
+ for (var i = updaterFunctions.length - 1; i > -1; i--) {
1062
+ updaterFunctions[i](dynamicObject, packet, dynamicObjectCollection, sourceUri);
1013
1063
  }
1014
1064
  }
1015
1065
  }
1016
1066
 
1017
1067
  function loadCzml(dataSource, czml, sourceUri) {
1018
1068
  var dynamicObjectCollection = dataSource._dynamicObjectCollection;
1019
- CzmlDataSource._processCzml(czml, dynamicObjectCollection, sourceUri);
1069
+ CzmlDataSource._processCzml(czml, dynamicObjectCollection, sourceUri, undefined, dataSource);
1020
1070
  var availability = dynamicObjectCollection.computeAvailability();
1021
1071
 
1022
1072
  var clock;
1023
- var documentObject = dynamicObjectCollection.getById('document');
1073
+ var documentObject = dataSource._document;
1024
1074
  if (defined(documentObject) && defined(documentObject.clock)) {
1025
1075
  clock = new DynamicClock();
1026
1076
  clock.startTime = documentObject.clock.startTime;
@@ -1040,6 +1090,18 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
1040
1090
  clock.currentTime = clock.startTime;
1041
1091
  clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;
1042
1092
  }
1093
+
1094
+ var name;
1095
+ if (defined(documentObject) && defined(documentObject.name)) {
1096
+ name = documentObject.name;
1097
+ }
1098
+
1099
+ if (!defined(name) && defined(sourceUri)) {
1100
+ name = getFilenameFromUri(sourceUri);
1101
+ }
1102
+
1103
+ dataSource._name = name;
1104
+
1043
1105
  return clock;
1044
1106
  }
1045
1107
 
@@ -1047,13 +1109,17 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
1047
1109
  * A {@link DataSource} which processes CZML.
1048
1110
  * @alias CzmlDataSource
1049
1111
  * @constructor
1112
+ *
1113
+ * @param {String} [name] An optional name for the data source. This value will be overwritten if a loaded document contains a name.
1050
1114
  */
1051
- var CzmlDataSource = function() {
1115
+ var CzmlDataSource = function(name) {
1116
+ this._name = name;
1052
1117
  this._changed = new Event();
1053
1118
  this._error = new Event();
1054
1119
  this._clock = undefined;
1055
1120
  this._dynamicObjectCollection = new DynamicObjectCollection();
1056
1121
  this._timeVarying = true;
1122
+ this._document = new DynamicObject();
1057
1123
  };
1058
1124
 
1059
1125
  /**
@@ -1067,6 +1133,7 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
1067
1133
  processEllipsoid, //
1068
1134
  processCone, //
1069
1135
  processLabel, //
1136
+ processName, //
1070
1137
  processPath, //
1071
1138
  processPoint, //
1072
1139
  processPolygon, //
@@ -1079,6 +1146,16 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
1079
1146
  processVertexPositions, //
1080
1147
  processAvailability];
1081
1148
 
1149
+ /**
1150
+ * Gets the name of this data source.
1151
+ * @memberof CzmlDataSource
1152
+ *
1153
+ * @returns {String} The name.
1154
+ */
1155
+ CzmlDataSource.prototype.getName = function() {
1156
+ return this._name;
1157
+ };
1158
+
1082
1159
  /**
1083
1160
  * Gets an event that will be raised when non-time-varying data changes
1084
1161
  * or if the return value of getIsTimeVarying changes.
@@ -1162,6 +1239,7 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
1162
1239
  throw new DeveloperError('czml is required.');
1163
1240
  }
1164
1241
 
1242
+ this._document = new DynamicObject('document');
1165
1243
  this._dynamicObjectCollection.removeAll();
1166
1244
  this._clock = loadCzml(this, czml, source);
1167
1245
  };
@@ -1255,15 +1333,15 @@ define(['Core/Cartesian2', 'Core/Cartesian3', 'Core/Cartographic', 'Core/Color',
1255
1333
  */
1256
1334
  CzmlDataSource.processMaterialPacketData = processMaterialPacketData;
1257
1335
 
1258
- CzmlDataSource._processCzml = function(czml, dynamicObjectCollection, sourceUri, updaterFunctions) {
1336
+ CzmlDataSource._processCzml = function(czml, dynamicObjectCollection, sourceUri, updaterFunctions, dataSource) {
1259
1337
  updaterFunctions = defined(updaterFunctions) ? updaterFunctions : CzmlDataSource.updaters;
1260
1338
 
1261
1339
  if (Array.isArray(czml)) {
1262
1340
  for ( var i = 0, len = czml.length; i < len; i++) {
1263
- processCzmlPacket(czml[i], dynamicObjectCollection, updaterFunctions, sourceUri);
1341
+ processCzmlPacket(czml[i], dynamicObjectCollection, updaterFunctions, sourceUri, dataSource);
1264
1342
  }
1265
1343
  } else {
1266
- processCzmlPacket(czml, dynamicObjectCollection, updaterFunctions, sourceUri);
1344
+ processCzmlPacket(czml, dynamicObjectCollection, updaterFunctions, sourceUri, dataSource);
1267
1345
  }
1268
1346
  };
1269
1347