@vcmap/ui 5.0.0-rc.8 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (663) hide show
  1. package/README.md +95 -64
  2. package/app.config.json +3 -0
  3. package/build/.eslintrc +3 -0
  4. package/build/build.js +302 -165
  5. package/build/buildCesium.js +39 -19
  6. package/build/buildHelpers.js +279 -88
  7. package/build/buildPreview.js +16 -6
  8. package/build/bundle.js +57 -0
  9. package/build/commonViteConfig.js +7 -16
  10. package/build/determineHost.js +17 -4
  11. package/build/generateOLLib.js +15 -18
  12. package/build/getPluginProxies.js +35 -3
  13. package/build/info/conf.json +21 -19
  14. package/build/info/publish.js +16 -5
  15. package/config/aerowest.config.json +47 -54
  16. package/config/base.config.json +597 -662
  17. package/config/codes.config.json +401 -0
  18. package/config/dev.config.json +460 -14
  19. package/config/graphFeatureInfo.config.json +141 -0
  20. package/config/projects.config.json +29 -0
  21. package/config/www.config.json +1801 -0
  22. package/dist/assets/@mdi/font/LICENSE +20 -0
  23. package/dist/assets/@mdi/font/css/materialdesignicons.css.map +16 -0
  24. package/dist/assets/@mdi/font/css/materialdesignicons.min.e3f476.css +3 -0
  25. package/dist/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
  26. package/dist/assets/cesium/ThirdParty/Workers/basis_transcoder.js +21 -0
  27. package/dist/assets/cesium/ThirdParty/Workers/package.json +1 -0
  28. package/dist/assets/cesium/ThirdParty/Workers/pako_deflate.min.js +2 -0
  29. package/dist/assets/cesium/ThirdParty/Workers/pako_inflate.min.js +2 -0
  30. package/dist/assets/cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
  31. package/dist/assets/cesium/ThirdParty/basis_transcoder.wasm +0 -0
  32. package/dist/assets/cesium/ThirdParty/draco_decoder.wasm +0 -0
  33. package/dist/assets/cesium/ThirdParty/google-earth-dbroot-parser.js +8337 -0
  34. package/dist/assets/cesium/Workers/chunk-227AJNOA.js +59 -0
  35. package/dist/assets/cesium/Workers/chunk-2R5O53JW.js +157 -0
  36. package/dist/assets/cesium/Workers/chunk-34YUDLRP.js +781 -0
  37. package/dist/assets/cesium/Workers/chunk-3W63OHNJ.js +100 -0
  38. package/dist/assets/cesium/Workers/chunk-4MFFIWUA.js +163 -0
  39. package/dist/assets/cesium/Workers/chunk-66QLLS45.js +218 -0
  40. package/dist/assets/cesium/Workers/chunk-6BTKZDRG.js +77 -0
  41. package/dist/assets/cesium/Workers/chunk-A4JVFBQ3.js +101 -0
  42. package/dist/assets/cesium/Workers/chunk-ABADGKYE.js +58 -0
  43. package/dist/assets/cesium/Workers/chunk-AFFLIKOH.js +353 -0
  44. package/dist/assets/cesium/Workers/chunk-AHKEZ2OE.js +629 -0
  45. package/dist/assets/cesium/Workers/chunk-C3SXRKRW.js +476 -0
  46. package/dist/assets/cesium/Workers/chunk-CCFQRR6D.js +55 -0
  47. package/dist/assets/cesium/Workers/chunk-CHHNOC2C.js +1860 -0
  48. package/dist/assets/cesium/Workers/chunk-CTELOFLA.js +196 -0
  49. package/dist/assets/cesium/Workers/chunk-DUHWWBQQ.js +3273 -0
  50. package/dist/assets/cesium/Workers/chunk-EW2GWJYB.js +44 -0
  51. package/dist/assets/cesium/Workers/chunk-GLZBE3ML.js +421 -0
  52. package/dist/assets/cesium/Workers/chunk-HARLBUOL.js +236 -0
  53. package/dist/assets/cesium/Workers/chunk-HQF437NJ.js +117 -0
  54. package/dist/assets/cesium/Workers/chunk-IPA4EACJ.js +368 -0
  55. package/dist/assets/cesium/Workers/chunk-J3JY6I2C.js +1009 -0
  56. package/dist/assets/cesium/Workers/chunk-JB2LWGH4.js +390 -0
  57. package/dist/assets/cesium/Workers/chunk-JS3AW5BK.js +634 -0
  58. package/dist/assets/cesium/Workers/chunk-K36FEYS7.js +452 -0
  59. package/dist/assets/cesium/Workers/chunk-KD4Y7CZL.js +400 -0
  60. package/dist/assets/cesium/Workers/chunk-KTJSNCK4.js +842 -0
  61. package/dist/assets/cesium/Workers/chunk-LLUNNUJV.js +258 -0
  62. package/dist/assets/cesium/Workers/chunk-MPAZH4BF.js +37 -0
  63. package/dist/assets/cesium/Workers/chunk-MYZB7C4T.js +1258 -0
  64. package/dist/assets/cesium/Workers/chunk-N3JIFFX2.js +501 -0
  65. package/dist/assets/cesium/Workers/chunk-O5AMBQ36.js +430 -0
  66. package/dist/assets/cesium/Workers/chunk-OAVNIRB4.js +124 -0
  67. package/dist/assets/cesium/Workers/chunk-OYFCF4PL.js +171 -0
  68. package/dist/assets/cesium/Workers/chunk-OZJDGN5F.js +1477 -0
  69. package/dist/assets/cesium/Workers/chunk-PCJWUS4M.js +2041 -0
  70. package/dist/assets/cesium/Workers/chunk-PFQBCKBM.js +8644 -0
  71. package/dist/assets/cesium/Workers/chunk-QIKODV5G.js +305 -0
  72. package/dist/assets/cesium/Workers/chunk-QJ3DFBH3.js +73 -0
  73. package/dist/assets/cesium/Workers/chunk-QMEMZIJI.js +138 -0
  74. package/dist/assets/cesium/Workers/chunk-QT3MPEMI.js +102 -0
  75. package/dist/assets/cesium/Workers/chunk-RP2A7BR5.js +289 -0
  76. package/dist/assets/cesium/Workers/chunk-RW6LU2CJ.js +138 -0
  77. package/dist/assets/cesium/Workers/chunk-TFC6TZ3S.js +757 -0
  78. package/dist/assets/cesium/Workers/chunk-V3NGATMV.js +693 -0
  79. package/dist/assets/cesium/Workers/chunk-VLGOATD6.js +1075 -0
  80. package/dist/assets/cesium/Workers/chunk-WXTV4ATB.js +39 -0
  81. package/dist/assets/cesium/Workers/chunk-X4SU25DT.js +302 -0
  82. package/dist/assets/cesium/Workers/chunk-XTY7B2N6.js +2716 -0
  83. package/dist/assets/cesium/Workers/chunk-XY7MGBKC.js +513 -0
  84. package/dist/assets/cesium/Workers/chunk-Z24VKNDO.js +834 -0
  85. package/dist/assets/cesium/Workers/chunk-ZA25DG4Y.js +684 -0
  86. package/dist/assets/cesium/Workers/chunk-ZFOBYDGF.js +73 -0
  87. package/dist/assets/cesium/Workers/combineGeometry.js +67 -1
  88. package/dist/assets/cesium/Workers/createBoxGeometry.js +57 -1
  89. package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +234 -1
  90. package/dist/assets/cesium/Workers/createCircleGeometry.js +196 -1
  91. package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +146 -1
  92. package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +506 -1
  93. package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +224 -1
  94. package/dist/assets/cesium/Workers/createCorridorGeometry.js +1262 -1
  95. package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +567 -1
  96. package/dist/assets/cesium/Workers/createCylinderGeometry.js +59 -1
  97. package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +231 -1
  98. package/dist/assets/cesium/Workers/createEllipseGeometry.js +70 -1
  99. package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +63 -1
  100. package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +58 -1
  101. package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +60 -1
  102. package/dist/assets/cesium/Workers/createFrustumGeometry.js +57 -1
  103. package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +234 -1
  104. package/dist/assets/cesium/Workers/createGeometry.js +150 -1
  105. package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1607 -1
  106. package/dist/assets/cesium/Workers/createPlaneGeometry.js +223 -1
  107. package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +123 -1
  108. package/dist/assets/cesium/Workers/createPolygonGeometry.js +1134 -1
  109. package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +542 -1
  110. package/dist/assets/cesium/Workers/createPolylineGeometry.js +495 -1
  111. package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +379 -1
  112. package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +277 -1
  113. package/dist/assets/cesium/Workers/createRectangleGeometry.js +1273 -1
  114. package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +480 -1
  115. package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +399 -1
  116. package/dist/assets/cesium/Workers/createSphereGeometry.js +117 -1
  117. package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +117 -1
  118. package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +32 -1
  119. package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +492 -1
  120. package/dist/assets/cesium/Workers/createVectorTileGeometries.js +386 -1
  121. package/dist/assets/cesium/Workers/createVectorTilePoints.js +112 -1
  122. package/dist/assets/cesium/Workers/createVectorTilePolygons.js +384 -1
  123. package/dist/assets/cesium/Workers/createVectorTilePolylines.js +262 -1
  124. package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +568 -1
  125. package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2277 -3
  126. package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +745 -1
  127. package/dist/assets/cesium/Workers/createWallGeometry.js +489 -1
  128. package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +337 -1
  129. package/dist/assets/cesium/Workers/decodeDraco.js +369 -1
  130. package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +2650 -1
  131. package/dist/assets/cesium/Workers/decodeI3S.js +835 -0
  132. package/dist/assets/cesium/Workers/transcodeKTX2.js +3425 -1
  133. package/dist/assets/cesium/Workers/transferTypedArrayTest.js +41 -1
  134. package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +818 -1
  135. package/dist/assets/cesium.4137c8.js +164897 -0
  136. package/dist/assets/cesium.js +1 -1
  137. package/dist/assets/core.306872.js +19286 -0
  138. package/dist/assets/core.js +1 -1
  139. package/dist/assets/favicon-128.4c4ce5.png +0 -0
  140. package/dist/assets/favicon-180.5b99c0.png +0 -0
  141. package/dist/assets/favicon-192.0e205e.png +0 -0
  142. package/dist/assets/favicon-32.6b9add.png +0 -0
  143. package/dist/assets/favicon.d5ec97.svg +10 -0
  144. package/dist/assets/font/OFL.txt +93 -0
  145. package/dist/assets/font/TitilliumWeb-Regular.9ca076.woff2 +0 -0
  146. package/dist/assets/index-cfed33b1.js +1 -0
  147. package/dist/assets/ol.328bbf.js +60117 -0
  148. package/dist/assets/ol.js +1 -1
  149. package/dist/assets/style/icon-marker-blue.534e37.png +0 -0
  150. package/dist/assets/style/icon-marker-green.0b6a92.png +0 -0
  151. package/dist/assets/style/icon-marker-o-blue.7b6d62.png +0 -0
  152. package/dist/assets/style/icon-marker-o-green.c863c0.png +0 -0
  153. package/dist/assets/style/icon-marker-o-red.93ff58.png +0 -0
  154. package/dist/assets/style/icon-marker-o.036477.png +0 -0
  155. package/dist/assets/style/icon-marker-red.313d03.png +0 -0
  156. package/dist/assets/style/icon-marker.70960f.png +0 -0
  157. package/dist/assets/style/icon-pin-blue.7be369.png +0 -0
  158. package/dist/assets/style/icon-pin-green.cbb935.png +0 -0
  159. package/dist/assets/style/icon-pin-red.3f25b2.png +0 -0
  160. package/dist/assets/style/icon-pin.b7ce77.png +0 -0
  161. package/dist/assets/ui.e84ce9.css +5 -0
  162. package/dist/assets/ui.e84ce9.js +16488 -0
  163. package/dist/assets/ui.js +1 -1
  164. package/dist/assets/vue.1c8696.js +4911 -0
  165. package/dist/assets/vue.js +5 -1
  166. package/dist/assets/vuetify.008fac.css +5 -0
  167. package/dist/assets/vuetify.008fac.js +21262 -0
  168. package/dist/assets/vuetify.js +5 -2
  169. package/dist/index.html +90 -8
  170. package/index.html +111 -0
  171. package/index.js +203 -18
  172. package/lib/cesium.js +1 -1
  173. package/lib/core.js +1 -1
  174. package/lib/olLib.js +861 -843
  175. package/lib/ui.js +1 -1
  176. package/lib/vue.js +2 -1
  177. package/lib/vuetify.js +2 -2
  178. package/package.json +53 -34
  179. package/plugins/.eslintrc +9 -0
  180. package/plugins/@vcmap-show-case/README.md +28 -0
  181. package/plugins/@vcmap-show-case/buttons-example/README.md +4 -0
  182. package/plugins/@vcmap-show-case/buttons-example/package.json +5 -0
  183. package/plugins/@vcmap-show-case/buttons-example/src/ButtonsExample.vue +282 -0
  184. package/plugins/@vcmap-show-case/buttons-example/src/index.js +51 -0
  185. package/plugins/@vcmap-show-case/category-tester/README.md +3 -0
  186. package/plugins/@vcmap-show-case/category-tester/package.json +5 -0
  187. package/plugins/@vcmap-show-case/category-tester/src/CategoriesExample.vue +135 -0
  188. package/plugins/@vcmap-show-case/category-tester/src/CollectionComponentOptions.vue +209 -0
  189. package/plugins/@vcmap-show-case/category-tester/src/index.js +73 -0
  190. package/plugins/@vcmap-show-case/collection-manager-example/README.md +3 -0
  191. package/plugins/@vcmap-show-case/collection-manager-example/package.json +5 -0
  192. package/plugins/@vcmap-show-case/collection-manager-example/src/CollectionManagerExample.vue +182 -0
  193. package/plugins/@vcmap-show-case/collection-manager-example/src/index.js +79 -0
  194. package/plugins/@vcmap-show-case/config-editor/README.md +3 -0
  195. package/plugins/@vcmap-show-case/config-editor/package.json +5 -0
  196. package/plugins/@vcmap-show-case/config-editor/src/ConfigEditor.vue +62 -0
  197. package/plugins/@vcmap-show-case/config-editor/src/index.js +49 -0
  198. package/plugins/@vcmap-show-case/context-menu-tester/README.md +3 -0
  199. package/plugins/@vcmap-show-case/context-menu-tester/package.json +5 -0
  200. package/plugins/@vcmap-show-case/context-menu-tester/src/index.js +41 -0
  201. package/plugins/@vcmap-show-case/form-inputs-example/README.md +4 -0
  202. package/plugins/@vcmap-show-case/form-inputs-example/config.json +5 -0
  203. package/plugins/@vcmap-show-case/form-inputs-example/package.json +5 -0
  204. package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +516 -0
  205. package/plugins/@vcmap-show-case/form-inputs-example/src/exampleActions.js +36 -0
  206. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example/src}/index.js +123 -39
  207. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example/src}/validation.js +14 -2
  208. package/plugins/@vcmap-show-case/hello-world/README.md +31 -0
  209. package/plugins/@vcmap-show-case/hello-world/package.json +6 -0
  210. package/plugins/@vcmap-show-case/hello-world/plugin-assets/vcs_logo.png +0 -0
  211. package/plugins/@vcmap-show-case/hello-world/src/defaultOptions.js +4 -0
  212. package/plugins/@vcmap-show-case/hello-world/src/helloWorld.vue +69 -0
  213. package/plugins/@vcmap-show-case/hello-world/src/index.js +142 -0
  214. package/plugins/@vcmap-show-case/hello-world/tests/helloWorld.spec.js +53 -0
  215. package/plugins/@vcmap-show-case/icons-example/README.md +5 -0
  216. package/plugins/@vcmap-show-case/icons-example/package.json +5 -0
  217. package/plugins/@vcmap-show-case/icons-example/src/AllIconsComponent.vue +51 -0
  218. package/plugins/@vcmap-show-case/icons-example/src/index.js +46 -0
  219. package/plugins/@vcmap-show-case/list-example/README.md +3 -0
  220. package/plugins/@vcmap-show-case/list-example/package.json +5 -0
  221. package/plugins/@vcmap-show-case/list-example/src/ListExample.vue +411 -0
  222. package/plugins/@vcmap-show-case/list-example/src/index.js +46 -0
  223. package/plugins/@vcmap-show-case/notifier-tester/README.md +3 -0
  224. package/plugins/@vcmap-show-case/notifier-tester/package.json +5 -0
  225. package/plugins/@vcmap-show-case/notifier-tester/src/NotifierTester.vue +82 -0
  226. package/plugins/@vcmap-show-case/notifier-tester/src/index.js +42 -0
  227. package/plugins/@vcmap-show-case/plugin-editors/README.md +4 -0
  228. package/plugins/@vcmap-show-case/plugin-editors/package.json +5 -0
  229. package/plugins/@vcmap-show-case/plugin-editors/src/PluginEditors.vue +119 -0
  230. package/plugins/@vcmap-show-case/plugin-editors/src/index.js +41 -0
  231. package/plugins/@vcmap-show-case/project-selector/README.md +25 -0
  232. package/plugins/@vcmap-show-case/project-selector/config.json +15 -0
  233. package/plugins/@vcmap-show-case/project-selector/package.json +13 -0
  234. package/plugins/@vcmap-show-case/project-selector/src/ModulesListComponent.vue +65 -0
  235. package/plugins/@vcmap-show-case/project-selector/src/ProjectSelectorComponent.vue +102 -0
  236. package/plugins/@vcmap-show-case/project-selector/src/de.json +10 -0
  237. package/plugins/@vcmap-show-case/project-selector/src/en.json +10 -0
  238. package/plugins/@vcmap-show-case/project-selector/src/index.js +269 -0
  239. package/plugins/@vcmap-show-case/simple-graph/README.md +71 -0
  240. package/plugins/@vcmap-show-case/simple-graph/package.json +11 -0
  241. package/plugins/@vcmap-show-case/simple-graph/src/SimpleGraphComponent.vue +59 -0
  242. package/plugins/@vcmap-show-case/simple-graph/src/index.js +17 -0
  243. package/plugins/@vcmap-show-case/simple-graph/src/simpleGraphView.js +78 -0
  244. package/plugins/@vcmap-show-case/style-input-example/README.md +4 -0
  245. package/plugins/@vcmap-show-case/style-input-example/package.json +5 -0
  246. package/plugins/@vcmap-show-case/style-input-example/src/StyleExample.vue +190 -0
  247. package/plugins/@vcmap-show-case/style-input-example/src/index.js +42 -0
  248. package/plugins/@vcmap-show-case/switch-map-callback-example/README.md +21 -0
  249. package/plugins/@vcmap-show-case/switch-map-callback-example/config.json +3 -0
  250. package/plugins/@vcmap-show-case/switch-map-callback-example/package.json +5 -0
  251. package/plugins/@vcmap-show-case/switch-map-callback-example/src/index.js +34 -0
  252. package/plugins/@vcmap-show-case/switch-map-callback-example/src/switchMapCallback.js +47 -0
  253. package/plugins/@vcmap-show-case/table-example/README.md +3 -0
  254. package/plugins/@vcmap-show-case/table-example/package.json +5 -0
  255. package/plugins/@vcmap-show-case/table-example/src/DataTableExample.vue +182 -0
  256. package/plugins/@vcmap-show-case/table-example/src/index.js +49 -0
  257. package/plugins/@vcmap-show-case/textfields-example/README.md +3 -0
  258. package/plugins/@vcmap-show-case/textfields-example/package.json +5 -0
  259. package/plugins/{example/mySuperComponent.vue → @vcmap-show-case/textfields-example/src/TextfieldsExample.vue} +13 -31
  260. package/plugins/@vcmap-show-case/textfields-example/src/index.js +64 -0
  261. package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/README.md +5 -3
  262. package/plugins/@vcmap-show-case/theme-changer/config.json +69 -0
  263. package/plugins/@vcmap-show-case/theme-changer/package.json +11 -0
  264. package/plugins/{@vcmap/theme-changer → @vcmap-show-case/theme-changer/src}/ThemeChangerComponent.vue +36 -8
  265. package/plugins/{@vcmap/theme-changer → @vcmap-show-case/theme-changer/src}/index.js +20 -14
  266. package/plugins/@vcmap-show-case/vector-properties-example/package.json +5 -0
  267. package/plugins/@vcmap-show-case/vector-properties-example/src/VectorPropertiesExample.vue +128 -0
  268. package/plugins/@vcmap-show-case/vector-properties-example/src/index.js +40 -0
  269. package/plugins/@vcmap-show-case/window-tester/README.md +3 -0
  270. package/plugins/@vcmap-show-case/window-tester/package.json +5 -0
  271. package/plugins/@vcmap-show-case/window-tester/src/EmptyComponent.vue +18 -0
  272. package/plugins/@vcmap-show-case/window-tester/src/MyCustomHeader.vue +31 -0
  273. package/plugins/@vcmap-show-case/window-tester/src/WindowExample.vue +185 -0
  274. package/plugins/@vcmap-show-case/window-tester/src/WindowExampleContent.vue +18 -0
  275. package/plugins/@vcmap-show-case/window-tester/src/WindowExampleToggleChild.vue +45 -0
  276. package/plugins/@vcmap-show-case/window-tester/src/index.js +80 -0
  277. package/plugins/@vcmap-show-case/window-tester/src/toolboxData.js +288 -0
  278. package/plugins/@vcmap-show-case/wizard-example/README.md +3 -0
  279. package/plugins/@vcmap-show-case/wizard-example/package.json +5 -0
  280. package/plugins/@vcmap-show-case/wizard-example/src/WizardExample.vue +127 -0
  281. package/plugins/@vcmap-show-case/wizard-example/src/index.js +53 -0
  282. package/plugins/package.json +9 -2
  283. package/public/assets/@mdi/font/LICENSE +20 -0
  284. package/public/assets/@mdi/font/css/materialdesignicons.css.map +16 -0
  285. package/public/assets/@mdi/font/css/materialdesignicons.min.css +3 -0
  286. package/public/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
  287. package/public/assets/favicon-128.png +0 -0
  288. package/public/assets/favicon-180.png +0 -0
  289. package/public/assets/favicon-192.png +0 -0
  290. package/public/assets/favicon-32.png +0 -0
  291. package/public/assets/favicon.svg +10 -0
  292. package/public/assets/font/OFL.txt +93 -0
  293. package/public/assets/font/TitilliumWeb-Regular.woff2 +0 -0
  294. package/public/assets/style/icon-marker-blue.png +0 -0
  295. package/public/assets/style/icon-marker-green.png +0 -0
  296. package/public/assets/style/icon-marker-o-blue.png +0 -0
  297. package/public/assets/style/icon-marker-o-green.png +0 -0
  298. package/public/assets/style/icon-marker-o-red.png +0 -0
  299. package/public/assets/style/icon-marker-o.png +0 -0
  300. package/public/assets/style/icon-marker-red.png +0 -0
  301. package/public/assets/style/icon-marker.png +0 -0
  302. package/public/assets/style/icon-pin-blue.png +0 -0
  303. package/public/assets/style/icon-pin-green.png +0 -0
  304. package/public/assets/style/icon-pin-red.png +0 -0
  305. package/public/assets/style/icon-pin.png +0 -0
  306. package/src/actions/StyleSelector.vue +121 -0
  307. package/src/actions/actionHelper.js +186 -50
  308. package/src/actions/stateRefAction.js +2 -3
  309. package/src/application/VcsApp.vue +539 -93
  310. package/src/application/VcsAppWrapper.vue +32 -0
  311. package/src/application/VcsAttributions.vue +83 -0
  312. package/src/application/VcsAttributionsFooter.vue +83 -0
  313. package/src/application/VcsMap.vue +22 -5
  314. package/src/application/VcsNavbar.vue +217 -0
  315. package/src/application/VcsSettings.vue +98 -0
  316. package/src/application/attributionsHelper.js +162 -0
  317. package/src/callback/activateLayersCallback.js +54 -0
  318. package/src/callback/applyLayerStyleCallback.js +63 -0
  319. package/src/callback/deactivateLayersCallback.js +54 -0
  320. package/src/callback/goToViewpointCallback.js +54 -0
  321. package/src/callback/vcsCallback.js +66 -0
  322. package/src/components/ImageElementInjector.vue +24 -0
  323. package/src/components/buttons/VcsActionButtonList.vue +129 -0
  324. package/src/components/buttons/VcsButton.vue +151 -0
  325. package/src/components/buttons/VcsFormButton.vue +178 -0
  326. package/src/components/buttons/VcsToolButton.vue +161 -0
  327. package/src/components/form-inputs-controls/VcsCheckbox.vue +115 -0
  328. package/src/components/form-inputs-controls/VcsChipArrayInput.vue +290 -0
  329. package/src/components/form-inputs-controls/VcsDatePicker.vue +156 -0
  330. package/src/components/form-inputs-controls/VcsFormSection.vue +150 -0
  331. package/src/components/form-inputs-controls/VcsLabel.vue +56 -0
  332. package/src/components/form-inputs-controls/VcsRadio.vue +149 -0
  333. package/src/components/form-inputs-controls/VcsRadioGrid.vue +175 -0
  334. package/src/components/form-inputs-controls/VcsSelect.vue +211 -0
  335. package/src/components/form-inputs-controls/VcsSlider.vue +73 -0
  336. package/src/components/form-inputs-controls/VcsTextArea.vue +180 -0
  337. package/src/components/form-inputs-controls/VcsTextField.vue +298 -0
  338. package/src/components/form-inputs-controls/VcsWizard.vue +137 -0
  339. package/src/components/form-inputs-controls/VcsWizardStep.vue +161 -0
  340. package/src/components/form-inputs-controls/composables.js +31 -0
  341. package/src/components/form-output/VcsFormattedNumber.vue +103 -0
  342. package/src/components/icons/+all.js +463 -0
  343. package/src/components/icons/2DAreaIcon.vue +58 -0
  344. package/src/components/icons/2DDistanceIcon.vue +24 -0
  345. package/src/components/icons/3DAreaIcon.vue +58 -0
  346. package/src/components/icons/3DDistanceIcon.vue +24 -0
  347. package/src/components/icons/3DHeightIcon.vue +24 -0
  348. package/src/components/icons/AngleIcon.vue +16 -0
  349. package/src/components/icons/AssociationsIcon.vue +37 -0
  350. package/src/components/icons/AxisIcon.vue +35 -0
  351. package/src/components/icons/BoundingBoxIcon.vue +38 -0
  352. package/src/components/icons/CheckboxCheckedIcon.vue +12 -0
  353. package/src/components/icons/CheckboxIcon.vue +21 -0
  354. package/src/components/icons/CheckboxIndeterminateIcon.vue +10 -0
  355. package/src/components/icons/CircleIcon.vue +25 -0
  356. package/src/components/icons/ClippingHorizontalIcon.vue +18 -0
  357. package/src/components/icons/ClippingIcon.vue +17 -0
  358. package/src/components/icons/ClippingVerticalIcon.vue +18 -0
  359. package/src/components/icons/ColorPickerIcon.vue +17 -0
  360. package/src/components/icons/ColorSwatchIcon.vue +21 -0
  361. package/src/components/icons/CommentIcon.vue +19 -0
  362. package/src/components/icons/CompassIcon.vue +24 -0
  363. package/src/components/icons/ComponentsIcon.vue +18 -0
  364. package/src/components/icons/ConeIcon.vue +30 -0
  365. package/src/components/icons/DimensionsHouseIcon.vue +20 -0
  366. package/src/components/icons/EditIcon.vue +17 -0
  367. package/src/components/icons/EditVerticesIcon.vue +35 -0
  368. package/src/components/icons/ElevationProfileIcon.vue +104 -0
  369. package/src/components/icons/ExportAreaIcon.vue +17 -0
  370. package/src/components/icons/ExportFlightIcon.vue +17 -0
  371. package/src/components/icons/ExportIcon.vue +24 -0
  372. package/src/components/icons/ExternalLinkIcon.vue +23 -0
  373. package/src/components/icons/EyeIcon.vue +17 -0
  374. package/src/components/icons/FastForwardIcon.vue +17 -0
  375. package/src/components/icons/FilterIcon.vue +18 -0
  376. package/src/components/icons/GlobalTerrainIcon.vue +19 -0
  377. package/src/components/icons/GlobeNatureIcon.vue +17 -0
  378. package/src/components/icons/GroundIcon.vue +27 -0
  379. package/src/components/icons/HealthCareIndustriesIcon.vue +113 -0
  380. package/src/components/icons/HelpIcon.vue +17 -0
  381. package/src/components/icons/HideIcon.vue +25 -0
  382. package/src/components/icons/HomePointIcon.vue +17 -0
  383. package/src/components/icons/HospitalsIcon.vue +223 -0
  384. package/src/components/icons/HouseIcon.vue +32 -0
  385. package/src/components/icons/ImportIcon.vue +18 -0
  386. package/src/components/icons/InfoIcon.vue +24 -0
  387. package/src/components/icons/KebabIcon.vue +38 -0
  388. package/src/components/icons/LabelIcon.vue +23 -0
  389. package/src/components/icons/LayersIcon.vue +28 -0
  390. package/src/components/icons/LegendIcon.vue +24 -0
  391. package/src/components/icons/LineIcon.vue +22 -0
  392. package/src/components/icons/LinkIcon.vue +17 -0
  393. package/src/components/icons/LogoutIcon.vue +17 -0
  394. package/src/components/icons/MapIcon.vue +18 -0
  395. package/src/components/icons/MenuIcon.vue +36 -0
  396. package/src/components/icons/MinusIcon.vue +18 -0
  397. package/src/components/icons/ObjectAttributeIcon.vue +18 -0
  398. package/src/components/icons/ObjectSelectIcon.vue +18 -0
  399. package/src/components/icons/ObliqueViewIcon.vue +19 -0
  400. package/src/components/icons/PdfIcon.vue +19 -0
  401. package/src/components/icons/PedestrianIcon.vue +17 -0
  402. package/src/components/icons/PenIcon.vue +16 -0
  403. package/src/components/icons/PlayCircleIcon.vue +20 -0
  404. package/src/components/icons/PlusIcon.vue +18 -0
  405. package/src/components/icons/PoiIcon.vue +23 -0
  406. package/src/components/icons/PointIcon.vue +40 -0
  407. package/src/components/icons/PointSelectIcon.vue +18 -0
  408. package/src/components/icons/PresentationModeIcon.vue +17 -0
  409. package/src/components/icons/ProgressIcon.vue +26 -0
  410. package/src/components/icons/QueryIcon.vue +39 -0
  411. package/src/components/icons/RectangleIcon.vue +24 -0
  412. package/src/components/icons/ReturnIcon.vue +17 -0
  413. package/src/components/icons/RewindIcon.vue +16 -0
  414. package/src/components/icons/RotateLeftIcon.vue +17 -0
  415. package/src/components/icons/RotateRightIcon.vue +17 -0
  416. package/src/components/icons/ScreenshotIcon.vue +53 -0
  417. package/src/components/icons/SearchIcon.vue +17 -0
  418. package/src/components/icons/ShadowIcon.vue +18 -0
  419. package/src/components/icons/ShapesIcon.vue +35 -0
  420. package/src/components/icons/ShareIcon.vue +22 -0
  421. package/src/components/icons/SimpleCircleFilledIcon.vue +18 -0
  422. package/src/components/icons/SimpleCircleHalfFilledIcon.vue +16 -0
  423. package/src/components/icons/SimpleCircleOutlinedIcon.vue +13 -0
  424. package/src/components/icons/SkipNextIcon.vue +18 -0
  425. package/src/components/icons/SkipPreviousIcon.vue +18 -0
  426. package/src/components/icons/SplitViewIcon.vue +19 -0
  427. package/src/components/icons/TerrainBoxIcon.vue +19 -0
  428. package/src/components/icons/TextStyleIcon.vue +17 -0
  429. package/src/components/icons/ThreeDimensionsIcon.vue +17 -0
  430. package/src/components/icons/ToolsIcon.vue +16 -0
  431. package/src/components/icons/TouchIcon.vue +18 -0
  432. package/src/components/icons/TrashCanIcon.vue +18 -0
  433. package/src/components/icons/TriangleIcon.vue +16 -0
  434. package/src/components/icons/TwoDimensionsIcon.vue +18 -0
  435. package/src/components/icons/UploadIcon.vue +17 -0
  436. package/src/components/icons/UserProfileIcon.vue +17 -0
  437. package/src/components/icons/UserShareIcon.vue +16 -0
  438. package/src/components/icons/VideoRecorderIcon.vue +23 -0
  439. package/src/components/icons/ViewpointFlightIcon.vue +28 -0
  440. package/src/components/icons/ViewpointIcon.vue +28 -0
  441. package/src/components/icons/Viewshed360Icon.vue +18 -0
  442. package/src/components/icons/ViewshedConeIcon.vue +17 -0
  443. package/src/components/icons/ViewshedIcon.vue +18 -0
  444. package/src/components/icons/WalkingIcon.vue +17 -0
  445. package/src/components/icons/WallIcon.vue +22 -0
  446. package/src/components/icons/WandIcon.vue +123 -0
  447. package/src/components/lists/VcsActionList.vue +132 -0
  448. package/src/components/lists/VcsList.vue +590 -0
  449. package/src/components/lists/VcsTreeview.vue +112 -0
  450. package/src/components/lists/VcsTreeviewLeaf.vue +81 -0
  451. package/src/components/lists/VcsTreeviewSearchbar.vue +148 -0
  452. package/src/components/notification/VcsBadge.vue +29 -0
  453. package/src/components/notification/VcsHelp.vue +39 -0
  454. package/src/components/notification/VcsTooltip.vue +160 -0
  455. package/src/components/notification/validation.js +19 -0
  456. package/src/components/plugins/AbstractConfigEditor.vue +84 -0
  457. package/src/components/style/MenuWrapper.vue +140 -0
  458. package/src/components/style/VcsFillMenu.vue +61 -0
  459. package/src/components/style/VcsFillSelector.vue +45 -0
  460. package/src/components/style/VcsImageMenu.vue +83 -0
  461. package/src/components/style/VcsImageSelector.vue +577 -0
  462. package/src/components/style/VcsStrokeMenu.vue +73 -0
  463. package/src/components/style/VcsStrokeSelector.vue +88 -0
  464. package/src/components/style/VcsTextMenu.vue +81 -0
  465. package/src/components/style/VcsTextSelector.vue +269 -0
  466. package/src/components/style/VcsVectorStyleComponent.vue +114 -0
  467. package/src/components/style/composables.js +84 -0
  468. package/src/components/tables/VcsDataTable.vue +475 -0
  469. package/src/components/tables/VcsTable.vue +145 -0
  470. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +778 -0
  471. package/src/components/vector-properties/composables.js +93 -0
  472. package/src/contentTree/LayerTree.vue +19 -15
  473. package/src/contentTree/contentTreeCollection.js +114 -42
  474. package/src/contentTree/contentTreeItem.js +109 -43
  475. package/src/contentTree/groupContentTreeItem.js +46 -23
  476. package/src/contentTree/layerContentTreeItem.js +54 -23
  477. package/src/contentTree/layerGroupContentTreeItem.js +58 -26
  478. package/src/contentTree/nodeContentTreeItem.js +19 -8
  479. package/src/contentTree/obliqueCollectionContentTreeItem.js +51 -22
  480. package/src/contentTree/subContentTreeItem.js +14 -5
  481. package/src/contentTree/vcsObjectContentTreeItem.js +27 -16
  482. package/src/contentTree/viewpointContentTreeItem.js +121 -0
  483. package/src/downloadHelper.js +52 -0
  484. package/src/featureInfo/AddressBalloonComponent.vue +58 -0
  485. package/src/featureInfo/BalloonComponent.vue +193 -0
  486. package/src/featureInfo/abstractFeatureInfoView.js +346 -0
  487. package/src/featureInfo/addressBalloonFeatureInfoView.js +130 -0
  488. package/src/featureInfo/balloonFeatureInfoView.js +159 -0
  489. package/src/featureInfo/balloonHelper.js +172 -0
  490. package/src/featureInfo/featureInfo.js +525 -0
  491. package/src/featureInfo/featureInfoInteraction.js +48 -0
  492. package/src/featureInfo/iframeFeatureInfoView.js +97 -0
  493. package/src/featureInfo/tableFeatureInfoView.js +120 -0
  494. package/src/i18n/de.js +195 -0
  495. package/src/i18n/en.js +195 -0
  496. package/src/i18n/i18nCollection.js +137 -0
  497. package/src/init.js +121 -36
  498. package/src/legend/StyleLegendItem.vue +176 -0
  499. package/src/legend/VcsLegend.vue +140 -0
  500. package/src/legend/legendHelper.js +204 -0
  501. package/src/logo-mobile.svg +9 -0
  502. package/src/logo.svg +26 -0
  503. package/src/manager/buttonManager.js +30 -61
  504. package/src/manager/collectionManager/CollectionComponent.vue +140 -0
  505. package/src/manager/collectionManager/CollectionComponentList.vue +77 -0
  506. package/src/manager/collectionManager/CollectionComponentProvider.vue +39 -0
  507. package/src/manager/collectionManager/CollectionManager.vue +62 -0
  508. package/src/manager/collectionManager/categoryManager.js +83 -0
  509. package/src/manager/collectionManager/collectionComponent.js +470 -0
  510. package/src/manager/collectionManager/collectionManager.js +432 -0
  511. package/src/manager/contextMenu/ContextMenuComponent.vue +43 -0
  512. package/src/manager/contextMenu/contextMenuInteraction.js +47 -0
  513. package/src/manager/contextMenu/contextMenuManager.js +220 -0
  514. package/src/manager/navbarManager.js +115 -0
  515. package/src/manager/toolbox/GroupToolboxComponent.vue +128 -0
  516. package/src/manager/toolbox/SelectToolboxComponent.vue +144 -0
  517. package/src/manager/toolbox/ToolboxManager.vue +139 -74
  518. package/src/manager/toolbox/toolboxManager.js +371 -0
  519. package/src/manager/window/WindowComponent.vue +105 -85
  520. package/src/manager/window/WindowComponentHeader.vue +116 -25
  521. package/src/manager/window/WindowManager.vue +133 -50
  522. package/src/manager/window/windowHelper.js +465 -0
  523. package/src/manager/window/windowManager.js +297 -91
  524. package/src/navigation/{mapNavCompass.vue → MapNavCompass.vue} +31 -11
  525. package/src/navigation/MapNavigation.vue +291 -0
  526. package/src/navigation/ObliqueRotation.vue +69 -0
  527. package/src/navigation/{orientationToolsButton.vue → OrientationToolsButton.vue} +14 -13
  528. package/src/navigation/{tiltSlider.vue → TiltSlider.vue} +40 -17
  529. package/src/navigation/VcsCompass.vue +69 -0
  530. package/src/navigation/VcsZoomButton.vue +52 -0
  531. package/src/navigation/overviewMap.js +142 -104
  532. package/src/navigation/overviewMapClickedInteraction.js +6 -1
  533. package/src/notifier/NotifierComponent.vue +86 -0
  534. package/src/notifier/notifier.js +129 -0
  535. package/src/pluginHelper.js +148 -20
  536. package/src/search/ResultItem.vue +83 -0
  537. package/src/search/ResultsComponent.vue +103 -0
  538. package/src/search/SearchComponent.vue +116 -0
  539. package/src/search/search.js +342 -0
  540. package/src/setup.js +9 -10
  541. package/src/state.js +272 -0
  542. package/src/styles/_theming.scss +69 -11
  543. package/src/styles/_typography.scss +3 -6
  544. package/src/styles/main.scss +12 -0
  545. package/src/styles/shades.scss +4 -0
  546. package/src/styles/utils/_border.scss +1 -1
  547. package/src/styles/utils/_cursor.scss +4 -0
  548. package/src/styles/utils/_display.scss +1 -1
  549. package/src/styles/variables.scss +138 -0
  550. package/src/styles/vcsFont.scss +2 -0
  551. package/src/styles/vcsGrid.scss +13 -0
  552. package/src/uiConfig.js +83 -0
  553. package/src/vcsUiApp.js +510 -69
  554. package/src/vuePlugins/i18n.js +51 -13
  555. package/src/vuePlugins/vuetify.js +104 -43
  556. package/config/berlin.config.json +0 -529
  557. package/dist/assets/cesium/Workers/ArcType-fc72c06c.js +0 -1
  558. package/dist/assets/cesium/Workers/AttributeCompression-80665726.js +0 -1
  559. package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-a655a4bc.js +0 -1
  560. package/dist/assets/cesium/Workers/BoundingRectangle-c3b79029.js +0 -1
  561. package/dist/assets/cesium/Workers/BoxGeometry-f8f9c981.js +0 -1
  562. package/dist/assets/cesium/Workers/Color-de06a177.js +0 -1
  563. package/dist/assets/cesium/Workers/ComponentDatatype-a15c9a19.js +0 -1
  564. package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-48cdc26d.js +0 -1
  565. package/dist/assets/cesium/Workers/CorridorGeometryLibrary-ddc027d3.js +0 -1
  566. package/dist/assets/cesium/Workers/CylinderGeometry-82a8cbe6.js +0 -1
  567. package/dist/assets/cesium/Workers/CylinderGeometryLibrary-76cda53e.js +0 -1
  568. package/dist/assets/cesium/Workers/EllipseGeometry-32d55454.js +0 -1
  569. package/dist/assets/cesium/Workers/EllipseGeometryLibrary-b2ae188a.js +0 -1
  570. package/dist/assets/cesium/Workers/EllipseOutlineGeometry-f05a5a27.js +0 -1
  571. package/dist/assets/cesium/Workers/EllipsoidGeodesic-19e75e11.js +0 -1
  572. package/dist/assets/cesium/Workers/EllipsoidGeometry-7c99fc81.js +0 -1
  573. package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-21c243df.js +0 -1
  574. package/dist/assets/cesium/Workers/EllipsoidRhumbLine-6145377b.js +0 -1
  575. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-a01286f6.js +0 -1
  576. package/dist/assets/cesium/Workers/EncodedCartesian3-d9f5c4a4.js +0 -1
  577. package/dist/assets/cesium/Workers/FrustumGeometry-17776af8.js +0 -1
  578. package/dist/assets/cesium/Workers/GeometryAttribute-89a520b9.js +0 -1
  579. package/dist/assets/cesium/Workers/GeometryAttributes-32b29525.js +0 -1
  580. package/dist/assets/cesium/Workers/GeometryInstance-4fbf16ba.js +0 -1
  581. package/dist/assets/cesium/Workers/GeometryOffsetAttribute-8c5e10db.js +0 -1
  582. package/dist/assets/cesium/Workers/GeometryPipeline-309fad76.js +0 -1
  583. package/dist/assets/cesium/Workers/IndexDatatype-f1dcdf35.js +0 -1
  584. package/dist/assets/cesium/Workers/IntersectionTests-58aa8f80.js +0 -1
  585. package/dist/assets/cesium/Workers/Matrix2-47e98d76.js +0 -1
  586. package/dist/assets/cesium/Workers/OrientedBoundingBox-fcb5b750.js +0 -1
  587. package/dist/assets/cesium/Workers/Plane-3f01019d.js +0 -1
  588. package/dist/assets/cesium/Workers/PolygonGeometryLibrary-0b29eb16.js +0 -1
  589. package/dist/assets/cesium/Workers/PolygonPipeline-a934c4dd.js +0 -1
  590. package/dist/assets/cesium/Workers/PolylinePipeline-8095c9bc.js +0 -1
  591. package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-67d12fff.js +0 -1
  592. package/dist/assets/cesium/Workers/PrimitivePipeline-980e44c5.js +0 -1
  593. package/dist/assets/cesium/Workers/RectangleGeometryLibrary-621c6de8.js +0 -1
  594. package/dist/assets/cesium/Workers/RuntimeError-8952249c.js +0 -1
  595. package/dist/assets/cesium/Workers/TerrainEncoding-f96552d5.js +0 -1
  596. package/dist/assets/cesium/Workers/Transforms-c8cb8f43.js +0 -39
  597. package/dist/assets/cesium/Workers/VertexFormat-a0b706b0.js +0 -1
  598. package/dist/assets/cesium/Workers/WallGeometryLibrary-c03d8479.js +0 -1
  599. package/dist/assets/cesium/Workers/WebGLConstants-508b9636.js +0 -1
  600. package/dist/assets/cesium/Workers/WebMercatorProjection-79b3214e.js +0 -1
  601. package/dist/assets/cesium/Workers/_commonjsHelpers-3aae1032-26891ab7.js +0 -1
  602. package/dist/assets/cesium/Workers/_rollup_plugin_ignore_empty_module_placeholder-57d574d0.js +0 -1
  603. package/dist/assets/cesium/Workers/arrayRemoveDuplicates-dc2f4046.js +0 -1
  604. package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +0 -6
  605. package/dist/assets/cesium/Workers/combine-3c023bda.js +0 -1
  606. package/dist/assets/cesium/Workers/defaultValue-81eec7ed.js +0 -1
  607. package/dist/assets/cesium.6b5bb6.js +0 -9105
  608. package/dist/assets/core.98f9bb.js +0 -4
  609. package/dist/assets/index.0be2842f.js +0 -1
  610. package/dist/assets/index.60dea538.css +0 -1
  611. package/dist/assets/ol.0561aa.js +0 -318
  612. package/dist/assets/ui.b7c1e3.css +0 -1
  613. package/dist/assets/ui.b7c1e3.js +0 -39
  614. package/dist/assets/uicomponents.682c5f.css +0 -1
  615. package/dist/assets/uicomponents.682c5f.js +0 -32
  616. package/dist/assets/uicomponents.js +0 -1
  617. package/dist/assets/vue-composition-api.f926fa.js +0 -14
  618. package/dist/assets/vue-composition-api.js +0 -2
  619. package/dist/assets/vue.ddcb6b.js +0 -9
  620. package/dist/assets/vuetify.d21163.css +0 -5
  621. package/dist/assets/vuetify.d21163.js +0 -48
  622. package/lib/uicomponents.js +0 -1
  623. package/lib/vue-composition-api.js +0 -2
  624. package/map.config.json +0 -35
  625. package/plugins/@vcmap/pluginExample/config.json +0 -6
  626. package/plugins/@vcmap/pluginExample/package.json +0 -7
  627. package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +0 -374
  628. package/plugins/@vcmap/project-selector/ContextsListComponent.vue +0 -62
  629. package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +0 -81
  630. package/plugins/@vcmap/project-selector/README.md +0 -29
  631. package/plugins/@vcmap/project-selector/config.json +0 -15
  632. package/plugins/@vcmap/project-selector/index.js +0 -254
  633. package/plugins/@vcmap/project-selector/package.json +0 -15
  634. package/plugins/@vcmap/theme-changer/config.json +0 -69
  635. package/plugins/@vcmap/theme-changer/package.json +0 -12
  636. package/plugins/buttonExamples/ButtonExamples.vue +0 -190
  637. package/plugins/buttonExamples/index.js +0 -40
  638. package/plugins/categoryTest/Categories.vue +0 -145
  639. package/plugins/categoryTest/Category.vue +0 -114
  640. package/plugins/categoryTest/ItemEditor.vue +0 -13
  641. package/plugins/categoryTest/index.js +0 -41
  642. package/plugins/example/index.js +0 -56
  643. package/plugins/test/editor.vue +0 -63
  644. package/plugins/test/index.js +0 -93
  645. package/plugins/test/myCustomHeader.vue +0 -19
  646. package/plugins/test/toolbox-data.js +0 -49
  647. package/plugins/test/vcsContent.vue +0 -23
  648. package/plugins/test/windowManagerExample.vue +0 -144
  649. package/src/actions/styleSelector.vue +0 -90
  650. package/src/application/Navbar.vue +0 -118
  651. package/src/application/empty-cmp.vue +0 -6
  652. package/src/assets/logo.svg +0 -26
  653. package/src/contentTree/viewPointContentTreeItem.js +0 -107
  654. package/src/lang/de.js +0 -60
  655. package/src/lang/en.js +0 -53
  656. package/src/manager/toolbox/ToolboxMultiSelectButton.vue +0 -96
  657. package/src/manager/toolbox/ToolboxSingleSelectButton.vue +0 -98
  658. package/src/manager/toolbox/toolbox-manager.js +0 -203
  659. package/src/navigation/mapNavigation.vue +0 -201
  660. package/src/navigation/obliqueRotation.vue +0 -48
  661. package/src/navigation/vcsCompass.vue +0 -144
  662. package/src/navigation/vcsZoomButton.vue +0 -27
  663. package/start.js +0 -3
@@ -0,0 +1,2716 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.109.3
5
+ *
6
+ * Copyright 2011-2022 Cesium Contributors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * Columbus View (Pat. Pend.)
21
+ *
22
+ * Portions licensed separately.
23
+ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
+ */
25
+
26
+ import {
27
+ AttributeCompression_default
28
+ } from "./chunk-O5AMBQ36.js";
29
+ import {
30
+ EncodedCartesian3_default
31
+ } from "./chunk-QT3MPEMI.js";
32
+ import {
33
+ IntersectionTests_default
34
+ } from "./chunk-MYZB7C4T.js";
35
+ import {
36
+ Plane_default
37
+ } from "./chunk-OYFCF4PL.js";
38
+ import {
39
+ IndexDatatype_default
40
+ } from "./chunk-RW6LU2CJ.js";
41
+ import {
42
+ GeometryAttribute_default,
43
+ GeometryType_default,
44
+ Geometry_default,
45
+ PrimitiveType_default
46
+ } from "./chunk-X4SU25DT.js";
47
+ import {
48
+ BoundingSphere_default,
49
+ GeographicProjection_default,
50
+ Intersect_default
51
+ } from "./chunk-PFQBCKBM.js";
52
+ import {
53
+ Cartesian2_default,
54
+ Cartesian4_default,
55
+ Matrix4_default
56
+ } from "./chunk-DUHWWBQQ.js";
57
+ import {
58
+ ComponentDatatype_default
59
+ } from "./chunk-LLUNNUJV.js";
60
+ import {
61
+ Cartesian3_default,
62
+ Cartographic_default,
63
+ Matrix3_default
64
+ } from "./chunk-PCJWUS4M.js";
65
+ import {
66
+ Math_default
67
+ } from "./chunk-N3JIFFX2.js";
68
+ import {
69
+ defaultValue_default
70
+ } from "./chunk-WXTV4ATB.js";
71
+ import {
72
+ Check_default,
73
+ DeveloperError_default
74
+ } from "./chunk-4MFFIWUA.js";
75
+ import {
76
+ defined_default
77
+ } from "./chunk-6BTKZDRG.js";
78
+
79
+ // packages/engine/Source/Core/barycentricCoordinates.js
80
+ var scratchCartesian1 = new Cartesian3_default();
81
+ var scratchCartesian2 = new Cartesian3_default();
82
+ var scratchCartesian3 = new Cartesian3_default();
83
+ function barycentricCoordinates(point, p0, p1, p2, result) {
84
+ Check_default.defined("point", point);
85
+ Check_default.defined("p0", p0);
86
+ Check_default.defined("p1", p1);
87
+ Check_default.defined("p2", p2);
88
+ if (!defined_default(result)) {
89
+ result = new Cartesian3_default();
90
+ }
91
+ let v02;
92
+ let v12;
93
+ let v22;
94
+ let dot00;
95
+ let dot01;
96
+ let dot02;
97
+ let dot11;
98
+ let dot12;
99
+ if (!defined_default(p0.z)) {
100
+ if (Cartesian2_default.equalsEpsilon(point, p0, Math_default.EPSILON14)) {
101
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_X, result);
102
+ }
103
+ if (Cartesian2_default.equalsEpsilon(point, p1, Math_default.EPSILON14)) {
104
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_Y, result);
105
+ }
106
+ if (Cartesian2_default.equalsEpsilon(point, p2, Math_default.EPSILON14)) {
107
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_Z, result);
108
+ }
109
+ v02 = Cartesian2_default.subtract(p1, p0, scratchCartesian1);
110
+ v12 = Cartesian2_default.subtract(p2, p0, scratchCartesian2);
111
+ v22 = Cartesian2_default.subtract(point, p0, scratchCartesian3);
112
+ dot00 = Cartesian2_default.dot(v02, v02);
113
+ dot01 = Cartesian2_default.dot(v02, v12);
114
+ dot02 = Cartesian2_default.dot(v02, v22);
115
+ dot11 = Cartesian2_default.dot(v12, v12);
116
+ dot12 = Cartesian2_default.dot(v12, v22);
117
+ } else {
118
+ if (Cartesian3_default.equalsEpsilon(point, p0, Math_default.EPSILON14)) {
119
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_X, result);
120
+ }
121
+ if (Cartesian3_default.equalsEpsilon(point, p1, Math_default.EPSILON14)) {
122
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_Y, result);
123
+ }
124
+ if (Cartesian3_default.equalsEpsilon(point, p2, Math_default.EPSILON14)) {
125
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_Z, result);
126
+ }
127
+ v02 = Cartesian3_default.subtract(p1, p0, scratchCartesian1);
128
+ v12 = Cartesian3_default.subtract(p2, p0, scratchCartesian2);
129
+ v22 = Cartesian3_default.subtract(point, p0, scratchCartesian3);
130
+ dot00 = Cartesian3_default.dot(v02, v02);
131
+ dot01 = Cartesian3_default.dot(v02, v12);
132
+ dot02 = Cartesian3_default.dot(v02, v22);
133
+ dot11 = Cartesian3_default.dot(v12, v12);
134
+ dot12 = Cartesian3_default.dot(v12, v22);
135
+ }
136
+ result.y = dot11 * dot02 - dot01 * dot12;
137
+ result.z = dot00 * dot12 - dot01 * dot02;
138
+ const q = dot00 * dot11 - dot01 * dot01;
139
+ if (q === 0) {
140
+ return void 0;
141
+ }
142
+ result.y /= q;
143
+ result.z /= q;
144
+ result.x = 1 - result.y - result.z;
145
+ return result;
146
+ }
147
+ var barycentricCoordinates_default = barycentricCoordinates;
148
+
149
+ // packages/engine/Source/Core/Tipsify.js
150
+ var Tipsify = {};
151
+ Tipsify.calculateACMR = function(options) {
152
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
153
+ const indices = options.indices;
154
+ let maximumIndex = options.maximumIndex;
155
+ const cacheSize = defaultValue_default(options.cacheSize, 24);
156
+ if (!defined_default(indices)) {
157
+ throw new DeveloperError_default("indices is required.");
158
+ }
159
+ const numIndices = indices.length;
160
+ if (numIndices < 3 || numIndices % 3 !== 0) {
161
+ throw new DeveloperError_default("indices length must be a multiple of three.");
162
+ }
163
+ if (maximumIndex <= 0) {
164
+ throw new DeveloperError_default("maximumIndex must be greater than zero.");
165
+ }
166
+ if (cacheSize < 3) {
167
+ throw new DeveloperError_default("cacheSize must be greater than two.");
168
+ }
169
+ if (!defined_default(maximumIndex)) {
170
+ maximumIndex = 0;
171
+ let currentIndex = 0;
172
+ let intoIndices = indices[currentIndex];
173
+ while (currentIndex < numIndices) {
174
+ if (intoIndices > maximumIndex) {
175
+ maximumIndex = intoIndices;
176
+ }
177
+ ++currentIndex;
178
+ intoIndices = indices[currentIndex];
179
+ }
180
+ }
181
+ const vertexTimeStamps = [];
182
+ for (let i = 0; i < maximumIndex + 1; i++) {
183
+ vertexTimeStamps[i] = 0;
184
+ }
185
+ let s = cacheSize + 1;
186
+ for (let j = 0; j < numIndices; ++j) {
187
+ if (s - vertexTimeStamps[indices[j]] > cacheSize) {
188
+ vertexTimeStamps[indices[j]] = s;
189
+ ++s;
190
+ }
191
+ }
192
+ return (s - cacheSize + 1) / (numIndices / 3);
193
+ };
194
+ Tipsify.tipsify = function(options) {
195
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
196
+ const indices = options.indices;
197
+ const maximumIndex = options.maximumIndex;
198
+ const cacheSize = defaultValue_default(options.cacheSize, 24);
199
+ let cursor;
200
+ function skipDeadEnd(vertices2, deadEnd2, indices2, maximumIndexPlusOne2) {
201
+ while (deadEnd2.length >= 1) {
202
+ const d = deadEnd2[deadEnd2.length - 1];
203
+ deadEnd2.splice(deadEnd2.length - 1, 1);
204
+ if (vertices2[d].numLiveTriangles > 0) {
205
+ return d;
206
+ }
207
+ }
208
+ while (cursor < maximumIndexPlusOne2) {
209
+ if (vertices2[cursor].numLiveTriangles > 0) {
210
+ ++cursor;
211
+ return cursor - 1;
212
+ }
213
+ ++cursor;
214
+ }
215
+ return -1;
216
+ }
217
+ function getNextVertex(indices2, cacheSize2, oneRing2, vertices2, s2, deadEnd2, maximumIndexPlusOne2) {
218
+ let n = -1;
219
+ let p;
220
+ let m = -1;
221
+ let itOneRing = 0;
222
+ while (itOneRing < oneRing2.length) {
223
+ const index2 = oneRing2[itOneRing];
224
+ if (vertices2[index2].numLiveTriangles) {
225
+ p = 0;
226
+ if (s2 - vertices2[index2].timeStamp + 2 * vertices2[index2].numLiveTriangles <= cacheSize2) {
227
+ p = s2 - vertices2[index2].timeStamp;
228
+ }
229
+ if (p > m || m === -1) {
230
+ m = p;
231
+ n = index2;
232
+ }
233
+ }
234
+ ++itOneRing;
235
+ }
236
+ if (n === -1) {
237
+ return skipDeadEnd(vertices2, deadEnd2, indices2, maximumIndexPlusOne2);
238
+ }
239
+ return n;
240
+ }
241
+ if (!defined_default(indices)) {
242
+ throw new DeveloperError_default("indices is required.");
243
+ }
244
+ const numIndices = indices.length;
245
+ if (numIndices < 3 || numIndices % 3 !== 0) {
246
+ throw new DeveloperError_default("indices length must be a multiple of three.");
247
+ }
248
+ if (maximumIndex <= 0) {
249
+ throw new DeveloperError_default("maximumIndex must be greater than zero.");
250
+ }
251
+ if (cacheSize < 3) {
252
+ throw new DeveloperError_default("cacheSize must be greater than two.");
253
+ }
254
+ let maximumIndexPlusOne = 0;
255
+ let currentIndex = 0;
256
+ let intoIndices = indices[currentIndex];
257
+ const endIndex = numIndices;
258
+ if (defined_default(maximumIndex)) {
259
+ maximumIndexPlusOne = maximumIndex + 1;
260
+ } else {
261
+ while (currentIndex < endIndex) {
262
+ if (intoIndices > maximumIndexPlusOne) {
263
+ maximumIndexPlusOne = intoIndices;
264
+ }
265
+ ++currentIndex;
266
+ intoIndices = indices[currentIndex];
267
+ }
268
+ if (maximumIndexPlusOne === -1) {
269
+ return 0;
270
+ }
271
+ ++maximumIndexPlusOne;
272
+ }
273
+ const vertices = [];
274
+ let i;
275
+ for (i = 0; i < maximumIndexPlusOne; i++) {
276
+ vertices[i] = {
277
+ numLiveTriangles: 0,
278
+ timeStamp: 0,
279
+ vertexTriangles: []
280
+ };
281
+ }
282
+ currentIndex = 0;
283
+ let triangle = 0;
284
+ while (currentIndex < endIndex) {
285
+ vertices[indices[currentIndex]].vertexTriangles.push(triangle);
286
+ ++vertices[indices[currentIndex]].numLiveTriangles;
287
+ vertices[indices[currentIndex + 1]].vertexTriangles.push(triangle);
288
+ ++vertices[indices[currentIndex + 1]].numLiveTriangles;
289
+ vertices[indices[currentIndex + 2]].vertexTriangles.push(triangle);
290
+ ++vertices[indices[currentIndex + 2]].numLiveTriangles;
291
+ ++triangle;
292
+ currentIndex += 3;
293
+ }
294
+ let f = 0;
295
+ let s = cacheSize + 1;
296
+ cursor = 1;
297
+ let oneRing = [];
298
+ const deadEnd = [];
299
+ let vertex;
300
+ let intoVertices;
301
+ let currentOutputIndex = 0;
302
+ const outputIndices = [];
303
+ const numTriangles = numIndices / 3;
304
+ const triangleEmitted = [];
305
+ for (i = 0; i < numTriangles; i++) {
306
+ triangleEmitted[i] = false;
307
+ }
308
+ let index;
309
+ let limit;
310
+ while (f !== -1) {
311
+ oneRing = [];
312
+ intoVertices = vertices[f];
313
+ limit = intoVertices.vertexTriangles.length;
314
+ for (let k = 0; k < limit; ++k) {
315
+ triangle = intoVertices.vertexTriangles[k];
316
+ if (!triangleEmitted[triangle]) {
317
+ triangleEmitted[triangle] = true;
318
+ currentIndex = triangle + triangle + triangle;
319
+ for (let j = 0; j < 3; ++j) {
320
+ index = indices[currentIndex];
321
+ oneRing.push(index);
322
+ deadEnd.push(index);
323
+ outputIndices[currentOutputIndex] = index;
324
+ ++currentOutputIndex;
325
+ vertex = vertices[index];
326
+ --vertex.numLiveTriangles;
327
+ if (s - vertex.timeStamp > cacheSize) {
328
+ vertex.timeStamp = s;
329
+ ++s;
330
+ }
331
+ ++currentIndex;
332
+ }
333
+ }
334
+ }
335
+ f = getNextVertex(
336
+ indices,
337
+ cacheSize,
338
+ oneRing,
339
+ vertices,
340
+ s,
341
+ deadEnd,
342
+ maximumIndexPlusOne
343
+ );
344
+ }
345
+ return outputIndices;
346
+ };
347
+ var Tipsify_default = Tipsify;
348
+
349
+ // packages/engine/Source/Core/GeometryPipeline.js
350
+ var GeometryPipeline = {};
351
+ function addTriangle(lines, index, i0, i1, i2) {
352
+ lines[index++] = i0;
353
+ lines[index++] = i1;
354
+ lines[index++] = i1;
355
+ lines[index++] = i2;
356
+ lines[index++] = i2;
357
+ lines[index] = i0;
358
+ }
359
+ function trianglesToLines(triangles) {
360
+ const count = triangles.length;
361
+ const size = count / 3 * 6;
362
+ const lines = IndexDatatype_default.createTypedArray(count, size);
363
+ let index = 0;
364
+ for (let i = 0; i < count; i += 3, index += 6) {
365
+ addTriangle(lines, index, triangles[i], triangles[i + 1], triangles[i + 2]);
366
+ }
367
+ return lines;
368
+ }
369
+ function triangleStripToLines(triangles) {
370
+ const count = triangles.length;
371
+ if (count >= 3) {
372
+ const size = (count - 2) * 6;
373
+ const lines = IndexDatatype_default.createTypedArray(count, size);
374
+ addTriangle(lines, 0, triangles[0], triangles[1], triangles[2]);
375
+ let index = 6;
376
+ for (let i = 3; i < count; ++i, index += 6) {
377
+ addTriangle(
378
+ lines,
379
+ index,
380
+ triangles[i - 1],
381
+ triangles[i],
382
+ triangles[i - 2]
383
+ );
384
+ }
385
+ return lines;
386
+ }
387
+ return new Uint16Array();
388
+ }
389
+ function triangleFanToLines(triangles) {
390
+ if (triangles.length > 0) {
391
+ const count = triangles.length - 1;
392
+ const size = (count - 1) * 6;
393
+ const lines = IndexDatatype_default.createTypedArray(count, size);
394
+ const base = triangles[0];
395
+ let index = 0;
396
+ for (let i = 1; i < count; ++i, index += 6) {
397
+ addTriangle(lines, index, base, triangles[i], triangles[i + 1]);
398
+ }
399
+ return lines;
400
+ }
401
+ return new Uint16Array();
402
+ }
403
+ GeometryPipeline.toWireframe = function(geometry) {
404
+ if (!defined_default(geometry)) {
405
+ throw new DeveloperError_default("geometry is required.");
406
+ }
407
+ const indices = geometry.indices;
408
+ if (defined_default(indices)) {
409
+ switch (geometry.primitiveType) {
410
+ case PrimitiveType_default.TRIANGLES:
411
+ geometry.indices = trianglesToLines(indices);
412
+ break;
413
+ case PrimitiveType_default.TRIANGLE_STRIP:
414
+ geometry.indices = triangleStripToLines(indices);
415
+ break;
416
+ case PrimitiveType_default.TRIANGLE_FAN:
417
+ geometry.indices = triangleFanToLines(indices);
418
+ break;
419
+ default:
420
+ throw new DeveloperError_default(
421
+ "geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN."
422
+ );
423
+ }
424
+ geometry.primitiveType = PrimitiveType_default.LINES;
425
+ }
426
+ return geometry;
427
+ };
428
+ GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length) {
429
+ attributeName = defaultValue_default(attributeName, "normal");
430
+ if (!defined_default(geometry)) {
431
+ throw new DeveloperError_default("geometry is required.");
432
+ }
433
+ if (!defined_default(geometry.attributes.position)) {
434
+ throw new DeveloperError_default("geometry.attributes.position is required.");
435
+ }
436
+ if (!defined_default(geometry.attributes[attributeName])) {
437
+ throw new DeveloperError_default(
438
+ `geometry.attributes must have an attribute with the same name as the attributeName parameter, ${attributeName}.`
439
+ );
440
+ }
441
+ length = defaultValue_default(length, 1e4);
442
+ const positions = geometry.attributes.position.values;
443
+ const vectors = geometry.attributes[attributeName].values;
444
+ const positionsLength = positions.length;
445
+ const newPositions = new Float64Array(2 * positionsLength);
446
+ let j = 0;
447
+ for (let i = 0; i < positionsLength; i += 3) {
448
+ newPositions[j++] = positions[i];
449
+ newPositions[j++] = positions[i + 1];
450
+ newPositions[j++] = positions[i + 2];
451
+ newPositions[j++] = positions[i] + vectors[i] * length;
452
+ newPositions[j++] = positions[i + 1] + vectors[i + 1] * length;
453
+ newPositions[j++] = positions[i + 2] + vectors[i + 2] * length;
454
+ }
455
+ let newBoundingSphere;
456
+ const bs = geometry.boundingSphere;
457
+ if (defined_default(bs)) {
458
+ newBoundingSphere = new BoundingSphere_default(bs.center, bs.radius + length);
459
+ }
460
+ return new Geometry_default({
461
+ attributes: {
462
+ position: new GeometryAttribute_default({
463
+ componentDatatype: ComponentDatatype_default.DOUBLE,
464
+ componentsPerAttribute: 3,
465
+ values: newPositions
466
+ })
467
+ },
468
+ primitiveType: PrimitiveType_default.LINES,
469
+ boundingSphere: newBoundingSphere
470
+ });
471
+ };
472
+ GeometryPipeline.createAttributeLocations = function(geometry) {
473
+ if (!defined_default(geometry)) {
474
+ throw new DeveloperError_default("geometry is required.");
475
+ }
476
+ const semantics = [
477
+ "position",
478
+ "positionHigh",
479
+ "positionLow",
480
+ // From VertexFormat.position - after 2D projection and high-precision encoding
481
+ "position3DHigh",
482
+ "position3DLow",
483
+ "position2DHigh",
484
+ "position2DLow",
485
+ // From Primitive
486
+ "pickColor",
487
+ // From VertexFormat
488
+ "normal",
489
+ "st",
490
+ "tangent",
491
+ "bitangent",
492
+ // For shadow volumes
493
+ "extrudeDirection",
494
+ // From compressing texture coordinates and normals
495
+ "compressedAttributes"
496
+ ];
497
+ const attributes = geometry.attributes;
498
+ const indices = {};
499
+ let j = 0;
500
+ let i;
501
+ const len = semantics.length;
502
+ for (i = 0; i < len; ++i) {
503
+ const semantic = semantics[i];
504
+ if (defined_default(attributes[semantic])) {
505
+ indices[semantic] = j++;
506
+ }
507
+ }
508
+ for (const name in attributes) {
509
+ if (attributes.hasOwnProperty(name) && !defined_default(indices[name])) {
510
+ indices[name] = j++;
511
+ }
512
+ }
513
+ return indices;
514
+ };
515
+ GeometryPipeline.reorderForPreVertexCache = function(geometry) {
516
+ if (!defined_default(geometry)) {
517
+ throw new DeveloperError_default("geometry is required.");
518
+ }
519
+ const numVertices = Geometry_default.computeNumberOfVertices(geometry);
520
+ const indices = geometry.indices;
521
+ if (defined_default(indices)) {
522
+ const indexCrossReferenceOldToNew = new Int32Array(numVertices);
523
+ for (let i = 0; i < numVertices; i++) {
524
+ indexCrossReferenceOldToNew[i] = -1;
525
+ }
526
+ const indicesIn = indices;
527
+ const numIndices = indicesIn.length;
528
+ const indicesOut = IndexDatatype_default.createTypedArray(numVertices, numIndices);
529
+ let intoIndicesIn = 0;
530
+ let intoIndicesOut = 0;
531
+ let nextIndex = 0;
532
+ let tempIndex;
533
+ while (intoIndicesIn < numIndices) {
534
+ tempIndex = indexCrossReferenceOldToNew[indicesIn[intoIndicesIn]];
535
+ if (tempIndex !== -1) {
536
+ indicesOut[intoIndicesOut] = tempIndex;
537
+ } else {
538
+ tempIndex = indicesIn[intoIndicesIn];
539
+ indexCrossReferenceOldToNew[tempIndex] = nextIndex;
540
+ indicesOut[intoIndicesOut] = nextIndex;
541
+ ++nextIndex;
542
+ }
543
+ ++intoIndicesIn;
544
+ ++intoIndicesOut;
545
+ }
546
+ geometry.indices = indicesOut;
547
+ const attributes = geometry.attributes;
548
+ for (const property in attributes) {
549
+ if (attributes.hasOwnProperty(property) && defined_default(attributes[property]) && defined_default(attributes[property].values)) {
550
+ const attribute = attributes[property];
551
+ const elementsIn = attribute.values;
552
+ let intoElementsIn = 0;
553
+ const numComponents = attribute.componentsPerAttribute;
554
+ const elementsOut = ComponentDatatype_default.createTypedArray(
555
+ attribute.componentDatatype,
556
+ nextIndex * numComponents
557
+ );
558
+ while (intoElementsIn < numVertices) {
559
+ const temp = indexCrossReferenceOldToNew[intoElementsIn];
560
+ if (temp !== -1) {
561
+ for (let j = 0; j < numComponents; j++) {
562
+ elementsOut[numComponents * temp + j] = elementsIn[numComponents * intoElementsIn + j];
563
+ }
564
+ }
565
+ ++intoElementsIn;
566
+ }
567
+ attribute.values = elementsOut;
568
+ }
569
+ }
570
+ }
571
+ return geometry;
572
+ };
573
+ GeometryPipeline.reorderForPostVertexCache = function(geometry, cacheCapacity) {
574
+ if (!defined_default(geometry)) {
575
+ throw new DeveloperError_default("geometry is required.");
576
+ }
577
+ const indices = geometry.indices;
578
+ if (geometry.primitiveType === PrimitiveType_default.TRIANGLES && defined_default(indices)) {
579
+ const numIndices = indices.length;
580
+ let maximumIndex = 0;
581
+ for (let j = 0; j < numIndices; j++) {
582
+ if (indices[j] > maximumIndex) {
583
+ maximumIndex = indices[j];
584
+ }
585
+ }
586
+ geometry.indices = Tipsify_default.tipsify({
587
+ indices,
588
+ maximumIndex,
589
+ cacheSize: cacheCapacity
590
+ });
591
+ }
592
+ return geometry;
593
+ };
594
+ function copyAttributesDescriptions(attributes) {
595
+ const newAttributes = {};
596
+ for (const attribute in attributes) {
597
+ if (attributes.hasOwnProperty(attribute) && defined_default(attributes[attribute]) && defined_default(attributes[attribute].values)) {
598
+ const attr = attributes[attribute];
599
+ newAttributes[attribute] = new GeometryAttribute_default({
600
+ componentDatatype: attr.componentDatatype,
601
+ componentsPerAttribute: attr.componentsPerAttribute,
602
+ normalize: attr.normalize,
603
+ values: []
604
+ });
605
+ }
606
+ }
607
+ return newAttributes;
608
+ }
609
+ function copyVertex(destinationAttributes, sourceAttributes, index) {
610
+ for (const attribute in sourceAttributes) {
611
+ if (sourceAttributes.hasOwnProperty(attribute) && defined_default(sourceAttributes[attribute]) && defined_default(sourceAttributes[attribute].values)) {
612
+ const attr = sourceAttributes[attribute];
613
+ for (let k = 0; k < attr.componentsPerAttribute; ++k) {
614
+ destinationAttributes[attribute].values.push(
615
+ attr.values[index * attr.componentsPerAttribute + k]
616
+ );
617
+ }
618
+ }
619
+ }
620
+ }
621
+ GeometryPipeline.fitToUnsignedShortIndices = function(geometry) {
622
+ if (!defined_default(geometry)) {
623
+ throw new DeveloperError_default("geometry is required.");
624
+ }
625
+ if (defined_default(geometry.indices) && geometry.primitiveType !== PrimitiveType_default.TRIANGLES && geometry.primitiveType !== PrimitiveType_default.LINES && geometry.primitiveType !== PrimitiveType_default.POINTS) {
626
+ throw new DeveloperError_default(
627
+ "geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS."
628
+ );
629
+ }
630
+ const geometries = [];
631
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
632
+ if (defined_default(geometry.indices) && numberOfVertices >= Math_default.SIXTY_FOUR_KILOBYTES) {
633
+ let oldToNewIndex = [];
634
+ let newIndices = [];
635
+ let currentIndex = 0;
636
+ let newAttributes = copyAttributesDescriptions(geometry.attributes);
637
+ const originalIndices = geometry.indices;
638
+ const numberOfIndices = originalIndices.length;
639
+ let indicesPerPrimitive;
640
+ if (geometry.primitiveType === PrimitiveType_default.TRIANGLES) {
641
+ indicesPerPrimitive = 3;
642
+ } else if (geometry.primitiveType === PrimitiveType_default.LINES) {
643
+ indicesPerPrimitive = 2;
644
+ } else if (geometry.primitiveType === PrimitiveType_default.POINTS) {
645
+ indicesPerPrimitive = 1;
646
+ }
647
+ for (let j = 0; j < numberOfIndices; j += indicesPerPrimitive) {
648
+ for (let k = 0; k < indicesPerPrimitive; ++k) {
649
+ const x = originalIndices[j + k];
650
+ let i = oldToNewIndex[x];
651
+ if (!defined_default(i)) {
652
+ i = currentIndex++;
653
+ oldToNewIndex[x] = i;
654
+ copyVertex(newAttributes, geometry.attributes, x);
655
+ }
656
+ newIndices.push(i);
657
+ }
658
+ if (currentIndex + indicesPerPrimitive >= Math_default.SIXTY_FOUR_KILOBYTES) {
659
+ geometries.push(
660
+ new Geometry_default({
661
+ attributes: newAttributes,
662
+ indices: newIndices,
663
+ primitiveType: geometry.primitiveType,
664
+ boundingSphere: geometry.boundingSphere,
665
+ boundingSphereCV: geometry.boundingSphereCV
666
+ })
667
+ );
668
+ oldToNewIndex = [];
669
+ newIndices = [];
670
+ currentIndex = 0;
671
+ newAttributes = copyAttributesDescriptions(geometry.attributes);
672
+ }
673
+ }
674
+ if (newIndices.length !== 0) {
675
+ geometries.push(
676
+ new Geometry_default({
677
+ attributes: newAttributes,
678
+ indices: newIndices,
679
+ primitiveType: geometry.primitiveType,
680
+ boundingSphere: geometry.boundingSphere,
681
+ boundingSphereCV: geometry.boundingSphereCV
682
+ })
683
+ );
684
+ }
685
+ } else {
686
+ geometries.push(geometry);
687
+ }
688
+ return geometries;
689
+ };
690
+ var scratchProjectTo2DCartesian3 = new Cartesian3_default();
691
+ var scratchProjectTo2DCartographic = new Cartographic_default();
692
+ GeometryPipeline.projectTo2D = function(geometry, attributeName, attributeName3D, attributeName2D, projection) {
693
+ if (!defined_default(geometry)) {
694
+ throw new DeveloperError_default("geometry is required.");
695
+ }
696
+ if (!defined_default(attributeName)) {
697
+ throw new DeveloperError_default("attributeName is required.");
698
+ }
699
+ if (!defined_default(attributeName3D)) {
700
+ throw new DeveloperError_default("attributeName3D is required.");
701
+ }
702
+ if (!defined_default(attributeName2D)) {
703
+ throw new DeveloperError_default("attributeName2D is required.");
704
+ }
705
+ if (!defined_default(geometry.attributes[attributeName])) {
706
+ throw new DeveloperError_default(
707
+ `geometry must have attribute matching the attributeName argument: ${attributeName}.`
708
+ );
709
+ }
710
+ if (geometry.attributes[attributeName].componentDatatype !== ComponentDatatype_default.DOUBLE) {
711
+ throw new DeveloperError_default(
712
+ "The attribute componentDatatype must be ComponentDatatype.DOUBLE."
713
+ );
714
+ }
715
+ const attribute = geometry.attributes[attributeName];
716
+ projection = defined_default(projection) ? projection : new GeographicProjection_default();
717
+ const ellipsoid = projection.ellipsoid;
718
+ const values3D = attribute.values;
719
+ const projectedValues = new Float64Array(values3D.length);
720
+ let index = 0;
721
+ for (let i = 0; i < values3D.length; i += 3) {
722
+ const value = Cartesian3_default.fromArray(
723
+ values3D,
724
+ i,
725
+ scratchProjectTo2DCartesian3
726
+ );
727
+ const lonLat = ellipsoid.cartesianToCartographic(
728
+ value,
729
+ scratchProjectTo2DCartographic
730
+ );
731
+ if (!defined_default(lonLat)) {
732
+ throw new DeveloperError_default(
733
+ `Could not project point (${value.x}, ${value.y}, ${value.z}) to 2D.`
734
+ );
735
+ }
736
+ const projectedLonLat = projection.project(
737
+ lonLat,
738
+ scratchProjectTo2DCartesian3
739
+ );
740
+ projectedValues[index++] = projectedLonLat.x;
741
+ projectedValues[index++] = projectedLonLat.y;
742
+ projectedValues[index++] = projectedLonLat.z;
743
+ }
744
+ geometry.attributes[attributeName3D] = attribute;
745
+ geometry.attributes[attributeName2D] = new GeometryAttribute_default({
746
+ componentDatatype: ComponentDatatype_default.DOUBLE,
747
+ componentsPerAttribute: 3,
748
+ values: projectedValues
749
+ });
750
+ delete geometry.attributes[attributeName];
751
+ return geometry;
752
+ };
753
+ var encodedResult = {
754
+ high: 0,
755
+ low: 0
756
+ };
757
+ GeometryPipeline.encodeAttribute = function(geometry, attributeName, attributeHighName, attributeLowName) {
758
+ if (!defined_default(geometry)) {
759
+ throw new DeveloperError_default("geometry is required.");
760
+ }
761
+ if (!defined_default(attributeName)) {
762
+ throw new DeveloperError_default("attributeName is required.");
763
+ }
764
+ if (!defined_default(attributeHighName)) {
765
+ throw new DeveloperError_default("attributeHighName is required.");
766
+ }
767
+ if (!defined_default(attributeLowName)) {
768
+ throw new DeveloperError_default("attributeLowName is required.");
769
+ }
770
+ if (!defined_default(geometry.attributes[attributeName])) {
771
+ throw new DeveloperError_default(
772
+ `geometry must have attribute matching the attributeName argument: ${attributeName}.`
773
+ );
774
+ }
775
+ if (geometry.attributes[attributeName].componentDatatype !== ComponentDatatype_default.DOUBLE) {
776
+ throw new DeveloperError_default(
777
+ "The attribute componentDatatype must be ComponentDatatype.DOUBLE."
778
+ );
779
+ }
780
+ const attribute = geometry.attributes[attributeName];
781
+ const values = attribute.values;
782
+ const length = values.length;
783
+ const highValues = new Float32Array(length);
784
+ const lowValues = new Float32Array(length);
785
+ for (let i = 0; i < length; ++i) {
786
+ EncodedCartesian3_default.encode(values[i], encodedResult);
787
+ highValues[i] = encodedResult.high;
788
+ lowValues[i] = encodedResult.low;
789
+ }
790
+ const componentsPerAttribute = attribute.componentsPerAttribute;
791
+ geometry.attributes[attributeHighName] = new GeometryAttribute_default({
792
+ componentDatatype: ComponentDatatype_default.FLOAT,
793
+ componentsPerAttribute,
794
+ values: highValues
795
+ });
796
+ geometry.attributes[attributeLowName] = new GeometryAttribute_default({
797
+ componentDatatype: ComponentDatatype_default.FLOAT,
798
+ componentsPerAttribute,
799
+ values: lowValues
800
+ });
801
+ delete geometry.attributes[attributeName];
802
+ return geometry;
803
+ };
804
+ var scratchCartesian32 = new Cartesian3_default();
805
+ function transformPoint(matrix, attribute) {
806
+ if (defined_default(attribute)) {
807
+ const values = attribute.values;
808
+ const length = values.length;
809
+ for (let i = 0; i < length; i += 3) {
810
+ Cartesian3_default.unpack(values, i, scratchCartesian32);
811
+ Matrix4_default.multiplyByPoint(matrix, scratchCartesian32, scratchCartesian32);
812
+ Cartesian3_default.pack(scratchCartesian32, values, i);
813
+ }
814
+ }
815
+ }
816
+ function transformVector(matrix, attribute) {
817
+ if (defined_default(attribute)) {
818
+ const values = attribute.values;
819
+ const length = values.length;
820
+ for (let i = 0; i < length; i += 3) {
821
+ Cartesian3_default.unpack(values, i, scratchCartesian32);
822
+ Matrix3_default.multiplyByVector(matrix, scratchCartesian32, scratchCartesian32);
823
+ scratchCartesian32 = Cartesian3_default.normalize(
824
+ scratchCartesian32,
825
+ scratchCartesian32
826
+ );
827
+ Cartesian3_default.pack(scratchCartesian32, values, i);
828
+ }
829
+ }
830
+ }
831
+ var inverseTranspose = new Matrix4_default();
832
+ var normalMatrix = new Matrix3_default();
833
+ GeometryPipeline.transformToWorldCoordinates = function(instance) {
834
+ if (!defined_default(instance)) {
835
+ throw new DeveloperError_default("instance is required.");
836
+ }
837
+ const modelMatrix = instance.modelMatrix;
838
+ if (Matrix4_default.equals(modelMatrix, Matrix4_default.IDENTITY)) {
839
+ return instance;
840
+ }
841
+ const attributes = instance.geometry.attributes;
842
+ transformPoint(modelMatrix, attributes.position);
843
+ transformPoint(modelMatrix, attributes.prevPosition);
844
+ transformPoint(modelMatrix, attributes.nextPosition);
845
+ if (defined_default(attributes.normal) || defined_default(attributes.tangent) || defined_default(attributes.bitangent)) {
846
+ Matrix4_default.inverse(modelMatrix, inverseTranspose);
847
+ Matrix4_default.transpose(inverseTranspose, inverseTranspose);
848
+ Matrix4_default.getMatrix3(inverseTranspose, normalMatrix);
849
+ transformVector(normalMatrix, attributes.normal);
850
+ transformVector(normalMatrix, attributes.tangent);
851
+ transformVector(normalMatrix, attributes.bitangent);
852
+ }
853
+ const boundingSphere = instance.geometry.boundingSphere;
854
+ if (defined_default(boundingSphere)) {
855
+ instance.geometry.boundingSphere = BoundingSphere_default.transform(
856
+ boundingSphere,
857
+ modelMatrix,
858
+ boundingSphere
859
+ );
860
+ }
861
+ instance.modelMatrix = Matrix4_default.clone(Matrix4_default.IDENTITY);
862
+ return instance;
863
+ };
864
+ function findAttributesInAllGeometries(instances, propertyName) {
865
+ const length = instances.length;
866
+ const attributesInAllGeometries = {};
867
+ const attributes0 = instances[0][propertyName].attributes;
868
+ let name;
869
+ for (name in attributes0) {
870
+ if (attributes0.hasOwnProperty(name) && defined_default(attributes0[name]) && defined_default(attributes0[name].values)) {
871
+ const attribute = attributes0[name];
872
+ let numberOfComponents = attribute.values.length;
873
+ let inAllGeometries = true;
874
+ for (let i = 1; i < length; ++i) {
875
+ const otherAttribute = instances[i][propertyName].attributes[name];
876
+ if (!defined_default(otherAttribute) || attribute.componentDatatype !== otherAttribute.componentDatatype || attribute.componentsPerAttribute !== otherAttribute.componentsPerAttribute || attribute.normalize !== otherAttribute.normalize) {
877
+ inAllGeometries = false;
878
+ break;
879
+ }
880
+ numberOfComponents += otherAttribute.values.length;
881
+ }
882
+ if (inAllGeometries) {
883
+ attributesInAllGeometries[name] = new GeometryAttribute_default({
884
+ componentDatatype: attribute.componentDatatype,
885
+ componentsPerAttribute: attribute.componentsPerAttribute,
886
+ normalize: attribute.normalize,
887
+ values: ComponentDatatype_default.createTypedArray(
888
+ attribute.componentDatatype,
889
+ numberOfComponents
890
+ )
891
+ });
892
+ }
893
+ }
894
+ }
895
+ return attributesInAllGeometries;
896
+ }
897
+ var tempScratch = new Cartesian3_default();
898
+ function combineGeometries(instances, propertyName) {
899
+ const length = instances.length;
900
+ let name;
901
+ let i;
902
+ let j;
903
+ let k;
904
+ const m = instances[0].modelMatrix;
905
+ const haveIndices = defined_default(instances[0][propertyName].indices);
906
+ const primitiveType = instances[0][propertyName].primitiveType;
907
+ for (i = 1; i < length; ++i) {
908
+ if (!Matrix4_default.equals(instances[i].modelMatrix, m)) {
909
+ throw new DeveloperError_default("All instances must have the same modelMatrix.");
910
+ }
911
+ if (defined_default(instances[i][propertyName].indices) !== haveIndices) {
912
+ throw new DeveloperError_default(
913
+ "All instance geometries must have an indices or not have one."
914
+ );
915
+ }
916
+ if (instances[i][propertyName].primitiveType !== primitiveType) {
917
+ throw new DeveloperError_default(
918
+ "All instance geometries must have the same primitiveType."
919
+ );
920
+ }
921
+ }
922
+ const attributes = findAttributesInAllGeometries(instances, propertyName);
923
+ let values;
924
+ let sourceValues;
925
+ let sourceValuesLength;
926
+ for (name in attributes) {
927
+ if (attributes.hasOwnProperty(name)) {
928
+ values = attributes[name].values;
929
+ k = 0;
930
+ for (i = 0; i < length; ++i) {
931
+ sourceValues = instances[i][propertyName].attributes[name].values;
932
+ sourceValuesLength = sourceValues.length;
933
+ for (j = 0; j < sourceValuesLength; ++j) {
934
+ values[k++] = sourceValues[j];
935
+ }
936
+ }
937
+ }
938
+ }
939
+ let indices;
940
+ if (haveIndices) {
941
+ let numberOfIndices = 0;
942
+ for (i = 0; i < length; ++i) {
943
+ numberOfIndices += instances[i][propertyName].indices.length;
944
+ }
945
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(
946
+ new Geometry_default({
947
+ attributes,
948
+ primitiveType: PrimitiveType_default.POINTS
949
+ })
950
+ );
951
+ const destIndices = IndexDatatype_default.createTypedArray(
952
+ numberOfVertices,
953
+ numberOfIndices
954
+ );
955
+ let destOffset = 0;
956
+ let offset = 0;
957
+ for (i = 0; i < length; ++i) {
958
+ const sourceIndices = instances[i][propertyName].indices;
959
+ const sourceIndicesLen = sourceIndices.length;
960
+ for (k = 0; k < sourceIndicesLen; ++k) {
961
+ destIndices[destOffset++] = offset + sourceIndices[k];
962
+ }
963
+ offset += Geometry_default.computeNumberOfVertices(instances[i][propertyName]);
964
+ }
965
+ indices = destIndices;
966
+ }
967
+ let center = new Cartesian3_default();
968
+ let radius = 0;
969
+ let bs;
970
+ for (i = 0; i < length; ++i) {
971
+ bs = instances[i][propertyName].boundingSphere;
972
+ if (!defined_default(bs)) {
973
+ center = void 0;
974
+ break;
975
+ }
976
+ Cartesian3_default.add(bs.center, center, center);
977
+ }
978
+ if (defined_default(center)) {
979
+ Cartesian3_default.divideByScalar(center, length, center);
980
+ for (i = 0; i < length; ++i) {
981
+ bs = instances[i][propertyName].boundingSphere;
982
+ const tempRadius = Cartesian3_default.magnitude(
983
+ Cartesian3_default.subtract(bs.center, center, tempScratch)
984
+ ) + bs.radius;
985
+ if (tempRadius > radius) {
986
+ radius = tempRadius;
987
+ }
988
+ }
989
+ }
990
+ return new Geometry_default({
991
+ attributes,
992
+ indices,
993
+ primitiveType,
994
+ boundingSphere: defined_default(center) ? new BoundingSphere_default(center, radius) : void 0
995
+ });
996
+ }
997
+ GeometryPipeline.combineInstances = function(instances) {
998
+ if (!defined_default(instances) || instances.length < 1) {
999
+ throw new DeveloperError_default(
1000
+ "instances is required and must have length greater than zero."
1001
+ );
1002
+ }
1003
+ const instanceGeometry = [];
1004
+ const instanceSplitGeometry = [];
1005
+ const length = instances.length;
1006
+ for (let i = 0; i < length; ++i) {
1007
+ const instance = instances[i];
1008
+ if (defined_default(instance.geometry)) {
1009
+ instanceGeometry.push(instance);
1010
+ } else if (defined_default(instance.westHemisphereGeometry) && defined_default(instance.eastHemisphereGeometry)) {
1011
+ instanceSplitGeometry.push(instance);
1012
+ }
1013
+ }
1014
+ const geometries = [];
1015
+ if (instanceGeometry.length > 0) {
1016
+ geometries.push(combineGeometries(instanceGeometry, "geometry"));
1017
+ }
1018
+ if (instanceSplitGeometry.length > 0) {
1019
+ geometries.push(
1020
+ combineGeometries(instanceSplitGeometry, "westHemisphereGeometry")
1021
+ );
1022
+ geometries.push(
1023
+ combineGeometries(instanceSplitGeometry, "eastHemisphereGeometry")
1024
+ );
1025
+ }
1026
+ return geometries;
1027
+ };
1028
+ var normal = new Cartesian3_default();
1029
+ var v0 = new Cartesian3_default();
1030
+ var v1 = new Cartesian3_default();
1031
+ var v2 = new Cartesian3_default();
1032
+ GeometryPipeline.computeNormal = function(geometry) {
1033
+ if (!defined_default(geometry)) {
1034
+ throw new DeveloperError_default("geometry is required.");
1035
+ }
1036
+ if (!defined_default(geometry.attributes.position) || !defined_default(geometry.attributes.position.values)) {
1037
+ throw new DeveloperError_default(
1038
+ "geometry.attributes.position.values is required."
1039
+ );
1040
+ }
1041
+ if (!defined_default(geometry.indices)) {
1042
+ throw new DeveloperError_default("geometry.indices is required.");
1043
+ }
1044
+ if (geometry.indices.length < 2 || geometry.indices.length % 3 !== 0) {
1045
+ throw new DeveloperError_default(
1046
+ "geometry.indices length must be greater than 0 and be a multiple of 3."
1047
+ );
1048
+ }
1049
+ if (geometry.primitiveType !== PrimitiveType_default.TRIANGLES) {
1050
+ throw new DeveloperError_default(
1051
+ "geometry.primitiveType must be PrimitiveType.TRIANGLES."
1052
+ );
1053
+ }
1054
+ const indices = geometry.indices;
1055
+ const attributes = geometry.attributes;
1056
+ const vertices = attributes.position.values;
1057
+ const numVertices = attributes.position.values.length / 3;
1058
+ const numIndices = indices.length;
1059
+ const normalsPerVertex = new Array(numVertices);
1060
+ const normalsPerTriangle = new Array(numIndices / 3);
1061
+ const normalIndices = new Array(numIndices);
1062
+ let i;
1063
+ for (i = 0; i < numVertices; i++) {
1064
+ normalsPerVertex[i] = {
1065
+ indexOffset: 0,
1066
+ count: 0,
1067
+ currentCount: 0
1068
+ };
1069
+ }
1070
+ let j = 0;
1071
+ for (i = 0; i < numIndices; i += 3) {
1072
+ const i0 = indices[i];
1073
+ const i1 = indices[i + 1];
1074
+ const i2 = indices[i + 2];
1075
+ const i03 = i0 * 3;
1076
+ const i13 = i1 * 3;
1077
+ const i23 = i2 * 3;
1078
+ v0.x = vertices[i03];
1079
+ v0.y = vertices[i03 + 1];
1080
+ v0.z = vertices[i03 + 2];
1081
+ v1.x = vertices[i13];
1082
+ v1.y = vertices[i13 + 1];
1083
+ v1.z = vertices[i13 + 2];
1084
+ v2.x = vertices[i23];
1085
+ v2.y = vertices[i23 + 1];
1086
+ v2.z = vertices[i23 + 2];
1087
+ normalsPerVertex[i0].count++;
1088
+ normalsPerVertex[i1].count++;
1089
+ normalsPerVertex[i2].count++;
1090
+ Cartesian3_default.subtract(v1, v0, v1);
1091
+ Cartesian3_default.subtract(v2, v0, v2);
1092
+ normalsPerTriangle[j] = Cartesian3_default.cross(v1, v2, new Cartesian3_default());
1093
+ j++;
1094
+ }
1095
+ let indexOffset = 0;
1096
+ for (i = 0; i < numVertices; i++) {
1097
+ normalsPerVertex[i].indexOffset += indexOffset;
1098
+ indexOffset += normalsPerVertex[i].count;
1099
+ }
1100
+ j = 0;
1101
+ let vertexNormalData;
1102
+ for (i = 0; i < numIndices; i += 3) {
1103
+ vertexNormalData = normalsPerVertex[indices[i]];
1104
+ let index = vertexNormalData.indexOffset + vertexNormalData.currentCount;
1105
+ normalIndices[index] = j;
1106
+ vertexNormalData.currentCount++;
1107
+ vertexNormalData = normalsPerVertex[indices[i + 1]];
1108
+ index = vertexNormalData.indexOffset + vertexNormalData.currentCount;
1109
+ normalIndices[index] = j;
1110
+ vertexNormalData.currentCount++;
1111
+ vertexNormalData = normalsPerVertex[indices[i + 2]];
1112
+ index = vertexNormalData.indexOffset + vertexNormalData.currentCount;
1113
+ normalIndices[index] = j;
1114
+ vertexNormalData.currentCount++;
1115
+ j++;
1116
+ }
1117
+ const normalValues = new Float32Array(numVertices * 3);
1118
+ for (i = 0; i < numVertices; i++) {
1119
+ const i3 = i * 3;
1120
+ vertexNormalData = normalsPerVertex[i];
1121
+ Cartesian3_default.clone(Cartesian3_default.ZERO, normal);
1122
+ if (vertexNormalData.count > 0) {
1123
+ for (j = 0; j < vertexNormalData.count; j++) {
1124
+ Cartesian3_default.add(
1125
+ normal,
1126
+ normalsPerTriangle[normalIndices[vertexNormalData.indexOffset + j]],
1127
+ normal
1128
+ );
1129
+ }
1130
+ if (Cartesian3_default.equalsEpsilon(Cartesian3_default.ZERO, normal, Math_default.EPSILON10)) {
1131
+ Cartesian3_default.clone(
1132
+ normalsPerTriangle[normalIndices[vertexNormalData.indexOffset]],
1133
+ normal
1134
+ );
1135
+ }
1136
+ }
1137
+ if (Cartesian3_default.equalsEpsilon(Cartesian3_default.ZERO, normal, Math_default.EPSILON10)) {
1138
+ normal.z = 1;
1139
+ }
1140
+ Cartesian3_default.normalize(normal, normal);
1141
+ normalValues[i3] = normal.x;
1142
+ normalValues[i3 + 1] = normal.y;
1143
+ normalValues[i3 + 2] = normal.z;
1144
+ }
1145
+ geometry.attributes.normal = new GeometryAttribute_default({
1146
+ componentDatatype: ComponentDatatype_default.FLOAT,
1147
+ componentsPerAttribute: 3,
1148
+ values: normalValues
1149
+ });
1150
+ return geometry;
1151
+ };
1152
+ var normalScratch = new Cartesian3_default();
1153
+ var normalScale = new Cartesian3_default();
1154
+ var tScratch = new Cartesian3_default();
1155
+ GeometryPipeline.computeTangentAndBitangent = function(geometry) {
1156
+ if (!defined_default(geometry)) {
1157
+ throw new DeveloperError_default("geometry is required.");
1158
+ }
1159
+ const attributes = geometry.attributes;
1160
+ const indices = geometry.indices;
1161
+ if (!defined_default(attributes.position) || !defined_default(attributes.position.values)) {
1162
+ throw new DeveloperError_default(
1163
+ "geometry.attributes.position.values is required."
1164
+ );
1165
+ }
1166
+ if (!defined_default(attributes.normal) || !defined_default(attributes.normal.values)) {
1167
+ throw new DeveloperError_default("geometry.attributes.normal.values is required.");
1168
+ }
1169
+ if (!defined_default(attributes.st) || !defined_default(attributes.st.values)) {
1170
+ throw new DeveloperError_default("geometry.attributes.st.values is required.");
1171
+ }
1172
+ if (!defined_default(indices)) {
1173
+ throw new DeveloperError_default("geometry.indices is required.");
1174
+ }
1175
+ if (indices.length < 2 || indices.length % 3 !== 0) {
1176
+ throw new DeveloperError_default(
1177
+ "geometry.indices length must be greater than 0 and be a multiple of 3."
1178
+ );
1179
+ }
1180
+ if (geometry.primitiveType !== PrimitiveType_default.TRIANGLES) {
1181
+ throw new DeveloperError_default(
1182
+ "geometry.primitiveType must be PrimitiveType.TRIANGLES."
1183
+ );
1184
+ }
1185
+ const vertices = geometry.attributes.position.values;
1186
+ const normals = geometry.attributes.normal.values;
1187
+ const st = geometry.attributes.st.values;
1188
+ const numVertices = geometry.attributes.position.values.length / 3;
1189
+ const numIndices = indices.length;
1190
+ const tan1 = new Array(numVertices * 3);
1191
+ let i;
1192
+ for (i = 0; i < tan1.length; i++) {
1193
+ tan1[i] = 0;
1194
+ }
1195
+ let i03;
1196
+ let i13;
1197
+ let i23;
1198
+ for (i = 0; i < numIndices; i += 3) {
1199
+ const i0 = indices[i];
1200
+ const i1 = indices[i + 1];
1201
+ const i2 = indices[i + 2];
1202
+ i03 = i0 * 3;
1203
+ i13 = i1 * 3;
1204
+ i23 = i2 * 3;
1205
+ const i02 = i0 * 2;
1206
+ const i12 = i1 * 2;
1207
+ const i22 = i2 * 2;
1208
+ const ux = vertices[i03];
1209
+ const uy = vertices[i03 + 1];
1210
+ const uz = vertices[i03 + 2];
1211
+ const wx = st[i02];
1212
+ const wy = st[i02 + 1];
1213
+ const t1 = st[i12 + 1] - wy;
1214
+ const t2 = st[i22 + 1] - wy;
1215
+ const r = 1 / ((st[i12] - wx) * t2 - (st[i22] - wx) * t1);
1216
+ const sdirx = (t2 * (vertices[i13] - ux) - t1 * (vertices[i23] - ux)) * r;
1217
+ const sdiry = (t2 * (vertices[i13 + 1] - uy) - t1 * (vertices[i23 + 1] - uy)) * r;
1218
+ const sdirz = (t2 * (vertices[i13 + 2] - uz) - t1 * (vertices[i23 + 2] - uz)) * r;
1219
+ tan1[i03] += sdirx;
1220
+ tan1[i03 + 1] += sdiry;
1221
+ tan1[i03 + 2] += sdirz;
1222
+ tan1[i13] += sdirx;
1223
+ tan1[i13 + 1] += sdiry;
1224
+ tan1[i13 + 2] += sdirz;
1225
+ tan1[i23] += sdirx;
1226
+ tan1[i23 + 1] += sdiry;
1227
+ tan1[i23 + 2] += sdirz;
1228
+ }
1229
+ const tangentValues = new Float32Array(numVertices * 3);
1230
+ const bitangentValues = new Float32Array(numVertices * 3);
1231
+ for (i = 0; i < numVertices; i++) {
1232
+ i03 = i * 3;
1233
+ i13 = i03 + 1;
1234
+ i23 = i03 + 2;
1235
+ const n = Cartesian3_default.fromArray(normals, i03, normalScratch);
1236
+ const t = Cartesian3_default.fromArray(tan1, i03, tScratch);
1237
+ const scalar = Cartesian3_default.dot(n, t);
1238
+ Cartesian3_default.multiplyByScalar(n, scalar, normalScale);
1239
+ Cartesian3_default.normalize(Cartesian3_default.subtract(t, normalScale, t), t);
1240
+ tangentValues[i03] = t.x;
1241
+ tangentValues[i13] = t.y;
1242
+ tangentValues[i23] = t.z;
1243
+ Cartesian3_default.normalize(Cartesian3_default.cross(n, t, t), t);
1244
+ bitangentValues[i03] = t.x;
1245
+ bitangentValues[i13] = t.y;
1246
+ bitangentValues[i23] = t.z;
1247
+ }
1248
+ geometry.attributes.tangent = new GeometryAttribute_default({
1249
+ componentDatatype: ComponentDatatype_default.FLOAT,
1250
+ componentsPerAttribute: 3,
1251
+ values: tangentValues
1252
+ });
1253
+ geometry.attributes.bitangent = new GeometryAttribute_default({
1254
+ componentDatatype: ComponentDatatype_default.FLOAT,
1255
+ componentsPerAttribute: 3,
1256
+ values: bitangentValues
1257
+ });
1258
+ return geometry;
1259
+ };
1260
+ var scratchCartesian22 = new Cartesian2_default();
1261
+ var toEncode1 = new Cartesian3_default();
1262
+ var toEncode2 = new Cartesian3_default();
1263
+ var toEncode3 = new Cartesian3_default();
1264
+ var encodeResult2 = new Cartesian2_default();
1265
+ GeometryPipeline.compressVertices = function(geometry) {
1266
+ if (!defined_default(geometry)) {
1267
+ throw new DeveloperError_default("geometry is required.");
1268
+ }
1269
+ const extrudeAttribute = geometry.attributes.extrudeDirection;
1270
+ let i;
1271
+ let numVertices;
1272
+ if (defined_default(extrudeAttribute)) {
1273
+ const extrudeDirections = extrudeAttribute.values;
1274
+ numVertices = extrudeDirections.length / 3;
1275
+ const compressedDirections = new Float32Array(numVertices * 2);
1276
+ let i2 = 0;
1277
+ for (i = 0; i < numVertices; ++i) {
1278
+ Cartesian3_default.fromArray(extrudeDirections, i * 3, toEncode1);
1279
+ if (Cartesian3_default.equals(toEncode1, Cartesian3_default.ZERO)) {
1280
+ i2 += 2;
1281
+ continue;
1282
+ }
1283
+ encodeResult2 = AttributeCompression_default.octEncodeInRange(
1284
+ toEncode1,
1285
+ 65535,
1286
+ encodeResult2
1287
+ );
1288
+ compressedDirections[i2++] = encodeResult2.x;
1289
+ compressedDirections[i2++] = encodeResult2.y;
1290
+ }
1291
+ geometry.attributes.compressedAttributes = new GeometryAttribute_default({
1292
+ componentDatatype: ComponentDatatype_default.FLOAT,
1293
+ componentsPerAttribute: 2,
1294
+ values: compressedDirections
1295
+ });
1296
+ delete geometry.attributes.extrudeDirection;
1297
+ return geometry;
1298
+ }
1299
+ const normalAttribute = geometry.attributes.normal;
1300
+ const stAttribute = geometry.attributes.st;
1301
+ const hasNormal = defined_default(normalAttribute);
1302
+ const hasSt = defined_default(stAttribute);
1303
+ if (!hasNormal && !hasSt) {
1304
+ return geometry;
1305
+ }
1306
+ const tangentAttribute = geometry.attributes.tangent;
1307
+ const bitangentAttribute = geometry.attributes.bitangent;
1308
+ const hasTangent = defined_default(tangentAttribute);
1309
+ const hasBitangent = defined_default(bitangentAttribute);
1310
+ let normals;
1311
+ let st;
1312
+ let tangents;
1313
+ let bitangents;
1314
+ if (hasNormal) {
1315
+ normals = normalAttribute.values;
1316
+ }
1317
+ if (hasSt) {
1318
+ st = stAttribute.values;
1319
+ }
1320
+ if (hasTangent) {
1321
+ tangents = tangentAttribute.values;
1322
+ }
1323
+ if (hasBitangent) {
1324
+ bitangents = bitangentAttribute.values;
1325
+ }
1326
+ const length = hasNormal ? normals.length : st.length;
1327
+ const numComponents = hasNormal ? 3 : 2;
1328
+ numVertices = length / numComponents;
1329
+ let compressedLength = numVertices;
1330
+ let numCompressedComponents = hasSt && hasNormal ? 2 : 1;
1331
+ numCompressedComponents += hasTangent || hasBitangent ? 1 : 0;
1332
+ compressedLength *= numCompressedComponents;
1333
+ const compressedAttributes = new Float32Array(compressedLength);
1334
+ let normalIndex = 0;
1335
+ for (i = 0; i < numVertices; ++i) {
1336
+ if (hasSt) {
1337
+ Cartesian2_default.fromArray(st, i * 2, scratchCartesian22);
1338
+ compressedAttributes[normalIndex++] = AttributeCompression_default.compressTextureCoordinates(scratchCartesian22);
1339
+ }
1340
+ const index = i * 3;
1341
+ if (hasNormal && defined_default(tangents) && defined_default(bitangents)) {
1342
+ Cartesian3_default.fromArray(normals, index, toEncode1);
1343
+ Cartesian3_default.fromArray(tangents, index, toEncode2);
1344
+ Cartesian3_default.fromArray(bitangents, index, toEncode3);
1345
+ AttributeCompression_default.octPack(
1346
+ toEncode1,
1347
+ toEncode2,
1348
+ toEncode3,
1349
+ scratchCartesian22
1350
+ );
1351
+ compressedAttributes[normalIndex++] = scratchCartesian22.x;
1352
+ compressedAttributes[normalIndex++] = scratchCartesian22.y;
1353
+ } else {
1354
+ if (hasNormal) {
1355
+ Cartesian3_default.fromArray(normals, index, toEncode1);
1356
+ compressedAttributes[normalIndex++] = AttributeCompression_default.octEncodeFloat(toEncode1);
1357
+ }
1358
+ if (hasTangent) {
1359
+ Cartesian3_default.fromArray(tangents, index, toEncode1);
1360
+ compressedAttributes[normalIndex++] = AttributeCompression_default.octEncodeFloat(toEncode1);
1361
+ }
1362
+ if (hasBitangent) {
1363
+ Cartesian3_default.fromArray(bitangents, index, toEncode1);
1364
+ compressedAttributes[normalIndex++] = AttributeCompression_default.octEncodeFloat(toEncode1);
1365
+ }
1366
+ }
1367
+ }
1368
+ geometry.attributes.compressedAttributes = new GeometryAttribute_default({
1369
+ componentDatatype: ComponentDatatype_default.FLOAT,
1370
+ componentsPerAttribute: numCompressedComponents,
1371
+ values: compressedAttributes
1372
+ });
1373
+ if (hasNormal) {
1374
+ delete geometry.attributes.normal;
1375
+ }
1376
+ if (hasSt) {
1377
+ delete geometry.attributes.st;
1378
+ }
1379
+ if (hasBitangent) {
1380
+ delete geometry.attributes.bitangent;
1381
+ }
1382
+ if (hasTangent) {
1383
+ delete geometry.attributes.tangent;
1384
+ }
1385
+ return geometry;
1386
+ };
1387
+ function indexTriangles(geometry) {
1388
+ if (defined_default(geometry.indices)) {
1389
+ return geometry;
1390
+ }
1391
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
1392
+ if (numberOfVertices < 3) {
1393
+ throw new DeveloperError_default("The number of vertices must be at least three.");
1394
+ }
1395
+ if (numberOfVertices % 3 !== 0) {
1396
+ throw new DeveloperError_default(
1397
+ "The number of vertices must be a multiple of three."
1398
+ );
1399
+ }
1400
+ const indices = IndexDatatype_default.createTypedArray(
1401
+ numberOfVertices,
1402
+ numberOfVertices
1403
+ );
1404
+ for (let i = 0; i < numberOfVertices; ++i) {
1405
+ indices[i] = i;
1406
+ }
1407
+ geometry.indices = indices;
1408
+ return geometry;
1409
+ }
1410
+ function indexTriangleFan(geometry) {
1411
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
1412
+ if (numberOfVertices < 3) {
1413
+ throw new DeveloperError_default("The number of vertices must be at least three.");
1414
+ }
1415
+ const indices = IndexDatatype_default.createTypedArray(
1416
+ numberOfVertices,
1417
+ (numberOfVertices - 2) * 3
1418
+ );
1419
+ indices[0] = 1;
1420
+ indices[1] = 0;
1421
+ indices[2] = 2;
1422
+ let indicesIndex = 3;
1423
+ for (let i = 3; i < numberOfVertices; ++i) {
1424
+ indices[indicesIndex++] = i - 1;
1425
+ indices[indicesIndex++] = 0;
1426
+ indices[indicesIndex++] = i;
1427
+ }
1428
+ geometry.indices = indices;
1429
+ geometry.primitiveType = PrimitiveType_default.TRIANGLES;
1430
+ return geometry;
1431
+ }
1432
+ function indexTriangleStrip(geometry) {
1433
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
1434
+ if (numberOfVertices < 3) {
1435
+ throw new DeveloperError_default("The number of vertices must be at least 3.");
1436
+ }
1437
+ const indices = IndexDatatype_default.createTypedArray(
1438
+ numberOfVertices,
1439
+ (numberOfVertices - 2) * 3
1440
+ );
1441
+ indices[0] = 0;
1442
+ indices[1] = 1;
1443
+ indices[2] = 2;
1444
+ if (numberOfVertices > 3) {
1445
+ indices[3] = 0;
1446
+ indices[4] = 2;
1447
+ indices[5] = 3;
1448
+ }
1449
+ let indicesIndex = 6;
1450
+ for (let i = 3; i < numberOfVertices - 1; i += 2) {
1451
+ indices[indicesIndex++] = i;
1452
+ indices[indicesIndex++] = i - 1;
1453
+ indices[indicesIndex++] = i + 1;
1454
+ if (i + 2 < numberOfVertices) {
1455
+ indices[indicesIndex++] = i;
1456
+ indices[indicesIndex++] = i + 1;
1457
+ indices[indicesIndex++] = i + 2;
1458
+ }
1459
+ }
1460
+ geometry.indices = indices;
1461
+ geometry.primitiveType = PrimitiveType_default.TRIANGLES;
1462
+ return geometry;
1463
+ }
1464
+ function indexLines(geometry) {
1465
+ if (defined_default(geometry.indices)) {
1466
+ return geometry;
1467
+ }
1468
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
1469
+ if (numberOfVertices < 2) {
1470
+ throw new DeveloperError_default("The number of vertices must be at least two.");
1471
+ }
1472
+ if (numberOfVertices % 2 !== 0) {
1473
+ throw new DeveloperError_default("The number of vertices must be a multiple of 2.");
1474
+ }
1475
+ const indices = IndexDatatype_default.createTypedArray(
1476
+ numberOfVertices,
1477
+ numberOfVertices
1478
+ );
1479
+ for (let i = 0; i < numberOfVertices; ++i) {
1480
+ indices[i] = i;
1481
+ }
1482
+ geometry.indices = indices;
1483
+ return geometry;
1484
+ }
1485
+ function indexLineStrip(geometry) {
1486
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
1487
+ if (numberOfVertices < 2) {
1488
+ throw new DeveloperError_default("The number of vertices must be at least two.");
1489
+ }
1490
+ const indices = IndexDatatype_default.createTypedArray(
1491
+ numberOfVertices,
1492
+ (numberOfVertices - 1) * 2
1493
+ );
1494
+ indices[0] = 0;
1495
+ indices[1] = 1;
1496
+ let indicesIndex = 2;
1497
+ for (let i = 2; i < numberOfVertices; ++i) {
1498
+ indices[indicesIndex++] = i - 1;
1499
+ indices[indicesIndex++] = i;
1500
+ }
1501
+ geometry.indices = indices;
1502
+ geometry.primitiveType = PrimitiveType_default.LINES;
1503
+ return geometry;
1504
+ }
1505
+ function indexLineLoop(geometry) {
1506
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
1507
+ if (numberOfVertices < 2) {
1508
+ throw new DeveloperError_default("The number of vertices must be at least two.");
1509
+ }
1510
+ const indices = IndexDatatype_default.createTypedArray(
1511
+ numberOfVertices,
1512
+ numberOfVertices * 2
1513
+ );
1514
+ indices[0] = 0;
1515
+ indices[1] = 1;
1516
+ let indicesIndex = 2;
1517
+ for (let i = 2; i < numberOfVertices; ++i) {
1518
+ indices[indicesIndex++] = i - 1;
1519
+ indices[indicesIndex++] = i;
1520
+ }
1521
+ indices[indicesIndex++] = numberOfVertices - 1;
1522
+ indices[indicesIndex] = 0;
1523
+ geometry.indices = indices;
1524
+ geometry.primitiveType = PrimitiveType_default.LINES;
1525
+ return geometry;
1526
+ }
1527
+ function indexPrimitive(geometry) {
1528
+ switch (geometry.primitiveType) {
1529
+ case PrimitiveType_default.TRIANGLE_FAN:
1530
+ return indexTriangleFan(geometry);
1531
+ case PrimitiveType_default.TRIANGLE_STRIP:
1532
+ return indexTriangleStrip(geometry);
1533
+ case PrimitiveType_default.TRIANGLES:
1534
+ return indexTriangles(geometry);
1535
+ case PrimitiveType_default.LINE_STRIP:
1536
+ return indexLineStrip(geometry);
1537
+ case PrimitiveType_default.LINE_LOOP:
1538
+ return indexLineLoop(geometry);
1539
+ case PrimitiveType_default.LINES:
1540
+ return indexLines(geometry);
1541
+ }
1542
+ return geometry;
1543
+ }
1544
+ function offsetPointFromXZPlane(p, isBehind) {
1545
+ if (Math.abs(p.y) < Math_default.EPSILON6) {
1546
+ if (isBehind) {
1547
+ p.y = -Math_default.EPSILON6;
1548
+ } else {
1549
+ p.y = Math_default.EPSILON6;
1550
+ }
1551
+ }
1552
+ }
1553
+ function offsetTriangleFromXZPlane(p0, p1, p2) {
1554
+ if (p0.y !== 0 && p1.y !== 0 && p2.y !== 0) {
1555
+ offsetPointFromXZPlane(p0, p0.y < 0);
1556
+ offsetPointFromXZPlane(p1, p1.y < 0);
1557
+ offsetPointFromXZPlane(p2, p2.y < 0);
1558
+ return;
1559
+ }
1560
+ const p0y = Math.abs(p0.y);
1561
+ const p1y = Math.abs(p1.y);
1562
+ const p2y = Math.abs(p2.y);
1563
+ let sign;
1564
+ if (p0y > p1y) {
1565
+ if (p0y > p2y) {
1566
+ sign = Math_default.sign(p0.y);
1567
+ } else {
1568
+ sign = Math_default.sign(p2.y);
1569
+ }
1570
+ } else if (p1y > p2y) {
1571
+ sign = Math_default.sign(p1.y);
1572
+ } else {
1573
+ sign = Math_default.sign(p2.y);
1574
+ }
1575
+ const isBehind = sign < 0;
1576
+ offsetPointFromXZPlane(p0, isBehind);
1577
+ offsetPointFromXZPlane(p1, isBehind);
1578
+ offsetPointFromXZPlane(p2, isBehind);
1579
+ }
1580
+ var c3 = new Cartesian3_default();
1581
+ function getXZIntersectionOffsetPoints(p, p1, u12, v12) {
1582
+ Cartesian3_default.add(
1583
+ p,
1584
+ Cartesian3_default.multiplyByScalar(
1585
+ Cartesian3_default.subtract(p1, p, c3),
1586
+ p.y / (p.y - p1.y),
1587
+ c3
1588
+ ),
1589
+ u12
1590
+ );
1591
+ Cartesian3_default.clone(u12, v12);
1592
+ offsetPointFromXZPlane(u12, true);
1593
+ offsetPointFromXZPlane(v12, false);
1594
+ }
1595
+ var u1 = new Cartesian3_default();
1596
+ var u2 = new Cartesian3_default();
1597
+ var q1 = new Cartesian3_default();
1598
+ var q2 = new Cartesian3_default();
1599
+ var splitTriangleResult = {
1600
+ positions: new Array(7),
1601
+ indices: new Array(3 * 3)
1602
+ };
1603
+ function splitTriangle(p0, p1, p2) {
1604
+ if (p0.x >= 0 || p1.x >= 0 || p2.x >= 0) {
1605
+ return void 0;
1606
+ }
1607
+ offsetTriangleFromXZPlane(p0, p1, p2);
1608
+ const p0Behind = p0.y < 0;
1609
+ const p1Behind = p1.y < 0;
1610
+ const p2Behind = p2.y < 0;
1611
+ let numBehind = 0;
1612
+ numBehind += p0Behind ? 1 : 0;
1613
+ numBehind += p1Behind ? 1 : 0;
1614
+ numBehind += p2Behind ? 1 : 0;
1615
+ const indices = splitTriangleResult.indices;
1616
+ if (numBehind === 1) {
1617
+ indices[1] = 3;
1618
+ indices[2] = 4;
1619
+ indices[5] = 6;
1620
+ indices[7] = 6;
1621
+ indices[8] = 5;
1622
+ if (p0Behind) {
1623
+ getXZIntersectionOffsetPoints(p0, p1, u1, q1);
1624
+ getXZIntersectionOffsetPoints(p0, p2, u2, q2);
1625
+ indices[0] = 0;
1626
+ indices[3] = 1;
1627
+ indices[4] = 2;
1628
+ indices[6] = 1;
1629
+ } else if (p1Behind) {
1630
+ getXZIntersectionOffsetPoints(p1, p2, u1, q1);
1631
+ getXZIntersectionOffsetPoints(p1, p0, u2, q2);
1632
+ indices[0] = 1;
1633
+ indices[3] = 2;
1634
+ indices[4] = 0;
1635
+ indices[6] = 2;
1636
+ } else if (p2Behind) {
1637
+ getXZIntersectionOffsetPoints(p2, p0, u1, q1);
1638
+ getXZIntersectionOffsetPoints(p2, p1, u2, q2);
1639
+ indices[0] = 2;
1640
+ indices[3] = 0;
1641
+ indices[4] = 1;
1642
+ indices[6] = 0;
1643
+ }
1644
+ } else if (numBehind === 2) {
1645
+ indices[2] = 4;
1646
+ indices[4] = 4;
1647
+ indices[5] = 3;
1648
+ indices[7] = 5;
1649
+ indices[8] = 6;
1650
+ if (!p0Behind) {
1651
+ getXZIntersectionOffsetPoints(p0, p1, u1, q1);
1652
+ getXZIntersectionOffsetPoints(p0, p2, u2, q2);
1653
+ indices[0] = 1;
1654
+ indices[1] = 2;
1655
+ indices[3] = 1;
1656
+ indices[6] = 0;
1657
+ } else if (!p1Behind) {
1658
+ getXZIntersectionOffsetPoints(p1, p2, u1, q1);
1659
+ getXZIntersectionOffsetPoints(p1, p0, u2, q2);
1660
+ indices[0] = 2;
1661
+ indices[1] = 0;
1662
+ indices[3] = 2;
1663
+ indices[6] = 1;
1664
+ } else if (!p2Behind) {
1665
+ getXZIntersectionOffsetPoints(p2, p0, u1, q1);
1666
+ getXZIntersectionOffsetPoints(p2, p1, u2, q2);
1667
+ indices[0] = 0;
1668
+ indices[1] = 1;
1669
+ indices[3] = 0;
1670
+ indices[6] = 2;
1671
+ }
1672
+ }
1673
+ const positions = splitTriangleResult.positions;
1674
+ positions[0] = p0;
1675
+ positions[1] = p1;
1676
+ positions[2] = p2;
1677
+ positions.length = 3;
1678
+ if (numBehind === 1 || numBehind === 2) {
1679
+ positions[3] = u1;
1680
+ positions[4] = u2;
1681
+ positions[5] = q1;
1682
+ positions[6] = q2;
1683
+ positions.length = 7;
1684
+ }
1685
+ return splitTriangleResult;
1686
+ }
1687
+ function updateGeometryAfterSplit(geometry, computeBoundingSphere) {
1688
+ const attributes = geometry.attributes;
1689
+ if (attributes.position.values.length === 0) {
1690
+ return void 0;
1691
+ }
1692
+ for (const property in attributes) {
1693
+ if (attributes.hasOwnProperty(property) && defined_default(attributes[property]) && defined_default(attributes[property].values)) {
1694
+ const attribute = attributes[property];
1695
+ attribute.values = ComponentDatatype_default.createTypedArray(
1696
+ attribute.componentDatatype,
1697
+ attribute.values
1698
+ );
1699
+ }
1700
+ }
1701
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
1702
+ geometry.indices = IndexDatatype_default.createTypedArray(
1703
+ numberOfVertices,
1704
+ geometry.indices
1705
+ );
1706
+ if (computeBoundingSphere) {
1707
+ geometry.boundingSphere = BoundingSphere_default.fromVertices(
1708
+ attributes.position.values
1709
+ );
1710
+ }
1711
+ return geometry;
1712
+ }
1713
+ function copyGeometryForSplit(geometry) {
1714
+ const attributes = geometry.attributes;
1715
+ const copiedAttributes = {};
1716
+ for (const property in attributes) {
1717
+ if (attributes.hasOwnProperty(property) && defined_default(attributes[property]) && defined_default(attributes[property].values)) {
1718
+ const attribute = attributes[property];
1719
+ copiedAttributes[property] = new GeometryAttribute_default({
1720
+ componentDatatype: attribute.componentDatatype,
1721
+ componentsPerAttribute: attribute.componentsPerAttribute,
1722
+ normalize: attribute.normalize,
1723
+ values: []
1724
+ });
1725
+ }
1726
+ }
1727
+ return new Geometry_default({
1728
+ attributes: copiedAttributes,
1729
+ indices: [],
1730
+ primitiveType: geometry.primitiveType
1731
+ });
1732
+ }
1733
+ function updateInstanceAfterSplit(instance, westGeometry, eastGeometry) {
1734
+ const computeBoundingSphere = defined_default(instance.geometry.boundingSphere);
1735
+ westGeometry = updateGeometryAfterSplit(westGeometry, computeBoundingSphere);
1736
+ eastGeometry = updateGeometryAfterSplit(eastGeometry, computeBoundingSphere);
1737
+ if (defined_default(eastGeometry) && !defined_default(westGeometry)) {
1738
+ instance.geometry = eastGeometry;
1739
+ } else if (!defined_default(eastGeometry) && defined_default(westGeometry)) {
1740
+ instance.geometry = westGeometry;
1741
+ } else {
1742
+ instance.westHemisphereGeometry = westGeometry;
1743
+ instance.eastHemisphereGeometry = eastGeometry;
1744
+ instance.geometry = void 0;
1745
+ }
1746
+ }
1747
+ function generateBarycentricInterpolateFunction(CartesianType, numberOfComponents) {
1748
+ const v0Scratch = new CartesianType();
1749
+ const v1Scratch = new CartesianType();
1750
+ const v2Scratch = new CartesianType();
1751
+ return function(i0, i1, i2, coords, sourceValues, currentValues, insertedIndex, normalize) {
1752
+ const v02 = CartesianType.fromArray(
1753
+ sourceValues,
1754
+ i0 * numberOfComponents,
1755
+ v0Scratch
1756
+ );
1757
+ const v12 = CartesianType.fromArray(
1758
+ sourceValues,
1759
+ i1 * numberOfComponents,
1760
+ v1Scratch
1761
+ );
1762
+ const v22 = CartesianType.fromArray(
1763
+ sourceValues,
1764
+ i2 * numberOfComponents,
1765
+ v2Scratch
1766
+ );
1767
+ CartesianType.multiplyByScalar(v02, coords.x, v02);
1768
+ CartesianType.multiplyByScalar(v12, coords.y, v12);
1769
+ CartesianType.multiplyByScalar(v22, coords.z, v22);
1770
+ const value = CartesianType.add(v02, v12, v02);
1771
+ CartesianType.add(value, v22, value);
1772
+ if (normalize) {
1773
+ CartesianType.normalize(value, value);
1774
+ }
1775
+ CartesianType.pack(
1776
+ value,
1777
+ currentValues,
1778
+ insertedIndex * numberOfComponents
1779
+ );
1780
+ };
1781
+ }
1782
+ var interpolateAndPackCartesian4 = generateBarycentricInterpolateFunction(
1783
+ Cartesian4_default,
1784
+ 4
1785
+ );
1786
+ var interpolateAndPackCartesian3 = generateBarycentricInterpolateFunction(
1787
+ Cartesian3_default,
1788
+ 3
1789
+ );
1790
+ var interpolateAndPackCartesian2 = generateBarycentricInterpolateFunction(
1791
+ Cartesian2_default,
1792
+ 2
1793
+ );
1794
+ var interpolateAndPackBoolean = function(i0, i1, i2, coords, sourceValues, currentValues, insertedIndex) {
1795
+ const v12 = sourceValues[i0] * coords.x;
1796
+ const v22 = sourceValues[i1] * coords.y;
1797
+ const v3 = sourceValues[i2] * coords.z;
1798
+ currentValues[insertedIndex] = v12 + v22 + v3 > Math_default.EPSILON6 ? 1 : 0;
1799
+ };
1800
+ var p0Scratch = new Cartesian3_default();
1801
+ var p1Scratch = new Cartesian3_default();
1802
+ var p2Scratch = new Cartesian3_default();
1803
+ var barycentricScratch = new Cartesian3_default();
1804
+ function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, applyOffset, currentAttributes, customAttributeNames, customAttributesLength, allAttributes, insertedIndex) {
1805
+ if (!defined_default(normals) && !defined_default(tangents) && !defined_default(bitangents) && !defined_default(texCoords) && !defined_default(extrudeDirections) && customAttributesLength === 0) {
1806
+ return;
1807
+ }
1808
+ const p0 = Cartesian3_default.fromArray(positions, i0 * 3, p0Scratch);
1809
+ const p1 = Cartesian3_default.fromArray(positions, i1 * 3, p1Scratch);
1810
+ const p2 = Cartesian3_default.fromArray(positions, i2 * 3, p2Scratch);
1811
+ const coords = barycentricCoordinates_default(point, p0, p1, p2, barycentricScratch);
1812
+ if (!defined_default(coords)) {
1813
+ return;
1814
+ }
1815
+ if (defined_default(normals)) {
1816
+ interpolateAndPackCartesian3(
1817
+ i0,
1818
+ i1,
1819
+ i2,
1820
+ coords,
1821
+ normals,
1822
+ currentAttributes.normal.values,
1823
+ insertedIndex,
1824
+ true
1825
+ );
1826
+ }
1827
+ if (defined_default(extrudeDirections)) {
1828
+ const d0 = Cartesian3_default.fromArray(extrudeDirections, i0 * 3, p0Scratch);
1829
+ const d1 = Cartesian3_default.fromArray(extrudeDirections, i1 * 3, p1Scratch);
1830
+ const d2 = Cartesian3_default.fromArray(extrudeDirections, i2 * 3, p2Scratch);
1831
+ Cartesian3_default.multiplyByScalar(d0, coords.x, d0);
1832
+ Cartesian3_default.multiplyByScalar(d1, coords.y, d1);
1833
+ Cartesian3_default.multiplyByScalar(d2, coords.z, d2);
1834
+ let direction;
1835
+ if (!Cartesian3_default.equals(d0, Cartesian3_default.ZERO) || !Cartesian3_default.equals(d1, Cartesian3_default.ZERO) || !Cartesian3_default.equals(d2, Cartesian3_default.ZERO)) {
1836
+ direction = Cartesian3_default.add(d0, d1, d0);
1837
+ Cartesian3_default.add(direction, d2, direction);
1838
+ Cartesian3_default.normalize(direction, direction);
1839
+ } else {
1840
+ direction = p0Scratch;
1841
+ direction.x = 0;
1842
+ direction.y = 0;
1843
+ direction.z = 0;
1844
+ }
1845
+ Cartesian3_default.pack(
1846
+ direction,
1847
+ currentAttributes.extrudeDirection.values,
1848
+ insertedIndex * 3
1849
+ );
1850
+ }
1851
+ if (defined_default(applyOffset)) {
1852
+ interpolateAndPackBoolean(
1853
+ i0,
1854
+ i1,
1855
+ i2,
1856
+ coords,
1857
+ applyOffset,
1858
+ currentAttributes.applyOffset.values,
1859
+ insertedIndex
1860
+ );
1861
+ }
1862
+ if (defined_default(tangents)) {
1863
+ interpolateAndPackCartesian3(
1864
+ i0,
1865
+ i1,
1866
+ i2,
1867
+ coords,
1868
+ tangents,
1869
+ currentAttributes.tangent.values,
1870
+ insertedIndex,
1871
+ true
1872
+ );
1873
+ }
1874
+ if (defined_default(bitangents)) {
1875
+ interpolateAndPackCartesian3(
1876
+ i0,
1877
+ i1,
1878
+ i2,
1879
+ coords,
1880
+ bitangents,
1881
+ currentAttributes.bitangent.values,
1882
+ insertedIndex,
1883
+ true
1884
+ );
1885
+ }
1886
+ if (defined_default(texCoords)) {
1887
+ interpolateAndPackCartesian2(
1888
+ i0,
1889
+ i1,
1890
+ i2,
1891
+ coords,
1892
+ texCoords,
1893
+ currentAttributes.st.values,
1894
+ insertedIndex
1895
+ );
1896
+ }
1897
+ if (customAttributesLength > 0) {
1898
+ for (let i = 0; i < customAttributesLength; i++) {
1899
+ const attributeName = customAttributeNames[i];
1900
+ genericInterpolate(
1901
+ i0,
1902
+ i1,
1903
+ i2,
1904
+ coords,
1905
+ insertedIndex,
1906
+ allAttributes[attributeName],
1907
+ currentAttributes[attributeName]
1908
+ );
1909
+ }
1910
+ }
1911
+ }
1912
+ function genericInterpolate(i0, i1, i2, coords, insertedIndex, sourceAttribute, currentAttribute) {
1913
+ const componentsPerAttribute = sourceAttribute.componentsPerAttribute;
1914
+ const sourceValues = sourceAttribute.values;
1915
+ const currentValues = currentAttribute.values;
1916
+ switch (componentsPerAttribute) {
1917
+ case 4:
1918
+ interpolateAndPackCartesian4(
1919
+ i0,
1920
+ i1,
1921
+ i2,
1922
+ coords,
1923
+ sourceValues,
1924
+ currentValues,
1925
+ insertedIndex,
1926
+ false
1927
+ );
1928
+ break;
1929
+ case 3:
1930
+ interpolateAndPackCartesian3(
1931
+ i0,
1932
+ i1,
1933
+ i2,
1934
+ coords,
1935
+ sourceValues,
1936
+ currentValues,
1937
+ insertedIndex,
1938
+ false
1939
+ );
1940
+ break;
1941
+ case 2:
1942
+ interpolateAndPackCartesian2(
1943
+ i0,
1944
+ i1,
1945
+ i2,
1946
+ coords,
1947
+ sourceValues,
1948
+ currentValues,
1949
+ insertedIndex,
1950
+ false
1951
+ );
1952
+ break;
1953
+ default:
1954
+ currentValues[insertedIndex] = sourceValues[i0] * coords.x + sourceValues[i1] * coords.y + sourceValues[i2] * coords.z;
1955
+ }
1956
+ }
1957
+ function insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, currentIndex, point) {
1958
+ const insertIndex = currentAttributes.position.values.length / 3;
1959
+ if (currentIndex !== -1) {
1960
+ const prevIndex = indices[currentIndex];
1961
+ const newIndex = currentIndexMap[prevIndex];
1962
+ if (newIndex === -1) {
1963
+ currentIndexMap[prevIndex] = insertIndex;
1964
+ currentAttributes.position.values.push(point.x, point.y, point.z);
1965
+ currentIndices.push(insertIndex);
1966
+ return insertIndex;
1967
+ }
1968
+ currentIndices.push(newIndex);
1969
+ return newIndex;
1970
+ }
1971
+ currentAttributes.position.values.push(point.x, point.y, point.z);
1972
+ currentIndices.push(insertIndex);
1973
+ return insertIndex;
1974
+ }
1975
+ var NAMED_ATTRIBUTES = {
1976
+ position: true,
1977
+ normal: true,
1978
+ bitangent: true,
1979
+ tangent: true,
1980
+ st: true,
1981
+ extrudeDirection: true,
1982
+ applyOffset: true
1983
+ };
1984
+ function splitLongitudeTriangles(instance) {
1985
+ const geometry = instance.geometry;
1986
+ const attributes = geometry.attributes;
1987
+ const positions = attributes.position.values;
1988
+ const normals = defined_default(attributes.normal) ? attributes.normal.values : void 0;
1989
+ const bitangents = defined_default(attributes.bitangent) ? attributes.bitangent.values : void 0;
1990
+ const tangents = defined_default(attributes.tangent) ? attributes.tangent.values : void 0;
1991
+ const texCoords = defined_default(attributes.st) ? attributes.st.values : void 0;
1992
+ const extrudeDirections = defined_default(attributes.extrudeDirection) ? attributes.extrudeDirection.values : void 0;
1993
+ const applyOffset = defined_default(attributes.applyOffset) ? attributes.applyOffset.values : void 0;
1994
+ const indices = geometry.indices;
1995
+ const customAttributeNames = [];
1996
+ for (const attributeName in attributes) {
1997
+ if (attributes.hasOwnProperty(attributeName) && !NAMED_ATTRIBUTES[attributeName] && defined_default(attributes[attributeName])) {
1998
+ customAttributeNames.push(attributeName);
1999
+ }
2000
+ }
2001
+ const customAttributesLength = customAttributeNames.length;
2002
+ const eastGeometry = copyGeometryForSplit(geometry);
2003
+ const westGeometry = copyGeometryForSplit(geometry);
2004
+ let currentAttributes;
2005
+ let currentIndices;
2006
+ let currentIndexMap;
2007
+ let insertedIndex;
2008
+ let i;
2009
+ const westGeometryIndexMap = [];
2010
+ westGeometryIndexMap.length = positions.length / 3;
2011
+ const eastGeometryIndexMap = [];
2012
+ eastGeometryIndexMap.length = positions.length / 3;
2013
+ for (i = 0; i < westGeometryIndexMap.length; ++i) {
2014
+ westGeometryIndexMap[i] = -1;
2015
+ eastGeometryIndexMap[i] = -1;
2016
+ }
2017
+ const len = indices.length;
2018
+ for (i = 0; i < len; i += 3) {
2019
+ const i0 = indices[i];
2020
+ const i1 = indices[i + 1];
2021
+ const i2 = indices[i + 2];
2022
+ let p0 = Cartesian3_default.fromArray(positions, i0 * 3);
2023
+ let p1 = Cartesian3_default.fromArray(positions, i1 * 3);
2024
+ let p2 = Cartesian3_default.fromArray(positions, i2 * 3);
2025
+ const result = splitTriangle(p0, p1, p2);
2026
+ if (defined_default(result) && result.positions.length > 3) {
2027
+ const resultPositions = result.positions;
2028
+ const resultIndices = result.indices;
2029
+ const resultLength = resultIndices.length;
2030
+ for (let j = 0; j < resultLength; ++j) {
2031
+ const resultIndex = resultIndices[j];
2032
+ const point = resultPositions[resultIndex];
2033
+ if (point.y < 0) {
2034
+ currentAttributes = westGeometry.attributes;
2035
+ currentIndices = westGeometry.indices;
2036
+ currentIndexMap = westGeometryIndexMap;
2037
+ } else {
2038
+ currentAttributes = eastGeometry.attributes;
2039
+ currentIndices = eastGeometry.indices;
2040
+ currentIndexMap = eastGeometryIndexMap;
2041
+ }
2042
+ insertedIndex = insertSplitPoint(
2043
+ currentAttributes,
2044
+ currentIndices,
2045
+ currentIndexMap,
2046
+ indices,
2047
+ resultIndex < 3 ? i + resultIndex : -1,
2048
+ point
2049
+ );
2050
+ computeTriangleAttributes(
2051
+ i0,
2052
+ i1,
2053
+ i2,
2054
+ point,
2055
+ positions,
2056
+ normals,
2057
+ tangents,
2058
+ bitangents,
2059
+ texCoords,
2060
+ extrudeDirections,
2061
+ applyOffset,
2062
+ currentAttributes,
2063
+ customAttributeNames,
2064
+ customAttributesLength,
2065
+ attributes,
2066
+ insertedIndex
2067
+ );
2068
+ }
2069
+ } else {
2070
+ if (defined_default(result)) {
2071
+ p0 = result.positions[0];
2072
+ p1 = result.positions[1];
2073
+ p2 = result.positions[2];
2074
+ }
2075
+ if (p0.y < 0) {
2076
+ currentAttributes = westGeometry.attributes;
2077
+ currentIndices = westGeometry.indices;
2078
+ currentIndexMap = westGeometryIndexMap;
2079
+ } else {
2080
+ currentAttributes = eastGeometry.attributes;
2081
+ currentIndices = eastGeometry.indices;
2082
+ currentIndexMap = eastGeometryIndexMap;
2083
+ }
2084
+ insertedIndex = insertSplitPoint(
2085
+ currentAttributes,
2086
+ currentIndices,
2087
+ currentIndexMap,
2088
+ indices,
2089
+ i,
2090
+ p0
2091
+ );
2092
+ computeTriangleAttributes(
2093
+ i0,
2094
+ i1,
2095
+ i2,
2096
+ p0,
2097
+ positions,
2098
+ normals,
2099
+ tangents,
2100
+ bitangents,
2101
+ texCoords,
2102
+ extrudeDirections,
2103
+ applyOffset,
2104
+ currentAttributes,
2105
+ customAttributeNames,
2106
+ customAttributesLength,
2107
+ attributes,
2108
+ insertedIndex
2109
+ );
2110
+ insertedIndex = insertSplitPoint(
2111
+ currentAttributes,
2112
+ currentIndices,
2113
+ currentIndexMap,
2114
+ indices,
2115
+ i + 1,
2116
+ p1
2117
+ );
2118
+ computeTriangleAttributes(
2119
+ i0,
2120
+ i1,
2121
+ i2,
2122
+ p1,
2123
+ positions,
2124
+ normals,
2125
+ tangents,
2126
+ bitangents,
2127
+ texCoords,
2128
+ extrudeDirections,
2129
+ applyOffset,
2130
+ currentAttributes,
2131
+ customAttributeNames,
2132
+ customAttributesLength,
2133
+ attributes,
2134
+ insertedIndex
2135
+ );
2136
+ insertedIndex = insertSplitPoint(
2137
+ currentAttributes,
2138
+ currentIndices,
2139
+ currentIndexMap,
2140
+ indices,
2141
+ i + 2,
2142
+ p2
2143
+ );
2144
+ computeTriangleAttributes(
2145
+ i0,
2146
+ i1,
2147
+ i2,
2148
+ p2,
2149
+ positions,
2150
+ normals,
2151
+ tangents,
2152
+ bitangents,
2153
+ texCoords,
2154
+ extrudeDirections,
2155
+ applyOffset,
2156
+ currentAttributes,
2157
+ customAttributeNames,
2158
+ customAttributesLength,
2159
+ attributes,
2160
+ insertedIndex
2161
+ );
2162
+ }
2163
+ }
2164
+ updateInstanceAfterSplit(instance, westGeometry, eastGeometry);
2165
+ }
2166
+ var xzPlane = Plane_default.fromPointNormal(Cartesian3_default.ZERO, Cartesian3_default.UNIT_Y);
2167
+ var offsetScratch = new Cartesian3_default();
2168
+ var offsetPointScratch = new Cartesian3_default();
2169
+ function computeLineAttributes(i0, i1, point, positions, insertIndex, currentAttributes, applyOffset) {
2170
+ if (!defined_default(applyOffset)) {
2171
+ return;
2172
+ }
2173
+ const p0 = Cartesian3_default.fromArray(positions, i0 * 3, p0Scratch);
2174
+ if (Cartesian3_default.equalsEpsilon(p0, point, Math_default.EPSILON10)) {
2175
+ currentAttributes.applyOffset.values[insertIndex] = applyOffset[i0];
2176
+ } else {
2177
+ currentAttributes.applyOffset.values[insertIndex] = applyOffset[i1];
2178
+ }
2179
+ }
2180
+ function splitLongitudeLines(instance) {
2181
+ const geometry = instance.geometry;
2182
+ const attributes = geometry.attributes;
2183
+ const positions = attributes.position.values;
2184
+ const applyOffset = defined_default(attributes.applyOffset) ? attributes.applyOffset.values : void 0;
2185
+ const indices = geometry.indices;
2186
+ const eastGeometry = copyGeometryForSplit(geometry);
2187
+ const westGeometry = copyGeometryForSplit(geometry);
2188
+ let i;
2189
+ const length = indices.length;
2190
+ const westGeometryIndexMap = [];
2191
+ westGeometryIndexMap.length = positions.length / 3;
2192
+ const eastGeometryIndexMap = [];
2193
+ eastGeometryIndexMap.length = positions.length / 3;
2194
+ for (i = 0; i < westGeometryIndexMap.length; ++i) {
2195
+ westGeometryIndexMap[i] = -1;
2196
+ eastGeometryIndexMap[i] = -1;
2197
+ }
2198
+ for (i = 0; i < length; i += 2) {
2199
+ const i0 = indices[i];
2200
+ const i1 = indices[i + 1];
2201
+ const p0 = Cartesian3_default.fromArray(positions, i0 * 3, p0Scratch);
2202
+ const p1 = Cartesian3_default.fromArray(positions, i1 * 3, p1Scratch);
2203
+ let insertIndex;
2204
+ if (Math.abs(p0.y) < Math_default.EPSILON6) {
2205
+ if (p0.y < 0) {
2206
+ p0.y = -Math_default.EPSILON6;
2207
+ } else {
2208
+ p0.y = Math_default.EPSILON6;
2209
+ }
2210
+ }
2211
+ if (Math.abs(p1.y) < Math_default.EPSILON6) {
2212
+ if (p1.y < 0) {
2213
+ p1.y = -Math_default.EPSILON6;
2214
+ } else {
2215
+ p1.y = Math_default.EPSILON6;
2216
+ }
2217
+ }
2218
+ let p0Attributes = eastGeometry.attributes;
2219
+ let p0Indices = eastGeometry.indices;
2220
+ let p0IndexMap = eastGeometryIndexMap;
2221
+ let p1Attributes = westGeometry.attributes;
2222
+ let p1Indices = westGeometry.indices;
2223
+ let p1IndexMap = westGeometryIndexMap;
2224
+ const intersection = IntersectionTests_default.lineSegmentPlane(
2225
+ p0,
2226
+ p1,
2227
+ xzPlane,
2228
+ p2Scratch
2229
+ );
2230
+ if (defined_default(intersection)) {
2231
+ const offset = Cartesian3_default.multiplyByScalar(
2232
+ Cartesian3_default.UNIT_Y,
2233
+ 5 * Math_default.EPSILON9,
2234
+ offsetScratch
2235
+ );
2236
+ if (p0.y < 0) {
2237
+ Cartesian3_default.negate(offset, offset);
2238
+ p0Attributes = westGeometry.attributes;
2239
+ p0Indices = westGeometry.indices;
2240
+ p0IndexMap = westGeometryIndexMap;
2241
+ p1Attributes = eastGeometry.attributes;
2242
+ p1Indices = eastGeometry.indices;
2243
+ p1IndexMap = eastGeometryIndexMap;
2244
+ }
2245
+ const offsetPoint = Cartesian3_default.add(
2246
+ intersection,
2247
+ offset,
2248
+ offsetPointScratch
2249
+ );
2250
+ insertIndex = insertSplitPoint(
2251
+ p0Attributes,
2252
+ p0Indices,
2253
+ p0IndexMap,
2254
+ indices,
2255
+ i,
2256
+ p0
2257
+ );
2258
+ computeLineAttributes(
2259
+ i0,
2260
+ i1,
2261
+ p0,
2262
+ positions,
2263
+ insertIndex,
2264
+ p0Attributes,
2265
+ applyOffset
2266
+ );
2267
+ insertIndex = insertSplitPoint(
2268
+ p0Attributes,
2269
+ p0Indices,
2270
+ p0IndexMap,
2271
+ indices,
2272
+ -1,
2273
+ offsetPoint
2274
+ );
2275
+ computeLineAttributes(
2276
+ i0,
2277
+ i1,
2278
+ offsetPoint,
2279
+ positions,
2280
+ insertIndex,
2281
+ p0Attributes,
2282
+ applyOffset
2283
+ );
2284
+ Cartesian3_default.negate(offset, offset);
2285
+ Cartesian3_default.add(intersection, offset, offsetPoint);
2286
+ insertIndex = insertSplitPoint(
2287
+ p1Attributes,
2288
+ p1Indices,
2289
+ p1IndexMap,
2290
+ indices,
2291
+ -1,
2292
+ offsetPoint
2293
+ );
2294
+ computeLineAttributes(
2295
+ i0,
2296
+ i1,
2297
+ offsetPoint,
2298
+ positions,
2299
+ insertIndex,
2300
+ p1Attributes,
2301
+ applyOffset
2302
+ );
2303
+ insertIndex = insertSplitPoint(
2304
+ p1Attributes,
2305
+ p1Indices,
2306
+ p1IndexMap,
2307
+ indices,
2308
+ i + 1,
2309
+ p1
2310
+ );
2311
+ computeLineAttributes(
2312
+ i0,
2313
+ i1,
2314
+ p1,
2315
+ positions,
2316
+ insertIndex,
2317
+ p1Attributes,
2318
+ applyOffset
2319
+ );
2320
+ } else {
2321
+ let currentAttributes;
2322
+ let currentIndices;
2323
+ let currentIndexMap;
2324
+ if (p0.y < 0) {
2325
+ currentAttributes = westGeometry.attributes;
2326
+ currentIndices = westGeometry.indices;
2327
+ currentIndexMap = westGeometryIndexMap;
2328
+ } else {
2329
+ currentAttributes = eastGeometry.attributes;
2330
+ currentIndices = eastGeometry.indices;
2331
+ currentIndexMap = eastGeometryIndexMap;
2332
+ }
2333
+ insertIndex = insertSplitPoint(
2334
+ currentAttributes,
2335
+ currentIndices,
2336
+ currentIndexMap,
2337
+ indices,
2338
+ i,
2339
+ p0
2340
+ );
2341
+ computeLineAttributes(
2342
+ i0,
2343
+ i1,
2344
+ p0,
2345
+ positions,
2346
+ insertIndex,
2347
+ currentAttributes,
2348
+ applyOffset
2349
+ );
2350
+ insertIndex = insertSplitPoint(
2351
+ currentAttributes,
2352
+ currentIndices,
2353
+ currentIndexMap,
2354
+ indices,
2355
+ i + 1,
2356
+ p1
2357
+ );
2358
+ computeLineAttributes(
2359
+ i0,
2360
+ i1,
2361
+ p1,
2362
+ positions,
2363
+ insertIndex,
2364
+ currentAttributes,
2365
+ applyOffset
2366
+ );
2367
+ }
2368
+ }
2369
+ updateInstanceAfterSplit(instance, westGeometry, eastGeometry);
2370
+ }
2371
+ var cartesian2Scratch0 = new Cartesian2_default();
2372
+ var cartesian2Scratch1 = new Cartesian2_default();
2373
+ var cartesian3Scratch0 = new Cartesian3_default();
2374
+ var cartesian3Scratch2 = new Cartesian3_default();
2375
+ var cartesian3Scratch3 = new Cartesian3_default();
2376
+ var cartesian3Scratch4 = new Cartesian3_default();
2377
+ var cartesian3Scratch5 = new Cartesian3_default();
2378
+ var cartesian3Scratch6 = new Cartesian3_default();
2379
+ var cartesian4Scratch0 = new Cartesian4_default();
2380
+ function updateAdjacencyAfterSplit(geometry) {
2381
+ const attributes = geometry.attributes;
2382
+ const positions = attributes.position.values;
2383
+ const prevPositions = attributes.prevPosition.values;
2384
+ const nextPositions = attributes.nextPosition.values;
2385
+ const length = positions.length;
2386
+ for (let j = 0; j < length; j += 3) {
2387
+ const position = Cartesian3_default.unpack(positions, j, cartesian3Scratch0);
2388
+ if (position.x > 0) {
2389
+ continue;
2390
+ }
2391
+ const prevPosition = Cartesian3_default.unpack(
2392
+ prevPositions,
2393
+ j,
2394
+ cartesian3Scratch2
2395
+ );
2396
+ if (position.y < 0 && prevPosition.y > 0 || position.y > 0 && prevPosition.y < 0) {
2397
+ if (j - 3 > 0) {
2398
+ prevPositions[j] = positions[j - 3];
2399
+ prevPositions[j + 1] = positions[j - 2];
2400
+ prevPositions[j + 2] = positions[j - 1];
2401
+ } else {
2402
+ Cartesian3_default.pack(position, prevPositions, j);
2403
+ }
2404
+ }
2405
+ const nextPosition = Cartesian3_default.unpack(
2406
+ nextPositions,
2407
+ j,
2408
+ cartesian3Scratch3
2409
+ );
2410
+ if (position.y < 0 && nextPosition.y > 0 || position.y > 0 && nextPosition.y < 0) {
2411
+ if (j + 3 < length) {
2412
+ nextPositions[j] = positions[j + 3];
2413
+ nextPositions[j + 1] = positions[j + 4];
2414
+ nextPositions[j + 2] = positions[j + 5];
2415
+ } else {
2416
+ Cartesian3_default.pack(position, nextPositions, j);
2417
+ }
2418
+ }
2419
+ }
2420
+ }
2421
+ var offsetScalar = 5 * Math_default.EPSILON9;
2422
+ var coplanarOffset = Math_default.EPSILON6;
2423
+ function splitLongitudePolyline(instance) {
2424
+ const geometry = instance.geometry;
2425
+ const attributes = geometry.attributes;
2426
+ const positions = attributes.position.values;
2427
+ const prevPositions = attributes.prevPosition.values;
2428
+ const nextPositions = attributes.nextPosition.values;
2429
+ const expandAndWidths = attributes.expandAndWidth.values;
2430
+ const texCoords = defined_default(attributes.st) ? attributes.st.values : void 0;
2431
+ const colors = defined_default(attributes.color) ? attributes.color.values : void 0;
2432
+ const eastGeometry = copyGeometryForSplit(geometry);
2433
+ const westGeometry = copyGeometryForSplit(geometry);
2434
+ let i;
2435
+ let j;
2436
+ let index;
2437
+ let intersectionFound = false;
2438
+ const length = positions.length / 3;
2439
+ for (i = 0; i < length; i += 4) {
2440
+ const i0 = i;
2441
+ const i2 = i + 2;
2442
+ const p0 = Cartesian3_default.fromArray(positions, i0 * 3, cartesian3Scratch0);
2443
+ const p2 = Cartesian3_default.fromArray(positions, i2 * 3, cartesian3Scratch2);
2444
+ if (Math.abs(p0.y) < coplanarOffset) {
2445
+ p0.y = coplanarOffset * (p2.y < 0 ? -1 : 1);
2446
+ positions[i * 3 + 1] = p0.y;
2447
+ positions[(i + 1) * 3 + 1] = p0.y;
2448
+ for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {
2449
+ prevPositions[j] = positions[i * 3];
2450
+ prevPositions[j + 1] = positions[i * 3 + 1];
2451
+ prevPositions[j + 2] = positions[i * 3 + 2];
2452
+ }
2453
+ }
2454
+ if (Math.abs(p2.y) < coplanarOffset) {
2455
+ p2.y = coplanarOffset * (p0.y < 0 ? -1 : 1);
2456
+ positions[(i + 2) * 3 + 1] = p2.y;
2457
+ positions[(i + 3) * 3 + 1] = p2.y;
2458
+ for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {
2459
+ nextPositions[j] = positions[(i + 2) * 3];
2460
+ nextPositions[j + 1] = positions[(i + 2) * 3 + 1];
2461
+ nextPositions[j + 2] = positions[(i + 2) * 3 + 2];
2462
+ }
2463
+ }
2464
+ let p0Attributes = eastGeometry.attributes;
2465
+ let p0Indices = eastGeometry.indices;
2466
+ let p2Attributes = westGeometry.attributes;
2467
+ let p2Indices = westGeometry.indices;
2468
+ const intersection = IntersectionTests_default.lineSegmentPlane(
2469
+ p0,
2470
+ p2,
2471
+ xzPlane,
2472
+ cartesian3Scratch4
2473
+ );
2474
+ if (defined_default(intersection)) {
2475
+ intersectionFound = true;
2476
+ const offset = Cartesian3_default.multiplyByScalar(
2477
+ Cartesian3_default.UNIT_Y,
2478
+ offsetScalar,
2479
+ cartesian3Scratch5
2480
+ );
2481
+ if (p0.y < 0) {
2482
+ Cartesian3_default.negate(offset, offset);
2483
+ p0Attributes = westGeometry.attributes;
2484
+ p0Indices = westGeometry.indices;
2485
+ p2Attributes = eastGeometry.attributes;
2486
+ p2Indices = eastGeometry.indices;
2487
+ }
2488
+ const offsetPoint = Cartesian3_default.add(
2489
+ intersection,
2490
+ offset,
2491
+ cartesian3Scratch6
2492
+ );
2493
+ p0Attributes.position.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);
2494
+ p0Attributes.position.values.push(
2495
+ offsetPoint.x,
2496
+ offsetPoint.y,
2497
+ offsetPoint.z
2498
+ );
2499
+ p0Attributes.position.values.push(
2500
+ offsetPoint.x,
2501
+ offsetPoint.y,
2502
+ offsetPoint.z
2503
+ );
2504
+ p0Attributes.prevPosition.values.push(
2505
+ prevPositions[i0 * 3],
2506
+ prevPositions[i0 * 3 + 1],
2507
+ prevPositions[i0 * 3 + 2]
2508
+ );
2509
+ p0Attributes.prevPosition.values.push(
2510
+ prevPositions[i0 * 3 + 3],
2511
+ prevPositions[i0 * 3 + 4],
2512
+ prevPositions[i0 * 3 + 5]
2513
+ );
2514
+ p0Attributes.prevPosition.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);
2515
+ p0Attributes.nextPosition.values.push(
2516
+ offsetPoint.x,
2517
+ offsetPoint.y,
2518
+ offsetPoint.z
2519
+ );
2520
+ p0Attributes.nextPosition.values.push(
2521
+ offsetPoint.x,
2522
+ offsetPoint.y,
2523
+ offsetPoint.z
2524
+ );
2525
+ p0Attributes.nextPosition.values.push(
2526
+ offsetPoint.x,
2527
+ offsetPoint.y,
2528
+ offsetPoint.z
2529
+ );
2530
+ p0Attributes.nextPosition.values.push(
2531
+ offsetPoint.x,
2532
+ offsetPoint.y,
2533
+ offsetPoint.z
2534
+ );
2535
+ Cartesian3_default.negate(offset, offset);
2536
+ Cartesian3_default.add(intersection, offset, offsetPoint);
2537
+ p2Attributes.position.values.push(
2538
+ offsetPoint.x,
2539
+ offsetPoint.y,
2540
+ offsetPoint.z
2541
+ );
2542
+ p2Attributes.position.values.push(
2543
+ offsetPoint.x,
2544
+ offsetPoint.y,
2545
+ offsetPoint.z
2546
+ );
2547
+ p2Attributes.position.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);
2548
+ p2Attributes.prevPosition.values.push(
2549
+ offsetPoint.x,
2550
+ offsetPoint.y,
2551
+ offsetPoint.z
2552
+ );
2553
+ p2Attributes.prevPosition.values.push(
2554
+ offsetPoint.x,
2555
+ offsetPoint.y,
2556
+ offsetPoint.z
2557
+ );
2558
+ p2Attributes.prevPosition.values.push(
2559
+ offsetPoint.x,
2560
+ offsetPoint.y,
2561
+ offsetPoint.z
2562
+ );
2563
+ p2Attributes.prevPosition.values.push(
2564
+ offsetPoint.x,
2565
+ offsetPoint.y,
2566
+ offsetPoint.z
2567
+ );
2568
+ p2Attributes.nextPosition.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);
2569
+ p2Attributes.nextPosition.values.push(
2570
+ nextPositions[i2 * 3],
2571
+ nextPositions[i2 * 3 + 1],
2572
+ nextPositions[i2 * 3 + 2]
2573
+ );
2574
+ p2Attributes.nextPosition.values.push(
2575
+ nextPositions[i2 * 3 + 3],
2576
+ nextPositions[i2 * 3 + 4],
2577
+ nextPositions[i2 * 3 + 5]
2578
+ );
2579
+ const ew0 = Cartesian2_default.fromArray(
2580
+ expandAndWidths,
2581
+ i0 * 2,
2582
+ cartesian2Scratch0
2583
+ );
2584
+ const width = Math.abs(ew0.y);
2585
+ p0Attributes.expandAndWidth.values.push(-1, width, 1, width);
2586
+ p0Attributes.expandAndWidth.values.push(-1, -width, 1, -width);
2587
+ p2Attributes.expandAndWidth.values.push(-1, width, 1, width);
2588
+ p2Attributes.expandAndWidth.values.push(-1, -width, 1, -width);
2589
+ let t = Cartesian3_default.magnitudeSquared(
2590
+ Cartesian3_default.subtract(intersection, p0, cartesian3Scratch3)
2591
+ );
2592
+ t /= Cartesian3_default.magnitudeSquared(
2593
+ Cartesian3_default.subtract(p2, p0, cartesian3Scratch3)
2594
+ );
2595
+ if (defined_default(colors)) {
2596
+ const c0 = Cartesian4_default.fromArray(colors, i0 * 4, cartesian4Scratch0);
2597
+ const c2 = Cartesian4_default.fromArray(colors, i2 * 4, cartesian4Scratch0);
2598
+ const r = Math_default.lerp(c0.x, c2.x, t);
2599
+ const g = Math_default.lerp(c0.y, c2.y, t);
2600
+ const b = Math_default.lerp(c0.z, c2.z, t);
2601
+ const a = Math_default.lerp(c0.w, c2.w, t);
2602
+ for (j = i0 * 4; j < i0 * 4 + 2 * 4; ++j) {
2603
+ p0Attributes.color.values.push(colors[j]);
2604
+ }
2605
+ p0Attributes.color.values.push(r, g, b, a);
2606
+ p0Attributes.color.values.push(r, g, b, a);
2607
+ p2Attributes.color.values.push(r, g, b, a);
2608
+ p2Attributes.color.values.push(r, g, b, a);
2609
+ for (j = i2 * 4; j < i2 * 4 + 2 * 4; ++j) {
2610
+ p2Attributes.color.values.push(colors[j]);
2611
+ }
2612
+ }
2613
+ if (defined_default(texCoords)) {
2614
+ const s0 = Cartesian2_default.fromArray(texCoords, i0 * 2, cartesian2Scratch0);
2615
+ const s3 = Cartesian2_default.fromArray(
2616
+ texCoords,
2617
+ (i + 3) * 2,
2618
+ cartesian2Scratch1
2619
+ );
2620
+ const sx = Math_default.lerp(s0.x, s3.x, t);
2621
+ for (j = i0 * 2; j < i0 * 2 + 2 * 2; ++j) {
2622
+ p0Attributes.st.values.push(texCoords[j]);
2623
+ }
2624
+ p0Attributes.st.values.push(sx, s0.y);
2625
+ p0Attributes.st.values.push(sx, s3.y);
2626
+ p2Attributes.st.values.push(sx, s0.y);
2627
+ p2Attributes.st.values.push(sx, s3.y);
2628
+ for (j = i2 * 2; j < i2 * 2 + 2 * 2; ++j) {
2629
+ p2Attributes.st.values.push(texCoords[j]);
2630
+ }
2631
+ }
2632
+ index = p0Attributes.position.values.length / 3 - 4;
2633
+ p0Indices.push(index, index + 2, index + 1);
2634
+ p0Indices.push(index + 1, index + 2, index + 3);
2635
+ index = p2Attributes.position.values.length / 3 - 4;
2636
+ p2Indices.push(index, index + 2, index + 1);
2637
+ p2Indices.push(index + 1, index + 2, index + 3);
2638
+ } else {
2639
+ let currentAttributes;
2640
+ let currentIndices;
2641
+ if (p0.y < 0) {
2642
+ currentAttributes = westGeometry.attributes;
2643
+ currentIndices = westGeometry.indices;
2644
+ } else {
2645
+ currentAttributes = eastGeometry.attributes;
2646
+ currentIndices = eastGeometry.indices;
2647
+ }
2648
+ currentAttributes.position.values.push(p0.x, p0.y, p0.z);
2649
+ currentAttributes.position.values.push(p0.x, p0.y, p0.z);
2650
+ currentAttributes.position.values.push(p2.x, p2.y, p2.z);
2651
+ currentAttributes.position.values.push(p2.x, p2.y, p2.z);
2652
+ for (j = i * 3; j < i * 3 + 4 * 3; ++j) {
2653
+ currentAttributes.prevPosition.values.push(prevPositions[j]);
2654
+ currentAttributes.nextPosition.values.push(nextPositions[j]);
2655
+ }
2656
+ for (j = i * 2; j < i * 2 + 4 * 2; ++j) {
2657
+ currentAttributes.expandAndWidth.values.push(expandAndWidths[j]);
2658
+ if (defined_default(texCoords)) {
2659
+ currentAttributes.st.values.push(texCoords[j]);
2660
+ }
2661
+ }
2662
+ if (defined_default(colors)) {
2663
+ for (j = i * 4; j < i * 4 + 4 * 4; ++j) {
2664
+ currentAttributes.color.values.push(colors[j]);
2665
+ }
2666
+ }
2667
+ index = currentAttributes.position.values.length / 3 - 4;
2668
+ currentIndices.push(index, index + 2, index + 1);
2669
+ currentIndices.push(index + 1, index + 2, index + 3);
2670
+ }
2671
+ }
2672
+ if (intersectionFound) {
2673
+ updateAdjacencyAfterSplit(westGeometry);
2674
+ updateAdjacencyAfterSplit(eastGeometry);
2675
+ }
2676
+ updateInstanceAfterSplit(instance, westGeometry, eastGeometry);
2677
+ }
2678
+ GeometryPipeline.splitLongitude = function(instance) {
2679
+ if (!defined_default(instance)) {
2680
+ throw new DeveloperError_default("instance is required.");
2681
+ }
2682
+ const geometry = instance.geometry;
2683
+ const boundingSphere = geometry.boundingSphere;
2684
+ if (defined_default(boundingSphere)) {
2685
+ const minX = boundingSphere.center.x - boundingSphere.radius;
2686
+ if (minX > 0 || BoundingSphere_default.intersectPlane(boundingSphere, Plane_default.ORIGIN_ZX_PLANE) !== Intersect_default.INTERSECTING) {
2687
+ return instance;
2688
+ }
2689
+ }
2690
+ if (geometry.geometryType !== GeometryType_default.NONE) {
2691
+ switch (geometry.geometryType) {
2692
+ case GeometryType_default.POLYLINES:
2693
+ splitLongitudePolyline(instance);
2694
+ break;
2695
+ case GeometryType_default.TRIANGLES:
2696
+ splitLongitudeTriangles(instance);
2697
+ break;
2698
+ case GeometryType_default.LINES:
2699
+ splitLongitudeLines(instance);
2700
+ break;
2701
+ }
2702
+ } else {
2703
+ indexPrimitive(geometry);
2704
+ if (geometry.primitiveType === PrimitiveType_default.TRIANGLES) {
2705
+ splitLongitudeTriangles(instance);
2706
+ } else if (geometry.primitiveType === PrimitiveType_default.LINES) {
2707
+ splitLongitudeLines(instance);
2708
+ }
2709
+ }
2710
+ return instance;
2711
+ };
2712
+ var GeometryPipeline_default = GeometryPipeline;
2713
+
2714
+ export {
2715
+ GeometryPipeline_default
2716
+ };