@cesium/engine 3.0.1 → 4.0.0

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 (234) hide show
  1. package/Build/ThirdParty/Workers/pako_deflate.min.js +605 -0
  2. package/Build/ThirdParty/Workers/pako_inflate.min.js +800 -0
  3. package/Build/ThirdParty/Workers/z-worker-pako.js +502 -0
  4. package/Build/Workers/chunk-27R2KRIK.js +634 -0
  5. package/Build/Workers/chunk-2C65EKYA.js +55 -0
  6. package/Build/Workers/chunk-2NLMZNJI.js +138 -0
  7. package/Build/Workers/chunk-4V6RCTVH.js +289 -0
  8. package/Build/Workers/chunk-4VWUFKYW.js +368 -0
  9. package/Build/Workers/chunk-527JG4D7.js +629 -0
  10. package/Build/Workers/chunk-5U4UHRZ2.js +8644 -0
  11. package/Build/Workers/chunk-7CZEWQWE.js +353 -0
  12. package/Build/Workers/chunk-7IMAWM6A.js +842 -0
  13. package/Build/Workers/{package.js → chunk-A6EA6KIE.js} +13 -2
  14. package/Build/Workers/chunk-AXGQUPXA.js +1075 -0
  15. package/Build/Workers/chunk-BT6YIL2N.js +39 -0
  16. package/Build/Workers/chunk-C6MRR5YL.js +476 -0
  17. package/Build/Workers/chunk-DJUTBX6A.js +1860 -0
  18. package/Build/Workers/chunk-EQ6ZAP37.js +218 -0
  19. package/Build/Workers/chunk-F7P2HCYZ.js +73 -0
  20. package/Build/Workers/chunk-FE2XG3SS.js +73 -0
  21. package/Build/Workers/chunk-FKHRSGKP.js +781 -0
  22. package/Build/Workers/chunk-FVDTKX3F.js +58 -0
  23. package/Build/Workers/chunk-FYHCAKU6.js +684 -0
  24. package/Build/Workers/chunk-G3MOT7BZ.js +157 -0
  25. package/Build/Workers/chunk-H52L6U76.js +421 -0
  26. package/Build/Workers/chunk-H6MBQ4W4.js +305 -0
  27. package/Build/Workers/chunk-HCZR75II.js +2716 -0
  28. package/Build/Workers/chunk-I5MQWHBR.js +102 -0
  29. package/Build/Workers/chunk-KAFF2QX3.js +258 -0
  30. package/Build/Workers/chunk-LGSGX2RH.js +757 -0
  31. package/Build/Workers/chunk-LQRFWCNX.js +124 -0
  32. package/Build/Workers/chunk-N5MMDSD2.js +44 -0
  33. package/Build/Workers/chunk-NRETMGYL.js +390 -0
  34. package/Build/Workers/chunk-P4M4QUNQ.js +196 -0
  35. package/Build/Workers/chunk-P7PWX5HR.js +430 -0
  36. package/Build/Workers/chunk-PGB3EFR7.js +171 -0
  37. package/Build/Workers/chunk-PW5CA4MJ.js +3273 -0
  38. package/Build/Workers/chunk-PWDYKCNC.js +501 -0
  39. package/Build/Workers/chunk-QIS3NB7U.js +1258 -0
  40. package/Build/Workers/chunk-QVJ6IRKV.js +77 -0
  41. package/Build/Workers/chunk-RDCDRNJ7.js +117 -0
  42. package/Build/Workers/chunk-RDM3BKNC.js +1009 -0
  43. package/Build/Workers/chunk-RRUPTJ6P.js +452 -0
  44. package/Build/Workers/chunk-SGRWJKNO.js +400 -0
  45. package/Build/Workers/chunk-TF5D2H7B.js +138 -0
  46. package/Build/Workers/chunk-TVYIHH4V.js +513 -0
  47. package/Build/Workers/chunk-U5LKG6LX.js +101 -0
  48. package/Build/Workers/chunk-UGZGTV5K.js +302 -0
  49. package/Build/Workers/chunk-UN7AK64D.js +163 -0
  50. package/Build/Workers/chunk-V2LKNJGT.js +59 -0
  51. package/Build/Workers/chunk-VSCXSFHE.js +1477 -0
  52. package/Build/Workers/chunk-XJCTFTBM.js +2041 -0
  53. package/Build/Workers/chunk-XZVQMPWG.js +100 -0
  54. package/Build/Workers/chunk-YLAFWVOW.js +834 -0
  55. package/Build/Workers/chunk-YLS3FX3U.js +236 -0
  56. package/Build/Workers/chunk-YMJPANZZ.js +693 -0
  57. package/Build/Workers/combineGeometry.js +65 -15
  58. package/Build/Workers/createBoxGeometry.js +55 -10
  59. package/Build/Workers/createBoxOutlineGeometry.js +231 -310
  60. package/Build/Workers/createCircleGeometry.js +185 -202
  61. package/Build/Workers/createCircleOutlineGeometry.js +141 -155
  62. package/Build/Workers/createCoplanarPolygonGeometry.js +477 -557
  63. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +218 -230
  64. package/Build/Workers/createCorridorGeometry.js +1162 -1307
  65. package/Build/Workers/createCorridorOutlineGeometry.js +533 -569
  66. package/Build/Workers/createCylinderGeometry.js +57 -10
  67. package/Build/Workers/createCylinderOutlineGeometry.js +224 -258
  68. package/Build/Workers/createEllipseGeometry.js +68 -12
  69. package/Build/Workers/createEllipseOutlineGeometry.js +61 -12
  70. package/Build/Workers/createEllipsoidGeometry.js +56 -10
  71. package/Build/Workers/createEllipsoidOutlineGeometry.js +58 -13
  72. package/Build/Workers/createFrustumGeometry.js +55 -10
  73. package/Build/Workers/createFrustumOutlineGeometry.js +226 -243
  74. package/Build/Workers/createGeometry.js +143 -48
  75. package/Build/Workers/createGroundPolylineGeometry.js +1484 -2011
  76. package/Build/Workers/createPlaneGeometry.js +216 -243
  77. package/Build/Workers/createPlaneOutlineGeometry.js +121 -113
  78. package/Build/Workers/createPolygonGeometry.js +1041 -1327
  79. package/Build/Workers/createPolygonOutlineGeometry.js +516 -657
  80. package/Build/Workers/createPolylineGeometry.js +471 -547
  81. package/Build/Workers/createPolylineVolumeGeometry.js +352 -384
  82. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +271 -295
  83. package/Build/Workers/createRectangleGeometry.js +1128 -1331
  84. package/Build/Workers/createRectangleOutlineGeometry.js +445 -500
  85. package/Build/Workers/createSimplePolylineGeometry.js +381 -440
  86. package/Build/Workers/createSphereGeometry.js +112 -118
  87. package/Build/Workers/createSphereOutlineGeometry.js +112 -121
  88. package/Build/Workers/createTaskProcessorWorker.js +32 -127
  89. package/Build/Workers/createVectorTileClampedPolylines.js +462 -505
  90. package/Build/Workers/createVectorTileGeometries.js +377 -436
  91. package/Build/Workers/createVectorTilePoints.js +110 -77
  92. package/Build/Workers/createVectorTilePolygons.js +369 -391
  93. package/Build/Workers/createVectorTilePolylines.js +252 -244
  94. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +543 -615
  95. package/Build/Workers/createVerticesFromHeightmap.js +2244 -2677
  96. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +682 -904
  97. package/Build/Workers/createWallGeometry.js +459 -593
  98. package/Build/Workers/createWallOutlineGeometry.js +324 -419
  99. package/Build/Workers/decodeDraco.js +327 -347
  100. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2530 -3567
  101. package/Build/Workers/decodeI3S.js +765 -970
  102. package/Build/Workers/transcodeKTX2.js +3353 -1464
  103. package/Build/Workers/transferTypedArrayTest.js +3 -4
  104. package/Build/Workers/upsampleQuantizedTerrainMesh.js +748 -953
  105. package/LICENSE.md +0 -12
  106. package/Source/Core/FeatureDetection.js +9 -0
  107. package/Source/Core/GoogleMaps.js +1 -1
  108. package/Source/Core/GroundPolylineGeometry.js +3 -2
  109. package/Source/Core/Ion.js +1 -1
  110. package/Source/Core/KTX2Transcoder.js +7 -3
  111. package/Source/Core/RequestScheduler.js +1 -0
  112. package/Source/Core/TaskProcessor.js +150 -146
  113. package/Source/Core/Transforms.js +2 -2
  114. package/Source/Core/buildModuleUrl.js +6 -5
  115. package/Source/DataSources/CzmlDataSource.js +6 -4
  116. package/Source/Scene/ArcGisMapService.js +1 -1
  117. package/Source/Scene/DracoLoader.js +26 -3
  118. package/Source/Scene/GltfLoaderUtil.js +1 -7
  119. package/Source/Scene/I3SDataProvider.js +0 -27
  120. package/Source/Scene/I3SDecoder.js +127 -0
  121. package/Source/Scene/I3SNode.js +32 -110
  122. package/Source/Scene/ImageryLayer.js +2 -2
  123. package/Source/Scene/Implicit3DTileContent.js +13 -0
  124. package/Source/Scene/ImplicitTileset.js +5 -0
  125. package/Source/Scene/Model/I3dmLoader.js +5 -1
  126. package/Source/Scene/Model/Model.js +4 -1
  127. package/Source/Scene/OpenStreetMapImageryProvider.js +7 -4
  128. package/Source/Scene/SingleTileImageryProvider.js +4 -2
  129. package/Source/ThirdParty/Workers/basis_transcoder.js +1 -1
  130. package/Source/{WorkersES6 → Workers}/createGeometry.js +11 -12
  131. package/Source/{WorkersES6 → Workers}/createTaskProcessorWorker.js +43 -59
  132. package/Source/{WorkersES6 → Workers}/decodeDraco.js +19 -25
  133. package/Source/{WorkersES6 → Workers}/decodeI3S.js +18 -32
  134. package/Source/{WorkersES6 → Workers}/transcodeKTX2.js +19 -26
  135. package/Source/Workers/transferTypedArrayTest.js +0 -6
  136. package/index.d.ts +20 -11
  137. package/index.js +170 -169
  138. package/package.json +3 -2
  139. package/Build/Workers/ArcType-2d9abbbc.js +0 -37
  140. package/Build/Workers/AttributeCompression-f9f6c717.js +0 -716
  141. package/Build/Workers/AxisAlignedBoundingBox-4bfd84f3.js +0 -258
  142. package/Build/Workers/BoundingRectangle-5fd6403a.js +0 -369
  143. package/Build/Workers/BoxGeometry-7aa4ce7f.js +0 -884
  144. package/Build/Workers/Check-6ede7e26.js +0 -290
  145. package/Build/Workers/Color-8e135f71.js +0 -2262
  146. package/Build/Workers/ComponentDatatype-cf1fa08e.js +0 -341
  147. package/Build/Workers/CoplanarPolygonGeometryLibrary-59c69b0a.js +0 -132
  148. package/Build/Workers/CorridorGeometryLibrary-63907365.js +0 -498
  149. package/Build/Workers/CylinderGeometry-8fc7c44b.js +0 -467
  150. package/Build/Workers/CylinderGeometryLibrary-7bf291b4.js +0 -63
  151. package/Build/Workers/EllipseGeometry-16b3736a.js +0 -1304
  152. package/Build/Workers/EllipseGeometryLibrary-21262a28.js +0 -366
  153. package/Build/Workers/EllipseOutlineGeometry-05d35d18.js +0 -443
  154. package/Build/Workers/EllipsoidGeodesic-5b3623dc.js +0 -520
  155. package/Build/Workers/EllipsoidGeometry-a503d1d6.js +0 -637
  156. package/Build/Workers/EllipsoidOutlineGeometry-7b09f24d.js +0 -454
  157. package/Build/Workers/EllipsoidRhumbLine-ef872433.js +0 -741
  158. package/Build/Workers/EllipsoidTangentPlane-546c0d5e.js +0 -373
  159. package/Build/Workers/EncodedCartesian3-57415c8a.js +0 -171
  160. package/Build/Workers/FrustumGeometry-87ce8622.js +0 -2540
  161. package/Build/Workers/GeometryAttribute-8fcff0d5.js +0 -619
  162. package/Build/Workers/GeometryAttributes-ad136444.js +0 -91
  163. package/Build/Workers/GeometryInstance-34d9e21e.js +0 -121
  164. package/Build/Workers/GeometryOffsetAttribute-9ad0019c.js +0 -16
  165. package/Build/Workers/GeometryPipeline-70d69a43.js +0 -3690
  166. package/Build/Workers/IndexDatatype-2643aa47.js +0 -200
  167. package/Build/Workers/IntersectionTests-85350792.js +0 -1836
  168. package/Build/Workers/Math-0a2ac845.js +0 -1340
  169. package/Build/Workers/Matrix2-e1298525.js +0 -7086
  170. package/Build/Workers/Matrix3-41c58dde.js +0 -4283
  171. package/Build/Workers/OrientedBoundingBox-29fb0fcd.js +0 -1259
  172. package/Build/Workers/Plane-4c3d403b.js +0 -309
  173. package/Build/Workers/PolygonGeometryLibrary-bad6329a.js +0 -1074
  174. package/Build/Workers/PolygonPipeline-dd13ee78.js +0 -1344
  175. package/Build/Workers/PolylinePipeline-7119eb3f.js +0 -573
  176. package/Build/Workers/PolylineVolumeGeometryLibrary-d25f0050.js +0 -781
  177. package/Build/Workers/PrimitivePipeline-111ee29f.js +0 -966
  178. package/Build/Workers/RectangleGeometryLibrary-bb378fb6.js +0 -280
  179. package/Build/Workers/RuntimeError-ef395448.js +0 -68
  180. package/Build/Workers/TerrainEncoding-c8e029a2.js +0 -1227
  181. package/Build/Workers/Transforms-e2d4a55a.js +0 -14713
  182. package/Build/Workers/VertexFormat-030f11ff.js +0 -312
  183. package/Build/Workers/WallGeometryLibrary-3e0819ec.js +0 -211
  184. package/Build/Workers/WebGLConstants-0b1ce7ba.js +0 -620
  185. package/Build/Workers/WebMercatorProjection-13ed1a6e.js +0 -151
  186. package/Build/Workers/arrayRemoveDuplicates-d2061e85.js +0 -129
  187. package/Build/Workers/cesiumWorkerBootstrapper.js +0 -1363
  188. package/Build/Workers/combine-d9581036.js +0 -82
  189. package/Build/Workers/defaultValue-fe22d8c0.js +0 -51
  190. package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +0 -117
  191. package/Source/Workers/cesiumWorkerBootstrapper.js +0 -2290
  192. package/Source/Workers/package.json +0 -1
  193. /package/Source/{WorkersES6 → Workers}/combineGeometry.js +0 -0
  194. /package/Source/{WorkersES6 → Workers}/createBoxGeometry.js +0 -0
  195. /package/Source/{WorkersES6 → Workers}/createBoxOutlineGeometry.js +0 -0
  196. /package/Source/{WorkersES6 → Workers}/createCircleGeometry.js +0 -0
  197. /package/Source/{WorkersES6 → Workers}/createCircleOutlineGeometry.js +0 -0
  198. /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonGeometry.js +0 -0
  199. /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonOutlineGeometry.js +0 -0
  200. /package/Source/{WorkersES6 → Workers}/createCorridorGeometry.js +0 -0
  201. /package/Source/{WorkersES6 → Workers}/createCorridorOutlineGeometry.js +0 -0
  202. /package/Source/{WorkersES6 → Workers}/createCylinderGeometry.js +0 -0
  203. /package/Source/{WorkersES6 → Workers}/createCylinderOutlineGeometry.js +0 -0
  204. /package/Source/{WorkersES6 → Workers}/createEllipseGeometry.js +0 -0
  205. /package/Source/{WorkersES6 → Workers}/createEllipseOutlineGeometry.js +0 -0
  206. /package/Source/{WorkersES6 → Workers}/createEllipsoidGeometry.js +0 -0
  207. /package/Source/{WorkersES6 → Workers}/createEllipsoidOutlineGeometry.js +0 -0
  208. /package/Source/{WorkersES6 → Workers}/createFrustumGeometry.js +0 -0
  209. /package/Source/{WorkersES6 → Workers}/createFrustumOutlineGeometry.js +0 -0
  210. /package/Source/{WorkersES6 → Workers}/createGroundPolylineGeometry.js +0 -0
  211. /package/Source/{WorkersES6 → Workers}/createPlaneGeometry.js +0 -0
  212. /package/Source/{WorkersES6 → Workers}/createPlaneOutlineGeometry.js +0 -0
  213. /package/Source/{WorkersES6 → Workers}/createPolygonGeometry.js +0 -0
  214. /package/Source/{WorkersES6 → Workers}/createPolygonOutlineGeometry.js +0 -0
  215. /package/Source/{WorkersES6 → Workers}/createPolylineGeometry.js +0 -0
  216. /package/Source/{WorkersES6 → Workers}/createPolylineVolumeGeometry.js +0 -0
  217. /package/Source/{WorkersES6 → Workers}/createPolylineVolumeOutlineGeometry.js +0 -0
  218. /package/Source/{WorkersES6 → Workers}/createRectangleGeometry.js +0 -0
  219. /package/Source/{WorkersES6 → Workers}/createRectangleOutlineGeometry.js +0 -0
  220. /package/Source/{WorkersES6 → Workers}/createSimplePolylineGeometry.js +0 -0
  221. /package/Source/{WorkersES6 → Workers}/createSphereGeometry.js +0 -0
  222. /package/Source/{WorkersES6 → Workers}/createSphereOutlineGeometry.js +0 -0
  223. /package/Source/{WorkersES6 → Workers}/createVectorTileClampedPolylines.js +0 -0
  224. /package/Source/{WorkersES6 → Workers}/createVectorTileGeometries.js +0 -0
  225. /package/Source/{WorkersES6 → Workers}/createVectorTilePoints.js +0 -0
  226. /package/Source/{WorkersES6 → Workers}/createVectorTilePolygons.js +0 -0
  227. /package/Source/{WorkersES6 → Workers}/createVectorTilePolylines.js +0 -0
  228. /package/Source/{WorkersES6 → Workers}/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -0
  229. /package/Source/{WorkersES6 → Workers}/createVerticesFromHeightmap.js +0 -0
  230. /package/Source/{WorkersES6 → Workers}/createVerticesFromQuantizedTerrainMesh.js +0 -0
  231. /package/Source/{WorkersES6 → Workers}/createWallGeometry.js +0 -0
  232. /package/Source/{WorkersES6 → Workers}/createWallOutlineGeometry.js +0 -0
  233. /package/Source/{WorkersES6 → Workers}/decodeGoogleEarthEnterprisePacket.js +0 -0
  234. /package/Source/{WorkersES6 → Workers}/upsampleQuantizedTerrainMesh.js +0 -0
@@ -1,341 +0,0 @@
1
- define(['exports', './defaultValue-fe22d8c0', './Check-6ede7e26', './WebGLConstants-0b1ce7ba'], (function (exports, defaultValue, Check, WebGLConstants) { 'use strict';
2
-
3
- /**
4
- * WebGL component datatypes. Components are intrinsics,
5
- * which form attributes, which form vertices.
6
- *
7
- * @enum {number}
8
- */
9
- const ComponentDatatype = {
10
- /**
11
- * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type
12
- * of an element in <code>Int8Array</code>.
13
- *
14
- * @type {number}
15
- * @constant
16
- */
17
- BYTE: WebGLConstants.WebGLConstants.BYTE,
18
-
19
- /**
20
- * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
21
- * of an element in <code>Uint8Array</code>.
22
- *
23
- * @type {number}
24
- * @constant
25
- */
26
- UNSIGNED_BYTE: WebGLConstants.WebGLConstants.UNSIGNED_BYTE,
27
-
28
- /**
29
- * 16-bit signed short corresponding to <code>SHORT</code> and the type
30
- * of an element in <code>Int16Array</code>.
31
- *
32
- * @type {number}
33
- * @constant
34
- */
35
- SHORT: WebGLConstants.WebGLConstants.SHORT,
36
-
37
- /**
38
- * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
39
- * of an element in <code>Uint16Array</code>.
40
- *
41
- * @type {number}
42
- * @constant
43
- */
44
- UNSIGNED_SHORT: WebGLConstants.WebGLConstants.UNSIGNED_SHORT,
45
-
46
- /**
47
- * 32-bit signed int corresponding to <code>INT</code> and the type
48
- * of an element in <code>Int32Array</code>.
49
- *
50
- * @memberOf ComponentDatatype
51
- *
52
- * @type {number}
53
- * @constant
54
- */
55
- INT: WebGLConstants.WebGLConstants.INT,
56
-
57
- /**
58
- * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
59
- * of an element in <code>Uint32Array</code>.
60
- *
61
- * @memberOf ComponentDatatype
62
- *
63
- * @type {number}
64
- * @constant
65
- */
66
- UNSIGNED_INT: WebGLConstants.WebGLConstants.UNSIGNED_INT,
67
-
68
- /**
69
- * 32-bit floating-point corresponding to <code>FLOAT</code> and the type
70
- * of an element in <code>Float32Array</code>.
71
- *
72
- * @type {number}
73
- * @constant
74
- */
75
- FLOAT: WebGLConstants.WebGLConstants.FLOAT,
76
-
77
- /**
78
- * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;
79
- * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
80
- * and the type of an element in <code>Float64Array</code>.
81
- *
82
- * @memberOf ComponentDatatype
83
- *
84
- * @type {number}
85
- * @constant
86
- * @default 0x140A
87
- */
88
- DOUBLE: WebGLConstants.WebGLConstants.DOUBLE,
89
- };
90
-
91
- /**
92
- * Returns the size, in bytes, of the corresponding datatype.
93
- *
94
- * @param {ComponentDatatype} componentDatatype The component datatype to get the size of.
95
- * @returns {number} The size in bytes.
96
- *
97
- * @exception {DeveloperError} componentDatatype is not a valid value.
98
- *
99
- * @example
100
- * // Returns Int8Array.BYTES_PER_ELEMENT
101
- * const size = Cesium.ComponentDatatype.getSizeInBytes(Cesium.ComponentDatatype.BYTE);
102
- */
103
- ComponentDatatype.getSizeInBytes = function (componentDatatype) {
104
- //>>includeStart('debug', pragmas.debug);
105
- if (!defaultValue.defined(componentDatatype)) {
106
- throw new Check.DeveloperError("value is required.");
107
- }
108
- //>>includeEnd('debug');
109
-
110
- switch (componentDatatype) {
111
- case ComponentDatatype.BYTE:
112
- return Int8Array.BYTES_PER_ELEMENT;
113
- case ComponentDatatype.UNSIGNED_BYTE:
114
- return Uint8Array.BYTES_PER_ELEMENT;
115
- case ComponentDatatype.SHORT:
116
- return Int16Array.BYTES_PER_ELEMENT;
117
- case ComponentDatatype.UNSIGNED_SHORT:
118
- return Uint16Array.BYTES_PER_ELEMENT;
119
- case ComponentDatatype.INT:
120
- return Int32Array.BYTES_PER_ELEMENT;
121
- case ComponentDatatype.UNSIGNED_INT:
122
- return Uint32Array.BYTES_PER_ELEMENT;
123
- case ComponentDatatype.FLOAT:
124
- return Float32Array.BYTES_PER_ELEMENT;
125
- case ComponentDatatype.DOUBLE:
126
- return Float64Array.BYTES_PER_ELEMENT;
127
- //>>includeStart('debug', pragmas.debug);
128
- default:
129
- throw new Check.DeveloperError("componentDatatype is not a valid value.");
130
- //>>includeEnd('debug');
131
- }
132
- };
133
-
134
- /**
135
- * Gets the {@link ComponentDatatype} for the provided TypedArray instance.
136
- *
137
- * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} array The typed array.
138
- * @returns {ComponentDatatype} The ComponentDatatype for the provided array, or undefined if the array is not a TypedArray.
139
- */
140
- ComponentDatatype.fromTypedArray = function (array) {
141
- if (array instanceof Int8Array) {
142
- return ComponentDatatype.BYTE;
143
- }
144
- if (array instanceof Uint8Array) {
145
- return ComponentDatatype.UNSIGNED_BYTE;
146
- }
147
- if (array instanceof Int16Array) {
148
- return ComponentDatatype.SHORT;
149
- }
150
- if (array instanceof Uint16Array) {
151
- return ComponentDatatype.UNSIGNED_SHORT;
152
- }
153
- if (array instanceof Int32Array) {
154
- return ComponentDatatype.INT;
155
- }
156
- if (array instanceof Uint32Array) {
157
- return ComponentDatatype.UNSIGNED_INT;
158
- }
159
- if (array instanceof Float32Array) {
160
- return ComponentDatatype.FLOAT;
161
- }
162
- if (array instanceof Float64Array) {
163
- return ComponentDatatype.DOUBLE;
164
- }
165
-
166
- //>>includeStart('debug', pragmas.debug);
167
- throw new Check.DeveloperError(
168
- "array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array."
169
- );
170
- //>>includeEnd('debug');
171
- };
172
-
173
- /**
174
- * Validates that the provided component datatype is a valid {@link ComponentDatatype}
175
- *
176
- * @param {ComponentDatatype} componentDatatype The component datatype to validate.
177
- * @returns {boolean} <code>true</code> if the provided component datatype is a valid value; otherwise, <code>false</code>.
178
- *
179
- * @example
180
- * if (!Cesium.ComponentDatatype.validate(componentDatatype)) {
181
- * throw new Cesium.DeveloperError('componentDatatype must be a valid value.');
182
- * }
183
- */
184
- ComponentDatatype.validate = function (componentDatatype) {
185
- return (
186
- defaultValue.defined(componentDatatype) &&
187
- (componentDatatype === ComponentDatatype.BYTE ||
188
- componentDatatype === ComponentDatatype.UNSIGNED_BYTE ||
189
- componentDatatype === ComponentDatatype.SHORT ||
190
- componentDatatype === ComponentDatatype.UNSIGNED_SHORT ||
191
- componentDatatype === ComponentDatatype.INT ||
192
- componentDatatype === ComponentDatatype.UNSIGNED_INT ||
193
- componentDatatype === ComponentDatatype.FLOAT ||
194
- componentDatatype === ComponentDatatype.DOUBLE)
195
- );
196
- };
197
-
198
- /**
199
- * Creates a typed array corresponding to component data type.
200
- *
201
- * @param {ComponentDatatype} componentDatatype The component data type.
202
- * @param {number|Array} valuesOrLength The length of the array to create or an array.
203
- * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array.
204
- *
205
- * @exception {DeveloperError} componentDatatype is not a valid value.
206
- *
207
- * @example
208
- * // creates a Float32Array with length of 100
209
- * const typedArray = Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT, 100);
210
- */
211
- ComponentDatatype.createTypedArray = function (
212
- componentDatatype,
213
- valuesOrLength
214
- ) {
215
- //>>includeStart('debug', pragmas.debug);
216
- if (!defaultValue.defined(componentDatatype)) {
217
- throw new Check.DeveloperError("componentDatatype is required.");
218
- }
219
- if (!defaultValue.defined(valuesOrLength)) {
220
- throw new Check.DeveloperError("valuesOrLength is required.");
221
- }
222
- //>>includeEnd('debug');
223
-
224
- switch (componentDatatype) {
225
- case ComponentDatatype.BYTE:
226
- return new Int8Array(valuesOrLength);
227
- case ComponentDatatype.UNSIGNED_BYTE:
228
- return new Uint8Array(valuesOrLength);
229
- case ComponentDatatype.SHORT:
230
- return new Int16Array(valuesOrLength);
231
- case ComponentDatatype.UNSIGNED_SHORT:
232
- return new Uint16Array(valuesOrLength);
233
- case ComponentDatatype.INT:
234
- return new Int32Array(valuesOrLength);
235
- case ComponentDatatype.UNSIGNED_INT:
236
- return new Uint32Array(valuesOrLength);
237
- case ComponentDatatype.FLOAT:
238
- return new Float32Array(valuesOrLength);
239
- case ComponentDatatype.DOUBLE:
240
- return new Float64Array(valuesOrLength);
241
- //>>includeStart('debug', pragmas.debug);
242
- default:
243
- throw new Check.DeveloperError("componentDatatype is not a valid value.");
244
- //>>includeEnd('debug');
245
- }
246
- };
247
-
248
- /**
249
- * Creates a typed view of an array of bytes.
250
- *
251
- * @param {ComponentDatatype} componentDatatype The type of the view to create.
252
- * @param {ArrayBuffer} buffer The buffer storage to use for the view.
253
- * @param {number} [byteOffset] The offset, in bytes, to the first element in the view.
254
- * @param {number} [length] The number of elements in the view.
255
- * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array view of the buffer.
256
- *
257
- * @exception {DeveloperError} componentDatatype is not a valid value.
258
- */
259
- ComponentDatatype.createArrayBufferView = function (
260
- componentDatatype,
261
- buffer,
262
- byteOffset,
263
- length
264
- ) {
265
- //>>includeStart('debug', pragmas.debug);
266
- if (!defaultValue.defined(componentDatatype)) {
267
- throw new Check.DeveloperError("componentDatatype is required.");
268
- }
269
- if (!defaultValue.defined(buffer)) {
270
- throw new Check.DeveloperError("buffer is required.");
271
- }
272
- //>>includeEnd('debug');
273
-
274
- byteOffset = defaultValue.defaultValue(byteOffset, 0);
275
- length = defaultValue.defaultValue(
276
- length,
277
- (buffer.byteLength - byteOffset) /
278
- ComponentDatatype.getSizeInBytes(componentDatatype)
279
- );
280
-
281
- switch (componentDatatype) {
282
- case ComponentDatatype.BYTE:
283
- return new Int8Array(buffer, byteOffset, length);
284
- case ComponentDatatype.UNSIGNED_BYTE:
285
- return new Uint8Array(buffer, byteOffset, length);
286
- case ComponentDatatype.SHORT:
287
- return new Int16Array(buffer, byteOffset, length);
288
- case ComponentDatatype.UNSIGNED_SHORT:
289
- return new Uint16Array(buffer, byteOffset, length);
290
- case ComponentDatatype.INT:
291
- return new Int32Array(buffer, byteOffset, length);
292
- case ComponentDatatype.UNSIGNED_INT:
293
- return new Uint32Array(buffer, byteOffset, length);
294
- case ComponentDatatype.FLOAT:
295
- return new Float32Array(buffer, byteOffset, length);
296
- case ComponentDatatype.DOUBLE:
297
- return new Float64Array(buffer, byteOffset, length);
298
- //>>includeStart('debug', pragmas.debug);
299
- default:
300
- throw new Check.DeveloperError("componentDatatype is not a valid value.");
301
- //>>includeEnd('debug');
302
- }
303
- };
304
-
305
- /**
306
- * Get the ComponentDatatype from its name.
307
- *
308
- * @param {string} name The name of the ComponentDatatype.
309
- * @returns {ComponentDatatype} The ComponentDatatype.
310
- *
311
- * @exception {DeveloperError} name is not a valid value.
312
- */
313
- ComponentDatatype.fromName = function (name) {
314
- switch (name) {
315
- case "BYTE":
316
- return ComponentDatatype.BYTE;
317
- case "UNSIGNED_BYTE":
318
- return ComponentDatatype.UNSIGNED_BYTE;
319
- case "SHORT":
320
- return ComponentDatatype.SHORT;
321
- case "UNSIGNED_SHORT":
322
- return ComponentDatatype.UNSIGNED_SHORT;
323
- case "INT":
324
- return ComponentDatatype.INT;
325
- case "UNSIGNED_INT":
326
- return ComponentDatatype.UNSIGNED_INT;
327
- case "FLOAT":
328
- return ComponentDatatype.FLOAT;
329
- case "DOUBLE":
330
- return ComponentDatatype.DOUBLE;
331
- //>>includeStart('debug', pragmas.debug);
332
- default:
333
- throw new Check.DeveloperError("name is not a valid value.");
334
- //>>includeEnd('debug');
335
- }
336
- };
337
- var ComponentDatatype$1 = Object.freeze(ComponentDatatype);
338
-
339
- exports.ComponentDatatype = ComponentDatatype$1;
340
-
341
- }));
@@ -1,132 +0,0 @@
1
- define(['exports', './Matrix2-e1298525', './Matrix3-41c58dde', './Check-6ede7e26', './OrientedBoundingBox-29fb0fcd'], (function (exports, Matrix2, Matrix3, Check, OrientedBoundingBox) { 'use strict';
2
-
3
- /**
4
- * @private
5
- */
6
- const CoplanarPolygonGeometryLibrary = {};
7
-
8
- const scratchIntersectionPoint = new Matrix3.Cartesian3();
9
- const scratchXAxis = new Matrix3.Cartesian3();
10
- const scratchYAxis = new Matrix3.Cartesian3();
11
- const scratchZAxis = new Matrix3.Cartesian3();
12
- const obbScratch = new OrientedBoundingBox.OrientedBoundingBox();
13
-
14
- CoplanarPolygonGeometryLibrary.validOutline = function (positions) {
15
- //>>includeStart('debug', pragmas.debug);
16
- Check.Check.defined("positions", positions);
17
- //>>includeEnd('debug');
18
-
19
- const orientedBoundingBox = OrientedBoundingBox.OrientedBoundingBox.fromPoints(
20
- positions,
21
- obbScratch
22
- );
23
- const halfAxes = orientedBoundingBox.halfAxes;
24
- const xAxis = Matrix3.Matrix3.getColumn(halfAxes, 0, scratchXAxis);
25
- const yAxis = Matrix3.Matrix3.getColumn(halfAxes, 1, scratchYAxis);
26
- const zAxis = Matrix3.Matrix3.getColumn(halfAxes, 2, scratchZAxis);
27
-
28
- const xMag = Matrix3.Cartesian3.magnitude(xAxis);
29
- const yMag = Matrix3.Cartesian3.magnitude(yAxis);
30
- const zMag = Matrix3.Cartesian3.magnitude(zAxis);
31
-
32
- // If all the points are on a line return undefined because we can't draw a polygon
33
- return !(
34
- (xMag === 0 && (yMag === 0 || zMag === 0)) ||
35
- (yMag === 0 && zMag === 0)
36
- );
37
- };
38
-
39
- // call after removeDuplicates
40
- CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function (
41
- positions,
42
- centerResult,
43
- planeAxis1Result,
44
- planeAxis2Result
45
- ) {
46
- //>>includeStart('debug', pragmas.debug);
47
- Check.Check.defined("positions", positions);
48
- Check.Check.defined("centerResult", centerResult);
49
- Check.Check.defined("planeAxis1Result", planeAxis1Result);
50
- Check.Check.defined("planeAxis2Result", planeAxis2Result);
51
- //>>includeEnd('debug');
52
-
53
- const orientedBoundingBox = OrientedBoundingBox.OrientedBoundingBox.fromPoints(
54
- positions,
55
- obbScratch
56
- );
57
- const halfAxes = orientedBoundingBox.halfAxes;
58
- const xAxis = Matrix3.Matrix3.getColumn(halfAxes, 0, scratchXAxis);
59
- const yAxis = Matrix3.Matrix3.getColumn(halfAxes, 1, scratchYAxis);
60
- const zAxis = Matrix3.Matrix3.getColumn(halfAxes, 2, scratchZAxis);
61
-
62
- const xMag = Matrix3.Cartesian3.magnitude(xAxis);
63
- const yMag = Matrix3.Cartesian3.magnitude(yAxis);
64
- const zMag = Matrix3.Cartesian3.magnitude(zAxis);
65
- const min = Math.min(xMag, yMag, zMag);
66
-
67
- // If all the points are on a line return undefined because we can't draw a polygon
68
- if (
69
- (xMag === 0 && (yMag === 0 || zMag === 0)) ||
70
- (yMag === 0 && zMag === 0)
71
- ) {
72
- return false;
73
- }
74
-
75
- let planeAxis1;
76
- let planeAxis2;
77
-
78
- if (min === yMag || min === zMag) {
79
- planeAxis1 = xAxis;
80
- }
81
- if (min === xMag) {
82
- planeAxis1 = yAxis;
83
- } else if (min === zMag) {
84
- planeAxis2 = yAxis;
85
- }
86
- if (min === xMag || min === yMag) {
87
- planeAxis2 = zAxis;
88
- }
89
-
90
- Matrix3.Cartesian3.normalize(planeAxis1, planeAxis1Result);
91
- Matrix3.Cartesian3.normalize(planeAxis2, planeAxis2Result);
92
- Matrix3.Cartesian3.clone(orientedBoundingBox.center, centerResult);
93
- return true;
94
- };
95
-
96
- function projectTo2D(position, center, axis1, axis2, result) {
97
- const v = Matrix3.Cartesian3.subtract(position, center, scratchIntersectionPoint);
98
- const x = Matrix3.Cartesian3.dot(axis1, v);
99
- const y = Matrix3.Cartesian3.dot(axis2, v);
100
-
101
- return Matrix2.Cartesian2.fromElements(x, y, result);
102
- }
103
-
104
- CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function (
105
- center,
106
- axis1,
107
- axis2
108
- ) {
109
- return function (positions) {
110
- const positionResults = new Array(positions.length);
111
- for (let i = 0; i < positions.length; i++) {
112
- positionResults[i] = projectTo2D(positions[i], center, axis1, axis2);
113
- }
114
-
115
- return positionResults;
116
- };
117
- };
118
-
119
- CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction = function (
120
- center,
121
- axis1,
122
- axis2
123
- ) {
124
- return function (position, result) {
125
- return projectTo2D(position, center, axis1, axis2, result);
126
- };
127
- };
128
- var CoplanarPolygonGeometryLibrary$1 = CoplanarPolygonGeometryLibrary;
129
-
130
- exports.CoplanarPolygonGeometryLibrary = CoplanarPolygonGeometryLibrary$1;
131
-
132
- }));