@vtx/cs-map 1.0.122 → 1.0.124

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 (321) hide show
  1. package/README.md +202 -202
  2. package/lib/_util/EventEmitter.js +3 -3
  3. package/lib/_util/EventEmitter.js.map +1 -1
  4. package/lib/_util/Provider.js.map +1 -1
  5. package/lib/_util/StyleCache.js.map +1 -1
  6. package/lib/_util/cesium.js +10 -10
  7. package/lib/_util/cesium.js.map +1 -1
  8. package/lib/_util/encryptParams.js.map +1 -1
  9. package/lib/_util/filterSpecialCharacters.js +6 -6
  10. package/lib/_util/filterSpecialCharacters.js.map +1 -1
  11. package/lib/_util/generateRandomPosition.js +5 -5
  12. package/lib/_util/generateRandomPosition.js.map +1 -1
  13. package/lib/_util/getBBoxFromGeojson.js +11 -11
  14. package/lib/_util/getBBoxFromGeojson.js.map +1 -1
  15. package/lib/_util/getComponentProps.js.map +1 -1
  16. package/lib/_util/getCookie.js +4 -4
  17. package/lib/_util/getCookie.js.map +1 -1
  18. package/lib/_util/getDefaultMapInfo.js.map +1 -1
  19. package/lib/_util/getSystemInfo.js.map +1 -1
  20. package/lib/_util/getToken.js +2 -2
  21. package/lib/_util/getToken.js.map +1 -1
  22. package/lib/_util/getUrlParam.js.map +1 -1
  23. package/lib/_util/heightAndZoom.js.map +1 -1
  24. package/lib/_util/http.js +18 -18
  25. package/lib/_util/http.js.map +1 -1
  26. package/lib/_util/isFunction.js.map +1 -1
  27. package/lib/_util/isObject.js.map +1 -1
  28. package/lib/_util/layer.js +3 -3
  29. package/lib/_util/layer.js.map +1 -1
  30. package/lib/_util/mapTool.js +34 -34
  31. package/lib/_util/mapTool.js.map +1 -1
  32. package/lib/_util/parabola.js +7 -7
  33. package/lib/_util/parabola.js.map +1 -1
  34. package/lib/_util/setCookie.js +4 -4
  35. package/lib/_util/setCookie.js.map +1 -1
  36. package/lib/_util/transformRgb.js.map +1 -1
  37. package/lib/_util/useColSize.js.map +1 -1
  38. package/lib/_util/useInterval.js.map +1 -1
  39. package/lib/_util/useProps.js.map +1 -1
  40. package/lib/_util/useSet.js.map +1 -1
  41. package/lib/assets/grate.png +0 -0
  42. package/lib/assets/well.png +0 -0
  43. package/lib/building-tiles-layer/BuildingTilesLayer.js +2 -2
  44. package/lib/building-tiles-layer/BuildingTilesLayer.js.map +1 -1
  45. package/lib/building-tiles-layer/index.js.map +1 -1
  46. package/lib/building-tiles-layer/style/css.js.map +1 -1
  47. package/lib/building-tiles-layer/style/index.js.map +1 -1
  48. package/lib/cesium-tiles-layer/CesiumTilesLayer.js +2 -2
  49. package/lib/cesium-tiles-layer/CesiumTilesLayer.js.map +1 -1
  50. package/lib/cesium-tiles-layer/demo/index.less +111 -111
  51. package/lib/cesium-tiles-layer/demo/putian/index.less +27 -27
  52. package/lib/cesium-tiles-layer/index.js.map +1 -1
  53. package/lib/cesium-tiles-layer/style/css.js.map +1 -1
  54. package/lib/cesium-tiles-layer/style/index.js.map +1 -1
  55. package/lib/circle/Circle.js +2 -2
  56. package/lib/circle/Circle.js.map +1 -1
  57. package/lib/circle/index.js.map +1 -1
  58. package/lib/circle-fly/index.js +4 -4
  59. package/lib/circle-fly/index.js.map +1 -1
  60. package/lib/circle-fly/style/css.js.map +1 -1
  61. package/lib/circle-fly/style/index.js.map +1 -1
  62. package/lib/cone-glow-layer/BottomCircle.js.map +1 -1
  63. package/lib/cone-glow-layer/ButtomRotateCircle.js +8 -8
  64. package/lib/cone-glow-layer/ButtomRotateCircle.js.map +1 -1
  65. package/lib/cone-glow-layer/ConeGlowLayer.js.map +1 -1
  66. package/lib/cone-glow-layer/Texture.js.map +1 -1
  67. package/lib/config.js.map +1 -1
  68. package/lib/demand-layer/DemandLayer.js +5 -3
  69. package/lib/demand-layer/DemandLayer.js.map +1 -1
  70. package/lib/demand-layer/index.js.map +1 -1
  71. package/lib/demand-layer/style/css.js.map +1 -1
  72. package/lib/demand-layer/style/index.js.map +1 -1
  73. package/lib/dom/Dom.js.map +1 -1
  74. package/lib/dom/index.js +2 -2
  75. package/lib/dom/index.js.map +1 -1
  76. package/lib/events/index.js +2 -2
  77. package/lib/events/index.js.map +1 -1
  78. package/lib/excavation-analysis/Cut.js +19 -19
  79. package/lib/excavation-analysis/Cut.js.map +1 -1
  80. package/lib/excavation-analysis/TilesetCut.js +5 -5
  81. package/lib/excavation-analysis/TilesetCut.js.map +1 -1
  82. package/lib/excavation-analysis/hooks/useDrawHandler.js.map +1 -1
  83. package/lib/excavation-analysis/hooks/useTerrainClipPlan.js.map +1 -1
  84. package/lib/excavation-analysis/hooks/useTileSetCut.js.map +1 -1
  85. package/lib/excavation-analysis/index.js.map +1 -1
  86. package/lib/excavation-analysis/style/css.js.map +1 -1
  87. package/lib/excavation-analysis/style/index.js.map +1 -1
  88. package/lib/feature-layer/FeatureLayer.js +7 -5
  89. package/lib/feature-layer/FeatureLayer.js.map +1 -1
  90. package/lib/feature-layer/createFeatureCollection.js +11 -11
  91. package/lib/feature-layer/createFeatureCollection.js.map +1 -1
  92. package/lib/feature-layer/index.js +2 -2
  93. package/lib/feature-layer/index.js.map +1 -1
  94. package/lib/feature-layer/style/css.js.map +1 -1
  95. package/lib/feature-layer/style/index.js.map +1 -1
  96. package/lib/fence-layer/FenceLayer.js +5 -3
  97. package/lib/fence-layer/FenceLayer.js.map +1 -1
  98. package/lib/fence-layer/GradualLightRingMaterialProperty.js +5 -5
  99. package/lib/fence-layer/GradualLightRingMaterialProperty.js.map +1 -1
  100. package/lib/fence-layer/index.js.map +1 -1
  101. package/lib/fence-layer/style/css.js.map +1 -1
  102. package/lib/fence-layer/style/index.js.map +1 -1
  103. package/lib/flight-line-layer/FlightLineLayer.js.map +1 -1
  104. package/lib/flight-line-layer/index.js +2 -2
  105. package/lib/flight-line-layer/index.js.map +1 -1
  106. package/lib/flight-line-layer/style/css.js.map +1 -1
  107. package/lib/flight-line-layer/style/index.js.map +1 -1
  108. package/lib/fly-line-layer/FlyLineLayer.js +9 -7
  109. package/lib/fly-line-layer/FlyLineLayer.js.map +1 -1
  110. package/lib/fly-line-layer/LineFlowMaterialProperty.js.map +1 -1
  111. package/lib/fly-line-layer/index.js.map +1 -1
  112. package/lib/fly-line-layer/style/css.js.map +1 -1
  113. package/lib/fly-line-layer/style/index.js.map +1 -1
  114. package/lib/gif-dom-layer/GifDomLayer.js.map +1 -1
  115. package/lib/gif-dom-layer/index.js.map +1 -1
  116. package/lib/gif-dom-layer/style/css.js.map +1 -1
  117. package/lib/gif-dom-layer/style/index.js.map +1 -1
  118. package/lib/gradation-line-layer/GradationLineLayer.js.map +1 -1
  119. package/lib/gradation-line-layer/index.js.map +1 -1
  120. package/lib/gradation-line-layer/style/css.js.map +1 -1
  121. package/lib/gradation-line-layer/style/index.js.map +1 -1
  122. package/lib/group-layer/GroupLayer.js.map +1 -1
  123. package/lib/group-layer/index.js.map +1 -1
  124. package/lib/group-layer/style/css.js.map +1 -1
  125. package/lib/group-layer/style/index.js.map +1 -1
  126. package/lib/heatmap-layer/CesiumHeatmap.js +25 -23
  127. package/lib/heatmap-layer/CesiumHeatmap.js.map +1 -1
  128. package/lib/heatmap-layer/HeatmapLayer.js.map +1 -1
  129. package/lib/heatmap-layer/heatmap.js +41 -41
  130. package/lib/heatmap-layer/heatmap.js.map +1 -1
  131. package/lib/heatmap-layer/index.js +2 -2
  132. package/lib/heatmap-layer/index.js.map +1 -1
  133. package/lib/heatmap-layer/style/css.js.map +1 -1
  134. package/lib/heatmap-layer/style/index.js.map +1 -1
  135. package/lib/highlight-layer/HighlightLayer.js +22 -10
  136. package/lib/highlight-layer/HighlightLayer.js.map +1 -1
  137. package/lib/highlight-layer/index.js.map +1 -1
  138. package/lib/highlight-layer/style/css.js.map +1 -1
  139. package/lib/highlight-layer/style/index.js.map +1 -1
  140. package/lib/image-layer/ImageLayer.js +4 -2
  141. package/lib/image-layer/ImageLayer.js.map +1 -1
  142. package/lib/image-layer/index.js +2 -2
  143. package/lib/image-layer/index.js.map +1 -1
  144. package/lib/image-layer/style/css.js.map +1 -1
  145. package/lib/image-layer/style/index.js.map +1 -1
  146. package/lib/image-wms-layer/ImageWmsLayer.js +2 -2
  147. package/lib/image-wms-layer/ImageWmsLayer.js.map +1 -1
  148. package/lib/image-wms-layer/index.js +2 -2
  149. package/lib/image-wms-layer/index.js.map +1 -1
  150. package/lib/image-wms-layer/style/css.js.map +1 -1
  151. package/lib/image-wms-layer/style/index.js.map +1 -1
  152. package/lib/index.js.map +1 -1
  153. package/lib/inundate-analysis/index.js.map +1 -1
  154. package/lib/inundate-analysis/style/css.js.map +1 -1
  155. package/lib/inundate-analysis/style/index.js.map +1 -1
  156. package/lib/label/Label.js +2 -2
  157. package/lib/label/Label.js.map +1 -1
  158. package/lib/label/index.js.map +1 -1
  159. package/lib/legend/index.js +2 -2
  160. package/lib/legend/index.js.map +1 -1
  161. package/lib/legend/style/css.js.map +1 -1
  162. package/lib/legend/style/index.js.map +1 -1
  163. package/lib/legend/style/index.less +74 -74
  164. package/lib/line-flow-layer/LineFlowLayer.js +5 -3
  165. package/lib/line-flow-layer/LineFlowLayer.js.map +1 -1
  166. package/lib/line-flow-layer/index.js.map +1 -1
  167. package/lib/line-flow-layer/style/css.js.map +1 -1
  168. package/lib/line-flow-layer/style/index.js.map +1 -1
  169. package/lib/map/InfoTool/index.js +43 -43
  170. package/lib/map/InfoTool/index.js.map +1 -1
  171. package/lib/map/InfoTool/index.less +46 -46
  172. package/lib/map/InfoTool/util.js +23 -23
  173. package/lib/map/InfoTool/util.js.map +1 -1
  174. package/lib/map/InfoWindow.js.map +1 -1
  175. package/lib/map/Layers.js +8 -8
  176. package/lib/map/Layers.js.map +1 -1
  177. package/lib/map/Popup.js +20 -15
  178. package/lib/map/Popup.js.map +1 -1
  179. package/lib/map/base/imagery/amap/AmapImageryProvider.js.map +1 -1
  180. package/lib/map/base/imagery/amap/AmapMercatorTilingScheme.js.map +1 -1
  181. package/lib/map/base/imagery/baidu/BaiduImageryProvider.js.map +1 -1
  182. package/lib/map/base/imagery/baidu/BaiduMercatorProjection.js +77 -77
  183. package/lib/map/base/imagery/baidu/BaiduMercatorProjection.js.map +1 -1
  184. package/lib/map/base/imagery/baidu/BaiduMercatorTilingScheme.js +13 -13
  185. package/lib/map/base/imagery/baidu/BaiduMercatorTilingScheme.js.map +1 -1
  186. package/lib/map/base/imagery/geoq/GeoQImageryProvider.js.map +1 -1
  187. package/lib/map/base/imagery/google/GoogleImageryProvider.js.map +1 -1
  188. package/lib/map/base/imagery/irs/IRSImageryProvider.js.map +1 -1
  189. package/lib/map/base/imagery/tdt/JiangSuTdtImageryProvider.js.map +1 -1
  190. package/lib/map/base/imagery/tdt/TdtImageryProvider.js +4 -4
  191. package/lib/map/base/imagery/tdt/TdtImageryProvider.js.map +1 -1
  192. package/lib/map/base/imagery/tencent/TencentImageryProvider.js.map +1 -1
  193. package/lib/map/base/imagery/transform/AmapMercatorTilingScheme.js.map +1 -1
  194. package/lib/map/base/imagery/transform/CoordTransform.js +42 -42
  195. package/lib/map/base/imagery/transform/CoordTransform.js.map +1 -1
  196. package/lib/map/base/index.js +25 -10
  197. package/lib/map/base/index.js.map +1 -1
  198. package/lib/map/hooks/useGetMapFeatureInfoByText.js +1 -1
  199. package/lib/map/hooks/useGetMapFeatureInfoByText.js.map +1 -1
  200. package/lib/map/index.js +5 -5
  201. package/lib/map/index.js.map +1 -1
  202. package/lib/map/material/AroundPoint.js.map +1 -1
  203. package/lib/map/material/CircleRippleMaterialProperty.js +5 -5
  204. package/lib/map/material/CircleRippleMaterialProperty.js.map +1 -1
  205. package/lib/map/material/ODLineLayer.js.map +1 -1
  206. package/lib/map/material/PolylineTrailLinkMaterialProperty.js.map +1 -1
  207. package/lib/map/material/PolylineTrailMaterialProperty.js.map +1 -1
  208. package/lib/map/material/TilesBuilding.js.map +1 -1
  209. package/lib/map/material/index.js.map +1 -1
  210. package/lib/map/style/css.js.map +1 -1
  211. package/lib/map/style/index.js.map +1 -1
  212. package/lib/map/style/index.less +248 -248
  213. package/lib/marker/Marker.js +2 -2
  214. package/lib/marker/Marker.js.map +1 -1
  215. package/lib/marker/index.js.map +1 -1
  216. package/lib/model/Model.js +2 -2
  217. package/lib/model/Model.js.map +1 -1
  218. package/lib/model/index.js +2 -2
  219. package/lib/model/index.js.map +1 -1
  220. package/lib/navigation/index.js +6 -6
  221. package/lib/navigation/index.js.map +1 -1
  222. package/lib/navigation/style/css.js.map +1 -1
  223. package/lib/navigation/style/index.js.map +1 -1
  224. package/lib/navigation/style/index.less +176 -176
  225. package/lib/pipe-tiles-layer/PipeTilesLayer.js.map +1 -1
  226. package/lib/pipe-tiles-layer/index.js.map +1 -1
  227. package/lib/pipe-tiles-layer/style/css.js.map +1 -1
  228. package/lib/pipe-tiles-layer/style/index.js.map +1 -1
  229. package/lib/point/Point.js +2 -2
  230. package/lib/point/Point.js.map +1 -1
  231. package/lib/point/index.js.map +1 -1
  232. package/lib/polygon/Polygon.js +2 -2
  233. package/lib/polygon/Polygon.js.map +1 -1
  234. package/lib/polygon/index.js.map +1 -1
  235. package/lib/polyline/Polyline.js +2 -2
  236. package/lib/polyline/Polyline.js.map +1 -1
  237. package/lib/polyline/index.js.map +1 -1
  238. package/lib/renderer/index.js +24 -18
  239. package/lib/renderer/index.js.map +1 -1
  240. package/lib/renderer/style/css.js.map +1 -1
  241. package/lib/renderer/style/index.js.map +1 -1
  242. package/lib/road-line-layer/RoadLineLayer.js +3 -4
  243. package/lib/road-line-layer/RoadLineLayer.js.map +1 -1
  244. package/lib/road-line-layer/index.js.map +1 -1
  245. package/lib/road-line-layer/style/css.js.map +1 -1
  246. package/lib/road-line-layer/style/index.js.map +1 -1
  247. package/lib/scene-roam/index.js.map +1 -1
  248. package/lib/scene-roam/style/css.js.map +1 -1
  249. package/lib/scene-roam/style/index.js.map +1 -1
  250. package/lib/slider-scene/index.js.map +1 -1
  251. package/lib/slider-scene/style/css.js.map +1 -1
  252. package/lib/slider-scene/style/index.js.map +1 -1
  253. package/lib/slider-scene/style/index.less +13 -13
  254. package/lib/split-screen/index.js +2 -2
  255. package/lib/split-screen/index.js.map +1 -1
  256. package/lib/style/index.less +2 -2
  257. package/lib/style/themes/compact.less +1 -1
  258. package/lib/style/themes/dark.less +9 -9
  259. package/lib/style/themes/default.less +7 -7
  260. package/lib/style/themes/index.less +1 -1
  261. package/lib/style/themes/variable.less +5 -5
  262. package/lib/three-line-layer/ThreeLineLayer.js +3 -1
  263. package/lib/three-line-layer/ThreeLineLayer.js.map +1 -1
  264. package/lib/three-line-layer/index.js +5 -1
  265. package/lib/three-line-layer/index.js.map +1 -1
  266. package/lib/three-line-layer/style/css.js.map +1 -1
  267. package/lib/three-line-layer/style/index.js.map +1 -1
  268. package/lib/three-point-layer/DiffuseCircle.js.map +1 -1
  269. package/lib/three-point-layer/Grate.js +774 -0
  270. package/lib/three-point-layer/Grate.js.map +1 -0
  271. package/lib/three-point-layer/ThreePointLayer.js +95 -35
  272. package/lib/three-point-layer/ThreePointLayer.js.map +1 -1
  273. package/lib/three-point-layer/Well.js +440 -0
  274. package/lib/three-point-layer/Well.js.map +1 -0
  275. package/lib/three-point-layer/index.js +5 -1
  276. package/lib/three-point-layer/index.js.map +1 -1
  277. package/lib/three-point-layer/style/css.js.map +1 -1
  278. package/lib/three-point-layer/style/index.js.map +1 -1
  279. package/lib/tools/base-map-switch/index.js.map +1 -1
  280. package/lib/tools/components/Icon/index.js.map +1 -1
  281. package/lib/tools/components/Icon/svg.js.map +1 -1
  282. package/lib/tools/components/item-wrap/index.js.map +1 -1
  283. package/lib/tools/index.js.map +1 -1
  284. package/lib/tools/layer-control/index.js +6 -6
  285. package/lib/tools/layer-control/index.js.map +1 -1
  286. package/lib/tools/layer-control-popover/LayersCheckService.js +8 -8
  287. package/lib/tools/layer-control-popover/LayersCheckService.js.map +1 -1
  288. package/lib/tools/layer-control-popover/index.js.map +1 -1
  289. package/lib/tools/loading/index.js.map +1 -1
  290. package/lib/tools/map-search/Select/index.js +7 -7
  291. package/lib/tools/map-search/Select/index.js.map +1 -1
  292. package/lib/tools/map-search/Select/style/css.js.map +1 -1
  293. package/lib/tools/map-search/Select/style/index.js.map +1 -1
  294. package/lib/tools/map-search/Select/style/index.less +47 -47
  295. package/lib/tools/map-search/index.js +5 -5
  296. package/lib/tools/map-search/index.js.map +1 -1
  297. package/lib/tools/tip/index.js.map +1 -1
  298. package/lib/tools/tool-box/Measure/Area/index.js.map +1 -1
  299. package/lib/tools/tool-box/Measure/Distance/index.js.map +1 -1
  300. package/lib/tools/tool-box/Measure/Measure.js.map +1 -1
  301. package/lib/tools/tool-box/Measure/index.js +2 -2
  302. package/lib/tools/tool-box/Measure/index.js.map +1 -1
  303. package/lib/tools/tool-box/index.js.map +1 -1
  304. package/lib/trail-polyline-layer/TrailPolylineLayer.js.map +1 -1
  305. package/lib/trail-polyline-layer/TrailPolylineMaterial.js.map +1 -1
  306. package/lib/trail-polyline-layer/style/css.js.map +1 -1
  307. package/lib/trail-polyline-layer/style/index.js.map +1 -1
  308. package/lib/wall/WallGeometry.js.map +1 -1
  309. package/lib/wall/style/css.js.map +1 -1
  310. package/lib/wall/style/index.js.map +1 -1
  311. package/lib/water-surface-layer/WaterSurfaceLayer.js +8 -6
  312. package/lib/water-surface-layer/WaterSurfaceLayer.js.map +1 -1
  313. package/lib/water-surface-layer/index.js.map +1 -1
  314. package/lib/water-surface-layer/style/css.js.map +1 -1
  315. package/lib/water-surface-layer/style/index.js.map +1 -1
  316. package/lib/weather/Weather.js +28 -28
  317. package/lib/weather/Weather.js.map +1 -1
  318. package/lib/weather/index.js.map +1 -1
  319. package/lib/weather/style/css.js.map +1 -1
  320. package/lib/weather/style/index.js.map +1 -1
  321. package/package.json +2 -2
@@ -0,0 +1,774 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _cesium = require("cesium");
8
+ var diffScratch = new _cesium.Cartesian3();
9
+
10
+ /**
11
+ * Describes a cube centered at the origin.
12
+ *
13
+ * @alias BoxGeometry
14
+ * @constructor
15
+ *
16
+ * @param {Object} options Object with the following properties:
17
+ * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.
18
+ * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.
19
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
20
+ *
21
+ * @see Grate.fromDimensions
22
+ * @see Grate.createGeometry
23
+ * @see Packable
24
+ *
25
+ * @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo}
26
+ *
27
+ * @example
28
+ * const box = new Cesium.BoxGeometry({
29
+ * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
30
+ * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
31
+ * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
32
+ * });
33
+ * const geometry = Cesium.BoxGeometry.createGeometry(box);
34
+ */
35
+ function Grate(options) {
36
+ options = (0, _cesium.defaultValue)(options, _cesium.defaultValue.EMPTY_OBJECT);
37
+ var min = options.minimum;
38
+ var max = options.maximum;
39
+
40
+ //>>includeStart('debug', pragmas.debug);
41
+ _cesium.Check.typeOf.object("min", min);
42
+ _cesium.Check.typeOf.object("max", max);
43
+ if ((0, _cesium.defined)(options.offsetAttribute) && options.offsetAttribute === _cesium.GeometryOffsetAttribute.TOP) {
44
+ throw new _cesium.DeveloperError("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");
45
+ }
46
+ //>>includeEnd('debug');
47
+
48
+ var vertexFormat = (0, _cesium.defaultValue)(options.vertexFormat, _cesium.VertexFormat.DEFAULT);
49
+ this._minimum = _cesium.Cartesian3.clone(min);
50
+ this._maximum = _cesium.Cartesian3.clone(max);
51
+ this._vertexFormat = vertexFormat;
52
+ this._offsetAttribute = options.offsetAttribute;
53
+ this._workerName = "createBoxGeometry";
54
+ }
55
+
56
+ /**
57
+ * Creates a cube centered at the origin given its dimensions.
58
+ *
59
+ * @param {Object} options Object with the following properties:
60
+ * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively.
61
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
62
+ * @returns {Grate}
63
+ *
64
+ * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.
65
+ *
66
+ *
67
+ * @example
68
+ * const box = Cesium.BoxGeometry.fromDimensions({
69
+ * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
70
+ * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
71
+ * });
72
+ * const geometry = Cesium.BoxGeometry.createGeometry(box);
73
+ *
74
+ * @see Grate.createGeometry
75
+ */
76
+ Grate.fromDimensions = function (options) {
77
+ options = (0, _cesium.defaultValue)(options, _cesium.defaultValue.EMPTY_OBJECT);
78
+ var dimensions = options.dimensions;
79
+
80
+ //>>includeStart('debug', pragmas.debug);
81
+ _cesium.Check.typeOf.object("dimensions", dimensions);
82
+ _cesium.Check.typeOf.number.greaterThanOrEquals("dimensions.x", dimensions.x, 0);
83
+ _cesium.Check.typeOf.number.greaterThanOrEquals("dimensions.y", dimensions.y, 0);
84
+ _cesium.Check.typeOf.number.greaterThanOrEquals("dimensions.z", dimensions.z, 0);
85
+ //>>includeEnd('debug');
86
+
87
+ var corner = _cesium.Cartesian3.multiplyByScalar(dimensions, 0.5, new _cesium.Cartesian3());
88
+ return new Grate({
89
+ minimum: _cesium.Cartesian3.negate(corner, new _cesium.Cartesian3()),
90
+ maximum: corner,
91
+ vertexFormat: options.vertexFormat,
92
+ offsetAttribute: options.offsetAttribute
93
+ });
94
+ };
95
+
96
+ /**
97
+ * Creates a cube from the dimensions of an AxisAlignedBoundingBox.
98
+ *
99
+ * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.
100
+ * @returns {Grate}
101
+ *
102
+ *
103
+ *
104
+ * @example
105
+ * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
106
+ * -72.0, 40.0,
107
+ * -70.0, 35.0,
108
+ * -75.0, 30.0,
109
+ * -70.0, 30.0,
110
+ * -68.0, 40.0
111
+ * ]));
112
+ * const box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
113
+ *
114
+ * @see Grate.createGeometry
115
+ */
116
+ Grate.fromAxisAlignedBoundingBox = function (boundingBox) {
117
+ //>>includeStart('debug', pragmas.debug);
118
+ _cesium.Check.typeOf.object("boundingBox", boundingBox);
119
+ //>>includeEnd('debug');
120
+
121
+ return new Grate({
122
+ minimum: boundingBox.minimum,
123
+ maximum: boundingBox.maximum
124
+ });
125
+ };
126
+
127
+ /**
128
+ * The number of elements used to pack the object into an array.
129
+ * @type {Number}
130
+ */
131
+ Grate.packedLength = 2 * _cesium.Cartesian3.packedLength + _cesium.VertexFormat.packedLength + 1;
132
+
133
+ /**
134
+ * Stores the provided instance into the provided array.
135
+ *
136
+ * @param {Grate} value The value to pack.
137
+ * @param {Number[]} array The array to pack into.
138
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
139
+ *
140
+ * @returns {Number[]} The array that was packed into
141
+ */
142
+ Grate.pack = function (value, array, startingIndex) {
143
+ //>>includeStart('debug', pragmas.debug);
144
+ _cesium.Check.typeOf.object("value", value);
145
+ _cesium.Check.defined("array", array);
146
+ //>>includeEnd('debug');
147
+
148
+ startingIndex = (0, _cesium.defaultValue)(startingIndex, 0);
149
+ _cesium.Cartesian3.pack(value._minimum, array, startingIndex);
150
+ _cesium.Cartesian3.pack(value._maximum, array, startingIndex + _cesium.Cartesian3.packedLength);
151
+ _cesium.VertexFormat.pack(value._vertexFormat, array, startingIndex + 2 * _cesium.Cartesian3.packedLength);
152
+ array[startingIndex + 2 * _cesium.Cartesian3.packedLength + _cesium.VertexFormat.packedLength] = (0, _cesium.defaultValue)(value._offsetAttribute, -1);
153
+ return array;
154
+ };
155
+ var scratchMin = new _cesium.Cartesian3();
156
+ var scratchMax = new _cesium.Cartesian3();
157
+ var scratchVertexFormat = new _cesium.VertexFormat();
158
+ var scratchOptions = {
159
+ minimum: scratchMin,
160
+ maximum: scratchMax,
161
+ vertexFormat: scratchVertexFormat,
162
+ offsetAttribute: undefined
163
+ };
164
+
165
+ /**
166
+ * Retrieves an instance from a packed array.
167
+ *
168
+ * @param {Number[]} array The packed array.
169
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
170
+ * @param {Grate} [result] The object into which to store the result.
171
+ * @returns {Grate} The modified result parameter or a new BoxGeometry instance if one was not provided.
172
+ */
173
+ Grate.unpack = function (array, startingIndex, result) {
174
+ //>>includeStart('debug', pragmas.debug);
175
+ _cesium.Check.defined("array", array);
176
+ //>>includeEnd('debug');
177
+
178
+ startingIndex = (0, _cesium.defaultValue)(startingIndex, 0);
179
+ var min = _cesium.Cartesian3.unpack(array, startingIndex, scratchMin);
180
+ var max = _cesium.Cartesian3.unpack(array, startingIndex + _cesium.Cartesian3.packedLength, scratchMax);
181
+ var vertexFormat = _cesium.VertexFormat.unpack(array, startingIndex + 2 * _cesium.Cartesian3.packedLength, scratchVertexFormat);
182
+ var offsetAttribute = array[startingIndex + 2 * _cesium.Cartesian3.packedLength + _cesium.VertexFormat.packedLength];
183
+ if (!(0, _cesium.defined)(result)) {
184
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
185
+ return new Grate(scratchOptions);
186
+ }
187
+ result._minimum = _cesium.Cartesian3.clone(min, result._minimum);
188
+ result._maximum = _cesium.Cartesian3.clone(max, result._maximum);
189
+ result._vertexFormat = _cesium.VertexFormat.clone(vertexFormat, result._vertexFormat);
190
+ result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
191
+ return result;
192
+ };
193
+
194
+ /**
195
+ * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.
196
+ *
197
+ * @param {Grate} boxGeometry A description of the box.
198
+ * @returns {Geometry|undefined} The computed vertices and indices.
199
+ */
200
+ Grate.createGeometry = function (boxGeometry) {
201
+ var min = boxGeometry._minimum;
202
+ var max = boxGeometry._maximum;
203
+ var vertexFormat = boxGeometry._vertexFormat;
204
+ if (_cesium.Cartesian3.equals(min, max)) {
205
+ return;
206
+ }
207
+ var attributes = new _cesium.GeometryAttributes();
208
+ var indices;
209
+ var positions;
210
+ if (vertexFormat.position && (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent)) {
211
+ if (vertexFormat.position) {
212
+ // 8 corner points. Duplicated 3 times each for each incident edge/face.
213
+ positions = new Float64Array(6 * 4 * 3);
214
+
215
+ // +z face
216
+ positions[0] = min.x;
217
+ positions[1] = min.y;
218
+ positions[2] = max.z;
219
+ positions[3] = max.x;
220
+ positions[4] = min.y;
221
+ positions[5] = max.z;
222
+ positions[6] = max.x;
223
+ positions[7] = max.y;
224
+ positions[8] = max.z;
225
+ positions[9] = min.x;
226
+ positions[10] = max.y;
227
+ positions[11] = max.z;
228
+
229
+ // -z face
230
+ positions[12] = min.x;
231
+ positions[13] = min.y;
232
+ positions[14] = min.z;
233
+ positions[15] = max.x;
234
+ positions[16] = min.y;
235
+ positions[17] = min.z;
236
+ positions[18] = max.x;
237
+ positions[19] = max.y;
238
+ positions[20] = min.z;
239
+ positions[21] = min.x;
240
+ positions[22] = max.y;
241
+ positions[23] = min.z;
242
+
243
+ // +x face
244
+ positions[24] = max.x;
245
+ positions[25] = min.y;
246
+ positions[26] = min.z;
247
+ positions[27] = max.x;
248
+ positions[28] = max.y;
249
+ positions[29] = min.z;
250
+ positions[30] = max.x;
251
+ positions[31] = max.y;
252
+ positions[32] = max.z;
253
+ positions[33] = max.x;
254
+ positions[34] = min.y;
255
+ positions[35] = max.z;
256
+
257
+ // -x face
258
+ positions[36] = min.x;
259
+ positions[37] = min.y;
260
+ positions[38] = min.z;
261
+ positions[39] = min.x;
262
+ positions[40] = max.y;
263
+ positions[41] = min.z;
264
+ positions[42] = min.x;
265
+ positions[43] = max.y;
266
+ positions[44] = max.z;
267
+ positions[45] = min.x;
268
+ positions[46] = min.y;
269
+ positions[47] = max.z;
270
+
271
+ // +y face
272
+ positions[48] = min.x;
273
+ positions[49] = max.y;
274
+ positions[50] = min.z;
275
+ positions[51] = max.x;
276
+ positions[52] = max.y;
277
+ positions[53] = min.z;
278
+ positions[54] = max.x;
279
+ positions[55] = max.y;
280
+ positions[56] = max.z;
281
+ positions[57] = min.x;
282
+ positions[58] = max.y;
283
+ positions[59] = max.z;
284
+
285
+ // -y face
286
+ positions[60] = min.x;
287
+ positions[61] = min.y;
288
+ positions[62] = min.z;
289
+ positions[63] = max.x;
290
+ positions[64] = min.y;
291
+ positions[65] = min.z;
292
+ positions[66] = max.x;
293
+ positions[67] = min.y;
294
+ positions[68] = max.z;
295
+ positions[69] = min.x;
296
+ positions[70] = min.y;
297
+ positions[71] = max.z;
298
+ attributes.position = new _cesium.GeometryAttribute({
299
+ componentDatatype: _cesium.ComponentDatatype.DOUBLE,
300
+ componentsPerAttribute: 3,
301
+ values: positions
302
+ });
303
+ }
304
+ if (vertexFormat.normal) {
305
+ var normals = new Float32Array(6 * 4 * 3);
306
+
307
+ // +z face
308
+ normals[0] = 0.0;
309
+ normals[1] = 0.0;
310
+ normals[2] = 1.0;
311
+ normals[3] = 0.0;
312
+ normals[4] = 0.0;
313
+ normals[5] = 1.0;
314
+ normals[6] = 0.0;
315
+ normals[7] = 0.0;
316
+ normals[8] = 1.0;
317
+ normals[9] = 0.0;
318
+ normals[10] = 0.0;
319
+ normals[11] = 1.0;
320
+
321
+ // -z face
322
+ normals[12] = 0.0;
323
+ normals[13] = 0.0;
324
+ normals[14] = -1.0;
325
+ normals[15] = 0.0;
326
+ normals[16] = 0.0;
327
+ normals[17] = -1.0;
328
+ normals[18] = 0.0;
329
+ normals[19] = 0.0;
330
+ normals[20] = -1.0;
331
+ normals[21] = 0.0;
332
+ normals[22] = 0.0;
333
+ normals[23] = -1.0;
334
+
335
+ // +x face
336
+ normals[24] = 1.0;
337
+ normals[25] = 0.0;
338
+ normals[26] = 0.0;
339
+ normals[27] = 1.0;
340
+ normals[28] = 0.0;
341
+ normals[29] = 0.0;
342
+ normals[30] = 1.0;
343
+ normals[31] = 0.0;
344
+ normals[32] = 0.0;
345
+ normals[33] = 1.0;
346
+ normals[34] = 0.0;
347
+ normals[35] = 0.0;
348
+
349
+ // -x face
350
+ normals[36] = -1.0;
351
+ normals[37] = 0.0;
352
+ normals[38] = 0.0;
353
+ normals[39] = -1.0;
354
+ normals[40] = 0.0;
355
+ normals[41] = 0.0;
356
+ normals[42] = -1.0;
357
+ normals[43] = 0.0;
358
+ normals[44] = 0.0;
359
+ normals[45] = -1.0;
360
+ normals[46] = 0.0;
361
+ normals[47] = 0.0;
362
+
363
+ // +y face
364
+ normals[48] = 0.0;
365
+ normals[49] = 1.0;
366
+ normals[50] = 0.0;
367
+ normals[51] = 0.0;
368
+ normals[52] = 1.0;
369
+ normals[53] = 0.0;
370
+ normals[54] = 0.0;
371
+ normals[55] = 1.0;
372
+ normals[56] = 0.0;
373
+ normals[57] = 0.0;
374
+ normals[58] = 1.0;
375
+ normals[59] = 0.0;
376
+
377
+ // -y face
378
+ normals[60] = 0.0;
379
+ normals[61] = -1.0;
380
+ normals[62] = 0.0;
381
+ normals[63] = 0.0;
382
+ normals[64] = -1.0;
383
+ normals[65] = 0.0;
384
+ normals[66] = 0.0;
385
+ normals[67] = -1.0;
386
+ normals[68] = 0.0;
387
+ normals[69] = 0.0;
388
+ normals[70] = -1.0;
389
+ normals[71] = 0.0;
390
+ attributes.normal = new _cesium.GeometryAttribute({
391
+ componentDatatype: _cesium.ComponentDatatype.FLOAT,
392
+ componentsPerAttribute: 3,
393
+ values: normals
394
+ });
395
+ }
396
+ if (vertexFormat.st) {
397
+ var texCoords = new Float32Array([
398
+ // +z face
399
+ 0, 0.75, 1, 0.75, 1, 1, 0, 1,
400
+ // -z face
401
+ 0, 0, 1, 0, 1, 0.25, 0, 0.25,
402
+ // +x face
403
+ 0, 0.25, 1, 0.25, 1, 0.75, 0, 0.75,
404
+ // -x face
405
+ 0, 0.25, 1, 0.25, 1, 0.75, 0, 0.75,
406
+ // +y face
407
+ 0, 0.25, 1, 0.25, 1, 0.75, 0, 0.75,
408
+ // -y face
409
+ 0, 0.25, 1, 0.25, 1, 0.75, 0, 0.75]);
410
+ attributes.st = new _cesium.GeometryAttribute({
411
+ componentDatatype: _cesium.ComponentDatatype.FLOAT,
412
+ componentsPerAttribute: 2,
413
+ values: texCoords
414
+ });
415
+ }
416
+ if (vertexFormat.tangent) {
417
+ var tangents = new Float32Array(6 * 4 * 3);
418
+
419
+ // +z face
420
+ tangents[0] = 1.0;
421
+ tangents[1] = 0.0;
422
+ tangents[2] = 0.0;
423
+ tangents[3] = 1.0;
424
+ tangents[4] = 0.0;
425
+ tangents[5] = 0.0;
426
+ tangents[6] = 1.0;
427
+ tangents[7] = 0.0;
428
+ tangents[8] = 0.0;
429
+ tangents[9] = 1.0;
430
+ tangents[10] = 0.0;
431
+ tangents[11] = 0.0;
432
+
433
+ // -z face
434
+ tangents[12] = -1.0;
435
+ tangents[13] = 0.0;
436
+ tangents[14] = 0.0;
437
+ tangents[15] = -1.0;
438
+ tangents[16] = 0.0;
439
+ tangents[17] = 0.0;
440
+ tangents[18] = -1.0;
441
+ tangents[19] = 0.0;
442
+ tangents[20] = 0.0;
443
+ tangents[21] = -1.0;
444
+ tangents[22] = 0.0;
445
+ tangents[23] = 0.0;
446
+
447
+ // +x face
448
+ tangents[24] = 0.0;
449
+ tangents[25] = 1.0;
450
+ tangents[26] = 0.0;
451
+ tangents[27] = 0.0;
452
+ tangents[28] = 1.0;
453
+ tangents[29] = 0.0;
454
+ tangents[30] = 0.0;
455
+ tangents[31] = 1.0;
456
+ tangents[32] = 0.0;
457
+ tangents[33] = 0.0;
458
+ tangents[34] = 1.0;
459
+ tangents[35] = 0.0;
460
+
461
+ // -x face
462
+ tangents[36] = 0.0;
463
+ tangents[37] = -1.0;
464
+ tangents[38] = 0.0;
465
+ tangents[39] = 0.0;
466
+ tangents[40] = -1.0;
467
+ tangents[41] = 0.0;
468
+ tangents[42] = 0.0;
469
+ tangents[43] = -1.0;
470
+ tangents[44] = 0.0;
471
+ tangents[45] = 0.0;
472
+ tangents[46] = -1.0;
473
+ tangents[47] = 0.0;
474
+
475
+ // +y face
476
+ tangents[48] = -1.0;
477
+ tangents[49] = 0.0;
478
+ tangents[50] = 0.0;
479
+ tangents[51] = -1.0;
480
+ tangents[52] = 0.0;
481
+ tangents[53] = 0.0;
482
+ tangents[54] = -1.0;
483
+ tangents[55] = 0.0;
484
+ tangents[56] = 0.0;
485
+ tangents[57] = -1.0;
486
+ tangents[58] = 0.0;
487
+ tangents[59] = 0.0;
488
+
489
+ // -y face
490
+ tangents[60] = 1.0;
491
+ tangents[61] = 0.0;
492
+ tangents[62] = 0.0;
493
+ tangents[63] = 1.0;
494
+ tangents[64] = 0.0;
495
+ tangents[65] = 0.0;
496
+ tangents[66] = 1.0;
497
+ tangents[67] = 0.0;
498
+ tangents[68] = 0.0;
499
+ tangents[69] = 1.0;
500
+ tangents[70] = 0.0;
501
+ tangents[71] = 0.0;
502
+ attributes.tangent = new _cesium.GeometryAttribute({
503
+ componentDatatype: _cesium.ComponentDatatype.FLOAT,
504
+ componentsPerAttribute: 3,
505
+ values: tangents
506
+ });
507
+ }
508
+ if (vertexFormat.bitangent) {
509
+ var bitangents = new Float32Array(6 * 4 * 3);
510
+
511
+ // +z face
512
+ bitangents[0] = 0.0;
513
+ bitangents[1] = 1.0;
514
+ bitangents[2] = 0.0;
515
+ bitangents[3] = 0.0;
516
+ bitangents[4] = 1.0;
517
+ bitangents[5] = 0.0;
518
+ bitangents[6] = 0.0;
519
+ bitangents[7] = 1.0;
520
+ bitangents[8] = 0.0;
521
+ bitangents[9] = 0.0;
522
+ bitangents[10] = 1.0;
523
+ bitangents[11] = 0.0;
524
+
525
+ // -z face
526
+ bitangents[12] = 0.0;
527
+ bitangents[13] = 1.0;
528
+ bitangents[14] = 0.0;
529
+ bitangents[15] = 0.0;
530
+ bitangents[16] = 1.0;
531
+ bitangents[17] = 0.0;
532
+ bitangents[18] = 0.0;
533
+ bitangents[19] = 1.0;
534
+ bitangents[20] = 0.0;
535
+ bitangents[21] = 0.0;
536
+ bitangents[22] = 1.0;
537
+ bitangents[23] = 0.0;
538
+
539
+ // +x face
540
+ bitangents[24] = 0.0;
541
+ bitangents[25] = 0.0;
542
+ bitangents[26] = 1.0;
543
+ bitangents[27] = 0.0;
544
+ bitangents[28] = 0.0;
545
+ bitangents[29] = 1.0;
546
+ bitangents[30] = 0.0;
547
+ bitangents[31] = 0.0;
548
+ bitangents[32] = 1.0;
549
+ bitangents[33] = 0.0;
550
+ bitangents[34] = 0.0;
551
+ bitangents[35] = 1.0;
552
+
553
+ // -x face
554
+ bitangents[36] = 0.0;
555
+ bitangents[37] = 0.0;
556
+ bitangents[38] = 1.0;
557
+ bitangents[39] = 0.0;
558
+ bitangents[40] = 0.0;
559
+ bitangents[41] = 1.0;
560
+ bitangents[42] = 0.0;
561
+ bitangents[43] = 0.0;
562
+ bitangents[44] = 1.0;
563
+ bitangents[45] = 0.0;
564
+ bitangents[46] = 0.0;
565
+ bitangents[47] = 1.0;
566
+
567
+ // +y face
568
+ bitangents[48] = 0.0;
569
+ bitangents[49] = 0.0;
570
+ bitangents[50] = 1.0;
571
+ bitangents[51] = 0.0;
572
+ bitangents[52] = 0.0;
573
+ bitangents[53] = 1.0;
574
+ bitangents[54] = 0.0;
575
+ bitangents[55] = 0.0;
576
+ bitangents[56] = 1.0;
577
+ bitangents[57] = 0.0;
578
+ bitangents[58] = 0.0;
579
+ bitangents[59] = 1.0;
580
+
581
+ // -y face
582
+ bitangents[60] = 0.0;
583
+ bitangents[61] = 0.0;
584
+ bitangents[62] = 1.0;
585
+ bitangents[63] = 0.0;
586
+ bitangents[64] = 0.0;
587
+ bitangents[65] = 1.0;
588
+ bitangents[66] = 0.0;
589
+ bitangents[67] = 0.0;
590
+ bitangents[68] = 1.0;
591
+ bitangents[69] = 0.0;
592
+ bitangents[70] = 0.0;
593
+ bitangents[71] = 1.0;
594
+ attributes.bitangent = new _cesium.GeometryAttribute({
595
+ componentDatatype: _cesium.ComponentDatatype.FLOAT,
596
+ componentsPerAttribute: 3,
597
+ values: bitangents
598
+ });
599
+ }
600
+
601
+ // 12 triangles: 6 faces, 2 triangles each.
602
+ indices = new Uint16Array(6 * 2 * 3);
603
+
604
+ // +z face
605
+ indices[0] = 0;
606
+ indices[1] = 1;
607
+ indices[2] = 2;
608
+ indices[3] = 0;
609
+ indices[4] = 2;
610
+ indices[5] = 3;
611
+
612
+ // -z face
613
+ indices[6] = 4 + 2;
614
+ indices[7] = 4 + 1;
615
+ indices[8] = 4 + 0;
616
+ indices[9] = 4 + 3;
617
+ indices[10] = 4 + 2;
618
+ indices[11] = 4 + 0;
619
+
620
+ // +x face
621
+ indices[12] = 8 + 0;
622
+ indices[13] = 8 + 1;
623
+ indices[14] = 8 + 2;
624
+ indices[15] = 8 + 0;
625
+ indices[16] = 8 + 2;
626
+ indices[17] = 8 + 3;
627
+
628
+ // -x face
629
+ indices[18] = 12 + 2;
630
+ indices[19] = 12 + 1;
631
+ indices[20] = 12 + 0;
632
+ indices[21] = 12 + 3;
633
+ indices[22] = 12 + 2;
634
+ indices[23] = 12 + 0;
635
+
636
+ // +y face
637
+ indices[24] = 16 + 2;
638
+ indices[25] = 16 + 1;
639
+ indices[26] = 16 + 0;
640
+ indices[27] = 16 + 3;
641
+ indices[28] = 16 + 2;
642
+ indices[29] = 16 + 0;
643
+
644
+ // -y face
645
+ indices[30] = 20 + 0;
646
+ indices[31] = 20 + 1;
647
+ indices[32] = 20 + 2;
648
+ indices[33] = 20 + 0;
649
+ indices[34] = 20 + 2;
650
+ indices[35] = 20 + 3;
651
+ } else {
652
+ // Positions only - no need to duplicate corner points
653
+ positions = new Float64Array(8 * 3);
654
+ positions[0] = min.x;
655
+ positions[1] = min.y;
656
+ positions[2] = min.z;
657
+ positions[3] = max.x;
658
+ positions[4] = min.y;
659
+ positions[5] = min.z;
660
+ positions[6] = max.x;
661
+ positions[7] = max.y;
662
+ positions[8] = min.z;
663
+ positions[9] = min.x;
664
+ positions[10] = max.y;
665
+ positions[11] = min.z;
666
+ positions[12] = min.x;
667
+ positions[13] = min.y;
668
+ positions[14] = max.z;
669
+ positions[15] = max.x;
670
+ positions[16] = min.y;
671
+ positions[17] = max.z;
672
+ positions[18] = max.x;
673
+ positions[19] = max.y;
674
+ positions[20] = max.z;
675
+ positions[21] = min.x;
676
+ positions[22] = max.y;
677
+ positions[23] = max.z;
678
+ attributes.position = new _cesium.GeometryAttribute({
679
+ componentDatatype: _cesium.ComponentDatatype.DOUBLE,
680
+ componentsPerAttribute: 3,
681
+ values: positions
682
+ });
683
+
684
+ // 12 triangles: 6 faces, 2 triangles each.
685
+ indices = new Uint16Array(6 * 2 * 3);
686
+
687
+ // plane z = corner.Z
688
+ indices[0] = 4;
689
+ indices[1] = 5;
690
+ indices[2] = 6;
691
+ indices[3] = 4;
692
+ indices[4] = 6;
693
+ indices[5] = 7;
694
+
695
+ // plane z = -corner.Z
696
+ indices[6] = 1;
697
+ indices[7] = 0;
698
+ indices[8] = 3;
699
+ indices[9] = 1;
700
+ indices[10] = 3;
701
+ indices[11] = 2;
702
+
703
+ // plane x = corner.X
704
+ indices[12] = 1;
705
+ indices[13] = 6;
706
+ indices[14] = 5;
707
+ indices[15] = 1;
708
+ indices[16] = 2;
709
+ indices[17] = 6;
710
+
711
+ // plane y = corner.Y
712
+ indices[18] = 2;
713
+ indices[19] = 3;
714
+ indices[20] = 7;
715
+ indices[21] = 2;
716
+ indices[22] = 7;
717
+ indices[23] = 6;
718
+
719
+ // plane x = -corner.X
720
+ indices[24] = 3;
721
+ indices[25] = 0;
722
+ indices[26] = 4;
723
+ indices[27] = 3;
724
+ indices[28] = 4;
725
+ indices[29] = 7;
726
+
727
+ // plane y = -corner.Y
728
+ indices[30] = 0;
729
+ indices[31] = 1;
730
+ indices[32] = 5;
731
+ indices[33] = 0;
732
+ indices[34] = 5;
733
+ indices[35] = 4;
734
+ }
735
+ var diff = _cesium.Cartesian3.subtract(max, min, diffScratch);
736
+ var radius = _cesium.Cartesian3.magnitude(diff) * 0.5;
737
+ if ((0, _cesium.defined)(boxGeometry._offsetAttribute)) {
738
+ var length = positions.length;
739
+ var applyOffset = new Uint8Array(length / 3);
740
+ var offsetValue = boxGeometry._offsetAttribute === _cesium.GeometryOffsetAttribute.NONE ? 0 : 1;
741
+ (0, _cesium.arrayFill)(applyOffset, offsetValue);
742
+ attributes.applyOffset = new _cesium.GeometryAttribute({
743
+ componentDatatype: _cesium.ComponentDatatype.UNSIGNED_BYTE,
744
+ componentsPerAttribute: 1,
745
+ values: applyOffset
746
+ });
747
+ }
748
+ return new _cesium.Geometry({
749
+ attributes: attributes,
750
+ indices: indices,
751
+ primitiveType: _cesium.PrimitiveType.TRIANGLES,
752
+ boundingSphere: new _cesium.BoundingSphere(_cesium.Cartesian3.ZERO, radius),
753
+ offsetAttribute: boxGeometry._offsetAttribute
754
+ });
755
+ };
756
+ var unitBoxGeometry;
757
+
758
+ /**
759
+ * Returns the geometric representation of a unit box, including its vertices, indices, and a bounding sphere.
760
+ * @returns {Geometry} The computed vertices and indices.
761
+ *
762
+ * @private
763
+ */
764
+ Grate.getUnitBox = function () {
765
+ if (!(0, _cesium.defined)(unitBoxGeometry)) {
766
+ unitBoxGeometry = Grate.createGeometry(Grate.fromDimensions({
767
+ dimensions: new _cesium.Cartesian3(1.0, 1.0, 1.0),
768
+ vertexFormat: _cesium.VertexFormat.POSITION_ONLY
769
+ }));
770
+ }
771
+ return unitBoxGeometry;
772
+ };
773
+ var _default = exports["default"] = Grate;
774
+ //# sourceMappingURL=Grate.js.map