@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,462 +1,484 @@
1
- define(['./defaultValue-fe22d8c0', './Matrix3-41c58dde', './ArcType-2d9abbbc', './BoundingRectangle-c714b156', './Transforms-a2a85221', './Matrix2-e1298525', './Check-6ede7e26', './ComponentDatatype-cf1fa08e', './EllipsoidGeodesic-5b3623dc', './EllipsoidTangentPlane-6dd1b7af', './GeometryAttribute-ff5b4fb1', './GeometryInstance-34d9e21e', './GeometryOffsetAttribute-9ad0019c', './GeometryPipeline-1f8fbf05', './IndexDatatype-2643aa47', './Math-0a2ac845', './PolygonGeometryLibrary-076a5d25', './PolygonPipeline-b9f2810a', './VertexFormat-030f11ff', './combine-d9581036', './RuntimeError-ef395448', './WebGLConstants-0b1ce7ba', './AxisAlignedBoundingBox-4140c51f', './IntersectionTests-70d39ba9', './Plane-4c3d403b', './AttributeCompression-f9f6c717', './EncodedCartesian3-57415c8a', './arrayRemoveDuplicates-d2061e85', './EllipsoidRhumbLine-ef872433', './GeometryAttributes-ad136444'], (function (defaultValue, Matrix3, ArcType, BoundingRectangle, Transforms, Matrix2, Check, ComponentDatatype, EllipsoidGeodesic, EllipsoidTangentPlane, GeometryAttribute, GeometryInstance, GeometryOffsetAttribute, GeometryPipeline, IndexDatatype, Math$1, PolygonGeometryLibrary, PolygonPipeline, VertexFormat, combine, RuntimeError, WebGLConstants, AxisAlignedBoundingBox, IntersectionTests, Plane, AttributeCompression, EncodedCartesian3, arrayRemoveDuplicates, EllipsoidRhumbLine, GeometryAttributes) { 'use strict';
2
-
3
- const scratchCarto1 = new Matrix3.Cartographic();
4
- const scratchCarto2 = new Matrix3.Cartographic();
5
- function adjustPosHeightsForNormal(position, p1, p2, ellipsoid) {
6
- const carto1 = ellipsoid.cartesianToCartographic(position, scratchCarto1);
7
- const height = carto1.height;
8
- const p1Carto = ellipsoid.cartesianToCartographic(p1, scratchCarto2);
9
- p1Carto.height = height;
10
- ellipsoid.cartographicToCartesian(p1Carto, p1);
11
-
12
- const p2Carto = ellipsoid.cartesianToCartographic(p2, scratchCarto2);
13
- p2Carto.height = height - 100;
14
- ellipsoid.cartographicToCartesian(p2Carto, p2);
15
- }
16
-
17
- const scratchBoundingRectangle = new BoundingRectangle.BoundingRectangle();
18
- const scratchPosition = new Matrix3.Cartesian3();
19
- const scratchNormal = new Matrix3.Cartesian3();
20
- const scratchTangent = new Matrix3.Cartesian3();
21
- const scratchBitangent = new Matrix3.Cartesian3();
22
- const p1Scratch = new Matrix3.Cartesian3();
23
- const p2Scratch = new Matrix3.Cartesian3();
24
- let scratchPerPosNormal = new Matrix3.Cartesian3();
25
- let scratchPerPosTangent = new Matrix3.Cartesian3();
26
- let scratchPerPosBitangent = new Matrix3.Cartesian3();
27
-
28
- const appendTextureCoordinatesOrigin = new Matrix2.Cartesian2();
29
- const appendTextureCoordinatesCartesian2 = new Matrix2.Cartesian2();
30
- const appendTextureCoordinatesCartesian3 = new Matrix3.Cartesian3();
31
- const appendTextureCoordinatesQuaternion = new Transforms.Quaternion();
32
- const appendTextureCoordinatesMatrix3 = new Matrix3.Matrix3();
33
- const tangentMatrixScratch = new Matrix3.Matrix3();
34
-
35
- function computeAttributes(options) {
36
- const vertexFormat = options.vertexFormat;
37
- const geometry = options.geometry;
38
- const shadowVolume = options.shadowVolume;
39
- const flatPositions = geometry.attributes.position.values;
40
- const flatTexcoords = defaultValue.defined(geometry.attributes.st)
41
- ? geometry.attributes.st.values
42
- : undefined;
43
-
44
- let length = flatPositions.length;
45
- const wall = options.wall;
46
- const top = options.top || wall;
47
- const bottom = options.bottom || wall;
48
- if (
49
- vertexFormat.st ||
50
- vertexFormat.normal ||
51
- vertexFormat.tangent ||
52
- vertexFormat.bitangent ||
53
- shadowVolume
54
- ) {
55
- // PERFORMANCE_IDEA: Compute before subdivision, then just interpolate during subdivision.
56
- // PERFORMANCE_IDEA: Compute with createGeometryFromPositions() for fast path when there's no holes.
57
- const boundingRectangle = options.boundingRectangle;
58
- const tangentPlane = options.tangentPlane;
59
- const ellipsoid = options.ellipsoid;
60
- const stRotation = options.stRotation;
61
- const perPositionHeight = options.perPositionHeight;
62
-
63
- const origin = appendTextureCoordinatesOrigin;
64
- origin.x = boundingRectangle.x;
65
- origin.y = boundingRectangle.y;
66
-
67
- const textureCoordinates = vertexFormat.st
68
- ? new Float32Array(2 * (length / 3))
69
- : undefined;
70
- let normals;
71
- if (vertexFormat.normal) {
72
- if (perPositionHeight && top && !wall) {
73
- normals = geometry.attributes.normal.values;
74
- } else {
75
- normals = new Float32Array(length);
76
- }
77
- }
78
- const tangents = vertexFormat.tangent
79
- ? new Float32Array(length)
80
- : undefined;
81
- const bitangents = vertexFormat.bitangent
82
- ? new Float32Array(length)
83
- : undefined;
84
- const extrudeNormals = shadowVolume ? new Float32Array(length) : undefined;
85
-
86
- let textureCoordIndex = 0;
87
- let attrIndex = 0;
88
-
89
- let normal = scratchNormal;
90
- let tangent = scratchTangent;
91
- let bitangent = scratchBitangent;
92
- let recomputeNormal = true;
93
-
94
- let textureMatrix = appendTextureCoordinatesMatrix3;
95
- let tangentRotationMatrix = tangentMatrixScratch;
96
- if (stRotation !== 0.0) {
97
- let rotation = Transforms.Quaternion.fromAxisAngle(
98
- tangentPlane._plane.normal,
99
- stRotation,
100
- appendTextureCoordinatesQuaternion
101
- );
102
- textureMatrix = Matrix3.Matrix3.fromQuaternion(rotation, textureMatrix);
103
-
104
- rotation = Transforms.Quaternion.fromAxisAngle(
105
- tangentPlane._plane.normal,
106
- -stRotation,
107
- appendTextureCoordinatesQuaternion
108
- );
109
- tangentRotationMatrix = Matrix3.Matrix3.fromQuaternion(
110
- rotation,
111
- tangentRotationMatrix
112
- );
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
+ BoundingRectangle_default
28
+ } from "./chunk-66QLLS45.js";
29
+ import {
30
+ PolygonGeometryLibrary_default
31
+ } from "./chunk-KTJSNCK4.js";
32
+ import {
33
+ ArcType_default
34
+ } from "./chunk-CCFQRR6D.js";
35
+ import {
36
+ GeometryInstance_default
37
+ } from "./chunk-227AJNOA.js";
38
+ import {
39
+ GeometryPipeline_default
40
+ } from "./chunk-XTY7B2N6.js";
41
+ import "./chunk-O5AMBQ36.js";
42
+ import "./chunk-QT3MPEMI.js";
43
+ import {
44
+ EllipsoidGeodesic_default
45
+ } from "./chunk-AFFLIKOH.js";
46
+ import {
47
+ GeometryOffsetAttribute_default
48
+ } from "./chunk-MPAZH4BF.js";
49
+ import {
50
+ VertexFormat_default
51
+ } from "./chunk-QMEMZIJI.js";
52
+ import {
53
+ EllipsoidTangentPlane_default
54
+ } from "./chunk-RP2A7BR5.js";
55
+ import "./chunk-2R5O53JW.js";
56
+ import {
57
+ PolygonPipeline_default,
58
+ WindingOrder_default
59
+ } from "./chunk-J3JY6I2C.js";
60
+ import "./chunk-3W63OHNJ.js";
61
+ import "./chunk-K36FEYS7.js";
62
+ import "./chunk-MYZB7C4T.js";
63
+ import "./chunk-OYFCF4PL.js";
64
+ import {
65
+ IndexDatatype_default
66
+ } from "./chunk-RW6LU2CJ.js";
67
+ import "./chunk-EW2GWJYB.js";
68
+ import {
69
+ GeometryAttribute_default,
70
+ Geometry_default
71
+ } from "./chunk-X4SU25DT.js";
72
+ import {
73
+ BoundingSphere_default,
74
+ Quaternion_default
75
+ } from "./chunk-PFQBCKBM.js";
76
+ import "./chunk-QJ3DFBH3.js";
77
+ import {
78
+ Cartesian2_default,
79
+ Rectangle_default
80
+ } from "./chunk-DUHWWBQQ.js";
81
+ import {
82
+ ComponentDatatype_default
83
+ } from "./chunk-LLUNNUJV.js";
84
+ import {
85
+ Cartesian3_default,
86
+ Cartographic_default,
87
+ Ellipsoid_default,
88
+ Matrix3_default
89
+ } from "./chunk-PCJWUS4M.js";
90
+ import {
91
+ Math_default
92
+ } from "./chunk-N3JIFFX2.js";
93
+ import "./chunk-AHKEZ2OE.js";
94
+ import "./chunk-ABADGKYE.js";
95
+ import {
96
+ defaultValue_default
97
+ } from "./chunk-WXTV4ATB.js";
98
+ import {
99
+ Check_default,
100
+ DeveloperError_default
101
+ } from "./chunk-4MFFIWUA.js";
102
+ import {
103
+ defined_default
104
+ } from "./chunk-6BTKZDRG.js";
105
+
106
+ // packages/engine/Source/Core/PolygonGeometry.js
107
+ var scratchCarto1 = new Cartographic_default();
108
+ var scratchCarto2 = new Cartographic_default();
109
+ function adjustPosHeightsForNormal(position, p1, p2, ellipsoid) {
110
+ const carto1 = ellipsoid.cartesianToCartographic(position, scratchCarto1);
111
+ const height = carto1.height;
112
+ const p1Carto = ellipsoid.cartesianToCartographic(p1, scratchCarto2);
113
+ p1Carto.height = height;
114
+ ellipsoid.cartographicToCartesian(p1Carto, p1);
115
+ const p2Carto = ellipsoid.cartesianToCartographic(p2, scratchCarto2);
116
+ p2Carto.height = height - 100;
117
+ ellipsoid.cartographicToCartesian(p2Carto, p2);
118
+ }
119
+ var scratchBoundingRectangle = new BoundingRectangle_default();
120
+ var scratchPosition = new Cartesian3_default();
121
+ var scratchNormal = new Cartesian3_default();
122
+ var scratchTangent = new Cartesian3_default();
123
+ var scratchBitangent = new Cartesian3_default();
124
+ var p1Scratch = new Cartesian3_default();
125
+ var p2Scratch = new Cartesian3_default();
126
+ var scratchPerPosNormal = new Cartesian3_default();
127
+ var scratchPerPosTangent = new Cartesian3_default();
128
+ var scratchPerPosBitangent = new Cartesian3_default();
129
+ var appendTextureCoordinatesOrigin = new Cartesian2_default();
130
+ var appendTextureCoordinatesCartesian2 = new Cartesian2_default();
131
+ var appendTextureCoordinatesCartesian3 = new Cartesian3_default();
132
+ var appendTextureCoordinatesQuaternion = new Quaternion_default();
133
+ var appendTextureCoordinatesMatrix3 = new Matrix3_default();
134
+ var tangentMatrixScratch = new Matrix3_default();
135
+ function computeAttributes(options) {
136
+ const vertexFormat = options.vertexFormat;
137
+ const geometry = options.geometry;
138
+ const shadowVolume = options.shadowVolume;
139
+ const flatPositions = geometry.attributes.position.values;
140
+ const flatTexcoords = defined_default(geometry.attributes.st) ? geometry.attributes.st.values : void 0;
141
+ let length = flatPositions.length;
142
+ const wall = options.wall;
143
+ const top = options.top || wall;
144
+ const bottom = options.bottom || wall;
145
+ if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) {
146
+ const boundingRectangle = options.boundingRectangle;
147
+ const tangentPlane = options.tangentPlane;
148
+ const ellipsoid = options.ellipsoid;
149
+ const stRotation = options.stRotation;
150
+ const perPositionHeight = options.perPositionHeight;
151
+ const origin = appendTextureCoordinatesOrigin;
152
+ origin.x = boundingRectangle.x;
153
+ origin.y = boundingRectangle.y;
154
+ const textureCoordinates = vertexFormat.st ? new Float32Array(2 * (length / 3)) : void 0;
155
+ let normals;
156
+ if (vertexFormat.normal) {
157
+ if (perPositionHeight && top && !wall) {
158
+ normals = geometry.attributes.normal.values;
113
159
  } else {
114
- textureMatrix = Matrix3.Matrix3.clone(Matrix3.Matrix3.IDENTITY, textureMatrix);
115
- tangentRotationMatrix = Matrix3.Matrix3.clone(
116
- Matrix3.Matrix3.IDENTITY,
117
- tangentRotationMatrix
118
- );
160
+ normals = new Float32Array(length);
119
161
  }
120
-
121
- let bottomOffset = 0;
122
- let bottomOffset2 = 0;
123
-
124
- if (top && bottom) {
125
- bottomOffset = length / 2;
126
- bottomOffset2 = length / 3;
127
-
128
- length /= 2;
129
- }
130
-
131
- for (let i = 0; i < length; i += 3) {
132
- const position = Matrix3.Cartesian3.fromArray(
133
- flatPositions,
134
- i,
135
- appendTextureCoordinatesCartesian3
136
- );
137
-
138
- if (vertexFormat.st) {
139
- if (!defaultValue.defined(flatTexcoords)) {
140
- let p = Matrix3.Matrix3.multiplyByVector(
141
- textureMatrix,
142
- position,
143
- scratchPosition
144
- );
145
- p = ellipsoid.scaleToGeodeticSurface(p, p);
146
- const st = tangentPlane.projectPointOntoPlane(
147
- p,
148
- appendTextureCoordinatesCartesian2
149
- );
150
- Matrix2.Cartesian2.subtract(st, origin, st);
151
-
152
- const stx = Math$1.CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);
153
- const sty = Math$1.CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);
154
- if (bottom) {
155
- textureCoordinates[textureCoordIndex + bottomOffset2] = stx;
156
- textureCoordinates[textureCoordIndex + 1 + bottomOffset2] = sty;
157
- }
158
- if (top) {
159
- textureCoordinates[textureCoordIndex] = stx;
160
- textureCoordinates[textureCoordIndex + 1] = sty;
161
- }
162
-
163
- textureCoordIndex += 2;
162
+ }
163
+ const tangents = vertexFormat.tangent ? new Float32Array(length) : void 0;
164
+ const bitangents = vertexFormat.bitangent ? new Float32Array(length) : void 0;
165
+ const extrudeNormals = shadowVolume ? new Float32Array(length) : void 0;
166
+ let textureCoordIndex = 0;
167
+ let attrIndex = 0;
168
+ let normal = scratchNormal;
169
+ let tangent = scratchTangent;
170
+ let bitangent = scratchBitangent;
171
+ let recomputeNormal = true;
172
+ let textureMatrix = appendTextureCoordinatesMatrix3;
173
+ let tangentRotationMatrix = tangentMatrixScratch;
174
+ if (stRotation !== 0) {
175
+ let rotation = Quaternion_default.fromAxisAngle(
176
+ tangentPlane._plane.normal,
177
+ stRotation,
178
+ appendTextureCoordinatesQuaternion
179
+ );
180
+ textureMatrix = Matrix3_default.fromQuaternion(rotation, textureMatrix);
181
+ rotation = Quaternion_default.fromAxisAngle(
182
+ tangentPlane._plane.normal,
183
+ -stRotation,
184
+ appendTextureCoordinatesQuaternion
185
+ );
186
+ tangentRotationMatrix = Matrix3_default.fromQuaternion(
187
+ rotation,
188
+ tangentRotationMatrix
189
+ );
190
+ } else {
191
+ textureMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY, textureMatrix);
192
+ tangentRotationMatrix = Matrix3_default.clone(
193
+ Matrix3_default.IDENTITY,
194
+ tangentRotationMatrix
195
+ );
196
+ }
197
+ let bottomOffset = 0;
198
+ let bottomOffset2 = 0;
199
+ if (top && bottom) {
200
+ bottomOffset = length / 2;
201
+ bottomOffset2 = length / 3;
202
+ length /= 2;
203
+ }
204
+ for (let i = 0; i < length; i += 3) {
205
+ const position = Cartesian3_default.fromArray(
206
+ flatPositions,
207
+ i,
208
+ appendTextureCoordinatesCartesian3
209
+ );
210
+ if (vertexFormat.st) {
211
+ if (!defined_default(flatTexcoords)) {
212
+ let p = Matrix3_default.multiplyByVector(
213
+ textureMatrix,
214
+ position,
215
+ scratchPosition
216
+ );
217
+ p = ellipsoid.scaleToGeodeticSurface(p, p);
218
+ const st = tangentPlane.projectPointOntoPlane(
219
+ p,
220
+ appendTextureCoordinatesCartesian2
221
+ );
222
+ Cartesian2_default.subtract(st, origin, st);
223
+ const stx = Math_default.clamp(st.x / boundingRectangle.width, 0, 1);
224
+ const sty = Math_default.clamp(st.y / boundingRectangle.height, 0, 1);
225
+ if (bottom) {
226
+ textureCoordinates[textureCoordIndex + bottomOffset2] = stx;
227
+ textureCoordinates[textureCoordIndex + 1 + bottomOffset2] = sty;
228
+ }
229
+ if (top) {
230
+ textureCoordinates[textureCoordIndex] = stx;
231
+ textureCoordinates[textureCoordIndex + 1] = sty;
164
232
  }
233
+ textureCoordIndex += 2;
165
234
  }
166
-
167
- if (
168
- vertexFormat.normal ||
169
- vertexFormat.tangent ||
170
- vertexFormat.bitangent ||
171
- shadowVolume
172
- ) {
173
- const attrIndex1 = attrIndex + 1;
174
- const attrIndex2 = attrIndex + 2;
175
-
176
- if (wall) {
177
- if (i + 3 < length) {
178
- const p1 = Matrix3.Cartesian3.fromArray(flatPositions, i + 3, p1Scratch);
179
-
180
- if (recomputeNormal) {
181
- const p2 = Matrix3.Cartesian3.fromArray(
182
- flatPositions,
183
- i + length,
184
- p2Scratch
185
- );
186
- if (perPositionHeight) {
187
- adjustPosHeightsForNormal(position, p1, p2, ellipsoid);
188
- }
189
- Matrix3.Cartesian3.subtract(p1, position, p1);
190
- Matrix3.Cartesian3.subtract(p2, position, p2);
191
- normal = Matrix3.Cartesian3.normalize(
192
- Matrix3.Cartesian3.cross(p2, p1, normal),
193
- normal
194
- );
195
- recomputeNormal = false;
196
- }
197
-
198
- if (Matrix3.Cartesian3.equalsEpsilon(p1, position, Math$1.CesiumMath.EPSILON10)) {
199
- // if we've reached a corner
200
- recomputeNormal = true;
235
+ }
236
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) {
237
+ const attrIndex1 = attrIndex + 1;
238
+ const attrIndex2 = attrIndex + 2;
239
+ if (wall) {
240
+ if (i + 3 < length) {
241
+ const p1 = Cartesian3_default.fromArray(flatPositions, i + 3, p1Scratch);
242
+ if (recomputeNormal) {
243
+ const p2 = Cartesian3_default.fromArray(
244
+ flatPositions,
245
+ i + length,
246
+ p2Scratch
247
+ );
248
+ if (perPositionHeight) {
249
+ adjustPosHeightsForNormal(position, p1, p2, ellipsoid);
201
250
  }
251
+ Cartesian3_default.subtract(p1, position, p1);
252
+ Cartesian3_default.subtract(p2, position, p2);
253
+ normal = Cartesian3_default.normalize(
254
+ Cartesian3_default.cross(p2, p1, normal),
255
+ normal
256
+ );
257
+ recomputeNormal = false;
202
258
  }
203
-
204
- if (vertexFormat.tangent || vertexFormat.bitangent) {
205
- bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent);
206
- if (vertexFormat.tangent) {
207
- tangent = Matrix3.Cartesian3.normalize(
208
- Matrix3.Cartesian3.cross(bitangent, normal, tangent),
209
- tangent
210
- );
211
- }
259
+ if (Cartesian3_default.equalsEpsilon(p1, position, Math_default.EPSILON10)) {
260
+ recomputeNormal = true;
212
261
  }
213
- } else {
214
- normal = ellipsoid.geodeticSurfaceNormal(position, normal);
215
- if (vertexFormat.tangent || vertexFormat.bitangent) {
216
- if (perPositionHeight) {
217
- scratchPerPosNormal = Matrix3.Cartesian3.fromArray(
218
- normals,
219
- attrIndex,
220
- scratchPerPosNormal
221
- );
222
- scratchPerPosTangent = Matrix3.Cartesian3.cross(
223
- Matrix3.Cartesian3.UNIT_Z,
224
- scratchPerPosNormal,
262
+ }
263
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
264
+ bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent);
265
+ if (vertexFormat.tangent) {
266
+ tangent = Cartesian3_default.normalize(
267
+ Cartesian3_default.cross(bitangent, normal, tangent),
268
+ tangent
269
+ );
270
+ }
271
+ }
272
+ } else {
273
+ normal = ellipsoid.geodeticSurfaceNormal(position, normal);
274
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
275
+ if (perPositionHeight) {
276
+ scratchPerPosNormal = Cartesian3_default.fromArray(
277
+ normals,
278
+ attrIndex,
279
+ scratchPerPosNormal
280
+ );
281
+ scratchPerPosTangent = Cartesian3_default.cross(
282
+ Cartesian3_default.UNIT_Z,
283
+ scratchPerPosNormal,
284
+ scratchPerPosTangent
285
+ );
286
+ scratchPerPosTangent = Cartesian3_default.normalize(
287
+ Matrix3_default.multiplyByVector(
288
+ tangentRotationMatrix,
289
+ scratchPerPosTangent,
225
290
  scratchPerPosTangent
226
- );
227
- scratchPerPosTangent = Matrix3.Cartesian3.normalize(
228
- Matrix3.Matrix3.multiplyByVector(
229
- tangentRotationMatrix,
291
+ ),
292
+ scratchPerPosTangent
293
+ );
294
+ if (vertexFormat.bitangent) {
295
+ scratchPerPosBitangent = Cartesian3_default.normalize(
296
+ Cartesian3_default.cross(
297
+ scratchPerPosNormal,
230
298
  scratchPerPosTangent,
231
- scratchPerPosTangent
299
+ scratchPerPosBitangent
232
300
  ),
233
- scratchPerPosTangent
301
+ scratchPerPosBitangent
234
302
  );
235
- if (vertexFormat.bitangent) {
236
- scratchPerPosBitangent = Matrix3.Cartesian3.normalize(
237
- Matrix3.Cartesian3.cross(
238
- scratchPerPosNormal,
239
- scratchPerPosTangent,
240
- scratchPerPosBitangent
241
- ),
242
- scratchPerPosBitangent
243
- );
244
- }
245
303
  }
246
-
247
- tangent = Matrix3.Cartesian3.cross(Matrix3.Cartesian3.UNIT_Z, normal, tangent);
248
- tangent = Matrix3.Cartesian3.normalize(
249
- Matrix3.Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent),
250
- tangent
304
+ }
305
+ tangent = Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal, tangent);
306
+ tangent = Cartesian3_default.normalize(
307
+ Matrix3_default.multiplyByVector(tangentRotationMatrix, tangent, tangent),
308
+ tangent
309
+ );
310
+ if (vertexFormat.bitangent) {
311
+ bitangent = Cartesian3_default.normalize(
312
+ Cartesian3_default.cross(normal, tangent, bitangent),
313
+ bitangent
251
314
  );
252
- if (vertexFormat.bitangent) {
253
- bitangent = Matrix3.Cartesian3.normalize(
254
- Matrix3.Cartesian3.cross(normal, tangent, bitangent),
255
- bitangent
256
- );
257
- }
258
315
  }
259
316
  }
260
-
261
- if (vertexFormat.normal) {
262
- if (options.wall) {
263
- normals[attrIndex + bottomOffset] = normal.x;
264
- normals[attrIndex1 + bottomOffset] = normal.y;
265
- normals[attrIndex2 + bottomOffset] = normal.z;
266
- } else if (bottom) {
267
- normals[attrIndex + bottomOffset] = -normal.x;
268
- normals[attrIndex1 + bottomOffset] = -normal.y;
269
- normals[attrIndex2 + bottomOffset] = -normal.z;
270
- }
271
-
272
- if ((top && !perPositionHeight) || wall) {
273
- normals[attrIndex] = normal.x;
274
- normals[attrIndex1] = normal.y;
275
- normals[attrIndex2] = normal.z;
276
- }
317
+ }
318
+ if (vertexFormat.normal) {
319
+ if (options.wall) {
320
+ normals[attrIndex + bottomOffset] = normal.x;
321
+ normals[attrIndex1 + bottomOffset] = normal.y;
322
+ normals[attrIndex2 + bottomOffset] = normal.z;
323
+ } else if (bottom) {
324
+ normals[attrIndex + bottomOffset] = -normal.x;
325
+ normals[attrIndex1 + bottomOffset] = -normal.y;
326
+ normals[attrIndex2 + bottomOffset] = -normal.z;
277
327
  }
278
-
279
- if (shadowVolume) {
280
- if (wall) {
281
- normal = ellipsoid.geodeticSurfaceNormal(position, normal);
282
- }
283
- extrudeNormals[attrIndex + bottomOffset] = -normal.x;
284
- extrudeNormals[attrIndex1 + bottomOffset] = -normal.y;
285
- extrudeNormals[attrIndex2 + bottomOffset] = -normal.z;
328
+ if (top && !perPositionHeight || wall) {
329
+ normals[attrIndex] = normal.x;
330
+ normals[attrIndex1] = normal.y;
331
+ normals[attrIndex2] = normal.z;
286
332
  }
287
-
288
- if (vertexFormat.tangent) {
289
- if (options.wall) {
290
- tangents[attrIndex + bottomOffset] = tangent.x;
291
- tangents[attrIndex1 + bottomOffset] = tangent.y;
292
- tangents[attrIndex2 + bottomOffset] = tangent.z;
293
- } else if (bottom) {
294
- tangents[attrIndex + bottomOffset] = -tangent.x;
295
- tangents[attrIndex1 + bottomOffset] = -tangent.y;
296
- tangents[attrIndex2 + bottomOffset] = -tangent.z;
297
- }
298
-
299
- if (top) {
300
- if (perPositionHeight) {
301
- tangents[attrIndex] = scratchPerPosTangent.x;
302
- tangents[attrIndex1] = scratchPerPosTangent.y;
303
- tangents[attrIndex2] = scratchPerPosTangent.z;
304
- } else {
305
- tangents[attrIndex] = tangent.x;
306
- tangents[attrIndex1] = tangent.y;
307
- tangents[attrIndex2] = tangent.z;
308
- }
309
- }
333
+ }
334
+ if (shadowVolume) {
335
+ if (wall) {
336
+ normal = ellipsoid.geodeticSurfaceNormal(position, normal);
310
337
  }
311
-
312
- if (vertexFormat.bitangent) {
313
- if (bottom) {
314
- bitangents[attrIndex + bottomOffset] = bitangent.x;
315
- bitangents[attrIndex1 + bottomOffset] = bitangent.y;
316
- bitangents[attrIndex2 + bottomOffset] = bitangent.z;
338
+ extrudeNormals[attrIndex + bottomOffset] = -normal.x;
339
+ extrudeNormals[attrIndex1 + bottomOffset] = -normal.y;
340
+ extrudeNormals[attrIndex2 + bottomOffset] = -normal.z;
341
+ }
342
+ if (vertexFormat.tangent) {
343
+ if (options.wall) {
344
+ tangents[attrIndex + bottomOffset] = tangent.x;
345
+ tangents[attrIndex1 + bottomOffset] = tangent.y;
346
+ tangents[attrIndex2 + bottomOffset] = tangent.z;
347
+ } else if (bottom) {
348
+ tangents[attrIndex + bottomOffset] = -tangent.x;
349
+ tangents[attrIndex1 + bottomOffset] = -tangent.y;
350
+ tangents[attrIndex2 + bottomOffset] = -tangent.z;
351
+ }
352
+ if (top) {
353
+ if (perPositionHeight) {
354
+ tangents[attrIndex] = scratchPerPosTangent.x;
355
+ tangents[attrIndex1] = scratchPerPosTangent.y;
356
+ tangents[attrIndex2] = scratchPerPosTangent.z;
357
+ } else {
358
+ tangents[attrIndex] = tangent.x;
359
+ tangents[attrIndex1] = tangent.y;
360
+ tangents[attrIndex2] = tangent.z;
317
361
  }
318
- if (top) {
319
- if (perPositionHeight) {
320
- bitangents[attrIndex] = scratchPerPosBitangent.x;
321
- bitangents[attrIndex1] = scratchPerPosBitangent.y;
322
- bitangents[attrIndex2] = scratchPerPosBitangent.z;
323
- } else {
324
- bitangents[attrIndex] = bitangent.x;
325
- bitangents[attrIndex1] = bitangent.y;
326
- bitangents[attrIndex2] = bitangent.z;
327
- }
362
+ }
363
+ }
364
+ if (vertexFormat.bitangent) {
365
+ if (bottom) {
366
+ bitangents[attrIndex + bottomOffset] = bitangent.x;
367
+ bitangents[attrIndex1 + bottomOffset] = bitangent.y;
368
+ bitangents[attrIndex2 + bottomOffset] = bitangent.z;
369
+ }
370
+ if (top) {
371
+ if (perPositionHeight) {
372
+ bitangents[attrIndex] = scratchPerPosBitangent.x;
373
+ bitangents[attrIndex1] = scratchPerPosBitangent.y;
374
+ bitangents[attrIndex2] = scratchPerPosBitangent.z;
375
+ } else {
376
+ bitangents[attrIndex] = bitangent.x;
377
+ bitangents[attrIndex1] = bitangent.y;
378
+ bitangents[attrIndex2] = bitangent.z;
328
379
  }
329
380
  }
330
- attrIndex += 3;
331
381
  }
332
- }
333
-
334
- if (vertexFormat.st && !defaultValue.defined(flatTexcoords)) {
335
- geometry.attributes.st = new GeometryAttribute.GeometryAttribute({
336
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
337
- componentsPerAttribute: 2,
338
- values: textureCoordinates,
339
- });
340
- }
341
-
342
- if (vertexFormat.normal) {
343
- geometry.attributes.normal = new GeometryAttribute.GeometryAttribute({
344
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
345
- componentsPerAttribute: 3,
346
- values: normals,
347
- });
348
- }
349
-
350
- if (vertexFormat.tangent) {
351
- geometry.attributes.tangent = new GeometryAttribute.GeometryAttribute({
352
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
353
- componentsPerAttribute: 3,
354
- values: tangents,
355
- });
356
- }
357
-
358
- if (vertexFormat.bitangent) {
359
- geometry.attributes.bitangent = new GeometryAttribute.GeometryAttribute({
360
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
361
- componentsPerAttribute: 3,
362
- values: bitangents,
363
- });
364
- }
365
-
366
- if (shadowVolume) {
367
- geometry.attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
368
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
369
- componentsPerAttribute: 3,
370
- values: extrudeNormals,
371
- });
382
+ attrIndex += 3;
372
383
  }
373
384
  }
374
-
375
- if (options.extrude && defaultValue.defined(options.offsetAttribute)) {
376
- const size = flatPositions.length / 3;
377
- let offsetAttribute = new Uint8Array(size);
378
-
379
- if (options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
380
- if ((top && bottom) || wall) {
381
- offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
382
- } else if (top) {
383
- offsetAttribute = offsetAttribute.fill(1);
384
- }
385
- } else {
386
- const offsetValue =
387
- options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
388
- offsetAttribute = offsetAttribute.fill(offsetValue);
389
- }
390
-
391
- geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
392
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
393
- componentsPerAttribute: 1,
394
- values: offsetAttribute,
385
+ if (vertexFormat.st && !defined_default(flatTexcoords)) {
386
+ geometry.attributes.st = new GeometryAttribute_default({
387
+ componentDatatype: ComponentDatatype_default.FLOAT,
388
+ componentsPerAttribute: 2,
389
+ values: textureCoordinates
395
390
  });
396
391
  }
397
-
398
- return geometry;
399
- }
400
-
401
- const startCartographicScratch = new Matrix3.Cartographic();
402
- const endCartographicScratch = new Matrix3.Cartographic();
403
- const idlCross = {
404
- westOverIDL: 0.0,
405
- eastOverIDL: 0.0,
406
- };
407
- let ellipsoidGeodesic = new EllipsoidGeodesic.EllipsoidGeodesic();
408
- function computeRectangle(positions, ellipsoid, arcType, granularity, result) {
409
- result = defaultValue.defaultValue(result, new Matrix2.Rectangle());
410
- if (!defaultValue.defined(positions) || positions.length < 3) {
411
- result.west = 0.0;
412
- result.north = 0.0;
413
- result.south = 0.0;
414
- result.east = 0.0;
415
- return result;
392
+ if (vertexFormat.normal) {
393
+ geometry.attributes.normal = new GeometryAttribute_default({
394
+ componentDatatype: ComponentDatatype_default.FLOAT,
395
+ componentsPerAttribute: 3,
396
+ values: normals
397
+ });
416
398
  }
417
-
418
- if (arcType === ArcType.ArcType.RHUMB) {
419
- return Matrix2.Rectangle.fromCartesianArray(positions, ellipsoid, result);
399
+ if (vertexFormat.tangent) {
400
+ geometry.attributes.tangent = new GeometryAttribute_default({
401
+ componentDatatype: ComponentDatatype_default.FLOAT,
402
+ componentsPerAttribute: 3,
403
+ values: tangents
404
+ });
420
405
  }
421
-
422
- if (!ellipsoidGeodesic.ellipsoid.equals(ellipsoid)) {
423
- ellipsoidGeodesic = new EllipsoidGeodesic.EllipsoidGeodesic(undefined, undefined, ellipsoid);
406
+ if (vertexFormat.bitangent) {
407
+ geometry.attributes.bitangent = new GeometryAttribute_default({
408
+ componentDatatype: ComponentDatatype_default.FLOAT,
409
+ componentsPerAttribute: 3,
410
+ values: bitangents
411
+ });
424
412
  }
425
-
426
- result.west = Number.POSITIVE_INFINITY;
427
- result.east = Number.NEGATIVE_INFINITY;
428
- result.south = Number.POSITIVE_INFINITY;
429
- result.north = Number.NEGATIVE_INFINITY;
430
-
431
- idlCross.westOverIDL = Number.POSITIVE_INFINITY;
432
- idlCross.eastOverIDL = Number.NEGATIVE_INFINITY;
433
-
434
- const inverseChordLength =
435
- 1.0 / Math$1.CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);
436
- const positionsLength = positions.length;
437
- let endCartographic = ellipsoid.cartesianToCartographic(
438
- positions[0],
439
- endCartographicScratch
440
- );
441
- let startCartographic = startCartographicScratch;
442
- let swap;
443
-
444
- for (let i = 1; i < positionsLength; i++) {
445
- swap = startCartographic;
446
- startCartographic = endCartographic;
447
- endCartographic = ellipsoid.cartesianToCartographic(positions[i], swap);
448
- ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
449
- interpolateAndGrowRectangle(
450
- ellipsoidGeodesic,
451
- inverseChordLength,
452
- result,
453
- idlCross
454
- );
413
+ if (shadowVolume) {
414
+ geometry.attributes.extrudeDirection = new GeometryAttribute_default({
415
+ componentDatatype: ComponentDatatype_default.FLOAT,
416
+ componentsPerAttribute: 3,
417
+ values: extrudeNormals
418
+ });
455
419
  }
456
-
420
+ }
421
+ if (options.extrude && defined_default(options.offsetAttribute)) {
422
+ const size = flatPositions.length / 3;
423
+ let offsetAttribute = new Uint8Array(size);
424
+ if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
425
+ if (top && bottom || wall) {
426
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
427
+ } else if (top) {
428
+ offsetAttribute = offsetAttribute.fill(1);
429
+ }
430
+ } else {
431
+ const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
432
+ offsetAttribute = offsetAttribute.fill(offsetValue);
433
+ }
434
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
435
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
436
+ componentsPerAttribute: 1,
437
+ values: offsetAttribute
438
+ });
439
+ }
440
+ return geometry;
441
+ }
442
+ var startCartographicScratch = new Cartographic_default();
443
+ var endCartographicScratch = new Cartographic_default();
444
+ var idlCross = {
445
+ westOverIDL: 0,
446
+ eastOverIDL: 0
447
+ };
448
+ var ellipsoidGeodesic = new EllipsoidGeodesic_default();
449
+ function computeRectangle(positions, ellipsoid, arcType, granularity, result) {
450
+ result = defaultValue_default(result, new Rectangle_default());
451
+ if (!defined_default(positions) || positions.length < 3) {
452
+ result.west = 0;
453
+ result.north = 0;
454
+ result.south = 0;
455
+ result.east = 0;
456
+ return result;
457
+ }
458
+ if (arcType === ArcType_default.RHUMB) {
459
+ return Rectangle_default.fromCartesianArray(positions, ellipsoid, result);
460
+ }
461
+ if (!ellipsoidGeodesic.ellipsoid.equals(ellipsoid)) {
462
+ ellipsoidGeodesic = new EllipsoidGeodesic_default(void 0, void 0, ellipsoid);
463
+ }
464
+ result.west = Number.POSITIVE_INFINITY;
465
+ result.east = Number.NEGATIVE_INFINITY;
466
+ result.south = Number.POSITIVE_INFINITY;
467
+ result.north = Number.NEGATIVE_INFINITY;
468
+ idlCross.westOverIDL = Number.POSITIVE_INFINITY;
469
+ idlCross.eastOverIDL = Number.NEGATIVE_INFINITY;
470
+ const inverseChordLength = 1 / Math_default.chordLength(granularity, ellipsoid.maximumRadius);
471
+ const positionsLength = positions.length;
472
+ let endCartographic = ellipsoid.cartesianToCartographic(
473
+ positions[0],
474
+ endCartographicScratch
475
+ );
476
+ let startCartographic = startCartographicScratch;
477
+ let swap;
478
+ for (let i = 1; i < positionsLength; i++) {
457
479
  swap = startCartographic;
458
480
  startCartographic = endCartographic;
459
- endCartographic = ellipsoid.cartesianToCartographic(positions[0], swap);
481
+ endCartographic = ellipsoid.cartesianToCartographic(positions[i], swap);
460
482
  ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
461
483
  interpolateAndGrowRectangle(
462
484
  ellipsoidGeodesic,
@@ -464,164 +486,155 @@ define(['./defaultValue-fe22d8c0', './Matrix3-41c58dde', './ArcType-2d9abbbc', '
464
486
  result,
465
487
  idlCross
466
488
  );
467
-
468
- if (result.east - result.west > idlCross.eastOverIDL - idlCross.westOverIDL) {
469
- result.west = idlCross.westOverIDL;
470
- result.east = idlCross.eastOverIDL;
471
-
472
- if (result.east > Math$1.CesiumMath.PI) {
473
- result.east = result.east - Math$1.CesiumMath.TWO_PI;
474
- }
475
- if (result.west > Math$1.CesiumMath.PI) {
476
- result.west = result.west - Math$1.CesiumMath.TWO_PI;
477
- }
478
- }
479
-
480
- return result;
481
489
  }
482
-
483
- const interpolatedCartographicScratch = new Matrix3.Cartographic();
484
- function interpolateAndGrowRectangle(
490
+ swap = startCartographic;
491
+ startCartographic = endCartographic;
492
+ endCartographic = ellipsoid.cartesianToCartographic(positions[0], swap);
493
+ ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
494
+ interpolateAndGrowRectangle(
485
495
  ellipsoidGeodesic,
486
496
  inverseChordLength,
487
497
  result,
488
498
  idlCross
489
- ) {
490
- const segmentLength = ellipsoidGeodesic.surfaceDistance;
491
-
492
- const numPoints = Math.ceil(segmentLength * inverseChordLength);
493
- const subsegmentDistance =
494
- numPoints > 0 ? segmentLength / (numPoints - 1) : Number.POSITIVE_INFINITY;
495
- let interpolationDistance = 0.0;
496
-
497
- for (let i = 0; i < numPoints; i++) {
498
- const interpolatedCartographic = ellipsoidGeodesic.interpolateUsingSurfaceDistance(
499
- interpolationDistance,
500
- interpolatedCartographicScratch
499
+ );
500
+ if (result.east - result.west > idlCross.eastOverIDL - idlCross.westOverIDL) {
501
+ result.west = idlCross.westOverIDL;
502
+ result.east = idlCross.eastOverIDL;
503
+ if (result.east > Math_default.PI) {
504
+ result.east = result.east - Math_default.TWO_PI;
505
+ }
506
+ if (result.west > Math_default.PI) {
507
+ result.west = result.west - Math_default.TWO_PI;
508
+ }
509
+ }
510
+ return result;
511
+ }
512
+ var interpolatedCartographicScratch = new Cartographic_default();
513
+ function interpolateAndGrowRectangle(ellipsoidGeodesic2, inverseChordLength, result, idlCross2) {
514
+ const segmentLength = ellipsoidGeodesic2.surfaceDistance;
515
+ const numPoints = Math.ceil(segmentLength * inverseChordLength);
516
+ const subsegmentDistance = numPoints > 0 ? segmentLength / (numPoints - 1) : Number.POSITIVE_INFINITY;
517
+ let interpolationDistance = 0;
518
+ for (let i = 0; i < numPoints; i++) {
519
+ const interpolatedCartographic = ellipsoidGeodesic2.interpolateUsingSurfaceDistance(
520
+ interpolationDistance,
521
+ interpolatedCartographicScratch
522
+ );
523
+ interpolationDistance += subsegmentDistance;
524
+ const longitude = interpolatedCartographic.longitude;
525
+ const latitude = interpolatedCartographic.latitude;
526
+ result.west = Math.min(result.west, longitude);
527
+ result.east = Math.max(result.east, longitude);
528
+ result.south = Math.min(result.south, latitude);
529
+ result.north = Math.max(result.north, latitude);
530
+ const lonAdjusted = longitude >= 0 ? longitude : longitude + Math_default.TWO_PI;
531
+ idlCross2.westOverIDL = Math.min(idlCross2.westOverIDL, lonAdjusted);
532
+ idlCross2.eastOverIDL = Math.max(idlCross2.eastOverIDL, lonAdjusted);
533
+ }
534
+ }
535
+ var createGeometryFromPositionsExtrudedPositions = [];
536
+ function createGeometryFromPositionsExtruded(ellipsoid, polygon, textureCoordinates, granularity, hierarchy, perPositionHeight, closeTop, closeBottom, vertexFormat, arcType) {
537
+ const geos = {
538
+ walls: []
539
+ };
540
+ let i;
541
+ if (closeTop || closeBottom) {
542
+ const topGeo = PolygonGeometryLibrary_default.createGeometryFromPositions(
543
+ ellipsoid,
544
+ polygon,
545
+ textureCoordinates,
546
+ granularity,
547
+ perPositionHeight,
548
+ vertexFormat,
549
+ arcType
550
+ );
551
+ const edgePoints = topGeo.attributes.position.values;
552
+ const indices = topGeo.indices;
553
+ let numPositions;
554
+ let newIndices;
555
+ if (closeTop && closeBottom) {
556
+ const topBottomPositions = edgePoints.concat(edgePoints);
557
+ numPositions = topBottomPositions.length / 3;
558
+ newIndices = IndexDatatype_default.createTypedArray(
559
+ numPositions,
560
+ indices.length * 2
501
561
  );
502
- interpolationDistance += subsegmentDistance;
503
- const longitude = interpolatedCartographic.longitude;
504
- const latitude = interpolatedCartographic.latitude;
505
-
506
- result.west = Math.min(result.west, longitude);
507
- result.east = Math.max(result.east, longitude);
508
- result.south = Math.min(result.south, latitude);
509
- result.north = Math.max(result.north, latitude);
510
-
511
- const lonAdjusted =
512
- longitude >= 0 ? longitude : longitude + Math$1.CesiumMath.TWO_PI;
513
- idlCross.westOverIDL = Math.min(idlCross.westOverIDL, lonAdjusted);
514
- idlCross.eastOverIDL = Math.max(idlCross.eastOverIDL, lonAdjusted);
562
+ newIndices.set(indices);
563
+ const ilength = indices.length;
564
+ const length = numPositions / 2;
565
+ for (i = 0; i < ilength; i += 3) {
566
+ const i0 = newIndices[i] + length;
567
+ const i1 = newIndices[i + 1] + length;
568
+ const i2 = newIndices[i + 2] + length;
569
+ newIndices[i + ilength] = i2;
570
+ newIndices[i + 1 + ilength] = i1;
571
+ newIndices[i + 2 + ilength] = i0;
572
+ }
573
+ topGeo.attributes.position.values = topBottomPositions;
574
+ if (perPositionHeight && vertexFormat.normal) {
575
+ const normals = topGeo.attributes.normal.values;
576
+ topGeo.attributes.normal.values = new Float32Array(
577
+ topBottomPositions.length
578
+ );
579
+ topGeo.attributes.normal.values.set(normals);
580
+ }
581
+ if (vertexFormat.st && defined_default(textureCoordinates)) {
582
+ const texcoords = topGeo.attributes.st.values;
583
+ topGeo.attributes.st.values = new Float32Array(numPositions * 2);
584
+ topGeo.attributes.st.values = texcoords.concat(texcoords);
585
+ }
586
+ topGeo.indices = newIndices;
587
+ } else if (closeBottom) {
588
+ numPositions = edgePoints.length / 3;
589
+ newIndices = IndexDatatype_default.createTypedArray(numPositions, indices.length);
590
+ for (i = 0; i < indices.length; i += 3) {
591
+ newIndices[i] = indices[i + 2];
592
+ newIndices[i + 1] = indices[i + 1];
593
+ newIndices[i + 2] = indices[i];
594
+ }
595
+ topGeo.indices = newIndices;
515
596
  }
597
+ geos.topAndBottom = new GeometryInstance_default({
598
+ geometry: topGeo
599
+ });
516
600
  }
517
-
518
- const createGeometryFromPositionsExtrudedPositions = [];
519
-
520
- function createGeometryFromPositionsExtruded(
521
- ellipsoid,
522
- polygon,
601
+ let outerRing = hierarchy.outerRing;
602
+ let tangentPlane = EllipsoidTangentPlane_default.fromPoints(outerRing, ellipsoid);
603
+ let positions2D = tangentPlane.projectPointsOntoPlane(
604
+ outerRing,
605
+ createGeometryFromPositionsExtrudedPositions
606
+ );
607
+ let windingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
608
+ if (windingOrder === WindingOrder_default.CLOCKWISE) {
609
+ outerRing = outerRing.slice().reverse();
610
+ }
611
+ let wallGeo = PolygonGeometryLibrary_default.computeWallGeometry(
612
+ outerRing,
523
613
  textureCoordinates,
614
+ ellipsoid,
524
615
  granularity,
525
- hierarchy,
526
616
  perPositionHeight,
527
- closeTop,
528
- closeBottom,
529
- vertexFormat,
530
617
  arcType
531
- ) {
532
- const geos = {
533
- walls: [],
534
- };
535
- let i;
536
-
537
- if (closeTop || closeBottom) {
538
- const topGeo = PolygonGeometryLibrary.PolygonGeometryLibrary.createGeometryFromPositions(
539
- ellipsoid,
540
- polygon,
541
- textureCoordinates,
542
- granularity,
543
- perPositionHeight,
544
- vertexFormat,
545
- arcType
546
- );
547
-
548
- const edgePoints = topGeo.attributes.position.values;
549
- const indices = topGeo.indices;
550
- let numPositions;
551
- let newIndices;
552
-
553
- if (closeTop && closeBottom) {
554
- const topBottomPositions = edgePoints.concat(edgePoints);
555
-
556
- numPositions = topBottomPositions.length / 3;
557
-
558
- newIndices = IndexDatatype.IndexDatatype.createTypedArray(
559
- numPositions,
560
- indices.length * 2
561
- );
562
- newIndices.set(indices);
563
- const ilength = indices.length;
564
-
565
- const length = numPositions / 2;
566
-
567
- for (i = 0; i < ilength; i += 3) {
568
- const i0 = newIndices[i] + length;
569
- const i1 = newIndices[i + 1] + length;
570
- const i2 = newIndices[i + 2] + length;
571
-
572
- newIndices[i + ilength] = i2;
573
- newIndices[i + 1 + ilength] = i1;
574
- newIndices[i + 2 + ilength] = i0;
575
- }
576
-
577
- topGeo.attributes.position.values = topBottomPositions;
578
- if (perPositionHeight && vertexFormat.normal) {
579
- const normals = topGeo.attributes.normal.values;
580
- topGeo.attributes.normal.values = new Float32Array(
581
- topBottomPositions.length
582
- );
583
- topGeo.attributes.normal.values.set(normals);
584
- }
585
-
586
- if (vertexFormat.st && defaultValue.defined(textureCoordinates)) {
587
- const texcoords = topGeo.attributes.st.values;
588
- topGeo.attributes.st.values = new Float32Array(numPositions * 2);
589
- topGeo.attributes.st.values = texcoords.concat(texcoords);
590
- }
591
-
592
- topGeo.indices = newIndices;
593
- } else if (closeBottom) {
594
- numPositions = edgePoints.length / 3;
595
- newIndices = IndexDatatype.IndexDatatype.createTypedArray(numPositions, indices.length);
596
-
597
- for (i = 0; i < indices.length; i += 3) {
598
- newIndices[i] = indices[i + 2];
599
- newIndices[i + 1] = indices[i + 1];
600
- newIndices[i + 2] = indices[i];
601
- }
602
-
603
- topGeo.indices = newIndices;
604
- }
605
-
606
- geos.topAndBottom = new GeometryInstance.GeometryInstance({
607
- geometry: topGeo,
608
- });
609
- }
610
-
611
- let outerRing = hierarchy.outerRing;
612
- let tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(outerRing, ellipsoid);
613
- let positions2D = tangentPlane.projectPointsOntoPlane(
614
- outerRing,
618
+ );
619
+ geos.walls.push(
620
+ new GeometryInstance_default({
621
+ geometry: wallGeo
622
+ })
623
+ );
624
+ const holes = hierarchy.holes;
625
+ for (i = 0; i < holes.length; i++) {
626
+ let hole = holes[i];
627
+ tangentPlane = EllipsoidTangentPlane_default.fromPoints(hole, ellipsoid);
628
+ positions2D = tangentPlane.projectPointsOntoPlane(
629
+ hole,
615
630
  createGeometryFromPositionsExtrudedPositions
616
631
  );
617
-
618
- let windingOrder = PolygonPipeline.PolygonPipeline.computeWindingOrder2D(positions2D);
619
- if (windingOrder === PolygonPipeline.WindingOrder.CLOCKWISE) {
620
- outerRing = outerRing.slice().reverse();
632
+ windingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
633
+ if (windingOrder === WindingOrder_default.COUNTER_CLOCKWISE) {
634
+ hole = hole.slice().reverse();
621
635
  }
622
-
623
- let wallGeo = PolygonGeometryLibrary.PolygonGeometryLibrary.computeWallGeometry(
624
- outerRing,
636
+ wallGeo = PolygonGeometryLibrary_default.computeWallGeometry(
637
+ hole,
625
638
  textureCoordinates,
626
639
  ellipsoid,
627
640
  granularity,
@@ -629,792 +642,493 @@ define(['./defaultValue-fe22d8c0', './Matrix3-41c58dde', './ArcType-2d9abbbc', '
629
642
  arcType
630
643
  );
631
644
  geos.walls.push(
632
- new GeometryInstance.GeometryInstance({
633
- geometry: wallGeo,
645
+ new GeometryInstance_default({
646
+ geometry: wallGeo
634
647
  })
635
648
  );
636
-
637
- const holes = hierarchy.holes;
638
- for (i = 0; i < holes.length; i++) {
639
- let hole = holes[i];
640
-
641
- tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(hole, ellipsoid);
642
- positions2D = tangentPlane.projectPointsOntoPlane(
643
- hole,
644
- createGeometryFromPositionsExtrudedPositions
645
- );
646
-
647
- windingOrder = PolygonPipeline.PolygonPipeline.computeWindingOrder2D(positions2D);
648
- if (windingOrder === PolygonPipeline.WindingOrder.COUNTER_CLOCKWISE) {
649
- hole = hole.slice().reverse();
650
- }
651
-
652
- wallGeo = PolygonGeometryLibrary.PolygonGeometryLibrary.computeWallGeometry(
653
- hole,
654
- textureCoordinates,
655
- ellipsoid,
656
- granularity,
657
- perPositionHeight,
658
- arcType
659
- );
660
- geos.walls.push(
661
- new GeometryInstance.GeometryInstance({
662
- geometry: wallGeo,
663
- })
664
- );
665
- }
666
-
667
- return geos;
668
649
  }
669
-
670
- /**
671
- * A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
672
- *
673
- * @alias PolygonGeometry
674
- * @constructor
675
- *
676
- * @param {object} options Object with the following properties:
677
- * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
678
- * @param {number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface.
679
- * @param {number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.
680
- * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
681
- * @param {number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
682
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
683
- * @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.
684
- * @param {boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
685
- * @param {boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.
686
- * @param {boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.
687
- * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
688
- * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
689
- *
690
- * @see PolygonGeometry#createGeometry
691
- * @see PolygonGeometry#fromPositions
692
- *
693
- * @demo {@link https://sandcastle.cesium.com/index.html?src=Polygon.html|Cesium Sandcastle Polygon Demo}
694
- *
695
- * @example
696
- * // 1. create a polygon from points
697
- * const polygon = new Cesium.PolygonGeometry({
698
- * polygonHierarchy : new Cesium.PolygonHierarchy(
699
- * Cesium.Cartesian3.fromDegreesArray([
700
- * -72.0, 40.0,
701
- * -70.0, 35.0,
702
- * -75.0, 30.0,
703
- * -70.0, 30.0,
704
- * -68.0, 40.0
705
- * ])
706
- * )
707
- * });
708
- * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
709
- *
710
- * // 2. create a nested polygon with holes
711
- * const polygonWithHole = new Cesium.PolygonGeometry({
712
- * polygonHierarchy : new Cesium.PolygonHierarchy(
713
- * Cesium.Cartesian3.fromDegreesArray([
714
- * -109.0, 30.0,
715
- * -95.0, 30.0,
716
- * -95.0, 40.0,
717
- * -109.0, 40.0
718
- * ]),
719
- * [new Cesium.PolygonHierarchy(
720
- * Cesium.Cartesian3.fromDegreesArray([
721
- * -107.0, 31.0,
722
- * -107.0, 39.0,
723
- * -97.0, 39.0,
724
- * -97.0, 31.0
725
- * ]),
726
- * [new Cesium.PolygonHierarchy(
727
- * Cesium.Cartesian3.fromDegreesArray([
728
- * -105.0, 33.0,
729
- * -99.0, 33.0,
730
- * -99.0, 37.0,
731
- * -105.0, 37.0
732
- * ]),
733
- * [new Cesium.PolygonHierarchy(
734
- * Cesium.Cartesian3.fromDegreesArray([
735
- * -103.0, 34.0,
736
- * -101.0, 34.0,
737
- * -101.0, 36.0,
738
- * -103.0, 36.0
739
- * ])
740
- * )]
741
- * )]
742
- * )]
743
- * )
744
- * });
745
- * const geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);
746
- *
747
- * // 3. create extruded polygon
748
- * const extrudedPolygon = new Cesium.PolygonGeometry({
749
- * polygonHierarchy : new Cesium.PolygonHierarchy(
750
- * Cesium.Cartesian3.fromDegreesArray([
751
- * -72.0, 40.0,
752
- * -70.0, 35.0,
753
- * -75.0, 30.0,
754
- * -70.0, 30.0,
755
- * -68.0, 40.0
756
- * ])
757
- * ),
758
- * extrudedHeight: 300000
759
- * });
760
- * const geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);
761
- */
762
- function PolygonGeometry(options) {
763
- //>>includeStart('debug', pragmas.debug);
764
- Check.Check.typeOf.object("options", options);
765
- Check.Check.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
766
- if (
767
- defaultValue.defined(options.perPositionHeight) &&
768
- options.perPositionHeight &&
769
- defaultValue.defined(options.height)
770
- ) {
771
- throw new Check.DeveloperError(
772
- "Cannot use both options.perPositionHeight and options.height"
773
- );
774
- }
775
- if (
776
- defaultValue.defined(options.arcType) &&
777
- options.arcType !== ArcType.ArcType.GEODESIC &&
778
- options.arcType !== ArcType.ArcType.RHUMB
779
- ) {
780
- throw new Check.DeveloperError(
781
- "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
782
- );
783
- }
784
- //>>includeEnd('debug');
785
-
786
- const polygonHierarchy = options.polygonHierarchy;
787
- const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
788
- const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
789
- const granularity = defaultValue.defaultValue(
790
- options.granularity,
791
- Math$1.CesiumMath.RADIANS_PER_DEGREE
650
+ return geos;
651
+ }
652
+ function PolygonGeometry(options) {
653
+ Check_default.typeOf.object("options", options);
654
+ Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
655
+ if (defined_default(options.perPositionHeight) && options.perPositionHeight && defined_default(options.height)) {
656
+ throw new DeveloperError_default(
657
+ "Cannot use both options.perPositionHeight and options.height"
792
658
  );
793
- const stRotation = defaultValue.defaultValue(options.stRotation, 0.0);
794
- const textureCoordinates = options.textureCoordinates;
795
- const perPositionHeight = defaultValue.defaultValue(options.perPositionHeight, false);
796
- const perPositionHeightExtrude =
797
- perPositionHeight && defaultValue.defined(options.extrudedHeight);
798
- let height = defaultValue.defaultValue(options.height, 0.0);
799
- let extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
800
-
801
- if (!perPositionHeightExtrude) {
802
- const h = Math.max(height, extrudedHeight);
803
- extrudedHeight = Math.min(height, extrudedHeight);
804
- height = h;
805
- }
806
-
807
- this._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat);
808
- this._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid);
809
- this._granularity = granularity;
810
- this._stRotation = stRotation;
811
- this._height = height;
812
- this._extrudedHeight = extrudedHeight;
813
- this._closeTop = defaultValue.defaultValue(options.closeTop, true);
814
- this._closeBottom = defaultValue.defaultValue(options.closeBottom, true);
815
- this._polygonHierarchy = polygonHierarchy;
816
- this._perPositionHeight = perPositionHeight;
817
- this._perPositionHeightExtrude = perPositionHeightExtrude;
818
- this._shadowVolume = defaultValue.defaultValue(options.shadowVolume, false);
819
- this._workerName = "createPolygonGeometry";
820
- this._offsetAttribute = options.offsetAttribute;
821
- this._arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
822
-
823
- this._rectangle = undefined;
824
- this._textureCoordinateRotationPoints = undefined;
825
- this._textureCoordinates = textureCoordinates;
826
-
827
- /**
828
- * The number of elements used to pack the object into an array.
829
- * @type {number}
830
- */
831
- this.packedLength =
832
- PolygonGeometryLibrary.PolygonGeometryLibrary.computeHierarchyPackedLength(
833
- polygonHierarchy,
834
- Matrix3.Cartesian3
835
- ) +
836
- Matrix3.Ellipsoid.packedLength +
837
- VertexFormat.VertexFormat.packedLength +
838
- (textureCoordinates
839
- ? PolygonGeometryLibrary.PolygonGeometryLibrary.computeHierarchyPackedLength(
840
- textureCoordinates,
841
- Matrix2.Cartesian2
842
- )
843
- : 1) +
844
- 12;
845
659
  }
846
-
847
- /**
848
- * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
849
- *
850
- * @param {object} options Object with the following properties:
851
- * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.
852
- * @param {number} [options.height=0.0] The height of the polygon.
853
- * @param {number} [options.extrudedHeight] The height of the polygon extrusion.
854
- * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
855
- * @param {number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
856
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
857
- * @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.
858
- * @param {boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
859
- * @param {boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.
860
- * @param {boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.
861
- * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
862
- * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
863
- * @returns {PolygonGeometry}
864
- *
865
- * @example
866
- * // create a polygon from points
867
- * const polygon = Cesium.PolygonGeometry.fromPositions({
868
- * positions : Cesium.Cartesian3.fromDegreesArray([
869
- * -72.0, 40.0,
870
- * -70.0, 35.0,
871
- * -75.0, 30.0,
872
- * -70.0, 30.0,
873
- * -68.0, 40.0
874
- * ])
875
- * });
876
- * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
877
- *
878
- * @see PolygonGeometry#createGeometry
879
- */
880
- PolygonGeometry.fromPositions = function (options) {
881
- options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
882
-
883
- //>>includeStart('debug', pragmas.debug);
884
- Check.Check.defined("options.positions", options.positions);
885
- //>>includeEnd('debug');
886
-
887
- const newOptions = {
888
- polygonHierarchy: {
889
- positions: options.positions,
890
- },
891
- height: options.height,
892
- extrudedHeight: options.extrudedHeight,
893
- vertexFormat: options.vertexFormat,
894
- stRotation: options.stRotation,
895
- ellipsoid: options.ellipsoid,
896
- granularity: options.granularity,
897
- perPositionHeight: options.perPositionHeight,
898
- closeTop: options.closeTop,
899
- closeBottom: options.closeBottom,
900
- offsetAttribute: options.offsetAttribute,
901
- arcType: options.arcType,
902
- textureCoordinates: options.textureCoordinates,
903
- };
904
- return new PolygonGeometry(newOptions);
905
- };
906
-
907
- /**
908
- * Stores the provided instance into the provided array.
909
- *
910
- * @param {PolygonGeometry} value The value to pack.
911
- * @param {number[]} array The array to pack into.
912
- * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
913
- *
914
- * @returns {number[]} The array that was packed into
915
- */
916
- PolygonGeometry.pack = function (value, array, startingIndex) {
917
- //>>includeStart('debug', pragmas.debug);
918
- Check.Check.typeOf.object("value", value);
919
- Check.Check.defined("array", array);
920
- //>>includeEnd('debug');
921
-
922
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
923
-
924
- startingIndex = PolygonGeometryLibrary.PolygonGeometryLibrary.packPolygonHierarchy(
925
- value._polygonHierarchy,
926
- array,
927
- startingIndex,
928
- Matrix3.Cartesian3
660
+ if (defined_default(options.arcType) && options.arcType !== ArcType_default.GEODESIC && options.arcType !== ArcType_default.RHUMB) {
661
+ throw new DeveloperError_default(
662
+ "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
929
663
  );
930
-
931
- Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
932
- startingIndex += Matrix3.Ellipsoid.packedLength;
933
-
934
- VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
935
- startingIndex += VertexFormat.VertexFormat.packedLength;
936
-
937
- array[startingIndex++] = value._height;
938
- array[startingIndex++] = value._extrudedHeight;
939
- array[startingIndex++] = value._granularity;
940
- array[startingIndex++] = value._stRotation;
941
- array[startingIndex++] = value._perPositionHeightExtrude ? 1.0 : 0.0;
942
- array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0;
943
- array[startingIndex++] = value._closeTop ? 1.0 : 0.0;
944
- array[startingIndex++] = value._closeBottom ? 1.0 : 0.0;
945
- array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;
946
- array[startingIndex++] = defaultValue.defaultValue(value._offsetAttribute, -1);
947
- array[startingIndex++] = value._arcType;
948
- if (defaultValue.defined(value._textureCoordinates)) {
949
- startingIndex = PolygonGeometryLibrary.PolygonGeometryLibrary.packPolygonHierarchy(
950
- value._textureCoordinates,
951
- array,
952
- startingIndex,
953
- Matrix2.Cartesian2
954
- );
955
- } else {
956
- array[startingIndex++] = -1.0;
957
- }
958
- array[startingIndex++] = value.packedLength;
959
- return array;
960
- };
961
-
962
- const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
963
- const scratchVertexFormat = new VertexFormat.VertexFormat();
964
-
965
- //Only used to avoid inability to default construct.
966
- const dummyOptions = {
967
- polygonHierarchy: {},
664
+ }
665
+ const polygonHierarchy = options.polygonHierarchy;
666
+ const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
667
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
668
+ const granularity = defaultValue_default(
669
+ options.granularity,
670
+ Math_default.RADIANS_PER_DEGREE
671
+ );
672
+ const stRotation = defaultValue_default(options.stRotation, 0);
673
+ const textureCoordinates = options.textureCoordinates;
674
+ const perPositionHeight = defaultValue_default(options.perPositionHeight, false);
675
+ const perPositionHeightExtrude = perPositionHeight && defined_default(options.extrudedHeight);
676
+ let height = defaultValue_default(options.height, 0);
677
+ let extrudedHeight = defaultValue_default(options.extrudedHeight, height);
678
+ if (!perPositionHeightExtrude) {
679
+ const h = Math.max(height, extrudedHeight);
680
+ extrudedHeight = Math.min(height, extrudedHeight);
681
+ height = h;
682
+ }
683
+ this._vertexFormat = VertexFormat_default.clone(vertexFormat);
684
+ this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
685
+ this._granularity = granularity;
686
+ this._stRotation = stRotation;
687
+ this._height = height;
688
+ this._extrudedHeight = extrudedHeight;
689
+ this._closeTop = defaultValue_default(options.closeTop, true);
690
+ this._closeBottom = defaultValue_default(options.closeBottom, true);
691
+ this._polygonHierarchy = polygonHierarchy;
692
+ this._perPositionHeight = perPositionHeight;
693
+ this._perPositionHeightExtrude = perPositionHeightExtrude;
694
+ this._shadowVolume = defaultValue_default(options.shadowVolume, false);
695
+ this._workerName = "createPolygonGeometry";
696
+ this._offsetAttribute = options.offsetAttribute;
697
+ this._arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
698
+ this._rectangle = void 0;
699
+ this._textureCoordinateRotationPoints = void 0;
700
+ this._textureCoordinates = textureCoordinates;
701
+ this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
702
+ polygonHierarchy,
703
+ Cartesian3_default
704
+ ) + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + (textureCoordinates ? PolygonGeometryLibrary_default.computeHierarchyPackedLength(
705
+ textureCoordinates,
706
+ Cartesian2_default
707
+ ) : 1) + 12;
708
+ }
709
+ PolygonGeometry.fromPositions = function(options) {
710
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
711
+ Check_default.defined("options.positions", options.positions);
712
+ const newOptions = {
713
+ polygonHierarchy: {
714
+ positions: options.positions
715
+ },
716
+ height: options.height,
717
+ extrudedHeight: options.extrudedHeight,
718
+ vertexFormat: options.vertexFormat,
719
+ stRotation: options.stRotation,
720
+ ellipsoid: options.ellipsoid,
721
+ granularity: options.granularity,
722
+ perPositionHeight: options.perPositionHeight,
723
+ closeTop: options.closeTop,
724
+ closeBottom: options.closeBottom,
725
+ offsetAttribute: options.offsetAttribute,
726
+ arcType: options.arcType,
727
+ textureCoordinates: options.textureCoordinates
968
728
  };
969
-
970
- /**
971
- * Retrieves an instance from a packed array.
972
- *
973
- * @param {number[]} array The packed array.
974
- * @param {number} [startingIndex=0] The starting index of the element to be unpacked.
975
- * @param {PolygonGeometry} [result] The object into which to store the result.
976
- */
977
- PolygonGeometry.unpack = function (array, startingIndex, result) {
978
- //>>includeStart('debug', pragmas.debug);
979
- Check.Check.defined("array", array);
980
- //>>includeEnd('debug');
981
-
982
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
983
-
984
- const polygonHierarchy = PolygonGeometryLibrary.PolygonGeometryLibrary.unpackPolygonHierarchy(
729
+ return new PolygonGeometry(newOptions);
730
+ };
731
+ PolygonGeometry.pack = function(value, array, startingIndex) {
732
+ Check_default.typeOf.object("value", value);
733
+ Check_default.defined("array", array);
734
+ startingIndex = defaultValue_default(startingIndex, 0);
735
+ startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
736
+ value._polygonHierarchy,
737
+ array,
738
+ startingIndex,
739
+ Cartesian3_default
740
+ );
741
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
742
+ startingIndex += Ellipsoid_default.packedLength;
743
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
744
+ startingIndex += VertexFormat_default.packedLength;
745
+ array[startingIndex++] = value._height;
746
+ array[startingIndex++] = value._extrudedHeight;
747
+ array[startingIndex++] = value._granularity;
748
+ array[startingIndex++] = value._stRotation;
749
+ array[startingIndex++] = value._perPositionHeightExtrude ? 1 : 0;
750
+ array[startingIndex++] = value._perPositionHeight ? 1 : 0;
751
+ array[startingIndex++] = value._closeTop ? 1 : 0;
752
+ array[startingIndex++] = value._closeBottom ? 1 : 0;
753
+ array[startingIndex++] = value._shadowVolume ? 1 : 0;
754
+ array[startingIndex++] = defaultValue_default(value._offsetAttribute, -1);
755
+ array[startingIndex++] = value._arcType;
756
+ if (defined_default(value._textureCoordinates)) {
757
+ startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
758
+ value._textureCoordinates,
985
759
  array,
986
760
  startingIndex,
987
- Matrix3.Cartesian3
761
+ Cartesian2_default
988
762
  );
989
- startingIndex = polygonHierarchy.startingIndex;
990
- delete polygonHierarchy.startingIndex;
991
-
992
- const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
993
- startingIndex += Matrix3.Ellipsoid.packedLength;
994
-
995
- const vertexFormat = VertexFormat.VertexFormat.unpack(
996
- array,
997
- startingIndex,
998
- scratchVertexFormat
763
+ } else {
764
+ array[startingIndex++] = -1;
765
+ }
766
+ array[startingIndex++] = value.packedLength;
767
+ return array;
768
+ };
769
+ var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
770
+ var scratchVertexFormat = new VertexFormat_default();
771
+ var dummyOptions = {
772
+ polygonHierarchy: {}
773
+ };
774
+ PolygonGeometry.unpack = function(array, startingIndex, result) {
775
+ Check_default.defined("array", array);
776
+ startingIndex = defaultValue_default(startingIndex, 0);
777
+ const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
778
+ array,
779
+ startingIndex,
780
+ Cartesian3_default
781
+ );
782
+ startingIndex = polygonHierarchy.startingIndex;
783
+ delete polygonHierarchy.startingIndex;
784
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
785
+ startingIndex += Ellipsoid_default.packedLength;
786
+ const vertexFormat = VertexFormat_default.unpack(
787
+ array,
788
+ startingIndex,
789
+ scratchVertexFormat
790
+ );
791
+ startingIndex += VertexFormat_default.packedLength;
792
+ const height = array[startingIndex++];
793
+ const extrudedHeight = array[startingIndex++];
794
+ const granularity = array[startingIndex++];
795
+ const stRotation = array[startingIndex++];
796
+ const perPositionHeightExtrude = array[startingIndex++] === 1;
797
+ const perPositionHeight = array[startingIndex++] === 1;
798
+ const closeTop = array[startingIndex++] === 1;
799
+ const closeBottom = array[startingIndex++] === 1;
800
+ const shadowVolume = array[startingIndex++] === 1;
801
+ const offsetAttribute = array[startingIndex++];
802
+ const arcType = array[startingIndex++];
803
+ const textureCoordinates = array[startingIndex] === -1 ? void 0 : PolygonGeometryLibrary_default.unpackPolygonHierarchy(
804
+ array,
805
+ startingIndex,
806
+ Cartesian2_default
807
+ );
808
+ if (defined_default(textureCoordinates)) {
809
+ startingIndex = textureCoordinates.startingIndex;
810
+ delete textureCoordinates.startingIndex;
811
+ } else {
812
+ startingIndex++;
813
+ }
814
+ const packedLength = array[startingIndex++];
815
+ if (!defined_default(result)) {
816
+ result = new PolygonGeometry(dummyOptions);
817
+ }
818
+ result._polygonHierarchy = polygonHierarchy;
819
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
820
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
821
+ result._height = height;
822
+ result._extrudedHeight = extrudedHeight;
823
+ result._granularity = granularity;
824
+ result._stRotation = stRotation;
825
+ result._perPositionHeightExtrude = perPositionHeightExtrude;
826
+ result._perPositionHeight = perPositionHeight;
827
+ result._closeTop = closeTop;
828
+ result._closeBottom = closeBottom;
829
+ result._shadowVolume = shadowVolume;
830
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
831
+ result._arcType = arcType;
832
+ result._textureCoordinates = textureCoordinates;
833
+ result.packedLength = packedLength;
834
+ return result;
835
+ };
836
+ PolygonGeometry.computeRectangle = function(options, result) {
837
+ Check_default.typeOf.object("options", options);
838
+ Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
839
+ const granularity = defaultValue_default(
840
+ options.granularity,
841
+ Math_default.RADIANS_PER_DEGREE
842
+ );
843
+ const arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
844
+ if (arcType !== ArcType_default.GEODESIC && arcType !== ArcType_default.RHUMB) {
845
+ throw new DeveloperError_default(
846
+ "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
999
847
  );
1000
- startingIndex += VertexFormat.VertexFormat.packedLength;
1001
-
1002
- const height = array[startingIndex++];
1003
- const extrudedHeight = array[startingIndex++];
1004
- const granularity = array[startingIndex++];
1005
- const stRotation = array[startingIndex++];
1006
- const perPositionHeightExtrude = array[startingIndex++] === 1.0;
1007
- const perPositionHeight = array[startingIndex++] === 1.0;
1008
- const closeTop = array[startingIndex++] === 1.0;
1009
- const closeBottom = array[startingIndex++] === 1.0;
1010
- const shadowVolume = array[startingIndex++] === 1.0;
1011
- const offsetAttribute = array[startingIndex++];
1012
- const arcType = array[startingIndex++];
1013
- const textureCoordinates =
1014
- array[startingIndex] === -1.0
1015
- ? undefined
1016
- : PolygonGeometryLibrary.PolygonGeometryLibrary.unpackPolygonHierarchy(
1017
- array,
1018
- startingIndex,
1019
- Matrix2.Cartesian2
1020
- );
1021
- if (defaultValue.defined(textureCoordinates)) {
1022
- startingIndex = textureCoordinates.startingIndex;
1023
- delete textureCoordinates.startingIndex;
1024
- } else {
1025
- startingIndex++;
1026
- }
1027
- const packedLength = array[startingIndex++];
1028
-
1029
- if (!defaultValue.defined(result)) {
1030
- result = new PolygonGeometry(dummyOptions);
1031
- }
1032
-
1033
- result._polygonHierarchy = polygonHierarchy;
1034
- result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
1035
- result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
1036
- result._height = height;
1037
- result._extrudedHeight = extrudedHeight;
1038
- result._granularity = granularity;
1039
- result._stRotation = stRotation;
1040
- result._perPositionHeightExtrude = perPositionHeightExtrude;
1041
- result._perPositionHeight = perPositionHeight;
1042
- result._closeTop = closeTop;
1043
- result._closeBottom = closeBottom;
1044
- result._shadowVolume = shadowVolume;
1045
- result._offsetAttribute =
1046
- offsetAttribute === -1 ? undefined : offsetAttribute;
1047
- result._arcType = arcType;
1048
- result._textureCoordinates = textureCoordinates;
1049
- result.packedLength = packedLength;
1050
-
1051
- return result;
848
+ }
849
+ const polygonHierarchy = options.polygonHierarchy;
850
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
851
+ return computeRectangle(
852
+ polygonHierarchy.positions,
853
+ ellipsoid,
854
+ arcType,
855
+ granularity,
856
+ result
857
+ );
858
+ };
859
+ PolygonGeometry.createGeometry = function(polygonGeometry) {
860
+ const vertexFormat = polygonGeometry._vertexFormat;
861
+ const ellipsoid = polygonGeometry._ellipsoid;
862
+ const granularity = polygonGeometry._granularity;
863
+ const stRotation = polygonGeometry._stRotation;
864
+ const polygonHierarchy = polygonGeometry._polygonHierarchy;
865
+ const perPositionHeight = polygonGeometry._perPositionHeight;
866
+ const closeTop = polygonGeometry._closeTop;
867
+ const closeBottom = polygonGeometry._closeBottom;
868
+ const arcType = polygonGeometry._arcType;
869
+ const textureCoordinates = polygonGeometry._textureCoordinates;
870
+ const hasTextureCoordinates = defined_default(textureCoordinates);
871
+ let outerPositions = polygonHierarchy.positions;
872
+ if (outerPositions.length < 3) {
873
+ return;
874
+ }
875
+ const tangentPlane = EllipsoidTangentPlane_default.fromPoints(
876
+ outerPositions,
877
+ ellipsoid
878
+ );
879
+ const results = PolygonGeometryLibrary_default.polygonsFromHierarchy(
880
+ polygonHierarchy,
881
+ hasTextureCoordinates,
882
+ tangentPlane.projectPointsOntoPlane.bind(tangentPlane),
883
+ !perPositionHeight,
884
+ ellipsoid
885
+ );
886
+ const hierarchy = results.hierarchy;
887
+ const polygons = results.polygons;
888
+ const dummyFunction = function(identity) {
889
+ return identity;
1052
890
  };
1053
-
1054
- /**
1055
- * Returns the bounding rectangle given the provided options
1056
- *
1057
- * @param {object} options Object with the following properties:
1058
- * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
1059
- * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
1060
- * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
1061
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
1062
- * @param {Rectangle} [result] An object in which to store the result.
1063
- *
1064
- * @returns {Rectangle} The result rectangle
1065
- */
1066
- PolygonGeometry.computeRectangle = function (options, result) {
1067
- //>>includeStart('debug', pragmas.debug);
1068
- Check.Check.typeOf.object("options", options);
1069
- Check.Check.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
1070
- //>>includeEnd('debug');
1071
-
1072
- const granularity = defaultValue.defaultValue(
1073
- options.granularity,
1074
- Math$1.CesiumMath.RADIANS_PER_DEGREE
1075
- );
1076
- const arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
1077
- //>>includeStart('debug', pragmas.debug);
1078
- if (arcType !== ArcType.ArcType.GEODESIC && arcType !== ArcType.ArcType.RHUMB) {
1079
- throw new Check.DeveloperError(
1080
- "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
1081
- );
1082
- }
1083
- //>>includeEnd('debug');
1084
-
1085
- const polygonHierarchy = options.polygonHierarchy;
1086
- const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
1087
-
1088
- return computeRectangle(
1089
- polygonHierarchy.positions,
1090
- ellipsoid,
1091
- arcType,
1092
- granularity,
1093
- result
1094
- );
891
+ const textureCoordinatePolygons = hasTextureCoordinates ? PolygonGeometryLibrary_default.polygonsFromHierarchy(
892
+ textureCoordinates,
893
+ true,
894
+ dummyFunction,
895
+ false
896
+ ).polygons : void 0;
897
+ if (hierarchy.length === 0) {
898
+ return;
899
+ }
900
+ outerPositions = hierarchy[0].outerRing;
901
+ const boundingRectangle = PolygonGeometryLibrary_default.computeBoundingRectangle(
902
+ tangentPlane.plane.normal,
903
+ tangentPlane.projectPointOntoPlane.bind(tangentPlane),
904
+ outerPositions,
905
+ stRotation,
906
+ scratchBoundingRectangle
907
+ );
908
+ const geometries = [];
909
+ const height = polygonGeometry._height;
910
+ const extrudedHeight = polygonGeometry._extrudedHeight;
911
+ const extrude = polygonGeometry._perPositionHeightExtrude || !Math_default.equalsEpsilon(height, extrudedHeight, 0, Math_default.EPSILON2);
912
+ const options = {
913
+ perPositionHeight,
914
+ vertexFormat,
915
+ geometry: void 0,
916
+ tangentPlane,
917
+ boundingRectangle,
918
+ ellipsoid,
919
+ stRotation,
920
+ textureCoordinates: void 0,
921
+ bottom: false,
922
+ top: true,
923
+ wall: false,
924
+ extrude: false,
925
+ arcType
1095
926
  };
1096
-
1097
- /**
1098
- * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
1099
- *
1100
- * @param {PolygonGeometry} polygonGeometry A description of the polygon.
1101
- * @returns {Geometry|undefined} The computed vertices and indices.
1102
- */
1103
- PolygonGeometry.createGeometry = function (polygonGeometry) {
1104
- const vertexFormat = polygonGeometry._vertexFormat;
1105
- const ellipsoid = polygonGeometry._ellipsoid;
1106
- const granularity = polygonGeometry._granularity;
1107
- const stRotation = polygonGeometry._stRotation;
1108
- const polygonHierarchy = polygonGeometry._polygonHierarchy;
1109
- const perPositionHeight = polygonGeometry._perPositionHeight;
1110
- const closeTop = polygonGeometry._closeTop;
1111
- const closeBottom = polygonGeometry._closeBottom;
1112
- const arcType = polygonGeometry._arcType;
1113
- const textureCoordinates = polygonGeometry._textureCoordinates;
1114
-
1115
- const hasTextureCoordinates = defaultValue.defined(textureCoordinates);
1116
-
1117
- let outerPositions = polygonHierarchy.positions;
1118
- if (outerPositions.length < 3) {
1119
- return;
1120
- }
1121
-
1122
- const tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(
1123
- outerPositions,
1124
- ellipsoid
1125
- );
1126
-
1127
- const results = PolygonGeometryLibrary.PolygonGeometryLibrary.polygonsFromHierarchy(
1128
- polygonHierarchy,
1129
- hasTextureCoordinates,
1130
- tangentPlane.projectPointsOntoPlane.bind(tangentPlane),
1131
- !perPositionHeight,
1132
- ellipsoid
1133
- );
1134
-
1135
- const hierarchy = results.hierarchy;
1136
- const polygons = results.polygons;
1137
-
1138
- const dummyFunction = function (identity) {
1139
- return identity;
1140
- };
1141
-
1142
- const textureCoordinatePolygons = hasTextureCoordinates
1143
- ? PolygonGeometryLibrary.PolygonGeometryLibrary.polygonsFromHierarchy(
1144
- textureCoordinates,
1145
- true,
1146
- dummyFunction,
1147
- false
1148
- ).polygons
1149
- : undefined;
1150
-
1151
- if (hierarchy.length === 0) {
1152
- return;
927
+ let i;
928
+ if (extrude) {
929
+ options.extrude = true;
930
+ options.top = closeTop;
931
+ options.bottom = closeBottom;
932
+ options.shadowVolume = polygonGeometry._shadowVolume;
933
+ options.offsetAttribute = polygonGeometry._offsetAttribute;
934
+ for (i = 0; i < polygons.length; i++) {
935
+ const splitGeometry = createGeometryFromPositionsExtruded(
936
+ ellipsoid,
937
+ polygons[i],
938
+ hasTextureCoordinates ? textureCoordinatePolygons[i] : void 0,
939
+ granularity,
940
+ hierarchy[i],
941
+ perPositionHeight,
942
+ closeTop,
943
+ closeBottom,
944
+ vertexFormat,
945
+ arcType
946
+ );
947
+ let topAndBottom;
948
+ if (closeTop && closeBottom) {
949
+ topAndBottom = splitGeometry.topAndBottom;
950
+ options.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
951
+ topAndBottom.geometry,
952
+ height,
953
+ extrudedHeight,
954
+ ellipsoid,
955
+ perPositionHeight
956
+ );
957
+ } else if (closeTop) {
958
+ topAndBottom = splitGeometry.topAndBottom;
959
+ topAndBottom.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
960
+ topAndBottom.geometry.attributes.position.values,
961
+ height,
962
+ ellipsoid,
963
+ !perPositionHeight
964
+ );
965
+ options.geometry = topAndBottom.geometry;
966
+ } else if (closeBottom) {
967
+ topAndBottom = splitGeometry.topAndBottom;
968
+ topAndBottom.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
969
+ topAndBottom.geometry.attributes.position.values,
970
+ extrudedHeight,
971
+ ellipsoid,
972
+ true
973
+ );
974
+ options.geometry = topAndBottom.geometry;
975
+ }
976
+ if (closeTop || closeBottom) {
977
+ options.wall = false;
978
+ topAndBottom.geometry = computeAttributes(options);
979
+ geometries.push(topAndBottom);
980
+ }
981
+ const walls = splitGeometry.walls;
982
+ options.wall = true;
983
+ for (let k = 0; k < walls.length; k++) {
984
+ const wall = walls[k];
985
+ options.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
986
+ wall.geometry,
987
+ height,
988
+ extrudedHeight,
989
+ ellipsoid,
990
+ perPositionHeight
991
+ );
992
+ wall.geometry = computeAttributes(options);
993
+ geometries.push(wall);
994
+ }
1153
995
  }
1154
-
1155
- outerPositions = hierarchy[0].outerRing;
1156
- const boundingRectangle = PolygonGeometryLibrary.PolygonGeometryLibrary.computeBoundingRectangle(
1157
- tangentPlane.plane.normal,
1158
- tangentPlane.projectPointOntoPlane.bind(tangentPlane),
1159
- outerPositions,
1160
- stRotation,
1161
- scratchBoundingRectangle
1162
- );
1163
-
1164
- const geometries = [];
1165
-
1166
- const height = polygonGeometry._height;
1167
- const extrudedHeight = polygonGeometry._extrudedHeight;
1168
- const extrude =
1169
- polygonGeometry._perPositionHeightExtrude ||
1170
- !Math$1.CesiumMath.equalsEpsilon(height, extrudedHeight, 0, Math$1.CesiumMath.EPSILON2);
1171
-
1172
- const options = {
1173
- perPositionHeight: perPositionHeight,
1174
- vertexFormat: vertexFormat,
1175
- geometry: undefined,
1176
- tangentPlane: tangentPlane,
1177
- boundingRectangle: boundingRectangle,
1178
- ellipsoid: ellipsoid,
1179
- stRotation: stRotation,
1180
- textureCoordinates: undefined,
1181
- bottom: false,
1182
- top: true,
1183
- wall: false,
1184
- extrude: false,
1185
- arcType: arcType,
1186
- };
1187
-
1188
- let i;
1189
-
1190
- if (extrude) {
1191
- options.extrude = true;
1192
- options.top = closeTop;
1193
- options.bottom = closeBottom;
1194
- options.shadowVolume = polygonGeometry._shadowVolume;
1195
- options.offsetAttribute = polygonGeometry._offsetAttribute;
1196
- for (i = 0; i < polygons.length; i++) {
1197
- const splitGeometry = createGeometryFromPositionsExtruded(
996
+ } else {
997
+ for (i = 0; i < polygons.length; i++) {
998
+ const geometryInstance = new GeometryInstance_default({
999
+ geometry: PolygonGeometryLibrary_default.createGeometryFromPositions(
1198
1000
  ellipsoid,
1199
1001
  polygons[i],
1200
- hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,
1002
+ hasTextureCoordinates ? textureCoordinatePolygons[i] : void 0,
1201
1003
  granularity,
1202
- hierarchy[i],
1203
1004
  perPositionHeight,
1204
- closeTop,
1205
- closeBottom,
1206
1005
  vertexFormat,
1207
1006
  arcType
1007
+ )
1008
+ });
1009
+ geometryInstance.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
1010
+ geometryInstance.geometry.attributes.position.values,
1011
+ height,
1012
+ ellipsoid,
1013
+ !perPositionHeight
1014
+ );
1015
+ options.geometry = geometryInstance.geometry;
1016
+ geometryInstance.geometry = computeAttributes(options);
1017
+ if (defined_default(polygonGeometry._offsetAttribute)) {
1018
+ const length = geometryInstance.geometry.attributes.position.values.length;
1019
+ const offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
1020
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
1021
+ geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default(
1022
+ {
1023
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
1024
+ componentsPerAttribute: 1,
1025
+ values: applyOffset
1026
+ }
1208
1027
  );
1209
-
1210
- let topAndBottom;
1211
- if (closeTop && closeBottom) {
1212
- topAndBottom = splitGeometry.topAndBottom;
1213
- options.geometry = PolygonGeometryLibrary.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(
1214
- topAndBottom.geometry,
1215
- height,
1216
- extrudedHeight,
1217
- ellipsoid,
1218
- perPositionHeight
1219
- );
1220
- } else if (closeTop) {
1221
- topAndBottom = splitGeometry.topAndBottom;
1222
- topAndBottom.geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
1223
- topAndBottom.geometry.attributes.position.values,
1224
- height,
1225
- ellipsoid,
1226
- !perPositionHeight
1227
- );
1228
- options.geometry = topAndBottom.geometry;
1229
- } else if (closeBottom) {
1230
- topAndBottom = splitGeometry.topAndBottom;
1231
- topAndBottom.geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
1232
- topAndBottom.geometry.attributes.position.values,
1233
- extrudedHeight,
1234
- ellipsoid,
1235
- true
1236
- );
1237
- options.geometry = topAndBottom.geometry;
1238
- }
1239
- if (closeTop || closeBottom) {
1240
- options.wall = false;
1241
- topAndBottom.geometry = computeAttributes(options);
1242
- geometries.push(topAndBottom);
1243
- }
1244
-
1245
- const walls = splitGeometry.walls;
1246
- options.wall = true;
1247
- for (let k = 0; k < walls.length; k++) {
1248
- const wall = walls[k];
1249
- options.geometry = PolygonGeometryLibrary.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(
1250
- wall.geometry,
1251
- height,
1252
- extrudedHeight,
1253
- ellipsoid,
1254
- perPositionHeight
1255
- );
1256
- wall.geometry = computeAttributes(options);
1257
- geometries.push(wall);
1258
- }
1259
1028
  }
1260
- } else {
1261
- for (i = 0; i < polygons.length; i++) {
1262
- const geometryInstance = new GeometryInstance.GeometryInstance({
1263
- geometry: PolygonGeometryLibrary.PolygonGeometryLibrary.createGeometryFromPositions(
1264
- ellipsoid,
1265
- polygons[i],
1266
- hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,
1267
- granularity,
1268
- perPositionHeight,
1269
- vertexFormat,
1270
- arcType
1271
- ),
1272
- });
1273
- geometryInstance.geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
1274
- geometryInstance.geometry.attributes.position.values,
1275
- height,
1276
- ellipsoid,
1277
- !perPositionHeight
1029
+ geometries.push(geometryInstance);
1030
+ }
1031
+ }
1032
+ const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
1033
+ geometry.attributes.position.values = new Float64Array(
1034
+ geometry.attributes.position.values
1035
+ );
1036
+ geometry.indices = IndexDatatype_default.createTypedArray(
1037
+ geometry.attributes.position.values.length / 3,
1038
+ geometry.indices
1039
+ );
1040
+ const attributes = geometry.attributes;
1041
+ const boundingSphere = BoundingSphere_default.fromVertices(
1042
+ attributes.position.values
1043
+ );
1044
+ if (!vertexFormat.position) {
1045
+ delete attributes.position;
1046
+ }
1047
+ return new Geometry_default({
1048
+ attributes,
1049
+ indices: geometry.indices,
1050
+ primitiveType: geometry.primitiveType,
1051
+ boundingSphere,
1052
+ offsetAttribute: polygonGeometry._offsetAttribute
1053
+ });
1054
+ };
1055
+ PolygonGeometry.createShadowVolume = function(polygonGeometry, minHeightFunc, maxHeightFunc) {
1056
+ const granularity = polygonGeometry._granularity;
1057
+ const ellipsoid = polygonGeometry._ellipsoid;
1058
+ const minHeight = minHeightFunc(granularity, ellipsoid);
1059
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
1060
+ return new PolygonGeometry({
1061
+ polygonHierarchy: polygonGeometry._polygonHierarchy,
1062
+ ellipsoid,
1063
+ stRotation: polygonGeometry._stRotation,
1064
+ granularity,
1065
+ perPositionHeight: false,
1066
+ extrudedHeight: minHeight,
1067
+ height: maxHeight,
1068
+ vertexFormat: VertexFormat_default.POSITION_ONLY,
1069
+ shadowVolume: true,
1070
+ arcType: polygonGeometry._arcType
1071
+ });
1072
+ };
1073
+ function textureCoordinateRotationPoints(polygonGeometry) {
1074
+ const stRotation = -polygonGeometry._stRotation;
1075
+ if (stRotation === 0) {
1076
+ return [0, 0, 0, 1, 1, 0];
1077
+ }
1078
+ const ellipsoid = polygonGeometry._ellipsoid;
1079
+ const positions = polygonGeometry._polygonHierarchy.positions;
1080
+ const boundingRectangle = polygonGeometry.rectangle;
1081
+ return Geometry_default._textureCoordinateRotationPoints(
1082
+ positions,
1083
+ stRotation,
1084
+ ellipsoid,
1085
+ boundingRectangle
1086
+ );
1087
+ }
1088
+ Object.defineProperties(PolygonGeometry.prototype, {
1089
+ /**
1090
+ * @private
1091
+ */
1092
+ rectangle: {
1093
+ get: function() {
1094
+ if (!defined_default(this._rectangle)) {
1095
+ const positions = this._polygonHierarchy.positions;
1096
+ this._rectangle = computeRectangle(
1097
+ positions,
1098
+ this._ellipsoid,
1099
+ this._arcType,
1100
+ this._granularity
1278
1101
  );
1279
- options.geometry = geometryInstance.geometry;
1280
-
1281
- geometryInstance.geometry = computeAttributes(options);
1282
-
1283
- if (defaultValue.defined(polygonGeometry._offsetAttribute)) {
1284
- const length =
1285
- geometryInstance.geometry.attributes.position.values.length;
1286
- const offsetValue =
1287
- polygonGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
1288
- ? 0
1289
- : 1;
1290
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
1291
- geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute(
1292
- {
1293
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
1294
- componentsPerAttribute: 1,
1295
- values: applyOffset,
1296
- }
1297
- );
1298
- }
1299
-
1300
- geometries.push(geometryInstance);
1301
1102
  }
1103
+ return this._rectangle;
1302
1104
  }
1303
-
1304
- const geometry = GeometryPipeline.GeometryPipeline.combineInstances(geometries)[0];
1305
- geometry.attributes.position.values = new Float64Array(
1306
- geometry.attributes.position.values
1307
- );
1308
- geometry.indices = IndexDatatype.IndexDatatype.createTypedArray(
1309
- geometry.attributes.position.values.length / 3,
1310
- geometry.indices
1311
- );
1312
-
1313
- const attributes = geometry.attributes;
1314
- const boundingSphere = Transforms.BoundingSphere.fromVertices(
1315
- attributes.position.values
1316
- );
1317
-
1318
- if (!vertexFormat.position) {
1319
- delete attributes.position;
1320
- }
1321
-
1322
- return new GeometryAttribute.Geometry({
1323
- attributes: attributes,
1324
- indices: geometry.indices,
1325
- primitiveType: geometry.primitiveType,
1326
- boundingSphere: boundingSphere,
1327
- offsetAttribute: polygonGeometry._offsetAttribute,
1328
- });
1329
- };
1330
-
1105
+ },
1331
1106
  /**
1107
+ * For remapping texture coordinates when rendering PolygonGeometries as GroundPrimitives.
1332
1108
  * @private
1333
1109
  */
1334
- PolygonGeometry.createShadowVolume = function (
1335
- polygonGeometry,
1336
- minHeightFunc,
1337
- maxHeightFunc
1338
- ) {
1339
- const granularity = polygonGeometry._granularity;
1340
- const ellipsoid = polygonGeometry._ellipsoid;
1341
-
1342
- const minHeight = minHeightFunc(granularity, ellipsoid);
1343
- const maxHeight = maxHeightFunc(granularity, ellipsoid);
1344
-
1345
- return new PolygonGeometry({
1346
- polygonHierarchy: polygonGeometry._polygonHierarchy,
1347
- ellipsoid: ellipsoid,
1348
- stRotation: polygonGeometry._stRotation,
1349
- granularity: granularity,
1350
- perPositionHeight: false,
1351
- extrudedHeight: minHeight,
1352
- height: maxHeight,
1353
- vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
1354
- shadowVolume: true,
1355
- arcType: polygonGeometry._arcType,
1356
- });
1357
- };
1358
-
1359
- function textureCoordinateRotationPoints(polygonGeometry) {
1360
- const stRotation = -polygonGeometry._stRotation;
1361
- if (stRotation === 0.0) {
1362
- return [0, 0, 0, 1, 1, 0];
1110
+ textureCoordinateRotationPoints: {
1111
+ get: function() {
1112
+ if (!defined_default(this._textureCoordinateRotationPoints)) {
1113
+ this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(
1114
+ this
1115
+ );
1116
+ }
1117
+ return this._textureCoordinateRotationPoints;
1363
1118
  }
1364
- const ellipsoid = polygonGeometry._ellipsoid;
1365
- const positions = polygonGeometry._polygonHierarchy.positions;
1366
- const boundingRectangle = polygonGeometry.rectangle;
1367
- return GeometryAttribute.Geometry._textureCoordinateRotationPoints(
1368
- positions,
1369
- stRotation,
1370
- ellipsoid,
1371
- boundingRectangle
1372
- );
1373
1119
  }
1120
+ });
1121
+ var PolygonGeometry_default = PolygonGeometry;
1374
1122
 
1375
- Object.defineProperties(PolygonGeometry.prototype, {
1376
- /**
1377
- * @private
1378
- */
1379
- rectangle: {
1380
- get: function () {
1381
- if (!defaultValue.defined(this._rectangle)) {
1382
- const positions = this._polygonHierarchy.positions;
1383
- this._rectangle = computeRectangle(
1384
- positions,
1385
- this._ellipsoid,
1386
- this._arcType,
1387
- this._granularity
1388
- );
1389
- }
1390
-
1391
- return this._rectangle;
1392
- },
1393
- },
1394
- /**
1395
- * For remapping texture coordinates when rendering PolygonGeometries as GroundPrimitives.
1396
- * @private
1397
- */
1398
- textureCoordinateRotationPoints: {
1399
- get: function () {
1400
- if (!defaultValue.defined(this._textureCoordinateRotationPoints)) {
1401
- this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(
1402
- this
1403
- );
1404
- }
1405
- return this._textureCoordinateRotationPoints;
1406
- },
1407
- },
1408
- });
1409
-
1410
- function createPolygonGeometry(polygonGeometry, offset) {
1411
- if (defaultValue.defined(offset)) {
1412
- polygonGeometry = PolygonGeometry.unpack(polygonGeometry, offset);
1413
- }
1414
- polygonGeometry._ellipsoid = Matrix3.Ellipsoid.clone(polygonGeometry._ellipsoid);
1415
- return PolygonGeometry.createGeometry(polygonGeometry);
1123
+ // packages/engine/Source/Workers/createPolygonGeometry.js
1124
+ function createPolygonGeometry(polygonGeometry, offset) {
1125
+ if (defined_default(offset)) {
1126
+ polygonGeometry = PolygonGeometry_default.unpack(polygonGeometry, offset);
1416
1127
  }
1417
-
1418
- return createPolygonGeometry;
1419
-
1420
- }));
1128
+ polygonGeometry._ellipsoid = Ellipsoid_default.clone(polygonGeometry._ellipsoid);
1129
+ return PolygonGeometry_default.createGeometry(polygonGeometry);
1130
+ }
1131
+ var createPolygonGeometry_default = createPolygonGeometry;
1132
+ export {
1133
+ createPolygonGeometry_default as default
1134
+ };