@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,625 +1,650 @@
1
- define(['./defaultValue-fe22d8c0', './Matrix3-41c58dde', './Matrix2-e1298525', './Transforms-a2a85221', './Check-6ede7e26', './ComponentDatatype-cf1fa08e', './GeometryAttribute-ff5b4fb1', './GeometryAttributes-ad136444', './GeometryInstance-34d9e21e', './GeometryOffsetAttribute-9ad0019c', './GeometryPipeline-1f8fbf05', './IndexDatatype-2643aa47', './Math-0a2ac845', './PolygonPipeline-b9f2810a', './RectangleGeometryLibrary-c35a7356', './VertexFormat-030f11ff', './RuntimeError-ef395448', './combine-d9581036', './WebGLConstants-0b1ce7ba', './AttributeCompression-f9f6c717', './EncodedCartesian3-57415c8a', './IntersectionTests-70d39ba9', './Plane-4c3d403b', './EllipsoidRhumbLine-ef872433'], (function (defaultValue, Matrix3, Matrix2, Transforms, Check, ComponentDatatype, GeometryAttribute, GeometryAttributes, GeometryInstance, GeometryOffsetAttribute, GeometryPipeline, IndexDatatype, Math$1, PolygonPipeline, RectangleGeometryLibrary, VertexFormat, RuntimeError, combine, WebGLConstants, AttributeCompression, EncodedCartesian3, IntersectionTests, Plane, EllipsoidRhumbLine) { 'use strict';
2
-
3
- const positionScratch = new Matrix3.Cartesian3();
4
- const normalScratch = new Matrix3.Cartesian3();
5
- const tangentScratch = new Matrix3.Cartesian3();
6
- const bitangentScratch = new Matrix3.Cartesian3();
7
- const rectangleScratch = new Matrix2.Rectangle();
8
- const stScratch = new Matrix2.Cartesian2();
9
- const bottomBoundingSphere = new Transforms.BoundingSphere();
10
- const topBoundingSphere = new Transforms.BoundingSphere();
11
-
12
- function createAttributes(vertexFormat, attributes) {
13
- const geo = new GeometryAttribute.Geometry({
14
- attributes: new GeometryAttributes.GeometryAttributes(),
15
- primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
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
+ RectangleGeometryLibrary_default
28
+ } from "./chunk-HARLBUOL.js";
29
+ import {
30
+ GeometryInstance_default
31
+ } from "./chunk-227AJNOA.js";
32
+ import {
33
+ GeometryPipeline_default
34
+ } from "./chunk-XTY7B2N6.js";
35
+ import "./chunk-O5AMBQ36.js";
36
+ import "./chunk-QT3MPEMI.js";
37
+ import {
38
+ GeometryOffsetAttribute_default
39
+ } from "./chunk-MPAZH4BF.js";
40
+ import {
41
+ VertexFormat_default
42
+ } from "./chunk-QMEMZIJI.js";
43
+ import {
44
+ PolygonPipeline_default
45
+ } from "./chunk-J3JY6I2C.js";
46
+ import "./chunk-K36FEYS7.js";
47
+ import "./chunk-MYZB7C4T.js";
48
+ import "./chunk-OYFCF4PL.js";
49
+ import {
50
+ IndexDatatype_default
51
+ } from "./chunk-RW6LU2CJ.js";
52
+ import {
53
+ GeometryAttributes_default
54
+ } from "./chunk-EW2GWJYB.js";
55
+ import {
56
+ GeometryAttribute_default,
57
+ Geometry_default,
58
+ PrimitiveType_default
59
+ } from "./chunk-X4SU25DT.js";
60
+ import {
61
+ BoundingSphere_default,
62
+ Quaternion_default
63
+ } from "./chunk-PFQBCKBM.js";
64
+ import "./chunk-QJ3DFBH3.js";
65
+ import {
66
+ Cartesian2_default,
67
+ Matrix2_default,
68
+ Rectangle_default
69
+ } from "./chunk-DUHWWBQQ.js";
70
+ import {
71
+ ComponentDatatype_default
72
+ } from "./chunk-LLUNNUJV.js";
73
+ import {
74
+ Cartesian3_default,
75
+ Cartographic_default,
76
+ Ellipsoid_default,
77
+ Matrix3_default
78
+ } from "./chunk-PCJWUS4M.js";
79
+ import {
80
+ Math_default
81
+ } from "./chunk-N3JIFFX2.js";
82
+ import "./chunk-AHKEZ2OE.js";
83
+ import "./chunk-ABADGKYE.js";
84
+ import {
85
+ defaultValue_default
86
+ } from "./chunk-WXTV4ATB.js";
87
+ import {
88
+ Check_default,
89
+ DeveloperError_default
90
+ } from "./chunk-4MFFIWUA.js";
91
+ import {
92
+ defined_default
93
+ } from "./chunk-6BTKZDRG.js";
94
+
95
+ // packages/engine/Source/Core/RectangleGeometry.js
96
+ var positionScratch = new Cartesian3_default();
97
+ var normalScratch = new Cartesian3_default();
98
+ var tangentScratch = new Cartesian3_default();
99
+ var bitangentScratch = new Cartesian3_default();
100
+ var rectangleScratch = new Rectangle_default();
101
+ var stScratch = new Cartesian2_default();
102
+ var bottomBoundingSphere = new BoundingSphere_default();
103
+ var topBoundingSphere = new BoundingSphere_default();
104
+ function createAttributes(vertexFormat, attributes) {
105
+ const geo = new Geometry_default({
106
+ attributes: new GeometryAttributes_default(),
107
+ primitiveType: PrimitiveType_default.TRIANGLES
108
+ });
109
+ geo.attributes.position = new GeometryAttribute_default({
110
+ componentDatatype: ComponentDatatype_default.DOUBLE,
111
+ componentsPerAttribute: 3,
112
+ values: attributes.positions
113
+ });
114
+ if (vertexFormat.normal) {
115
+ geo.attributes.normal = new GeometryAttribute_default({
116
+ componentDatatype: ComponentDatatype_default.FLOAT,
117
+ componentsPerAttribute: 3,
118
+ values: attributes.normals
16
119
  });
17
-
18
- geo.attributes.position = new GeometryAttribute.GeometryAttribute({
19
- componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
120
+ }
121
+ if (vertexFormat.tangent) {
122
+ geo.attributes.tangent = new GeometryAttribute_default({
123
+ componentDatatype: ComponentDatatype_default.FLOAT,
20
124
  componentsPerAttribute: 3,
21
- values: attributes.positions,
125
+ values: attributes.tangents
22
126
  });
23
- if (vertexFormat.normal) {
24
- geo.attributes.normal = new GeometryAttribute.GeometryAttribute({
25
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
26
- componentsPerAttribute: 3,
27
- values: attributes.normals,
28
- });
29
- }
30
- if (vertexFormat.tangent) {
31
- geo.attributes.tangent = new GeometryAttribute.GeometryAttribute({
32
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
33
- componentsPerAttribute: 3,
34
- values: attributes.tangents,
35
- });
36
- }
37
- if (vertexFormat.bitangent) {
38
- geo.attributes.bitangent = new GeometryAttribute.GeometryAttribute({
39
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
40
- componentsPerAttribute: 3,
41
- values: attributes.bitangents,
42
- });
43
- }
44
- return geo;
45
127
  }
46
-
47
- function calculateAttributes(
48
- positions,
49
- vertexFormat,
50
- ellipsoid,
51
- tangentRotationMatrix
52
- ) {
53
- const length = positions.length;
54
-
55
- const normals = vertexFormat.normal ? new Float32Array(length) : undefined;
56
- const tangents = vertexFormat.tangent ? new Float32Array(length) : undefined;
57
- const bitangents = vertexFormat.bitangent
58
- ? new Float32Array(length)
59
- : undefined;
60
-
61
- let attrIndex = 0;
62
- const bitangent = bitangentScratch;
63
- const tangent = tangentScratch;
64
- let normal = normalScratch;
65
- if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
66
- for (let i = 0; i < length; i += 3) {
67
- const p = Matrix3.Cartesian3.fromArray(positions, i, positionScratch);
68
- const attrIndex1 = attrIndex + 1;
69
- const attrIndex2 = attrIndex + 2;
70
-
71
- normal = ellipsoid.geodeticSurfaceNormal(p, normal);
72
- if (vertexFormat.tangent || vertexFormat.bitangent) {
73
- Matrix3.Cartesian3.cross(Matrix3.Cartesian3.UNIT_Z, normal, tangent);
74
- Matrix3.Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent);
75
- Matrix3.Cartesian3.normalize(tangent, tangent);
76
-
77
- if (vertexFormat.bitangent) {
78
- Matrix3.Cartesian3.normalize(
79
- Matrix3.Cartesian3.cross(normal, tangent, bitangent),
80
- bitangent
81
- );
82
- }
83
- }
84
-
85
- if (vertexFormat.normal) {
86
- normals[attrIndex] = normal.x;
87
- normals[attrIndex1] = normal.y;
88
- normals[attrIndex2] = normal.z;
89
- }
90
- if (vertexFormat.tangent) {
91
- tangents[attrIndex] = tangent.x;
92
- tangents[attrIndex1] = tangent.y;
93
- tangents[attrIndex2] = tangent.z;
94
- }
95
- if (vertexFormat.bitangent) {
96
- bitangents[attrIndex] = bitangent.x;
97
- bitangents[attrIndex1] = bitangent.y;
98
- bitangents[attrIndex2] = bitangent.z;
99
- }
100
- attrIndex += 3;
101
- }
102
- }
103
- return createAttributes(vertexFormat, {
104
- positions: positions,
105
- normals: normals,
106
- tangents: tangents,
107
- bitangents: bitangents,
128
+ if (vertexFormat.bitangent) {
129
+ geo.attributes.bitangent = new GeometryAttribute_default({
130
+ componentDatatype: ComponentDatatype_default.FLOAT,
131
+ componentsPerAttribute: 3,
132
+ values: attributes.bitangents
108
133
  });
109
134
  }
110
-
111
- const v1Scratch = new Matrix3.Cartesian3();
112
- const v2Scratch = new Matrix3.Cartesian3();
113
-
114
- function calculateAttributesWall(positions, vertexFormat, ellipsoid) {
115
- const length = positions.length;
116
-
117
- const normals = vertexFormat.normal ? new Float32Array(length) : undefined;
118
- const tangents = vertexFormat.tangent ? new Float32Array(length) : undefined;
119
- const bitangents = vertexFormat.bitangent
120
- ? new Float32Array(length)
121
- : undefined;
122
-
123
- let normalIndex = 0;
124
- let tangentIndex = 0;
125
- let bitangentIndex = 0;
126
- let recomputeNormal = true;
127
-
128
- let bitangent = bitangentScratch;
129
- let tangent = tangentScratch;
130
- let normal = normalScratch;
131
- if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
132
- for (let i = 0; i < length; i += 6) {
133
- const p = Matrix3.Cartesian3.fromArray(positions, i, positionScratch);
134
- const p1 = Matrix3.Cartesian3.fromArray(positions, (i + 6) % length, v1Scratch);
135
- if (recomputeNormal) {
136
- const p2 = Matrix3.Cartesian3.fromArray(positions, (i + 3) % length, v2Scratch);
137
- Matrix3.Cartesian3.subtract(p1, p, p1);
138
- Matrix3.Cartesian3.subtract(p2, p, p2);
139
- normal = Matrix3.Cartesian3.normalize(Matrix3.Cartesian3.cross(p2, p1, normal), normal);
140
- recomputeNormal = false;
141
- }
142
-
143
- if (Matrix3.Cartesian3.equalsEpsilon(p1, p, Math$1.CesiumMath.EPSILON10)) {
144
- // if we've reached a corner
145
- recomputeNormal = true;
146
- }
147
-
148
- if (vertexFormat.tangent || vertexFormat.bitangent) {
149
- bitangent = ellipsoid.geodeticSurfaceNormal(p, bitangent);
150
- if (vertexFormat.tangent) {
151
- tangent = Matrix3.Cartesian3.normalize(
152
- Matrix3.Cartesian3.cross(bitangent, normal, tangent),
153
- tangent
154
- );
155
- }
156
- }
157
-
158
- if (vertexFormat.normal) {
159
- normals[normalIndex++] = normal.x;
160
- normals[normalIndex++] = normal.y;
161
- normals[normalIndex++] = normal.z;
162
- normals[normalIndex++] = normal.x;
163
- normals[normalIndex++] = normal.y;
164
- normals[normalIndex++] = normal.z;
165
- }
166
-
167
- if (vertexFormat.tangent) {
168
- tangents[tangentIndex++] = tangent.x;
169
- tangents[tangentIndex++] = tangent.y;
170
- tangents[tangentIndex++] = tangent.z;
171
- tangents[tangentIndex++] = tangent.x;
172
- tangents[tangentIndex++] = tangent.y;
173
- tangents[tangentIndex++] = tangent.z;
174
- }
175
-
135
+ return geo;
136
+ }
137
+ function calculateAttributes(positions, vertexFormat, ellipsoid, tangentRotationMatrix) {
138
+ const length = positions.length;
139
+ const normals = vertexFormat.normal ? new Float32Array(length) : void 0;
140
+ const tangents = vertexFormat.tangent ? new Float32Array(length) : void 0;
141
+ const bitangents = vertexFormat.bitangent ? new Float32Array(length) : void 0;
142
+ let attrIndex = 0;
143
+ const bitangent = bitangentScratch;
144
+ const tangent = tangentScratch;
145
+ let normal = normalScratch;
146
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
147
+ for (let i = 0; i < length; i += 3) {
148
+ const p = Cartesian3_default.fromArray(positions, i, positionScratch);
149
+ const attrIndex1 = attrIndex + 1;
150
+ const attrIndex2 = attrIndex + 2;
151
+ normal = ellipsoid.geodeticSurfaceNormal(p, normal);
152
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
153
+ Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal, tangent);
154
+ Matrix3_default.multiplyByVector(tangentRotationMatrix, tangent, tangent);
155
+ Cartesian3_default.normalize(tangent, tangent);
176
156
  if (vertexFormat.bitangent) {
177
- bitangents[bitangentIndex++] = bitangent.x;
178
- bitangents[bitangentIndex++] = bitangent.y;
179
- bitangents[bitangentIndex++] = bitangent.z;
180
- bitangents[bitangentIndex++] = bitangent.x;
181
- bitangents[bitangentIndex++] = bitangent.y;
182
- bitangents[bitangentIndex++] = bitangent.z;
157
+ Cartesian3_default.normalize(
158
+ Cartesian3_default.cross(normal, tangent, bitangent),
159
+ bitangent
160
+ );
183
161
  }
184
162
  }
163
+ if (vertexFormat.normal) {
164
+ normals[attrIndex] = normal.x;
165
+ normals[attrIndex1] = normal.y;
166
+ normals[attrIndex2] = normal.z;
167
+ }
168
+ if (vertexFormat.tangent) {
169
+ tangents[attrIndex] = tangent.x;
170
+ tangents[attrIndex1] = tangent.y;
171
+ tangents[attrIndex2] = tangent.z;
172
+ }
173
+ if (vertexFormat.bitangent) {
174
+ bitangents[attrIndex] = bitangent.x;
175
+ bitangents[attrIndex1] = bitangent.y;
176
+ bitangents[attrIndex2] = bitangent.z;
177
+ }
178
+ attrIndex += 3;
185
179
  }
186
-
187
- return createAttributes(vertexFormat, {
188
- positions: positions,
189
- normals: normals,
190
- tangents: tangents,
191
- bitangents: bitangents,
192
- });
193
180
  }
194
-
195
- function constructRectangle(rectangleGeometry, computedOptions) {
196
- const vertexFormat = rectangleGeometry._vertexFormat;
197
- const ellipsoid = rectangleGeometry._ellipsoid;
198
- const height = computedOptions.height;
199
- const width = computedOptions.width;
200
- const northCap = computedOptions.northCap;
201
- const southCap = computedOptions.southCap;
202
-
203
- let rowStart = 0;
204
- let rowEnd = height;
205
- let rowHeight = height;
206
- let size = 0;
207
- if (northCap) {
208
- rowStart = 1;
209
- rowHeight -= 1;
210
- size += 1;
211
- }
212
- if (southCap) {
213
- rowEnd -= 1;
214
- rowHeight -= 1;
215
- size += 1;
216
- }
217
- size += width * rowHeight;
218
-
219
- const positions = vertexFormat.position
220
- ? new Float64Array(size * 3)
221
- : undefined;
222
- const textureCoordinates = vertexFormat.st
223
- ? new Float32Array(size * 2)
224
- : undefined;
225
-
226
- let posIndex = 0;
227
- let stIndex = 0;
228
-
229
- const position = positionScratch;
230
- const st = stScratch;
231
-
232
- let minX = Number.MAX_VALUE;
233
- let minY = Number.MAX_VALUE;
234
- let maxX = -Number.MAX_VALUE;
235
- let maxY = -Number.MAX_VALUE;
236
-
237
- for (let row = rowStart; row < rowEnd; ++row) {
238
- for (let col = 0; col < width; ++col) {
239
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
240
- computedOptions,
241
- ellipsoid,
242
- vertexFormat.st,
243
- row,
244
- col,
245
- position,
246
- st
247
- );
248
-
249
- positions[posIndex++] = position.x;
250
- positions[posIndex++] = position.y;
251
- positions[posIndex++] = position.z;
252
-
253
- if (vertexFormat.st) {
254
- textureCoordinates[stIndex++] = st.x;
255
- textureCoordinates[stIndex++] = st.y;
256
-
257
- minX = Math.min(minX, st.x);
258
- minY = Math.min(minY, st.y);
259
- maxX = Math.max(maxX, st.x);
260
- maxY = Math.max(maxY, st.y);
181
+ return createAttributes(vertexFormat, {
182
+ positions,
183
+ normals,
184
+ tangents,
185
+ bitangents
186
+ });
187
+ }
188
+ var v1Scratch = new Cartesian3_default();
189
+ var v2Scratch = new Cartesian3_default();
190
+ function calculateAttributesWall(positions, vertexFormat, ellipsoid) {
191
+ const length = positions.length;
192
+ const normals = vertexFormat.normal ? new Float32Array(length) : void 0;
193
+ const tangents = vertexFormat.tangent ? new Float32Array(length) : void 0;
194
+ const bitangents = vertexFormat.bitangent ? new Float32Array(length) : void 0;
195
+ let normalIndex = 0;
196
+ let tangentIndex = 0;
197
+ let bitangentIndex = 0;
198
+ let recomputeNormal = true;
199
+ let bitangent = bitangentScratch;
200
+ let tangent = tangentScratch;
201
+ let normal = normalScratch;
202
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
203
+ for (let i = 0; i < length; i += 6) {
204
+ const p = Cartesian3_default.fromArray(positions, i, positionScratch);
205
+ const p1 = Cartesian3_default.fromArray(positions, (i + 6) % length, v1Scratch);
206
+ if (recomputeNormal) {
207
+ const p2 = Cartesian3_default.fromArray(positions, (i + 3) % length, v2Scratch);
208
+ Cartesian3_default.subtract(p1, p, p1);
209
+ Cartesian3_default.subtract(p2, p, p2);
210
+ normal = Cartesian3_default.normalize(Cartesian3_default.cross(p2, p1, normal), normal);
211
+ recomputeNormal = false;
212
+ }
213
+ if (Cartesian3_default.equalsEpsilon(p1, p, Math_default.EPSILON10)) {
214
+ recomputeNormal = true;
215
+ }
216
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
217
+ bitangent = ellipsoid.geodeticSurfaceNormal(p, bitangent);
218
+ if (vertexFormat.tangent) {
219
+ tangent = Cartesian3_default.normalize(
220
+ Cartesian3_default.cross(bitangent, normal, tangent),
221
+ tangent
222
+ );
261
223
  }
262
224
  }
225
+ if (vertexFormat.normal) {
226
+ normals[normalIndex++] = normal.x;
227
+ normals[normalIndex++] = normal.y;
228
+ normals[normalIndex++] = normal.z;
229
+ normals[normalIndex++] = normal.x;
230
+ normals[normalIndex++] = normal.y;
231
+ normals[normalIndex++] = normal.z;
232
+ }
233
+ if (vertexFormat.tangent) {
234
+ tangents[tangentIndex++] = tangent.x;
235
+ tangents[tangentIndex++] = tangent.y;
236
+ tangents[tangentIndex++] = tangent.z;
237
+ tangents[tangentIndex++] = tangent.x;
238
+ tangents[tangentIndex++] = tangent.y;
239
+ tangents[tangentIndex++] = tangent.z;
240
+ }
241
+ if (vertexFormat.bitangent) {
242
+ bitangents[bitangentIndex++] = bitangent.x;
243
+ bitangents[bitangentIndex++] = bitangent.y;
244
+ bitangents[bitangentIndex++] = bitangent.z;
245
+ bitangents[bitangentIndex++] = bitangent.x;
246
+ bitangents[bitangentIndex++] = bitangent.y;
247
+ bitangents[bitangentIndex++] = bitangent.z;
248
+ }
263
249
  }
264
- if (northCap) {
265
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
250
+ }
251
+ return createAttributes(vertexFormat, {
252
+ positions,
253
+ normals,
254
+ tangents,
255
+ bitangents
256
+ });
257
+ }
258
+ function constructRectangle(rectangleGeometry, computedOptions) {
259
+ const vertexFormat = rectangleGeometry._vertexFormat;
260
+ const ellipsoid = rectangleGeometry._ellipsoid;
261
+ const height = computedOptions.height;
262
+ const width = computedOptions.width;
263
+ const northCap = computedOptions.northCap;
264
+ const southCap = computedOptions.southCap;
265
+ let rowStart = 0;
266
+ let rowEnd = height;
267
+ let rowHeight = height;
268
+ let size = 0;
269
+ if (northCap) {
270
+ rowStart = 1;
271
+ rowHeight -= 1;
272
+ size += 1;
273
+ }
274
+ if (southCap) {
275
+ rowEnd -= 1;
276
+ rowHeight -= 1;
277
+ size += 1;
278
+ }
279
+ size += width * rowHeight;
280
+ const positions = vertexFormat.position ? new Float64Array(size * 3) : void 0;
281
+ const textureCoordinates = vertexFormat.st ? new Float32Array(size * 2) : void 0;
282
+ let posIndex = 0;
283
+ let stIndex = 0;
284
+ const position = positionScratch;
285
+ const st = stScratch;
286
+ let minX = Number.MAX_VALUE;
287
+ let minY = Number.MAX_VALUE;
288
+ let maxX = -Number.MAX_VALUE;
289
+ let maxY = -Number.MAX_VALUE;
290
+ for (let row = rowStart; row < rowEnd; ++row) {
291
+ for (let col = 0; col < width; ++col) {
292
+ RectangleGeometryLibrary_default.computePosition(
266
293
  computedOptions,
267
294
  ellipsoid,
268
295
  vertexFormat.st,
269
- 0,
270
- 0,
296
+ row,
297
+ col,
271
298
  position,
272
299
  st
273
300
  );
274
-
275
301
  positions[posIndex++] = position.x;
276
302
  positions[posIndex++] = position.y;
277
303
  positions[posIndex++] = position.z;
278
-
279
304
  if (vertexFormat.st) {
280
305
  textureCoordinates[stIndex++] = st.x;
281
306
  textureCoordinates[stIndex++] = st.y;
282
-
283
- minX = st.x;
284
- minY = st.y;
285
- maxX = st.x;
286
- maxY = st.y;
287
- }
288
- }
289
- if (southCap) {
290
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
291
- computedOptions,
292
- ellipsoid,
293
- vertexFormat.st,
294
- height - 1,
295
- 0,
296
- position,
297
- st
298
- );
299
-
300
- positions[posIndex++] = position.x;
301
- positions[posIndex++] = position.y;
302
- positions[posIndex] = position.z;
303
-
304
- if (vertexFormat.st) {
305
- textureCoordinates[stIndex++] = st.x;
306
- textureCoordinates[stIndex] = st.y;
307
-
308
307
  minX = Math.min(minX, st.x);
309
308
  minY = Math.min(minY, st.y);
310
309
  maxX = Math.max(maxX, st.x);
311
310
  maxY = Math.max(maxY, st.y);
312
311
  }
313
312
  }
314
-
315
- if (
316
- vertexFormat.st &&
317
- (minX < 0.0 || minY < 0.0 || maxX > 1.0 || maxY > 1.0)
318
- ) {
319
- for (let k = 0; k < textureCoordinates.length; k += 2) {
320
- textureCoordinates[k] = (textureCoordinates[k] - minX) / (maxX - minX);
321
- textureCoordinates[k + 1] =
322
- (textureCoordinates[k + 1] - minY) / (maxY - minY);
323
- }
324
- }
325
-
326
- const geo = calculateAttributes(
327
- positions,
328
- vertexFormat,
313
+ }
314
+ if (northCap) {
315
+ RectangleGeometryLibrary_default.computePosition(
316
+ computedOptions,
329
317
  ellipsoid,
330
- computedOptions.tangentRotationMatrix
318
+ vertexFormat.st,
319
+ 0,
320
+ 0,
321
+ position,
322
+ st
331
323
  );
332
-
333
- let indicesSize = 6 * (width - 1) * (rowHeight - 1);
334
- if (northCap) {
335
- indicesSize += 3 * (width - 1);
336
- }
337
- if (southCap) {
338
- indicesSize += 3 * (width - 1);
339
- }
340
- const indices = IndexDatatype.IndexDatatype.createTypedArray(size, indicesSize);
341
- let index = 0;
342
- let indicesIndex = 0;
343
- let i;
344
- for (i = 0; i < rowHeight - 1; ++i) {
345
- for (let j = 0; j < width - 1; ++j) {
346
- const upperLeft = index;
347
- const lowerLeft = upperLeft + width;
348
- const lowerRight = lowerLeft + 1;
349
- const upperRight = upperLeft + 1;
350
- indices[indicesIndex++] = upperLeft;
351
- indices[indicesIndex++] = lowerLeft;
352
- indices[indicesIndex++] = upperRight;
353
- indices[indicesIndex++] = upperRight;
354
- indices[indicesIndex++] = lowerLeft;
355
- indices[indicesIndex++] = lowerRight;
356
- ++index;
357
- }
358
- ++index;
359
- }
360
- if (northCap || southCap) {
361
- let northIndex = size - 1;
362
- const southIndex = size - 1;
363
- if (northCap && southCap) {
364
- northIndex = size - 2;
365
- }
366
-
367
- let p1;
368
- let p2;
369
- index = 0;
370
-
371
- if (northCap) {
372
- for (i = 0; i < width - 1; i++) {
373
- p1 = index;
374
- p2 = p1 + 1;
375
- indices[indicesIndex++] = northIndex;
376
- indices[indicesIndex++] = p1;
377
- indices[indicesIndex++] = p2;
378
- ++index;
379
- }
380
- }
381
- if (southCap) {
382
- index = (rowHeight - 1) * width;
383
- for (i = 0; i < width - 1; i++) {
384
- p1 = index;
385
- p2 = p1 + 1;
386
- indices[indicesIndex++] = p1;
387
- indices[indicesIndex++] = southIndex;
388
- indices[indicesIndex++] = p2;
389
- ++index;
390
- }
391
- }
324
+ positions[posIndex++] = position.x;
325
+ positions[posIndex++] = position.y;
326
+ positions[posIndex++] = position.z;
327
+ if (vertexFormat.st) {
328
+ textureCoordinates[stIndex++] = st.x;
329
+ textureCoordinates[stIndex++] = st.y;
330
+ minX = st.x;
331
+ minY = st.y;
332
+ maxX = st.x;
333
+ maxY = st.y;
392
334
  }
393
-
394
- geo.indices = indices;
335
+ }
336
+ if (southCap) {
337
+ RectangleGeometryLibrary_default.computePosition(
338
+ computedOptions,
339
+ ellipsoid,
340
+ vertexFormat.st,
341
+ height - 1,
342
+ 0,
343
+ position,
344
+ st
345
+ );
346
+ positions[posIndex++] = position.x;
347
+ positions[posIndex++] = position.y;
348
+ positions[posIndex] = position.z;
395
349
  if (vertexFormat.st) {
396
- geo.attributes.st = new GeometryAttribute.GeometryAttribute({
397
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
398
- componentsPerAttribute: 2,
399
- values: textureCoordinates,
400
- });
350
+ textureCoordinates[stIndex++] = st.x;
351
+ textureCoordinates[stIndex] = st.y;
352
+ minX = Math.min(minX, st.x);
353
+ minY = Math.min(minY, st.y);
354
+ maxX = Math.max(maxX, st.x);
355
+ maxY = Math.max(maxY, st.y);
401
356
  }
402
-
403
- return geo;
404
357
  }
405
-
406
- function addWallPositions(
407
- wallPositions,
408
- posIndex,
409
- i,
410
- topPositions,
411
- bottomPositions
412
- ) {
413
- wallPositions[posIndex++] = topPositions[i];
414
- wallPositions[posIndex++] = topPositions[i + 1];
415
- wallPositions[posIndex++] = topPositions[i + 2];
416
- wallPositions[posIndex++] = bottomPositions[i];
417
- wallPositions[posIndex++] = bottomPositions[i + 1];
418
- wallPositions[posIndex] = bottomPositions[i + 2];
419
- return wallPositions;
358
+ if (vertexFormat.st && (minX < 0 || minY < 0 || maxX > 1 || maxY > 1)) {
359
+ for (let k = 0; k < textureCoordinates.length; k += 2) {
360
+ textureCoordinates[k] = (textureCoordinates[k] - minX) / (maxX - minX);
361
+ textureCoordinates[k + 1] = (textureCoordinates[k + 1] - minY) / (maxY - minY);
362
+ }
420
363
  }
421
-
422
- function addWallTextureCoordinates(wallTextures, stIndex, i, st) {
423
- wallTextures[stIndex++] = st[i];
424
- wallTextures[stIndex++] = st[i + 1];
425
- wallTextures[stIndex++] = st[i];
426
- wallTextures[stIndex] = st[i + 1];
427
- return wallTextures;
364
+ const geo = calculateAttributes(
365
+ positions,
366
+ vertexFormat,
367
+ ellipsoid,
368
+ computedOptions.tangentRotationMatrix
369
+ );
370
+ let indicesSize = 6 * (width - 1) * (rowHeight - 1);
371
+ if (northCap) {
372
+ indicesSize += 3 * (width - 1);
428
373
  }
429
-
430
- const scratchVertexFormat = new VertexFormat.VertexFormat();
431
-
432
- function constructExtrudedRectangle(rectangleGeometry, computedOptions) {
433
- const shadowVolume = rectangleGeometry._shadowVolume;
434
- const offsetAttributeValue = rectangleGeometry._offsetAttribute;
435
- const vertexFormat = rectangleGeometry._vertexFormat;
436
- const minHeight = rectangleGeometry._extrudedHeight;
437
- const maxHeight = rectangleGeometry._surfaceHeight;
438
- const ellipsoid = rectangleGeometry._ellipsoid;
439
-
440
- const height = computedOptions.height;
441
- const width = computedOptions.width;
442
-
443
- let i;
444
-
445
- if (shadowVolume) {
446
- const newVertexFormat = VertexFormat.VertexFormat.clone(
447
- vertexFormat,
448
- scratchVertexFormat
449
- );
450
- newVertexFormat.normal = true;
451
- rectangleGeometry._vertexFormat = newVertexFormat;
374
+ if (southCap) {
375
+ indicesSize += 3 * (width - 1);
376
+ }
377
+ const indices = IndexDatatype_default.createTypedArray(size, indicesSize);
378
+ let index = 0;
379
+ let indicesIndex = 0;
380
+ let i;
381
+ for (i = 0; i < rowHeight - 1; ++i) {
382
+ for (let j = 0; j < width - 1; ++j) {
383
+ const upperLeft = index;
384
+ const lowerLeft = upperLeft + width;
385
+ const lowerRight = lowerLeft + 1;
386
+ const upperRight = upperLeft + 1;
387
+ indices[indicesIndex++] = upperLeft;
388
+ indices[indicesIndex++] = lowerLeft;
389
+ indices[indicesIndex++] = upperRight;
390
+ indices[indicesIndex++] = upperRight;
391
+ indices[indicesIndex++] = lowerLeft;
392
+ indices[indicesIndex++] = lowerRight;
393
+ ++index;
452
394
  }
453
-
454
- const topBottomGeo = constructRectangle(rectangleGeometry, computedOptions);
455
-
456
- if (shadowVolume) {
457
- rectangleGeometry._vertexFormat = vertexFormat;
395
+ ++index;
396
+ }
397
+ if (northCap || southCap) {
398
+ let northIndex = size - 1;
399
+ const southIndex = size - 1;
400
+ if (northCap && southCap) {
401
+ northIndex = size - 2;
458
402
  }
459
-
460
- let topPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
461
- topBottomGeo.attributes.position.values,
462
- maxHeight,
463
- ellipsoid,
464
- false
465
- );
466
- topPositions = new Float64Array(topPositions);
467
- let length = topPositions.length;
468
- const newLength = length * 2;
469
- const positions = new Float64Array(newLength);
470
- positions.set(topPositions);
471
- const bottomPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
472
- topBottomGeo.attributes.position.values,
473
- minHeight,
474
- ellipsoid
475
- );
476
- positions.set(bottomPositions, length);
477
- topBottomGeo.attributes.position.values = positions;
478
-
479
- const normals = vertexFormat.normal ? new Float32Array(newLength) : undefined;
480
- const tangents = vertexFormat.tangent
481
- ? new Float32Array(newLength)
482
- : undefined;
483
- const bitangents = vertexFormat.bitangent
484
- ? new Float32Array(newLength)
485
- : undefined;
486
- const textures = vertexFormat.st
487
- ? new Float32Array((newLength / 3) * 2)
488
- : undefined;
489
- let topSt;
490
- let topNormals;
491
- if (vertexFormat.normal) {
492
- topNormals = topBottomGeo.attributes.normal.values;
493
- normals.set(topNormals);
494
- for (i = 0; i < length; i++) {
495
- topNormals[i] = -topNormals[i];
403
+ let p1;
404
+ let p2;
405
+ index = 0;
406
+ if (northCap) {
407
+ for (i = 0; i < width - 1; i++) {
408
+ p1 = index;
409
+ p2 = p1 + 1;
410
+ indices[indicesIndex++] = northIndex;
411
+ indices[indicesIndex++] = p1;
412
+ indices[indicesIndex++] = p2;
413
+ ++index;
496
414
  }
497
- normals.set(topNormals, length);
498
- topBottomGeo.attributes.normal.values = normals;
499
415
  }
500
- if (shadowVolume) {
501
- topNormals = topBottomGeo.attributes.normal.values;
502
- if (!vertexFormat.normal) {
503
- topBottomGeo.attributes.normal = undefined;
504
- }
505
- const extrudeNormals = new Float32Array(newLength);
506
- for (i = 0; i < length; i++) {
507
- topNormals[i] = -topNormals[i];
416
+ if (southCap) {
417
+ index = (rowHeight - 1) * width;
418
+ for (i = 0; i < width - 1; i++) {
419
+ p1 = index;
420
+ p2 = p1 + 1;
421
+ indices[indicesIndex++] = p1;
422
+ indices[indicesIndex++] = southIndex;
423
+ indices[indicesIndex++] = p2;
424
+ ++index;
508
425
  }
509
- extrudeNormals.set(topNormals, length); //only get normals for bottom layer that's going to be pushed down
510
- topBottomGeo.attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
511
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
512
- componentsPerAttribute: 3,
513
- values: extrudeNormals,
514
- });
515
426
  }
516
-
517
- let offsetValue;
518
- const hasOffsets = defaultValue.defined(offsetAttributeValue);
519
- if (hasOffsets) {
520
- const size = (length / 3) * 2;
521
- let offsetAttribute = new Uint8Array(size);
522
- if (offsetAttributeValue === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
523
- offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
524
- } else {
525
- offsetValue =
526
- offsetAttributeValue === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
527
- offsetAttribute = offsetAttribute.fill(offsetValue);
528
- }
529
-
530
- topBottomGeo.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
531
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
532
- componentsPerAttribute: 1,
533
- values: offsetAttribute,
534
- });
427
+ }
428
+ geo.indices = indices;
429
+ if (vertexFormat.st) {
430
+ geo.attributes.st = new GeometryAttribute_default({
431
+ componentDatatype: ComponentDatatype_default.FLOAT,
432
+ componentsPerAttribute: 2,
433
+ values: textureCoordinates
434
+ });
435
+ }
436
+ return geo;
437
+ }
438
+ function addWallPositions(wallPositions, posIndex, i, topPositions, bottomPositions) {
439
+ wallPositions[posIndex++] = topPositions[i];
440
+ wallPositions[posIndex++] = topPositions[i + 1];
441
+ wallPositions[posIndex++] = topPositions[i + 2];
442
+ wallPositions[posIndex++] = bottomPositions[i];
443
+ wallPositions[posIndex++] = bottomPositions[i + 1];
444
+ wallPositions[posIndex] = bottomPositions[i + 2];
445
+ return wallPositions;
446
+ }
447
+ function addWallTextureCoordinates(wallTextures, stIndex, i, st) {
448
+ wallTextures[stIndex++] = st[i];
449
+ wallTextures[stIndex++] = st[i + 1];
450
+ wallTextures[stIndex++] = st[i];
451
+ wallTextures[stIndex] = st[i + 1];
452
+ return wallTextures;
453
+ }
454
+ var scratchVertexFormat = new VertexFormat_default();
455
+ function constructExtrudedRectangle(rectangleGeometry, computedOptions) {
456
+ const shadowVolume = rectangleGeometry._shadowVolume;
457
+ const offsetAttributeValue = rectangleGeometry._offsetAttribute;
458
+ const vertexFormat = rectangleGeometry._vertexFormat;
459
+ const minHeight = rectangleGeometry._extrudedHeight;
460
+ const maxHeight = rectangleGeometry._surfaceHeight;
461
+ const ellipsoid = rectangleGeometry._ellipsoid;
462
+ const height = computedOptions.height;
463
+ const width = computedOptions.width;
464
+ let i;
465
+ if (shadowVolume) {
466
+ const newVertexFormat = VertexFormat_default.clone(
467
+ vertexFormat,
468
+ scratchVertexFormat
469
+ );
470
+ newVertexFormat.normal = true;
471
+ rectangleGeometry._vertexFormat = newVertexFormat;
472
+ }
473
+ const topBottomGeo = constructRectangle(rectangleGeometry, computedOptions);
474
+ if (shadowVolume) {
475
+ rectangleGeometry._vertexFormat = vertexFormat;
476
+ }
477
+ let topPositions = PolygonPipeline_default.scaleToGeodeticHeight(
478
+ topBottomGeo.attributes.position.values,
479
+ maxHeight,
480
+ ellipsoid,
481
+ false
482
+ );
483
+ topPositions = new Float64Array(topPositions);
484
+ let length = topPositions.length;
485
+ const newLength = length * 2;
486
+ const positions = new Float64Array(newLength);
487
+ positions.set(topPositions);
488
+ const bottomPositions = PolygonPipeline_default.scaleToGeodeticHeight(
489
+ topBottomGeo.attributes.position.values,
490
+ minHeight,
491
+ ellipsoid
492
+ );
493
+ positions.set(bottomPositions, length);
494
+ topBottomGeo.attributes.position.values = positions;
495
+ const normals = vertexFormat.normal ? new Float32Array(newLength) : void 0;
496
+ const tangents = vertexFormat.tangent ? new Float32Array(newLength) : void 0;
497
+ const bitangents = vertexFormat.bitangent ? new Float32Array(newLength) : void 0;
498
+ const textures = vertexFormat.st ? new Float32Array(newLength / 3 * 2) : void 0;
499
+ let topSt;
500
+ let topNormals;
501
+ if (vertexFormat.normal) {
502
+ topNormals = topBottomGeo.attributes.normal.values;
503
+ normals.set(topNormals);
504
+ for (i = 0; i < length; i++) {
505
+ topNormals[i] = -topNormals[i];
535
506
  }
536
-
537
- if (vertexFormat.tangent) {
538
- const topTangents = topBottomGeo.attributes.tangent.values;
539
- tangents.set(topTangents);
540
- for (i = 0; i < length; i++) {
541
- topTangents[i] = -topTangents[i];
542
- }
543
- tangents.set(topTangents, length);
544
- topBottomGeo.attributes.tangent.values = tangents;
507
+ normals.set(topNormals, length);
508
+ topBottomGeo.attributes.normal.values = normals;
509
+ }
510
+ if (shadowVolume) {
511
+ topNormals = topBottomGeo.attributes.normal.values;
512
+ if (!vertexFormat.normal) {
513
+ topBottomGeo.attributes.normal = void 0;
545
514
  }
546
- if (vertexFormat.bitangent) {
547
- const topBitangents = topBottomGeo.attributes.bitangent.values;
548
- bitangents.set(topBitangents);
549
- bitangents.set(topBitangents, length);
550
- topBottomGeo.attributes.bitangent.values = bitangents;
515
+ const extrudeNormals = new Float32Array(newLength);
516
+ for (i = 0; i < length; i++) {
517
+ topNormals[i] = -topNormals[i];
551
518
  }
552
- if (vertexFormat.st) {
553
- topSt = topBottomGeo.attributes.st.values;
554
- textures.set(topSt);
555
- textures.set(topSt, (length / 3) * 2);
556
- topBottomGeo.attributes.st.values = textures;
519
+ extrudeNormals.set(topNormals, length);
520
+ topBottomGeo.attributes.extrudeDirection = new GeometryAttribute_default({
521
+ componentDatatype: ComponentDatatype_default.FLOAT,
522
+ componentsPerAttribute: 3,
523
+ values: extrudeNormals
524
+ });
525
+ }
526
+ let offsetValue;
527
+ const hasOffsets = defined_default(offsetAttributeValue);
528
+ if (hasOffsets) {
529
+ const size = length / 3 * 2;
530
+ let offsetAttribute = new Uint8Array(size);
531
+ if (offsetAttributeValue === GeometryOffsetAttribute_default.TOP) {
532
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
533
+ } else {
534
+ offsetValue = offsetAttributeValue === GeometryOffsetAttribute_default.NONE ? 0 : 1;
535
+ offsetAttribute = offsetAttribute.fill(offsetValue);
557
536
  }
558
-
559
- const indices = topBottomGeo.indices;
560
- const indicesLength = indices.length;
561
- const posLength = length / 3;
562
- const newIndices = IndexDatatype.IndexDatatype.createTypedArray(
563
- newLength / 3,
564
- indicesLength * 2
565
- );
566
- newIndices.set(indices);
567
- for (i = 0; i < indicesLength; i += 3) {
568
- newIndices[i + indicesLength] = indices[i + 2] + posLength;
569
- newIndices[i + 1 + indicesLength] = indices[i + 1] + posLength;
570
- newIndices[i + 2 + indicesLength] = indices[i] + posLength;
537
+ topBottomGeo.attributes.applyOffset = new GeometryAttribute_default({
538
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
539
+ componentsPerAttribute: 1,
540
+ values: offsetAttribute
541
+ });
542
+ }
543
+ if (vertexFormat.tangent) {
544
+ const topTangents = topBottomGeo.attributes.tangent.values;
545
+ tangents.set(topTangents);
546
+ for (i = 0; i < length; i++) {
547
+ topTangents[i] = -topTangents[i];
571
548
  }
572
- topBottomGeo.indices = newIndices;
573
-
574
- const northCap = computedOptions.northCap;
575
- const southCap = computedOptions.southCap;
576
-
577
- let rowHeight = height;
578
- let widthMultiplier = 2;
579
- let perimeterPositions = 0;
580
- let corners = 4;
581
- let dupliateCorners = 4;
582
- if (northCap) {
583
- widthMultiplier -= 1;
584
- rowHeight -= 1;
585
- perimeterPositions += 1;
586
- corners -= 2;
587
- dupliateCorners -= 1;
549
+ tangents.set(topTangents, length);
550
+ topBottomGeo.attributes.tangent.values = tangents;
551
+ }
552
+ if (vertexFormat.bitangent) {
553
+ const topBitangents = topBottomGeo.attributes.bitangent.values;
554
+ bitangents.set(topBitangents);
555
+ bitangents.set(topBitangents, length);
556
+ topBottomGeo.attributes.bitangent.values = bitangents;
557
+ }
558
+ if (vertexFormat.st) {
559
+ topSt = topBottomGeo.attributes.st.values;
560
+ textures.set(topSt);
561
+ textures.set(topSt, length / 3 * 2);
562
+ topBottomGeo.attributes.st.values = textures;
563
+ }
564
+ const indices = topBottomGeo.indices;
565
+ const indicesLength = indices.length;
566
+ const posLength = length / 3;
567
+ const newIndices = IndexDatatype_default.createTypedArray(
568
+ newLength / 3,
569
+ indicesLength * 2
570
+ );
571
+ newIndices.set(indices);
572
+ for (i = 0; i < indicesLength; i += 3) {
573
+ newIndices[i + indicesLength] = indices[i + 2] + posLength;
574
+ newIndices[i + 1 + indicesLength] = indices[i + 1] + posLength;
575
+ newIndices[i + 2 + indicesLength] = indices[i] + posLength;
576
+ }
577
+ topBottomGeo.indices = newIndices;
578
+ const northCap = computedOptions.northCap;
579
+ const southCap = computedOptions.southCap;
580
+ let rowHeight = height;
581
+ let widthMultiplier = 2;
582
+ let perimeterPositions = 0;
583
+ let corners = 4;
584
+ let dupliateCorners = 4;
585
+ if (northCap) {
586
+ widthMultiplier -= 1;
587
+ rowHeight -= 1;
588
+ perimeterPositions += 1;
589
+ corners -= 2;
590
+ dupliateCorners -= 1;
591
+ }
592
+ if (southCap) {
593
+ widthMultiplier -= 1;
594
+ rowHeight -= 1;
595
+ perimeterPositions += 1;
596
+ corners -= 2;
597
+ dupliateCorners -= 1;
598
+ }
599
+ perimeterPositions += widthMultiplier * width + 2 * rowHeight - corners;
600
+ const wallCount = (perimeterPositions + dupliateCorners) * 2;
601
+ let wallPositions = new Float64Array(wallCount * 3);
602
+ const wallExtrudeNormals = shadowVolume ? new Float32Array(wallCount * 3) : void 0;
603
+ let wallOffsetAttribute = hasOffsets ? new Uint8Array(wallCount) : void 0;
604
+ let wallTextures = vertexFormat.st ? new Float32Array(wallCount * 2) : void 0;
605
+ const computeTopOffsets = offsetAttributeValue === GeometryOffsetAttribute_default.TOP;
606
+ if (hasOffsets && !computeTopOffsets) {
607
+ offsetValue = offsetAttributeValue === GeometryOffsetAttribute_default.ALL ? 1 : 0;
608
+ wallOffsetAttribute = wallOffsetAttribute.fill(offsetValue);
609
+ }
610
+ let posIndex = 0;
611
+ let stIndex = 0;
612
+ let extrudeNormalIndex = 0;
613
+ let wallOffsetIndex = 0;
614
+ const area = width * rowHeight;
615
+ let threeI;
616
+ for (i = 0; i < area; i += width) {
617
+ threeI = i * 3;
618
+ wallPositions = addWallPositions(
619
+ wallPositions,
620
+ posIndex,
621
+ threeI,
622
+ topPositions,
623
+ bottomPositions
624
+ );
625
+ posIndex += 6;
626
+ if (vertexFormat.st) {
627
+ wallTextures = addWallTextureCoordinates(
628
+ wallTextures,
629
+ stIndex,
630
+ i * 2,
631
+ topSt
632
+ );
633
+ stIndex += 4;
588
634
  }
589
- if (southCap) {
590
- widthMultiplier -= 1;
591
- rowHeight -= 1;
592
- perimeterPositions += 1;
593
- corners -= 2;
594
- dupliateCorners -= 1;
635
+ if (shadowVolume) {
636
+ extrudeNormalIndex += 3;
637
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
638
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
639
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
595
640
  }
596
- perimeterPositions += widthMultiplier * width + 2 * rowHeight - corners;
597
-
598
- const wallCount = (perimeterPositions + dupliateCorners) * 2;
599
-
600
- let wallPositions = new Float64Array(wallCount * 3);
601
- const wallExtrudeNormals = shadowVolume
602
- ? new Float32Array(wallCount * 3)
603
- : undefined;
604
- let wallOffsetAttribute = hasOffsets ? new Uint8Array(wallCount) : undefined;
605
- let wallTextures = vertexFormat.st
606
- ? new Float32Array(wallCount * 2)
607
- : undefined;
608
-
609
- const computeTopOffsets =
610
- offsetAttributeValue === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP;
611
- if (hasOffsets && !computeTopOffsets) {
612
- offsetValue = offsetAttributeValue === GeometryOffsetAttribute.GeometryOffsetAttribute.ALL ? 1 : 0;
613
- wallOffsetAttribute = wallOffsetAttribute.fill(offsetValue);
641
+ if (computeTopOffsets) {
642
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
643
+ wallOffsetIndex += 1;
614
644
  }
615
-
616
- let posIndex = 0;
617
- let stIndex = 0;
618
- let extrudeNormalIndex = 0;
619
- let wallOffsetIndex = 0;
620
- const area = width * rowHeight;
621
- let threeI;
622
- for (i = 0; i < area; i += width) {
645
+ }
646
+ if (!southCap) {
647
+ for (i = area - width; i < area; i++) {
623
648
  threeI = i * 3;
624
649
  wallPositions = addWallPositions(
625
650
  wallPositions,
@@ -649,75 +674,71 @@ define(['./defaultValue-fe22d8c0', './Matrix3-41c58dde', './Matrix2-e1298525', '
649
674
  wallOffsetIndex += 1;
650
675
  }
651
676
  }
652
-
653
- if (!southCap) {
654
- for (i = area - width; i < area; i++) {
655
- threeI = i * 3;
656
- wallPositions = addWallPositions(
657
- wallPositions,
658
- posIndex,
659
- threeI,
660
- topPositions,
661
- bottomPositions
677
+ } else {
678
+ const southIndex = northCap ? area + 1 : area;
679
+ threeI = southIndex * 3;
680
+ for (i = 0; i < 2; i++) {
681
+ wallPositions = addWallPositions(
682
+ wallPositions,
683
+ posIndex,
684
+ threeI,
685
+ topPositions,
686
+ bottomPositions
687
+ );
688
+ posIndex += 6;
689
+ if (vertexFormat.st) {
690
+ wallTextures = addWallTextureCoordinates(
691
+ wallTextures,
692
+ stIndex,
693
+ southIndex * 2,
694
+ topSt
662
695
  );
663
- posIndex += 6;
664
- if (vertexFormat.st) {
665
- wallTextures = addWallTextureCoordinates(
666
- wallTextures,
667
- stIndex,
668
- i * 2,
669
- topSt
670
- );
671
- stIndex += 4;
672
- }
673
- if (shadowVolume) {
674
- extrudeNormalIndex += 3;
675
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
676
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
677
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
678
- }
679
- if (computeTopOffsets) {
680
- wallOffsetAttribute[wallOffsetIndex++] = 1;
681
- wallOffsetIndex += 1;
682
- }
696
+ stIndex += 4;
683
697
  }
684
- } else {
685
- const southIndex = northCap ? area + 1 : area;
686
- threeI = southIndex * 3;
687
-
688
- for (i = 0; i < 2; i++) {
689
- // duplicate corner points
690
- wallPositions = addWallPositions(
691
- wallPositions,
692
- posIndex,
693
- threeI,
694
- topPositions,
695
- bottomPositions
696
- );
697
- posIndex += 6;
698
- if (vertexFormat.st) {
699
- wallTextures = addWallTextureCoordinates(
700
- wallTextures,
701
- stIndex,
702
- southIndex * 2,
703
- topSt
704
- );
705
- stIndex += 4;
706
- }
707
- if (shadowVolume) {
708
- extrudeNormalIndex += 3;
709
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
710
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
711
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
712
- }
713
- if (computeTopOffsets) {
714
- wallOffsetAttribute[wallOffsetIndex++] = 1;
715
- wallOffsetIndex += 1;
716
- }
698
+ if (shadowVolume) {
699
+ extrudeNormalIndex += 3;
700
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
701
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
702
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
703
+ }
704
+ if (computeTopOffsets) {
705
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
706
+ wallOffsetIndex += 1;
717
707
  }
718
708
  }
719
-
720
- for (i = area - 1; i > 0; i -= width) {
709
+ }
710
+ for (i = area - 1; i > 0; i -= width) {
711
+ threeI = i * 3;
712
+ wallPositions = addWallPositions(
713
+ wallPositions,
714
+ posIndex,
715
+ threeI,
716
+ topPositions,
717
+ bottomPositions
718
+ );
719
+ posIndex += 6;
720
+ if (vertexFormat.st) {
721
+ wallTextures = addWallTextureCoordinates(
722
+ wallTextures,
723
+ stIndex,
724
+ i * 2,
725
+ topSt
726
+ );
727
+ stIndex += 4;
728
+ }
729
+ if (shadowVolume) {
730
+ extrudeNormalIndex += 3;
731
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
732
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
733
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
734
+ }
735
+ if (computeTopOffsets) {
736
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
737
+ wallOffsetIndex += 1;
738
+ }
739
+ }
740
+ if (!northCap) {
741
+ for (i = width - 1; i >= 0; i--) {
721
742
  threeI = i * 3;
722
743
  wallPositions = addWallPositions(
723
744
  wallPositions,
@@ -747,730 +768,506 @@ define(['./defaultValue-fe22d8c0', './Matrix3-41c58dde', './Matrix2-e1298525', '
747
768
  wallOffsetIndex += 1;
748
769
  }
749
770
  }
750
-
751
- if (!northCap) {
752
- for (i = width - 1; i >= 0; i--) {
753
- threeI = i * 3;
754
- wallPositions = addWallPositions(
755
- wallPositions,
756
- posIndex,
757
- threeI,
758
- topPositions,
759
- bottomPositions
771
+ } else {
772
+ const northIndex = area;
773
+ threeI = northIndex * 3;
774
+ for (i = 0; i < 2; i++) {
775
+ wallPositions = addWallPositions(
776
+ wallPositions,
777
+ posIndex,
778
+ threeI,
779
+ topPositions,
780
+ bottomPositions
781
+ );
782
+ posIndex += 6;
783
+ if (vertexFormat.st) {
784
+ wallTextures = addWallTextureCoordinates(
785
+ wallTextures,
786
+ stIndex,
787
+ northIndex * 2,
788
+ topSt
760
789
  );
761
- posIndex += 6;
762
- if (vertexFormat.st) {
763
- wallTextures = addWallTextureCoordinates(
764
- wallTextures,
765
- stIndex,
766
- i * 2,
767
- topSt
768
- );
769
- stIndex += 4;
770
- }
771
- if (shadowVolume) {
772
- extrudeNormalIndex += 3;
773
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
774
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
775
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
776
- }
777
- if (computeTopOffsets) {
778
- wallOffsetAttribute[wallOffsetIndex++] = 1;
779
- wallOffsetIndex += 1;
780
- }
790
+ stIndex += 4;
781
791
  }
782
- } else {
783
- const northIndex = area;
784
- threeI = northIndex * 3;
785
-
786
- for (i = 0; i < 2; i++) {
787
- // duplicate corner points
788
- wallPositions = addWallPositions(
789
- wallPositions,
790
- posIndex,
791
- threeI,
792
- topPositions,
793
- bottomPositions
794
- );
795
- posIndex += 6;
796
- if (vertexFormat.st) {
797
- wallTextures = addWallTextureCoordinates(
798
- wallTextures,
799
- stIndex,
800
- northIndex * 2,
801
- topSt
802
- );
803
- stIndex += 4;
804
- }
805
- if (shadowVolume) {
806
- extrudeNormalIndex += 3;
807
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
808
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
809
- wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
810
- }
811
- if (computeTopOffsets) {
812
- wallOffsetAttribute[wallOffsetIndex++] = 1;
813
- wallOffsetIndex += 1;
814
- }
792
+ if (shadowVolume) {
793
+ extrudeNormalIndex += 3;
794
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
795
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
796
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
815
797
  }
816
- }
817
-
818
- let geo = calculateAttributesWall(wallPositions, vertexFormat, ellipsoid);
819
-
820
- if (vertexFormat.st) {
821
- geo.attributes.st = new GeometryAttribute.GeometryAttribute({
822
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
823
- componentsPerAttribute: 2,
824
- values: wallTextures,
825
- });
826
- }
827
- if (shadowVolume) {
828
- geo.attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
829
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
830
- componentsPerAttribute: 3,
831
- values: wallExtrudeNormals,
832
- });
833
- }
834
- if (hasOffsets) {
835
- geo.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
836
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
837
- componentsPerAttribute: 1,
838
- values: wallOffsetAttribute,
839
- });
840
- }
841
-
842
- const wallIndices = IndexDatatype.IndexDatatype.createTypedArray(
843
- wallCount,
844
- perimeterPositions * 6
845
- );
846
-
847
- let upperLeft;
848
- let lowerLeft;
849
- let lowerRight;
850
- let upperRight;
851
- length = wallPositions.length / 3;
852
- let index = 0;
853
- for (i = 0; i < length - 1; i += 2) {
854
- upperLeft = i;
855
- upperRight = (upperLeft + 2) % length;
856
- const p1 = Matrix3.Cartesian3.fromArray(wallPositions, upperLeft * 3, v1Scratch);
857
- const p2 = Matrix3.Cartesian3.fromArray(wallPositions, upperRight * 3, v2Scratch);
858
- if (Matrix3.Cartesian3.equalsEpsilon(p1, p2, Math$1.CesiumMath.EPSILON10)) {
859
- continue;
798
+ if (computeTopOffsets) {
799
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
800
+ wallOffsetIndex += 1;
860
801
  }
861
- lowerLeft = (upperLeft + 1) % length;
862
- lowerRight = (lowerLeft + 2) % length;
863
- wallIndices[index++] = upperLeft;
864
- wallIndices[index++] = lowerLeft;
865
- wallIndices[index++] = upperRight;
866
- wallIndices[index++] = upperRight;
867
- wallIndices[index++] = lowerLeft;
868
- wallIndices[index++] = lowerRight;
869
802
  }
870
-
871
- geo.indices = wallIndices;
872
-
873
- geo = GeometryPipeline.GeometryPipeline.combineInstances([
874
- new GeometryInstance.GeometryInstance({
875
- geometry: topBottomGeo,
876
- }),
877
- new GeometryInstance.GeometryInstance({
878
- geometry: geo,
879
- }),
880
- ]);
881
-
882
- return geo[0];
883
803
  }
884
-
885
- const scratchRectanglePoints = [
886
- new Matrix3.Cartesian3(),
887
- new Matrix3.Cartesian3(),
888
- new Matrix3.Cartesian3(),
889
- new Matrix3.Cartesian3(),
890
- ];
891
- const nwScratch = new Matrix3.Cartographic();
892
- const stNwScratch = new Matrix3.Cartographic();
893
- function computeRectangle(rectangle, granularity, rotation, ellipsoid, result) {
894
- if (rotation === 0.0) {
895
- return Matrix2.Rectangle.clone(rectangle, result);
804
+ let geo = calculateAttributesWall(wallPositions, vertexFormat, ellipsoid);
805
+ if (vertexFormat.st) {
806
+ geo.attributes.st = new GeometryAttribute_default({
807
+ componentDatatype: ComponentDatatype_default.FLOAT,
808
+ componentsPerAttribute: 2,
809
+ values: wallTextures
810
+ });
811
+ }
812
+ if (shadowVolume) {
813
+ geo.attributes.extrudeDirection = new GeometryAttribute_default({
814
+ componentDatatype: ComponentDatatype_default.FLOAT,
815
+ componentsPerAttribute: 3,
816
+ values: wallExtrudeNormals
817
+ });
818
+ }
819
+ if (hasOffsets) {
820
+ geo.attributes.applyOffset = new GeometryAttribute_default({
821
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
822
+ componentsPerAttribute: 1,
823
+ values: wallOffsetAttribute
824
+ });
825
+ }
826
+ const wallIndices = IndexDatatype_default.createTypedArray(
827
+ wallCount,
828
+ perimeterPositions * 6
829
+ );
830
+ let upperLeft;
831
+ let lowerLeft;
832
+ let lowerRight;
833
+ let upperRight;
834
+ length = wallPositions.length / 3;
835
+ let index = 0;
836
+ for (i = 0; i < length - 1; i += 2) {
837
+ upperLeft = i;
838
+ upperRight = (upperLeft + 2) % length;
839
+ const p1 = Cartesian3_default.fromArray(wallPositions, upperLeft * 3, v1Scratch);
840
+ const p2 = Cartesian3_default.fromArray(wallPositions, upperRight * 3, v2Scratch);
841
+ if (Cartesian3_default.equalsEpsilon(p1, p2, Math_default.EPSILON10)) {
842
+ continue;
896
843
  }
897
-
898
- const computedOptions = RectangleGeometryLibrary.RectangleGeometryLibrary.computeOptions(
899
- rectangle,
900
- granularity,
901
- rotation,
902
- 0,
903
- rectangleScratch,
904
- nwScratch
844
+ lowerLeft = (upperLeft + 1) % length;
845
+ lowerRight = (lowerLeft + 2) % length;
846
+ wallIndices[index++] = upperLeft;
847
+ wallIndices[index++] = lowerLeft;
848
+ wallIndices[index++] = upperRight;
849
+ wallIndices[index++] = upperRight;
850
+ wallIndices[index++] = lowerLeft;
851
+ wallIndices[index++] = lowerRight;
852
+ }
853
+ geo.indices = wallIndices;
854
+ geo = GeometryPipeline_default.combineInstances([
855
+ new GeometryInstance_default({
856
+ geometry: topBottomGeo
857
+ }),
858
+ new GeometryInstance_default({
859
+ geometry: geo
860
+ })
861
+ ]);
862
+ return geo[0];
863
+ }
864
+ var scratchRectanglePoints = [
865
+ new Cartesian3_default(),
866
+ new Cartesian3_default(),
867
+ new Cartesian3_default(),
868
+ new Cartesian3_default()
869
+ ];
870
+ var nwScratch = new Cartographic_default();
871
+ var stNwScratch = new Cartographic_default();
872
+ function computeRectangle(rectangle, granularity, rotation, ellipsoid, result) {
873
+ if (rotation === 0) {
874
+ return Rectangle_default.clone(rectangle, result);
875
+ }
876
+ const computedOptions = RectangleGeometryLibrary_default.computeOptions(
877
+ rectangle,
878
+ granularity,
879
+ rotation,
880
+ 0,
881
+ rectangleScratch,
882
+ nwScratch
883
+ );
884
+ const height = computedOptions.height;
885
+ const width = computedOptions.width;
886
+ const positions = scratchRectanglePoints;
887
+ RectangleGeometryLibrary_default.computePosition(
888
+ computedOptions,
889
+ ellipsoid,
890
+ false,
891
+ 0,
892
+ 0,
893
+ positions[0]
894
+ );
895
+ RectangleGeometryLibrary_default.computePosition(
896
+ computedOptions,
897
+ ellipsoid,
898
+ false,
899
+ 0,
900
+ width - 1,
901
+ positions[1]
902
+ );
903
+ RectangleGeometryLibrary_default.computePosition(
904
+ computedOptions,
905
+ ellipsoid,
906
+ false,
907
+ height - 1,
908
+ 0,
909
+ positions[2]
910
+ );
911
+ RectangleGeometryLibrary_default.computePosition(
912
+ computedOptions,
913
+ ellipsoid,
914
+ false,
915
+ height - 1,
916
+ width - 1,
917
+ positions[3]
918
+ );
919
+ return Rectangle_default.fromCartesianArray(positions, ellipsoid, result);
920
+ }
921
+ function RectangleGeometry(options) {
922
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
923
+ const rectangle = options.rectangle;
924
+ Check_default.typeOf.object("rectangle", rectangle);
925
+ Rectangle_default.validate(rectangle);
926
+ if (rectangle.north < rectangle.south) {
927
+ throw new DeveloperError_default(
928
+ "options.rectangle.north must be greater than or equal to options.rectangle.south"
905
929
  );
906
-
907
- const height = computedOptions.height;
908
- const width = computedOptions.width;
909
-
910
- const positions = scratchRectanglePoints;
911
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
912
- computedOptions,
913
- ellipsoid,
914
- false,
915
- 0,
916
- 0,
917
- positions[0]
930
+ }
931
+ const height = defaultValue_default(options.height, 0);
932
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
933
+ this._rectangle = Rectangle_default.clone(rectangle);
934
+ this._granularity = defaultValue_default(
935
+ options.granularity,
936
+ Math_default.RADIANS_PER_DEGREE
937
+ );
938
+ this._ellipsoid = Ellipsoid_default.clone(
939
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
940
+ );
941
+ this._surfaceHeight = Math.max(height, extrudedHeight);
942
+ this._rotation = defaultValue_default(options.rotation, 0);
943
+ this._stRotation = defaultValue_default(options.stRotation, 0);
944
+ this._vertexFormat = VertexFormat_default.clone(
945
+ defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
946
+ );
947
+ this._extrudedHeight = Math.min(height, extrudedHeight);
948
+ this._shadowVolume = defaultValue_default(options.shadowVolume, false);
949
+ this._workerName = "createRectangleGeometry";
950
+ this._offsetAttribute = options.offsetAttribute;
951
+ this._rotatedRectangle = void 0;
952
+ this._textureCoordinateRotationPoints = void 0;
953
+ }
954
+ RectangleGeometry.packedLength = Rectangle_default.packedLength + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 7;
955
+ RectangleGeometry.pack = function(value, array, startingIndex) {
956
+ Check_default.typeOf.object("value", value);
957
+ Check_default.defined("array", array);
958
+ startingIndex = defaultValue_default(startingIndex, 0);
959
+ Rectangle_default.pack(value._rectangle, array, startingIndex);
960
+ startingIndex += Rectangle_default.packedLength;
961
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
962
+ startingIndex += Ellipsoid_default.packedLength;
963
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
964
+ startingIndex += VertexFormat_default.packedLength;
965
+ array[startingIndex++] = value._granularity;
966
+ array[startingIndex++] = value._surfaceHeight;
967
+ array[startingIndex++] = value._rotation;
968
+ array[startingIndex++] = value._stRotation;
969
+ array[startingIndex++] = value._extrudedHeight;
970
+ array[startingIndex++] = value._shadowVolume ? 1 : 0;
971
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
972
+ return array;
973
+ };
974
+ var scratchRectangle = new Rectangle_default();
975
+ var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
976
+ var scratchOptions = {
977
+ rectangle: scratchRectangle,
978
+ ellipsoid: scratchEllipsoid,
979
+ vertexFormat: scratchVertexFormat,
980
+ granularity: void 0,
981
+ height: void 0,
982
+ rotation: void 0,
983
+ stRotation: void 0,
984
+ extrudedHeight: void 0,
985
+ shadowVolume: void 0,
986
+ offsetAttribute: void 0
987
+ };
988
+ RectangleGeometry.unpack = function(array, startingIndex, result) {
989
+ Check_default.defined("array", array);
990
+ startingIndex = defaultValue_default(startingIndex, 0);
991
+ const rectangle = Rectangle_default.unpack(array, startingIndex, scratchRectangle);
992
+ startingIndex += Rectangle_default.packedLength;
993
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
994
+ startingIndex += Ellipsoid_default.packedLength;
995
+ const vertexFormat = VertexFormat_default.unpack(
996
+ array,
997
+ startingIndex,
998
+ scratchVertexFormat
999
+ );
1000
+ startingIndex += VertexFormat_default.packedLength;
1001
+ const granularity = array[startingIndex++];
1002
+ const surfaceHeight = array[startingIndex++];
1003
+ const rotation = array[startingIndex++];
1004
+ const stRotation = array[startingIndex++];
1005
+ const extrudedHeight = array[startingIndex++];
1006
+ const shadowVolume = array[startingIndex++] === 1;
1007
+ const offsetAttribute = array[startingIndex];
1008
+ if (!defined_default(result)) {
1009
+ scratchOptions.granularity = granularity;
1010
+ scratchOptions.height = surfaceHeight;
1011
+ scratchOptions.rotation = rotation;
1012
+ scratchOptions.stRotation = stRotation;
1013
+ scratchOptions.extrudedHeight = extrudedHeight;
1014
+ scratchOptions.shadowVolume = shadowVolume;
1015
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
1016
+ return new RectangleGeometry(scratchOptions);
1017
+ }
1018
+ result._rectangle = Rectangle_default.clone(rectangle, result._rectangle);
1019
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
1020
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
1021
+ result._granularity = granularity;
1022
+ result._surfaceHeight = surfaceHeight;
1023
+ result._rotation = rotation;
1024
+ result._stRotation = stRotation;
1025
+ result._extrudedHeight = extrudedHeight;
1026
+ result._shadowVolume = shadowVolume;
1027
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
1028
+ return result;
1029
+ };
1030
+ RectangleGeometry.computeRectangle = function(options, result) {
1031
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
1032
+ const rectangle = options.rectangle;
1033
+ Check_default.typeOf.object("rectangle", rectangle);
1034
+ Rectangle_default.validate(rectangle);
1035
+ if (rectangle.north < rectangle.south) {
1036
+ throw new DeveloperError_default(
1037
+ "options.rectangle.north must be greater than or equal to options.rectangle.south"
918
1038
  );
919
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
920
- computedOptions,
1039
+ }
1040
+ const granularity = defaultValue_default(
1041
+ options.granularity,
1042
+ Math_default.RADIANS_PER_DEGREE
1043
+ );
1044
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
1045
+ const rotation = defaultValue_default(options.rotation, 0);
1046
+ return computeRectangle(rectangle, granularity, rotation, ellipsoid, result);
1047
+ };
1048
+ var tangentRotationMatrixScratch = new Matrix3_default();
1049
+ var quaternionScratch = new Quaternion_default();
1050
+ var centerScratch = new Cartographic_default();
1051
+ RectangleGeometry.createGeometry = function(rectangleGeometry) {
1052
+ if (Math_default.equalsEpsilon(
1053
+ rectangleGeometry._rectangle.north,
1054
+ rectangleGeometry._rectangle.south,
1055
+ Math_default.EPSILON10
1056
+ ) || Math_default.equalsEpsilon(
1057
+ rectangleGeometry._rectangle.east,
1058
+ rectangleGeometry._rectangle.west,
1059
+ Math_default.EPSILON10
1060
+ )) {
1061
+ return void 0;
1062
+ }
1063
+ let rectangle = rectangleGeometry._rectangle;
1064
+ const ellipsoid = rectangleGeometry._ellipsoid;
1065
+ const rotation = rectangleGeometry._rotation;
1066
+ const stRotation = rectangleGeometry._stRotation;
1067
+ const vertexFormat = rectangleGeometry._vertexFormat;
1068
+ const computedOptions = RectangleGeometryLibrary_default.computeOptions(
1069
+ rectangle,
1070
+ rectangleGeometry._granularity,
1071
+ rotation,
1072
+ stRotation,
1073
+ rectangleScratch,
1074
+ nwScratch,
1075
+ stNwScratch
1076
+ );
1077
+ const tangentRotationMatrix = tangentRotationMatrixScratch;
1078
+ if (stRotation !== 0 || rotation !== 0) {
1079
+ const center = Rectangle_default.center(rectangle, centerScratch);
1080
+ const axis = ellipsoid.geodeticSurfaceNormalCartographic(center, v1Scratch);
1081
+ Quaternion_default.fromAxisAngle(axis, -stRotation, quaternionScratch);
1082
+ Matrix3_default.fromQuaternion(quaternionScratch, tangentRotationMatrix);
1083
+ } else {
1084
+ Matrix3_default.clone(Matrix3_default.IDENTITY, tangentRotationMatrix);
1085
+ }
1086
+ const surfaceHeight = rectangleGeometry._surfaceHeight;
1087
+ const extrudedHeight = rectangleGeometry._extrudedHeight;
1088
+ const extrude = !Math_default.equalsEpsilon(
1089
+ surfaceHeight,
1090
+ extrudedHeight,
1091
+ 0,
1092
+ Math_default.EPSILON2
1093
+ );
1094
+ computedOptions.lonScalar = 1 / rectangleGeometry._rectangle.width;
1095
+ computedOptions.latScalar = 1 / rectangleGeometry._rectangle.height;
1096
+ computedOptions.tangentRotationMatrix = tangentRotationMatrix;
1097
+ let geometry;
1098
+ let boundingSphere;
1099
+ rectangle = rectangleGeometry._rectangle;
1100
+ if (extrude) {
1101
+ geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);
1102
+ const topBS = BoundingSphere_default.fromRectangle3D(
1103
+ rectangle,
921
1104
  ellipsoid,
922
- false,
923
- 0,
924
- width - 1,
925
- positions[1]
1105
+ surfaceHeight,
1106
+ topBoundingSphere
926
1107
  );
927
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
928
- computedOptions,
1108
+ const bottomBS = BoundingSphere_default.fromRectangle3D(
1109
+ rectangle,
929
1110
  ellipsoid,
930
- false,
931
- height - 1,
932
- 0,
933
- positions[2]
1111
+ extrudedHeight,
1112
+ bottomBoundingSphere
934
1113
  );
935
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
936
- computedOptions,
1114
+ boundingSphere = BoundingSphere_default.union(topBS, bottomBS);
1115
+ } else {
1116
+ geometry = constructRectangle(rectangleGeometry, computedOptions);
1117
+ geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
1118
+ geometry.attributes.position.values,
1119
+ surfaceHeight,
937
1120
  ellipsoid,
938
- false,
939
- height - 1,
940
- width - 1,
941
- positions[3]
1121
+ false
942
1122
  );
943
-
944
- return Matrix2.Rectangle.fromCartesianArray(positions, ellipsoid, result);
945
- }
946
-
947
- /**
948
- * A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
949
- *
950
- * @alias RectangleGeometry
951
- * @constructor
952
- *
953
- * @param {object} options Object with the following properties:
954
- * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.
955
- * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
956
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.
957
- * @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.
958
- * @param {number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface.
959
- * @param {number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
960
- * @param {number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
961
- * @param {number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.
962
- *
963
- * @exception {DeveloperError} <code>options.rectangle.north</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].
964
- * @exception {DeveloperError} <code>options.rectangle.south</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].
965
- * @exception {DeveloperError} <code>options.rectangle.east</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].
966
- * @exception {DeveloperError} <code>options.rectangle.west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].
967
- * @exception {DeveloperError} <code>options.rectangle.north</code> must be greater than <code>options.rectangle.south</code>.
968
- *
969
- * @see RectangleGeometry#createGeometry
970
- *
971
- * @demo {@link https://sandcastle.cesium.com/index.html?src=Rectangle.html|Cesium Sandcastle Rectangle Demo}
972
- *
973
- * @example
974
- * // 1. create a rectangle
975
- * const rectangle = new Cesium.RectangleGeometry({
976
- * ellipsoid : Cesium.Ellipsoid.WGS84,
977
- * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
978
- * height : 10000.0
979
- * });
980
- * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
981
- *
982
- * // 2. create an extruded rectangle without a top
983
- * const rectangle = new Cesium.RectangleGeometry({
984
- * ellipsoid : Cesium.Ellipsoid.WGS84,
985
- * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
986
- * height : 10000.0,
987
- * extrudedHeight: 300000
988
- * });
989
- * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
990
- */
991
- function RectangleGeometry(options) {
992
- options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
993
-
994
- const rectangle = options.rectangle;
995
-
996
- //>>includeStart('debug', pragmas.debug);
997
- Check.Check.typeOf.object("rectangle", rectangle);
998
- Matrix2.Rectangle.validate(rectangle);
999
- if (rectangle.north < rectangle.south) {
1000
- throw new Check.DeveloperError(
1001
- "options.rectangle.north must be greater than or equal to options.rectangle.south"
1002
- );
1123
+ if (defined_default(rectangleGeometry._offsetAttribute)) {
1124
+ const length = geometry.attributes.position.values.length;
1125
+ const offsetValue = rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
1126
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
1127
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
1128
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
1129
+ componentsPerAttribute: 1,
1130
+ values: applyOffset
1131
+ });
1003
1132
  }
1004
- //>>includeEnd('debug');
1005
-
1006
- const height = defaultValue.defaultValue(options.height, 0.0);
1007
- const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
1008
-
1009
- this._rectangle = Matrix2.Rectangle.clone(rectangle);
1010
- this._granularity = defaultValue.defaultValue(
1011
- options.granularity,
1012
- Math$1.CesiumMath.RADIANS_PER_DEGREE
1013
- );
1014
- this._ellipsoid = Matrix3.Ellipsoid.clone(
1015
- defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
1016
- );
1017
- this._surfaceHeight = Math.max(height, extrudedHeight);
1018
- this._rotation = defaultValue.defaultValue(options.rotation, 0.0);
1019
- this._stRotation = defaultValue.defaultValue(options.stRotation, 0.0);
1020
- this._vertexFormat = VertexFormat.VertexFormat.clone(
1021
- defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT)
1133
+ boundingSphere = BoundingSphere_default.fromRectangle3D(
1134
+ rectangle,
1135
+ ellipsoid,
1136
+ surfaceHeight
1022
1137
  );
1023
- this._extrudedHeight = Math.min(height, extrudedHeight);
1024
- this._shadowVolume = defaultValue.defaultValue(options.shadowVolume, false);
1025
- this._workerName = "createRectangleGeometry";
1026
- this._offsetAttribute = options.offsetAttribute;
1027
- this._rotatedRectangle = undefined;
1028
-
1029
- this._textureCoordinateRotationPoints = undefined;
1030
1138
  }
1031
-
1032
- /**
1033
- * The number of elements used to pack the object into an array.
1034
- * @type {number}
1035
- */
1036
- RectangleGeometry.packedLength =
1037
- Matrix2.Rectangle.packedLength +
1038
- Matrix3.Ellipsoid.packedLength +
1039
- VertexFormat.VertexFormat.packedLength +
1040
- 7;
1041
-
1042
- /**
1043
- * Stores the provided instance into the provided array.
1044
- *
1045
- * @param {RectangleGeometry} value The value to pack.
1046
- * @param {number[]} array The array to pack into.
1047
- * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
1048
- *
1049
- * @returns {number[]} The array that was packed into
1050
- */
1051
- RectangleGeometry.pack = function (value, array, startingIndex) {
1052
- //>>includeStart('debug', pragmas.debug);
1053
- Check.Check.typeOf.object("value", value);
1054
- Check.Check.defined("array", array);
1055
- //>>includeEnd('debug');
1056
-
1057
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
1058
-
1059
- Matrix2.Rectangle.pack(value._rectangle, array, startingIndex);
1060
- startingIndex += Matrix2.Rectangle.packedLength;
1061
-
1062
- Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
1063
- startingIndex += Matrix3.Ellipsoid.packedLength;
1064
-
1065
- VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
1066
- startingIndex += VertexFormat.VertexFormat.packedLength;
1067
-
1068
- array[startingIndex++] = value._granularity;
1069
- array[startingIndex++] = value._surfaceHeight;
1070
- array[startingIndex++] = value._rotation;
1071
- array[startingIndex++] = value._stRotation;
1072
- array[startingIndex++] = value._extrudedHeight;
1073
- array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;
1074
- array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
1075
-
1076
- return array;
1077
- };
1078
-
1079
- const scratchRectangle = new Matrix2.Rectangle();
1080
- const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
1081
- const scratchOptions = {
1082
- rectangle: scratchRectangle,
1083
- ellipsoid: scratchEllipsoid,
1084
- vertexFormat: scratchVertexFormat,
1085
- granularity: undefined,
1086
- height: undefined,
1087
- rotation: undefined,
1088
- stRotation: undefined,
1089
- extrudedHeight: undefined,
1090
- shadowVolume: undefined,
1091
- offsetAttribute: undefined,
1092
- };
1093
-
1094
- /**
1095
- * Retrieves an instance from a packed array.
1096
- *
1097
- * @param {number[]} array The packed array.
1098
- * @param {number} [startingIndex=0] The starting index of the element to be unpacked.
1099
- * @param {RectangleGeometry} [result] The object into which to store the result.
1100
- * @returns {RectangleGeometry} The modified result parameter or a new RectangleGeometry instance if one was not provided.
1101
- */
1102
- RectangleGeometry.unpack = function (array, startingIndex, result) {
1103
- //>>includeStart('debug', pragmas.debug);
1104
- Check.Check.defined("array", array);
1105
- //>>includeEnd('debug');
1106
-
1107
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
1108
-
1109
- const rectangle = Matrix2.Rectangle.unpack(array, startingIndex, scratchRectangle);
1110
- startingIndex += Matrix2.Rectangle.packedLength;
1111
-
1112
- const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
1113
- startingIndex += Matrix3.Ellipsoid.packedLength;
1114
-
1115
- const vertexFormat = VertexFormat.VertexFormat.unpack(
1116
- array,
1117
- startingIndex,
1118
- scratchVertexFormat
1119
- );
1120
- startingIndex += VertexFormat.VertexFormat.packedLength;
1121
-
1122
- const granularity = array[startingIndex++];
1123
- const surfaceHeight = array[startingIndex++];
1124
- const rotation = array[startingIndex++];
1125
- const stRotation = array[startingIndex++];
1126
- const extrudedHeight = array[startingIndex++];
1127
- const shadowVolume = array[startingIndex++] === 1.0;
1128
- const offsetAttribute = array[startingIndex];
1129
-
1130
- if (!defaultValue.defined(result)) {
1131
- scratchOptions.granularity = granularity;
1132
- scratchOptions.height = surfaceHeight;
1133
- scratchOptions.rotation = rotation;
1134
- scratchOptions.stRotation = stRotation;
1135
- scratchOptions.extrudedHeight = extrudedHeight;
1136
- scratchOptions.shadowVolume = shadowVolume;
1137
- scratchOptions.offsetAttribute =
1138
- offsetAttribute === -1 ? undefined : offsetAttribute;
1139
-
1140
- return new RectangleGeometry(scratchOptions);
1141
- }
1142
-
1143
- result._rectangle = Matrix2.Rectangle.clone(rectangle, result._rectangle);
1144
- result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
1145
- result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
1146
- result._granularity = granularity;
1147
- result._surfaceHeight = surfaceHeight;
1148
- result._rotation = rotation;
1149
- result._stRotation = stRotation;
1150
- result._extrudedHeight = extrudedHeight;
1151
- result._shadowVolume = shadowVolume;
1152
- result._offsetAttribute =
1153
- offsetAttribute === -1 ? undefined : offsetAttribute;
1154
-
1155
- return result;
1156
- };
1157
-
1158
- /**
1159
- * Computes the bounding rectangle based on the provided options
1160
- *
1161
- * @param {object} options Object with the following properties:
1162
- * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.
1163
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.
1164
- * @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.
1165
- * @param {number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
1166
- * @param {Rectangle} [result] An object in which to store the result.
1167
- *
1168
- * @returns {Rectangle} The result rectangle
1169
- */
1170
- RectangleGeometry.computeRectangle = function (options, result) {
1171
- options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
1172
-
1173
- const rectangle = options.rectangle;
1174
-
1175
- //>>includeStart('debug', pragmas.debug);
1176
- Check.Check.typeOf.object("rectangle", rectangle);
1177
- Matrix2.Rectangle.validate(rectangle);
1178
- if (rectangle.north < rectangle.south) {
1179
- throw new Check.DeveloperError(
1180
- "options.rectangle.north must be greater than or equal to options.rectangle.south"
1181
- );
1182
- }
1183
- //>>includeEnd('debug');
1184
-
1185
- const granularity = defaultValue.defaultValue(
1186
- options.granularity,
1187
- Math$1.CesiumMath.RADIANS_PER_DEGREE
1188
- );
1189
- const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
1190
- const rotation = defaultValue.defaultValue(options.rotation, 0.0);
1191
-
1192
- return computeRectangle(rectangle, granularity, rotation, ellipsoid, result);
1193
- };
1194
-
1195
- const tangentRotationMatrixScratch = new Matrix3.Matrix3();
1196
- const quaternionScratch = new Transforms.Quaternion();
1197
- const centerScratch = new Matrix3.Cartographic();
1139
+ if (!vertexFormat.position) {
1140
+ delete geometry.attributes.position;
1141
+ }
1142
+ return new Geometry_default({
1143
+ attributes: geometry.attributes,
1144
+ indices: geometry.indices,
1145
+ primitiveType: geometry.primitiveType,
1146
+ boundingSphere,
1147
+ offsetAttribute: rectangleGeometry._offsetAttribute
1148
+ });
1149
+ };
1150
+ RectangleGeometry.createShadowVolume = function(rectangleGeometry, minHeightFunc, maxHeightFunc) {
1151
+ const granularity = rectangleGeometry._granularity;
1152
+ const ellipsoid = rectangleGeometry._ellipsoid;
1153
+ const minHeight = minHeightFunc(granularity, ellipsoid);
1154
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
1155
+ return new RectangleGeometry({
1156
+ rectangle: rectangleGeometry._rectangle,
1157
+ rotation: rectangleGeometry._rotation,
1158
+ ellipsoid,
1159
+ stRotation: rectangleGeometry._stRotation,
1160
+ granularity,
1161
+ extrudedHeight: maxHeight,
1162
+ height: minHeight,
1163
+ vertexFormat: VertexFormat_default.POSITION_ONLY,
1164
+ shadowVolume: true
1165
+ });
1166
+ };
1167
+ var unrotatedTextureRectangleScratch = new Rectangle_default();
1168
+ var points2DScratch = [new Cartesian2_default(), new Cartesian2_default(), new Cartesian2_default()];
1169
+ var rotation2DScratch = new Matrix2_default();
1170
+ var rectangleCenterScratch = new Cartographic_default();
1171
+ function textureCoordinateRotationPoints(rectangleGeometry) {
1172
+ if (rectangleGeometry._stRotation === 0) {
1173
+ return [0, 0, 0, 1, 1, 0];
1174
+ }
1175
+ const rectangle = Rectangle_default.clone(
1176
+ rectangleGeometry._rectangle,
1177
+ unrotatedTextureRectangleScratch
1178
+ );
1179
+ const granularity = rectangleGeometry._granularity;
1180
+ const ellipsoid = rectangleGeometry._ellipsoid;
1181
+ const rotation = rectangleGeometry._rotation - rectangleGeometry._stRotation;
1182
+ const unrotatedTextureRectangle = computeRectangle(
1183
+ rectangle,
1184
+ granularity,
1185
+ rotation,
1186
+ ellipsoid,
1187
+ unrotatedTextureRectangleScratch
1188
+ );
1189
+ const points2D = points2DScratch;
1190
+ points2D[0].x = unrotatedTextureRectangle.west;
1191
+ points2D[0].y = unrotatedTextureRectangle.south;
1192
+ points2D[1].x = unrotatedTextureRectangle.west;
1193
+ points2D[1].y = unrotatedTextureRectangle.north;
1194
+ points2D[2].x = unrotatedTextureRectangle.east;
1195
+ points2D[2].y = unrotatedTextureRectangle.south;
1196
+ const boundingRectangle = rectangleGeometry.rectangle;
1197
+ const toDesiredInComputed = Matrix2_default.fromRotation(
1198
+ rectangleGeometry._stRotation,
1199
+ rotation2DScratch
1200
+ );
1201
+ const boundingRectangleCenter = Rectangle_default.center(
1202
+ boundingRectangle,
1203
+ rectangleCenterScratch
1204
+ );
1205
+ for (let i = 0; i < 3; ++i) {
1206
+ const point2D = points2D[i];
1207
+ point2D.x -= boundingRectangleCenter.longitude;
1208
+ point2D.y -= boundingRectangleCenter.latitude;
1209
+ Matrix2_default.multiplyByVector(toDesiredInComputed, point2D, point2D);
1210
+ point2D.x += boundingRectangleCenter.longitude;
1211
+ point2D.y += boundingRectangleCenter.latitude;
1212
+ point2D.x = (point2D.x - boundingRectangle.west) / boundingRectangle.width;
1213
+ point2D.y = (point2D.y - boundingRectangle.south) / boundingRectangle.height;
1214
+ }
1215
+ const minXYCorner = points2D[0];
1216
+ const maxYCorner = points2D[1];
1217
+ const maxXCorner = points2D[2];
1218
+ const result = new Array(6);
1219
+ Cartesian2_default.pack(minXYCorner, result);
1220
+ Cartesian2_default.pack(maxYCorner, result, 2);
1221
+ Cartesian2_default.pack(maxXCorner, result, 4);
1222
+ return result;
1223
+ }
1224
+ Object.defineProperties(RectangleGeometry.prototype, {
1198
1225
  /**
1199
- * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.
1200
- *
1201
- * @param {RectangleGeometry} rectangleGeometry A description of the rectangle.
1202
- * @returns {Geometry|undefined} The computed vertices and indices.
1203
- *
1204
- * @exception {DeveloperError} Rotated rectangle is invalid.
1226
+ * @private
1205
1227
  */
1206
- RectangleGeometry.createGeometry = function (rectangleGeometry) {
1207
- if (
1208
- Math$1.CesiumMath.equalsEpsilon(
1209
- rectangleGeometry._rectangle.north,
1210
- rectangleGeometry._rectangle.south,
1211
- Math$1.CesiumMath.EPSILON10
1212
- ) ||
1213
- Math$1.CesiumMath.equalsEpsilon(
1214
- rectangleGeometry._rectangle.east,
1215
- rectangleGeometry._rectangle.west,
1216
- Math$1.CesiumMath.EPSILON10
1217
- )
1218
- ) {
1219
- return undefined;
1220
- }
1221
-
1222
- let rectangle = rectangleGeometry._rectangle;
1223
- const ellipsoid = rectangleGeometry._ellipsoid;
1224
- const rotation = rectangleGeometry._rotation;
1225
- const stRotation = rectangleGeometry._stRotation;
1226
- const vertexFormat = rectangleGeometry._vertexFormat;
1227
-
1228
- const computedOptions = RectangleGeometryLibrary.RectangleGeometryLibrary.computeOptions(
1229
- rectangle,
1230
- rectangleGeometry._granularity,
1231
- rotation,
1232
- stRotation,
1233
- rectangleScratch,
1234
- nwScratch,
1235
- stNwScratch
1236
- );
1237
-
1238
- const tangentRotationMatrix = tangentRotationMatrixScratch;
1239
- if (stRotation !== 0 || rotation !== 0) {
1240
- const center = Matrix2.Rectangle.center(rectangle, centerScratch);
1241
- const axis = ellipsoid.geodeticSurfaceNormalCartographic(center, v1Scratch);
1242
- Transforms.Quaternion.fromAxisAngle(axis, -stRotation, quaternionScratch);
1243
- Matrix3.Matrix3.fromQuaternion(quaternionScratch, tangentRotationMatrix);
1244
- } else {
1245
- Matrix3.Matrix3.clone(Matrix3.Matrix3.IDENTITY, tangentRotationMatrix);
1246
- }
1247
-
1248
- const surfaceHeight = rectangleGeometry._surfaceHeight;
1249
- const extrudedHeight = rectangleGeometry._extrudedHeight;
1250
- const extrude = !Math$1.CesiumMath.equalsEpsilon(
1251
- surfaceHeight,
1252
- extrudedHeight,
1253
- 0,
1254
- Math$1.CesiumMath.EPSILON2
1255
- );
1256
-
1257
- computedOptions.lonScalar = 1.0 / rectangleGeometry._rectangle.width;
1258
- computedOptions.latScalar = 1.0 / rectangleGeometry._rectangle.height;
1259
- computedOptions.tangentRotationMatrix = tangentRotationMatrix;
1260
-
1261
- let geometry;
1262
- let boundingSphere;
1263
- rectangle = rectangleGeometry._rectangle;
1264
- if (extrude) {
1265
- geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);
1266
- const topBS = Transforms.BoundingSphere.fromRectangle3D(
1267
- rectangle,
1268
- ellipsoid,
1269
- surfaceHeight,
1270
- topBoundingSphere
1271
- );
1272
- const bottomBS = Transforms.BoundingSphere.fromRectangle3D(
1273
- rectangle,
1274
- ellipsoid,
1275
- extrudedHeight,
1276
- bottomBoundingSphere
1277
- );
1278
- boundingSphere = Transforms.BoundingSphere.union(topBS, bottomBS);
1279
- } else {
1280
- geometry = constructRectangle(rectangleGeometry, computedOptions);
1281
- geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
1282
- geometry.attributes.position.values,
1283
- surfaceHeight,
1284
- ellipsoid,
1285
- false
1286
- );
1287
-
1288
- if (defaultValue.defined(rectangleGeometry._offsetAttribute)) {
1289
- const length = geometry.attributes.position.values.length;
1290
- const offsetValue =
1291
- rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
1292
- ? 0
1293
- : 1;
1294
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
1295
- geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
1296
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
1297
- componentsPerAttribute: 1,
1298
- values: applyOffset,
1299
- });
1228
+ rectangle: {
1229
+ get: function() {
1230
+ if (!defined_default(this._rotatedRectangle)) {
1231
+ this._rotatedRectangle = computeRectangle(
1232
+ this._rectangle,
1233
+ this._granularity,
1234
+ this._rotation,
1235
+ this._ellipsoid
1236
+ );
1300
1237
  }
1301
-
1302
- boundingSphere = Transforms.BoundingSphere.fromRectangle3D(
1303
- rectangle,
1304
- ellipsoid,
1305
- surfaceHeight
1306
- );
1307
- }
1308
-
1309
- if (!vertexFormat.position) {
1310
- delete geometry.attributes.position;
1238
+ return this._rotatedRectangle;
1311
1239
  }
1312
-
1313
- return new GeometryAttribute.Geometry({
1314
- attributes: geometry.attributes,
1315
- indices: geometry.indices,
1316
- primitiveType: geometry.primitiveType,
1317
- boundingSphere: boundingSphere,
1318
- offsetAttribute: rectangleGeometry._offsetAttribute,
1319
- });
1320
- };
1321
-
1240
+ },
1322
1241
  /**
1242
+ * For remapping texture coordinates when rendering RectangleGeometries as GroundPrimitives.
1243
+ * This version permits skew in textures by computing offsets directly in cartographic space and
1244
+ * more accurately approximates rendering RectangleGeometries with height as standard Primitives.
1245
+ * @see Geometry#_textureCoordinateRotationPoints
1323
1246
  * @private
1324
1247
  */
1325
- RectangleGeometry.createShadowVolume = function (
1326
- rectangleGeometry,
1327
- minHeightFunc,
1328
- maxHeightFunc
1329
- ) {
1330
- const granularity = rectangleGeometry._granularity;
1331
- const ellipsoid = rectangleGeometry._ellipsoid;
1332
-
1333
- const minHeight = minHeightFunc(granularity, ellipsoid);
1334
- const maxHeight = maxHeightFunc(granularity, ellipsoid);
1335
-
1336
- return new RectangleGeometry({
1337
- rectangle: rectangleGeometry._rectangle,
1338
- rotation: rectangleGeometry._rotation,
1339
- ellipsoid: ellipsoid,
1340
- stRotation: rectangleGeometry._stRotation,
1341
- granularity: granularity,
1342
- extrudedHeight: maxHeight,
1343
- height: minHeight,
1344
- vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
1345
- shadowVolume: true,
1346
- });
1347
- };
1348
-
1349
- const unrotatedTextureRectangleScratch = new Matrix2.Rectangle();
1350
- const points2DScratch = [new Matrix2.Cartesian2(), new Matrix2.Cartesian2(), new Matrix2.Cartesian2()];
1351
- const rotation2DScratch = new Matrix2.Matrix2();
1352
- const rectangleCenterScratch = new Matrix3.Cartographic();
1353
-
1354
- function textureCoordinateRotationPoints(rectangleGeometry) {
1355
- if (rectangleGeometry._stRotation === 0.0) {
1356
- return [0, 0, 0, 1, 1, 0];
1357
- }
1358
-
1359
- const rectangle = Matrix2.Rectangle.clone(
1360
- rectangleGeometry._rectangle,
1361
- unrotatedTextureRectangleScratch
1362
- );
1363
- const granularity = rectangleGeometry._granularity;
1364
- const ellipsoid = rectangleGeometry._ellipsoid;
1365
-
1366
- // Rotate to align the texture coordinates with ENU
1367
- const rotation = rectangleGeometry._rotation - rectangleGeometry._stRotation;
1368
-
1369
- const unrotatedTextureRectangle = computeRectangle(
1370
- rectangle,
1371
- granularity,
1372
- rotation,
1373
- ellipsoid,
1374
- unrotatedTextureRectangleScratch
1375
- );
1376
-
1377
- // Assume a computed "east-north" texture coordinate system based on spherical or planar tricks, bounded by `boundingRectangle`.
1378
- // The "desired" texture coordinate system forms an oriented rectangle (un-oriented computed) around the geometry that completely and tightly bounds it.
1379
- // We want to map from the "east-north" texture coordinate system into the "desired" system using a pair of lines (analagous planes in 2D)
1380
- // Compute 3 corners of the "desired" texture coordinate system in "east-north" texture space by the following in cartographic space:
1381
- // - rotate 3 of the corners in unrotatedTextureRectangle by stRotation around the center of the bounding rectangle
1382
- // - apply the "east-north" system's normalization formula to the rotated cartographics, even though this is likely to produce values outside [0-1].
1383
- // This gives us a set of points in the "east-north" texture coordinate system that can be used to map "east-north" texture coordinates to "desired."
1384
-
1385
- const points2D = points2DScratch;
1386
- points2D[0].x = unrotatedTextureRectangle.west;
1387
- points2D[0].y = unrotatedTextureRectangle.south;
1388
-
1389
- points2D[1].x = unrotatedTextureRectangle.west;
1390
- points2D[1].y = unrotatedTextureRectangle.north;
1391
-
1392
- points2D[2].x = unrotatedTextureRectangle.east;
1393
- points2D[2].y = unrotatedTextureRectangle.south;
1394
-
1395
- const boundingRectangle = rectangleGeometry.rectangle;
1396
- const toDesiredInComputed = Matrix2.Matrix2.fromRotation(
1397
- rectangleGeometry._stRotation,
1398
- rotation2DScratch
1399
- );
1400
- const boundingRectangleCenter = Matrix2.Rectangle.center(
1401
- boundingRectangle,
1402
- rectangleCenterScratch
1403
- );
1404
-
1405
- for (let i = 0; i < 3; ++i) {
1406
- const point2D = points2D[i];
1407
- point2D.x -= boundingRectangleCenter.longitude;
1408
- point2D.y -= boundingRectangleCenter.latitude;
1409
- Matrix2.Matrix2.multiplyByVector(toDesiredInComputed, point2D, point2D);
1410
- point2D.x += boundingRectangleCenter.longitude;
1411
- point2D.y += boundingRectangleCenter.latitude;
1412
-
1413
- // Convert point into east-north texture coordinate space
1414
- point2D.x = (point2D.x - boundingRectangle.west) / boundingRectangle.width;
1415
- point2D.y =
1416
- (point2D.y - boundingRectangle.south) / boundingRectangle.height;
1248
+ textureCoordinateRotationPoints: {
1249
+ get: function() {
1250
+ if (!defined_default(this._textureCoordinateRotationPoints)) {
1251
+ this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(
1252
+ this
1253
+ );
1254
+ }
1255
+ return this._textureCoordinateRotationPoints;
1417
1256
  }
1418
-
1419
- const minXYCorner = points2D[0];
1420
- const maxYCorner = points2D[1];
1421
- const maxXCorner = points2D[2];
1422
- const result = new Array(6);
1423
- Matrix2.Cartesian2.pack(minXYCorner, result);
1424
- Matrix2.Cartesian2.pack(maxYCorner, result, 2);
1425
- Matrix2.Cartesian2.pack(maxXCorner, result, 4);
1426
- return result;
1427
1257
  }
1258
+ });
1259
+ var RectangleGeometry_default = RectangleGeometry;
1428
1260
 
1429
- Object.defineProperties(RectangleGeometry.prototype, {
1430
- /**
1431
- * @private
1432
- */
1433
- rectangle: {
1434
- get: function () {
1435
- if (!defaultValue.defined(this._rotatedRectangle)) {
1436
- this._rotatedRectangle = computeRectangle(
1437
- this._rectangle,
1438
- this._granularity,
1439
- this._rotation,
1440
- this._ellipsoid
1441
- );
1442
- }
1443
- return this._rotatedRectangle;
1444
- },
1445
- },
1446
- /**
1447
- * For remapping texture coordinates when rendering RectangleGeometries as GroundPrimitives.
1448
- * This version permits skew in textures by computing offsets directly in cartographic space and
1449
- * more accurately approximates rendering RectangleGeometries with height as standard Primitives.
1450
- * @see Geometry#_textureCoordinateRotationPoints
1451
- * @private
1452
- */
1453
- textureCoordinateRotationPoints: {
1454
- get: function () {
1455
- if (!defaultValue.defined(this._textureCoordinateRotationPoints)) {
1456
- this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(
1457
- this
1458
- );
1459
- }
1460
- return this._textureCoordinateRotationPoints;
1461
- },
1462
- },
1463
- });
1464
-
1465
- function createRectangleGeometry(rectangleGeometry, offset) {
1466
- if (defaultValue.defined(offset)) {
1467
- rectangleGeometry = RectangleGeometry.unpack(rectangleGeometry, offset);
1468
- }
1469
- rectangleGeometry._ellipsoid = Matrix3.Ellipsoid.clone(rectangleGeometry._ellipsoid);
1470
- rectangleGeometry._rectangle = Matrix2.Rectangle.clone(rectangleGeometry._rectangle);
1471
- return RectangleGeometry.createGeometry(rectangleGeometry);
1261
+ // packages/engine/Source/Workers/createRectangleGeometry.js
1262
+ function createRectangleGeometry(rectangleGeometry, offset) {
1263
+ if (defined_default(offset)) {
1264
+ rectangleGeometry = RectangleGeometry_default.unpack(rectangleGeometry, offset);
1472
1265
  }
1473
-
1474
- return createRectangleGeometry;
1475
-
1476
- }));
1266
+ rectangleGeometry._ellipsoid = Ellipsoid_default.clone(rectangleGeometry._ellipsoid);
1267
+ rectangleGeometry._rectangle = Rectangle_default.clone(rectangleGeometry._rectangle);
1268
+ return RectangleGeometry_default.createGeometry(rectangleGeometry);
1269
+ }
1270
+ var createRectangleGeometry_default = createRectangleGeometry;
1271
+ export {
1272
+ createRectangleGeometry_default as default
1273
+ };