@vcmap/ui 5.0.0-rc.18 → 5.0.0-rc.20

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 (379) hide show
  1. package/README.md +6 -6
  2. package/build/build.js +2 -2
  3. package/build/buildCesium.js +3 -3
  4. package/build/buildHelpers.js +2 -1
  5. package/config/base.config.json +0 -4
  6. package/config/dev.config.json +35 -14
  7. package/config/www.config.json +4 -0
  8. package/dist/assets/cesium/Workers/ArcType-ce2e50ab.js +37 -0
  9. package/dist/assets/cesium/Workers/AttributeCompression-b646d393.js +716 -0
  10. package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-ff186ccc.js +258 -0
  11. package/dist/assets/cesium/Workers/BoundingRectangle-be5924f4.js +369 -0
  12. package/dist/assets/cesium/Workers/BoxGeometry-12eeccaf.js +884 -0
  13. package/dist/assets/cesium/Workers/Check-666ab1a0.js +290 -0
  14. package/dist/assets/cesium/Workers/Color-a84038cb.js +2262 -0
  15. package/dist/assets/cesium/Workers/ComponentDatatype-f7b11d02.js +341 -0
  16. package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-3272c1b3.js +132 -0
  17. package/dist/assets/cesium/Workers/CorridorGeometryLibrary-0170e093.js +498 -0
  18. package/dist/assets/cesium/Workers/CylinderGeometry-7c5da648.js +467 -0
  19. package/dist/assets/cesium/Workers/CylinderGeometryLibrary-372c07d8.js +63 -0
  20. package/dist/assets/cesium/Workers/EllipseGeometry-797d580e.js +1304 -0
  21. package/dist/assets/cesium/Workers/EllipseGeometryLibrary-2939e1dc.js +366 -0
  22. package/dist/assets/cesium/Workers/EllipseOutlineGeometry-8b50870f.js +443 -0
  23. package/dist/assets/cesium/Workers/EllipsoidGeodesic-98c62a56.js +520 -0
  24. package/dist/assets/cesium/Workers/EllipsoidGeometry-21c0e3a5.js +637 -0
  25. package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-eff247c8.js +454 -0
  26. package/dist/assets/cesium/Workers/EllipsoidRhumbLine-19756602.js +741 -0
  27. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-214683dc.js +373 -0
  28. package/dist/assets/cesium/Workers/EncodedCartesian3-81f70735.js +171 -0
  29. package/dist/assets/cesium/Workers/FrustumGeometry-ac42a6d9.js +2512 -0
  30. package/dist/assets/cesium/Workers/GeometryAttribute-7d6f1732.js +619 -0
  31. package/dist/assets/cesium/Workers/GeometryAttributes-f06a2792.js +91 -0
  32. package/dist/assets/cesium/Workers/GeometryInstance-451dc1cd.js +121 -0
  33. package/dist/assets/cesium/Workers/GeometryOffsetAttribute-04332ce7.js +16 -0
  34. package/dist/assets/cesium/Workers/GeometryPipeline-ce4339ed.js +3690 -0
  35. package/dist/assets/cesium/Workers/IndexDatatype-a55ceaa1.js +200 -0
  36. package/dist/assets/cesium/Workers/IntersectionTests-f6e6bd8a.js +1836 -0
  37. package/dist/assets/cesium/Workers/Math-2dbd6b93.js +1330 -0
  38. package/dist/assets/cesium/Workers/Matrix2-13178034.js +7086 -0
  39. package/dist/assets/cesium/Workers/Matrix3-315394f6.js +4283 -0
  40. package/dist/assets/cesium/Workers/OrientedBoundingBox-04920dc7.js +1257 -0
  41. package/dist/assets/cesium/Workers/Plane-900aa728.js +309 -0
  42. package/dist/assets/cesium/Workers/PolygonGeometryLibrary-a8680d96.js +1074 -0
  43. package/dist/assets/cesium/Workers/PolygonPipeline-844aab0a.js +1345 -0
  44. package/dist/assets/cesium/Workers/PolylinePipeline-32f36d2a.js +573 -0
  45. package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-a510d657.js +781 -0
  46. package/dist/assets/cesium/Workers/PrimitivePipeline-ba38434a.js +966 -0
  47. package/dist/assets/cesium/Workers/RectangleGeometryLibrary-bdba697e.js +280 -0
  48. package/dist/assets/cesium/Workers/RuntimeError-06c93819.js +68 -0
  49. package/dist/assets/cesium/Workers/TerrainEncoding-833187da.js +1227 -0
  50. package/dist/assets/cesium/Workers/Transforms-40229881.js +14696 -0
  51. package/dist/assets/cesium/Workers/VertexFormat-6b480673.js +312 -0
  52. package/dist/assets/cesium/Workers/WallGeometryLibrary-919eed92.js +211 -0
  53. package/dist/assets/cesium/Workers/WebGLConstants-a8cc3e8c.js +620 -0
  54. package/dist/assets/cesium/Workers/WebMercatorProjection-13a90d41.js +151 -0
  55. package/dist/assets/cesium/Workers/arrayRemoveDuplicates-c2038105.js +129 -0
  56. package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +1336 -4
  57. package/dist/assets/cesium/Workers/combine-ca22a614.js +82 -0
  58. package/dist/assets/cesium/Workers/combineGeometry.js +17 -25
  59. package/dist/assets/cesium/Workers/createBoxGeometry.js +12 -25
  60. package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +313 -25
  61. package/dist/assets/cesium/Workers/createCircleGeometry.js +213 -25
  62. package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +160 -25
  63. package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +586 -25
  64. package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +236 -25
  65. package/dist/assets/cesium/Workers/createCorridorGeometry.js +1407 -25
  66. package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +603 -25
  67. package/dist/assets/cesium/Workers/createCylinderGeometry.js +12 -25
  68. package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +265 -25
  69. package/dist/assets/cesium/Workers/createEllipseGeometry.js +14 -25
  70. package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +14 -25
  71. package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +12 -25
  72. package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +15 -25
  73. package/dist/assets/cesium/Workers/createFrustumGeometry.js +12 -25
  74. package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +251 -25
  75. package/dist/assets/cesium/Workers/createGeometry.js +55 -25
  76. package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +2134 -25
  77. package/dist/assets/cesium/Workers/createPlaneGeometry.js +250 -25
  78. package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +115 -25
  79. package/dist/assets/cesium/Workers/createPolygonGeometry.js +1420 -25
  80. package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +683 -25
  81. package/dist/assets/cesium/Workers/createPolylineGeometry.js +571 -25
  82. package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +411 -25
  83. package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +301 -25
  84. package/dist/assets/cesium/Workers/createRectangleGeometry.js +1476 -25
  85. package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +535 -25
  86. package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +458 -25
  87. package/dist/assets/cesium/Workers/createSphereGeometry.js +123 -25
  88. package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +126 -25
  89. package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +127 -25
  90. package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +535 -25
  91. package/dist/assets/cesium/Workers/createVectorTileGeometries.js +445 -25
  92. package/dist/assets/cesium/Workers/createVectorTilePoints.js +79 -25
  93. package/dist/assets/cesium/Workers/createVectorTilePolygons.js +406 -25
  94. package/dist/assets/cesium/Workers/createVectorTilePolylines.js +254 -25
  95. package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +640 -25
  96. package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2711 -27
  97. package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +994 -25
  98. package/dist/assets/cesium/Workers/createWallGeometry.js +623 -25
  99. package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +432 -25
  100. package/dist/assets/cesium/Workers/decodeDraco.js +381 -25
  101. package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +3687 -25
  102. package/dist/assets/cesium/Workers/decodeI3S.js +1040 -0
  103. package/dist/assets/cesium/Workers/defaultValue-0a909f67.js +51 -0
  104. package/dist/assets/cesium/Workers/package.js +2 -2
  105. package/dist/assets/cesium/Workers/transcodeKTX2.js +1516 -25
  106. package/dist/assets/cesium/Workers/transferTypedArrayTest.js +18 -2
  107. package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +1023 -25
  108. package/dist/assets/{cesium.2f992f.js → cesium.adbd45.js} +112161 -108735
  109. package/dist/assets/cesium.js +1 -1
  110. package/dist/assets/{core.cb0408.js → core.60e74d.js} +1616 -1629
  111. package/dist/assets/core.f198cf.js +15993 -0
  112. package/dist/assets/core.js +1 -1
  113. package/dist/assets/{index.bccdf969.js → index.884a53ef.js} +1 -1
  114. package/dist/assets/{ol.5e3fd0.js → ol.c6ff35.js} +6992 -6972
  115. package/dist/assets/ol.dbd604.js +44299 -0
  116. package/dist/assets/ol.js +1 -1
  117. package/dist/assets/ui.bf504d.css +1 -0
  118. package/dist/assets/{ui.08c48f.js → ui.bf504d.js} +6121 -6785
  119. package/dist/assets/ui.js +1 -1
  120. package/dist/assets/{vue.228ead.js → vue.75b819.js} +0 -0
  121. package/dist/assets/vue.a831f1.js +4675 -0
  122. package/dist/assets/vue.js +2 -2
  123. package/dist/assets/{vuetify.0b5039.css → vuetify.0d7360.css} +0 -0
  124. package/dist/assets/{vuetify.0b5039.js → vuetify.0d7360.js} +1 -1
  125. package/dist/assets/vuetify.js +2 -2
  126. package/dist/index.html +1 -1
  127. package/index.js +2 -1
  128. package/lib/cesium.js +1 -1
  129. package/package.json +3 -4
  130. package/plugins/{simple-graph → @vcmap/simple-graph}/README.md +1 -1
  131. package/plugins/{simple-graph → @vcmap/simple-graph}/SimpleGraphComponent.vue +0 -0
  132. package/plugins/{simple-graph → @vcmap/simple-graph}/index.js +0 -0
  133. package/plugins/{simple-graph → @vcmap/simple-graph}/package.json +0 -0
  134. package/plugins/{simple-graph → @vcmap/simple-graph}/simpleGraphView.js +0 -0
  135. package/plugins/@vcmap-show-case/README.md +20 -0
  136. package/plugins/{buttonExamples/ButtonExamples.vue → @vcmap-show-case/buttons-example/ButtonsExample.vue} +1 -1
  137. package/plugins/@vcmap-show-case/buttons-example/README.md +4 -0
  138. package/plugins/{buttonExamples → @vcmap-show-case/buttons-example}/index.js +16 -8
  139. package/plugins/@vcmap-show-case/buttons-example/package.json +5 -0
  140. package/plugins/{categoryTest → @vcmap-show-case/category-tester}/Categories.vue +7 -6
  141. package/plugins/{categoryTest → @vcmap-show-case/category-tester}/Category.vue +4 -3
  142. package/plugins/@vcmap-show-case/category-tester/README.md +3 -0
  143. package/plugins/{categoryTest → @vcmap-show-case/category-tester}/index.js +12 -4
  144. package/plugins/@vcmap-show-case/category-tester/package.json +5 -0
  145. package/plugins/@vcmap-show-case/config-editor/README.md +3 -0
  146. package/plugins/{test → @vcmap-show-case/config-editor}/editor.vue +0 -0
  147. package/plugins/@vcmap-show-case/config-editor/index.js +47 -0
  148. package/plugins/@vcmap-show-case/config-editor/package.json +5 -0
  149. package/plugins/@vcmap-show-case/context-menu-tester/README.md +3 -0
  150. package/plugins/@vcmap-show-case/context-menu-tester/index.js +33 -0
  151. package/plugins/@vcmap-show-case/context-menu-tester/package.json +5 -0
  152. package/plugins/{@vcmap/pluginExample/pluginExampleComponent.vue → @vcmap-show-case/form-inputs-example/FormInputsExample.vue} +14 -13
  153. package/plugins/@vcmap-show-case/form-inputs-example/README.md +4 -0
  154. package/plugins/@vcmap-show-case/form-inputs-example/config.json +5 -0
  155. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example}/exampleActions.js +1 -1
  156. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example}/index.js +23 -22
  157. package/plugins/@vcmap-show-case/form-inputs-example/package.json +5 -0
  158. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example}/validation.js +0 -0
  159. package/plugins/@vcmap-show-case/icons-example/README.md +5 -0
  160. package/plugins/@vcmap-show-case/icons-example/allIconsComponent.vue +51 -0
  161. package/plugins/@vcmap-show-case/icons-example/index.js +44 -0
  162. package/plugins/@vcmap-show-case/icons-example/package.json +5 -0
  163. package/plugins/{test/testList.vue → @vcmap-show-case/list-example/ListExample.vue} +1 -1
  164. package/plugins/@vcmap-show-case/list-example/README.md +3 -0
  165. package/plugins/@vcmap-show-case/list-example/index.js +44 -0
  166. package/plugins/@vcmap-show-case/list-example/package.json +5 -0
  167. package/plugins/@vcmap-show-case/notifier-tester/README.md +3 -0
  168. package/plugins/{notifier → @vcmap-show-case/notifier-tester}/index.js +11 -6
  169. package/plugins/{notifier → @vcmap-show-case/notifier-tester}/notifierTester.vue +0 -0
  170. package/plugins/@vcmap-show-case/notifier-tester/package.json +5 -0
  171. package/plugins/@vcmap-show-case/textfields-example/README.md +3 -0
  172. package/plugins/{example/mySuperComponent.vue → @vcmap-show-case/textfields-example/TextfieldsExample.vue} +1 -7
  173. package/plugins/{example → @vcmap-show-case/textfields-example}/index.js +58 -62
  174. package/plugins/@vcmap-show-case/textfields-example/package.json +5 -0
  175. package/plugins/@vcmap-show-case/window-tester/README.md +3 -0
  176. package/plugins/{test/windowManagerExample.vue → @vcmap-show-case/window-tester/WindowExample.vue} +36 -20
  177. package/plugins/{test → @vcmap-show-case/window-tester}/emptyComponent.vue +8 -3
  178. package/plugins/@vcmap-show-case/window-tester/index.js +62 -0
  179. package/plugins/{test → @vcmap-show-case/window-tester}/myCustomHeader.vue +0 -0
  180. package/plugins/@vcmap-show-case/window-tester/package.json +5 -0
  181. package/plugins/{test → @vcmap-show-case/window-tester}/toolbox-data.js +9 -9
  182. package/plugins/{test/vcsContent.vue → @vcmap-show-case/window-tester/windowExampleContent.vue} +1 -5
  183. package/plugins/@vcmap-show-case/wizard-example/README.md +3 -0
  184. package/plugins/{wizardExample → @vcmap-show-case/wizard-example}/index.js +12 -6
  185. package/plugins/@vcmap-show-case/wizard-example/package.json +5 -0
  186. package/plugins/@vcmap-show-case/wizard-example/wizardExample.vue +95 -0
  187. package/plugins/package.json +2 -1
  188. package/src/actions/actionHelper.js +1 -3
  189. package/src/actions/stateRefAction.js +0 -10
  190. package/src/application/VcsApp.vue +42 -23
  191. package/src/application/VcsMap.vue +9 -0
  192. package/src/components/buttons/VcsActionButtonList.vue +1 -0
  193. package/src/components/form-inputs-controls/VcsCheckbox.vue +3 -1
  194. package/src/components/form-inputs-controls/VcsWizard.vue +17 -20
  195. package/src/components/form-inputs-controls/VcsWizardStep.vue +160 -0
  196. package/src/{icons → components/icons}/+all.js +0 -0
  197. package/src/{icons → components/icons}/2DAreaIcon.vue +0 -0
  198. package/src/{icons → components/icons}/2DDistanceIcon.vue +0 -0
  199. package/src/{icons → components/icons}/3DAreaIcon.vue +0 -0
  200. package/src/{icons → components/icons}/3DDistanceIcon.vue +0 -0
  201. package/src/{icons → components/icons}/3DHeightIcon.vue +0 -0
  202. package/src/{icons → components/icons}/AngleIcon.vue +0 -0
  203. package/src/{icons → components/icons}/AssociationsIcon.vue +0 -0
  204. package/src/{icons → components/icons}/AxisIcon.vue +0 -0
  205. package/src/{icons → components/icons}/BoundingBoxIcon.vue +0 -0
  206. package/src/{icons → components/icons}/CheckboxCheckedIcon.vue +0 -0
  207. package/src/{icons → components/icons}/CheckboxIcon.vue +0 -0
  208. package/src/{icons → components/icons}/CheckboxIndeterminateIcon.vue +0 -0
  209. package/src/{icons → components/icons}/CircleIcon.vue +0 -0
  210. package/src/{icons → components/icons}/ClippingHorizontalIcon.vue +0 -0
  211. package/src/{icons → components/icons}/ClippingIcon.vue +0 -0
  212. package/src/{icons → components/icons}/ClippingVerticalIcon.vue +0 -0
  213. package/src/{icons → components/icons}/ColorPickerIcon.vue +0 -0
  214. package/src/{icons → components/icons}/ColorSwatchIcon.vue +0 -0
  215. package/src/{icons → components/icons}/CommentIcon.vue +0 -0
  216. package/src/{icons → components/icons}/CompassIcon.vue +0 -0
  217. package/src/{icons → components/icons}/ComponentsIcon.vue +0 -0
  218. package/src/{icons → components/icons}/ConeIcon.vue +0 -0
  219. package/src/{icons → components/icons}/DimensionsHouseIcon.vue +0 -0
  220. package/src/{icons → components/icons}/EditIcon.vue +0 -0
  221. package/src/{icons → components/icons}/ElevationProfileIcon.vue +0 -0
  222. package/src/{icons → components/icons}/ExportAreaIcon.vue +0 -0
  223. package/src/{icons → components/icons}/ExportFlightIcon.vue +0 -0
  224. package/src/{icons → components/icons}/ExportIcon.vue +0 -0
  225. package/src/{icons → components/icons}/ExternalLinkIcon.vue +0 -0
  226. package/src/{icons → components/icons}/EyeIcon.vue +0 -0
  227. package/src/{icons → components/icons}/FastForwardIcon.vue +0 -0
  228. package/src/{icons → components/icons}/FilterIcon.vue +0 -0
  229. package/src/{icons → components/icons}/GlobalTerrainIcon.vue +0 -0
  230. package/src/{icons → components/icons}/GlobeNatureIcon.vue +0 -0
  231. package/src/{icons → components/icons}/GroundIcon.vue +0 -0
  232. package/src/{icons → components/icons}/HealthCareIndustriesIcon.vue +0 -0
  233. package/src/{icons → components/icons}/HelpIcon.vue +0 -0
  234. package/src/{icons → components/icons}/HideIcon.vue +0 -0
  235. package/src/{icons → components/icons}/HomePointIcon.vue +0 -0
  236. package/src/{icons → components/icons}/HospitalsIcon.vue +0 -0
  237. package/src/{icons → components/icons}/HouseIcon.vue +0 -0
  238. package/src/{icons → components/icons}/ImportIcon.vue +0 -0
  239. package/src/{icons → components/icons}/InfoIcon.vue +0 -0
  240. package/src/{icons → components/icons}/KebabIcon.vue +0 -0
  241. package/src/{icons → components/icons}/LabelIcon.vue +0 -0
  242. package/src/{icons → components/icons}/LayersIcon.vue +0 -0
  243. package/src/{icons → components/icons}/LegendIcon.vue +0 -0
  244. package/src/{icons → components/icons}/LineIcon.vue +0 -0
  245. package/src/{icons → components/icons}/LinkIcon.vue +0 -0
  246. package/src/{icons → components/icons}/LogoutIcon.vue +0 -0
  247. package/src/{icons → components/icons}/MapIcon.vue +0 -0
  248. package/src/{icons → components/icons}/MenuIcon.vue +0 -0
  249. package/src/{icons → components/icons}/MinusIcon.vue +0 -0
  250. package/src/{icons → components/icons}/ObjectAttributeIcon.vue +0 -0
  251. package/src/{icons → components/icons}/ObjectSelectIcon.vue +0 -0
  252. package/src/{icons → components/icons}/ObliqueViewIcon.vue +0 -0
  253. package/src/{icons → components/icons}/PdfIcon.vue +0 -0
  254. package/src/{icons → components/icons}/PedestrianIcon.vue +0 -0
  255. package/src/{icons → components/icons}/PenIcon.vue +0 -0
  256. package/src/{icons → components/icons}/PlayCircleIcon.vue +0 -0
  257. package/src/{icons → components/icons}/PlusIcon.vue +0 -0
  258. package/src/{icons → components/icons}/PoiIcon.vue +0 -0
  259. package/src/{icons → components/icons}/PointSelectIcon.vue +0 -0
  260. package/src/{icons → components/icons}/PolygonIcon.vue +0 -0
  261. package/src/{icons → components/icons}/PresentationModeIcon.vue +0 -0
  262. package/src/{icons → components/icons}/ProgressIcon.vue +0 -0
  263. package/src/{icons → components/icons}/QueryIcon.vue +0 -0
  264. package/src/{icons → components/icons}/RectangleIcon.vue +0 -0
  265. package/src/{icons → components/icons}/ReturnIcon.vue +0 -0
  266. package/src/{icons → components/icons}/RewindIcon.vue +0 -0
  267. package/src/{icons → components/icons}/RotateLeftIcon.vue +0 -0
  268. package/src/{icons → components/icons}/RotateRightIcon.vue +0 -0
  269. package/src/{icons → components/icons}/ScreenshotIcon.vue +0 -0
  270. package/src/{icons → components/icons}/SearchIcon.vue +0 -0
  271. package/src/{icons → components/icons}/ShadowIcon.vue +0 -0
  272. package/src/{icons → components/icons}/ShapesIcon.vue +0 -0
  273. package/src/{icons → components/icons}/ShareIcon.vue +0 -0
  274. package/src/{icons → components/icons}/SimpleCircleFilledIcon.vue +0 -0
  275. package/src/{icons → components/icons}/SimpleCircleHalfFilledIcon.vue +0 -0
  276. package/src/{icons → components/icons}/SimpleCircleOutlinedIcon.vue +0 -0
  277. package/src/{icons → components/icons}/SkipNextIcon.vue +0 -0
  278. package/src/{icons → components/icons}/SkipPreviousIcon.vue +0 -0
  279. package/src/{icons → components/icons}/SplitViewIcon.vue +0 -0
  280. package/src/{icons → components/icons}/TerrainBoxIcon.vue +0 -0
  281. package/src/{icons → components/icons}/TextStyleIcon.vue +0 -0
  282. package/src/{icons → components/icons}/ThreeDimensionsIcon.vue +0 -0
  283. package/src/{icons → components/icons}/ToolsIcon.vue +0 -0
  284. package/src/{icons → components/icons}/TouchIcon.vue +0 -0
  285. package/src/{icons → components/icons}/TrashCanIcon.vue +0 -0
  286. package/src/{icons → components/icons}/TriangleIcon.vue +0 -0
  287. package/src/{icons → components/icons}/TwoDimensionsIcon.vue +0 -0
  288. package/src/{icons → components/icons}/UploadIcon.vue +0 -0
  289. package/src/{icons → components/icons}/UserProfileIcon.vue +0 -0
  290. package/src/{icons → components/icons}/UserShareIcon.vue +0 -0
  291. package/src/{icons → components/icons}/VideoRecorderIcon.vue +0 -0
  292. package/src/{icons → components/icons}/ViewpointFlightIcon.vue +0 -0
  293. package/src/{icons → components/icons}/ViewpointIcon.vue +0 -0
  294. package/src/{icons → components/icons}/Viewshed360Icon.vue +0 -0
  295. package/src/{icons → components/icons}/ViewshedConeIcon.vue +0 -0
  296. package/src/{icons → components/icons}/ViewshedIcon.vue +0 -0
  297. package/src/{icons → components/icons}/WalkingIcon.vue +0 -0
  298. package/src/{icons → components/icons}/WallIcon.vue +0 -0
  299. package/src/{icons → components/icons}/WandIcon.vue +0 -0
  300. package/src/components/lists/VcsList.vue +21 -12
  301. package/src/components/lists/VcsTreeviewLeaf.vue +14 -2
  302. package/src/components/notification/VcsTooltip.vue +1 -1
  303. package/src/featureInfo/abstractFeatureInfoView.js +1 -1
  304. package/src/featureInfo/addressBalloonFeatureInfoView.js +1 -1
  305. package/src/featureInfo/balloonFeatureInfoView.js +1 -1
  306. package/src/featureInfo/balloonHelper.js +6 -6
  307. package/src/featureInfo/featureInfo.js +2 -2
  308. package/src/i18n/de.js +2 -6
  309. package/src/i18n/en.js +2 -6
  310. package/src/legend/legendHelper.js +4 -3
  311. package/src/legend/vcsLegend.vue +21 -2
  312. package/src/manager/window/WindowComponent.vue +42 -4
  313. package/src/manager/window/WindowComponentHeader.vue +1 -1
  314. package/src/manager/window/windowHelper.js +7 -11
  315. package/src/manager/window/windowManager.js +15 -11
  316. package/src/navigation/mapNavCompass.vue +13 -7
  317. package/src/navigation/mapNavigation.vue +66 -4
  318. package/src/navigation/orientationToolsButton.vue +1 -1
  319. package/src/navigation/overviewMap.js +26 -10
  320. package/src/navigation/vcsCompass.vue +4 -73
  321. package/src/setup.js +1 -1
  322. package/src/vuePlugins/vuetify.js +1 -1
  323. package/dist/assets/cesium/Workers/ArcType-c9b2b290.js +0 -25
  324. package/dist/assets/cesium/Workers/AttributeCompression-7b0f288d.js +0 -25
  325. package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-d0c22774.js +0 -25
  326. package/dist/assets/cesium/Workers/BoundingRectangle-201b1a81.js +0 -25
  327. package/dist/assets/cesium/Workers/BoxGeometry-4985457c.js +0 -25
  328. package/dist/assets/cesium/Workers/Color-cc8c18b3.js +0 -25
  329. package/dist/assets/cesium/Workers/ComponentDatatype-0200bf8c.js +0 -25
  330. package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-4345acdf.js +0 -25
  331. package/dist/assets/cesium/Workers/CorridorGeometryLibrary-850a6c35.js +0 -25
  332. package/dist/assets/cesium/Workers/CylinderGeometry-57a1051a.js +0 -25
  333. package/dist/assets/cesium/Workers/CylinderGeometryLibrary-62ce5a1f.js +0 -25
  334. package/dist/assets/cesium/Workers/EllipseGeometry-8627398f.js +0 -25
  335. package/dist/assets/cesium/Workers/EllipseGeometryLibrary-e5919563.js +0 -25
  336. package/dist/assets/cesium/Workers/EllipseOutlineGeometry-96fd4ae1.js +0 -25
  337. package/dist/assets/cesium/Workers/EllipsoidGeodesic-8bfefbff.js +0 -25
  338. package/dist/assets/cesium/Workers/EllipsoidGeometry-377329b9.js +0 -25
  339. package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-e6e16e49.js +0 -25
  340. package/dist/assets/cesium/Workers/EllipsoidRhumbLine-03528f73.js +0 -25
  341. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-c080fd1b.js +0 -25
  342. package/dist/assets/cesium/Workers/EncodedCartesian3-ea0e408f.js +0 -25
  343. package/dist/assets/cesium/Workers/FrustumGeometry-a8b5d817.js +0 -25
  344. package/dist/assets/cesium/Workers/GeometryAttribute-8458a8fd.js +0 -25
  345. package/dist/assets/cesium/Workers/GeometryAttributes-ac0f8485.js +0 -25
  346. package/dist/assets/cesium/Workers/GeometryInstance-ee3aa3ba.js +0 -25
  347. package/dist/assets/cesium/Workers/GeometryOffsetAttribute-08ae0c50.js +0 -25
  348. package/dist/assets/cesium/Workers/GeometryPipeline-33ca229c.js +0 -25
  349. package/dist/assets/cesium/Workers/IndexDatatype-e713bfd2.js +0 -25
  350. package/dist/assets/cesium/Workers/IntersectionTests-eb4db8e0.js +0 -25
  351. package/dist/assets/cesium/Workers/Matrix2-eefef8eb.js +0 -25
  352. package/dist/assets/cesium/Workers/OrientedBoundingBox-5193f9a2.js +0 -25
  353. package/dist/assets/cesium/Workers/Plane-b0299683.js +0 -25
  354. package/dist/assets/cesium/Workers/PolygonGeometryLibrary-b61295f3.js +0 -25
  355. package/dist/assets/cesium/Workers/PolygonPipeline-eb527514.js +0 -25
  356. package/dist/assets/cesium/Workers/PolylinePipeline-0f23dd84.js +0 -25
  357. package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-2d903430.js +0 -25
  358. package/dist/assets/cesium/Workers/PrimitivePipeline-e2640413.js +0 -25
  359. package/dist/assets/cesium/Workers/RectangleGeometryLibrary-ae8bf8a5.js +0 -25
  360. package/dist/assets/cesium/Workers/RuntimeError-5baf5c66.js +0 -25
  361. package/dist/assets/cesium/Workers/TerrainEncoding-bc10ab54.js +0 -25
  362. package/dist/assets/cesium/Workers/Transforms-d2e5867e.js +0 -63
  363. package/dist/assets/cesium/Workers/VertexFormat-5ec0d9ff.js +0 -25
  364. package/dist/assets/cesium/Workers/WallGeometryLibrary-1a33e416.js +0 -25
  365. package/dist/assets/cesium/Workers/WebGLConstants-5b50ced1.js +0 -25
  366. package/dist/assets/cesium/Workers/WebMercatorProjection-cd2f30c2.js +0 -25
  367. package/dist/assets/cesium/Workers/_commonjsHelpers-bc29abbc.js +0 -25
  368. package/dist/assets/cesium/Workers/arrayRemoveDuplicates-f13aceb1.js +0 -25
  369. package/dist/assets/cesium/Workers/combine-7533016d.js +0 -25
  370. package/dist/assets/cesium/Workers/defaultValue-0c475b81.js +0 -25
  371. package/dist/assets/cesium/Workers/package.json +0 -1
  372. package/dist/assets/ui.08c48f.css +0 -1
  373. package/plugins/@vcmap/pluginExample/config.json +0 -6
  374. package/plugins/@vcmap/pluginExample/package.json +0 -7
  375. package/plugins/categoryTest/ItemEditor.vue +0 -13
  376. package/plugins/test/allIconsComponent.vue +0 -50
  377. package/plugins/test/index.js +0 -209
  378. package/plugins/wizardExample/wizardExample.vue +0 -77
  379. package/src/components/form-inputs-controls/VcsColorPicker.vue +0 -85
@@ -0,0 +1,1330 @@
1
+ define(['exports', './Check-666ab1a0', './defaultValue-0a909f67'], (function (exports, Check, defaultValue) { 'use strict';
2
+
3
+ /*
4
+ https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
5
+ so it's better encapsulated. Now you can have multiple random number generators
6
+ and they won't stomp all over eachother's state.
7
+
8
+ If you want to use this as a substitute for Math.random(), use the random()
9
+ method like so:
10
+
11
+ var m = new MersenneTwister();
12
+ var randomNumber = m.random();
13
+
14
+ You can also call the other genrand_{foo}() methods on the instance.
15
+
16
+ If you want to use a specific seed in order to get a repeatable random
17
+ sequence, pass an integer into the constructor:
18
+
19
+ var m = new MersenneTwister(123);
20
+
21
+ and that will always produce the same random sequence.
22
+
23
+ Sean McCullough (banksean@gmail.com)
24
+ */
25
+
26
+ /*
27
+ A C-program for MT19937, with initialization improved 2002/1/26.
28
+ Coded by Takuji Nishimura and Makoto Matsumoto.
29
+
30
+ Before using, initialize the state by using init_seed(seed)
31
+ or init_by_array(init_key, key_length).
32
+
33
+ Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
34
+ All rights reserved.
35
+
36
+ Redistribution and use in source and binary forms, with or without
37
+ modification, are permitted provided that the following conditions
38
+ are met:
39
+
40
+ 1. Redistributions of source code must retain the above copyright
41
+ notice, this list of conditions and the following disclaimer.
42
+
43
+ 2. Redistributions in binary form must reproduce the above copyright
44
+ notice, this list of conditions and the following disclaimer in the
45
+ documentation and/or other materials provided with the distribution.
46
+
47
+ 3. The names of its contributors may not be used to endorse or promote
48
+ products derived from this software without specific prior written
49
+ permission.
50
+
51
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
55
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
56
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
57
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
58
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
59
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
60
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
61
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62
+
63
+
64
+ Any feedback is very welcome.
65
+ http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
66
+ email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
67
+ */
68
+
69
+ var MersenneTwister = function(seed) {
70
+ if (seed == undefined) {
71
+ seed = new Date().getTime();
72
+ }
73
+
74
+ /* Period parameters */
75
+ this.N = 624;
76
+ this.M = 397;
77
+ this.MATRIX_A = 0x9908b0df; /* constant vector a */
78
+ this.UPPER_MASK = 0x80000000; /* most significant w-r bits */
79
+ this.LOWER_MASK = 0x7fffffff; /* least significant r bits */
80
+
81
+ this.mt = new Array(this.N); /* the array for the state vector */
82
+ this.mti=this.N+1; /* mti==N+1 means mt[N] is not initialized */
83
+
84
+ if (seed.constructor == Array) {
85
+ this.init_by_array(seed, seed.length);
86
+ }
87
+ else {
88
+ this.init_seed(seed);
89
+ }
90
+ };
91
+
92
+ /* initializes mt[N] with a seed */
93
+ /* origin name init_genrand */
94
+ MersenneTwister.prototype.init_seed = function(s) {
95
+ this.mt[0] = s >>> 0;
96
+ for (this.mti=1; this.mti<this.N; this.mti++) {
97
+ var s = this.mt[this.mti-1] ^ (this.mt[this.mti-1] >>> 30);
98
+ this.mt[this.mti] = (((((s & 0xffff0000) >>> 16) * 1812433253) << 16) + (s & 0x0000ffff) * 1812433253)
99
+ + this.mti;
100
+ /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
101
+ /* In the previous versions, MSBs of the seed affect */
102
+ /* only MSBs of the array mt[]. */
103
+ /* 2002/01/09 modified by Makoto Matsumoto */
104
+ this.mt[this.mti] >>>= 0;
105
+ /* for >32 bit machines */
106
+ }
107
+ };
108
+
109
+ /* initialize by an array with array-length */
110
+ /* init_key is the array for initializing keys */
111
+ /* key_length is its length */
112
+ /* slight change for C++, 2004/2/26 */
113
+ MersenneTwister.prototype.init_by_array = function(init_key, key_length) {
114
+ var i, j, k;
115
+ this.init_seed(19650218);
116
+ i=1; j=0;
117
+ k = (this.N>key_length ? this.N : key_length);
118
+ for (; k; k--) {
119
+ var s = this.mt[i-1] ^ (this.mt[i-1] >>> 30);
120
+ this.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1664525) << 16) + ((s & 0x0000ffff) * 1664525)))
121
+ + init_key[j] + j; /* non linear */
122
+ this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */
123
+ i++; j++;
124
+ if (i>=this.N) { this.mt[0] = this.mt[this.N-1]; i=1; }
125
+ if (j>=key_length) j=0;
126
+ }
127
+ for (k=this.N-1; k; k--) {
128
+ var s = this.mt[i-1] ^ (this.mt[i-1] >>> 30);
129
+ this.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) + (s & 0x0000ffff) * 1566083941))
130
+ - i; /* non linear */
131
+ this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */
132
+ i++;
133
+ if (i>=this.N) { this.mt[0] = this.mt[this.N-1]; i=1; }
134
+ }
135
+
136
+ this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */
137
+ };
138
+
139
+ /* generates a random number on [0,0xffffffff]-interval */
140
+ /* origin name genrand_int32 */
141
+ MersenneTwister.prototype.random_int = function() {
142
+ var y;
143
+ var mag01 = new Array(0x0, this.MATRIX_A);
144
+ /* mag01[x] = x * MATRIX_A for x=0,1 */
145
+
146
+ if (this.mti >= this.N) { /* generate N words at one time */
147
+ var kk;
148
+
149
+ if (this.mti == this.N+1) /* if init_seed() has not been called, */
150
+ this.init_seed(5489); /* a default initial seed is used */
151
+
152
+ for (kk=0;kk<this.N-this.M;kk++) {
153
+ y = (this.mt[kk]&this.UPPER_MASK)|(this.mt[kk+1]&this.LOWER_MASK);
154
+ this.mt[kk] = this.mt[kk+this.M] ^ (y >>> 1) ^ mag01[y & 0x1];
155
+ }
156
+ for (;kk<this.N-1;kk++) {
157
+ y = (this.mt[kk]&this.UPPER_MASK)|(this.mt[kk+1]&this.LOWER_MASK);
158
+ this.mt[kk] = this.mt[kk+(this.M-this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];
159
+ }
160
+ y = (this.mt[this.N-1]&this.UPPER_MASK)|(this.mt[0]&this.LOWER_MASK);
161
+ this.mt[this.N-1] = this.mt[this.M-1] ^ (y >>> 1) ^ mag01[y & 0x1];
162
+
163
+ this.mti = 0;
164
+ }
165
+
166
+ y = this.mt[this.mti++];
167
+
168
+ /* Tempering */
169
+ y ^= (y >>> 11);
170
+ y ^= (y << 7) & 0x9d2c5680;
171
+ y ^= (y << 15) & 0xefc60000;
172
+ y ^= (y >>> 18);
173
+
174
+ return y >>> 0;
175
+ };
176
+
177
+ /* generates a random number on [0,0x7fffffff]-interval */
178
+ /* origin name genrand_int31 */
179
+ MersenneTwister.prototype.random_int31 = function() {
180
+ return (this.random_int()>>>1);
181
+ };
182
+
183
+ /* generates a random number on [0,1]-real-interval */
184
+ /* origin name genrand_real1 */
185
+ MersenneTwister.prototype.random_incl = function() {
186
+ return this.random_int()*(1.0/4294967295.0);
187
+ /* divided by 2^32-1 */
188
+ };
189
+
190
+ /* generates a random number on [0,1)-real-interval */
191
+ MersenneTwister.prototype.random = function() {
192
+ return this.random_int()*(1.0/4294967296.0);
193
+ /* divided by 2^32 */
194
+ };
195
+
196
+ /* generates a random number on (0,1)-real-interval */
197
+ /* origin name genrand_real3 */
198
+ MersenneTwister.prototype.random_excl = function() {
199
+ return (this.random_int() + 0.5)*(1.0/4294967296.0);
200
+ /* divided by 2^32 */
201
+ };
202
+
203
+ /* generates a random number on [0,1) with 53-bit resolution*/
204
+ /* origin name genrand_res53 */
205
+ MersenneTwister.prototype.random_long = function() {
206
+ var a=this.random_int()>>>5, b=this.random_int()>>>6;
207
+ return (a*67108864.0+b)*(1.0/9007199254740992.0);
208
+ };
209
+
210
+ /* These real versions are due to Isaku Wada, 2002/01/09 added */
211
+
212
+ var mersenneTwister = MersenneTwister;
213
+
214
+ /**
215
+ * Math functions.
216
+ *
217
+ * @exports CesiumMath
218
+ * @alias Math
219
+ */
220
+ const CesiumMath = {};
221
+
222
+ /**
223
+ * 0.1
224
+ * @type {Number}
225
+ * @constant
226
+ */
227
+ CesiumMath.EPSILON1 = 0.1;
228
+
229
+ /**
230
+ * 0.01
231
+ * @type {Number}
232
+ * @constant
233
+ */
234
+ CesiumMath.EPSILON2 = 0.01;
235
+
236
+ /**
237
+ * 0.001
238
+ * @type {Number}
239
+ * @constant
240
+ */
241
+ CesiumMath.EPSILON3 = 0.001;
242
+
243
+ /**
244
+ * 0.0001
245
+ * @type {Number}
246
+ * @constant
247
+ */
248
+ CesiumMath.EPSILON4 = 0.0001;
249
+
250
+ /**
251
+ * 0.00001
252
+ * @type {Number}
253
+ * @constant
254
+ */
255
+ CesiumMath.EPSILON5 = 0.00001;
256
+
257
+ /**
258
+ * 0.000001
259
+ * @type {Number}
260
+ * @constant
261
+ */
262
+ CesiumMath.EPSILON6 = 0.000001;
263
+
264
+ /**
265
+ * 0.0000001
266
+ * @type {Number}
267
+ * @constant
268
+ */
269
+ CesiumMath.EPSILON7 = 0.0000001;
270
+
271
+ /**
272
+ * 0.00000001
273
+ * @type {Number}
274
+ * @constant
275
+ */
276
+ CesiumMath.EPSILON8 = 0.00000001;
277
+
278
+ /**
279
+ * 0.000000001
280
+ * @type {Number}
281
+ * @constant
282
+ */
283
+ CesiumMath.EPSILON9 = 0.000000001;
284
+
285
+ /**
286
+ * 0.0000000001
287
+ * @type {Number}
288
+ * @constant
289
+ */
290
+ CesiumMath.EPSILON10 = 0.0000000001;
291
+
292
+ /**
293
+ * 0.00000000001
294
+ * @type {Number}
295
+ * @constant
296
+ */
297
+ CesiumMath.EPSILON11 = 0.00000000001;
298
+
299
+ /**
300
+ * 0.000000000001
301
+ * @type {Number}
302
+ * @constant
303
+ */
304
+ CesiumMath.EPSILON12 = 0.000000000001;
305
+
306
+ /**
307
+ * 0.0000000000001
308
+ * @type {Number}
309
+ * @constant
310
+ */
311
+ CesiumMath.EPSILON13 = 0.0000000000001;
312
+
313
+ /**
314
+ * 0.00000000000001
315
+ * @type {Number}
316
+ * @constant
317
+ */
318
+ CesiumMath.EPSILON14 = 0.00000000000001;
319
+
320
+ /**
321
+ * 0.000000000000001
322
+ * @type {Number}
323
+ * @constant
324
+ */
325
+ CesiumMath.EPSILON15 = 0.000000000000001;
326
+
327
+ /**
328
+ * 0.0000000000000001
329
+ * @type {Number}
330
+ * @constant
331
+ */
332
+ CesiumMath.EPSILON16 = 0.0000000000000001;
333
+
334
+ /**
335
+ * 0.00000000000000001
336
+ * @type {Number}
337
+ * @constant
338
+ */
339
+ CesiumMath.EPSILON17 = 0.00000000000000001;
340
+
341
+ /**
342
+ * 0.000000000000000001
343
+ * @type {Number}
344
+ * @constant
345
+ */
346
+ CesiumMath.EPSILON18 = 0.000000000000000001;
347
+
348
+ /**
349
+ * 0.0000000000000000001
350
+ * @type {Number}
351
+ * @constant
352
+ */
353
+ CesiumMath.EPSILON19 = 0.0000000000000000001;
354
+
355
+ /**
356
+ * 0.00000000000000000001
357
+ * @type {Number}
358
+ * @constant
359
+ */
360
+ CesiumMath.EPSILON20 = 0.00000000000000000001;
361
+
362
+ /**
363
+ * 0.000000000000000000001
364
+ * @type {Number}
365
+ * @constant
366
+ */
367
+ CesiumMath.EPSILON21 = 0.000000000000000000001;
368
+
369
+ /**
370
+ * The gravitational parameter of the Earth in meters cubed
371
+ * per second squared as defined by the WGS84 model: 3.986004418e14
372
+ * @type {Number}
373
+ * @constant
374
+ */
375
+ CesiumMath.GRAVITATIONALPARAMETER = 3.986004418e14;
376
+
377
+ /**
378
+ * Radius of the sun in meters: 6.955e8
379
+ * @type {Number}
380
+ * @constant
381
+ */
382
+ CesiumMath.SOLAR_RADIUS = 6.955e8;
383
+
384
+ /**
385
+ * The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on
386
+ * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000",
387
+ * Celestial Mechanics 82: 83-110, 2002.
388
+ * @type {Number}
389
+ * @constant
390
+ */
391
+ CesiumMath.LUNAR_RADIUS = 1737400.0;
392
+
393
+ /**
394
+ * 64 * 1024
395
+ * @type {Number}
396
+ * @constant
397
+ */
398
+ CesiumMath.SIXTY_FOUR_KILOBYTES = 64 * 1024;
399
+
400
+ /**
401
+ * 4 * 1024 * 1024 * 1024
402
+ * @type {Number}
403
+ * @constant
404
+ */
405
+ CesiumMath.FOUR_GIGABYTES = 4 * 1024 * 1024 * 1024;
406
+
407
+ /**
408
+ * Returns the sign of the value; 1 if the value is positive, -1 if the value is
409
+ * negative, or 0 if the value is 0.
410
+ *
411
+ * @function
412
+ * @param {Number} value The value to return the sign of.
413
+ * @returns {Number} The sign of value.
414
+ */
415
+ // eslint-disable-next-line es/no-math-sign
416
+ CesiumMath.sign = defaultValue.defaultValue(Math.sign, function sign(value) {
417
+ value = +value; // coerce to number
418
+ if (value === 0 || value !== value) {
419
+ // zero or NaN
420
+ return value;
421
+ }
422
+ return value > 0 ? 1 : -1;
423
+ });
424
+
425
+ /**
426
+ * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.
427
+ * This is similar to {@link CesiumMath#sign} except that returns 1.0 instead of
428
+ * 0.0 when the input value is 0.0.
429
+ * @param {Number} value The value to return the sign of.
430
+ * @returns {Number} The sign of value.
431
+ */
432
+ CesiumMath.signNotZero = function (value) {
433
+ return value < 0.0 ? -1.0 : 1.0;
434
+ };
435
+
436
+ /**
437
+ * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]
438
+ * @param {Number} value The scalar value in the range [-1.0, 1.0]
439
+ * @param {Number} [rangeMaximum=255] The maximum value in the mapped range, 255 by default.
440
+ * @returns {Number} A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.
441
+ *
442
+ * @see CesiumMath.fromSNorm
443
+ */
444
+ CesiumMath.toSNorm = function (value, rangeMaximum) {
445
+ rangeMaximum = defaultValue.defaultValue(rangeMaximum, 255);
446
+ return Math.round(
447
+ (CesiumMath.clamp(value, -1.0, 1.0) * 0.5 + 0.5) * rangeMaximum
448
+ );
449
+ };
450
+
451
+ /**
452
+ * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].
453
+ * @param {Number} value SNORM value in the range [0, rangeMaximum]
454
+ * @param {Number} [rangeMaximum=255] The maximum value in the SNORM range, 255 by default.
455
+ * @returns {Number} Scalar in the range [-1.0, 1.0].
456
+ *
457
+ * @see CesiumMath.toSNorm
458
+ */
459
+ CesiumMath.fromSNorm = function (value, rangeMaximum) {
460
+ rangeMaximum = defaultValue.defaultValue(rangeMaximum, 255);
461
+ return (
462
+ (CesiumMath.clamp(value, 0.0, rangeMaximum) / rangeMaximum) * 2.0 - 1.0
463
+ );
464
+ };
465
+
466
+ /**
467
+ * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]
468
+ * @param {Number} value The scalar value in the range [rangeMinimum, rangeMaximum]
469
+ * @param {Number} rangeMinimum The minimum value in the mapped range.
470
+ * @param {Number} rangeMaximum The maximum value in the mapped range.
471
+ * @returns {Number} A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.
472
+ */
473
+ CesiumMath.normalize = function (value, rangeMinimum, rangeMaximum) {
474
+ rangeMaximum = Math.max(rangeMaximum - rangeMinimum, 0.0);
475
+ return rangeMaximum === 0.0
476
+ ? 0.0
477
+ : CesiumMath.clamp((value - rangeMinimum) / rangeMaximum, 0.0, 1.0);
478
+ };
479
+
480
+ /**
481
+ * Returns the hyperbolic sine of a number.
482
+ * The hyperbolic sine of <em>value</em> is defined to be
483
+ * (<em>e<sup>x</sup>&nbsp;-&nbsp;e<sup>-x</sup></em>)/2.0
484
+ * where <i>e</i> is Euler's number, approximately 2.71828183.
485
+ *
486
+ * <p>Special cases:
487
+ * <ul>
488
+ * <li>If the argument is NaN, then the result is NaN.</li>
489
+ *
490
+ * <li>If the argument is infinite, then the result is an infinity
491
+ * with the same sign as the argument.</li>
492
+ *
493
+ * <li>If the argument is zero, then the result is a zero with the
494
+ * same sign as the argument.</li>
495
+ * </ul>
496
+ *</p>
497
+ *
498
+ * @function
499
+ * @param {Number} value The number whose hyperbolic sine is to be returned.
500
+ * @returns {Number} The hyperbolic sine of <code>value</code>.
501
+ */
502
+ // eslint-disable-next-line es/no-math-sinh
503
+ CesiumMath.sinh = defaultValue.defaultValue(Math.sinh, function sinh(value) {
504
+ return (Math.exp(value) - Math.exp(-value)) / 2.0;
505
+ });
506
+
507
+ /**
508
+ * Returns the hyperbolic cosine of a number.
509
+ * The hyperbolic cosine of <strong>value</strong> is defined to be
510
+ * (<em>e<sup>x</sup>&nbsp;+&nbsp;e<sup>-x</sup></em>)/2.0
511
+ * where <i>e</i> is Euler's number, approximately 2.71828183.
512
+ *
513
+ * <p>Special cases:
514
+ * <ul>
515
+ * <li>If the argument is NaN, then the result is NaN.</li>
516
+ *
517
+ * <li>If the argument is infinite, then the result is positive infinity.</li>
518
+ *
519
+ * <li>If the argument is zero, then the result is 1.0.</li>
520
+ * </ul>
521
+ *</p>
522
+ *
523
+ * @function
524
+ * @param {Number} value The number whose hyperbolic cosine is to be returned.
525
+ * @returns {Number} The hyperbolic cosine of <code>value</code>.
526
+ */
527
+ // eslint-disable-next-line es/no-math-cosh
528
+ CesiumMath.cosh = defaultValue.defaultValue(Math.cosh, function cosh(value) {
529
+ return (Math.exp(value) + Math.exp(-value)) / 2.0;
530
+ });
531
+
532
+ /**
533
+ * Computes the linear interpolation of two values.
534
+ *
535
+ * @param {Number} p The start value to interpolate.
536
+ * @param {Number} q The end value to interpolate.
537
+ * @param {Number} time The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
538
+ * @returns {Number} The linearly interpolated value.
539
+ *
540
+ * @example
541
+ * const n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0
542
+ */
543
+ CesiumMath.lerp = function (p, q, time) {
544
+ return (1.0 - time) * p + time * q;
545
+ };
546
+
547
+ /**
548
+ * pi
549
+ *
550
+ * @type {Number}
551
+ * @constant
552
+ */
553
+ CesiumMath.PI = Math.PI;
554
+
555
+ /**
556
+ * 1/pi
557
+ *
558
+ * @type {Number}
559
+ * @constant
560
+ */
561
+ CesiumMath.ONE_OVER_PI = 1.0 / Math.PI;
562
+
563
+ /**
564
+ * pi/2
565
+ *
566
+ * @type {Number}
567
+ * @constant
568
+ */
569
+ CesiumMath.PI_OVER_TWO = Math.PI / 2.0;
570
+
571
+ /**
572
+ * pi/3
573
+ *
574
+ * @type {Number}
575
+ * @constant
576
+ */
577
+ CesiumMath.PI_OVER_THREE = Math.PI / 3.0;
578
+
579
+ /**
580
+ * pi/4
581
+ *
582
+ * @type {Number}
583
+ * @constant
584
+ */
585
+ CesiumMath.PI_OVER_FOUR = Math.PI / 4.0;
586
+
587
+ /**
588
+ * pi/6
589
+ *
590
+ * @type {Number}
591
+ * @constant
592
+ */
593
+ CesiumMath.PI_OVER_SIX = Math.PI / 6.0;
594
+
595
+ /**
596
+ * 3pi/2
597
+ *
598
+ * @type {Number}
599
+ * @constant
600
+ */
601
+ CesiumMath.THREE_PI_OVER_TWO = (3.0 * Math.PI) / 2.0;
602
+
603
+ /**
604
+ * 2pi
605
+ *
606
+ * @type {Number}
607
+ * @constant
608
+ */
609
+ CesiumMath.TWO_PI = 2.0 * Math.PI;
610
+
611
+ /**
612
+ * 1/2pi
613
+ *
614
+ * @type {Number}
615
+ * @constant
616
+ */
617
+ CesiumMath.ONE_OVER_TWO_PI = 1.0 / (2.0 * Math.PI);
618
+
619
+ /**
620
+ * The number of radians in a degree.
621
+ *
622
+ * @type {Number}
623
+ * @constant
624
+ */
625
+ CesiumMath.RADIANS_PER_DEGREE = Math.PI / 180.0;
626
+
627
+ /**
628
+ * The number of degrees in a radian.
629
+ *
630
+ * @type {Number}
631
+ * @constant
632
+ */
633
+ CesiumMath.DEGREES_PER_RADIAN = 180.0 / Math.PI;
634
+
635
+ /**
636
+ * The number of radians in an arc second.
637
+ *
638
+ * @type {Number}
639
+ * @constant
640
+ */
641
+ CesiumMath.RADIANS_PER_ARCSECOND = CesiumMath.RADIANS_PER_DEGREE / 3600.0;
642
+
643
+ /**
644
+ * Converts degrees to radians.
645
+ * @param {Number} degrees The angle to convert in degrees.
646
+ * @returns {Number} The corresponding angle in radians.
647
+ */
648
+ CesiumMath.toRadians = function (degrees) {
649
+ //>>includeStart('debug', pragmas.debug);
650
+ if (!defaultValue.defined(degrees)) {
651
+ throw new Check.DeveloperError("degrees is required.");
652
+ }
653
+ //>>includeEnd('debug');
654
+ return degrees * CesiumMath.RADIANS_PER_DEGREE;
655
+ };
656
+
657
+ /**
658
+ * Converts radians to degrees.
659
+ * @param {Number} radians The angle to convert in radians.
660
+ * @returns {Number} The corresponding angle in degrees.
661
+ */
662
+ CesiumMath.toDegrees = function (radians) {
663
+ //>>includeStart('debug', pragmas.debug);
664
+ if (!defaultValue.defined(radians)) {
665
+ throw new Check.DeveloperError("radians is required.");
666
+ }
667
+ //>>includeEnd('debug');
668
+ return radians * CesiumMath.DEGREES_PER_RADIAN;
669
+ };
670
+
671
+ /**
672
+ * Converts a longitude value, in radians, to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
673
+ *
674
+ * @param {Number} angle The longitude value, in radians, to convert to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
675
+ * @returns {Number} The equivalent longitude value in the range [<code>-Math.PI</code>, <code>Math.PI</code>).
676
+ *
677
+ * @example
678
+ * // Convert 270 degrees to -90 degrees longitude
679
+ * const longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));
680
+ */
681
+ CesiumMath.convertLongitudeRange = function (angle) {
682
+ //>>includeStart('debug', pragmas.debug);
683
+ if (!defaultValue.defined(angle)) {
684
+ throw new Check.DeveloperError("angle is required.");
685
+ }
686
+ //>>includeEnd('debug');
687
+ const twoPi = CesiumMath.TWO_PI;
688
+
689
+ const simplified = angle - Math.floor(angle / twoPi) * twoPi;
690
+
691
+ if (simplified < -Math.PI) {
692
+ return simplified + twoPi;
693
+ }
694
+ if (simplified >= Math.PI) {
695
+ return simplified - twoPi;
696
+ }
697
+
698
+ return simplified;
699
+ };
700
+
701
+ /**
702
+ * Convenience function that clamps a latitude value, in radians, to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
703
+ * Useful for sanitizing data before use in objects requiring correct range.
704
+ *
705
+ * @param {Number} angle The latitude value, in radians, to clamp to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
706
+ * @returns {Number} The latitude value clamped to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
707
+ *
708
+ * @example
709
+ * // Clamp 108 degrees latitude to 90 degrees latitude
710
+ * const latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));
711
+ */
712
+ CesiumMath.clampToLatitudeRange = function (angle) {
713
+ //>>includeStart('debug', pragmas.debug);
714
+ if (!defaultValue.defined(angle)) {
715
+ throw new Check.DeveloperError("angle is required.");
716
+ }
717
+ //>>includeEnd('debug');
718
+
719
+ return CesiumMath.clamp(
720
+ angle,
721
+ -1 * CesiumMath.PI_OVER_TWO,
722
+ CesiumMath.PI_OVER_TWO
723
+ );
724
+ };
725
+
726
+ /**
727
+ * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
728
+ *
729
+ * @param {Number} angle in radians
730
+ * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>].
731
+ */
732
+ CesiumMath.negativePiToPi = function (angle) {
733
+ //>>includeStart('debug', pragmas.debug);
734
+ if (!defaultValue.defined(angle)) {
735
+ throw new Check.DeveloperError("angle is required.");
736
+ }
737
+ //>>includeEnd('debug');
738
+ if (angle >= -CesiumMath.PI && angle <= CesiumMath.PI) {
739
+ // Early exit if the input is already inside the range. This avoids
740
+ // unnecessary math which could introduce floating point error.
741
+ return angle;
742
+ }
743
+ return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI;
744
+ };
745
+
746
+ /**
747
+ * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
748
+ *
749
+ * @param {Number} angle in radians
750
+ * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>].
751
+ */
752
+ CesiumMath.zeroToTwoPi = function (angle) {
753
+ //>>includeStart('debug', pragmas.debug);
754
+ if (!defaultValue.defined(angle)) {
755
+ throw new Check.DeveloperError("angle is required.");
756
+ }
757
+ //>>includeEnd('debug');
758
+ if (angle >= 0 && angle <= CesiumMath.TWO_PI) {
759
+ // Early exit if the input is already inside the range. This avoids
760
+ // unnecessary math which could introduce floating point error.
761
+ return angle;
762
+ }
763
+ const mod = CesiumMath.mod(angle, CesiumMath.TWO_PI);
764
+ if (
765
+ Math.abs(mod) < CesiumMath.EPSILON14 &&
766
+ Math.abs(angle) > CesiumMath.EPSILON14
767
+ ) {
768
+ return CesiumMath.TWO_PI;
769
+ }
770
+ return mod;
771
+ };
772
+
773
+ /**
774
+ * The modulo operation that also works for negative dividends.
775
+ *
776
+ * @param {Number} m The dividend.
777
+ * @param {Number} n The divisor.
778
+ * @returns {Number} The remainder.
779
+ */
780
+ CesiumMath.mod = function (m, n) {
781
+ //>>includeStart('debug', pragmas.debug);
782
+ if (!defaultValue.defined(m)) {
783
+ throw new Check.DeveloperError("m is required.");
784
+ }
785
+ if (!defaultValue.defined(n)) {
786
+ throw new Check.DeveloperError("n is required.");
787
+ }
788
+ if (n === 0.0) {
789
+ throw new Check.DeveloperError("divisor cannot be 0.");
790
+ }
791
+ //>>includeEnd('debug');
792
+ if (CesiumMath.sign(m) === CesiumMath.sign(n) && Math.abs(m) < Math.abs(n)) {
793
+ // Early exit if the input does not need to be modded. This avoids
794
+ // unnecessary math which could introduce floating point error.
795
+ return m;
796
+ }
797
+
798
+ return ((m % n) + n) % n;
799
+ };
800
+
801
+ /**
802
+ * Determines if two values are equal using an absolute or relative tolerance test. This is useful
803
+ * to avoid problems due to roundoff error when comparing floating-point values directly. The values are
804
+ * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.
805
+ * Use this test if you are unsure of the magnitudes of left and right.
806
+ *
807
+ * @param {Number} left The first value to compare.
808
+ * @param {Number} right The other value to compare.
809
+ * @param {Number} [relativeEpsilon=0] The maximum inclusive delta between <code>left</code> and <code>right</code> for the relative tolerance test.
810
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The maximum inclusive delta between <code>left</code> and <code>right</code> for the absolute tolerance test.
811
+ * @returns {Boolean} <code>true</code> if the values are equal within the epsilon; otherwise, <code>false</code>.
812
+ *
813
+ * @example
814
+ * const a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true
815
+ * const b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false
816
+ * const c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true
817
+ * const d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false
818
+ */
819
+ CesiumMath.equalsEpsilon = function (
820
+ left,
821
+ right,
822
+ relativeEpsilon,
823
+ absoluteEpsilon
824
+ ) {
825
+ //>>includeStart('debug', pragmas.debug);
826
+ if (!defaultValue.defined(left)) {
827
+ throw new Check.DeveloperError("left is required.");
828
+ }
829
+ if (!defaultValue.defined(right)) {
830
+ throw new Check.DeveloperError("right is required.");
831
+ }
832
+ //>>includeEnd('debug');
833
+
834
+ relativeEpsilon = defaultValue.defaultValue(relativeEpsilon, 0.0);
835
+ absoluteEpsilon = defaultValue.defaultValue(absoluteEpsilon, relativeEpsilon);
836
+ const absDiff = Math.abs(left - right);
837
+ return (
838
+ absDiff <= absoluteEpsilon ||
839
+ absDiff <= relativeEpsilon * Math.max(Math.abs(left), Math.abs(right))
840
+ );
841
+ };
842
+
843
+ /**
844
+ * Determines if the left value is less than the right value. If the two values are within
845
+ * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
846
+ *
847
+ * @param {Number} left The first number to compare.
848
+ * @param {Number} right The second number to compare.
849
+ * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.
850
+ * @returns {Boolean} <code>true</code> if <code>left</code> is less than <code>right</code> by more than
851
+ * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is greater or if the two
852
+ * values are nearly equal.
853
+ */
854
+ CesiumMath.lessThan = function (left, right, absoluteEpsilon) {
855
+ //>>includeStart('debug', pragmas.debug);
856
+ if (!defaultValue.defined(left)) {
857
+ throw new Check.DeveloperError("first is required.");
858
+ }
859
+ if (!defaultValue.defined(right)) {
860
+ throw new Check.DeveloperError("second is required.");
861
+ }
862
+ if (!defaultValue.defined(absoluteEpsilon)) {
863
+ throw new Check.DeveloperError("absoluteEpsilon is required.");
864
+ }
865
+ //>>includeEnd('debug');
866
+ return left - right < -absoluteEpsilon;
867
+ };
868
+
869
+ /**
870
+ * Determines if the left value is less than or equal to the right value. If the two values are within
871
+ * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
872
+ *
873
+ * @param {Number} left The first number to compare.
874
+ * @param {Number} right The second number to compare.
875
+ * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.
876
+ * @returns {Boolean} <code>true</code> if <code>left</code> is less than <code>right</code> or if the
877
+ * the values are nearly equal.
878
+ */
879
+ CesiumMath.lessThanOrEquals = function (left, right, absoluteEpsilon) {
880
+ //>>includeStart('debug', pragmas.debug);
881
+ if (!defaultValue.defined(left)) {
882
+ throw new Check.DeveloperError("first is required.");
883
+ }
884
+ if (!defaultValue.defined(right)) {
885
+ throw new Check.DeveloperError("second is required.");
886
+ }
887
+ if (!defaultValue.defined(absoluteEpsilon)) {
888
+ throw new Check.DeveloperError("absoluteEpsilon is required.");
889
+ }
890
+ //>>includeEnd('debug');
891
+ return left - right < absoluteEpsilon;
892
+ };
893
+
894
+ /**
895
+ * Determines if the left value is greater the right value. If the two values are within
896
+ * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
897
+ *
898
+ * @param {Number} left The first number to compare.
899
+ * @param {Number} right The second number to compare.
900
+ * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.
901
+ * @returns {Boolean} <code>true</code> if <code>left</code> is greater than <code>right</code> by more than
902
+ * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is less or if the two
903
+ * values are nearly equal.
904
+ */
905
+ CesiumMath.greaterThan = function (left, right, absoluteEpsilon) {
906
+ //>>includeStart('debug', pragmas.debug);
907
+ if (!defaultValue.defined(left)) {
908
+ throw new Check.DeveloperError("first is required.");
909
+ }
910
+ if (!defaultValue.defined(right)) {
911
+ throw new Check.DeveloperError("second is required.");
912
+ }
913
+ if (!defaultValue.defined(absoluteEpsilon)) {
914
+ throw new Check.DeveloperError("absoluteEpsilon is required.");
915
+ }
916
+ //>>includeEnd('debug');
917
+ return left - right > absoluteEpsilon;
918
+ };
919
+
920
+ /**
921
+ * Determines if the left value is greater than or equal to the right value. If the two values are within
922
+ * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
923
+ *
924
+ * @param {Number} left The first number to compare.
925
+ * @param {Number} right The second number to compare.
926
+ * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.
927
+ * @returns {Boolean} <code>true</code> if <code>left</code> is greater than <code>right</code> or if the
928
+ * the values are nearly equal.
929
+ */
930
+ CesiumMath.greaterThanOrEquals = function (left, right, absoluteEpsilon) {
931
+ //>>includeStart('debug', pragmas.debug);
932
+ if (!defaultValue.defined(left)) {
933
+ throw new Check.DeveloperError("first is required.");
934
+ }
935
+ if (!defaultValue.defined(right)) {
936
+ throw new Check.DeveloperError("second is required.");
937
+ }
938
+ if (!defaultValue.defined(absoluteEpsilon)) {
939
+ throw new Check.DeveloperError("absoluteEpsilon is required.");
940
+ }
941
+ //>>includeEnd('debug');
942
+ return left - right > -absoluteEpsilon;
943
+ };
944
+
945
+ const factorials = [1];
946
+
947
+ /**
948
+ * Computes the factorial of the provided number.
949
+ *
950
+ * @param {Number} n The number whose factorial is to be computed.
951
+ * @returns {Number} The factorial of the provided number or undefined if the number is less than 0.
952
+ *
953
+ * @exception {DeveloperError} A number greater than or equal to 0 is required.
954
+ *
955
+ *
956
+ * @example
957
+ * //Compute 7!, which is equal to 5040
958
+ * const computedFactorial = Cesium.Math.factorial(7);
959
+ *
960
+ * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia}
961
+ */
962
+ CesiumMath.factorial = function (n) {
963
+ //>>includeStart('debug', pragmas.debug);
964
+ if (typeof n !== "number" || n < 0) {
965
+ throw new Check.DeveloperError(
966
+ "A number greater than or equal to 0 is required."
967
+ );
968
+ }
969
+ //>>includeEnd('debug');
970
+
971
+ const length = factorials.length;
972
+ if (n >= length) {
973
+ let sum = factorials[length - 1];
974
+ for (let i = length; i <= n; i++) {
975
+ const next = sum * i;
976
+ factorials.push(next);
977
+ sum = next;
978
+ }
979
+ }
980
+ return factorials[n];
981
+ };
982
+
983
+ /**
984
+ * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.
985
+ *
986
+ * @param {Number} [n] The number to be incremented.
987
+ * @param {Number} [maximumValue] The maximum incremented value before rolling over to the minimum value.
988
+ * @param {Number} [minimumValue=0.0] The number reset to after the maximum value has been exceeded.
989
+ * @returns {Number} The incremented number.
990
+ *
991
+ * @exception {DeveloperError} Maximum value must be greater than minimum value.
992
+ *
993
+ * @example
994
+ * const n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6
995
+ * const m = Cesium.Math.incrementWrap(10, 10, 0); // returns 0
996
+ */
997
+ CesiumMath.incrementWrap = function (n, maximumValue, minimumValue) {
998
+ minimumValue = defaultValue.defaultValue(minimumValue, 0.0);
999
+
1000
+ //>>includeStart('debug', pragmas.debug);
1001
+ if (!defaultValue.defined(n)) {
1002
+ throw new Check.DeveloperError("n is required.");
1003
+ }
1004
+ if (maximumValue <= minimumValue) {
1005
+ throw new Check.DeveloperError("maximumValue must be greater than minimumValue.");
1006
+ }
1007
+ //>>includeEnd('debug');
1008
+
1009
+ ++n;
1010
+ if (n > maximumValue) {
1011
+ n = minimumValue;
1012
+ }
1013
+ return n;
1014
+ };
1015
+
1016
+ /**
1017
+ * Determines if a non-negative integer is a power of two.
1018
+ * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
1019
+ *
1020
+ * @param {Number} n The integer to test in the range [0, (2^32)-1].
1021
+ * @returns {Boolean} <code>true</code> if the number if a power of two; otherwise, <code>false</code>.
1022
+ *
1023
+ * @exception {DeveloperError} A number between 0 and (2^32)-1 is required.
1024
+ *
1025
+ * @example
1026
+ * const t = Cesium.Math.isPowerOfTwo(16); // true
1027
+ * const f = Cesium.Math.isPowerOfTwo(20); // false
1028
+ */
1029
+ CesiumMath.isPowerOfTwo = function (n) {
1030
+ //>>includeStart('debug', pragmas.debug);
1031
+ if (typeof n !== "number" || n < 0 || n > 4294967295) {
1032
+ throw new Check.DeveloperError("A number between 0 and (2^32)-1 is required.");
1033
+ }
1034
+ //>>includeEnd('debug');
1035
+
1036
+ return n !== 0 && (n & (n - 1)) === 0;
1037
+ };
1038
+
1039
+ /**
1040
+ * Computes the next power-of-two integer greater than or equal to the provided non-negative integer.
1041
+ * The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript.
1042
+ *
1043
+ * @param {Number} n The integer to test in the range [0, 2^31].
1044
+ * @returns {Number} The next power-of-two integer.
1045
+ *
1046
+ * @exception {DeveloperError} A number between 0 and 2^31 is required.
1047
+ *
1048
+ * @example
1049
+ * const n = Cesium.Math.nextPowerOfTwo(29); // 32
1050
+ * const m = Cesium.Math.nextPowerOfTwo(32); // 32
1051
+ */
1052
+ CesiumMath.nextPowerOfTwo = function (n) {
1053
+ //>>includeStart('debug', pragmas.debug);
1054
+ if (typeof n !== "number" || n < 0 || n > 2147483648) {
1055
+ throw new Check.DeveloperError("A number between 0 and 2^31 is required.");
1056
+ }
1057
+ //>>includeEnd('debug');
1058
+
1059
+ // From http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
1060
+ --n;
1061
+ n |= n >> 1;
1062
+ n |= n >> 2;
1063
+ n |= n >> 4;
1064
+ n |= n >> 8;
1065
+ n |= n >> 16;
1066
+ ++n;
1067
+
1068
+ return n;
1069
+ };
1070
+
1071
+ /**
1072
+ * Computes the previous power-of-two integer less than or equal to the provided non-negative integer.
1073
+ * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
1074
+ *
1075
+ * @param {Number} n The integer to test in the range [0, (2^32)-1].
1076
+ * @returns {Number} The previous power-of-two integer.
1077
+ *
1078
+ * @exception {DeveloperError} A number between 0 and (2^32)-1 is required.
1079
+ *
1080
+ * @example
1081
+ * const n = Cesium.Math.previousPowerOfTwo(29); // 16
1082
+ * const m = Cesium.Math.previousPowerOfTwo(32); // 32
1083
+ */
1084
+ CesiumMath.previousPowerOfTwo = function (n) {
1085
+ //>>includeStart('debug', pragmas.debug);
1086
+ if (typeof n !== "number" || n < 0 || n > 4294967295) {
1087
+ throw new Check.DeveloperError("A number between 0 and (2^32)-1 is required.");
1088
+ }
1089
+ //>>includeEnd('debug');
1090
+
1091
+ n |= n >> 1;
1092
+ n |= n >> 2;
1093
+ n |= n >> 4;
1094
+ n |= n >> 8;
1095
+ n |= n >> 16;
1096
+ n |= n >> 32;
1097
+
1098
+ // The previous bitwise operations implicitly convert to signed 32-bit. Use `>>>` to convert to unsigned
1099
+ n = (n >>> 0) - (n >>> 1);
1100
+
1101
+ return n;
1102
+ };
1103
+
1104
+ /**
1105
+ * Constraint a value to lie between two values.
1106
+ *
1107
+ * @param {Number} value The value to clamp.
1108
+ * @param {Number} min The minimum value.
1109
+ * @param {Number} max The maximum value.
1110
+ * @returns {Number} The clamped value such that min <= result <= max.
1111
+ */
1112
+ CesiumMath.clamp = function (value, min, max) {
1113
+ //>>includeStart('debug', pragmas.debug);
1114
+ Check.Check.typeOf.number("value", value);
1115
+ Check.Check.typeOf.number("min", min);
1116
+ Check.Check.typeOf.number("max", max);
1117
+ //>>includeEnd('debug');
1118
+
1119
+ return value < min ? min : value > max ? max : value;
1120
+ };
1121
+
1122
+ let randomNumberGenerator = new mersenneTwister();
1123
+
1124
+ /**
1125
+ * Sets the seed used by the random number generator
1126
+ * in {@link CesiumMath#nextRandomNumber}.
1127
+ *
1128
+ * @param {Number} seed An integer used as the seed.
1129
+ */
1130
+ CesiumMath.setRandomNumberSeed = function (seed) {
1131
+ //>>includeStart('debug', pragmas.debug);
1132
+ if (!defaultValue.defined(seed)) {
1133
+ throw new Check.DeveloperError("seed is required.");
1134
+ }
1135
+ //>>includeEnd('debug');
1136
+
1137
+ randomNumberGenerator = new mersenneTwister(seed);
1138
+ };
1139
+
1140
+ /**
1141
+ * Generates a random floating point number in the range of [0.0, 1.0)
1142
+ * using a Mersenne twister.
1143
+ *
1144
+ * @returns {Number} A random number in the range of [0.0, 1.0).
1145
+ *
1146
+ * @see CesiumMath.setRandomNumberSeed
1147
+ * @see {@link http://en.wikipedia.org/wiki/Mersenne_twister|Mersenne twister on Wikipedia}
1148
+ */
1149
+ CesiumMath.nextRandomNumber = function () {
1150
+ return randomNumberGenerator.random();
1151
+ };
1152
+
1153
+ /**
1154
+ * Generates a random number between two numbers.
1155
+ *
1156
+ * @param {Number} min The minimum value.
1157
+ * @param {Number} max The maximum value.
1158
+ * @returns {Number} A random number between the min and max.
1159
+ */
1160
+ CesiumMath.randomBetween = function (min, max) {
1161
+ return CesiumMath.nextRandomNumber() * (max - min) + min;
1162
+ };
1163
+
1164
+ /**
1165
+ * Computes <code>Math.acos(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
1166
+ * so that the function will never return NaN.
1167
+ *
1168
+ * @param {Number} value The value for which to compute acos.
1169
+ * @returns {Number} The acos of the value if the value is in the range [-1.0, 1.0], or the acos of -1.0 or 1.0,
1170
+ * whichever is closer, if the value is outside the range.
1171
+ */
1172
+ CesiumMath.acosClamped = function (value) {
1173
+ //>>includeStart('debug', pragmas.debug);
1174
+ if (!defaultValue.defined(value)) {
1175
+ throw new Check.DeveloperError("value is required.");
1176
+ }
1177
+ //>>includeEnd('debug');
1178
+ return Math.acos(CesiumMath.clamp(value, -1.0, 1.0));
1179
+ };
1180
+
1181
+ /**
1182
+ * Computes <code>Math.asin(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
1183
+ * so that the function will never return NaN.
1184
+ *
1185
+ * @param {Number} value The value for which to compute asin.
1186
+ * @returns {Number} The asin of the value if the value is in the range [-1.0, 1.0], or the asin of -1.0 or 1.0,
1187
+ * whichever is closer, if the value is outside the range.
1188
+ */
1189
+ CesiumMath.asinClamped = function (value) {
1190
+ //>>includeStart('debug', pragmas.debug);
1191
+ if (!defaultValue.defined(value)) {
1192
+ throw new Check.DeveloperError("value is required.");
1193
+ }
1194
+ //>>includeEnd('debug');
1195
+ return Math.asin(CesiumMath.clamp(value, -1.0, 1.0));
1196
+ };
1197
+
1198
+ /**
1199
+ * Finds the chord length between two points given the circle's radius and the angle between the points.
1200
+ *
1201
+ * @param {Number} angle The angle between the two points.
1202
+ * @param {Number} radius The radius of the circle.
1203
+ * @returns {Number} The chord length.
1204
+ */
1205
+ CesiumMath.chordLength = function (angle, radius) {
1206
+ //>>includeStart('debug', pragmas.debug);
1207
+ if (!defaultValue.defined(angle)) {
1208
+ throw new Check.DeveloperError("angle is required.");
1209
+ }
1210
+ if (!defaultValue.defined(radius)) {
1211
+ throw new Check.DeveloperError("radius is required.");
1212
+ }
1213
+ //>>includeEnd('debug');
1214
+ return 2.0 * radius * Math.sin(angle * 0.5);
1215
+ };
1216
+
1217
+ /**
1218
+ * Finds the logarithm of a number to a base.
1219
+ *
1220
+ * @param {Number} number The number.
1221
+ * @param {Number} base The base.
1222
+ * @returns {Number} The result.
1223
+ */
1224
+ CesiumMath.logBase = function (number, base) {
1225
+ //>>includeStart('debug', pragmas.debug);
1226
+ if (!defaultValue.defined(number)) {
1227
+ throw new Check.DeveloperError("number is required.");
1228
+ }
1229
+ if (!defaultValue.defined(base)) {
1230
+ throw new Check.DeveloperError("base is required.");
1231
+ }
1232
+ //>>includeEnd('debug');
1233
+ return Math.log(number) / Math.log(base);
1234
+ };
1235
+
1236
+ /**
1237
+ * Finds the cube root of a number.
1238
+ * Returns NaN if <code>number</code> is not provided.
1239
+ *
1240
+ * @function
1241
+ * @param {Number} [number] The number.
1242
+ * @returns {Number} The result.
1243
+ */
1244
+ // eslint-disable-next-line es/no-math-cbrt
1245
+ CesiumMath.cbrt = defaultValue.defaultValue(Math.cbrt, function cbrt(number) {
1246
+ const result = Math.pow(Math.abs(number), 1.0 / 3.0);
1247
+ return number < 0.0 ? -result : result;
1248
+ });
1249
+
1250
+ /**
1251
+ * Finds the base 2 logarithm of a number.
1252
+ *
1253
+ * @function
1254
+ * @param {Number} number The number.
1255
+ * @returns {Number} The result.
1256
+ */
1257
+ // eslint-disable-next-line es/no-math-log2
1258
+ CesiumMath.log2 = defaultValue.defaultValue(Math.log2, function log2(number) {
1259
+ return Math.log(number) * Math.LOG2E;
1260
+ });
1261
+
1262
+ /**
1263
+ * @private
1264
+ */
1265
+ CesiumMath.fog = function (distanceToCamera, density) {
1266
+ const scalar = distanceToCamera * density;
1267
+ return 1.0 - Math.exp(-(scalar * scalar));
1268
+ };
1269
+
1270
+ /**
1271
+ * Computes a fast approximation of Atan for input in the range [-1, 1].
1272
+ *
1273
+ * Based on Michal Drobot's approximation from ShaderFastLibs,
1274
+ * which in turn is based on "Efficient approximations for the arctangent function,"
1275
+ * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
1276
+ * Adapted from ShaderFastLibs under MIT License.
1277
+ *
1278
+ * @param {Number} x An input number in the range [-1, 1]
1279
+ * @returns {Number} An approximation of atan(x)
1280
+ */
1281
+ CesiumMath.fastApproximateAtan = function (x) {
1282
+ //>>includeStart('debug', pragmas.debug);
1283
+ Check.Check.typeOf.number("x", x);
1284
+ //>>includeEnd('debug');
1285
+
1286
+ return x * (-0.1784 * Math.abs(x) - 0.0663 * x * x + 1.0301);
1287
+ };
1288
+
1289
+ /**
1290
+ * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.
1291
+ *
1292
+ * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html
1293
+ *
1294
+ * @param {Number} x An input number that isn't zero if y is zero.
1295
+ * @param {Number} y An input number that isn't zero if x is zero.
1296
+ * @returns {Number} An approximation of atan2(x, y)
1297
+ */
1298
+ CesiumMath.fastApproximateAtan2 = function (x, y) {
1299
+ //>>includeStart('debug', pragmas.debug);
1300
+ Check.Check.typeOf.number("x", x);
1301
+ Check.Check.typeOf.number("y", y);
1302
+ //>>includeEnd('debug');
1303
+
1304
+ // atan approximations are usually only reliable over [-1, 1]
1305
+ // So reduce the range by flipping whether x or y is on top based on which is bigger.
1306
+ let opposite;
1307
+ let t = Math.abs(x); // t used as swap and atan result.
1308
+ opposite = Math.abs(y);
1309
+ const adjacent = Math.max(t, opposite);
1310
+ opposite = Math.min(t, opposite);
1311
+
1312
+ const oppositeOverAdjacent = opposite / adjacent;
1313
+ //>>includeStart('debug', pragmas.debug);
1314
+ if (isNaN(oppositeOverAdjacent)) {
1315
+ throw new Check.DeveloperError("either x or y must be nonzero");
1316
+ }
1317
+ //>>includeEnd('debug');
1318
+ t = CesiumMath.fastApproximateAtan(oppositeOverAdjacent);
1319
+
1320
+ // Undo range reduction
1321
+ t = Math.abs(y) > Math.abs(x) ? CesiumMath.PI_OVER_TWO - t : t;
1322
+ t = x < 0.0 ? CesiumMath.PI - t : t;
1323
+ t = y < 0.0 ? -t : t;
1324
+ return t;
1325
+ };
1326
+ var CesiumMath$1 = CesiumMath;
1327
+
1328
+ exports.CesiumMath = CesiumMath$1;
1329
+
1330
+ }));