@vcmap/ui 5.0.0-rc.29 → 5.0.0-rc.31

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 (334) hide show
  1. package/build/buildHelpers.js +4 -3
  2. package/config/base.config.json +5 -4
  3. package/config/dev.config.json +8 -0
  4. package/config/graphFeatureInfo.config.json +1 -1
  5. package/config/projects.config.json +2 -2
  6. package/dist/assets/cesium/ThirdParty/Workers/basis_transcoder.js +1 -1
  7. package/dist/assets/cesium/Workers/chunk-227AJNOA.js +59 -0
  8. package/dist/assets/cesium/Workers/chunk-2R5O53JW.js +157 -0
  9. package/dist/assets/cesium/Workers/chunk-34YUDLRP.js +781 -0
  10. package/dist/assets/cesium/Workers/chunk-3W63OHNJ.js +100 -0
  11. package/dist/assets/cesium/Workers/chunk-4MFFIWUA.js +163 -0
  12. package/dist/assets/cesium/Workers/chunk-66QLLS45.js +218 -0
  13. package/dist/assets/cesium/Workers/chunk-6BTKZDRG.js +77 -0
  14. package/dist/assets/cesium/Workers/chunk-A4JVFBQ3.js +101 -0
  15. package/dist/assets/cesium/Workers/chunk-ABADGKYE.js +58 -0
  16. package/dist/assets/cesium/Workers/chunk-AFFLIKOH.js +353 -0
  17. package/dist/assets/cesium/Workers/chunk-AHKEZ2OE.js +629 -0
  18. package/dist/assets/cesium/Workers/chunk-C3SXRKRW.js +476 -0
  19. package/dist/assets/cesium/Workers/chunk-CCFQRR6D.js +55 -0
  20. package/dist/assets/cesium/Workers/chunk-CHHNOC2C.js +1860 -0
  21. package/dist/assets/cesium/Workers/chunk-CTELOFLA.js +196 -0
  22. package/dist/assets/cesium/Workers/chunk-DUHWWBQQ.js +3273 -0
  23. package/dist/assets/cesium/Workers/chunk-EW2GWJYB.js +44 -0
  24. package/dist/assets/cesium/Workers/chunk-GLZBE3ML.js +421 -0
  25. package/dist/assets/cesium/Workers/chunk-HARLBUOL.js +236 -0
  26. package/dist/assets/cesium/Workers/chunk-HQF437NJ.js +117 -0
  27. package/dist/assets/cesium/Workers/chunk-IPA4EACJ.js +368 -0
  28. package/dist/assets/cesium/Workers/chunk-J3JY6I2C.js +1009 -0
  29. package/dist/assets/cesium/Workers/chunk-JB2LWGH4.js +390 -0
  30. package/dist/assets/cesium/Workers/chunk-JS3AW5BK.js +634 -0
  31. package/dist/assets/cesium/Workers/chunk-K36FEYS7.js +452 -0
  32. package/dist/assets/cesium/Workers/chunk-KD4Y7CZL.js +400 -0
  33. package/dist/assets/cesium/Workers/chunk-KTJSNCK4.js +842 -0
  34. package/dist/assets/cesium/Workers/chunk-LLUNNUJV.js +258 -0
  35. package/dist/assets/cesium/Workers/{package.js → chunk-MPAZH4BF.js} +13 -2
  36. package/dist/assets/cesium/Workers/chunk-MYZB7C4T.js +1258 -0
  37. package/dist/assets/cesium/Workers/chunk-N3JIFFX2.js +501 -0
  38. package/dist/assets/cesium/Workers/chunk-O5AMBQ36.js +430 -0
  39. package/dist/assets/cesium/Workers/chunk-OAVNIRB4.js +124 -0
  40. package/dist/assets/cesium/Workers/chunk-OYFCF4PL.js +171 -0
  41. package/dist/assets/cesium/Workers/chunk-OZJDGN5F.js +1477 -0
  42. package/dist/assets/cesium/Workers/chunk-PCJWUS4M.js +2041 -0
  43. package/dist/assets/cesium/Workers/chunk-PFQBCKBM.js +8644 -0
  44. package/dist/assets/cesium/Workers/chunk-QIKODV5G.js +305 -0
  45. package/dist/assets/cesium/Workers/chunk-QJ3DFBH3.js +73 -0
  46. package/dist/assets/cesium/Workers/chunk-QMEMZIJI.js +138 -0
  47. package/dist/assets/cesium/Workers/chunk-QT3MPEMI.js +102 -0
  48. package/dist/assets/cesium/Workers/chunk-RP2A7BR5.js +289 -0
  49. package/dist/assets/cesium/Workers/chunk-RW6LU2CJ.js +138 -0
  50. package/dist/assets/cesium/Workers/chunk-TFC6TZ3S.js +757 -0
  51. package/dist/assets/cesium/Workers/chunk-V3NGATMV.js +693 -0
  52. package/dist/assets/cesium/Workers/chunk-VLGOATD6.js +1075 -0
  53. package/dist/assets/cesium/Workers/chunk-WXTV4ATB.js +39 -0
  54. package/dist/assets/cesium/Workers/chunk-X4SU25DT.js +302 -0
  55. package/dist/assets/cesium/Workers/chunk-XTY7B2N6.js +2716 -0
  56. package/dist/assets/cesium/Workers/chunk-XY7MGBKC.js +513 -0
  57. package/dist/assets/cesium/Workers/chunk-Z24VKNDO.js +834 -0
  58. package/dist/assets/cesium/Workers/chunk-ZA25DG4Y.js +684 -0
  59. package/dist/assets/cesium/Workers/chunk-ZFOBYDGF.js +73 -0
  60. package/dist/assets/cesium/Workers/combineGeometry.js +65 -15
  61. package/dist/assets/cesium/Workers/createBoxGeometry.js +55 -10
  62. package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +231 -310
  63. package/dist/assets/cesium/Workers/createCircleGeometry.js +185 -202
  64. package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +141 -155
  65. package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +477 -557
  66. package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +218 -230
  67. package/dist/assets/cesium/Workers/createCorridorGeometry.js +1162 -1307
  68. package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +533 -569
  69. package/dist/assets/cesium/Workers/createCylinderGeometry.js +57 -10
  70. package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +224 -258
  71. package/dist/assets/cesium/Workers/createEllipseGeometry.js +68 -12
  72. package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +61 -12
  73. package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +56 -10
  74. package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +58 -13
  75. package/dist/assets/cesium/Workers/createFrustumGeometry.js +55 -10
  76. package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +226 -243
  77. package/dist/assets/cesium/Workers/createGeometry.js +143 -48
  78. package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1484 -2011
  79. package/dist/assets/cesium/Workers/createPlaneGeometry.js +216 -243
  80. package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +121 -113
  81. package/dist/assets/cesium/Workers/createPolygonGeometry.js +1041 -1327
  82. package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +516 -657
  83. package/dist/assets/cesium/Workers/createPolylineGeometry.js +471 -547
  84. package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +352 -384
  85. package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +271 -295
  86. package/dist/assets/cesium/Workers/createRectangleGeometry.js +1128 -1331
  87. package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +445 -500
  88. package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +381 -440
  89. package/dist/assets/cesium/Workers/createSphereGeometry.js +112 -118
  90. package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +112 -121
  91. package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +32 -127
  92. package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +462 -505
  93. package/dist/assets/cesium/Workers/createVectorTileGeometries.js +377 -436
  94. package/dist/assets/cesium/Workers/createVectorTilePoints.js +110 -77
  95. package/dist/assets/cesium/Workers/createVectorTilePolygons.js +369 -391
  96. package/dist/assets/cesium/Workers/createVectorTilePolylines.js +252 -244
  97. package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +543 -615
  98. package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2244 -2677
  99. package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +682 -926
  100. package/dist/assets/cesium/Workers/createWallGeometry.js +459 -593
  101. package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +324 -419
  102. package/dist/assets/cesium/Workers/decodeDraco.js +327 -347
  103. package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +2530 -3567
  104. package/dist/assets/cesium/Workers/decodeI3S.js +765 -970
  105. package/dist/assets/cesium/Workers/transcodeKTX2.js +3353 -1464
  106. package/dist/assets/cesium/Workers/transferTypedArrayTest.js +3 -4
  107. package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +748 -953
  108. package/dist/assets/{cesium.16590b.js → cesium.77d0f7.js} +8915 -13165
  109. package/dist/assets/cesium.js +1 -1
  110. package/dist/assets/{core.74da2a.js → core.720589.js} +3421 -3365
  111. package/dist/assets/core.js +1 -1
  112. package/dist/assets/index-dd539204.js +1 -0
  113. package/dist/assets/{ol.50a512.js → ol.e48649.js} +4 -4
  114. package/dist/assets/ol.js +1 -1
  115. package/dist/assets/{ui.d3054c.css → ui.50452a.css} +2 -2
  116. package/dist/assets/{ui.d3054c.js → ui.50452a.js} +5312 -4776
  117. package/dist/assets/ui.js +1 -1
  118. package/dist/assets/vue.js +2 -2
  119. package/dist/assets/{vuetify.946bd8.js → vuetify.f0a769.js} +1 -1
  120. package/dist/assets/vuetify.js +2 -2
  121. package/dist/index.html +27 -23
  122. package/index.html +23 -22
  123. package/index.js +6 -0
  124. package/package.json +5 -5
  125. package/plugins/@vcmap-show-case/form-inputs-example/FormInputsExample.vue +37 -1
  126. package/plugins/@vcmap-show-case/form-inputs-example/index.js +3 -0
  127. package/plugins/@vcmap-show-case/form-inputs-example/validation.js +11 -0
  128. package/plugins/@vcmap-show-case/plugin-editors/PluginEditors.vue +119 -0
  129. package/plugins/@vcmap-show-case/plugin-editors/index.js +41 -0
  130. package/plugins/@vcmap-show-case/plugin-editors/package.json +5 -0
  131. package/plugins/{@vcmap → @vcmap-show-case}/project-selector/ProjectSelectorComponent.vue +1 -1
  132. package/plugins/{@vcmap → @vcmap-show-case}/project-selector/config.json +2 -2
  133. package/plugins/{@vcmap → @vcmap-show-case}/project-selector/package.json +1 -1
  134. package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/package.json +1 -1
  135. package/plugins/@vcmap-show-case/style-input-example/styleExample.vue +0 -1
  136. package/plugins/@vcmap-show-case/table-example/DataTableExample.vue +1 -1
  137. package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/ThemeChangerComponent.vue +1 -1
  138. package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/config.json +2 -2
  139. package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/package.json +1 -1
  140. package/plugins/@vcmap-show-case/vector-properties-example/index.js +40 -0
  141. package/plugins/@vcmap-show-case/vector-properties-example/package.json +5 -0
  142. package/plugins/@vcmap-show-case/vector-properties-example/vectorPropertiesExample.vue +128 -0
  143. package/plugins/package.json +6 -2
  144. package/src/application/VcsAttributions.vue +27 -20
  145. package/src/components/form-inputs-controls/VcsChipArrayInput.vue +290 -0
  146. package/src/components/form-inputs-controls/VcsSlider.vue +1 -0
  147. package/src/components/form-inputs-controls/VcsTextField.vue +9 -3
  148. package/src/components/icons/2DAreaIcon.vue +2 -17
  149. package/src/components/icons/2DDistanceIcon.vue +0 -3
  150. package/src/components/icons/3DAreaIcon.vue +2 -17
  151. package/src/components/icons/3DDistanceIcon.vue +0 -3
  152. package/src/components/icons/3DHeightIcon.vue +0 -3
  153. package/src/components/icons/AngleIcon.vue +0 -1
  154. package/src/components/icons/AssociationsIcon.vue +1 -3
  155. package/src/components/icons/AxisIcon.vue +0 -4
  156. package/src/components/icons/BoundingBoxIcon.vue +1 -4
  157. package/src/components/icons/CheckboxIcon.vue +0 -2
  158. package/src/components/icons/CheckboxIndeterminateIcon.vue +1 -5
  159. package/src/components/icons/CircleIcon.vue +1 -6
  160. package/src/components/icons/ClippingHorizontalIcon.vue +0 -1
  161. package/src/components/icons/ClippingIcon.vue +0 -1
  162. package/src/components/icons/ClippingVerticalIcon.vue +0 -1
  163. package/src/components/icons/ColorPickerIcon.vue +0 -1
  164. package/src/components/icons/ColorSwatchIcon.vue +0 -2
  165. package/src/components/icons/CommentIcon.vue +0 -1
  166. package/src/components/icons/CompassIcon.vue +0 -2
  167. package/src/components/icons/ComponentsIcon.vue +0 -1
  168. package/src/components/icons/ConeIcon.vue +1 -4
  169. package/src/components/icons/DimensionsHouseIcon.vue +0 -2
  170. package/src/components/icons/EditIcon.vue +0 -1
  171. package/src/components/icons/EditVerticesIcon.vue +0 -4
  172. package/src/components/icons/ElevationProfileIcon.vue +1 -13
  173. package/src/components/icons/ExportAreaIcon.vue +0 -1
  174. package/src/components/icons/ExportFlightIcon.vue +0 -1
  175. package/src/components/icons/ExportIcon.vue +12 -8
  176. package/src/components/icons/ExternalLinkIcon.vue +0 -2
  177. package/src/components/icons/FastForwardIcon.vue +0 -1
  178. package/src/components/icons/FilterIcon.vue +0 -1
  179. package/src/components/icons/GlobeNatureIcon.vue +0 -3
  180. package/src/components/icons/GroundIcon.vue +0 -1
  181. package/src/components/icons/HealthCareIndustriesIcon.vue +1 -11
  182. package/src/components/icons/HideIcon.vue +0 -1
  183. package/src/components/icons/HomePointIcon.vue +0 -1
  184. package/src/components/icons/HospitalsIcon.vue +1 -20
  185. package/src/components/icons/HouseIcon.vue +3 -13
  186. package/src/components/icons/ImportIcon.vue +6 -14
  187. package/src/components/icons/InfoIcon.vue +0 -2
  188. package/src/components/icons/KebabIcon.vue +1 -9
  189. package/src/components/icons/LabelIcon.vue +0 -2
  190. package/src/components/icons/LayersIcon.vue +1 -9
  191. package/src/components/icons/LegendIcon.vue +0 -1
  192. package/src/components/icons/LineIcon.vue +0 -2
  193. package/src/components/icons/LinkIcon.vue +0 -1
  194. package/src/components/icons/LogoutIcon.vue +0 -1
  195. package/src/components/icons/MapIcon.vue +0 -2
  196. package/src/components/icons/MenuIcon.vue +1 -5
  197. package/src/components/icons/MinusIcon.vue +0 -2
  198. package/src/components/icons/ObjectSelectIcon.vue +0 -2
  199. package/src/components/icons/ObliqueViewIcon.vue +0 -1
  200. package/src/components/icons/PdfIcon.vue +0 -1
  201. package/src/components/icons/PedestrianIcon.vue +0 -1
  202. package/src/components/icons/PenIcon.vue +0 -1
  203. package/src/components/icons/PlayCircleIcon.vue +1 -8
  204. package/src/components/icons/PlusIcon.vue +0 -2
  205. package/src/components/icons/PoiIcon.vue +0 -1
  206. package/src/components/icons/PointIcon.vue +2 -6
  207. package/src/components/icons/PointSelectIcon.vue +0 -1
  208. package/src/components/icons/PresentationModeIcon.vue +0 -1
  209. package/src/components/icons/ProgressIcon.vue +1 -1
  210. package/src/components/icons/QueryIcon.vue +0 -1
  211. package/src/components/icons/RectangleIcon.vue +1 -6
  212. package/src/components/icons/ReturnIcon.vue +0 -1
  213. package/src/components/icons/RewindIcon.vue +0 -1
  214. package/src/components/icons/RotateLeftIcon.vue +0 -1
  215. package/src/components/icons/RotateRightIcon.vue +0 -1
  216. package/src/components/icons/ScreenshotIcon.vue +1 -6
  217. package/src/components/icons/SearchIcon.vue +0 -1
  218. package/src/components/icons/ShadowIcon.vue +0 -2
  219. package/src/components/icons/ShapesIcon.vue +1 -4
  220. package/src/components/icons/ShareIcon.vue +0 -1
  221. package/src/components/icons/SimpleCircleFilledIcon.vue +0 -1
  222. package/src/components/icons/SimpleCircleHalfFilledIcon.vue +0 -1
  223. package/src/components/icons/SimpleCircleOutlinedIcon.vue +1 -7
  224. package/src/components/icons/SkipPreviousIcon.vue +1 -6
  225. package/src/components/icons/SplitViewIcon.vue +0 -1
  226. package/src/components/icons/TextStyleIcon.vue +0 -3
  227. package/src/components/icons/ThreeDimensionsIcon.vue +0 -1
  228. package/src/components/icons/ToolsIcon.vue +0 -1
  229. package/src/components/icons/TouchIcon.vue +0 -1
  230. package/src/components/icons/TriangleIcon.vue +0 -3
  231. package/src/components/icons/TwoDimensionsIcon.vue +0 -2
  232. package/src/components/icons/UploadIcon.vue +0 -1
  233. package/src/components/icons/UserProfileIcon.vue +0 -1
  234. package/src/components/icons/UserShareIcon.vue +0 -1
  235. package/src/components/icons/ViewpointFlightIcon.vue +0 -1
  236. package/src/components/icons/ViewpointIcon.vue +0 -1
  237. package/src/components/icons/Viewshed360Icon.vue +0 -1
  238. package/src/components/icons/ViewshedConeIcon.vue +0 -1
  239. package/src/components/icons/ViewshedIcon.vue +0 -1
  240. package/src/components/icons/WalkingIcon.vue +0 -1
  241. package/src/components/icons/WallIcon.vue +1 -4
  242. package/src/components/icons/WandIcon.vue +22 -70
  243. package/src/components/lists/VcsList.vue +18 -12
  244. package/src/components/plugins/AbstractConfigEditor.vue +84 -0
  245. package/src/components/style/VcsImageSelector.vue +6 -5
  246. package/src/components/style/VcsTextSelector.vue +1 -1
  247. package/src/components/tables/VcsDataTable.vue +1 -1
  248. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +780 -0
  249. package/src/components/vector-properties/composables.js +93 -0
  250. package/src/contentTree/contentTreeCollection.js +30 -9
  251. package/src/i18n/de.js +41 -7
  252. package/src/i18n/en.js +39 -5
  253. package/src/i18n/i18nCollection.js +19 -65
  254. package/src/manager/buttonManager.js +4 -0
  255. package/src/manager/collectionManager/collectionComponent.js +1 -1
  256. package/src/manager/contextMenu/contextMenuManager.js +2 -0
  257. package/src/pluginHelper.js +57 -17
  258. package/src/vcsUiApp.js +25 -30
  259. package/src/vuePlugins/i18n.js +0 -8
  260. package/dist/assets/cesium/ThirdParty/Workers/draco_decoder_nodejs.js +0 -117
  261. package/dist/assets/cesium/Workers/ArcType-2d9abbbc.js +0 -37
  262. package/dist/assets/cesium/Workers/AttributeCompression-f9f6c717.js +0 -716
  263. package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-4140c51f.js +0 -258
  264. package/dist/assets/cesium/Workers/BoundingRectangle-c714b156.js +0 -369
  265. package/dist/assets/cesium/Workers/BoxGeometry-6f3da43d.js +0 -884
  266. package/dist/assets/cesium/Workers/Check-6ede7e26.js +0 -290
  267. package/dist/assets/cesium/Workers/Color-8a565ff2.js +0 -2262
  268. package/dist/assets/cesium/Workers/ComponentDatatype-cf1fa08e.js +0 -341
  269. package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-4b4d4096.js +0 -132
  270. package/dist/assets/cesium/Workers/CorridorGeometryLibrary-7b94502b.js +0 -498
  271. package/dist/assets/cesium/Workers/CylinderGeometry-ca070b87.js +0 -467
  272. package/dist/assets/cesium/Workers/CylinderGeometryLibrary-7bf291b4.js +0 -63
  273. package/dist/assets/cesium/Workers/EllipseGeometry-122e51fa.js +0 -1304
  274. package/dist/assets/cesium/Workers/EllipseGeometryLibrary-4d326efc.js +0 -366
  275. package/dist/assets/cesium/Workers/EllipseOutlineGeometry-16cc2bd7.js +0 -443
  276. package/dist/assets/cesium/Workers/EllipsoidGeodesic-5b3623dc.js +0 -520
  277. package/dist/assets/cesium/Workers/EllipsoidGeometry-cb148ca2.js +0 -637
  278. package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-0fa10c79.js +0 -454
  279. package/dist/assets/cesium/Workers/EllipsoidRhumbLine-ef872433.js +0 -741
  280. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-6dd1b7af.js +0 -373
  281. package/dist/assets/cesium/Workers/EncodedCartesian3-57415c8a.js +0 -171
  282. package/dist/assets/cesium/Workers/FrustumGeometry-ee73037c.js +0 -2540
  283. package/dist/assets/cesium/Workers/GeometryAttribute-ff5b4fb1.js +0 -619
  284. package/dist/assets/cesium/Workers/GeometryAttributes-ad136444.js +0 -91
  285. package/dist/assets/cesium/Workers/GeometryInstance-34d9e21e.js +0 -121
  286. package/dist/assets/cesium/Workers/GeometryOffsetAttribute-9ad0019c.js +0 -16
  287. package/dist/assets/cesium/Workers/GeometryPipeline-1f8fbf05.js +0 -3690
  288. package/dist/assets/cesium/Workers/IndexDatatype-2643aa47.js +0 -200
  289. package/dist/assets/cesium/Workers/IntersectionTests-70d39ba9.js +0 -1836
  290. package/dist/assets/cesium/Workers/Math-0a2ac845.js +0 -1340
  291. package/dist/assets/cesium/Workers/Matrix2-e1298525.js +0 -7086
  292. package/dist/assets/cesium/Workers/Matrix3-41c58dde.js +0 -4283
  293. package/dist/assets/cesium/Workers/OrientedBoundingBox-159cf1d6.js +0 -1259
  294. package/dist/assets/cesium/Workers/Plane-4c3d403b.js +0 -309
  295. package/dist/assets/cesium/Workers/PolygonGeometryLibrary-076a5d25.js +0 -1074
  296. package/dist/assets/cesium/Workers/PolygonPipeline-b9f2810a.js +0 -1344
  297. package/dist/assets/cesium/Workers/PolylinePipeline-639192e0.js +0 -573
  298. package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-b73549fb.js +0 -781
  299. package/dist/assets/cesium/Workers/PrimitivePipeline-10ede1b6.js +0 -966
  300. package/dist/assets/cesium/Workers/RectangleGeometryLibrary-c35a7356.js +0 -280
  301. package/dist/assets/cesium/Workers/RuntimeError-ef395448.js +0 -68
  302. package/dist/assets/cesium/Workers/TerrainEncoding-668d242f.js +0 -1227
  303. package/dist/assets/cesium/Workers/Transforms-a2a85221.js +0 -14712
  304. package/dist/assets/cesium/Workers/VertexFormat-030f11ff.js +0 -312
  305. package/dist/assets/cesium/Workers/WallGeometryLibrary-1938bf0d.js +0 -211
  306. package/dist/assets/cesium/Workers/WebGLConstants-0b1ce7ba.js +0 -620
  307. package/dist/assets/cesium/Workers/WebMercatorProjection-13ed1a6e.js +0 -151
  308. package/dist/assets/cesium/Workers/arrayRemoveDuplicates-d2061e85.js +0 -129
  309. package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +0 -1363
  310. package/dist/assets/cesium/Workers/combine-d9581036.js +0 -82
  311. package/dist/assets/cesium/Workers/defaultValue-fe22d8c0.js +0 -51
  312. package/dist/assets/index-cb070eff.js +0 -1
  313. package/plugins/@vcmap/create-link/fallbackCreateLink.vue +0 -76
  314. package/plugins/@vcmap/create-link/index.js +0 -95
  315. package/plugins/@vcmap/create-link/package.json +0 -6
  316. package/plugins/@vcmap/search-nominatim/LICENSE.md +0 -13
  317. package/plugins/@vcmap/search-nominatim/README.md +0 -3
  318. package/plugins/@vcmap/search-nominatim/config.json +0 -3
  319. package/plugins/@vcmap/search-nominatim/index.js +0 -29
  320. package/plugins/@vcmap/search-nominatim/nominatim.js +0 -175
  321. package/plugins/@vcmap/search-nominatim/package.json +0 -9
  322. /package/dist/assets/{vue.30740e.js → vue.5d696e.js} +0 -0
  323. /package/dist/assets/{vuetify.946bd8.css → vuetify.f0a769.css} +0 -0
  324. /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/ModulesListComponent.vue +0 -0
  325. /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/README.md +0 -0
  326. /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/de.json +0 -0
  327. /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/en.json +0 -0
  328. /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/index.js +0 -0
  329. /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/README.md +0 -0
  330. /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/SimpleGraphComponent.vue +0 -0
  331. /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/index.js +0 -0
  332. /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/simpleGraphView.js +0 -0
  333. /package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/README.md +0 -0
  334. /package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/index.js +0 -0
@@ -1,176 +1,214 @@
1
- define(['./arrayRemoveDuplicates-d2061e85', './Transforms-a2a85221', './Matrix3-41c58dde', './Check-6ede7e26', './ComponentDatatype-cf1fa08e', './PolylineVolumeGeometryLibrary-b73549fb', './CorridorGeometryLibrary-7b94502b', './defaultValue-fe22d8c0', './GeometryAttribute-ff5b4fb1', './GeometryAttributes-ad136444', './GeometryOffsetAttribute-9ad0019c', './IndexDatatype-2643aa47', './Math-0a2ac845', './PolygonPipeline-b9f2810a', './Matrix2-e1298525', './VertexFormat-030f11ff', './combine-d9581036', './RuntimeError-ef395448', './WebGLConstants-0b1ce7ba', './EllipsoidTangentPlane-6dd1b7af', './AxisAlignedBoundingBox-4140c51f', './IntersectionTests-70d39ba9', './Plane-4c3d403b', './PolylinePipeline-639192e0', './EllipsoidGeodesic-5b3623dc', './EllipsoidRhumbLine-ef872433'], (function (arrayRemoveDuplicates, Transforms, Matrix3, Check, ComponentDatatype, PolylineVolumeGeometryLibrary, CorridorGeometryLibrary, defaultValue, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1, PolygonPipeline, Matrix2, VertexFormat, combine$1, RuntimeError, WebGLConstants, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane, PolylinePipeline, EllipsoidGeodesic, EllipsoidRhumbLine) { 'use strict';
2
-
3
- const cartesian1 = new Matrix3.Cartesian3();
4
- const cartesian2 = new Matrix3.Cartesian3();
5
- const cartesian3 = new Matrix3.Cartesian3();
6
- const cartesian4 = new Matrix3.Cartesian3();
7
- const cartesian5 = new Matrix3.Cartesian3();
8
- const cartesian6 = new Matrix3.Cartesian3();
9
-
10
- const scratch1 = new Matrix3.Cartesian3();
11
- const scratch2 = new Matrix3.Cartesian3();
12
-
13
- function scaleToSurface(positions, ellipsoid) {
14
- for (let i = 0; i < positions.length; i++) {
15
- positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
16
- }
17
- return positions;
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
+ CorridorGeometryLibrary_default
28
+ } from "./chunk-C3SXRKRW.js";
29
+ import {
30
+ CornerType_default
31
+ } from "./chunk-V3NGATMV.js";
32
+ import "./chunk-GLZBE3ML.js";
33
+ import "./chunk-AFFLIKOH.js";
34
+ import {
35
+ GeometryOffsetAttribute_default
36
+ } from "./chunk-MPAZH4BF.js";
37
+ import {
38
+ VertexFormat_default
39
+ } from "./chunk-QMEMZIJI.js";
40
+ import "./chunk-RP2A7BR5.js";
41
+ import "./chunk-2R5O53JW.js";
42
+ import {
43
+ PolygonPipeline_default
44
+ } from "./chunk-J3JY6I2C.js";
45
+ import {
46
+ arrayRemoveDuplicates_default
47
+ } from "./chunk-3W63OHNJ.js";
48
+ import "./chunk-K36FEYS7.js";
49
+ import "./chunk-MYZB7C4T.js";
50
+ import "./chunk-OYFCF4PL.js";
51
+ import {
52
+ IndexDatatype_default
53
+ } from "./chunk-RW6LU2CJ.js";
54
+ import {
55
+ GeometryAttributes_default
56
+ } from "./chunk-EW2GWJYB.js";
57
+ import {
58
+ GeometryAttribute_default,
59
+ Geometry_default,
60
+ PrimitiveType_default
61
+ } from "./chunk-X4SU25DT.js";
62
+ import {
63
+ BoundingSphere_default
64
+ } from "./chunk-PFQBCKBM.js";
65
+ import "./chunk-QJ3DFBH3.js";
66
+ import {
67
+ Rectangle_default
68
+ } from "./chunk-DUHWWBQQ.js";
69
+ import {
70
+ ComponentDatatype_default
71
+ } from "./chunk-LLUNNUJV.js";
72
+ import {
73
+ Cartesian3_default,
74
+ Cartographic_default,
75
+ Ellipsoid_default
76
+ } from "./chunk-PCJWUS4M.js";
77
+ import {
78
+ Math_default
79
+ } from "./chunk-N3JIFFX2.js";
80
+ import "./chunk-AHKEZ2OE.js";
81
+ import "./chunk-ABADGKYE.js";
82
+ import {
83
+ defaultValue_default
84
+ } from "./chunk-WXTV4ATB.js";
85
+ import {
86
+ Check_default
87
+ } from "./chunk-4MFFIWUA.js";
88
+ import {
89
+ defined_default
90
+ } from "./chunk-6BTKZDRG.js";
91
+
92
+ // packages/engine/Source/Core/CorridorGeometry.js
93
+ var cartesian1 = new Cartesian3_default();
94
+ var cartesian2 = new Cartesian3_default();
95
+ var cartesian3 = new Cartesian3_default();
96
+ var cartesian4 = new Cartesian3_default();
97
+ var cartesian5 = new Cartesian3_default();
98
+ var cartesian6 = new Cartesian3_default();
99
+ var scratch1 = new Cartesian3_default();
100
+ var scratch2 = new Cartesian3_default();
101
+ function scaleToSurface(positions, ellipsoid) {
102
+ for (let i = 0; i < positions.length; i++) {
103
+ positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
18
104
  }
19
-
20
- function addNormals(attr, normal, left, front, back, vertexFormat) {
21
- const normals = attr.normals;
22
- const tangents = attr.tangents;
23
- const bitangents = attr.bitangents;
24
- const forward = Matrix3.Cartesian3.normalize(
25
- Matrix3.Cartesian3.cross(left, normal, scratch1),
26
- scratch1
27
- );
28
- if (vertexFormat.normal) {
29
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, front, back);
30
- }
31
- if (vertexFormat.tangent) {
32
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(tangents, forward, front, back);
33
- }
34
- if (vertexFormat.bitangent) {
35
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(bitangents, left, front, back);
36
- }
105
+ return positions;
106
+ }
107
+ function addNormals(attr, normal, left, front, back, vertexFormat) {
108
+ const normals = attr.normals;
109
+ const tangents = attr.tangents;
110
+ const bitangents = attr.bitangents;
111
+ const forward = Cartesian3_default.normalize(
112
+ Cartesian3_default.cross(left, normal, scratch1),
113
+ scratch1
114
+ );
115
+ if (vertexFormat.normal) {
116
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, front, back);
37
117
  }
38
-
39
- function combine(computedPositions, vertexFormat, ellipsoid) {
40
- const positions = computedPositions.positions;
41
- const corners = computedPositions.corners;
42
- const endPositions = computedPositions.endPositions;
43
- const computedLefts = computedPositions.lefts;
44
- const computedNormals = computedPositions.normals;
45
- const attributes = new GeometryAttributes.GeometryAttributes();
46
- let corner;
47
- let leftCount = 0;
48
- let rightCount = 0;
49
- let i;
50
- let indicesLength = 0;
51
- let length;
52
- for (i = 0; i < positions.length; i += 2) {
53
- length = positions[i].length - 3;
54
- leftCount += length; //subtracting 3 to account for duplicate points at corners
55
- indicesLength += length * 2;
56
- rightCount += positions[i + 1].length - 3;
57
- }
58
- leftCount += 3; //add back count for end positions
59
- rightCount += 3;
60
- for (i = 0; i < corners.length; i++) {
61
- corner = corners[i];
62
- const leftSide = corners[i].leftPositions;
63
- if (defaultValue.defined(leftSide)) {
64
- length = leftSide.length;
65
- leftCount += length;
66
- indicesLength += length;
67
- } else {
68
- length = corners[i].rightPositions.length;
69
- rightCount += length;
70
- indicesLength += length;
71
- }
72
- }
73
-
74
- const addEndPositions = defaultValue.defined(endPositions);
75
- let endPositionLength;
76
- if (addEndPositions) {
77
- endPositionLength = endPositions[0].length - 3;
78
- leftCount += endPositionLength;
79
- rightCount += endPositionLength;
80
- endPositionLength /= 3;
81
- indicesLength += endPositionLength * 6;
82
- }
83
- const size = leftCount + rightCount;
84
- const finalPositions = new Float64Array(size);
85
- const normals = vertexFormat.normal ? new Float32Array(size) : undefined;
86
- const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;
87
- const bitangents = vertexFormat.bitangent
88
- ? new Float32Array(size)
89
- : undefined;
90
- const attr = {
91
- normals: normals,
92
- tangents: tangents,
93
- bitangents: bitangents,
94
- };
95
- let front = 0;
96
- let back = size - 1;
97
- let UL, LL, UR, LR;
98
- let normal = cartesian1;
99
- let left = cartesian2;
100
- let rightPos, leftPos;
101
- const halfLength = endPositionLength / 2;
102
-
103
- const indices = IndexDatatype.IndexDatatype.createTypedArray(size / 3, indicesLength);
104
- let index = 0;
105
- if (addEndPositions) {
106
- // add rounded end
107
- leftPos = cartesian3;
108
- rightPos = cartesian4;
109
- const firstEndPositions = endPositions[0];
110
- normal = Matrix3.Cartesian3.fromArray(computedNormals, 0, normal);
111
- left = Matrix3.Cartesian3.fromArray(computedLefts, 0, left);
112
- for (i = 0; i < halfLength; i++) {
113
- leftPos = Matrix3.Cartesian3.fromArray(
114
- firstEndPositions,
115
- (halfLength - 1 - i) * 3,
116
- leftPos
117
- );
118
- rightPos = Matrix3.Cartesian3.fromArray(
119
- firstEndPositions,
120
- (halfLength + i) * 3,
121
- rightPos
122
- );
123
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
124
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
125
- finalPositions,
126
- leftPos,
127
- undefined,
128
- back
129
- );
130
- addNormals(attr, normal, left, front, back, vertexFormat);
131
-
132
- LL = front / 3;
133
- LR = LL + 1;
134
- UL = (back - 2) / 3;
135
- UR = UL - 1;
136
- indices[index++] = UL;
137
- indices[index++] = LL;
138
- indices[index++] = UR;
139
- indices[index++] = UR;
140
- indices[index++] = LL;
141
- indices[index++] = LR;
142
-
143
- front += 3;
144
- back -= 3;
145
- }
118
+ if (vertexFormat.tangent) {
119
+ CorridorGeometryLibrary_default.addAttribute(tangents, forward, front, back);
120
+ }
121
+ if (vertexFormat.bitangent) {
122
+ CorridorGeometryLibrary_default.addAttribute(bitangents, left, front, back);
123
+ }
124
+ }
125
+ function combine(computedPositions, vertexFormat, ellipsoid) {
126
+ const positions = computedPositions.positions;
127
+ const corners = computedPositions.corners;
128
+ const endPositions = computedPositions.endPositions;
129
+ const computedLefts = computedPositions.lefts;
130
+ const computedNormals = computedPositions.normals;
131
+ const attributes = new GeometryAttributes_default();
132
+ let corner;
133
+ let leftCount = 0;
134
+ let rightCount = 0;
135
+ let i;
136
+ let indicesLength = 0;
137
+ let length;
138
+ for (i = 0; i < positions.length; i += 2) {
139
+ length = positions[i].length - 3;
140
+ leftCount += length;
141
+ indicesLength += length * 2;
142
+ rightCount += positions[i + 1].length - 3;
143
+ }
144
+ leftCount += 3;
145
+ rightCount += 3;
146
+ for (i = 0; i < corners.length; i++) {
147
+ corner = corners[i];
148
+ const leftSide = corners[i].leftPositions;
149
+ if (defined_default(leftSide)) {
150
+ length = leftSide.length;
151
+ leftCount += length;
152
+ indicesLength += length;
153
+ } else {
154
+ length = corners[i].rightPositions.length;
155
+ rightCount += length;
156
+ indicesLength += length;
146
157
  }
147
-
148
- let posIndex = 0;
149
- let compIndex = 0;
150
- let rightEdge = positions[posIndex++]; //add first two edges
151
- let leftEdge = positions[posIndex++];
152
- finalPositions.set(rightEdge, front);
153
- finalPositions.set(leftEdge, back - leftEdge.length + 1);
154
-
155
- left = Matrix3.Cartesian3.fromArray(computedLefts, compIndex, left);
156
- let rightNormal;
157
- let leftNormal;
158
- length = leftEdge.length - 3;
159
- for (i = 0; i < length; i += 3) {
160
- rightNormal = ellipsoid.geodeticSurfaceNormal(
161
- Matrix3.Cartesian3.fromArray(rightEdge, i, scratch1),
162
- scratch1
158
+ }
159
+ const addEndPositions = defined_default(endPositions);
160
+ let endPositionLength;
161
+ if (addEndPositions) {
162
+ endPositionLength = endPositions[0].length - 3;
163
+ leftCount += endPositionLength;
164
+ rightCount += endPositionLength;
165
+ endPositionLength /= 3;
166
+ indicesLength += endPositionLength * 6;
167
+ }
168
+ const size = leftCount + rightCount;
169
+ const finalPositions = new Float64Array(size);
170
+ const normals = vertexFormat.normal ? new Float32Array(size) : void 0;
171
+ const tangents = vertexFormat.tangent ? new Float32Array(size) : void 0;
172
+ const bitangents = vertexFormat.bitangent ? new Float32Array(size) : void 0;
173
+ const attr = {
174
+ normals,
175
+ tangents,
176
+ bitangents
177
+ };
178
+ let front = 0;
179
+ let back = size - 1;
180
+ let UL, LL, UR, LR;
181
+ let normal = cartesian1;
182
+ let left = cartesian2;
183
+ let rightPos, leftPos;
184
+ const halfLength = endPositionLength / 2;
185
+ const indices = IndexDatatype_default.createTypedArray(size / 3, indicesLength);
186
+ let index = 0;
187
+ if (addEndPositions) {
188
+ leftPos = cartesian3;
189
+ rightPos = cartesian4;
190
+ const firstEndPositions = endPositions[0];
191
+ normal = Cartesian3_default.fromArray(computedNormals, 0, normal);
192
+ left = Cartesian3_default.fromArray(computedLefts, 0, left);
193
+ for (i = 0; i < halfLength; i++) {
194
+ leftPos = Cartesian3_default.fromArray(
195
+ firstEndPositions,
196
+ (halfLength - 1 - i) * 3,
197
+ leftPos
163
198
  );
164
- leftNormal = ellipsoid.geodeticSurfaceNormal(
165
- Matrix3.Cartesian3.fromArray(leftEdge, length - i, scratch2),
166
- scratch2
199
+ rightPos = Cartesian3_default.fromArray(
200
+ firstEndPositions,
201
+ (halfLength + i) * 3,
202
+ rightPos
167
203
  );
168
- normal = Matrix3.Cartesian3.normalize(
169
- Matrix3.Cartesian3.add(rightNormal, leftNormal, normal),
170
- normal
204
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
205
+ CorridorGeometryLibrary_default.addAttribute(
206
+ finalPositions,
207
+ leftPos,
208
+ void 0,
209
+ back
171
210
  );
172
211
  addNormals(attr, normal, left, front, back, vertexFormat);
173
-
174
212
  LL = front / 3;
175
213
  LR = LL + 1;
176
214
  UL = (back - 2) / 3;
@@ -181,1227 +219,1044 @@ define(['./arrayRemoveDuplicates-d2061e85', './Transforms-a2a85221', './Matrix3-
181
219
  indices[index++] = UR;
182
220
  indices[index++] = LL;
183
221
  indices[index++] = LR;
184
-
185
222
  front += 3;
186
223
  back -= 3;
187
224
  }
188
-
225
+ }
226
+ let posIndex = 0;
227
+ let compIndex = 0;
228
+ let rightEdge = positions[posIndex++];
229
+ let leftEdge = positions[posIndex++];
230
+ finalPositions.set(rightEdge, front);
231
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
232
+ left = Cartesian3_default.fromArray(computedLefts, compIndex, left);
233
+ let rightNormal;
234
+ let leftNormal;
235
+ length = leftEdge.length - 3;
236
+ for (i = 0; i < length; i += 3) {
189
237
  rightNormal = ellipsoid.geodeticSurfaceNormal(
190
- Matrix3.Cartesian3.fromArray(rightEdge, length, scratch1),
238
+ Cartesian3_default.fromArray(rightEdge, i, scratch1),
191
239
  scratch1
192
240
  );
193
241
  leftNormal = ellipsoid.geodeticSurfaceNormal(
194
- Matrix3.Cartesian3.fromArray(leftEdge, length, scratch2),
242
+ Cartesian3_default.fromArray(leftEdge, length - i, scratch2),
195
243
  scratch2
196
244
  );
197
- normal = Matrix3.Cartesian3.normalize(
198
- Matrix3.Cartesian3.add(rightNormal, leftNormal, normal),
245
+ normal = Cartesian3_default.normalize(
246
+ Cartesian3_default.add(rightNormal, leftNormal, normal),
199
247
  normal
200
248
  );
201
- compIndex += 3;
202
- for (i = 0; i < corners.length; i++) {
203
- let j;
204
- corner = corners[i];
205
- const l = corner.leftPositions;
206
- const r = corner.rightPositions;
207
- let pivot;
208
- let start;
209
- let outsidePoint = cartesian6;
210
- let previousPoint = cartesian3;
211
- let nextPoint = cartesian4;
212
- normal = Matrix3.Cartesian3.fromArray(computedNormals, compIndex, normal);
213
- if (defaultValue.defined(l)) {
214
- addNormals(attr, normal, left, undefined, back, vertexFormat);
215
- back -= 3;
216
- pivot = LR;
217
- start = UR;
218
- for (j = 0; j < l.length / 3; j++) {
219
- outsidePoint = Matrix3.Cartesian3.fromArray(l, j * 3, outsidePoint);
220
- indices[index++] = pivot;
221
- indices[index++] = start - j - 1;
222
- indices[index++] = start - j;
223
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
224
- finalPositions,
225
- outsidePoint,
226
- undefined,
227
- back
228
- );
229
- previousPoint = Matrix3.Cartesian3.fromArray(
230
- finalPositions,
231
- (start - j - 1) * 3,
232
- previousPoint
233
- );
234
- nextPoint = Matrix3.Cartesian3.fromArray(finalPositions, pivot * 3, nextPoint);
235
- left = Matrix3.Cartesian3.normalize(
236
- Matrix3.Cartesian3.subtract(previousPoint, nextPoint, left),
237
- left
238
- );
239
- addNormals(attr, normal, left, undefined, back, vertexFormat);
240
- back -= 3;
241
- }
242
- outsidePoint = Matrix3.Cartesian3.fromArray(
249
+ addNormals(attr, normal, left, front, back, vertexFormat);
250
+ LL = front / 3;
251
+ LR = LL + 1;
252
+ UL = (back - 2) / 3;
253
+ UR = UL - 1;
254
+ indices[index++] = UL;
255
+ indices[index++] = LL;
256
+ indices[index++] = UR;
257
+ indices[index++] = UR;
258
+ indices[index++] = LL;
259
+ indices[index++] = LR;
260
+ front += 3;
261
+ back -= 3;
262
+ }
263
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
264
+ Cartesian3_default.fromArray(rightEdge, length, scratch1),
265
+ scratch1
266
+ );
267
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
268
+ Cartesian3_default.fromArray(leftEdge, length, scratch2),
269
+ scratch2
270
+ );
271
+ normal = Cartesian3_default.normalize(
272
+ Cartesian3_default.add(rightNormal, leftNormal, normal),
273
+ normal
274
+ );
275
+ compIndex += 3;
276
+ for (i = 0; i < corners.length; i++) {
277
+ let j;
278
+ corner = corners[i];
279
+ const l = corner.leftPositions;
280
+ const r = corner.rightPositions;
281
+ let pivot;
282
+ let start;
283
+ let outsidePoint = cartesian6;
284
+ let previousPoint = cartesian3;
285
+ let nextPoint = cartesian4;
286
+ normal = Cartesian3_default.fromArray(computedNormals, compIndex, normal);
287
+ if (defined_default(l)) {
288
+ addNormals(attr, normal, left, void 0, back, vertexFormat);
289
+ back -= 3;
290
+ pivot = LR;
291
+ start = UR;
292
+ for (j = 0; j < l.length / 3; j++) {
293
+ outsidePoint = Cartesian3_default.fromArray(l, j * 3, outsidePoint);
294
+ indices[index++] = pivot;
295
+ indices[index++] = start - j - 1;
296
+ indices[index++] = start - j;
297
+ CorridorGeometryLibrary_default.addAttribute(
243
298
  finalPositions,
244
- pivot * 3,
245
- outsidePoint
246
- );
247
- previousPoint = Matrix3.Cartesian3.subtract(
248
- Matrix3.Cartesian3.fromArray(finalPositions, start * 3, previousPoint),
249
299
  outsidePoint,
250
- previousPoint
300
+ void 0,
301
+ back
251
302
  );
252
- nextPoint = Matrix3.Cartesian3.subtract(
253
- Matrix3.Cartesian3.fromArray(finalPositions, (start - j) * 3, nextPoint),
254
- outsidePoint,
255
- nextPoint
303
+ previousPoint = Cartesian3_default.fromArray(
304
+ finalPositions,
305
+ (start - j - 1) * 3,
306
+ previousPoint
256
307
  );
257
- left = Matrix3.Cartesian3.normalize(
258
- Matrix3.Cartesian3.add(previousPoint, nextPoint, left),
308
+ nextPoint = Cartesian3_default.fromArray(finalPositions, pivot * 3, nextPoint);
309
+ left = Cartesian3_default.normalize(
310
+ Cartesian3_default.subtract(previousPoint, nextPoint, left),
259
311
  left
260
312
  );
261
- addNormals(attr, normal, left, front, undefined, vertexFormat);
262
- front += 3;
263
- } else {
264
- addNormals(attr, normal, left, front, undefined, vertexFormat);
265
- front += 3;
266
- pivot = UR;
267
- start = LR;
268
- for (j = 0; j < r.length / 3; j++) {
269
- outsidePoint = Matrix3.Cartesian3.fromArray(r, j * 3, outsidePoint);
270
- indices[index++] = pivot;
271
- indices[index++] = start + j;
272
- indices[index++] = start + j + 1;
273
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
274
- finalPositions,
275
- outsidePoint,
276
- front
277
- );
278
- previousPoint = Matrix3.Cartesian3.fromArray(
279
- finalPositions,
280
- pivot * 3,
281
- previousPoint
282
- );
283
- nextPoint = Matrix3.Cartesian3.fromArray(
284
- finalPositions,
285
- (start + j) * 3,
286
- nextPoint
287
- );
288
- left = Matrix3.Cartesian3.normalize(
289
- Matrix3.Cartesian3.subtract(previousPoint, nextPoint, left),
290
- left
291
- );
292
- addNormals(attr, normal, left, front, undefined, vertexFormat);
293
- front += 3;
294
- }
295
- outsidePoint = Matrix3.Cartesian3.fromArray(
313
+ addNormals(attr, normal, left, void 0, back, vertexFormat);
314
+ back -= 3;
315
+ }
316
+ outsidePoint = Cartesian3_default.fromArray(
317
+ finalPositions,
318
+ pivot * 3,
319
+ outsidePoint
320
+ );
321
+ previousPoint = Cartesian3_default.subtract(
322
+ Cartesian3_default.fromArray(finalPositions, start * 3, previousPoint),
323
+ outsidePoint,
324
+ previousPoint
325
+ );
326
+ nextPoint = Cartesian3_default.subtract(
327
+ Cartesian3_default.fromArray(finalPositions, (start - j) * 3, nextPoint),
328
+ outsidePoint,
329
+ nextPoint
330
+ );
331
+ left = Cartesian3_default.normalize(
332
+ Cartesian3_default.add(previousPoint, nextPoint, left),
333
+ left
334
+ );
335
+ addNormals(attr, normal, left, front, void 0, vertexFormat);
336
+ front += 3;
337
+ } else {
338
+ addNormals(attr, normal, left, front, void 0, vertexFormat);
339
+ front += 3;
340
+ pivot = UR;
341
+ start = LR;
342
+ for (j = 0; j < r.length / 3; j++) {
343
+ outsidePoint = Cartesian3_default.fromArray(r, j * 3, outsidePoint);
344
+ indices[index++] = pivot;
345
+ indices[index++] = start + j;
346
+ indices[index++] = start + j + 1;
347
+ CorridorGeometryLibrary_default.addAttribute(
296
348
  finalPositions,
297
- pivot * 3,
298
- outsidePoint
299
- );
300
- previousPoint = Matrix3.Cartesian3.subtract(
301
- Matrix3.Cartesian3.fromArray(finalPositions, (start + j) * 3, previousPoint),
302
349
  outsidePoint,
350
+ front
351
+ );
352
+ previousPoint = Cartesian3_default.fromArray(
353
+ finalPositions,
354
+ pivot * 3,
303
355
  previousPoint
304
356
  );
305
- nextPoint = Matrix3.Cartesian3.subtract(
306
- Matrix3.Cartesian3.fromArray(finalPositions, start * 3, nextPoint),
307
- outsidePoint,
357
+ nextPoint = Cartesian3_default.fromArray(
358
+ finalPositions,
359
+ (start + j) * 3,
308
360
  nextPoint
309
361
  );
310
- left = Matrix3.Cartesian3.normalize(
311
- Matrix3.Cartesian3.negate(Matrix3.Cartesian3.add(nextPoint, previousPoint, left), left),
362
+ left = Cartesian3_default.normalize(
363
+ Cartesian3_default.subtract(previousPoint, nextPoint, left),
312
364
  left
313
365
  );
314
- addNormals(attr, normal, left, undefined, back, vertexFormat);
315
- back -= 3;
316
- }
317
- rightEdge = positions[posIndex++];
318
- leftEdge = positions[posIndex++];
319
- rightEdge.splice(0, 3); //remove duplicate points added by corner
320
- leftEdge.splice(leftEdge.length - 3, 3);
321
- finalPositions.set(rightEdge, front);
322
- finalPositions.set(leftEdge, back - leftEdge.length + 1);
323
- length = leftEdge.length - 3;
324
-
325
- compIndex += 3;
326
- left = Matrix3.Cartesian3.fromArray(computedLefts, compIndex, left);
327
- for (j = 0; j < leftEdge.length; j += 3) {
328
- rightNormal = ellipsoid.geodeticSurfaceNormal(
329
- Matrix3.Cartesian3.fromArray(rightEdge, j, scratch1),
330
- scratch1
331
- );
332
- leftNormal = ellipsoid.geodeticSurfaceNormal(
333
- Matrix3.Cartesian3.fromArray(leftEdge, length - j, scratch2),
334
- scratch2
335
- );
336
- normal = Matrix3.Cartesian3.normalize(
337
- Matrix3.Cartesian3.add(rightNormal, leftNormal, normal),
338
- normal
339
- );
340
- addNormals(attr, normal, left, front, back, vertexFormat);
341
-
342
- LR = front / 3;
343
- LL = LR - 1;
344
- UR = (back - 2) / 3;
345
- UL = UR + 1;
346
- indices[index++] = UL;
347
- indices[index++] = LL;
348
- indices[index++] = UR;
349
- indices[index++] = UR;
350
- indices[index++] = LL;
351
- indices[index++] = LR;
352
-
366
+ addNormals(attr, normal, left, front, void 0, vertexFormat);
353
367
  front += 3;
354
- back -= 3;
355
368
  }
356
- front -= 3;
357
- back += 3;
369
+ outsidePoint = Cartesian3_default.fromArray(
370
+ finalPositions,
371
+ pivot * 3,
372
+ outsidePoint
373
+ );
374
+ previousPoint = Cartesian3_default.subtract(
375
+ Cartesian3_default.fromArray(finalPositions, (start + j) * 3, previousPoint),
376
+ outsidePoint,
377
+ previousPoint
378
+ );
379
+ nextPoint = Cartesian3_default.subtract(
380
+ Cartesian3_default.fromArray(finalPositions, start * 3, nextPoint),
381
+ outsidePoint,
382
+ nextPoint
383
+ );
384
+ left = Cartesian3_default.normalize(
385
+ Cartesian3_default.negate(Cartesian3_default.add(nextPoint, previousPoint, left), left),
386
+ left
387
+ );
388
+ addNormals(attr, normal, left, void 0, back, vertexFormat);
389
+ back -= 3;
358
390
  }
359
- normal = Matrix3.Cartesian3.fromArray(
360
- computedNormals,
361
- computedNormals.length - 3,
362
- normal
363
- );
364
- addNormals(attr, normal, left, front, back, vertexFormat);
365
-
366
- if (addEndPositions) {
367
- // add rounded end
391
+ rightEdge = positions[posIndex++];
392
+ leftEdge = positions[posIndex++];
393
+ rightEdge.splice(0, 3);
394
+ leftEdge.splice(leftEdge.length - 3, 3);
395
+ finalPositions.set(rightEdge, front);
396
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
397
+ length = leftEdge.length - 3;
398
+ compIndex += 3;
399
+ left = Cartesian3_default.fromArray(computedLefts, compIndex, left);
400
+ for (j = 0; j < leftEdge.length; j += 3) {
401
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
402
+ Cartesian3_default.fromArray(rightEdge, j, scratch1),
403
+ scratch1
404
+ );
405
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
406
+ Cartesian3_default.fromArray(leftEdge, length - j, scratch2),
407
+ scratch2
408
+ );
409
+ normal = Cartesian3_default.normalize(
410
+ Cartesian3_default.add(rightNormal, leftNormal, normal),
411
+ normal
412
+ );
413
+ addNormals(attr, normal, left, front, back, vertexFormat);
414
+ LR = front / 3;
415
+ LL = LR - 1;
416
+ UR = (back - 2) / 3;
417
+ UL = UR + 1;
418
+ indices[index++] = UL;
419
+ indices[index++] = LL;
420
+ indices[index++] = UR;
421
+ indices[index++] = UR;
422
+ indices[index++] = LL;
423
+ indices[index++] = LR;
368
424
  front += 3;
369
425
  back -= 3;
370
- leftPos = cartesian3;
371
- rightPos = cartesian4;
372
- const lastEndPositions = endPositions[1];
373
- for (i = 0; i < halfLength; i++) {
374
- leftPos = Matrix3.Cartesian3.fromArray(
375
- lastEndPositions,
376
- (endPositionLength - i - 1) * 3,
377
- leftPos
378
- );
379
- rightPos = Matrix3.Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);
380
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
381
- finalPositions,
382
- leftPos,
383
- undefined,
384
- back
385
- );
386
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
387
- addNormals(attr, normal, left, front, back, vertexFormat);
388
-
389
- LR = front / 3;
390
- LL = LR - 1;
391
- UR = (back - 2) / 3;
392
- UL = UR + 1;
393
- indices[index++] = UL;
394
- indices[index++] = LL;
395
- indices[index++] = UR;
396
- indices[index++] = UR;
397
- indices[index++] = LL;
398
- indices[index++] = LR;
399
-
400
- front += 3;
401
- back -= 3;
426
+ }
427
+ front -= 3;
428
+ back += 3;
429
+ }
430
+ normal = Cartesian3_default.fromArray(
431
+ computedNormals,
432
+ computedNormals.length - 3,
433
+ normal
434
+ );
435
+ addNormals(attr, normal, left, front, back, vertexFormat);
436
+ if (addEndPositions) {
437
+ front += 3;
438
+ back -= 3;
439
+ leftPos = cartesian3;
440
+ rightPos = cartesian4;
441
+ const lastEndPositions = endPositions[1];
442
+ for (i = 0; i < halfLength; i++) {
443
+ leftPos = Cartesian3_default.fromArray(
444
+ lastEndPositions,
445
+ (endPositionLength - i - 1) * 3,
446
+ leftPos
447
+ );
448
+ rightPos = Cartesian3_default.fromArray(lastEndPositions, i * 3, rightPos);
449
+ CorridorGeometryLibrary_default.addAttribute(
450
+ finalPositions,
451
+ leftPos,
452
+ void 0,
453
+ back
454
+ );
455
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
456
+ addNormals(attr, normal, left, front, back, vertexFormat);
457
+ LR = front / 3;
458
+ LL = LR - 1;
459
+ UR = (back - 2) / 3;
460
+ UL = UR + 1;
461
+ indices[index++] = UL;
462
+ indices[index++] = LL;
463
+ indices[index++] = UR;
464
+ indices[index++] = UR;
465
+ indices[index++] = LL;
466
+ indices[index++] = LR;
467
+ front += 3;
468
+ back -= 3;
469
+ }
470
+ }
471
+ attributes.position = new GeometryAttribute_default({
472
+ componentDatatype: ComponentDatatype_default.DOUBLE,
473
+ componentsPerAttribute: 3,
474
+ values: finalPositions
475
+ });
476
+ if (vertexFormat.st) {
477
+ const st = new Float32Array(size / 3 * 2);
478
+ let rightSt;
479
+ let leftSt;
480
+ let stIndex = 0;
481
+ if (addEndPositions) {
482
+ leftCount /= 3;
483
+ rightCount /= 3;
484
+ const theta = Math.PI / (endPositionLength + 1);
485
+ leftSt = 1 / (leftCount - endPositionLength + 1);
486
+ rightSt = 1 / (rightCount - endPositionLength + 1);
487
+ let a;
488
+ const halfEndPos = endPositionLength / 2;
489
+ for (i = halfEndPos + 1; i < endPositionLength + 1; i++) {
490
+ a = Math_default.PI_OVER_TWO + theta * i;
491
+ st[stIndex++] = rightSt * (1 + Math.cos(a));
492
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
493
+ }
494
+ for (i = 1; i < rightCount - endPositionLength + 1; i++) {
495
+ st[stIndex++] = i * rightSt;
496
+ st[stIndex++] = 0;
497
+ }
498
+ for (i = endPositionLength; i > halfEndPos; i--) {
499
+ a = Math_default.PI_OVER_TWO - i * theta;
500
+ st[stIndex++] = 1 - rightSt * (1 + Math.cos(a));
501
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
502
+ }
503
+ for (i = halfEndPos; i > 0; i--) {
504
+ a = Math_default.PI_OVER_TWO - theta * i;
505
+ st[stIndex++] = 1 - leftSt * (1 + Math.cos(a));
506
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
507
+ }
508
+ for (i = leftCount - endPositionLength; i > 0; i--) {
509
+ st[stIndex++] = i * leftSt;
510
+ st[stIndex++] = 1;
511
+ }
512
+ for (i = 1; i < halfEndPos + 1; i++) {
513
+ a = Math_default.PI_OVER_TWO + theta * i;
514
+ st[stIndex++] = leftSt * (1 + Math.cos(a));
515
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
516
+ }
517
+ } else {
518
+ leftCount /= 3;
519
+ rightCount /= 3;
520
+ leftSt = 1 / (leftCount - 1);
521
+ rightSt = 1 / (rightCount - 1);
522
+ for (i = 0; i < rightCount; i++) {
523
+ st[stIndex++] = i * rightSt;
524
+ st[stIndex++] = 0;
525
+ }
526
+ for (i = leftCount; i > 0; i--) {
527
+ st[stIndex++] = (i - 1) * leftSt;
528
+ st[stIndex++] = 1;
402
529
  }
403
530
  }
404
-
405
- attributes.position = new GeometryAttribute.GeometryAttribute({
406
- componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
531
+ attributes.st = new GeometryAttribute_default({
532
+ componentDatatype: ComponentDatatype_default.FLOAT,
533
+ componentsPerAttribute: 2,
534
+ values: st
535
+ });
536
+ }
537
+ if (vertexFormat.normal) {
538
+ attributes.normal = new GeometryAttribute_default({
539
+ componentDatatype: ComponentDatatype_default.FLOAT,
407
540
  componentsPerAttribute: 3,
408
- values: finalPositions,
541
+ values: attr.normals
409
542
  });
410
-
411
- if (vertexFormat.st) {
412
- const st = new Float32Array((size / 3) * 2);
413
- let rightSt;
414
- let leftSt;
415
- let stIndex = 0;
416
- if (addEndPositions) {
417
- leftCount /= 3;
418
- rightCount /= 3;
419
- const theta = Math.PI / (endPositionLength + 1);
420
- leftSt = 1 / (leftCount - endPositionLength + 1);
421
- rightSt = 1 / (rightCount - endPositionLength + 1);
422
- let a;
423
- const halfEndPos = endPositionLength / 2;
424
- for (i = halfEndPos + 1; i < endPositionLength + 1; i++) {
425
- // lower left rounded end
426
- a = Math$1.CesiumMath.PI_OVER_TWO + theta * i;
427
- st[stIndex++] = rightSt * (1 + Math.cos(a));
428
- st[stIndex++] = 0.5 * (1 + Math.sin(a));
429
- }
430
- for (i = 1; i < rightCount - endPositionLength + 1; i++) {
431
- // bottom edge
432
- st[stIndex++] = i * rightSt;
433
- st[stIndex++] = 0;
434
- }
435
- for (i = endPositionLength; i > halfEndPos; i--) {
436
- // lower right rounded end
437
- a = Math$1.CesiumMath.PI_OVER_TWO - i * theta;
438
- st[stIndex++] = 1 - rightSt * (1 + Math.cos(a));
439
- st[stIndex++] = 0.5 * (1 + Math.sin(a));
440
- }
441
- for (i = halfEndPos; i > 0; i--) {
442
- // upper right rounded end
443
- a = Math$1.CesiumMath.PI_OVER_TWO - theta * i;
444
- st[stIndex++] = 1 - leftSt * (1 + Math.cos(a));
445
- st[stIndex++] = 0.5 * (1 + Math.sin(a));
446
- }
447
- for (i = leftCount - endPositionLength; i > 0; i--) {
448
- // top edge
449
- st[stIndex++] = i * leftSt;
450
- st[stIndex++] = 1;
451
- }
452
- for (i = 1; i < halfEndPos + 1; i++) {
453
- // upper left rounded end
454
- a = Math$1.CesiumMath.PI_OVER_TWO + theta * i;
455
- st[stIndex++] = leftSt * (1 + Math.cos(a));
456
- st[stIndex++] = 0.5 * (1 + Math.sin(a));
457
- }
458
- } else {
459
- leftCount /= 3;
460
- rightCount /= 3;
461
- leftSt = 1 / (leftCount - 1);
462
- rightSt = 1 / (rightCount - 1);
463
- for (i = 0; i < rightCount; i++) {
464
- // bottom edge
465
- st[stIndex++] = i * rightSt;
466
- st[stIndex++] = 0;
467
- }
468
- for (i = leftCount; i > 0; i--) {
469
- // top edge
470
- st[stIndex++] = (i - 1) * leftSt;
471
- st[stIndex++] = 1;
472
- }
473
- }
474
-
475
- attributes.st = new GeometryAttribute.GeometryAttribute({
476
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
477
- componentsPerAttribute: 2,
478
- values: st,
479
- });
480
- }
481
-
482
- if (vertexFormat.normal) {
483
- attributes.normal = new GeometryAttribute.GeometryAttribute({
484
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
485
- componentsPerAttribute: 3,
486
- values: attr.normals,
487
- });
488
- }
489
-
490
- if (vertexFormat.tangent) {
491
- attributes.tangent = new GeometryAttribute.GeometryAttribute({
492
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
493
- componentsPerAttribute: 3,
494
- values: attr.tangents,
495
- });
496
- }
497
-
498
- if (vertexFormat.bitangent) {
499
- attributes.bitangent = new GeometryAttribute.GeometryAttribute({
500
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
501
- componentsPerAttribute: 3,
502
- values: attr.bitangents,
503
- });
504
- }
505
-
506
- return {
507
- attributes: attributes,
508
- indices: indices,
509
- };
510
543
  }
511
-
512
- function extrudedAttributes(attributes, vertexFormat) {
513
- if (
514
- !vertexFormat.normal &&
515
- !vertexFormat.tangent &&
516
- !vertexFormat.bitangent &&
517
- !vertexFormat.st
518
- ) {
519
- return attributes;
520
- }
521
- const positions = attributes.position.values;
522
- let topNormals;
523
- let topBitangents;
524
- if (vertexFormat.normal || vertexFormat.bitangent) {
525
- topNormals = attributes.normal.values;
526
- topBitangents = attributes.bitangent.values;
527
- }
528
- const size = attributes.position.values.length / 18;
529
- const threeSize = size * 3;
530
- const twoSize = size * 2;
531
- const sixSize = threeSize * 2;
532
- let i;
533
- if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) {
534
- const normals = vertexFormat.normal
535
- ? new Float32Array(threeSize * 6)
536
- : undefined;
537
- const tangents = vertexFormat.tangent
538
- ? new Float32Array(threeSize * 6)
539
- : undefined;
540
- const bitangents = vertexFormat.bitangent
541
- ? new Float32Array(threeSize * 6)
542
- : undefined;
543
- let topPosition = cartesian1;
544
- let bottomPosition = cartesian2;
545
- let previousPosition = cartesian3;
546
- let normal = cartesian4;
547
- let tangent = cartesian5;
548
- let bitangent = cartesian6;
549
- let attrIndex = sixSize;
550
- for (i = 0; i < threeSize; i += 3) {
551
- const attrIndexOffset = attrIndex + sixSize;
552
- topPosition = Matrix3.Cartesian3.fromArray(positions, i, topPosition);
553
- bottomPosition = Matrix3.Cartesian3.fromArray(
554
- positions,
555
- i + threeSize,
556
- bottomPosition
557
- );
558
- previousPosition = Matrix3.Cartesian3.fromArray(
559
- positions,
560
- (i + 3) % threeSize,
561
- previousPosition
562
- );
563
- bottomPosition = Matrix3.Cartesian3.subtract(
564
- bottomPosition,
565
- topPosition,
566
- bottomPosition
567
- );
568
- previousPosition = Matrix3.Cartesian3.subtract(
569
- previousPosition,
570
- topPosition,
571
- previousPosition
572
- );
573
- normal = Matrix3.Cartesian3.normalize(
574
- Matrix3.Cartesian3.cross(bottomPosition, previousPosition, normal),
575
- normal
544
+ if (vertexFormat.tangent) {
545
+ attributes.tangent = new GeometryAttribute_default({
546
+ componentDatatype: ComponentDatatype_default.FLOAT,
547
+ componentsPerAttribute: 3,
548
+ values: attr.tangents
549
+ });
550
+ }
551
+ if (vertexFormat.bitangent) {
552
+ attributes.bitangent = new GeometryAttribute_default({
553
+ componentDatatype: ComponentDatatype_default.FLOAT,
554
+ componentsPerAttribute: 3,
555
+ values: attr.bitangents
556
+ });
557
+ }
558
+ return {
559
+ attributes,
560
+ indices
561
+ };
562
+ }
563
+ function extrudedAttributes(attributes, vertexFormat) {
564
+ if (!vertexFormat.normal && !vertexFormat.tangent && !vertexFormat.bitangent && !vertexFormat.st) {
565
+ return attributes;
566
+ }
567
+ const positions = attributes.position.values;
568
+ let topNormals;
569
+ let topBitangents;
570
+ if (vertexFormat.normal || vertexFormat.bitangent) {
571
+ topNormals = attributes.normal.values;
572
+ topBitangents = attributes.bitangent.values;
573
+ }
574
+ const size = attributes.position.values.length / 18;
575
+ const threeSize = size * 3;
576
+ const twoSize = size * 2;
577
+ const sixSize = threeSize * 2;
578
+ let i;
579
+ if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) {
580
+ const normals = vertexFormat.normal ? new Float32Array(threeSize * 6) : void 0;
581
+ const tangents = vertexFormat.tangent ? new Float32Array(threeSize * 6) : void 0;
582
+ const bitangents = vertexFormat.bitangent ? new Float32Array(threeSize * 6) : void 0;
583
+ let topPosition = cartesian1;
584
+ let bottomPosition = cartesian2;
585
+ let previousPosition = cartesian3;
586
+ let normal = cartesian4;
587
+ let tangent = cartesian5;
588
+ let bitangent = cartesian6;
589
+ let attrIndex = sixSize;
590
+ for (i = 0; i < threeSize; i += 3) {
591
+ const attrIndexOffset = attrIndex + sixSize;
592
+ topPosition = Cartesian3_default.fromArray(positions, i, topPosition);
593
+ bottomPosition = Cartesian3_default.fromArray(
594
+ positions,
595
+ i + threeSize,
596
+ bottomPosition
597
+ );
598
+ previousPosition = Cartesian3_default.fromArray(
599
+ positions,
600
+ (i + 3) % threeSize,
601
+ previousPosition
602
+ );
603
+ bottomPosition = Cartesian3_default.subtract(
604
+ bottomPosition,
605
+ topPosition,
606
+ bottomPosition
607
+ );
608
+ previousPosition = Cartesian3_default.subtract(
609
+ previousPosition,
610
+ topPosition,
611
+ previousPosition
612
+ );
613
+ normal = Cartesian3_default.normalize(
614
+ Cartesian3_default.cross(bottomPosition, previousPosition, normal),
615
+ normal
616
+ );
617
+ if (vertexFormat.normal) {
618
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, attrIndexOffset);
619
+ CorridorGeometryLibrary_default.addAttribute(
620
+ normals,
621
+ normal,
622
+ attrIndexOffset + 3
576
623
  );
577
- if (vertexFormat.normal) {
578
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, attrIndexOffset);
579
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
580
- normals,
581
- normal,
624
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, attrIndex);
625
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, attrIndex + 3);
626
+ }
627
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
628
+ bitangent = Cartesian3_default.fromArray(topNormals, i, bitangent);
629
+ if (vertexFormat.bitangent) {
630
+ CorridorGeometryLibrary_default.addAttribute(
631
+ bitangents,
632
+ bitangent,
633
+ attrIndexOffset
634
+ );
635
+ CorridorGeometryLibrary_default.addAttribute(
636
+ bitangents,
637
+ bitangent,
582
638
  attrIndexOffset + 3
583
639
  );
584
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex);
585
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex + 3);
586
- }
587
- if (vertexFormat.tangent || vertexFormat.bitangent) {
588
- bitangent = Matrix3.Cartesian3.fromArray(topNormals, i, bitangent);
589
- if (vertexFormat.bitangent) {
590
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
591
- bitangents,
592
- bitangent,
593
- attrIndexOffset
594
- );
595
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
596
- bitangents,
597
- bitangent,
598
- attrIndexOffset + 3
599
- );
600
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
601
- bitangents,
602
- bitangent,
603
- attrIndex
604
- );
605
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
606
- bitangents,
607
- bitangent,
608
- attrIndex + 3
609
- );
610
- }
611
-
612
- if (vertexFormat.tangent) {
613
- tangent = Matrix3.Cartesian3.normalize(
614
- Matrix3.Cartesian3.cross(bitangent, normal, tangent),
615
- tangent
616
- );
617
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
618
- tangents,
619
- tangent,
620
- attrIndexOffset
621
- );
622
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
623
- tangents,
624
- tangent,
625
- attrIndexOffset + 3
626
- );
627
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndex);
628
- CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
629
- tangents,
630
- tangent,
631
- attrIndex + 3
632
- );
633
- }
640
+ CorridorGeometryLibrary_default.addAttribute(
641
+ bitangents,
642
+ bitangent,
643
+ attrIndex
644
+ );
645
+ CorridorGeometryLibrary_default.addAttribute(
646
+ bitangents,
647
+ bitangent,
648
+ attrIndex + 3
649
+ );
634
650
  }
635
- attrIndex += 6;
636
- }
637
-
638
- if (vertexFormat.normal) {
639
- normals.set(topNormals); //top
640
- for (i = 0; i < threeSize; i += 3) {
641
- //bottom normals
642
- normals[i + threeSize] = -topNormals[i];
643
- normals[i + threeSize + 1] = -topNormals[i + 1];
644
- normals[i + threeSize + 2] = -topNormals[i + 2];
651
+ if (vertexFormat.tangent) {
652
+ tangent = Cartesian3_default.normalize(
653
+ Cartesian3_default.cross(bitangent, normal, tangent),
654
+ tangent
655
+ );
656
+ CorridorGeometryLibrary_default.addAttribute(
657
+ tangents,
658
+ tangent,
659
+ attrIndexOffset
660
+ );
661
+ CorridorGeometryLibrary_default.addAttribute(
662
+ tangents,
663
+ tangent,
664
+ attrIndexOffset + 3
665
+ );
666
+ CorridorGeometryLibrary_default.addAttribute(tangents, tangent, attrIndex);
667
+ CorridorGeometryLibrary_default.addAttribute(
668
+ tangents,
669
+ tangent,
670
+ attrIndex + 3
671
+ );
645
672
  }
646
- attributes.normal.values = normals;
647
- } else {
648
- attributes.normal = undefined;
649
- }
650
-
651
- if (vertexFormat.bitangent) {
652
- bitangents.set(topBitangents); //top
653
- bitangents.set(topBitangents, threeSize); //bottom
654
- attributes.bitangent.values = bitangents;
655
- } else {
656
- attributes.bitangent = undefined;
657
- }
658
-
659
- if (vertexFormat.tangent) {
660
- const topTangents = attributes.tangent.values;
661
- tangents.set(topTangents); //top
662
- tangents.set(topTangents, threeSize); //bottom
663
- attributes.tangent.values = tangents;
664
673
  }
674
+ attrIndex += 6;
665
675
  }
666
- if (vertexFormat.st) {
667
- const topSt = attributes.st.values;
668
- const st = new Float32Array(twoSize * 6);
669
- st.set(topSt); //top
670
- st.set(topSt, twoSize); //bottom
671
- let index = twoSize * 2;
672
-
673
- for (let j = 0; j < 2; j++) {
674
- st[index++] = topSt[0];
675
- st[index++] = topSt[1];
676
- for (i = 2; i < twoSize; i += 2) {
677
- const s = topSt[i];
678
- const t = topSt[i + 1];
679
- st[index++] = s;
680
- st[index++] = t;
681
- st[index++] = s;
682
- st[index++] = t;
683
- }
684
- st[index++] = topSt[0];
685
- st[index++] = topSt[1];
676
+ if (vertexFormat.normal) {
677
+ normals.set(topNormals);
678
+ for (i = 0; i < threeSize; i += 3) {
679
+ normals[i + threeSize] = -topNormals[i];
680
+ normals[i + threeSize + 1] = -topNormals[i + 1];
681
+ normals[i + threeSize + 2] = -topNormals[i + 2];
686
682
  }
687
- attributes.st.values = st;
683
+ attributes.normal.values = normals;
684
+ } else {
685
+ attributes.normal = void 0;
688
686
  }
689
-
690
- return attributes;
691
- }
692
-
693
- function addWallPositions(positions, index, wallPositions) {
694
- wallPositions[index++] = positions[0];
695
- wallPositions[index++] = positions[1];
696
- wallPositions[index++] = positions[2];
697
- for (let i = 3; i < positions.length; i += 3) {
698
- const x = positions[i];
699
- const y = positions[i + 1];
700
- const z = positions[i + 2];
701
- wallPositions[index++] = x;
702
- wallPositions[index++] = y;
703
- wallPositions[index++] = z;
704
- wallPositions[index++] = x;
705
- wallPositions[index++] = y;
706
- wallPositions[index++] = z;
687
+ if (vertexFormat.bitangent) {
688
+ bitangents.set(topBitangents);
689
+ bitangents.set(topBitangents, threeSize);
690
+ attributes.bitangent.values = bitangents;
691
+ } else {
692
+ attributes.bitangent = void 0;
693
+ }
694
+ if (vertexFormat.tangent) {
695
+ const topTangents = attributes.tangent.values;
696
+ tangents.set(topTangents);
697
+ tangents.set(topTangents, threeSize);
698
+ attributes.tangent.values = tangents;
707
699
  }
708
- wallPositions[index++] = positions[0];
709
- wallPositions[index++] = positions[1];
710
- wallPositions[index++] = positions[2];
711
-
712
- return wallPositions;
713
700
  }
714
-
715
- function computePositionsExtruded(params, vertexFormat) {
716
- const topVertexFormat = new VertexFormat.VertexFormat({
717
- position: vertexFormat.position,
718
- normal:
719
- vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume,
720
- tangent: vertexFormat.tangent,
721
- bitangent: vertexFormat.normal || vertexFormat.bitangent,
722
- st: vertexFormat.st,
723
- });
724
- const ellipsoid = params.ellipsoid;
725
- const computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
726
- const attr = combine(computedPositions, topVertexFormat, ellipsoid);
727
- const height = params.height;
728
- const extrudedHeight = params.extrudedHeight;
729
- let attributes = attr.attributes;
730
- const indices = attr.indices;
731
- let positions = attributes.position.values;
732
- let length = positions.length;
733
- const newPositions = new Float64Array(length * 6);
734
- let extrudedPositions = new Float64Array(length);
735
- extrudedPositions.set(positions);
736
- let wallPositions = new Float64Array(length * 4);
737
-
738
- positions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
739
- positions,
740
- height,
741
- ellipsoid
742
- );
743
- wallPositions = addWallPositions(positions, 0, wallPositions);
744
- extrudedPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
745
- extrudedPositions,
746
- extrudedHeight,
747
- ellipsoid
748
- );
749
- wallPositions = addWallPositions(
750
- extrudedPositions,
751
- length * 2,
752
- wallPositions
753
- );
754
- newPositions.set(positions);
755
- newPositions.set(extrudedPositions, length);
756
- newPositions.set(wallPositions, length * 2);
757
- attributes.position.values = newPositions;
758
-
759
- attributes = extrudedAttributes(attributes, vertexFormat);
760
- let i;
761
- const size = length / 3;
762
- if (params.shadowVolume) {
763
- const topNormals = attributes.normal.values;
764
- length = topNormals.length;
765
-
766
- let extrudeNormals = new Float32Array(length * 6);
767
- for (i = 0; i < length; i++) {
768
- topNormals[i] = -topNormals[i];
769
- }
770
- //only get normals for bottom layer that's going to be pushed down
771
- extrudeNormals.set(topNormals, length); //bottom face
772
- extrudeNormals = addWallPositions(topNormals, length * 4, extrudeNormals); //bottom wall
773
- attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
774
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
775
- componentsPerAttribute: 3,
776
- values: extrudeNormals,
777
- });
778
- if (!vertexFormat.normal) {
779
- attributes.normal = undefined;
701
+ if (vertexFormat.st) {
702
+ const topSt = attributes.st.values;
703
+ const st = new Float32Array(twoSize * 6);
704
+ st.set(topSt);
705
+ st.set(topSt, twoSize);
706
+ let index = twoSize * 2;
707
+ for (let j = 0; j < 2; j++) {
708
+ st[index++] = topSt[0];
709
+ st[index++] = topSt[1];
710
+ for (i = 2; i < twoSize; i += 2) {
711
+ const s = topSt[i];
712
+ const t = topSt[i + 1];
713
+ st[index++] = s;
714
+ st[index++] = t;
715
+ st[index++] = s;
716
+ st[index++] = t;
780
717
  }
718
+ st[index++] = topSt[0];
719
+ st[index++] = topSt[1];
781
720
  }
782
- if (defaultValue.defined(params.offsetAttribute)) {
783
- let applyOffset = new Uint8Array(size * 6);
784
- if (params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
785
- applyOffset = applyOffset
786
- .fill(1, 0, size) // top face
787
- .fill(1, size * 2, size * 4); // top wall
788
- } else {
789
- const applyOffsetValue =
790
- params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
791
- applyOffset = applyOffset.fill(applyOffsetValue);
792
- }
793
- attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
794
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
795
- componentsPerAttribute: 1,
796
- values: applyOffset,
797
- });
721
+ attributes.st.values = st;
722
+ }
723
+ return attributes;
724
+ }
725
+ function addWallPositions(positions, index, wallPositions) {
726
+ wallPositions[index++] = positions[0];
727
+ wallPositions[index++] = positions[1];
728
+ wallPositions[index++] = positions[2];
729
+ for (let i = 3; i < positions.length; i += 3) {
730
+ const x = positions[i];
731
+ const y = positions[i + 1];
732
+ const z = positions[i + 2];
733
+ wallPositions[index++] = x;
734
+ wallPositions[index++] = y;
735
+ wallPositions[index++] = z;
736
+ wallPositions[index++] = x;
737
+ wallPositions[index++] = y;
738
+ wallPositions[index++] = z;
739
+ }
740
+ wallPositions[index++] = positions[0];
741
+ wallPositions[index++] = positions[1];
742
+ wallPositions[index++] = positions[2];
743
+ return wallPositions;
744
+ }
745
+ function computePositionsExtruded(params, vertexFormat) {
746
+ const topVertexFormat = new VertexFormat_default({
747
+ position: vertexFormat.position,
748
+ normal: vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume,
749
+ tangent: vertexFormat.tangent,
750
+ bitangent: vertexFormat.normal || vertexFormat.bitangent,
751
+ st: vertexFormat.st
752
+ });
753
+ const ellipsoid = params.ellipsoid;
754
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
755
+ const attr = combine(computedPositions, topVertexFormat, ellipsoid);
756
+ const height = params.height;
757
+ const extrudedHeight = params.extrudedHeight;
758
+ let attributes = attr.attributes;
759
+ const indices = attr.indices;
760
+ let positions = attributes.position.values;
761
+ let length = positions.length;
762
+ const newPositions = new Float64Array(length * 6);
763
+ let extrudedPositions = new Float64Array(length);
764
+ extrudedPositions.set(positions);
765
+ let wallPositions = new Float64Array(length * 4);
766
+ positions = PolygonPipeline_default.scaleToGeodeticHeight(
767
+ positions,
768
+ height,
769
+ ellipsoid
770
+ );
771
+ wallPositions = addWallPositions(positions, 0, wallPositions);
772
+ extrudedPositions = PolygonPipeline_default.scaleToGeodeticHeight(
773
+ extrudedPositions,
774
+ extrudedHeight,
775
+ ellipsoid
776
+ );
777
+ wallPositions = addWallPositions(
778
+ extrudedPositions,
779
+ length * 2,
780
+ wallPositions
781
+ );
782
+ newPositions.set(positions);
783
+ newPositions.set(extrudedPositions, length);
784
+ newPositions.set(wallPositions, length * 2);
785
+ attributes.position.values = newPositions;
786
+ attributes = extrudedAttributes(attributes, vertexFormat);
787
+ let i;
788
+ const size = length / 3;
789
+ if (params.shadowVolume) {
790
+ const topNormals = attributes.normal.values;
791
+ length = topNormals.length;
792
+ let extrudeNormals = new Float32Array(length * 6);
793
+ for (i = 0; i < length; i++) {
794
+ topNormals[i] = -topNormals[i];
798
795
  }
799
-
800
- const iLength = indices.length;
801
- const twoSize = size + size;
802
- const newIndices = IndexDatatype.IndexDatatype.createTypedArray(
803
- newPositions.length / 3,
804
- iLength * 2 + twoSize * 3
805
- );
806
- newIndices.set(indices);
807
- let index = iLength;
808
- for (i = 0; i < iLength; i += 3) {
809
- // bottom indices
810
- const v0 = indices[i];
811
- const v1 = indices[i + 1];
812
- const v2 = indices[i + 2];
813
- newIndices[index++] = v2 + size;
814
- newIndices[index++] = v1 + size;
815
- newIndices[index++] = v0 + size;
796
+ extrudeNormals.set(topNormals, length);
797
+ extrudeNormals = addWallPositions(topNormals, length * 4, extrudeNormals);
798
+ attributes.extrudeDirection = new GeometryAttribute_default({
799
+ componentDatatype: ComponentDatatype_default.FLOAT,
800
+ componentsPerAttribute: 3,
801
+ values: extrudeNormals
802
+ });
803
+ if (!vertexFormat.normal) {
804
+ attributes.normal = void 0;
816
805
  }
817
-
818
- let UL, LL, UR, LR;
819
-
820
- for (i = 0; i < twoSize; i += 2) {
821
- //wall indices
822
- UL = i + twoSize;
823
- LL = UL + twoSize;
824
- UR = UL + 1;
825
- LR = LL + 1;
826
- newIndices[index++] = UL;
827
- newIndices[index++] = LL;
828
- newIndices[index++] = UR;
829
- newIndices[index++] = UR;
830
- newIndices[index++] = LL;
831
- newIndices[index++] = LR;
806
+ }
807
+ if (defined_default(params.offsetAttribute)) {
808
+ let applyOffset = new Uint8Array(size * 6);
809
+ if (params.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
810
+ applyOffset = applyOffset.fill(1, 0, size).fill(1, size * 2, size * 4);
811
+ } else {
812
+ const applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
813
+ applyOffset = applyOffset.fill(applyOffsetValue);
832
814
  }
833
-
834
- return {
835
- attributes: attributes,
836
- indices: newIndices,
837
- };
815
+ attributes.applyOffset = new GeometryAttribute_default({
816
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
817
+ componentsPerAttribute: 1,
818
+ values: applyOffset
819
+ });
838
820
  }
839
-
840
- const scratchCartesian1 = new Matrix3.Cartesian3();
841
- const scratchCartesian2 = new Matrix3.Cartesian3();
842
- const scratchCartographic = new Matrix3.Cartographic();
843
-
844
- function computeOffsetPoints(
845
- position1,
821
+ const iLength = indices.length;
822
+ const twoSize = size + size;
823
+ const newIndices = IndexDatatype_default.createTypedArray(
824
+ newPositions.length / 3,
825
+ iLength * 2 + twoSize * 3
826
+ );
827
+ newIndices.set(indices);
828
+ let index = iLength;
829
+ for (i = 0; i < iLength; i += 3) {
830
+ const v0 = indices[i];
831
+ const v1 = indices[i + 1];
832
+ const v2 = indices[i + 2];
833
+ newIndices[index++] = v2 + size;
834
+ newIndices[index++] = v1 + size;
835
+ newIndices[index++] = v0 + size;
836
+ }
837
+ let UL, LL, UR, LR;
838
+ for (i = 0; i < twoSize; i += 2) {
839
+ UL = i + twoSize;
840
+ LL = UL + twoSize;
841
+ UR = UL + 1;
842
+ LR = LL + 1;
843
+ newIndices[index++] = UL;
844
+ newIndices[index++] = LL;
845
+ newIndices[index++] = UR;
846
+ newIndices[index++] = UR;
847
+ newIndices[index++] = LL;
848
+ newIndices[index++] = LR;
849
+ }
850
+ return {
851
+ attributes,
852
+ indices: newIndices
853
+ };
854
+ }
855
+ var scratchCartesian1 = new Cartesian3_default();
856
+ var scratchCartesian2 = new Cartesian3_default();
857
+ var scratchCartographic = new Cartographic_default();
858
+ function computeOffsetPoints(position1, position2, ellipsoid, halfWidth, min, max) {
859
+ const direction = Cartesian3_default.subtract(
846
860
  position2,
847
- ellipsoid,
848
- halfWidth,
849
- min,
850
- max
851
- ) {
852
- // Compute direction of offset the point
853
- const direction = Matrix3.Cartesian3.subtract(
854
- position2,
855
- position1,
856
- scratchCartesian1
861
+ position1,
862
+ scratchCartesian1
863
+ );
864
+ Cartesian3_default.normalize(direction, direction);
865
+ const normal = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian2);
866
+ const offsetDirection = Cartesian3_default.cross(
867
+ direction,
868
+ normal,
869
+ scratchCartesian1
870
+ );
871
+ Cartesian3_default.multiplyByScalar(offsetDirection, halfWidth, offsetDirection);
872
+ let minLat = min.latitude;
873
+ let minLon = min.longitude;
874
+ let maxLat = max.latitude;
875
+ let maxLon = max.longitude;
876
+ Cartesian3_default.add(position1, offsetDirection, scratchCartesian2);
877
+ ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
878
+ let lat = scratchCartographic.latitude;
879
+ let lon = scratchCartographic.longitude;
880
+ minLat = Math.min(minLat, lat);
881
+ minLon = Math.min(minLon, lon);
882
+ maxLat = Math.max(maxLat, lat);
883
+ maxLon = Math.max(maxLon, lon);
884
+ Cartesian3_default.subtract(position1, offsetDirection, scratchCartesian2);
885
+ ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
886
+ lat = scratchCartographic.latitude;
887
+ lon = scratchCartographic.longitude;
888
+ minLat = Math.min(minLat, lat);
889
+ minLon = Math.min(minLon, lon);
890
+ maxLat = Math.max(maxLat, lat);
891
+ maxLon = Math.max(maxLon, lon);
892
+ min.latitude = minLat;
893
+ min.longitude = minLon;
894
+ max.latitude = maxLat;
895
+ max.longitude = maxLon;
896
+ }
897
+ var scratchCartesianOffset = new Cartesian3_default();
898
+ var scratchCartesianEnds = new Cartesian3_default();
899
+ var scratchCartographicMin = new Cartographic_default();
900
+ var scratchCartographicMax = new Cartographic_default();
901
+ function computeRectangle(positions, ellipsoid, width, cornerType, result) {
902
+ positions = scaleToSurface(positions, ellipsoid);
903
+ const cleanPositions = arrayRemoveDuplicates_default(
904
+ positions,
905
+ Cartesian3_default.equalsEpsilon
906
+ );
907
+ const length = cleanPositions.length;
908
+ if (length < 2 || width <= 0) {
909
+ return new Rectangle_default();
910
+ }
911
+ const halfWidth = width * 0.5;
912
+ scratchCartographicMin.latitude = Number.POSITIVE_INFINITY;
913
+ scratchCartographicMin.longitude = Number.POSITIVE_INFINITY;
914
+ scratchCartographicMax.latitude = Number.NEGATIVE_INFINITY;
915
+ scratchCartographicMax.longitude = Number.NEGATIVE_INFINITY;
916
+ let lat, lon;
917
+ if (cornerType === CornerType_default.ROUNDED) {
918
+ const first = cleanPositions[0];
919
+ Cartesian3_default.subtract(first, cleanPositions[1], scratchCartesianOffset);
920
+ Cartesian3_default.normalize(scratchCartesianOffset, scratchCartesianOffset);
921
+ Cartesian3_default.multiplyByScalar(
922
+ scratchCartesianOffset,
923
+ halfWidth,
924
+ scratchCartesianOffset
857
925
  );
858
- Matrix3.Cartesian3.normalize(direction, direction);
859
- const normal = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian2);
860
- const offsetDirection = Matrix3.Cartesian3.cross(
861
- direction,
862
- normal,
863
- scratchCartesian1
926
+ Cartesian3_default.add(first, scratchCartesianOffset, scratchCartesianEnds);
927
+ ellipsoid.cartesianToCartographic(
928
+ scratchCartesianEnds,
929
+ scratchCartographic
864
930
  );
865
- Matrix3.Cartesian3.multiplyByScalar(offsetDirection, halfWidth, offsetDirection);
866
-
867
- let minLat = min.latitude;
868
- let minLon = min.longitude;
869
- let maxLat = max.latitude;
870
- let maxLon = max.longitude;
871
-
872
- // Compute 2 offset points
873
- Matrix3.Cartesian3.add(position1, offsetDirection, scratchCartesian2);
874
- ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
875
-
876
- let lat = scratchCartographic.latitude;
877
- let lon = scratchCartographic.longitude;
878
- minLat = Math.min(minLat, lat);
879
- minLon = Math.min(minLon, lon);
880
- maxLat = Math.max(maxLat, lat);
881
- maxLon = Math.max(maxLon, lon);
882
-
883
- Matrix3.Cartesian3.subtract(position1, offsetDirection, scratchCartesian2);
884
- ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
885
-
886
931
  lat = scratchCartographic.latitude;
887
932
  lon = scratchCartographic.longitude;
888
- minLat = Math.min(minLat, lat);
889
- minLon = Math.min(minLon, lon);
890
- maxLat = Math.max(maxLat, lat);
891
- maxLon = Math.max(maxLon, lon);
892
-
893
- min.latitude = minLat;
894
- min.longitude = minLon;
895
- max.latitude = maxLat;
896
- max.longitude = maxLon;
897
- }
898
-
899
- const scratchCartesianOffset = new Matrix3.Cartesian3();
900
- const scratchCartesianEnds = new Matrix3.Cartesian3();
901
- const scratchCartographicMin = new Matrix3.Cartographic();
902
- const scratchCartographicMax = new Matrix3.Cartographic();
903
-
904
- function computeRectangle(positions, ellipsoid, width, cornerType, result) {
905
- positions = scaleToSurface(positions, ellipsoid);
906
- const cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
907
- positions,
908
- Matrix3.Cartesian3.equalsEpsilon
933
+ scratchCartographicMin.latitude = Math.min(
934
+ scratchCartographicMin.latitude,
935
+ lat
909
936
  );
910
- const length = cleanPositions.length;
911
- if (length < 2 || width <= 0) {
912
- return new Matrix2.Rectangle();
913
- }
914
- const halfWidth = width * 0.5;
915
-
916
- scratchCartographicMin.latitude = Number.POSITIVE_INFINITY;
917
- scratchCartographicMin.longitude = Number.POSITIVE_INFINITY;
918
- scratchCartographicMax.latitude = Number.NEGATIVE_INFINITY;
919
- scratchCartographicMax.longitude = Number.NEGATIVE_INFINITY;
920
-
921
- let lat, lon;
922
- if (cornerType === PolylineVolumeGeometryLibrary.CornerType.ROUNDED) {
923
- // Compute start cap
924
- const first = cleanPositions[0];
925
- Matrix3.Cartesian3.subtract(first, cleanPositions[1], scratchCartesianOffset);
926
- Matrix3.Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);
927
- Matrix3.Cartesian3.multiplyByScalar(
928
- scratchCartesianOffset,
929
- halfWidth,
930
- scratchCartesianOffset
931
- );
932
- Matrix3.Cartesian3.add(first, scratchCartesianOffset, scratchCartesianEnds);
933
-
934
- ellipsoid.cartesianToCartographic(
935
- scratchCartesianEnds,
936
- scratchCartographic
937
- );
938
- lat = scratchCartographic.latitude;
939
- lon = scratchCartographic.longitude;
940
- scratchCartographicMin.latitude = Math.min(
941
- scratchCartographicMin.latitude,
942
- lat
943
- );
944
- scratchCartographicMin.longitude = Math.min(
945
- scratchCartographicMin.longitude,
946
- lon
947
- );
948
- scratchCartographicMax.latitude = Math.max(
949
- scratchCartographicMax.latitude,
950
- lat
951
- );
952
- scratchCartographicMax.longitude = Math.max(
953
- scratchCartographicMax.longitude,
954
- lon
955
- );
956
- }
957
-
958
- // Compute the rest
959
- for (let i = 0; i < length - 1; ++i) {
960
- computeOffsetPoints(
961
- cleanPositions[i],
962
- cleanPositions[i + 1],
963
- ellipsoid,
964
- halfWidth,
965
- scratchCartographicMin,
966
- scratchCartographicMax
967
- );
968
- }
969
-
970
- // Compute ending point
971
- const last = cleanPositions[length - 1];
972
- Matrix3.Cartesian3.subtract(last, cleanPositions[length - 2], scratchCartesianOffset);
973
- Matrix3.Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);
974
- Matrix3.Cartesian3.multiplyByScalar(
975
- scratchCartesianOffset,
976
- halfWidth,
977
- scratchCartesianOffset
937
+ scratchCartographicMin.longitude = Math.min(
938
+ scratchCartographicMin.longitude,
939
+ lon
940
+ );
941
+ scratchCartographicMax.latitude = Math.max(
942
+ scratchCartographicMax.latitude,
943
+ lat
978
944
  );
979
- Matrix3.Cartesian3.add(last, scratchCartesianOffset, scratchCartesianEnds);
945
+ scratchCartographicMax.longitude = Math.max(
946
+ scratchCartographicMax.longitude,
947
+ lon
948
+ );
949
+ }
950
+ for (let i = 0; i < length - 1; ++i) {
980
951
  computeOffsetPoints(
981
- last,
982
- scratchCartesianEnds,
952
+ cleanPositions[i],
953
+ cleanPositions[i + 1],
983
954
  ellipsoid,
984
955
  halfWidth,
985
956
  scratchCartographicMin,
986
957
  scratchCartographicMax
987
958
  );
988
-
989
- if (cornerType === PolylineVolumeGeometryLibrary.CornerType.ROUNDED) {
990
- // Compute end cap
991
- ellipsoid.cartesianToCartographic(
992
- scratchCartesianEnds,
993
- scratchCartographic
994
- );
995
- lat = scratchCartographic.latitude;
996
- lon = scratchCartographic.longitude;
997
- scratchCartographicMin.latitude = Math.min(
998
- scratchCartographicMin.latitude,
999
- lat
1000
- );
1001
- scratchCartographicMin.longitude = Math.min(
1002
- scratchCartographicMin.longitude,
1003
- lon
1004
- );
1005
- scratchCartographicMax.latitude = Math.max(
1006
- scratchCartographicMax.latitude,
1007
- lat
1008
- );
1009
- scratchCartographicMax.longitude = Math.max(
1010
- scratchCartographicMax.longitude,
1011
- lon
1012
- );
1013
- }
1014
-
1015
- const rectangle = defaultValue.defined(result) ? result : new Matrix2.Rectangle();
1016
- rectangle.north = scratchCartographicMax.latitude;
1017
- rectangle.south = scratchCartographicMin.latitude;
1018
- rectangle.east = scratchCartographicMax.longitude;
1019
- rectangle.west = scratchCartographicMin.longitude;
1020
-
1021
- return rectangle;
1022
959
  }
1023
-
1024
- /**
1025
- * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
1026
- *
1027
- * @alias CorridorGeometry
1028
- * @constructor
1029
- *
1030
- * @param {object} options Object with the following properties:
1031
- * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.
1032
- * @param {number} options.width The distance between the edges of the corridor in meters.
1033
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
1034
- * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
1035
- * @param {number} [options.height=0] The distance in meters between the ellipsoid surface and the positions.
1036
- * @param {number} [options.extrudedHeight] The distance in meters between the ellipsoid surface and the extruded face.
1037
- * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
1038
- * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
1039
- *
1040
- * @see CorridorGeometry.createGeometry
1041
- * @see Packable
1042
- *
1043
- * @demo {@link https://sandcastle.cesium.com/index.html?src=Corridor.html|Cesium Sandcastle Corridor Demo}
1044
- *
1045
- * @example
1046
- * const corridor = new Cesium.CorridorGeometry({
1047
- * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
1048
- * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
1049
- * width : 100000
1050
- * });
1051
- */
1052
- function CorridorGeometry(options) {
1053
- options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
1054
- const positions = options.positions;
1055
- const width = options.width;
1056
-
1057
- //>>includeStart('debug', pragmas.debug);
1058
- Check.Check.defined("options.positions", positions);
1059
- Check.Check.defined("options.width", width);
1060
- //>>includeEnd('debug');
1061
-
1062
- const height = defaultValue.defaultValue(options.height, 0.0);
1063
- const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
1064
-
1065
- this._positions = positions;
1066
- this._ellipsoid = Matrix3.Ellipsoid.clone(
1067
- defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
960
+ const last = cleanPositions[length - 1];
961
+ Cartesian3_default.subtract(last, cleanPositions[length - 2], scratchCartesianOffset);
962
+ Cartesian3_default.normalize(scratchCartesianOffset, scratchCartesianOffset);
963
+ Cartesian3_default.multiplyByScalar(
964
+ scratchCartesianOffset,
965
+ halfWidth,
966
+ scratchCartesianOffset
967
+ );
968
+ Cartesian3_default.add(last, scratchCartesianOffset, scratchCartesianEnds);
969
+ computeOffsetPoints(
970
+ last,
971
+ scratchCartesianEnds,
972
+ ellipsoid,
973
+ halfWidth,
974
+ scratchCartographicMin,
975
+ scratchCartographicMax
976
+ );
977
+ if (cornerType === CornerType_default.ROUNDED) {
978
+ ellipsoid.cartesianToCartographic(
979
+ scratchCartesianEnds,
980
+ scratchCartographic
1068
981
  );
1069
- this._vertexFormat = VertexFormat.VertexFormat.clone(
1070
- defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT)
982
+ lat = scratchCartographic.latitude;
983
+ lon = scratchCartographic.longitude;
984
+ scratchCartographicMin.latitude = Math.min(
985
+ scratchCartographicMin.latitude,
986
+ lat
1071
987
  );
1072
- this._width = width;
1073
- this._height = Math.max(height, extrudedHeight);
1074
- this._extrudedHeight = Math.min(height, extrudedHeight);
1075
- this._cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
1076
- this._granularity = defaultValue.defaultValue(
1077
- options.granularity,
1078
- Math$1.CesiumMath.RADIANS_PER_DEGREE
988
+ scratchCartographicMin.longitude = Math.min(
989
+ scratchCartographicMin.longitude,
990
+ lon
991
+ );
992
+ scratchCartographicMax.latitude = Math.max(
993
+ scratchCartographicMax.latitude,
994
+ lat
995
+ );
996
+ scratchCartographicMax.longitude = Math.max(
997
+ scratchCartographicMax.longitude,
998
+ lon
1079
999
  );
1080
- this._shadowVolume = defaultValue.defaultValue(options.shadowVolume, false);
1081
- this._workerName = "createCorridorGeometry";
1082
- this._offsetAttribute = options.offsetAttribute;
1083
- this._rectangle = undefined;
1084
-
1085
- /**
1086
- * The number of elements used to pack the object into an array.
1087
- * @type {number}
1088
- */
1089
- this.packedLength =
1090
- 1 +
1091
- positions.length * Matrix3.Cartesian3.packedLength +
1092
- Matrix3.Ellipsoid.packedLength +
1093
- VertexFormat.VertexFormat.packedLength +
1094
- 7;
1095
1000
  }
1096
-
1097
- /**
1098
- * Stores the provided instance into the provided array.
1099
- *
1100
- * @param {CorridorGeometry} value The value to pack.
1101
- * @param {number[]} array The array to pack into.
1102
- * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
1103
- *
1104
- * @returns {number[]} The array that was packed into
1105
- */
1106
- CorridorGeometry.pack = function (value, array, startingIndex) {
1107
- //>>includeStart('debug', pragmas.debug);
1108
- Check.Check.defined("value", value);
1109
- Check.Check.defined("array", array);
1110
- //>>includeEnd('debug');
1111
-
1112
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
1113
-
1114
- const positions = value._positions;
1115
- const length = positions.length;
1116
- array[startingIndex++] = length;
1117
-
1118
- for (let i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
1119
- Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
1120
- }
1121
-
1122
- Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
1123
- startingIndex += Matrix3.Ellipsoid.packedLength;
1124
-
1125
- VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
1126
- startingIndex += VertexFormat.VertexFormat.packedLength;
1127
-
1128
- array[startingIndex++] = value._width;
1129
- array[startingIndex++] = value._height;
1130
- array[startingIndex++] = value._extrudedHeight;
1131
- array[startingIndex++] = value._cornerType;
1132
- array[startingIndex++] = value._granularity;
1133
- array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;
1134
- array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
1135
-
1136
- return array;
1137
- };
1138
-
1139
- const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
1140
- const scratchVertexFormat = new VertexFormat.VertexFormat();
1141
- const scratchOptions = {
1142
- positions: undefined,
1143
- ellipsoid: scratchEllipsoid,
1144
- vertexFormat: scratchVertexFormat,
1145
- width: undefined,
1146
- height: undefined,
1147
- extrudedHeight: undefined,
1148
- cornerType: undefined,
1149
- granularity: undefined,
1150
- shadowVolume: undefined,
1151
- offsetAttribute: undefined,
1001
+ const rectangle = defined_default(result) ? result : new Rectangle_default();
1002
+ rectangle.north = scratchCartographicMax.latitude;
1003
+ rectangle.south = scratchCartographicMin.latitude;
1004
+ rectangle.east = scratchCartographicMax.longitude;
1005
+ rectangle.west = scratchCartographicMin.longitude;
1006
+ return rectangle;
1007
+ }
1008
+ function CorridorGeometry(options) {
1009
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
1010
+ const positions = options.positions;
1011
+ const width = options.width;
1012
+ Check_default.defined("options.positions", positions);
1013
+ Check_default.defined("options.width", width);
1014
+ const height = defaultValue_default(options.height, 0);
1015
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
1016
+ this._positions = positions;
1017
+ this._ellipsoid = Ellipsoid_default.clone(
1018
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
1019
+ );
1020
+ this._vertexFormat = VertexFormat_default.clone(
1021
+ defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
1022
+ );
1023
+ this._width = width;
1024
+ this._height = Math.max(height, extrudedHeight);
1025
+ this._extrudedHeight = Math.min(height, extrudedHeight);
1026
+ this._cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
1027
+ this._granularity = defaultValue_default(
1028
+ options.granularity,
1029
+ Math_default.RADIANS_PER_DEGREE
1030
+ );
1031
+ this._shadowVolume = defaultValue_default(options.shadowVolume, false);
1032
+ this._workerName = "createCorridorGeometry";
1033
+ this._offsetAttribute = options.offsetAttribute;
1034
+ this._rectangle = void 0;
1035
+ this.packedLength = 1 + positions.length * Cartesian3_default.packedLength + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 7;
1036
+ }
1037
+ CorridorGeometry.pack = function(value, array, startingIndex) {
1038
+ Check_default.defined("value", value);
1039
+ Check_default.defined("array", array);
1040
+ startingIndex = defaultValue_default(startingIndex, 0);
1041
+ const positions = value._positions;
1042
+ const length = positions.length;
1043
+ array[startingIndex++] = length;
1044
+ for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
1045
+ Cartesian3_default.pack(positions[i], array, startingIndex);
1046
+ }
1047
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
1048
+ startingIndex += Ellipsoid_default.packedLength;
1049
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
1050
+ startingIndex += VertexFormat_default.packedLength;
1051
+ array[startingIndex++] = value._width;
1052
+ array[startingIndex++] = value._height;
1053
+ array[startingIndex++] = value._extrudedHeight;
1054
+ array[startingIndex++] = value._cornerType;
1055
+ array[startingIndex++] = value._granularity;
1056
+ array[startingIndex++] = value._shadowVolume ? 1 : 0;
1057
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
1058
+ return array;
1059
+ };
1060
+ var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
1061
+ var scratchVertexFormat = new VertexFormat_default();
1062
+ var scratchOptions = {
1063
+ positions: void 0,
1064
+ ellipsoid: scratchEllipsoid,
1065
+ vertexFormat: scratchVertexFormat,
1066
+ width: void 0,
1067
+ height: void 0,
1068
+ extrudedHeight: void 0,
1069
+ cornerType: void 0,
1070
+ granularity: void 0,
1071
+ shadowVolume: void 0,
1072
+ offsetAttribute: void 0
1073
+ };
1074
+ CorridorGeometry.unpack = function(array, startingIndex, result) {
1075
+ Check_default.defined("array", array);
1076
+ startingIndex = defaultValue_default(startingIndex, 0);
1077
+ const length = array[startingIndex++];
1078
+ const positions = new Array(length);
1079
+ for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
1080
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
1081
+ }
1082
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
1083
+ startingIndex += Ellipsoid_default.packedLength;
1084
+ const vertexFormat = VertexFormat_default.unpack(
1085
+ array,
1086
+ startingIndex,
1087
+ scratchVertexFormat
1088
+ );
1089
+ startingIndex += VertexFormat_default.packedLength;
1090
+ const width = array[startingIndex++];
1091
+ const height = array[startingIndex++];
1092
+ const extrudedHeight = array[startingIndex++];
1093
+ const cornerType = array[startingIndex++];
1094
+ const granularity = array[startingIndex++];
1095
+ const shadowVolume = array[startingIndex++] === 1;
1096
+ const offsetAttribute = array[startingIndex];
1097
+ if (!defined_default(result)) {
1098
+ scratchOptions.positions = positions;
1099
+ scratchOptions.width = width;
1100
+ scratchOptions.height = height;
1101
+ scratchOptions.extrudedHeight = extrudedHeight;
1102
+ scratchOptions.cornerType = cornerType;
1103
+ scratchOptions.granularity = granularity;
1104
+ scratchOptions.shadowVolume = shadowVolume;
1105
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
1106
+ return new CorridorGeometry(scratchOptions);
1107
+ }
1108
+ result._positions = positions;
1109
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
1110
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
1111
+ result._width = width;
1112
+ result._height = height;
1113
+ result._extrudedHeight = extrudedHeight;
1114
+ result._cornerType = cornerType;
1115
+ result._granularity = granularity;
1116
+ result._shadowVolume = shadowVolume;
1117
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
1118
+ return result;
1119
+ };
1120
+ CorridorGeometry.computeRectangle = function(options, result) {
1121
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
1122
+ const positions = options.positions;
1123
+ const width = options.width;
1124
+ Check_default.defined("options.positions", positions);
1125
+ Check_default.defined("options.width", width);
1126
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
1127
+ const cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
1128
+ return computeRectangle(positions, ellipsoid, width, cornerType, result);
1129
+ };
1130
+ CorridorGeometry.createGeometry = function(corridorGeometry) {
1131
+ let positions = corridorGeometry._positions;
1132
+ const width = corridorGeometry._width;
1133
+ const ellipsoid = corridorGeometry._ellipsoid;
1134
+ positions = scaleToSurface(positions, ellipsoid);
1135
+ const cleanPositions = arrayRemoveDuplicates_default(
1136
+ positions,
1137
+ Cartesian3_default.equalsEpsilon
1138
+ );
1139
+ if (cleanPositions.length < 2 || width <= 0) {
1140
+ return;
1141
+ }
1142
+ const height = corridorGeometry._height;
1143
+ const extrudedHeight = corridorGeometry._extrudedHeight;
1144
+ const extrude = !Math_default.equalsEpsilon(
1145
+ height,
1146
+ extrudedHeight,
1147
+ 0,
1148
+ Math_default.EPSILON2
1149
+ );
1150
+ const vertexFormat = corridorGeometry._vertexFormat;
1151
+ const params = {
1152
+ ellipsoid,
1153
+ positions: cleanPositions,
1154
+ width,
1155
+ cornerType: corridorGeometry._cornerType,
1156
+ granularity: corridorGeometry._granularity,
1157
+ saveAttributes: true
1152
1158
  };
1153
-
1154
- /**
1155
- * Retrieves an instance from a packed array.
1156
- *
1157
- * @param {number[]} array The packed array.
1158
- * @param {number} [startingIndex=0] The starting index of the element to be unpacked.
1159
- * @param {CorridorGeometry} [result] The object into which to store the result.
1160
- * @returns {CorridorGeometry} The modified result parameter or a new CorridorGeometry instance if one was not provided.
1161
- */
1162
- CorridorGeometry.unpack = function (array, startingIndex, result) {
1163
- //>>includeStart('debug', pragmas.debug);
1164
- Check.Check.defined("array", array);
1165
- //>>includeEnd('debug');
1166
-
1167
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
1168
-
1169
- const length = array[startingIndex++];
1170
- const positions = new Array(length);
1171
-
1172
- for (let i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
1173
- positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
1174
- }
1175
-
1176
- const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
1177
- startingIndex += Matrix3.Ellipsoid.packedLength;
1178
-
1179
- const vertexFormat = VertexFormat.VertexFormat.unpack(
1180
- array,
1181
- startingIndex,
1182
- scratchVertexFormat
1159
+ let attr;
1160
+ if (extrude) {
1161
+ params.height = height;
1162
+ params.extrudedHeight = extrudedHeight;
1163
+ params.shadowVolume = corridorGeometry._shadowVolume;
1164
+ params.offsetAttribute = corridorGeometry._offsetAttribute;
1165
+ attr = computePositionsExtruded(params, vertexFormat);
1166
+ } else {
1167
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
1168
+ attr = combine(computedPositions, vertexFormat, ellipsoid);
1169
+ attr.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
1170
+ attr.attributes.position.values,
1171
+ height,
1172
+ ellipsoid
1183
1173
  );
1184
- startingIndex += VertexFormat.VertexFormat.packedLength;
1185
-
1186
- const width = array[startingIndex++];
1187
- const height = array[startingIndex++];
1188
- const extrudedHeight = array[startingIndex++];
1189
- const cornerType = array[startingIndex++];
1190
- const granularity = array[startingIndex++];
1191
- const shadowVolume = array[startingIndex++] === 1.0;
1192
- const offsetAttribute = array[startingIndex];
1193
-
1194
- if (!defaultValue.defined(result)) {
1195
- scratchOptions.positions = positions;
1196
- scratchOptions.width = width;
1197
- scratchOptions.height = height;
1198
- scratchOptions.extrudedHeight = extrudedHeight;
1199
- scratchOptions.cornerType = cornerType;
1200
- scratchOptions.granularity = granularity;
1201
- scratchOptions.shadowVolume = shadowVolume;
1202
- scratchOptions.offsetAttribute =
1203
- offsetAttribute === -1 ? undefined : offsetAttribute;
1204
-
1205
- return new CorridorGeometry(scratchOptions);
1174
+ if (defined_default(corridorGeometry._offsetAttribute)) {
1175
+ const applyOffsetValue = corridorGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
1176
+ const length = attr.attributes.position.values.length;
1177
+ const applyOffset = new Uint8Array(length / 3).fill(applyOffsetValue);
1178
+ attr.attributes.applyOffset = new GeometryAttribute_default({
1179
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
1180
+ componentsPerAttribute: 1,
1181
+ values: applyOffset
1182
+ });
1206
1183
  }
1207
-
1208
- result._positions = positions;
1209
- result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
1210
- result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
1211
- result._width = width;
1212
- result._height = height;
1213
- result._extrudedHeight = extrudedHeight;
1214
- result._cornerType = cornerType;
1215
- result._granularity = granularity;
1216
- result._shadowVolume = shadowVolume;
1217
- result._offsetAttribute =
1218
- offsetAttribute === -1 ? undefined : offsetAttribute;
1219
-
1220
- return result;
1221
- };
1222
-
1223
- /**
1224
- * Computes the bounding rectangle given the provided options
1225
- *
1226
- * @param {object} options Object with the following properties:
1227
- * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.
1228
- * @param {number} options.width The distance between the edges of the corridor in meters.
1229
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
1230
- * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
1231
- * @param {Rectangle} [result] An object in which to store the result.
1232
- *
1233
- * @returns {Rectangle} The result rectangle.
1234
- */
1235
- CorridorGeometry.computeRectangle = function (options, result) {
1236
- options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
1237
- const positions = options.positions;
1238
- const width = options.width;
1239
-
1240
- //>>includeStart('debug', pragmas.debug);
1241
- Check.Check.defined("options.positions", positions);
1242
- Check.Check.defined("options.width", width);
1243
- //>>includeEnd('debug');
1244
-
1245
- const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
1246
- const cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
1247
-
1248
- return computeRectangle(positions, ellipsoid, width, cornerType, result);
1249
- };
1250
-
1184
+ }
1185
+ const attributes = attr.attributes;
1186
+ const boundingSphere = BoundingSphere_default.fromVertices(
1187
+ attributes.position.values,
1188
+ void 0,
1189
+ 3
1190
+ );
1191
+ if (!vertexFormat.position) {
1192
+ attr.attributes.position.values = void 0;
1193
+ }
1194
+ return new Geometry_default({
1195
+ attributes,
1196
+ indices: attr.indices,
1197
+ primitiveType: PrimitiveType_default.TRIANGLES,
1198
+ boundingSphere,
1199
+ offsetAttribute: corridorGeometry._offsetAttribute
1200
+ });
1201
+ };
1202
+ CorridorGeometry.createShadowVolume = function(corridorGeometry, minHeightFunc, maxHeightFunc) {
1203
+ const granularity = corridorGeometry._granularity;
1204
+ const ellipsoid = corridorGeometry._ellipsoid;
1205
+ const minHeight = minHeightFunc(granularity, ellipsoid);
1206
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
1207
+ return new CorridorGeometry({
1208
+ positions: corridorGeometry._positions,
1209
+ width: corridorGeometry._width,
1210
+ cornerType: corridorGeometry._cornerType,
1211
+ ellipsoid,
1212
+ granularity,
1213
+ extrudedHeight: minHeight,
1214
+ height: maxHeight,
1215
+ vertexFormat: VertexFormat_default.POSITION_ONLY,
1216
+ shadowVolume: true
1217
+ });
1218
+ };
1219
+ Object.defineProperties(CorridorGeometry.prototype, {
1251
1220
  /**
1252
- * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
1253
- *
1254
- * @param {CorridorGeometry} corridorGeometry A description of the corridor.
1255
- * @returns {Geometry|undefined} The computed vertices and indices.
1221
+ * @private
1256
1222
  */
1257
- CorridorGeometry.createGeometry = function (corridorGeometry) {
1258
- let positions = corridorGeometry._positions;
1259
- const width = corridorGeometry._width;
1260
- const ellipsoid = corridorGeometry._ellipsoid;
1261
-
1262
- positions = scaleToSurface(positions, ellipsoid);
1263
- const cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
1264
- positions,
1265
- Matrix3.Cartesian3.equalsEpsilon
1266
- );
1267
-
1268
- if (cleanPositions.length < 2 || width <= 0) {
1269
- return;
1270
- }
1271
-
1272
- const height = corridorGeometry._height;
1273
- const extrudedHeight = corridorGeometry._extrudedHeight;
1274
- const extrude = !Math$1.CesiumMath.equalsEpsilon(
1275
- height,
1276
- extrudedHeight,
1277
- 0,
1278
- Math$1.CesiumMath.EPSILON2
1279
- );
1280
-
1281
- const vertexFormat = corridorGeometry._vertexFormat;
1282
- const params = {
1283
- ellipsoid: ellipsoid,
1284
- positions: cleanPositions,
1285
- width: width,
1286
- cornerType: corridorGeometry._cornerType,
1287
- granularity: corridorGeometry._granularity,
1288
- saveAttributes: true,
1289
- };
1290
- let attr;
1291
- if (extrude) {
1292
- params.height = height;
1293
- params.extrudedHeight = extrudedHeight;
1294
- params.shadowVolume = corridorGeometry._shadowVolume;
1295
- params.offsetAttribute = corridorGeometry._offsetAttribute;
1296
- attr = computePositionsExtruded(params, vertexFormat);
1297
- } else {
1298
- const computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
1299
- attr = combine(computedPositions, vertexFormat, ellipsoid);
1300
- attr.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
1301
- attr.attributes.position.values,
1302
- height,
1303
- ellipsoid
1304
- );
1305
-
1306
- if (defaultValue.defined(corridorGeometry._offsetAttribute)) {
1307
- const applyOffsetValue =
1308
- corridorGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
1309
- ? 0
1310
- : 1;
1311
- const length = attr.attributes.position.values.length;
1312
- const applyOffset = new Uint8Array(length / 3).fill(applyOffsetValue);
1313
- attr.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
1314
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
1315
- componentsPerAttribute: 1,
1316
- values: applyOffset,
1317
- });
1223
+ rectangle: {
1224
+ get: function() {
1225
+ if (!defined_default(this._rectangle)) {
1226
+ this._rectangle = computeRectangle(
1227
+ this._positions,
1228
+ this._ellipsoid,
1229
+ this._width,
1230
+ this._cornerType
1231
+ );
1318
1232
  }
1233
+ return this._rectangle;
1319
1234
  }
1320
- const attributes = attr.attributes;
1321
- const boundingSphere = Transforms.BoundingSphere.fromVertices(
1322
- attributes.position.values,
1323
- undefined,
1324
- 3
1325
- );
1326
- if (!vertexFormat.position) {
1327
- attr.attributes.position.values = undefined;
1328
- }
1329
-
1330
- return new GeometryAttribute.Geometry({
1331
- attributes: attributes,
1332
- indices: attr.indices,
1333
- primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
1334
- boundingSphere: boundingSphere,
1335
- offsetAttribute: corridorGeometry._offsetAttribute,
1336
- });
1337
- };
1338
-
1235
+ },
1339
1236
  /**
1237
+ * For remapping texture coordinates when rendering CorridorGeometries as GroundPrimitives.
1238
+ *
1239
+ * Corridors don't support stRotation,
1240
+ * so just return the corners of the original system.
1340
1241
  * @private
1341
1242
  */
1342
- CorridorGeometry.createShadowVolume = function (
1343
- corridorGeometry,
1344
- minHeightFunc,
1345
- maxHeightFunc
1346
- ) {
1347
- const granularity = corridorGeometry._granularity;
1348
- const ellipsoid = corridorGeometry._ellipsoid;
1349
-
1350
- const minHeight = minHeightFunc(granularity, ellipsoid);
1351
- const maxHeight = maxHeightFunc(granularity, ellipsoid);
1352
-
1353
- return new CorridorGeometry({
1354
- positions: corridorGeometry._positions,
1355
- width: corridorGeometry._width,
1356
- cornerType: corridorGeometry._cornerType,
1357
- ellipsoid: ellipsoid,
1358
- granularity: granularity,
1359
- extrudedHeight: minHeight,
1360
- height: maxHeight,
1361
- vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
1362
- shadowVolume: true,
1363
- });
1364
- };
1365
-
1366
- Object.defineProperties(CorridorGeometry.prototype, {
1367
- /**
1368
- * @private
1369
- */
1370
- rectangle: {
1371
- get: function () {
1372
- if (!defaultValue.defined(this._rectangle)) {
1373
- this._rectangle = computeRectangle(
1374
- this._positions,
1375
- this._ellipsoid,
1376
- this._width,
1377
- this._cornerType
1378
- );
1379
- }
1380
- return this._rectangle;
1381
- },
1382
- },
1383
- /**
1384
- * For remapping texture coordinates when rendering CorridorGeometries as GroundPrimitives.
1385
- *
1386
- * Corridors don't support stRotation,
1387
- * so just return the corners of the original system.
1388
- * @private
1389
- */
1390
- textureCoordinateRotationPoints: {
1391
- get: function () {
1392
- return [0, 0, 0, 1, 1, 0];
1393
- },
1394
- },
1395
- });
1396
-
1397
- function createCorridorGeometry(corridorGeometry, offset) {
1398
- if (defaultValue.defined(offset)) {
1399
- corridorGeometry = CorridorGeometry.unpack(corridorGeometry, offset);
1243
+ textureCoordinateRotationPoints: {
1244
+ get: function() {
1245
+ return [0, 0, 0, 1, 1, 0];
1400
1246
  }
1401
- corridorGeometry._ellipsoid = Matrix3.Ellipsoid.clone(corridorGeometry._ellipsoid);
1402
- return CorridorGeometry.createGeometry(corridorGeometry);
1403
1247
  }
1248
+ });
1249
+ var CorridorGeometry_default = CorridorGeometry;
1404
1250
 
1405
- return createCorridorGeometry;
1406
-
1407
- }));
1251
+ // packages/engine/Source/Workers/createCorridorGeometry.js
1252
+ function createCorridorGeometry(corridorGeometry, offset) {
1253
+ if (defined_default(offset)) {
1254
+ corridorGeometry = CorridorGeometry_default.unpack(corridorGeometry, offset);
1255
+ }
1256
+ corridorGeometry._ellipsoid = Ellipsoid_default.clone(corridorGeometry._ellipsoid);
1257
+ return CorridorGeometry_default.createGeometry(corridorGeometry);
1258
+ }
1259
+ var createCorridorGeometry_default = createCorridorGeometry;
1260
+ export {
1261
+ createCorridorGeometry_default as default
1262
+ };