@arcgis/core 5.2.0-next.113 → 5.2.0-next.115

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 (233) hide show
  1. package/Graphic.d.ts +5 -3
  2. package/Ground.d.ts +5 -4
  3. package/applications/Urban/LineImagePattern3D.js +1 -1
  4. package/arcgisGlobal.d.ts +2 -0
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/02f94f9d704f03ddb5c6.js +1 -0
  7. package/assets/esri/core/workers/chunks/{c517e732cab41093b2e0.js → 0312c40d94b248ad71e3.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0463c807b37f01bbc35c.js +1 -0
  9. package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +1 -0
  10. package/assets/esri/core/workers/chunks/2e0fd0536408053ac6f5.js +1 -0
  11. package/assets/esri/core/workers/chunks/{6b264006b96cbf93d8ed.js → 48d3da636be15581fd7d.js} +1 -1
  12. package/assets/esri/core/workers/chunks/515fe302743c0b46f7e0.js +1 -0
  13. package/assets/esri/core/workers/chunks/{982a396bd4fffa62e911.js → 526cc64ae46dec3fbeda.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{d13cf2e8b24e978ea77c.js → 7243d5721bb6a7329055.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{785206da3962ba23de16.js → 84b89c523d3e16a5ee46.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{484b3e2a220c440ccbb4.js → 9b92c41907e2da80c288.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{4d2553219ffd223b0e90.js → a774006be107e449bc29.js} +1 -1
  18. package/assets/esri/core/workers/chunks/b45ebb1b64ee7314375e.js +1 -0
  19. package/assets/esri/core/workers/chunks/{e0f417992889a6c41095.js → baa8bce361a2677533ec.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{96ebf76661b12128ddd5.js → be4de7111bc21bc69de1.js} +1 -1
  21. package/assets/esri/core/workers/chunks/f18ee2eaa96d103627a6.js +1 -0
  22. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ar.json +1 -1
  23. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.bg.json +1 -1
  24. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.bs.json +1 -1
  25. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ca.json +1 -1
  26. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.cs.json +1 -1
  27. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.da.json +1 -1
  28. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.de.json +1 -1
  29. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.el.json +1 -1
  30. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.es.json +1 -1
  31. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.et.json +1 -1
  32. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.fi.json +1 -1
  33. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.fr.json +1 -1
  34. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.he.json +1 -1
  35. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.hr.json +1 -1
  36. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.hu.json +1 -1
  37. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.id.json +1 -1
  38. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.it.json +1 -1
  39. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ja.json +1 -1
  40. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ko.json +1 -1
  41. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.lt.json +1 -1
  42. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.lv.json +1 -1
  43. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.nl.json +1 -1
  44. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.no.json +1 -1
  45. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.pl.json +1 -1
  46. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.pt-BR.json +1 -1
  47. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.pt-PT.json +1 -1
  48. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ro.json +1 -1
  49. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ru.json +1 -1
  50. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sk.json +1 -1
  51. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sl.json +1 -1
  52. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sr.json +1 -1
  53. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sv.json +1 -1
  54. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.th.json +1 -1
  55. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.tr.json +1 -1
  56. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.uk.json +1 -1
  57. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.vi.json +1 -1
  58. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.zh-CN.json +1 -1
  59. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.zh-HK.json +1 -1
  60. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.zh-TW.json +1 -1
  61. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/messages.ja.json +1 -1
  62. package/assets/esri/views/3d/environment/resources/milkyway-band.ktx2 +0 -0
  63. package/assets/esri/widgets/DistanceMeasurement2D/t9n/messages.de.json +1 -1
  64. package/assets/esri/widgets/DistanceMeasurement2D/t9n/messages.ro.json +1 -1
  65. package/assets/esri/widgets/Expand/t9n/messages.id.json +1 -1
  66. package/assets/esri/widgets/Features/t9n/messages.he.json +1 -1
  67. package/assets/esri/widgets/Features/t9n/messages.uk.json +1 -1
  68. package/assets/esri/widgets/Home/t9n/messages.bs.json +1 -1
  69. package/assets/esri/widgets/Home/t9n/messages.de.json +1 -1
  70. package/assets/esri/widgets/Home/t9n/messages.et.json +1 -1
  71. package/assets/esri/widgets/Home/t9n/messages.fi.json +1 -1
  72. package/assets/esri/widgets/Home/t9n/messages.hr.json +1 -1
  73. package/assets/esri/widgets/Home/t9n/messages.hu.json +1 -1
  74. package/assets/esri/widgets/Home/t9n/messages.id.json +1 -1
  75. package/assets/esri/widgets/Home/t9n/messages.lv.json +1 -1
  76. package/assets/esri/widgets/Home/t9n/messages.nl.json +1 -1
  77. package/assets/esri/widgets/Home/t9n/messages.pt-PT.json +1 -1
  78. package/assets/esri/widgets/Home/t9n/messages.th.json +1 -1
  79. package/assets/esri/widgets/Home/t9n/messages.tr.json +1 -1
  80. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.de.json +1 -1
  81. package/assets/esri/widgets/Print/t9n/messages.es.json +1 -1
  82. package/assets/esri/widgets/Print/t9n/messages.it.json +1 -1
  83. package/assets/esri/widgets/Print/t9n/messages.lt.json +1 -1
  84. package/assets/esri/widgets/Print/t9n/messages.pt-PT.json +1 -1
  85. package/assets/esri/widgets/Print/t9n/messages.sl.json +1 -1
  86. package/assets/esri/widgets/Print/t9n/messages.sr.json +1 -1
  87. package/assets/esri/widgets/Search/t9n/messages.bs.json +1 -1
  88. package/assets/esri/widgets/Search/t9n/messages.de.json +1 -1
  89. package/assets/esri/widgets/Search/t9n/messages.es.json +1 -1
  90. package/assets/esri/widgets/Search/t9n/messages.et.json +1 -1
  91. package/assets/esri/widgets/Search/t9n/messages.fi.json +1 -1
  92. package/assets/esri/widgets/Search/t9n/messages.he.json +1 -1
  93. package/assets/esri/widgets/Search/t9n/messages.hr.json +1 -1
  94. package/assets/esri/widgets/Search/t9n/messages.it.json +1 -1
  95. package/assets/esri/widgets/Search/t9n/messages.lv.json +1 -1
  96. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ar.json +1 -1
  97. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ca.json +1 -1
  98. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.cs.json +1 -1
  99. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.el.json +1 -1
  100. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.es.json +1 -1
  101. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.fi.json +1 -1
  102. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.he.json +1 -1
  103. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.it.json +1 -1
  104. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.lt.json +1 -1
  105. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.lv.json +1 -1
  106. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.pl.json +1 -1
  107. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ro.json +1 -1
  108. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ru.json +1 -1
  109. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.sl.json +1 -1
  110. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.uk.json +1 -1
  111. package/assets/esri/widgets/support/GridControls/t9n/messages.pt-BR.json +1 -1
  112. package/chunks/DeepSky.glsl.js +1 -1
  113. package/chunks/RibbonLine.glsl.js +63 -58
  114. package/config.js +1 -1
  115. package/core/Evented.d.ts +1 -1
  116. package/core/screenUtils.js +1 -1
  117. package/core/units.js +1 -1
  118. package/form/elements/AttachmentElement.d.ts +5 -5
  119. package/form/elements/inputs/attachments/AttachmentInput.d.ts +1 -1
  120. package/graphic/getGraphicOriginTitle.d.ts +10 -0
  121. package/graphic/getGraphicOriginTitle.js +2 -0
  122. package/kernel.js +1 -1
  123. package/layers/FeatureLayer.d.ts +2 -2
  124. package/layers/MapNotesLayer.js +1 -1
  125. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  126. package/layers/support/FeatureReductionBinning.d.ts +2 -2
  127. package/layers/support/FeatureReductionCluster.d.ts +2 -2
  128. package/layers/support/Field.js +1 -1
  129. package/layers/support/SubtypeSublayer.d.ts +1 -1
  130. package/layers/support/TimeSeriesInfo.d.ts +1 -1
  131. package/layers/support/featurePopupQueryUtils.js +1 -1
  132. package/layers/support/timeSeriesUtils.js +1 -1
  133. package/layers/support/types.d.ts +1 -1
  134. package/layers/types.d.ts +1 -2
  135. package/package.json +3 -3
  136. package/popup/FeatureContent.d.ts +7 -7
  137. package/portal/schemas/definitions.js +1 -1
  138. package/portal/types.d.ts +1 -1
  139. package/renderers/DotDensityRenderer.d.ts +2 -2
  140. package/rest/knowledgeGraph/ReplicaDefinition.d.ts +1 -1
  141. package/rest/knowledgeGraphService.d.ts +2 -2
  142. package/rest/support/OutDistance.d.ts +19 -18
  143. package/rest/support/Query.d.ts +49 -21
  144. package/rest/support/RelationshipQuery.d.ts +1 -1
  145. package/smartMapping/renderers/support/utils.js +1 -1
  146. package/support/revision.js +1 -1
  147. package/symbols/LineSymbol3D.js +1 -1
  148. package/symbols/cim/types.d.ts +32 -0
  149. package/symbols/patterns/LinePattern3D.js +1 -1
  150. package/symbols/patterns/LineStylePattern3D.js +1 -1
  151. package/symbols/patterns/LineTemplatePattern3D.js +1 -1
  152. package/symbols/patterns/utils.js +1 -1
  153. package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
  154. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  155. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  156. package/views/2d/support/clippingUtils.js +1 -1
  157. package/views/2d/support/hitTestUtils.js +1 -1
  158. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +1 -1
  159. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  160. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  161. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  162. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  163. package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
  164. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  165. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  166. package/views/3d/webgl-engine/effects/glow/BlurEmission.js +1 -1
  167. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  168. package/views/3d/webgl-engine/lib/AttributeView.js +2 -0
  169. package/views/3d/webgl-engine/lib/attributeViewUtils.js +2 -0
  170. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  171. package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
  172. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  173. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  174. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  175. package/views/BreakpointsOwner.d.ts +2 -2
  176. package/views/PopupView.d.ts +64 -2
  177. package/views/SceneView.js +1 -1
  178. package/views/SelectionManager.d.ts +24 -24
  179. package/views/View.js +1 -1
  180. package/views/View2D.js +1 -1
  181. package/views/interactive/support/types.d.ts +0 -1
  182. package/views/layers/FeatureLikeLayerView.js +1 -1
  183. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  184. package/views/support/DefaultsFromMap.js +1 -1
  185. package/widgets/Attachments/support/attachmentUtils.d.ts +8 -0
  186. package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +1 -0
  187. package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
  188. package/widgets/BasemapLayerList/BasemapLayerListVisibleElements.d.ts +5 -1
  189. package/widgets/BasemapLayerList/types.d.ts +15 -2
  190. package/widgets/BasemapLayerList.d.ts +1 -1
  191. package/widgets/BasemapLayerList.js +1 -1
  192. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  193. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  194. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +14 -0
  195. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  196. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  197. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +29 -2
  198. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  199. package/widgets/BatchAttributeForm/inputs/support/MultipleChoiceController.d.ts +1 -5
  200. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  201. package/widgets/BatchAttributeForm/inputs/types.d.ts +8 -1
  202. package/widgets/BatchAttributeForm.js +1 -1
  203. package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +2 -1
  204. package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
  205. package/widgets/CatalogLayerList/CatalogLayerListVisibleElements.d.ts +5 -1
  206. package/widgets/CatalogLayerList/types.d.ts +12 -1
  207. package/widgets/CatalogLayerList.d.ts +2 -1
  208. package/widgets/CatalogLayerList.js +1 -1
  209. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  210. package/widgets/Editor/EditorViewModel.d.ts +2 -2
  211. package/widgets/Editor.d.ts +2 -2
  212. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +6 -6
  213. package/widgets/FeatureTable/support/FeatureStore.d.ts +2 -2
  214. package/widgets/FeatureTable.d.ts +5 -5
  215. package/widgets/LayerList/LayerListVisibleElements.d.ts +4 -1
  216. package/widgets/LayerList.js +1 -1
  217. package/widgets/TableList/ListItem.d.ts +2 -0
  218. package/widgets/TableList/ListItemPanel.d.ts +4 -0
  219. package/widgets/TableList/TableListViewModel.d.ts +4 -0
  220. package/widgets/TableList/TableListViewModel.js +1 -1
  221. package/widgets/TableList/TableListVisibleElements.d.ts +6 -1
  222. package/widgets/TableList/types.d.ts +12 -1
  223. package/widgets/TableList.d.ts +3 -0
  224. package/widgets/TableList.js +1 -1
  225. package/widgets/support/SelectionList/SelectionListViewModel.d.ts +1 -1
  226. package/assets/esri/core/workers/chunks/078ed48eb055dd213ee6.js +0 -1
  227. package/assets/esri/core/workers/chunks/1004e77593dfa506cd5d.js +0 -1
  228. package/assets/esri/core/workers/chunks/510a190a6f0a60ae38c3.js +0 -1
  229. package/assets/esri/core/workers/chunks/cd0f5cd0fefe7f49e3d8.js +0 -1
  230. package/assets/esri/core/workers/chunks/e6fb7b93cf73b05b1079.js +0 -1
  231. package/assets/esri/core/workers/chunks/f86ea5cf4814b458d50b.js +0 -1
  232. package/assets/esri/core/workers/chunks/f9b29d2ce1cd31c0fce1.js +0 -1
  233. package/graphic/graphicOrigins.js +0 -2
@@ -9,7 +9,7 @@ import type { ScreenPoint } from "../../../core/types.js";
9
9
  * The ShadowCastAnalysisView3D is responsible for rendering a [ShadowCastAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/)
10
10
  * using custom visualizations. The [getDurationAtScreen()](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ShadowCastAnalysisView3D/#getDurationAtScreen) method
11
11
  * on the analysis view provides developers with the ability to obtain the specific shadow or sunlight duration at a
12
- * certain [point](https://developers.arcgis.com/javascript/latest/references/core/core/types/#ScreenPoint) on the screen or to [disable](#interactive) the tooltip attached to the cursor.
12
+ * certain [point](https://developers.arcgis.com/javascript/latest/references/core/core/types/#ScreenPoint) on the screen or to disable the tooltip attached to the cursor by setting [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ShadowCastAnalysisView3D/#interactive) to `false`.
13
13
  *
14
14
  * This analysis view controls the shadow or sunlight overlay produced by [ShadowCastAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/). It does
15
15
  * not control the scene's illumination. To change the scene lighting itself, use [SunLighting](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunLighting/).
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as i}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as o,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as l,initial as a}from"../../../../core/reactiveUtils.js";import{property as r,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{ViewshedInteractionVisuals as c}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as u}from"./ViewshedSnappingController.js";import{ViewshedSubTool as h}from"./ViewshedSubTool.js";import{findSubTool as v}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as b}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import T from"../../../interactive/options/InteractiveToolOptions.js";import{enterInputModeIfAvailable as m,makeTooltip as y}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as V}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";let w=class extends g{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._selectedManipulator=null,this._observerToolOptions=new T({tooltips:{enabled:!0}}),this._observerTooltipConnectionHandle=null,this._updatingHandles=new d}initialize(){const{snappingManager:e,view:t}=this;this._interactionVisuals=new c({view:t}),this._snappingController=new u({snappingManager:e,view:t}),this._initializeObserverTooltip(t);const o=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=i(()=>o,({viewshedComputedData:e})=>{const t=new h({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}}),this.addHandles([n(()=>this.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},l),this._updatingHandles.add(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(null==e)return;const{subTool:t,observer:i,target:o}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(o,!1)},a),this._updatingHandles.add(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),a),this._updatingHandles.add(()=>this.selectedViewshed,e=>{const t=this._selectedManipulator,i=this._selectedSubTool;this._connectObserverTooltip(i),null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.observerManipulator)},a)])}destroy(){this._selectManipulator(null),this._disconnectObserverTooltip(),o(this.subToolHandles),o(this._interactionVisuals),o(this._snappingController),o(this._observerTooltip),this._updatingHandles.destroy()}get updating(){return!!this._snappingController?.updating||this._updatingHandles.updating||this.subToolHandles.some(({subTool:e})=>e.updating)}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get cursor(){return null}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){const t=this._selectedSubTool,i=this.selectedViewshedComputedData;if(null==t||null==i)return void this._interactionVisuals?.setVisibility(!1);const o=t.moveInteractionState,s=e?o.grabbing:o.dragging,n=t.scaleOrientInteractionState,l=e?n.grabbing:n.dragging;if(!(this.analysisViewData.visible&&(s||l)))return void this._interactionVisuals?.setVisibility(!1);const a=s?i.elevationAlignedObserverRenderSpace:i.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:a,laserlineVisible:!0,verticalLineVisible:s,intersectsWorldUp:s})}createObserverMoveSnappingPipeline(e,t,i,o=!1){return this._snappingController.createObserverMoveSnappingPipeline(e,t,i,o)}onActivate(){this.updateInteractionVisualsVisibility()}onDeactivate(){this.updateInteractionVisualsVisibility()}onInputEvent(e){if(!this.destroyed&&!m(e,this._observerTooltip))switch(e.type){case"key-down":_.cancel===e.key?this._cancelKeyHandler(e):_.delete.includes(e.key)&&this._deleteKeyHandler(e);break;case"hold":this.updateInteractionVisualsVisibility(!0)}}_updateInteractionVisualsLocation(e,t){this._interactionVisuals?.updateLocation(e,t)}_initializeObserverTooltip(e){const t=this._observerToolOptions;this._observerTooltip=y(()=>({view:e,options:t.tooltips})),this._observerTooltipInfo=new V({toolOptions:t,viewType:e.type})}_connectObserverTooltip(e){if(this._disconnectObserverTooltip(),null==e)return void this._observerTooltip.clear();const t=e.observerManipulatedObject;this._observerTooltipConnectionHandle=b(this._observerTooltip,t,()=>({toolOptions:this._observerToolOptions,activeTooltipInfo:this._observerTooltipInfo,callbacks:{onBeforeUpdate:()=>this.updateInteractionVisualsVisibility(),onMoveStart:()=>{},onMove:()=>{},onMoveStop:()=>{},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}}}))}_disconnectObserverTooltip(){this._observerTooltipConnectionHandle=s(this._observerTooltipConnectionHandle)}_cancelKeyHandler(e){this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_deleteKeyHandler(e){const t=this.selectedViewshed;null!=t&&(this.analysis.viewsheds.remove(t),e.stopPropagation())}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return v(this.subToolHandles,e)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get test(){}};e([r({constructOnly:!0})],w.prototype,"analysis",void 0),e([r({constructOnly:!0})],w.prototype,"analysisViewData",void 0),e([r({constructOnly:!0})],w.prototype,"snappingManager",void 0),e([r({constructOnly:!0})],w.prototype,"view",void 0),e([r()],w.prototype,"subToolHandles",void 0),e([r()],w.prototype,"removeIncompleteOnCancel",void 0),e([r()],w.prototype,"automaticManipulatorSelection",void 0),e([r()],w.prototype,"multiTouchEnabled",void 0),e([r()],w.prototype,"_selectedManipulator",void 0),e([r()],w.prototype,"_interactionVisuals",void 0),e([r()],w.prototype,"_snappingController",void 0),e([r()],w.prototype,"_observerTooltip",void 0),e([r()],w.prototype,"_observerTooltipInfo",void 0),e([r()],w.prototype,"updating",null),e([r()],w.prototype,"grabbing",null),e([r()],w.prototype,"cursor",null),e([r()],w.prototype,"selectedViewshed",null),e([r()],w.prototype,"selectedViewshedComputedData",null),e([r()],w.prototype,"_selectedSubTool",null),w=e([p("esri.views.3d.analysis.Viewshed.ViewshedEditTool")],w);export{w as ViewshedEditTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as i}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as o,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as l,initial as a}from"../../../../core/reactiveUtils.js";import{property as r,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{ViewshedInteractionVisuals as c}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as u}from"./ViewshedSnappingController.js";import{ViewshedSubTool as h}from"./ViewshedSubTool.js";import{findSubTool as v}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as b}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import T from"../../../interactive/options/InteractiveToolOptions.js";import{enterInputModeIfAvailable as y,makeTooltip as m}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as V}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";let w=class extends g{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._selectedManipulator=null,this._observerToolOptions=new T({tooltips:{enabled:!0}}),this._observerTooltipConnectionHandle=null,this._updatingHandles=new d}initialize(){const{snappingManager:e,view:t}=this;this._interactionVisuals=new c({view:t}),this._snappingController=new u({snappingManager:e,view:t}),this._initializeObserverTooltip(t);const o=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=i(()=>o,({viewshedComputedData:e})=>{const t=new h({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}}),this.addHandles([n(()=>this.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},l),this._updatingHandles.add(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(null==e)return;const{subTool:t,observer:i,target:o}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(o,!1)},a),this._updatingHandles.add(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),a),this._updatingHandles.add(()=>this.selectedViewshed,e=>{const t=this._selectedManipulator,i=this._selectedSubTool;this._connectObserverTooltip(i),null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.observerManipulator)},a)])}destroy(){this._selectManipulator(null),this._disconnectObserverTooltip(),o(this.subToolHandles),o(this._interactionVisuals),o(this._snappingController),o(this._observerTooltip),this._updatingHandles.destroy()}get updating(){return!!this._snappingController?.updating||this._updatingHandles.updating||this.subToolHandles.some(({subTool:e})=>e.updating)}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get cursor(){return null}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){const t=this._selectedSubTool,i=this.selectedViewshedComputedData;if(null==t||null==i)return void this._interactionVisuals?.setVisibility(!1);const o=t.moveInteractionState,s=e?o.grabbing:o.dragging,n=t.scaleOrientInteractionState,l=e?n.grabbing:n.dragging;if(!(this.analysisViewData.visible&&(s||l)))return void this._interactionVisuals?.setVisibility(!1);const a=s?i.elevationAlignedObserverRenderSpace:i.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:a,laserlineVisible:!0,verticalLineVisible:s,intersectsWorldUp:s})}createObserverMoveSnappingPipeline(e,t,i,o=!1){return this._snappingController.createObserverMoveSnappingPipeline(e,t,i,o)}onActivate(){this.updateInteractionVisualsVisibility()}onDeactivate(){this.updateInteractionVisualsVisibility()}onInputEvent(e){if(!this.destroyed&&!y(e,this._observerTooltip))switch(e.type){case"key-down":_.cancel===e.key?this._cancelKeyHandler(e):_.delete.includes(e.key)&&this._deleteKeyHandler(e);break;case"hold":this.updateInteractionVisualsVisibility(!0)}}_updateInteractionVisualsLocation(e,t){this._interactionVisuals?.updateLocation(e,t)}_initializeObserverTooltip(e){const t=this._observerToolOptions;this._observerTooltip=m(()=>({view:e,options:t.tooltips})),this._observerTooltipInfo=new V({toolOptions:t,viewType:e.type})}_connectObserverTooltip(e){if(this._disconnectObserverTooltip(),null==e)return void this._observerTooltip.clear();const t=e.observerManipulatedObject;this._observerTooltipConnectionHandle=b(this._observerTooltip,t,()=>({toolOptions:this._observerToolOptions,activeTooltipInfo:this._observerTooltipInfo,callbacks:{onBeforeUpdate:()=>this.updateInteractionVisualsVisibility(),onMoveStart:()=>{},onMove:()=>{},onMoveStop:()=>{},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}}}))}_disconnectObserverTooltip(){this._observerTooltipConnectionHandle=s(this._observerTooltipConnectionHandle)}_cancelKeyHandler(e){this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_deleteKeyHandler(e){const t=this.selectedViewshed;null!=t&&(this.analysis.viewsheds.remove(t),e.stopPropagation())}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return v(this.subToolHandles,e)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get test(){}};e([r({constructOnly:!0})],w.prototype,"analysis",void 0),e([r({constructOnly:!0})],w.prototype,"analysisViewData",void 0),e([r({constructOnly:!0})],w.prototype,"intersector",void 0),e([r({constructOnly:!0})],w.prototype,"snappingManager",void 0),e([r({constructOnly:!0})],w.prototype,"view",void 0),e([r()],w.prototype,"subToolHandles",void 0),e([r()],w.prototype,"removeIncompleteOnCancel",void 0),e([r()],w.prototype,"automaticManipulatorSelection",void 0),e([r()],w.prototype,"multiTouchEnabled",void 0),e([r()],w.prototype,"_selectedManipulator",void 0),e([r()],w.prototype,"_interactionVisuals",void 0),e([r()],w.prototype,"_snappingController",void 0),e([r()],w.prototype,"_observerTooltip",void 0),e([r()],w.prototype,"_observerTooltipInfo",void 0),e([r()],w.prototype,"updating",null),e([r()],w.prototype,"grabbing",null),e([r()],w.prototype,"cursor",null),e([r()],w.prototype,"selectedViewshed",null),e([r()],w.prototype,"selectedViewshedComputedData",null),e([r()],w.prototype,"_selectedSubTool",null),w=e([p("esri.views.3d.analysis.Viewshed.ViewshedEditTool")],w);export{w as ViewshedEditTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import o from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as i,throwIfAborted as n,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as s,sync as r}from"../../../../core/reactiveUtils.js";import{property as l,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as p}from"../../../../support/elevationInfoUtils.js";import{createDrawTool as d,getFeatureReference as _}from"./placementUtils.js";import{detachToolFromView as v}from"./toolLifecycleUtils.js";import m from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as u}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as w}from"./viewshedToolUtils.js";import{vectorToRender as g}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as P}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as b}from"../../../input/InputManager.js";import{sketchKeys as f}from"../../../interactive/keybindings.js";import S from"../../../interactive/options/InteractiveToolOptions.js";const y="multiple",O=Symbol("hiddenManipulatorHandle");let T=class extends o{constructor(e){super(e),this.placementMode=y,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._toolOptions=new S({tooltips:{enabled:!1}}),this._observerScenePoint=h(),this._targetScenePoint=h(),this._mapPointVector=h()}initialize(){this.addHandles([this.view.on("key-down",e=>this._handleKeyDown(e),b.DEFAULT),s(()=>{const{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:null!=e&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{null==e||t||this.analysis.viewsheds.add(e)},r)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get creationState(){return this._get("creationState")}set creationState(e){this._set("creationState",e),this._toolOptions.tooltips.enabled="placing-observer"===e}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(i()),n(t);const{resolve:o,reject:s,promise:r}=Promise.withResolvers(),l=a(t,()=>this._cancelPlacementOperation());return this._placeOperation=new m({abortHandle:l,reject:s,resolve:o}),this.placementMode=e,this.observerPlacementElevationInfo=t?.elevationInfo,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),r}cancelPlaceOperation(){null==this.creationState&&null==this._placeOperation||(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return null!=this.creationState&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){null!=this.creationState&&(f.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):f.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&"multiple"===this.placementMode)return this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement();this._destroyDrawTool(),this._abortCreation()}_removeStaged(){const{stagedViewshed:e}=this;return this.stagedViewshed=null,!!e&&(this.analysis.viewsheds.remove(e),!0)}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,o,i){const n=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:i});this.analysis.viewsheds.add(n),this.stagedViewshed=n,this.creationState="placing-target",this._updateStagedViewshed(o),this.callbacks.setSelectedViewshed(null)}_onCancel(e){const t=this._removeStaged();return"placing-observer"===this.creationState?t&&"multiple"===this.placementMode?(this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement()):(this._destroyDrawTool(e),void this._abortCreation()):t?(this.creationState="placing-observer",this.callbacks.setSelectedViewshed(null),void("multiple"!==this.placementMode?(this._destroyDrawTool(e),this._abortCreation()):this._startPointPlacement())):(this._destroyDrawTool(e),void this._abortCreation())}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);const t=this.stagedViewshed;this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t)}_resolvePlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.resolve())}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){const t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState="placing-observer",this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);const{drawTool:e,intersector:t,renderer:o,snappingManager:i}=d({analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,toolOptions:this._toolOptions,elevationInfo:this._observerDrawToolElevationInfo,getSnapToSceneEnabled:()=>this._snapToSceneEnabled,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>"placing-observer"===this.creationState});this._drawTool=e,this._renderer=o;try{this.view.addAndActivateTool(e),e.begin([u({mode:this.placementMode,onObserverComplete:(e,o)=>this._onObserverMapPointComplete(t,i,e,o),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(n){this._destroyDrawTool(e),this._rejectPlaceOperation(n instanceof Error?n:new Error(String(n)))}}_onComplete(e){this._removeStaged(),this._resolvePlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t,o,i){const n=o.clone(),a=this._toScenePoint(o,this._targetScenePoint,this._observerDrawToolElevationInfo),s=_({intersector:e,snappingManager:t,screenPoint:i,view:this.view});this._renderer?.updatePlacementLocation(a),this._handleObserverPlacementComplete(n,a,s),this._setDrawToolElevationInfo(p)}_onTargetMapPointComplete(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t),"multiple"===this.placementMode&&(this.creationState="placing-observer",this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e))}_onObserverMapPointPreview(e){const t=e.clone(),o=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(o)}_onTargetMapPointPreview(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){const t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??p}get _snapToSceneEnabled(){const e=this.observerPlacementElevationInfo?.mode;return("placing-observer"!==this.creationState||null==e||"absolute-height"===e)&&null}_onManipulatorCountChange(e){e.removeHandles(O);const t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof P&&t.push(e.disableDisplay())}),e.addHandles(t,O)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&v(this.view,e)}_toScenePoint(e,t,o=p){const{x:i,y:n,z:a,spatialReference:s}=e,r=this._mapPointVector;return r[0]=i,r[1]=n,r[2]=a??0,g(r,s,o,this.view,t)}_updateStagedViewshed(e){const t=this.stagedViewshed;if(!t)return;const o=this.callbacks.findViewshedComputedData(t);if(!o)return;const{heading:i,tilt:n,farDistance:a}=w(this.view,o,e);t.farDistance=a,t.tilt=n,t.heading=i}get test(){}};e([l({constructOnly:!0})],T.prototype,"analysis",void 0),e([l({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([l({constructOnly:!0})],T.prototype,"snappingManager",void 0),e([l({constructOnly:!0})],T.prototype,"view",void 0),e([l({constructOnly:!0})],T.prototype,"callbacks",void 0),e([l()],T.prototype,"placementMode",void 0),e([l()],T.prototype,"observerPlacementElevationInfo",void 0),e([l()],T.prototype,"stagedViewshed",void 0),e([l()],T.prototype,"_placeOperation",void 0),e([l()],T.prototype,"_drawTool",void 0),e([l()],T.prototype,"_renderer",void 0),e([l()],T.prototype,"_toolOptions",void 0),e([l()],T.prototype,"updating",null),e([l()],T.prototype,"active",null),e([l({value:null})],T.prototype,"creationState",null),T=e([c("esri.views.3d.analysis.Viewshed.ViewshedPlacementController")],T);export{T as ViewshedPlacementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import o from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as i,throwIfAborted as n,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as s,sync as r}from"../../../../core/reactiveUtils.js";import{property as l,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as p}from"../../../../support/elevationInfoUtils.js";import{createDrawTool as d,getFeatureReference as _}from"./placementUtils.js";import{detachToolFromView as v}from"./toolLifecycleUtils.js";import m from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as u}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as w}from"./viewshedToolUtils.js";import{vectorToRender as g}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as P}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as b}from"../../../input/InputManager.js";import{sketchKeys as f}from"../../../interactive/keybindings.js";import y from"../../../interactive/options/InteractiveToolOptions.js";const S="multiple",O=Symbol("hiddenManipulatorHandle");let T=class extends o{constructor(e){super(e),this.placementMode=S,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._toolOptions=new y({tooltips:{enabled:!1}}),this._observerScenePoint=h(),this._targetScenePoint=h(),this._mapPointVector=h()}initialize(){this.addHandles([this.view.on("key-down",e=>this._handleKeyDown(e),b.DEFAULT),s(()=>{const{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:null!=e&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{null==e||t||this.analysis.viewsheds.add(e)},r)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get creationState(){return this._get("creationState")}set creationState(e){this._set("creationState",e),this._toolOptions.tooltips.enabled="placing-observer"===e}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(i()),n(t);const{resolve:o,reject:s,promise:r}=Promise.withResolvers(),l=a(t,()=>this._cancelPlacementOperation());return this._placeOperation=new m({abortHandle:l,reject:s,resolve:o}),this.placementMode=e,this.observerPlacementElevationInfo=t?.elevationInfo,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),r}cancelPlaceOperation(){null==this.creationState&&null==this._placeOperation||(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return null!=this.creationState&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){null!=this.creationState&&(f.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):f.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&"multiple"===this.placementMode)return this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement();this._destroyDrawTool(),this._abortCreation()}_removeStaged(){const{stagedViewshed:e}=this;return this.stagedViewshed=null,!!e&&(this.analysis.viewsheds.remove(e),!0)}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,o,i){const n=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:i});this.analysis.viewsheds.add(n),this.stagedViewshed=n,this.creationState="placing-target",this._updateStagedViewshed(o),this.callbacks.setSelectedViewshed(null)}_onCancel(e){const t=this._removeStaged();return"placing-observer"===this.creationState?t&&"multiple"===this.placementMode?(this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement()):(this._destroyDrawTool(e),void this._abortCreation()):t?(this.creationState="placing-observer",this.callbacks.setSelectedViewshed(null),void("multiple"!==this.placementMode?(this._destroyDrawTool(e),this._abortCreation()):this._startPointPlacement())):(this._destroyDrawTool(e),void this._abortCreation())}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);const t=this.stagedViewshed;this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t)}_resolvePlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.resolve())}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){const t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState="placing-observer",this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);const{drawTool:e,renderer:t}=d({analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,toolOptions:this._toolOptions,elevationInfo:this._observerDrawToolElevationInfo,getSnapToSceneEnabled:()=>this._snapToSceneEnabled,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>"placing-observer"===this.creationState});this._drawTool=e,this._renderer=t;try{this.view.addAndActivateTool(e),e.begin([u({mode:this.placementMode,onObserverComplete:(e,t)=>this._onObserverMapPointComplete(e,t),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(o){this._destroyDrawTool(e),this._rejectPlaceOperation(o instanceof Error?o:new Error(String(o)))}}_onComplete(e){this._removeStaged(),this._resolvePlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t){const{intersector:o,snappingManager:i,view:n}=this,a=e.clone(),s=this._toScenePoint(e,this._targetScenePoint,this._observerDrawToolElevationInfo),r=_({intersector:o,snappingManager:i,screenPoint:t,view:n});this._renderer?.updatePlacementLocation(s),this._handleObserverPlacementComplete(a,s,r),this._setDrawToolElevationInfo(p)}_onTargetMapPointComplete(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t),"multiple"===this.placementMode&&(this.creationState="placing-observer",this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e))}_onObserverMapPointPreview(e){const t=e.clone(),o=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(o)}_onTargetMapPointPreview(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){const t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??p}get _snapToSceneEnabled(){const e=this.observerPlacementElevationInfo?.mode;return("placing-observer"!==this.creationState||null==e||"absolute-height"===e)&&null}_onManipulatorCountChange(e){e.removeHandles(O);const t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof P&&t.push(e.disableDisplay())}),e.addHandles(t,O)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&v(this.view,e)}_toScenePoint(e,t,o=p){const{x:i,y:n,z:a,spatialReference:s}=e,r=this._mapPointVector;return r[0]=i,r[1]=n,r[2]=a??0,g(r,s,o,this.view,t)}_updateStagedViewshed(e){const t=this.stagedViewshed;if(!t)return;const o=this.callbacks.findViewshedComputedData(t);if(!o)return;const{heading:i,tilt:n,farDistance:a}=w(this.view,o,e);t.farDistance=a,t.tilt=n,t.heading=i}get test(){}};e([l({constructOnly:!0})],T.prototype,"analysis",void 0),e([l({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([l({constructOnly:!0})],T.prototype,"intersector",void 0),e([l({constructOnly:!0})],T.prototype,"snappingManager",void 0),e([l({constructOnly:!0})],T.prototype,"view",void 0),e([l({constructOnly:!0})],T.prototype,"callbacks",void 0),e([l()],T.prototype,"placementMode",void 0),e([l()],T.prototype,"observerPlacementElevationInfo",void 0),e([l()],T.prototype,"stagedViewshed",void 0),e([l()],T.prototype,"_placeOperation",void 0),e([l()],T.prototype,"_drawTool",void 0),e([l()],T.prototype,"_renderer",void 0),e([l()],T.prototype,"_toolOptions",void 0),e([l()],T.prototype,"updating",null),e([l()],T.prototype,"active",null),e([l({value:null})],T.prototype,"creationState",null),T=e([c("esri.views.3d.analysis.Viewshed.ViewshedPlacementController")],T);export{T as ViewshedPlacementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as a,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as r}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as p,initial as d}from"../../../../core/reactiveUtils.js";import{property as u,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{sub as c,len as v,dot as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as M}from"../../../../core/support/UpdatingHandles.js";import{viewshedToolManipulatorConfiguration as m}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as _,isSideHorizontal as f,flipSide as w}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as O}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as V}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as D}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as j}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as S}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as x,resetManipulatedObject as C,sceneSnappingAtLocation as T,dragManipulatedObject as A,sceneSnappingAtProjectedLocation as F,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const H=Symbol("dragHandles");let z=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new M,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new _({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new V({view:this.view,tool:this.parentTool}),this._observerManipulator=new D(this.view,this.parentTool),this._observerManipulatedObject=new O({view:this.view,subTool:this}),this.addHandles([s(()=>this.elevationAlignedObserverRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},p),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},d),this._updatingHandles.add(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:i,operations:a},n)=>{this._grabbing&&i!==n?.observer||(this.removeHandles(H),e?.valid&&null!=a&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),H))},d),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},d),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},d),this._updatingHandles.add(()=>{const{viewshedComputedData:e,analysisViewData:i}=this,t=i.visible&&(e?.valid??!1),a=i.selectedViewshed===e?.viewshed,n=t&&a,r=e?.effectiveElevationInfo.mode;return{controlsAvailable:n,selected:a,visibleAndValid:t,zManipulationAvailable:n&&"on-the-ground"!==r}},({controlsAvailable:e,selected:i,visibleAndValid:t,zManipulationAvailable:a})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=a,this._scaleOrientManipulation.available=e,this._observerManipulator.available=t,this._observerManipulator.collisionPriority=i?2:0,this._fieldOfViewManipulation.available=e},d),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},d)]);const e=e=>{this.addHandles([e.events.on("grab-changed",i=>{this._grabbing="start"===i.action,"end"===i.action&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(i=>i===e||!this._grabbing)}),e.events.on("drag",e=>{"start"===e.action&&this.parentTool.updateInteractionVisualsVisibility()})])};this._forEachManipulator(e)}destroy(){this._observerManipulatedObject=l(this._observerManipulatedObject),this._moveManipulation=l(this._moveManipulation),this._fieldOfViewManipulation=l(this._fieldOfViewManipulation),this._scaleOrientManipulation=l(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=l(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){const{dragging:e,grabbing:i}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:i||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){const{dragging:e,grabbing:i}=this._scaleOrientManipulation;return{dragging:e,grabbing:i}}_setInteractive(e){const i="boolean"==typeof e;this._observerManipulator.interactive=i?e:e(this._observerManipulator),this._forEachManipulation(t=>{t.interactive=i?e:t.someManipulator(e)})}onManipulatorSelectionChanged(){if(!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}}hasManipulator(e){let i=!1;return this._forEachManipulator(t=>{i=i||t===e}),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new S({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:j})}_buildObserverManipulatorDragPipeline(e){const{effectiveElevationInfo:i}=e,t=this._observerManipulatedObject,a=t.operations;if(null==a)return null;const n=a.data.spatialReference;return x(this._observerManipulator,(e,r,o,l)=>{const s=a.data.geometry;if("point"!==s.type)return;o=o.next(C(t));const p=this.parentTool.createObserverMoveSnappingPipeline(0,l,i,!0);let d=r.next(y(this.view,s,i,n)).next(T(this.view,i));if(null!=p){const{snappingStep:e,cancelSnapping:i}=p;o.next(i),d=d.next(...e)}d.next(A(t))})}_buildMoveManipulationDragPipeline(e){const{effectiveElevationInfo:i}=e,t=this._observerManipulatedObject,a=t.operations;return null==a?null:this._moveManipulation.createDragPipeline((e,a,n,r,o)=>{r=r.next(C(t));const l=this.parentTool.createObserverMoveSnappingPipeline(e,o,i);if(null!=l){const{snappingStep:e,cancelSnapping:a}=l;return r=r.next(a),{steps:n=n.next(F(this.view,i)).next(...e).next(A(t)),cancel:r}}return{steps:n=n.next(A(t)),cancel:r}},i,a.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((n,r,o)=>{if(null==e)return{steps:r,cancel:o};const l=e.viewshed;let s=null;o=o.next(P(l,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:r.next(n=>{"start"===n.action&&(s=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const r=n.deltaAngle;if(null==s&&0!==r){const e="bottom"===n.side||"left"===n.side?r>0:r<0;s=f(n.side)?0===i&&e||360===i&&!e:0===t&&e}const o=s?w(n.side):n.side;let p=0;switch(o){case"left":p=i/2-r;break;case"right":p=i/2+r;break;case"top":p=t+2*r;break;case"bottom":p=t-2*r}return f(o)?(p=a.normalize(p),p=p>270?0:p>180?180:p,l.horizontalFieldOfView=2*p):l.verticalFieldOfView=p,n}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const n=(i,t)=>(a,n,r)=>{if(null==e)return{steps:n,cancel:r};const o=e.viewshed;return r=r.next(P(o,[i])),{steps:n=n.next(t(o,e)),cancel:r}};return r([this._scaleOrientManipulation.createHeadingDragPipeline(n("heading",(i,n)=>n=>("start"===n.action&&(t=e.heading),i.heading=a.normalize(t+n.deltaAngle),n)),e),this._scaleOrientManipulation.createTiltDragPipeline(n("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let n=i+a.deltaAngle;return n<-90?n=180:n>270&&(n=0),t.tilt=I.clamp(n),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(n("farDistance",(e,i)=>t=>{const a=c(E,t.renderEnd,i.elevationAlignedObserverRenderSpace),n=v(a)*i.metersPerUnit,r=b(a,i.targetDirection)<0?m.scaleOrientMinDistance:n;return e.farDistance=r,t}),e)])}_forEachManipulator(e){this._forEachManipulation(i=>{i.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([u({constructOnly:!0})],z.prototype,"analysis",void 0),e([u({constructOnly:!0})],z.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],z.prototype,"parentTool",void 0),e([u({constructOnly:!0,nonNullable:!0})],z.prototype,"view",void 0),e([u()],z.prototype,"updating",null),e([u()],z.prototype,"viewshed",null),e([u()],z.prototype,"_grabbing",void 0),e([u()],z.prototype,"grabbing",null),e([u()],z.prototype,"viewshedComputedData",void 0),e([u()],z.prototype,"observer",null),e([u()],z.prototype,"elevationAlignedObserverRenderSpace",null),z=e([h("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],z);const E=g(),I=new n(0,180);export{z as ViewshedSubTool};
2
+ import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as a,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as r}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as l,syncAndInitial as p,initial as d}from"../../../../core/reactiveUtils.js";import{property as u,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{sub as h,len as v,dot as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as M}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as m}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as f}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as _,isSideHorizontal as w,flipSide as O}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as V}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as D}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as y}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as j}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as x}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as S}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as C,resetManipulatedObject as T,sceneSnappingAtLocation as A,dragManipulatedObject as F,sceneSnappingAtProjectedLocation as P,resetProperties as H}from"../../../interactive/dragEventPipeline.js";const E=Symbol("dragHandles");let z=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new M,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new _({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new D({view:this.view,tool:this.parentTool}),this._observerManipulator=new y(this.view,this.parentTool),this._observerManipulatedObject=new V({view:this.view,subTool:this}),this.addHandles([l(()=>this.elevationAlignedObserverRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},p),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},d),this._updatingHandles.add(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:i,operations:a},n)=>{this._grabbing&&i!==n?.observer||(this.removeHandles(E),e?.valid&&null!=a&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),E))},d),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},d),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},d),this._updatingHandles.add(()=>{const{viewshedComputedData:e,analysisViewData:i}=this,t=i.visible&&(e?.valid??!1),a=i.selectedViewshed===e?.viewshed,n=t&&a,r=e?.effectiveElevationInfo.mode;return{controlsAvailable:n,selected:a,visibleAndValid:t,zManipulationAvailable:n&&"on-the-ground"!==r}},({controlsAvailable:e,selected:i,visibleAndValid:t,zManipulationAvailable:a})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=a,this._scaleOrientManipulation.available=e,this._observerManipulator.available=t,this._observerManipulator.collisionPriority=i?2:0,this._fieldOfViewManipulation.available=e},d),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},d)]);const e=e=>{this.addHandles([e.events.on("grab-changed",i=>{this._grabbing="start"===i.action,"end"===i.action&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(i=>i===e||!this._grabbing)}),e.events.on("drag",e=>{"start"===e.action&&this.parentTool.updateInteractionVisualsVisibility()})])};this._forEachManipulator(e)}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){const{dragging:e,grabbing:i}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:i||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){const{dragging:e,grabbing:i}=this._scaleOrientManipulation;return{dragging:e,grabbing:i}}_setInteractive(e){const i="boolean"==typeof e;this._observerManipulator.interactive=i?e:e(this._observerManipulator),this._forEachManipulation(t=>{t.interactive=i?e:t.someManipulator(e)})}onManipulatorSelectionChanged(){if(!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}}hasManipulator(e){let i=!1;return this._forEachManipulator(t=>{i=i||t===e}),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new S({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:x})}_buildObserverManipulatorDragPipeline(e){const{effectiveElevationInfo:i,viewshed:t}=e,a=this._observerManipulatedObject,n=a.operations;if(null==n)return null;const r=n.data.spatialReference;return C(this._observerManipulator,(e,o,s,l)=>{const{parentTool:p,view:d}=this,{intersector:u,snappingManager:c}=p,{geometry:h}=n.data;if("point"!==h.type)return;const v=t.feature,b=T(a);s=s.next(e=>(t.feature=v,b(e)));const g=p.createObserverMoveSnappingPipeline(0,l,i,!0);let M=o.next(j(d,h,i,r)).next(A(d,i));if(null!=g){const{snappingStep:e,cancelSnapping:i}=g;s.next(i),M=M.next(...e)}M.next(e=>(t.feature=m({intersector:u,snappingManager:c,screenPoint:e.screenEnd,view:d}),e)).next(F(a))})}_buildMoveManipulationDragPipeline(e){const{effectiveElevationInfo:i}=e,t=this._observerManipulatedObject,a=t.operations;return null==a?null:this._moveManipulation.createDragPipeline((e,a,n,r,o)=>{r=r.next(T(t));const s=this.parentTool.createObserverMoveSnappingPipeline(e,o,i);if(null!=s){const{snappingStep:e,cancelSnapping:a}=s;return r=r.next(a),{steps:n=n.next(P(this.view,i)).next(...e).next(F(t)),cancel:r}}return{steps:n=n.next(F(t)),cancel:r}},i,a.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((n,r,o)=>{if(null==e)return{steps:r,cancel:o};const s=e.viewshed;let l=null;o=o.next(H(s,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:r.next(n=>{"start"===n.action&&(l=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const r=n.deltaAngle;if(null==l&&0!==r){const e="bottom"===n.side||"left"===n.side?r>0:r<0;l=w(n.side)?0===i&&e||360===i&&!e:0===t&&e}const o=l?O(n.side):n.side;let p=0;switch(o){case"left":p=i/2-r;break;case"right":p=i/2+r;break;case"top":p=t+2*r;break;case"bottom":p=t-2*r}return w(o)?(p=a.normalize(p),p=p>270?0:p>180?180:p,s.horizontalFieldOfView=2*p):s.verticalFieldOfView=p,n}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const n=(i,t)=>(a,n,r)=>{if(null==e)return{steps:n,cancel:r};const o=e.viewshed;return r=r.next(H(o,[i])),{steps:n=n.next(t(o,e)),cancel:r}};return r([this._scaleOrientManipulation.createHeadingDragPipeline(n("heading",(i,n)=>n=>("start"===n.action&&(t=e.heading),i.heading=a.normalize(t+n.deltaAngle),n)),e),this._scaleOrientManipulation.createTiltDragPipeline(n("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let n=i+a.deltaAngle;return n<-90?n=180:n>270&&(n=0),t.tilt=R.clamp(n),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(n("farDistance",(e,i)=>t=>{const a=h(I,t.renderEnd,i.elevationAlignedObserverRenderSpace),n=v(a)*i.metersPerUnit,r=b(a,i.targetDirection)<0?f.scaleOrientMinDistance:n;return e.farDistance=r,t}),e)])}_forEachManipulator(e){this._forEachManipulation(i=>{i.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([u({constructOnly:!0})],z.prototype,"analysis",void 0),e([u({constructOnly:!0})],z.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],z.prototype,"parentTool",void 0),e([u({constructOnly:!0,nonNullable:!0})],z.prototype,"view",void 0),e([u()],z.prototype,"updating",null),e([u()],z.prototype,"viewshed",null),e([u()],z.prototype,"_grabbing",void 0),e([u()],z.prototype,"grabbing",null),e([u()],z.prototype,"viewshedComputedData",void 0),e([u()],z.prototype,"observer",null),e([u()],z.prototype,"elevationAlignedObserverRenderSpace",null),z=e([c("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],z);const I=g(),R=new n(0,180);export{z as ViewshedSubTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as r}from"./toolLifecycleUtils.js";import{ViewshedEditTool as p}from"./ViewshedEditTool.js";import{ViewshedPlacementController as d}from"./ViewshedPlacementController.js";import{acquire as c}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as h}from"../../../interactive/snapping/snappingUtils.js";let g=class extends e{constructor(t){super(t),this._editTool=null,this._updatingHandles=new l}initialize(){const{view:t}=this;this._snappingManagerResult=c(t),this.addHandles(this._snappingManagerResult),this._placementController=new d({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this._snappingManager,view:t,callbacks:{cancelTool:()=>{null!=t.activeTool&&(t.activeTool=null)},findViewshedComputedData:t=>this._findViewshedComputedData(t),isToolDestroyed:()=>this.destroyed,setSelectedViewshed:t=>{this.analysisViewData.selectedViewshed=t}}}),h(this),this.addHandles([s(()=>({creationState:this._placementController.creationState,interactive:this.analysisViewData.interactive}),({creationState:e,interactive:i})=>{if(!i)return this._placementController.cancelPlaceOperation(),void this._destroyEditTool();null==e?this._editTool||(this._editTool=new p({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this._snappingManager,view:t}),t.tools.add(this._editTool)):this._destroyEditTool()},a),this._updatingHandles.add(()=>t.activeTool,t=>{null!=t&&t!==this._editTool&&null==this._placementController.creationState&&(this.analysisViewData.selectedViewshed=null)})])}destroy(){this._destroyEditTool(),i(this._placementController),this._updatingHandles.destroy()}get selectedViewshedComputedData(){return this._editTool?.selectedViewshedComputedData}get stagedViewshed(){return this._placementController.stagedViewshed}get active(){return this._placementController.active||(this._editTool?.active??!1)}get updating(){return this._updatingHandles.updating||this._placementController.updating||!!this._editTool?.updating}get creating(){return null!=this._placementController.creationState}get snappingOptions(){return this._snappingManager.options}set snappingOptions(t){this._snappingManager.options=t}get _snappingManager(){return this._snappingManagerResult.snappingManager}async place(t,e){if(this.analysisViewData.interactive=!0,this._destroyEditTool(),await this._placementController.startPlaceOperation(t,e),"single"===t)return{}}_findViewshedComputedData(t){return this.analysisViewData.viewshedComputedDataHandles?.find(e=>e.viewshedComputedData.viewshed===t)?.viewshedComputedData}_destroyEditTool(){const t=this._editTool;this._editTool=null,null!=t&&(r(this.view,t),i(t))}get test(){}};t([o({constructOnly:!0})],g.prototype,"view",void 0),t([o({constructOnly:!0})],g.prototype,"analysis",void 0),t([o({constructOnly:!0})],g.prototype,"analysisViewData",void 0),t([o()],g.prototype,"_placementController",void 0),t([o()],g.prototype,"_editTool",void 0),t([o()],g.prototype,"_snappingManagerResult",void 0),t([o()],g.prototype,"selectedViewshedComputedData",null),t([o()],g.prototype,"stagedViewshed",null),t([o()],g.prototype,"active",null),t([o()],g.prototype,"updating",null),t([o()],g.prototype,"creating",null),t([o()],g.prototype,"snappingOptions",null),g=t([n("esri.views.3d.analysis.Viewshed.ViewshedTool")],g);const u=g;export{u as default};
2
+ import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as r}from"./toolLifecycleUtils.js";import{ViewshedEditTool as p}from"./ViewshedEditTool.js";import{ViewshedPlacementController as d}from"./ViewshedPlacementController.js";import{newToolIntersector as c}from"../../../interactive/ToolIntersector.js";import{acquire as h}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";let u=class extends e{constructor(t){super(t),this._editTool=null,this._updatingHandles=new l}initialize(){const{view:t}=this,e=c(t.state.viewingMode);this._snappingManagerResult=h(t),this.addHandles(this._snappingManagerResult),this._placementController=new d({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:e,snappingManager:this._snappingManager,view:t,callbacks:{cancelTool:()=>{null!=t.activeTool&&(t.activeTool=null)},findViewshedComputedData:t=>this._findViewshedComputedData(t),isToolDestroyed:()=>this.destroyed,setSelectedViewshed:t=>{this.analysisViewData.selectedViewshed=t}}}),g(this),this.addHandles([s(()=>({creationState:this._placementController.creationState,interactive:this.analysisViewData.interactive}),({creationState:i,interactive:s})=>{if(!s)return this._placementController.cancelPlaceOperation(),void this._destroyEditTool();null==i?this._editTool||(this._editTool=new p({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:e,snappingManager:this._snappingManager,view:t}),t.tools.add(this._editTool)):this._destroyEditTool()},a),this._updatingHandles.add(()=>t.activeTool,t=>{null!=t&&t!==this._editTool&&null==this._placementController.creationState&&(this.analysisViewData.selectedViewshed=null)})])}destroy(){this._destroyEditTool(),i(this._placementController),this._updatingHandles.destroy()}get selectedViewshedComputedData(){return this._editTool?.selectedViewshedComputedData}get stagedViewshed(){return this._placementController.stagedViewshed}get active(){return this._placementController.active||(this._editTool?.active??!1)}get updating(){return this._updatingHandles.updating||this._placementController.updating||!!this._editTool?.updating}get creating(){return null!=this._placementController.creationState}get snappingOptions(){return this._snappingManager.options}set snappingOptions(t){this._snappingManager.options=t}get _snappingManager(){return this._snappingManagerResult.snappingManager}async place(t,e){if(this.analysisViewData.interactive=!0,this._destroyEditTool(),await this._placementController.startPlaceOperation(t,e),"single"===t)return{}}_findViewshedComputedData(t){return this.analysisViewData.viewshedComputedDataHandles?.find(e=>e.viewshedComputedData.viewshed===t)?.viewshedComputedData}_destroyEditTool(){const t=this._editTool;this._editTool=null,null!=t&&(r(this.view,t),i(t))}get test(){}};t([o({constructOnly:!0})],u.prototype,"view",void 0),t([o({constructOnly:!0})],u.prototype,"analysis",void 0),t([o({constructOnly:!0})],u.prototype,"analysisViewData",void 0),t([o()],u.prototype,"_placementController",void 0),t([o()],u.prototype,"_editTool",void 0),t([o()],u.prototype,"_snappingManagerResult",void 0),t([o()],u.prototype,"selectedViewshedComputedData",null),t([o()],u.prototype,"stagedViewshed",null),t([o()],u.prototype,"active",null),t([o()],u.prototype,"updating",null),t([o()],u.prototype,"creating",null),t([o()],u.prototype,"snappingOptions",null),u=t([n("esri.views.3d.analysis.Viewshed.ViewshedTool")],u);const m=u;export{m as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,syncAndInitial as r,sync as o,initial as t}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{ViewshedDrawToolRenderer as a}from"./ViewshedDrawToolRenderer.js";import{isValidIntersectorResult as s}from"../../webgl-engine/lib/IntersectorResult.js";import{toGraphic as l}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{DrawTool as c}from"../../../draw/DrawTool.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";function p(i){const{analysisViewData:s,snappingManager:l,view:p,toolOptions:u,elevationInfo:b,getSnapToSceneEnabled:g,onCancel:m,onComplete:j,onManipulatorCountChange:f,isPlacingObserver:w}=i,v=new a({view:p,isPlacingObserver:w}),I=d(p.state.viewingMode),M=new c({elevationInfo:b,enableVertexVisuals:!1,hasZ:!0,renderer:v,toolOptions:u,snappingManager:l,view:p});return M.addHandles([e(v),M.on("cancel",()=>m(M)),M.on("complete",()=>j(M)),n(()=>[M.surfaceManager,g()],([e,n])=>{e&&(e.snapToSceneEnabled=n)},r),n(()=>M.manipulators.length,()=>f(M),o),n(()=>s.visible,e=>v.analysisVisible=e,t)]),{drawTool:M,intersector:I,renderer:v,snappingManager:l}}function u({intersector:e,snappingManager:n,screenPoint:r,view:o}){const t=n.getMainFeatureCandidate();return t?g(t):r?b(r,o,e):null}function b(e,n,r){n.sceneIntersectionHelper.intersectToolIntersectorScreen(i(e.x,e.y),r);const o=r.results.min;return s(o)?l(o,n):null}function g(e){const n={id:e.layer.id,objectIdField:"objectIdField"in e.layer?e.layer.objectIdField:void 0};return{attributes:{[n.objectIdField??"ObjectId"]:e.objectId},layer:n,objectId:e.objectId,uid:null}}export{p as createDrawTool,u as getFeatureReference};
2
+ import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,syncAndInitial as r,sync as o,initial as t}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{ViewshedDrawToolRenderer as a}from"./ViewshedDrawToolRenderer.js";import{isValidIntersectorResult as s}from"../../webgl-engine/lib/IntersectorResult.js";import{toGraphic as l}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{DrawTool as c}from"../../../draw/DrawTool.js";function d(i){const{analysisViewData:s,snappingManager:l,view:d,toolOptions:p,elevationInfo:u,getSnapToSceneEnabled:b,onCancel:m,onComplete:g,onManipulatorCountChange:j,isPlacingObserver:f}=i,w=new a({view:d,isPlacingObserver:f}),I=new c({elevationInfo:u,enableVertexVisuals:!1,hasZ:!0,renderer:w,toolOptions:p,snappingManager:l,view:d});return I.addHandles([e(w),I.on("cancel",()=>m(I)),I.on("complete",()=>g(I)),n(()=>[I.surfaceManager,b()],([e,n])=>{e&&(e.snapToSceneEnabled=n)},r),n(()=>I.manipulators.length,()=>j(I),o),n(()=>s.visible,e=>w.analysisVisible=e,t)]),{drawTool:I,renderer:w}}function p({intersector:e,snappingManager:n,screenPoint:r,view:o}){const t=n.getMainFeatureCandidate();return t?b(t):r?u(r,o,e):null}function u(e,n,r){n.sceneIntersectionHelper.intersectToolIntersectorScreen(i(e.x,e.y),r);const o=r.results.min;return s(o)?l(o,n):null}function b(e){const n={id:e.layer.id,objectIdField:"objectIdField"in e.layer?e.layer.objectIdField:void 0};return{attributes:{[n.objectIdField??"ObjectId"]:e.objectId},layer:n,objectId:e.objectId,uid:null}}export{d as createDrawTool,p as getFeatureReference};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{px2pt as t,pt2px as r}from"../../../../core/screenUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as s,clone as o,ones as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as n,fromBuffer as c,intersectsClippingArea as h,empty as p,expandWithAABB as m,expandWithBuffer as d}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as u}from"../../../../renderers/support/renderingInfoUtils.js";import{sharedGeometryElevationAligner as _}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as y,needsElevationUpdates2D as f}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as g}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as b}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as v,nanFallbackColor as C}from"./Graphics3DSymbolLayer.js";import{parseCapType as P,computeSymbolLayerIndex as S,parseLineMarkerStyle as k}from"./lineUtils.js";import{initFastSymbolUpdatesState as w,updateFastSymbolUpdatesState as M,getAttributeValue as z,getSizeAttributeValue as L,ConvertOptions as O}from"../support/FastSymbolUpdates.js";import{debugFlags as x}from"../../support/debugFlags.js";import{createGeometry as U}from"../../support/engineContent/line.js";import{geometryToRenderInfo as E,geometryToRenderInfoDraped as V}from"../../support/renderInfoUtils/line.js";import{Object3D as j}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as A}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as D}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as F,patternHidesLine as G}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as I}from"../../webgl-engine/materials/RibbonLineMaterial.js";const R=["polyline"];class W extends v{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,T(t))}async doLoad(){this._fastUpdates=w(this._context.renderer,this._fastVisualVariableConvertOptions());const r=!0;if(this._fastMarkerUpdates=w(this._context.renderer,this._fastVisualVariableConvertOptions(r)),!this._drivenProperties.size){if((null!=this.symbolLayer.size?this.symbolLayer.size:t(1))<0)throw new e("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values")}}_getMaterialParameters(e,t){const r=this._screenSizePerspective,i=!!has("enable-feature:emissive-on-non-volumetric")&&!this.draped,{symbolLayer:a}=this,s=this._worldSizedEnabled,o={...this._getMaterialColorParameters(t),shadingEnabled:i,width:this._computeMaterialWidth(a?.size,s),worldSized:s,polygonOffset:3,polygonOffsetIndex:S(this._renderPriority,this._renderPriorityStep),join:a.join||"miter",cap:P(a.cap||"butt"),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:F(a.pattern??a.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:r};return 4===t&&this._fastMarkerUpdates?.visualVariables?{...o,...this._fastMarkerUpdates.materialParameters}:this._fastUpdates?.visualVariables?{...o,...this._fastUpdates.materialParameters}:o}_getMaterialColorParameters(e){const t=4===e,r=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(r[3]=0),{color:r}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){const e=this.symbolLayer.material?.emissive;return("color"===e?.source?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return null==this._materials[0]&&(this._materials[0]=new I(this._getMaterialParameters(!1,0),this.view.state.isGlobal)),this._materials[0]}get _wireframeLineMaterial(){return null==this._materials[2]&&(this._materials[2]=new I({...this._getMaterialParameters(!1,2),wireframe:!0},this.view.state.isGlobal)),this._materials[2]}get _markerMaterial(){return null==this._materials[4]&&null!=this.symbolLayer.marker&&(this._materials[4]=new D({...this._getMaterialParameters(!1,4),placement:this.symbolLayer.marker.placement,markerPrimitive:k(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[4]}_getDrivenSize(e){if(this._drivenProperties.size){const t=e.size;if(null==t)return this._getFallbackSize();const r=u(t.output);return this._getWorldOrScreenSize(r)}return 1}_getDrivenColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(a(r,e?.output??this._getFallbackOpacityAndColor(s)),null==t)||this._drivenProperties.opacity&&(e||this._materialColor)&&(r[3]=t?.output??this._getFallbackOpacity()),r}_getDrivenMarkerColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(a(r,e?.output??this._getFallbackMarkerOpacityAndColor(s)),null==t)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(r[3]=t?.output??this._getFallbackMarkerOpacity()),r}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validatePolylineContext(e))return null;const r=this.createElevationContextForGraphic(t),i="on-the-ground"===r.mode;return"line-3d"===this.symbol.type&&this.symbol.worldSized&&!i?(this.logger.warnOnce("World-sized LineSymbol3DLayer can only be displayed in layers with 'on-the-ground' elevation mode; graphic skipped"),null):(this.ensureDrapedStatus(i),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,r,t.uid))}_validatePolylineContext(e){const t=e.graphic.geometry;return this._validateGeometry(t,R,this.symbolLayer.type)&&"polyline"===t.type}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;{const e=this._fastUpdates;if(!M(e,t,this._fastVisualVariableConvertOptions()))return 0;for(const t of this._materials)t instanceof I&&t.setParameters(e.materialParameters);const r=this._fastMarkerUpdates,i=!0;if(!M(r,t,this._fastVisualVariableConvertOptions(i)))return 0;for(const t of this._materials)t instanceof D&&t.setParameters(r.materialParameters)}}return 2}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff,r={};"complete"===t.size?.type&&(r.width=this._computeMaterialWidth(t.size.newValue,this._worldSizedEnabled),delete t.size),"complete"===t.cap?.type&&(r.cap=P(t.cap.newValue??"butt"),delete t.cap);const i=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,i),e.symbolLayerStatePatches.push(()=>{for(const e of this._materials)e?.setParameters(r)})}layerOpacityChanged(){for(let e=0;e<5;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){const e=this._screenSizePerspective;for(const t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,a=y(W.elevationModeChangeTypes,r,i);if(1!==a)return a;const s=f(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>s)}slicePlaneEnabledChanged(){const e={hasSlicePlane:this._context.slicePlaneEnabled};for(const t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const i=H(e.graphic.geometry);if(null==i)return null;const a=new Array,s=n(),o=E(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(o,i.paths,"paths","LineSymbol3DLayer");for(let n=0;n<o.lines.length;n++){const t=o.lines[n],l=t.position,p=t.mapPositions;if(null!=this._context.clippingExtent&&(c(p,s),!h(s,this._context.clippingExtent)))continue;const m=this._createGeometry(this._lineMaterial,e,l,p,i.type,1,r);if(a.push(m),x.LINE_WIREFRAMES&&a.push(m.instantiate({material:this._wireframeLineMaterial})),null!=this._markerMaterial){const t=m.instantiate({material:this._markerMaterial});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),a.push(t)}}if(0===a.length)return null;const l=this._context.layerViewUid,p=new j({geometries:a,castShadow:!1,layerViewUid:l,graphicUid:r}),m=new b(this,p,null,_,t);return m.alignedSampledElevation=o.sampledElevation,m.needsElevationUpdates=f(t.mode),m}_createGeometry(e,t,r,i,a,s,o){const l=0===s?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,n="polygon"===a,c=this._fastUpdates?.visualVariables.color,h=this._fastUpdates?.visualVariables.size,p=this._fastUpdates?.visualVariables.opacity,m=this._context.layerViewUid,d=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:m}),{renderingInfo:u}=t,_={position:r,size:h?null:this._getDrivenSize(u),color:c?null:this._getDrivenColor(u),sizeFeature:h?L(h,u.size):null,colorFeature:c?z(c,u.color):null,opacityFeature:p?z(p,u.opacity):null};return U(e,{overlayInfo:l,removeDuplicateStartEnd:n,mapPositions:i,attributeData:_},d)}_createAsOverlay(e){const t=e.graphic,{geometry:r}=t;this._lineMaterial.renderPriority=this._renderPriority;const i=x.LINE_WIREFRAMES?this._wireframeLineMaterial:null,a=this._markerMaterial;null!=i&&(i.renderPriority=this._renderPriority-.001),null!=a&&(a.renderPriority=this._renderPriority-.002);const s=new Array,o=n(),l=p(),u=V(r,this._context.overlaySR);this._logGeometryCreationWarnings(u,r.paths,"paths","LineSymbol3DLayer");for(const n of u.lines){if(c(n.position,o),!h(o,this._context.clippingExtent))continue;m(l,o);const p=this._createGeometry(this._lineMaterial,e,n.position,void 0,r.type,0,t.uid),u=e=>{const r=this._context.layerViewUid,i=new A(e,{layerViewUid:r,graphicUid:t.uid});s.push(i)};if(null!=a){const t=p.instantiate({material:a});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),u(t);const r=this.symbolLayer.marker.placement;"begin"!==r&&"begin-end"!==r||d(o,n.position,0,1),"end"!==r&&"begin-end"!==r||d(o,n.position,n.position.length-3,1)}u(p),x.LINE_WIREFRAMES&&u(p.instantiate({material:i}))}return new g(this,s,l,this._context.drapeSourceRenderer)}get _patternHidesLine(){return G(this.symbolLayer.pattern)}_computeMaterialWidth(e,i){return i?e??1:(e=e??t(1),this._drivenProperties.size?this._fastUpdates?.visualVariables.size?r(1):1:r(e))}_prepareMaterialPatch(e,t,r){const i=t.material;if(null==i)return void(r.changed&&r.useMaterialColor&&B(this._getCombinedOpacityAndColor(this._materialColor),this._materials[4],e));if("collection"===i.type)return;const a="complete"===i.type?i.newValue?.color:"complete"===i.diff.color?.type?i.diff.color.newValue:null,s=this._getCombinedOpacityAndColor(a);r.useMaterialColor&&B(o(s),this._materials[4],e),this._patternHidesLine&&(s[3]=0),B(s,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){const r=t.marker,i=this._markerMaterial;if(null==r||"partial"!==r.type||null==r.diff||null!=r.diff.placement||null!=r.diff.style&&"complete"!==r.diff.style.type||null!=r.diff.color&&"complete"!==r.diff.color.type||null==i)return{changed:!1,useMaterialColor:null==this._markerColor};const a=r.diff.color,s=null!=a,o=s?a.newValue:null,l=null==o&&null==this._markerColor;o&&B(this._getCombinedOpacityAndColor(o),i,e);const n=r.diff.style?.newValue;return n&&e.symbolLayerStatePatches.push(()=>i.setParameters({markerPrimitive:k(n)})),delete t.marker,{changed:s,useMaterialColor:l}}_fastVisualVariableConvertOptions(e=!1){const t=this._getFallbackSize();return new O({supports:{size:!0,color:!0,rotation:!1,opacity:!0},fallbackColor:e?this._getFallbackMarkerOpacityAndColor(C):this._getFallbackOpacityAndColor(C),fallbackSize:i(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer?.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer?.marker?.color?.a??this._getFallbackOpacity()}get _worldSizedEnabled(){return"line-3d"===this.symbol.type&&this.symbol.worldSized&&this.draped}_getWorldOrScreenSize(e){return this._worldSizedEnabled?e:r(e)}_getFallbackSize(){const e=this.symbolLayer?.size;return null==e?1:this._getWorldOrScreenSize(e)}}function H(e){return"polyline"===e.type?e:null}function B(e,t,r){null!=t&&r.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function T(e){return 1===(e.material?.color?.a??1)&&1===(e.marker?.color?.a??1)}export{W as Graphics3DLineSymbolLayer};
2
+ import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{px2pt as t,pt2px as r}from"../../../../core/screenUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as s,clone as o,ones as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as n,fromBuffer as c,intersectsClippingArea as h,empty as p,expandWithAABB as m,expandWithBuffer as d}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as u}from"../../../../renderers/support/renderingInfoUtils.js";import{sharedGeometryElevationAligner as _}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as y,needsElevationUpdates2D as f}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as g}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as b}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as v,nanFallbackColor as C}from"./Graphics3DSymbolLayer.js";import{parseCapType as P,computeSymbolLayerIndex as S,parseLineMarkerStyle as k}from"./lineUtils.js";import{initFastSymbolUpdatesState as w,updateFastSymbolUpdatesState as M,getAttributeValue as z,getSizeAttributeValue as L,ConvertOptions as O}from"../support/FastSymbolUpdates.js";import{debugFlags as x}from"../../support/debugFlags.js";import{createGeometry as U}from"../../support/engineContent/line.js";import{geometryToRenderInfo as E,geometryToRenderInfoDraped as V}from"../../support/renderInfoUtils/line.js";import{Object3D as j}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as A}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as D}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as F,patternHidesLine as G}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as I}from"../../webgl-engine/materials/RibbonLineMaterial.js";const R=["polyline"];class W extends v{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,T(t))}async doLoad(){this._fastUpdates=w(this._context.renderer,this._fastVisualVariableConvertOptions());const r=!0;if(this._fastMarkerUpdates=w(this._context.renderer,this._fastVisualVariableConvertOptions(r)),!this._drivenProperties.size){if((null!=this.symbolLayer.size?this.symbolLayer.size:t(1))<0)throw new e("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values")}}_getMaterialParameters(e,t){const r=this._screenSizePerspective,i=!!has("enable-feature:emissive-on-non-volumetric")&&!this.draped,{symbolLayer:a}=this,s=this._worldSizedEnabled,o={...this._getMaterialColorParameters(t),shadingEnabled:i,width:this._computeMaterialWidth(a?.size,s),worldSized:s,polygonOffset:3,polygonOffsetIndex:S(this._renderPriority,this._renderPriorityStep),join:a.join||"miter",cap:P(a.cap||"butt"),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:F(a.pattern??a.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:r};if(2===t){if(this._fastMarkerUpdates?.visualVariables)return{...o,...this._fastMarkerUpdates.materialParameters}}else if(this._fastUpdates?.visualVariables)return{...o,...this._fastUpdates.materialParameters};return o}_getMaterialColorParameters(e){const t=2===e,r=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(r[3]=0),{color:r}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){const e=this.symbolLayer.material?.emissive;return("color"===e?.source?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return this._materials[0]??=new I(this._getMaterialParameters(!1,0),this.view.state.isGlobal),this._materials[0]}get _wireframeLineMaterial(){return this._materials[1]??=new I({...this._getMaterialParameters(!1,1),wireframe:!0},this.view.state.isGlobal),this._materials[1]}get _markerMaterial(){return null==this._materials[2]&&null!=this.symbolLayer.marker&&(this._materials[2]=new D({...this._getMaterialParameters(!1,2),placement:this.symbolLayer.marker.placement,markerPrimitive:k(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[2]}_getDrivenSize(e){if(this._drivenProperties.size){const t=e.size;if(null==t)return this._getFallbackSize();const r=u(t.output);return this._getWorldOrScreenSize(r)}return 1}_getDrivenColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(a(r,e?.output??this._getFallbackOpacityAndColor(s)),null==t)||this._drivenProperties.opacity&&(e||this._materialColor)&&(r[3]=t?.output??this._getFallbackOpacity()),r}_getDrivenMarkerColor({color:e,opacity:t}){const r=l();return this._drivenProperties.color&&(a(r,e?.output??this._getFallbackMarkerOpacityAndColor(s)),null==t)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(r[3]=t?.output??this._getFallbackMarkerOpacity()),r}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validatePolylineContext(e))return null;const r=this.createElevationContextForGraphic(t),i="on-the-ground"===r.mode;return"line-3d"===this.symbol.type&&this.symbol.worldSized&&!i?(this.logger.warnOnce("World-sized LineSymbol3DLayer can only be displayed in layers with 'on-the-ground' elevation mode; graphic skipped"),null):(this.ensureDrapedStatus(i),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,r,t.uid))}_validatePolylineContext(e){const t=e.graphic.geometry;return this._validateGeometry(t,R,this.symbolLayer.type)&&"polyline"===t.type}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;{const e=this._fastUpdates;if(!M(e,t,this._fastVisualVariableConvertOptions()))return 0;for(const t of this._materials)t instanceof I&&t.setParameters(e.materialParameters);const r=this._fastMarkerUpdates,i=!0;if(!M(r,t,this._fastVisualVariableConvertOptions(i)))return 0;for(const t of this._materials)t instanceof D&&t.setParameters(r.materialParameters)}}return 2}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff,r={};"complete"===t.size?.type&&(r.width=this._computeMaterialWidth(t.size.newValue,this._worldSizedEnabled),delete t.size),"complete"===t.cap?.type&&(r.cap=P(t.cap.newValue??"butt"),delete t.cap);const i=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,i),e.symbolLayerStatePatches.push(()=>{for(const e of this._materials)e?.setParameters(r)})}layerOpacityChanged(){for(let e=0;e<3;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){const e=this._screenSizePerspective;for(const t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,a=y(W.elevationModeChangeTypes,r,i);if(1!==a)return a;const s=f(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>s)}slicePlaneEnabledChanged(){const e={hasSlicePlane:this._context.slicePlaneEnabled};for(const t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const i=H(e.graphic.geometry);if(null==i)return null;const a=new Array,s=n(),o=E(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(o,i.paths,"paths","LineSymbol3DLayer");for(let n=0;n<o.lines.length;n++){const t=o.lines[n],l=t.position,p=t.mapPositions;if(null!=this._context.clippingExtent&&(c(p,s),!h(s,this._context.clippingExtent)))continue;const m=this._createGeometry(this._lineMaterial,e,l,p,i.type,1,r);if(a.push(m),x.LINE_WIREFRAMES&&a.push(m.instantiate({material:this._wireframeLineMaterial})),null!=this._markerMaterial){const t=m.instantiate({material:this._markerMaterial});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),a.push(t)}}if(0===a.length)return null;const l=this._context.layerViewUid,p=new j({geometries:a,castShadow:!1,layerViewUid:l,graphicUid:r}),m=new b(this,p,null,_,t);return m.alignedSampledElevation=o.sampledElevation,m.needsElevationUpdates=f(t.mode),m}_createGeometry(e,t,r,i,a,s,o){const l=0===s?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,n="polygon"===a,c=this._fastUpdates?.visualVariables.color,h=this._fastUpdates?.visualVariables.size,p=this._fastUpdates?.visualVariables.opacity,m=this._context.layerViewUid,d=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:m}),{renderingInfo:u}=t,_={position:r,size:h?null:this._getDrivenSize(u),color:c?null:this._getDrivenColor(u),sizeFeature:h?L(h,u.size):null,colorFeature:c?z(c,u.color):null,opacityFeature:p?z(p,u.opacity):null};return U(e,{overlayInfo:l,removeDuplicateStartEnd:n,mapPositions:i,attributeData:_},d)}_createAsOverlay(e){const t=e.graphic,{geometry:r}=t;this._lineMaterial.renderPriority=this._renderPriority;const i=x.LINE_WIREFRAMES?this._wireframeLineMaterial:null,a=this._markerMaterial;null!=i&&(i.renderPriority=this._renderPriority-.001),null!=a&&(a.renderPriority=this._renderPriority-.002);const s=new Array,o=n(),l=p(),u=V(r,this._context.overlaySR);this._logGeometryCreationWarnings(u,r.paths,"paths","LineSymbol3DLayer");for(const n of u.lines){if(c(n.position,o),!h(o,this._context.clippingExtent))continue;m(l,o);const p=this._createGeometry(this._lineMaterial,e,n.position,void 0,r.type,0,t.uid),u=e=>{const r=this._context.layerViewUid,i=new A(e,{layerViewUid:r,graphicUid:t.uid});s.push(i)};if(null!=a){const t=p.instantiate({material:a});t.attributes.has("color")&&t.setAttributeData("color",this._getDrivenMarkerColor(e.renderingInfo)),u(t);const r=this.symbolLayer.marker.placement;"begin"!==r&&"begin-end"!==r||d(o,n.position,0,1),"end"!==r&&"begin-end"!==r||d(o,n.position,n.position.length-3,1)}u(p),x.LINE_WIREFRAMES&&u(p.instantiate({material:i}))}return new g(this,s,l,this._context.drapeSourceRenderer)}get _patternHidesLine(){return G(this.symbolLayer.pattern)}_computeMaterialWidth(e,i){return i?e??1:(e=e??t(1),this._drivenProperties.size?this._fastUpdates?.visualVariables.size?r(1):1:r(e))}_prepareMaterialPatch(e,t,r){const i=t.material;if(null==i)return void(r.changed&&r.useMaterialColor&&B(this._getCombinedOpacityAndColor(this._materialColor),this._materials[2],e));if("collection"===i.type)return;const a="complete"===i.type?i.newValue?.color:"complete"===i.diff.color?.type?i.diff.color.newValue:null,s=this._getCombinedOpacityAndColor(a);r.useMaterialColor&&B(o(s),this._materials[2],e),this._patternHidesLine&&(s[3]=0),B(s,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){const r=t.marker,i=this._markerMaterial;if(null==r||"partial"!==r.type||null==r.diff||null!=r.diff.placement||null!=r.diff.style&&"complete"!==r.diff.style.type||null!=r.diff.color&&"complete"!==r.diff.color.type||null==i)return{changed:!1,useMaterialColor:null==this._markerColor};const a=r.diff.color,s=null!=a,o=s?a.newValue:null,l=null==o&&null==this._markerColor;o&&B(this._getCombinedOpacityAndColor(o),i,e);const n=r.diff.style?.newValue;return n&&e.symbolLayerStatePatches.push(()=>i.setParameters({markerPrimitive:k(n)})),delete t.marker,{changed:s,useMaterialColor:l}}_fastVisualVariableConvertOptions(e=!1){const t=this._getFallbackSize();return new O({supports:{size:!0,color:!0,rotation:!1,opacity:!0},fallbackColor:e?this._getFallbackMarkerOpacityAndColor(C):this._getFallbackOpacityAndColor(C),fallbackSize:i(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer?.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer?.marker?.color?.a??this._getFallbackOpacity()}get _worldSizedEnabled(){return"line-3d"===this.symbol.type&&this.symbol.worldSized&&this.draped}_getWorldOrScreenSize(e){return this._worldSizedEnabled?e:r(e)}_getFallbackSize(){const e=this.symbolLayer?.size;return null==e?1:this._getWorldOrScreenSize(e)}}function H(e){return"polyline"===e.type?e:null}function B(e,t,r){null!=t&&r.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function T(e){return 1===(e.material?.color?.a??1)&&1===(e.marker?.color?.a??1)}export{W as Graphics3DLineSymbolLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{BufferViewVec2f16 as t,BufferViewVec2f as e,BufferViewVec2f64 as i,BufferViewVec3f16 as s,BufferViewVec3f as r,BufferViewVec3f64 as n,BufferViewVec4f16 as h,BufferViewVec4f as d,BufferViewVec4f64 as u,BufferViewMat3f as f,BufferViewMat3f64 as o,BufferViewMat4f as l,BufferViewMat4f64 as p,BufferViewVec4u8 as c,BufferViewFloat16 as a,BufferViewFloat as _,BufferViewFloat64 as F,BufferViewUint8 as m,BufferViewUint16 as y,BufferViewInt8 as b,BufferViewVec2i8 as g,BufferViewVec2i16 as w,BufferViewVec2u8 as v,BufferViewVec2u16 as E,BufferViewVec4u16 as A,BufferViewVec4i16 as M,BufferViewUint32 as U,BufferViewVec3u8 as j,BufferViewVec3u16 as L,BufferViewVec2u32 as T,BufferViewVec3u32 as x,BufferViewVec4u32 as C,BufferViewVec3i8 as z,BufferViewVec4i8 as B,BufferViewInt16 as V,BufferViewVec3i16 as $,BufferViewInt32 as O,BufferViewVec2i32 as k,BufferViewVec3i32 as q,BufferViewVec4i32 as D}from"../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as G}from"../../../../geometry/support/buffer/types.js";import{glLayout as H}from"./glUtil.js";import{assert as I}from"../../webgl-engine/lib/Util.js";import{fromLayout as J}from"../../../webgl/VertexAttributeLocations.js";class K{constructor(t,e,i=0){this.layout=t,this.byteOffset=i,this.buffer="number"==typeof e?new ArrayBuffer(e*t.stride):e;for(const s of t.fields.keys()){const e=t.fields.get(s);this[s]=new e.constructor(this.buffer,i+e.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(t,e){const i=this[t];return i&&i.elementCount===e.ElementCount&&i.elementType===e.ElementType?i:null}slice(t,e){return new K(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,i=0,s=t.count){const r=this.stride;if(r%4==0){const n=new Uint32Array(t.buffer,e*r,s*r/4);new Uint32Array(this.buffer,i*r,s*r/4).set(n)}else{const n=new Uint8Array(t.buffer,e*r,s*r);new Uint8Array(this.buffer,i*r,s*r).set(n)}return this}get usedMemory(){return this.byteLength}dispose(){}}class N{constructor(t){this._stride=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(t=>this._fields.set(t[0],{...t[1],constructor:W(t[1].constructor)})))}freeze(){return this}get locations(){return J(H(this))}vec2f16(e,i){return this._appendField(e,t,i),this}vec2f(t,i){return this._appendField(t,e,i),this}vec2f64(t,e){return this._appendField(t,i,e),this}vec3f16(t,e){return this._appendField(t,s,e),this}vec3f(t,e){return this._appendField(t,r,e),this}vec3f64(t,e){return this._appendField(t,n,e),this}vec4f16(t,e){return this._appendField(t,h,e),this}vec4f(t,e){return this._appendField(t,d,e),this}vec4f64(t,e){return this._appendField(t,u,e),this}mat3f(t,e){return this._appendField(t,f,e),this}mat3f64(t,e){return this._appendField(t,o,e),this}mat4f(t,e){return this._appendField(t,l,e),this}mat4f64(t,e){return this._appendField(t,p,e),this}vec4u8(t,e){return this._appendField(t,c,e),this}f16(t,e){return this._appendField(t,a,e),this}f32(t,e){return this._appendField(t,_,e),this}f64(t,e){return this._appendField(t,F,e),this}u8(t,e){return this._appendField(t,m,e),this}u16(t,e){return this._appendField(t,y,e),this}i8(t,e){return this._appendField(t,b,e),this}vec2i8(t,e){return this._appendField(t,g,e),this}vec2i16(t,e){return this._appendField(t,w,e),this}vec2u8(t,e){return this._appendField(t,v,e),this}vec2u16(t,e){return this._appendField(t,E,e),this}vec4u16(t,e){return this._appendField(t,A,e),this}vec4i16(t,e){return this._appendField(t,M,e),this}u32(t,e){return this._appendField(t,U,e),this}_appendField(t,e,i){this._fields.has(t)&&I(!1,`${t} already added to vertex buffer layout`);const s=e.ElementCount*G(e.ElementType),r=this._stride;this._fields.set(t,{constructor:e,size:s,offset:r,optional:i}),this._alignFields()}_alignFields(){let t=0,e=1;this._fields.forEach(i=>{const s=G(i.constructor.ElementType);t=Math.floor((t+s-1)/s)*s,i.offset=t,t+=i.size,e=Math.max(e,s)}),t=Math.floor((t+e-1)/e)*e,this._stride=t}createBuffer(t){return new K(this,t)}createView(t,e){return new K(this,t,e)}clone(){const t=new N;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,i)=>t._fields.set(i,e)),t}get stride(){return this._stride}get fields(){return this._fields}}function P(){return new N}class Q{constructor(t){this.fields=new Array,t.fields.forEach((t,e)=>{const i={...t,constructor:S(t.constructor)};this.fields.push([e,i])}),this.stride=t.stride}}const R=[_,e,r,d,f,l,F,i,n,u,o,p,m,v,j,c,y,E,L,A,U,T,x,C,b,g,z,B,V,w,$,M,O,k,q,D];function S(t){return`${t.ElementType}_${t.ElementCount}`}function W(t){return X.get(t)}const X=new Map;R.forEach(t=>X.set(S(t),t));export{K as InterleavedBuffer,N as InterleavedLayout,Q as PackedLayout,P as newLayout};
2
+ import{BufferViewVec2f16 as t,BufferViewVec2f as e,BufferViewVec2f64 as i,BufferViewVec3f16 as s,BufferViewVec3f as r,BufferViewVec3f64 as n,BufferViewVec4f16 as h,BufferViewVec4f as d,BufferViewVec4f64 as u,BufferViewMat3f as f,BufferViewMat3f64 as o,BufferViewMat4f as l,BufferViewMat4f64 as p,BufferViewVec4u8 as c,BufferViewFloat16 as a,BufferViewFloat as _,BufferViewFloat64 as F,BufferViewUint8 as y,BufferViewUint16 as m,BufferViewInt8 as b,BufferViewVec2i8 as g,BufferViewVec2i16 as w,BufferViewVec2u8 as v,BufferViewVec2u16 as E,BufferViewVec4u16 as A,BufferViewVec4i16 as M,BufferViewUint32 as U,BufferViewVec3u8 as j,BufferViewVec3u16 as L,BufferViewVec2u32 as T,BufferViewVec3u32 as x,BufferViewVec4u32 as C,BufferViewVec3i8 as O,BufferViewVec4i8 as z,BufferViewInt16 as B,BufferViewVec3i16 as V,BufferViewInt32 as $,BufferViewVec2i32 as k,BufferViewVec3i32 as q,BufferViewVec4i32 as D}from"../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as G}from"../../../../geometry/support/buffer/types.js";import{glLayout as H}from"./glUtil.js";import{assert as I}from"../../webgl-engine/lib/Util.js";import{fromLayout as J}from"../../../webgl/VertexAttributeLocations.js";class K{constructor(t,e,i=0){this.layout=t,this.byteOffset=i,this.buffer="number"==typeof e?new ArrayBuffer(e*t.stride):e;for(const s of t.fields.keys()){const e=t.fields.get(s);this[s]=new e.constructor(this.buffer,i+e.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(t,e){const i=this[t];return i&&i.elementCount===e.ElementCount&&i.elementType===e.ElementType?i:null}slice(t,e){return new K(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,i=0,s=t.count){const r=this.stride,n=t.byteOffset+e*r,h=this.byteOffset+i*r,d=s*r;if(r%4==0&&n%4==0&&h%4==0){const e=new Uint32Array(t.buffer,n,d/4);new Uint32Array(this.buffer,h,d/4).set(e)}else{const e=new Uint8Array(t.buffer,n,d);new Uint8Array(this.buffer,h,d).set(e)}return this}get usedMemory(){return this.byteLength}dispose(){}}class N{constructor(t){this._stride=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(t=>this._fields.set(t[0],{...t[1],constructor:W(t[1].constructor)})))}freeze(){return this}get locations(){return J(H(this))}vec2f16(e,i){return this._appendField(e,t,i),this}vec2f(t,i){return this._appendField(t,e,i),this}vec2f64(t,e){return this._appendField(t,i,e),this}vec3f16(t,e){return this._appendField(t,s,e),this}vec3f(t,e){return this._appendField(t,r,e),this}vec3f64(t,e){return this._appendField(t,n,e),this}vec4f16(t,e){return this._appendField(t,h,e),this}vec4f(t,e){return this._appendField(t,d,e),this}vec4f64(t,e){return this._appendField(t,u,e),this}mat3f(t,e){return this._appendField(t,f,e),this}mat3f64(t,e){return this._appendField(t,o,e),this}mat4f(t,e){return this._appendField(t,l,e),this}mat4f64(t,e){return this._appendField(t,p,e),this}vec4u8(t,e){return this._appendField(t,c,e),this}f16(t,e){return this._appendField(t,a,e),this}f32(t,e){return this._appendField(t,_,e),this}f64(t,e){return this._appendField(t,F,e),this}u8(t,e){return this._appendField(t,y,e),this}u16(t,e){return this._appendField(t,m,e),this}i8(t,e){return this._appendField(t,b,e),this}vec2i8(t,e){return this._appendField(t,g,e),this}vec2i16(t,e){return this._appendField(t,w,e),this}vec2u8(t,e){return this._appendField(t,v,e),this}vec2u16(t,e){return this._appendField(t,E,e),this}vec4u16(t,e){return this._appendField(t,A,e),this}vec4i16(t,e){return this._appendField(t,M,e),this}u32(t,e){return this._appendField(t,U,e),this}_appendField(t,e,i){this._fields.has(t)&&I(!1,`${t} already added to vertex buffer layout`);const s=e.ElementCount*G(e.ElementType),r=this._stride;this._fields.set(t,{constructor:e,size:s,offset:r,optional:i}),this._alignFields()}_alignFields(){let t=0,e=1;this._fields.forEach(i=>{const s=G(i.constructor.ElementType);t=Math.floor((t+s-1)/s)*s,i.offset=t,t+=i.size,e=Math.max(e,s)}),t=Math.floor((t+e-1)/e)*e,this._stride=t}createBuffer(t){return new K(this,t)}createView(t,e){return new K(this,t,e)}clone(){const t=new N;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,i)=>t._fields.set(i,e)),t}get stride(){return this._stride}get fields(){return this._fields}}function P(){return new N}class Q{constructor(t){this.fields=new Array,t.fields.forEach((t,e)=>{const i={...t,constructor:S(t.constructor)};this.fields.push([e,i])}),this.stride=t.stride}}const R=[_,e,r,d,f,l,F,i,n,u,o,p,y,v,j,c,m,E,L,A,U,T,x,C,b,g,O,z,B,w,V,M,$,k,q,D];function S(t){return`${t.ElementType}_${t.ElementCount}`}function W(t){return X.get(t)}const X=new Map;R.forEach(t=>X.set(S(t),t));export{K as InterleavedBuffer,N as InterleavedLayout,Q as PackedLayout,P as newLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{getReferenceEllipsoid as o}from"../../../../../geometry/ellipsoidUtils.js";import{TransparentEnvironment as h}from"../TransparentEnvironment.js";import{B as n}from"../../../../../chunks/BlurEmission.glsl.js";import{BlurEmissionTechnique as l}from"./BlurEmissionTechnique.js";import{floatBlendReductionFactor as m}from"../../shaders/floatBlendScale.glsl.js";import{noParameters as p}from"../../../../webgl/NoParameters.js";let d=class extends h{constructor(e){super(e),this._glowBoost={realistic:0,cartographicMin:.5,cartographicDefault:2.5,cartographicMax:5},this._drawParameters=new n,this._ellipsoid=o(e.view.spatialReference)}initialize(){this.addHandles([r(()=>this._boost,e=>{this._passParameters.boost=e,this.requestRender(1)},s),r(()=>this.view.stage.renderView.fog?.strength??0,e=>{this._passParameters.scattering=e,this.requestRender(1)},s)])}precompile(){this._needsEmissionBlur&&this.techniques.precompile(l)}get _atmosphereRadius(){return this._ellipsoid.radius+this._ellipsoid.atmosphereHeight}_renderEmissionMipMap(){const e=this._passParameters.emission?.attachment;if(!e)return;this._drawParameters.input=e,this._drawParameters.inputScale=this.bindParameters.useFloatBlend.value?1:m,this._drawParameters.level=0,a(this._drawParameters.size,1,1);const t=Math.floor(.5*e.descriptor.width),r=Math.floor(.5*e.descriptor.height),s=this.fboCache,i=s.acquire(t,e.descriptor.height,"blur horizontal",8);let o,h=t,n=e.descriptor.height;const d=this.renderingContext,c=this.techniques.get(l),g=d.bindTechnique(c,this.bindParameters,p);for(;h>=1&&n>=1;)this._drawParameters.isHorizontal=!0,this._setupFBO(i,h,n),g.bindDraw(this.bindParameters,p,this._drawParameters),d.screen.draw(),n=Math.floor(.5*n),this._drawParameters.input=i.getTexture(),this._drawParameters.inputScale=1,this._drawParameters.isHorizontal=!1,a(this._drawParameters.size,h/t,n/r),o??=s.acquire(h,n,"blur mipmap",9),this._setupFBO(o,h,n,this._drawParameters.level),g.bindDraw(this.bindParameters,p,this._drawParameters),d.screen.draw(),s.debugCallback?.(o.name,o.fbo),h=Math.floor(.5*h),this._drawParameters.input=o.getTexture(),++this._drawParameters.level;i.release(),o&&(o.fbo.level=0),this._passParameters.mipmapLevels=this._drawParameters.level,this._passParameters.mipmapTexture=o,d.setViewport(0,0,e.descriptor.width,e.descriptor.height)}get _boost(){return 0===this._mode?this._glowBoost.realistic:this._intensity<=.5?t(this._glowBoost.cartographicMin,this._glowBoost.cartographicDefault,2*this._intensity):t(this._glowBoost.cartographicDefault,this._glowBoost.cartographicMax,2*(this._intensity-.5))}get _mode(){return null==this.view.environment.lighting.glow?this.view.environment.atmosphereEnabled?0:2:1}get _hasBlur(){return 2!==this._mode}get _intensity(){return this.view.environment.lighting.glow?.intensity??0}_setupFBO(e,t,r,s=0){e.fbo.level=s;const i=this.renderingContext;i.bindFramebuffer(e.fbo),i.setViewport(0,0,t,r),i.setClearColor(0,0,0,0),i.clear(16384)}};d=e([i("esri.views.3d.webgl-engine.effects.glow.BlurEmission")],d);export{d as BlurEmission};
2
+ import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{getReferenceEllipsoid as o}from"../../../../../geometry/ellipsoidUtils.js";import{TransparentEnvironment as h}from"../TransparentEnvironment.js";import{B as n}from"../../../../../chunks/BlurEmission.glsl.js";import{BlurEmissionTechnique as l}from"./BlurEmissionTechnique.js";import{floatBlendReductionFactor as m}from"../../shaders/floatBlendScale.glsl.js";import{noParameters as p}from"../../../../webgl/NoParameters.js";let d=class extends h{constructor(e){super(e),this._glowBoost={realistic:0,cartographicMin:.5,cartographicDefault:3.5,cartographicMax:10},this._drawParameters=new n,this._ellipsoid=o(e.view.spatialReference)}initialize(){this.addHandles([r(()=>this._boost,e=>{this._passParameters.boost=e,this.requestRender(1)},s),r(()=>this.view.stage.renderView.fog?.strength??0,e=>{this._passParameters.scattering=e,this.requestRender(1)},s)])}precompile(){this._needsEmissionBlur&&this.techniques.precompile(l)}get _atmosphereRadius(){return this._ellipsoid.radius+this._ellipsoid.atmosphereHeight}_renderEmissionMipMap(){const e=this._passParameters.emission?.attachment;if(!e)return;this._drawParameters.input=e,this._drawParameters.inputScale=this.bindParameters.useFloatBlend.value?1:m,this._drawParameters.level=0,a(this._drawParameters.size,1,1);const t=Math.floor(.5*e.descriptor.width),r=Math.floor(.5*e.descriptor.height),s=this.fboCache,i=s.acquire(t,e.descriptor.height,"blur horizontal",8);let o,h=t,n=e.descriptor.height;const d=this.renderingContext,c=this.techniques.get(l),g=d.bindTechnique(c,this.bindParameters,p);for(;h>=1&&n>=1;)this._drawParameters.isHorizontal=!0,this._setupFBO(i,h,n),g.bindDraw(this.bindParameters,p,this._drawParameters),d.screen.draw(),n=Math.floor(.5*n),this._drawParameters.input=i.getTexture(),this._drawParameters.inputScale=1,this._drawParameters.isHorizontal=!1,a(this._drawParameters.size,h/t,n/r),o??=s.acquire(h,n,"blur mipmap",9),this._setupFBO(o,h,n,this._drawParameters.level),g.bindDraw(this.bindParameters,p,this._drawParameters),d.screen.draw(),s.debugCallback?.(o.name,o.fbo),h=Math.floor(.5*h),this._drawParameters.input=o.getTexture(),++this._drawParameters.level;i.release(),o&&(o.fbo.level=0),this._passParameters.mipmapLevels=this._drawParameters.level,this._passParameters.mipmapTexture=o,d.setViewport(0,0,e.descriptor.width,e.descriptor.height)}get _boost(){return 0===this._mode?this._glowBoost.realistic:this._intensity<=.5?t(this._glowBoost.cartographicMin,this._glowBoost.cartographicDefault,2*this._intensity):t(this._glowBoost.cartographicDefault,this._glowBoost.cartographicMax,2*(this._intensity-.5))}get _mode(){return null==this.view.environment.lighting.glow?this.view.environment.atmosphereEnabled?0:2:1}get _hasBlur(){return 2!==this._mode}get _intensity(){return this.view.environment.lighting.glow?.intensity??0}_setupFBO(e,t,r,s=0){e.fbo.level=s;const i=this.renderingContext;i.bindFramebuffer(e.fbo),i.setViewport(0,0,t,r),i.setClearColor(0,0,0,0),i.clear(16384)}};d=e([i("esri.views.3d.webgl-engine.effects.glow.BlurEmission")],d);export{d as BlurEmission};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import a from"../../../../../core/Logger.js";import{abortMaybe as i,disposeMaybe as n}from"../../../../../core/maybe.js";import{isAbortError as o,throwIfAborted as f}from"../../../../../core/promiseUtils.js";import{watch as d,initial as h,syncAndInitial as m}from"../../../../../core/reactiveUtils.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{copy as u,rotateZ as l,multiply as p,invertOrIdentity as b}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as g}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as T}from"../../../webgl.js";import{cloudsHeight as w}from"../../../environment/weather.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as P}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as x,DeepSkyTechnique as v}from"./DeepSkyTechnique.js";import{StarPassParameters as k,StarsTechnique as j,layout as D}from"./StarsTechnique.js";import{getDailyRotationCoefficient as M,computeDayDuration as S,eq2ec as q,ec2eq as L}from"./starsUtils.js";import{createTextureKTX2 as U}from"../../lib/BasisUtil.js";import{VertexArrayObject as A}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as B,PrimitiveType as R}from"../../../../webgl/enums.js";import{TextureDescriptor as E}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as I}from"../../../../webgl/VertexBuffer.js";let C=class extends P{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new k,this._deepSkyPassParameters=new x}initialize(){this.addHandles([d(()=>this.view.environment.starsEnabled,e=>e?this._enable():this._disable(),h),d(()=>"virtual"===this.view.environment.lighting.type?null:this.view.environment.lighting.date,e=>this._update(e),m)])}_enable(){super._enable(),this._bandTextureTask=this._createLoadBandTextureTask(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished||!!this._bandTextureTask&&!this._bandTextureTask.finished}destroy(){this._bandTextureTask=i(this._bandTextureTask),this._bandTexture=n(this._bandTexture),this._loadDataTask=i(this._loadDataTask),this._numPoints=0,this._vao=n(this._vao),this._starData=null}render(e){const t=e.find(({name:e})=>e===T.OPAQUE_ENVIRONMENT),s=this.techniques.getCompiled(j),r=this.techniques.getCompiled(v);if(this.loading||!s||!r)return this.requestRender(1),t;const a=this.renderingContext;return this._bandTexture&&(this._deepSkyPassParameters.bandTexture=this._bandTexture,this._deepSkyPassParameters.heightAboveSeaLevelSquared=_(this.bindParameters.camera.eye),a.bindTechnique(r,this.bindParameters,this._deepSkyPassParameters),a.setDrawBuffers([B]),a.screen.draw()),this._starData&&(this._vao??=this._ensureResources(this._starData),a.bindTechnique(s,this.bindParameters,this._passParameters),a.setDrawBuffers([B]),a.bindVAO(this._vao),a.drawArrays(R.POINTS,0,this._numPoints)),t}_ensureResources(e){this._numPoints=e.byteLength/H;const t=new Float32Array(e,0,2*this._numPoints),s=new Uint8Array(e,2*this._numPoints*4,this._numPoints);return O(this.renderingContext,t,s,this._numPoints)}_update(e){const t=g(this.view.spatialReference).radius,s=.03*t;if(this._deepSkyPassParameters.radiusCloseToGround=(t+w)**2,this._deepSkyPassParameters.radiusBrightnessTransitionEnd=(t+w+s)**2,!e)return;const r=M(e),a=2*S(e),i=u(this._passParameters.modelMatrix,q);l(i,i,-a*Math.PI),p(i,L,i),l(i,i,-r*Math.PI),b(this._deepSkyPassParameters.inverseModelMatrix,i),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;const e=s(async e=>{const{data:s}=await t(z,{responseType:"array-buffer",signal:e});F(s),this._starData=s});return e.promise.catch(e=>{o(e)||a.getLogger(this).error(e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}_createLoadBandTextureTask(){if(this._bandTexture)return null;const e=s(async e=>{const{data:s}=await t(W,{responseType:"array-buffer",signal:e});f(e);const a=new E;a.wrapMode=33071,a.maxAnisotropy=8;const i=await U(this.renderingContext,a,s);if(e.aborted&&(i?.dispose(),f(e)),!i)throw new r("stars:invalid-band-texture","Failed to transcode Milky Way band texture.");this._bandTexture=i});return e.promise.catch(e=>{o(e)||a.getLogger(this).warn("Failed to load Milky Way band texture.",e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}};function O(e,t,s,r){const a=D.createBuffer(r),i=a.position,n=a.color,o=a.size;for(let f=0;f<r;f++){const e=t[2*f],r=t[2*f+1];i.set(f,0,-Math.cos(e)*Math.sin(r)),i.set(f,1,-Math.sin(e)*Math.sin(r)),i.set(f,2,-Math.cos(r));const a=V(s[f]),d=N(G[a[1]]);n.set(f,0,d[0]),n.set(f,1,d[1]),n.set(f,2,d[2]),n.set(f,3,255),o.set(f,a[0])}return new A(e,new I(e,y(D),a.buffer))}function F(e){if(!e)throw new r("stars:no-data-received","Failed to create stars because star catalogue is missing");const t=e.byteLength/H;if(t%1!=0||t>5e4||t<5e3)throw new r("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}function N(e){return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function V(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}C=e([c("esri.views.3d.webgl-engine.effects.stars.Stars")],C);const z="esri/views/3d/environment/resources/stars.wsv",W="esri/views/3d/environment/resources/milkyway-band.ktx2",G=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],H=9;export{C as Stars};
2
+ import{__decorate as e}from"tslib";import{fetchAsset as t}from"../../../../../assets.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Error.js";import a from"../../../../../core/Logger.js";import{abortMaybe as i,disposeMaybe as n}from"../../../../../core/maybe.js";import{isAbortError as o,throwIfAborted as f}from"../../../../../core/promiseUtils.js";import{watch as d,initial as h,syncAndInitial as m}from"../../../../../core/reactiveUtils.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{copy as u,rotateZ as l,multiply as p,invertOrIdentity as b}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{squaredLength as _}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as g}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as T}from"../../../webgl.js";import{glLayout as w}from"../../../support/buffer/glUtil.js";import{OpaqueEnvironment as y}from"../OpaqueEnvironment.js";import{DeepSkyPassParameters as P,DeepSkyTechnique as x}from"./DeepSkyTechnique.js";import{StarPassParameters as v,StarsTechnique as k,layout as j}from"./StarsTechnique.js";import{getDailyRotationCoefficient as D,computeDayDuration as M,eq2ec as S,ec2eq as q}from"./starsUtils.js";import{createTextureKTX2 as L}from"../../lib/BasisUtil.js";import{VertexArrayObject as U}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as A,PrimitiveType as B}from"../../../../webgl/enums.js";import{TextureDescriptor as R}from"../../../../webgl/TextureDescriptor.js";import{VertexBuffer as E}from"../../../../webgl/VertexBuffer.js";let I=class extends y{constructor(){super(...arguments),this._numPoints=0,this._passParameters=new v,this._deepSkyPassParameters=new P}initialize(){this.addHandles([d(()=>this.view.environment.starsEnabled,e=>e?this._enable():this._disable(),h),d(()=>"virtual"===this.view.environment.lighting.type?null:this.view.environment.lighting.date,e=>this._update(e),m)])}_enable(){super._enable(),this._bandTextureTask=this._createLoadBandTextureTask(),this._loadDataTask=this._createLoadDataTask()}get loading(){return!!this._loadDataTask&&!this._loadDataTask.finished||!!this._bandTextureTask&&!this._bandTextureTask.finished}destroy(){this._bandTextureTask=i(this._bandTextureTask),this._bandTexture=n(this._bandTexture),this._loadDataTask=i(this._loadDataTask),this._numPoints=0,this._vao=n(this._vao),this._starData=null}render(e){const t=e.find(({name:e})=>e===T.OPAQUE_ENVIRONMENT),s=this.techniques.getCompiled(k),r=this.techniques.getCompiled(x);if(this.loading||!s||!r)return this.requestRender(1),t;const a=this.renderingContext;return this._bandTexture&&(this._deepSkyPassParameters.bandTexture=this._bandTexture,this._deepSkyPassParameters.heightAboveSeaLevelSquared=_(this.bindParameters.camera.eye),a.bindTechnique(r,this.bindParameters,this._deepSkyPassParameters),a.setDrawBuffers([A]),a.screen.draw()),this._starData&&(this._vao??=this._ensureResources(this._starData),a.bindTechnique(s,this.bindParameters,this._passParameters),a.setDrawBuffers([A]),a.bindVAO(this._vao),a.drawArrays(B.POINTS,0,this._numPoints)),t}_ensureResources(e){this._numPoints=e.byteLength/G;const t=new Float32Array(e,0,2*this._numPoints),s=new Uint8Array(e,2*this._numPoints*4,this._numPoints);return C(this.renderingContext,t,s,this._numPoints)}_update(e){const t=g(this.view.spatialReference).radius,s=.05*t,r=.3*t;if(this._deepSkyPassParameters.radiusCloseToGround=(t+r)**2,this._deepSkyPassParameters.radiusBrightnessTransitionEnd=(t+r+s)**2,!e)return;const a=D(e),i=2*M(e),n=u(this._passParameters.modelMatrix,S);l(n,n,-i*Math.PI),p(n,q,n),l(n,n,-a*Math.PI),b(this._deepSkyPassParameters.inverseModelMatrix,n),this.requestRender(1)}_createLoadDataTask(){if(this._starData)return null;const e=s(async e=>{const{data:s}=await t(V,{responseType:"array-buffer",signal:e});O(s),this._starData=s});return e.promise.catch(e=>{o(e)||a.getLogger(this).error(e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}_createLoadBandTextureTask(){if(this._bandTexture)return null;const e=s(async e=>{const{data:s}=await t(z,{responseType:"array-buffer",signal:e});f(e);const a=new R;a.wrapMode=33071,a.maxAnisotropy=8;const i=await L(this.renderingContext,a,s);if(e.aborted&&(i?.dispose(),f(e)),!i)throw new r("stars:invalid-band-texture","Failed to transcode Milky Way band texture.");this._bandTexture=i});return e.promise.catch(e=>{o(e)||a.getLogger(this).warn("Failed to load Milky Way band texture.",e)}).then(()=>{this.destroyed||this.requestRender(1)}),e}};function C(e,t,s,r){const a=j.createBuffer(r),i=a.position,n=a.color,o=a.size;for(let f=0;f<r;f++){const e=t[2*f],r=t[2*f+1];i.set(f,0,-Math.cos(e)*Math.sin(r)),i.set(f,1,-Math.sin(e)*Math.sin(r)),i.set(f,2,-Math.cos(r));const a=N(s[f]),d=F(W[a[1]]);n.set(f,0,d[0]),n.set(f,1,d[1]),n.set(f,2,d[2]),n.set(f,3,255),o.set(f,a[0])}return new U(e,new E(e,w(j),a.buffer))}function O(e){if(!e)throw new r("stars:no-data-received","Failed to create stars because star catalogue is missing");const t=e.byteLength/G;if(t%1!=0||t>5e4||t<5e3)throw new r("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}function F(e){return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function N(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}I=e([c("esri.views.3d.webgl-engine.effects.stars.Stars")],I);const V="esri/views/3d/environment/resources/stars.wsv",z="esri/views/3d/environment/resources/milkyway-band.ktx2",W=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],G=9;export{I as Stars};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ function t(t,i){return t.size===i?new e(t):null}class e{constructor(t){this._attribute=t}get count(){return this._attribute.indices.length}get(t,e=0){const{data:i,indices:r,stride:n}=this._attribute;return i[r[t]*n+e]}getVec(t,e){const{data:i,indices:r,size:n,stride:s}=this._attribute,u=r[t]*s;for(let c=0;c<n;c++)e[c]=i[u+c];return e}}export{e as AttributeView,t as createAttributeView};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{createAttributeView as t}from"./AttributeView.js";function n(n,r){return o(n,r,1,t)}function r(n,r){return o(n,r,2,t)}function u(n,r){return o(n,r,3,t)}function e(n,r){return o(n,r,4,t)}function o(t,n,r,u){if(1===t.type){const{vertex:u}=t.buffers,e=u.layout.fields.get(n);return null==e||e.constructor.ElementCount!==r?null:u.getField(n,e.constructor)}const e=t.attributes.get(n);return null!=e?u(e,r):null}export{n as getScalarAttributeView,r as getVec2AttributeView,u as getVec3AttributeView,e as getVec4AttributeView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{fromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as a,set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ONES as l,fromValues as c,create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as f,length as p,scale as u,distance as d,transformMat4 as m,set as g,normalize as S,subtract as x,transformMat3 as b,scaleAndAdd as v,sub as O,dot as z}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,fromValues as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as V,ONES as D,create as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as R,empty as w,expandPointInPlace as A}from"../../../../geometry/support/aaBoundingRect.js";import{evaluateModelTransformScale as j}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as U}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as M,isColor as _,isOIT as T}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as L}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as I,GLTextureMaterial as E}from"../lib/GLTextureMaterial.js";import{PointMaterial as F}from"../lib/PointMaterial.js";import{screenPolygonIntersectsBounds as B,screenPolygonIntersectsTriangle as H}from"../lib/screenPolygonOverlapUtils.js";import{DrapedHit as N,Hit as G}from"../lib/screenPolygonTriangleIntersections.js";import{SeparateScreenSizePerspectiveEvaluators as q}from"../lib/screenSizePerspectiveUtils.js";import{assert as W}from"../lib/Util.js";import{writePosition as X,writeNormal as Y,writeColor as k,writeBufferVec2 as J,writeBufferFloat as K,writeBufferVec3 as Q,writeBufferZeros as Z,writeBufferVec4 as $}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as ee}from"./internal/MaterialUtil.js";import{a as te}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as se,getInstanceLayout as re,HUDMaterialTechnique as ie}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ae}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as ne}from"../../../../webscene/support/AlphaCutoff.js";class oe extends F{constructor(e,t,s=!1){super(e,He),this.produces=new Map([[12,e=>M(e)&&!this.parameters.drawAsLabel&&!this._configuration.transparentOccluded],[13,e=>M(e)&&!this.parameters.drawAsLabel&&this._configuration.transparentOccluded],[14,e=>M(e)&&this.parameters.drawAsLabel],[18,e=>this.parameters.draped&&M(e)]]),this._visible=!0,this._configuration=new ae(t,s)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:s}=this,r=t.draped;s.enableOITOffset=e.enableOITOffset,s.hasSlicePlane=this.parameters.hasSlicePlane,s.hasVerticalOffset=!!this.parameters.verticalOffset,s.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,s.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,s.polygonOffset=this.parameters.polygonOffset,s.draped=r,s.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,s.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,s.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,s.hasRotation=this.parameters.hasRotation,s.hasVVSize=!!this.parameters.vvSize,s.hasVVColor=!!this.parameters.vvColor,s.occludedFragmentFade=!r&&!!this.parameters.occludedFragmentOpacity,s.hasFocusAreaStyle=null!=this.parameters.focusAreaStyle,s.depthTestEnabled=this.parameters.depthEnabled,s.hasVertexColor=this.parameters.hasVertexColor,s.hasVertexSize=this.parameters.hasVertexSize,s.hasVertexRotation=this.parameters.hasVertexRotation,s.hasVertexUVi=this.parameters.hasVertexUVi,s.hasVertexCenterOffset=this.parameters.hasVertexCenterOffset,_(e.output)&&(s.debugDrawLabelBorder=!!U.LABELS_SHOW_BORDER),s.hasOcclusionTexture=!t.drawAsLabel&&s.transparentOccluded&&T(e.output)}intersectRay(e,t,s,r,i,a){const{options:{selectionMode:n,hud:o,excludeLabels:l},point:c,camera:h}=s,{parameters:g}=this;if(n&&o&&(!l||!g.isLabel)&&e.visible&&c&&h)for(const{renderScreenPosition:S,screenSize:x,pixelRatioTolerance:b,halfOutlineSize:v,rotationAngle:O,anchor:z,centerView:P}of this._forEachScreenSpaceHUDInstance(_e,e,t,h))if(fe(c,S[0],S[1],x,b,v,O,g,z)){const e=s.ray;if(xe[0]=c[0],xe[1]=c[1],xe[2]=S[2],h.unprojectFromRenderScreen(xe,me)){const t=y();f(t,e.direction);const s=1/p(t);u(t,t,s);const r=d(e.origin,me)*s,i=y();m(i,P,h.inverseViewMatrix),a(r,r,t,-1,i)}}}*_forEachScreenSpaceHUDInstance(e,t,s,i){const{parameters:n}=this,o=t.attributes.get("featureAttribute"),l=null==o?null:V(o.data,Ve),{scaleX:c,scaleY:h}=Ge(l,n,i.pixelRatio),p=t.attributes.get("position"),d=t.attributes.get("size"),O=t.attributes.get("normal"),z=t.attributes.get("rotation"),y=t.attributes.get("centerOffset"),P=n.size,D=r(ze,s);W(p.size>=3);const C="screen"===n.centerOffsetUnits;for(let r=0;r<p.data.length/p.size;r++){const t=r*p.size;if(g(me,p.data[t],p.data[t+1],p.data[t+2]),m(me,me,s),m(me,me,i.viewMatrix),y){const e=r*y.size;g(ye,y.data[e],y.data[e+1],y.data[e+2])}else g(ye,0,0,0);if(!C&&(me[0]+=ye[0],me[1]+=ye[1],0!==ye[2])){const e=ye[2];S(ye,me),x(me,me,u(ye,ye,e))}const o=r*O.size;g(ge,O.data[o],O.data[o+1],O.data[o+2]),b(ge,ge,D);const{normal:l,cosAngle:V}=he(ge,i,Le),R=We(n,me,V,i,de);if(v(me,me,l,R),i.applyProjection(me,Se),Se[0]>-1){if(C&&(ye[0]||ye[1])&&(Se[0]+=ye[0]*i.pixelRatio,0!==ye[1]&&(Se[1]+=de.alignmentEvaluator.apply(ye[1])*i.pixelRatio),i.unapplyProjection(Se,me)),Se[0]+=n.screenOffset[0]*i.pixelRatio,Se[1]+=n.screenOffset[1]*i.pixelRatio,Se[0]=Math.floor(Se[0]),Se[1]=Math.floor(Se[1]),Fe[0]=P[0],Fe[1]=P[1],null!=d){const e=r*d.size;Fe[0]*=d.data[e],Fe[1]*=d.data[e+1]}de.evaluator.applyVec2(Fe,Fe);let t=0;if(n.textureIsSignedDistanceField){t=Math.min(n.outlineSize,.5*Fe[0])*i.pixelRatio/2}Fe[0]*=c,Fe[1]*=h,f(e.centerView,me),g(e.renderScreenPosition,Se[0],Se[1],Se[2]),a(e.screenSize,Fe),e.pixelRatioTolerance=Ie*i.pixelRatio,e.halfOutlineSize=t,e.rotationAngle=n.rotation+(null!=z?z.data[r*z.size]:0),e.anchor=te(n),yield e}}}*_forEachDrapedHUDInstance(e,t,s){const r=t.attributes.get("position"),i=t.attributes.get("size"),n=t.attributes.get("rotation"),o=this.parameters,l=o.size,c=t.attributes.get("featureAttribute"),h=null==c?null:V(c.data,Ve),{scaleX:f,scaleY:p}=Ge(h,o,s);e.pixelRatioTolerance=Ee*s,e.anchor=te(o);for(let u=0;u<r.data.length/r.size;u++){const t=u*r.size;if(e.x=r.data[t],e.y=r.data[t+1],Fe[0]=l[0],Fe[1]=l[1],null!=i){const e=u*i.size;Fe[0]*=i.data[e],Fe[1]*=i.data[e+1]}if(e.halfOutlineSize=0,o.textureIsSignedDistanceField){const t=Math.min(o.outlineSize,.5*Fe[0]);e.halfOutlineSize=t*s/2}Fe[0]*=f,Fe[1]*=p,a(e.screenSize,Fe),e.rotationAngle=o.rotation+(null!=n?n.data[u*n.size]:0),yield e}}intersectRayDraped(e,t,s,r,i,a){const n=this.parameters;for(const{x:o,y:l,screenSize:c,pixelRatioTolerance:h,halfOutlineSize:f,rotationAngle:p,anchor:u}of this._forEachDrapedHUDInstance(Te,e,a))fe(s,o,l,c,h,f,p,n,u)&&r(i.distance,i.renderDistance,i.normal,-1)}intersectScreenPolygonDraped(e,t,s,r,i){if(!s.options.selectionMode||s.options.excludeLabels&&this.parameters.isLabel)return null;const a=this.parameters;for(const{x:n,y:o,screenSize:l,pixelRatioTolerance:c,halfOutlineSize:h,rotationAngle:f,anchor:p}of this._forEachDrapedHUDInstance(Te,e,i))if(pe(r,n+t[0],o+t[1],l,c,h,f,a,p,!1))return new N(-1);return null}intersectScreenPolygon(e,t,s,r){const{options:{selectionMode:i,hud:a,excludeLabels:n},camera:o}=s,{parameters:l}=this;if(!i||!a||n&&l.isLabel||!e.visible||null==t)return null;const c=new G(1),h=1/o.pixelRatio;for(const{renderScreenPosition:f,screenSize:p,pixelRatioTolerance:u,halfOutlineSize:g,rotationAngle:S,anchor:x,centerView:b}of this._forEachScreenSpaceHUDInstance(_e,e,t,o)){const e=m(me,b,o.inverseViewMatrix);if(!s.screenPolygonPrimitiveProcessor?.validatePoint(e))continue;const t=f[0]*h,i=(o.fullHeight-f[1])*h;if(je[0]=p[0]*h,je[1]=p[1]*h,pe(r,t,i,je,u*h,g*h,S,l,x,!0)){const t=d(o.eye,e);c.updateIfCloserFromValues(t,-1,e,null)}}return c.valid?c:null}createBufferWriter(){return new Ne(this.parameters)}applyShaderOffsets(e,t,s,i,a,n,o,l){b(be,s,r(ze,i));const c=he(be,o,Le),h=qe(p(t),o),f=We(this.parameters,t,c.cosAngle,o,l);v(t,t,c.normal,f+h),v(e,e,be,f+h);const u=n+f;this._applyPolygonOffsetView(t,c,u,o,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,s,r,i,a){return this._applyCenterOffsetNDC(e,t,r,i),null!=a&&f(a,i),this._applyPolygonOffsetNDC(i,s,r,i),i}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return f(a,t);const c=e(Math.abs(s.cosAngle),.01,1),h=1-Math.sqrt(1-c*c)/c/i.viewport[2];return u(a,t,l>0?h:1/h),a}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&f(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(S(ge,s),O(s,s,u(ge,ge,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&f(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&f(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t);r[2]-=(a||e)*i}return r}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:s}=this.parameters,r=e[3]>=ne||t>=ne&&s[3]>=ne;return this._visible&&r}createGLMaterial(e){return new le(e)}calculateRelativeScreenBounds(e,t,s=R()){return ce(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}}class le extends E{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(ie,e)}}function ce(e,t,s,r){r[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,r[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function he(e,t,s){return m(s.normal,e,t.viewInverseTransposeMatrix),s.cosAngle=z(s.normal,Be),s}function fe(e,s,r,i,a,l,c,h,f){const p=ue(s,r,i,a,l,h,f,De);return n(Oe,s,r),o(ve,e,Oe,t(c)),ve[0]>p[0]&&ve[0]<p[2]&&ve[1]>p[1]&&ve[1]<p[3]}function pe(e,s,r,i,a,l,c,h,f,p){const u=ue(s,r,i,a,l,h,f,De,p);if(n(Ce,u[0],u[1]),n(Re,u[2],u[1]),n(we,u[2],u[3]),n(Ae,u[0],u[3]),0!==c){const e=t(c);n(Oe,s,r),o(Ce,Ce,Oe,e),o(Re,Re,Oe,e),o(we,we,Oe,e),o(Ae,Ae,Oe,e),w(u),A(u,Ce),A(u,Re),A(u,we),A(u,Ae)}return!!B(e,u)&&(H(e,Ce,Re,we)||H(e,Ce,we,Ae))}function ue(e,t,s,r,i,a,n,o,l=!1){let c=e-r-s[0]*n[0],h=c+s[0]+2*r;const f=l?1-n[1]:n[1];let p=t-r-s[1]*f,u=p+s[1]+2*r;const d=a.distanceFieldBoundingBox;return a.textureIsSignedDistanceField&&null!=d&&(c+=s[0]*d[0],p+=s[1]*(l?1-d[3]:d[1]),h-=s[0]*(1-d[2]),u-=s[1]*(l?d[1]:1-d[3]),c-=i,h+=i,p-=i,u+=i),o[0]=c,o[1]=p,o[2]=h,o[3]=u,o}const de=new q,me=y(),ge=y(),Se=C(),xe=s(),be=y(),ve=h(),Oe=h(),ze=i(),ye=y(),Pe=y(),Ve=C(),De=R(),Ce=h(),Re=h(),we=h(),Ae=h(),je=h();class Ue{constructor(){this.renderScreenPosition=y(),this.screenSize=h(),this.centerView=y(),this.pixelRatioTolerance=0,this.halfOutlineSize=0,this.rotationAngle=0,this.anchor=h()}}class Me{constructor(){this.x=0,this.y=0,this.screenSize=h(),this.pixelRatioTolerance=0,this.halfOutlineSize=0,this.rotationAngle=0,this.anchor=h()}}const _e=new Ue,Te=new Me,Le={normal:y(),cosAngle:0},Ie=1,Ee=2,Fe=c(0,0),Be=P(0,0,1);class He extends I{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=D,this.size=l,this.polygonOffset=0,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=D,this.outlineSize=0,this.distanceFieldBoundingBox=C(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.hasVertexColor=!1,this.hasVertexSize=!1,this.hasVertexRotation=!1,this.hasVertexUVi=!1,this.hasVertexCenterOffset=!1,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.focusAreaStyle=null,this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Ne{constructor(e){this.baseInstanceLayout=se,this.layout=re(e)}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,s,r){if(null==r)return;const{buffer:i,offset:a}=r,{position:n,normal:o,color:l,size:c,rotation:h,centerOffset:f,groundDistance:p,featureAttribute:u,uvi:d,olidColor:m}=i;X(s.get("position"),e,n,a),Y(s.get("normal"),t,o,a);const g=s.get("position").indices.length;if(d){const e=s.get("uvi")?.data;if(e&&e.length>=4){const[t,s,r,i]=e;for(let e=0;e<g;++e){const n=a+e;d.setValues(n,t,s,r,i)}}}if(l&&k(s.get("color"),4,l,a),c&&J(s.get("size"),c,a),h&&K(s.get("rotation"),h,a),f&&(s.get("centerOffset")?Q(s.get("centerOffset"),f,a):Z(f,a,g)),s.get("groundDistance")?K(s.get("groundDistance"),p,a):Z(p,a,g),u&&(s.get("featureAttribute")?$(s.get("featureAttribute"),u,a):Z(u,a,g)),null!=m){const e=s.get("olidColor");null!=e?k(e,4,m,a):Z(m,a,g)}}writeBaseInstance(e,t){const{uv0:s}=t;J(e.get("uv0"),s,0)}}function Ge(e,t,s){return null==e||null==t.vvSize?{scaleX:s,scaleY:s}:(j(Pe,t,e),{scaleX:Pe[0]*s,scaleY:Pe[1]*s})}function qe(e,t){const s=t.computeRenderPixelSizeAtDist(e)*L;return(t.aboveGround?1:-1)*s}function We(e,t,s,r,i){if(!e.verticalOffset?.screenLength){const r=p(t);return i.update(s,r,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=p(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=ee(r,a,e.verticalOffset,s,n,e.screenSizePerspectiveMinPixelReferenceSize);return i.update(s,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{oe as HUDMaterial,He as Parameters};
2
+ import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as n,set as a,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ONES as l,fromValues as c,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as p,length as h,scale as u,distance as m,transformMat4 as d,set as g,normalize as S,subtract as x,transformMat3 as v,scaleAndAdd as b,sub as O,dot as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as z,fromValues as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as P,create as D}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as C,empty as R,expandPointInPlace as w}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec3f as A}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as j}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as U}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as M,isColor as _,isOIT as T}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as F}from"../core/shaderLibrary/hud/HUD.glsl.js";import{getVec3AttributeView as L,getVec2AttributeView as I,getScalarAttributeView as E,getVec4AttributeView as B}from"../lib/attributeViewUtils.js";import{GLTextureMaterialBindParameters as H,GLTextureMaterial as N}from"../lib/GLTextureMaterial.js";import{PointMaterial as q}from"../lib/PointMaterial.js";import{screenPolygonIntersectsBounds as G,screenPolygonIntersectsTriangle as W}from"../lib/screenPolygonOverlapUtils.js";import{DrapedHit as X,Hit as Y}from"../lib/screenPolygonTriangleIntersections.js";import{SeparateScreenSizePerspectiveEvaluators as k}from"../lib/screenSizePerspectiveUtils.js";import{assert as J}from"../lib/Util.js";import{writePosition as K,writeNormal as Q,writeColor as Z,writeBufferVec2 as $,writeBufferFloat as ee,writeBufferVec3 as te,writeBufferZeros as re,writeBufferVec4 as ie}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as se}from"./internal/MaterialUtil.js";import{a as ne}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as ae,getInstanceLayout as oe,HUDMaterialTechnique as le}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ce}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as fe}from"../../../../webscene/support/AlphaCutoff.js";class pe extends q{constructor(e,t,r=!1){super(e,We),this.produces=new Map([[12,e=>M(e)&&!this.parameters.drawAsLabel&&!this._configuration.transparentOccluded],[13,e=>M(e)&&!this.parameters.drawAsLabel&&this._configuration.transparentOccluded],[14,e=>M(e)&&this.parameters.drawAsLabel],[18,e=>this.parameters.draped&&M(e)]]),this._visible=!0,this._configuration=new ce(t,r)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this,i=t.draped;r.enableOITOffset=e.enableOITOffset,r.hasSlicePlane=this.parameters.hasSlicePlane,r.hasVerticalOffset=!!this.parameters.verticalOffset,r.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,r.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,r.polygonOffset=this.parameters.polygonOffset,r.draped=i,r.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,r.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,r.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,r.hasRotation=this.parameters.hasRotation,r.hasVVSize=!!this.parameters.vvSize,r.hasVVColor=!!this.parameters.vvColor,r.occludedFragmentFade=!i&&!!this.parameters.occludedFragmentOpacity,r.hasFocusAreaStyle=null!=this.parameters.focusAreaStyle,r.depthTestEnabled=this.parameters.depthEnabled,r.hasVertexColor=this.parameters.hasVertexColor,r.hasVertexSize=this.parameters.hasVertexSize,r.hasVertexRotation=this.parameters.hasVertexRotation,r.hasVertexUVi=this.parameters.hasVertexUVi,r.hasVertexCenterOffset=this.parameters.hasVertexCenterOffset,_(e.output)&&(r.debugDrawLabelBorder=!!U.LABELS_SHOW_BORDER),r.hasOcclusionTexture=!t.drawAsLabel&&r.transparentOccluded&&T(e.output)}intersectRay(e,t,r,i,s,n){const{options:{selectionMode:a,hud:o,excludeLabels:l},point:c,camera:f}=r,{parameters:g}=this;if(a&&o&&(!l||!g.isLabel)&&e.visible&&c&&f)for(const{renderScreenPosition:S,screenSize:x,pixelRatioTolerance:v,halfOutlineSize:b,rotationAngle:O,anchor:y,centerView:V}of this._forEachScreenSpaceHUDInstance(Ie,e,t,f))if(de(c,S[0],S[1],x,v,b,O,g,y)){const e=r.ray;if(ye[0]=c[0],ye[1]=c[1],ye[2]=S[2],f.unprojectFromRenderScreen(ye,ve)){const t=z();p(t,e.direction);const r=1/h(t);u(t,t,r);const i=m(e.origin,ve)*r,s=z();d(s,V,f.inverseViewMatrix),n(i,i,t,-1,s)}}}*_forEachScreenSpaceHUDInstance(e,t,r,s){const{parameters:a}=this,o=L(t,"position"),l=I(t,"size"),c=L(t,"normal"),f=E(t,"rotation"),h=L(t,"centerOffset"),m=B(t,"featureAttribute"),O=a.size,y=i(De,r),z="screen"===a.centerOffsetUnits;for(let i=0;i<o.count;i++){const t=m?.getVec(i,we)??null,{scaleX:V,scaleY:P}=Ye(t,a,s.pixelRatio);if(o.getVec(i,ve),d(ve,ve,r),d(ve,ve,s.viewMatrix),h?h.getVec(i,Ce):g(Ce,0,0,0),!z&&(ve[0]+=Ce[0],ve[1]+=Ce[1],0!==Ce[2])){const e=Ce[2];S(Ce,ve),x(ve,ve,u(Ce,Ce,e))}c.getVec(i,be),v(be,be,y);const{normal:D,cosAngle:C}=me(be,s,Be),R=Je(a,ve,C,s,xe);if(b(ve,ve,D,R),s.applyProjection(ve,Oe),Oe[0]>-1){z&&(Ce[0]||Ce[1])&&(Oe[0]+=Ce[0]*s.pixelRatio,0!==Ce[1]&&(Oe[1]+=xe.alignmentEvaluator.apply(Ce[1])*s.pixelRatio),s.unapplyProjection(Oe,ve)),Oe[0]+=a.screenOffset[0]*s.pixelRatio,Oe[1]+=a.screenOffset[1]*s.pixelRatio,Oe[0]=Math.floor(Oe[0]),Oe[1]=Math.floor(Oe[1]),qe[0]=O[0],qe[1]=O[1],null!=l&&(qe[0]*=l.get(i,0),qe[1]*=l.get(i,1)),xe.evaluator.applyVec2(qe,qe);let t=0;if(a.textureIsSignedDistanceField){t=Math.min(a.outlineSize,.5*qe[0])*s.pixelRatio/2}qe[0]*=V,qe[1]*=P,p(e.centerView,ve),g(e.renderScreenPosition,Oe[0],Oe[1],Oe[2]),n(e.screenSize,qe),e.pixelRatioTolerance=He*s.pixelRatio,e.halfOutlineSize=t,e.rotationAngle=a.rotation+(f?.get(i)??0),e.anchor=ne(a),yield e}}}*_forEachDrapedHUDInstance(e,t,r){const i=L(t,"position"),s=I(t,"size"),a=E(t,"rotation"),o=B(t,"featureAttribute"),l=this.parameters,c=l.size;e.pixelRatioTolerance=Ne*r,e.anchor=ne(l);for(let f=0;f<i.count;f++){const t=o?.getVec(f,we)??null,{scaleX:p,scaleY:h}=Ye(t,l,r);if(e.x=i.get(f,0),e.y=i.get(f,1),qe[0]=c[0],qe[1]=c[1],null!=s&&(qe[0]*=s.get(f,0),qe[1]*=s.get(f,1)),e.halfOutlineSize=0,l.textureIsSignedDistanceField){const t=Math.min(l.outlineSize,.5*qe[0]);e.halfOutlineSize=t*r/2}qe[0]*=p,qe[1]*=h,n(e.screenSize,qe),e.rotationAngle=l.rotation+(a?.get(f)??0),yield e}}intersectRayDraped(e,t,r,i,s,n){const a=this.parameters;for(const{x:o,y:l,screenSize:c,pixelRatioTolerance:f,halfOutlineSize:p,rotationAngle:h,anchor:u}of this._forEachDrapedHUDInstance(Ee,e,n))de(r,o,l,c,f,p,h,a,u)&&i(s.distance,s.renderDistance,s.normal,-1)}intersectScreenPolygonDraped(e,t,r,i,s){if(!r.options.selectionMode||r.options.excludeLabels&&this.parameters.isLabel)return null;const n=this.parameters;for(const{x:a,y:o,screenSize:l,pixelRatioTolerance:c,halfOutlineSize:f,rotationAngle:p,anchor:h}of this._forEachDrapedHUDInstance(Ee,e,s))if(ge(i,a+t[0],o+t[1],l,c,f,p,n,h,!1))return new X(-1);return null}intersectScreenPolygon(e,t,r,i){const{options:{selectionMode:s,hud:n,excludeLabels:a},camera:o}=r,{parameters:l}=this;if(!s||!n||a&&l.isLabel||!e.visible||null==t)return null;const c=new Y(1),f=1/o.pixelRatio;for(const{renderScreenPosition:p,screenSize:h,pixelRatioTolerance:u,halfOutlineSize:g,rotationAngle:S,anchor:x,centerView:v}of this._forEachScreenSpaceHUDInstance(Ie,e,t,o)){const e=d(ve,v,o.inverseViewMatrix);if(!r.screenPolygonPrimitiveProcessor?.validatePoint(e))continue;const t=p[0]*f,s=(o.fullHeight-p[1])*f;if(Te[0]=h[0]*f,Te[1]=h[1]*f,ge(i,t,s,Te,u*f,g*f,S,l,x,!0)){const t=m(o.eye,e);c.updateIfCloserFromValues(t,-1,e,null)}}return c.valid?c:null}createBufferWriter(){return new Xe(this.parameters)}createPrimitivePositionReader(e,t){J(null!=t,"HUD geometry requires instancing");const r=e.vertex.getField("position",A);return e=>r.getVec(0,e)}applyShaderOffsets(e,t,r,s,n,a,o,l){v(ze,r,i(De,s));const c=me(ze,o,Be),f=ke(h(t),o),p=Je(this.parameters,t,c.cosAngle,o,l);b(t,t,c.normal,p+f),b(e,e,ze,p+f);const u=a+p;this._applyPolygonOffsetView(t,c,u,o,t),this._applyCenterOffsetView(t,n,t)}applyShaderOffsetsNDC(e,t,r,i,s,n){return this._applyCenterOffsetNDC(e,t,i,s),null!=n&&p(n,s),this._applyPolygonOffsetNDC(s,r,i,s),s}_applyPolygonOffsetView(t,r,i,s,n){const a=s.aboveGround?1:-1;let o=Math.sign(i);0===o&&(o=a);const l=a*o;if(this.parameters.shaderPolygonOffset<=0)return p(n,t);const c=e(Math.abs(r.cosAngle),.01,1),f=1-Math.sqrt(1-c*c)/c/s.viewport[2];return u(n,t,l>0?f:1/f),n}_applyCenterOffsetView(e,t,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&p(r,e),i&&(r[0]+=t[0],r[1]+=t[1],t[2]&&(S(be,r),O(r,r,u(be,be,t[2])))),r}_applyCenterOffsetNDC(e,t,r,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&p(i,e),s||(i[0]+=t[0]/r.fullWidth*2,i[1]+=t[1]/r.fullHeight*2),i}_applyPolygonOffsetNDC(e,t,r,i){const s=this.parameters.shaderPolygonOffset;if(e!==i&&p(i,e),s){const e=r.aboveGround?1:-1,n=e*Math.sign(t);i[2]-=(n||e)*s}return i}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,i=e[3]>=fe||t>=fe&&r[3]>=fe;return this._visible&&i}createGLMaterial(e){return new he(e)}calculateRelativeScreenBounds(e,t,r=C()){return ue(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class he extends N{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(le,e)}}function ue(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}function me(e,t,r){return d(r.normal,e,t.viewInverseTransposeMatrix),r.cosAngle=y(r.normal,Ge),r}function de(e,r,i,s,n,l,c,f,p){const h=Se(r,i,s,n,l,f,p,Ae);return a(Pe,r,i),o(Ve,e,Pe,t(c)),Ve[0]>h[0]&&Ve[0]<h[2]&&Ve[1]>h[1]&&Ve[1]<h[3]}function ge(e,r,i,s,n,l,c,f,p,h){const u=Se(r,i,s,n,l,f,p,Ae,h);if(a(je,u[0],u[1]),a(Ue,u[2],u[1]),a(Me,u[2],u[3]),a(_e,u[0],u[3]),0!==c){const e=t(c);a(Pe,r,i),o(je,je,Pe,e),o(Ue,Ue,Pe,e),o(Me,Me,Pe,e),o(_e,_e,Pe,e),R(u),w(u,je),w(u,Ue),w(u,Me),w(u,_e)}return!!G(e,u)&&(W(e,je,Ue,Me)||W(e,je,Me,_e))}function Se(e,t,r,i,s,n,a,o,l=!1){let c=e-i-r[0]*a[0],f=c+r[0]+2*i;const p=l?1-a[1]:a[1];let h=t-i-r[1]*p,u=h+r[1]+2*i;const m=n.distanceFieldBoundingBox;return n.textureIsSignedDistanceField&&null!=m&&(c+=r[0]*m[0],h+=r[1]*(l?1-m[3]:m[1]),f-=r[0]*(1-m[2]),u-=r[1]*(l?m[1]:1-m[3]),c-=s,f+=s,h-=s,u+=s),o[0]=c,o[1]=h,o[2]=f,o[3]=u,o}const xe=new k,ve=z(),be=z(),Oe=D(),ye=r(),ze=z(),Ve=f(),Pe=f(),De=s(),Ce=z(),Re=z(),we=D(),Ae=C(),je=f(),Ue=f(),Me=f(),_e=f(),Te=f();class Fe{constructor(){this.renderScreenPosition=z(),this.screenSize=f(),this.centerView=z(),this.pixelRatioTolerance=0,this.halfOutlineSize=0,this.rotationAngle=0,this.anchor=f()}}class Le{constructor(){this.x=0,this.y=0,this.screenSize=f(),this.pixelRatioTolerance=0,this.halfOutlineSize=0,this.rotationAngle=0,this.anchor=f()}}const Ie=new Fe,Ee=new Le,Be={normal:z(),cosAngle:0},He=1,Ne=2,qe=c(0,0),Ge=V(0,0,1);class We extends H{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=P,this.size=l,this.polygonOffset=0,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=P,this.outlineSize=0,this.distanceFieldBoundingBox=D(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.hasVertexColor=!1,this.hasVertexSize=!1,this.hasVertexRotation=!1,this.hasVertexUVi=!1,this.hasVertexCenterOffset=!1,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.focusAreaStyle=null,this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Xe{constructor(e){this.baseInstanceLayout=ae,this.layout=oe(e)}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,r,i){if(null==i)return;const{buffer:s,offset:n}=i,{position:a,normal:o,color:l,size:c,rotation:f,centerOffset:p,groundDistance:h,featureAttribute:u,uvi:m,olidColor:d}=s;K(r.get("position"),e,a,n),Q(r.get("normal"),t,o,n);const g=r.get("position").indices.length;if(m){const e=r.get("uvi")?.data;if(e&&e.length>=4){const[t,r,i,s]=e;for(let e=0;e<g;++e){const a=n+e;m.setValues(a,t,r,i,s)}}}if(l&&Z(r.get("color"),4,l,n),c&&$(r.get("size"),c,n),f&&ee(r.get("rotation"),f,n),p&&(r.get("centerOffset")?te(r.get("centerOffset"),p,n):re(p,n,g)),r.get("groundDistance")?ee(r.get("groundDistance"),h,n):re(h,n,g),u&&(r.get("featureAttribute")?ie(r.get("featureAttribute"),u,n):re(u,n,g)),null!=d){const e=r.get("olidColor");null!=e?Z(e,4,d,n):re(d,n,g)}}writeBaseInstance(e,t){const{uv0:r}=t;$(e.get("uv0"),r,0)}rebaseBuffers(e,t){if(null==t)return;const{buffer:r,offset:i}=t;r.copyFrom(e.vertex,0,i)}}function Ye(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:(j(Re,t,e),{scaleX:Re[0]*r,scaleY:Re[1]*r})}function ke(e,t){const r=t.computeRenderPixelSizeAtDist(e)*F;return(t.aboveGround?1:-1)*r}function Je(e,t,r,i,s){if(!e.verticalOffset?.screenLength){const i=h(t);return s.update(r,i,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const n=h(t),a=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=se(i,n,e.verticalOffset,r,a,e.screenSizePerspectiveMinPixelReferenceSize);return s.update(r,n,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{pe as HUDMaterial,We as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{Attribute as t}from"../lib/Attribute.js";import{GeometryBaseInstance as n}from"../lib/GeometryBaseInstance.js";function e(){return o??=r(),o}function r(){const e=0,r=255,o=new t([e,e,e,r,r,e,r,r],[0,1,2,3],2,!0);return new n([["uv0",o]])}let o=null;export{e as getHUDMaterialBaseInstance};
2
+ import{Attribute as e}from"../lib/Attribute.js";import{BufferGeometryBaseInstance as t}from"../lib/BufferGeometryBaseInstance.js";import{Buffers as r}from"../lib/Buffers.js";import{GeometryBaseInstance as n}from"../lib/GeometryBaseInstance.js";import{baseLayout as u}from"../shaders/HUDMaterialTechnique.js";function s(){return l??=i(),l}function o(){return a??=f(),a}function i(){const t=0,r=255,u=new e([t,t,t,r,r,t,r,r],[0,1,2,3],2,!0);return new n([["uv0",u]])}function f(){const e=0,n=255,s=u.createBuffer(4);return s.uv0.setValues(0,e,e),s.uv0.setValues(1,e,n),s.uv0.setValues(2,n,e),s.uv0.setValues(3,n,n),new t(new r(s))}let l=null,a=null;export{s as getHUDMaterialBaseInstance,o as getHUDMaterialBufferBaseInstance};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as a,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as _,transformMat4 as b,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as w,distance2 as E,closestLineSegmentPoint as v,projectPoint as x,projectPointFraction as T,create as z}from"../../../../geometry/support/lineSegment.js";import{fromPoints as j,signedDistance as L,getNormal as C,create as A}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as M,BufferViewFloat as V,BufferViewVec4Unorm8 as F,BufferViewVec4f16 as R,BufferViewUint32 as O}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as B,isColor as U,isDepth as I,isColorHighlightOLIDOrDepth as N,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as W}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{LineMaterial as Y}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as X,DrapedHit as G}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{writeColor as ee}from"./internal/bufferWriterUtils.js";import{n as te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as se}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class oe extends Y{constructor(e,t){super(e,ce),this.produces=new Map([[2,e=>B(e)||U(e)&&8===this.parameters.renderOccluded],[3,e=>I(e)],[10,e=>N(e)&&8===this.parameters.renderOccluded],[11,e=>N(e)&&8===this.parameters.renderOccluded],[4,e=>U(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>U(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new ne(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&this.parameters.isImagePattern(),s=t&&(this.parameters.worldSized||r);this._configuration.draped=t,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ge(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&de(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!s,this._configuration.worldSized=s,this._configuration.imagePattern=r}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},i,r,s,n,a){if(!i.options.selectionMode)return;const o=this._getLineSize(e,!0),l=r[0],c=r[1],p=he(o,a,this.parameters.worldSized);let u=Number.MAX_VALUE,m=0;for(const h of fe(Pe,ye,this.parameters,e)){const e=l-Pe[0],i=c-Pe[1],r=ye[0]-Pe[0],s=ye[1]-Pe[1],n=t((r*e+s*i)/(r*r+s*s),0,1),a=r*n-e,o=s*n-i,p=a*a+o*o;p<u&&(u=p,m=h)}u<p*p&&s(n.distance,n.renderDistance,n.normal,m)}intersectRay(t,i,r,s,n,o){const{options:l,camera:_,rayBegin:b,rayEnd:S}=r;if(!l.selectionMode||!t.visible||!_)return;if(!K(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,x=this._getLineSize(P),T=ze;a(T,r.point);const z=x*_.pixelRatio,A=Ye*_.pixelRatio,M=z/2+A;c(Ue[0],T[0]-M,T[1]+M,0),c(Ue[1],T[0]+M,T[1]+M,0),c(Ue[2],T[0]+M,T[1]-M,0),c(Ue[3],T[0]-M,T[1]-M,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ue[e],Ie[e]))return;j(_.eye,Ie[0],Ie[1],Ne),j(_.eye,Ie[1],Ie[2],ke),j(_.eye,Ie[2],Ie[3],We),j(_.eye,Ie[3],Ie[0],De);let V=Number.MAX_VALUE,F=0;for(const e of this._forEachTransformedLineSegment(be,Se,y,i,me(this.parameters,P))){if(L(Ne,be)<0&&L(Ne,Se)<0||L(ke,be)<0&&L(ke,Se)<0||L(We,be)<0&&L(We,Se)<0||L(De,be)<0&&L(De,Se)<0)continue;const t=_.projectToRenderScreen(be,je),i=_.projectToRenderScreen(Se,Le);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){p(xe,be,Se);const e=_.frustum,i=-L(e[4],be)/u(xe,C(e[4]));if(m(xe,xe,i),h(be,be,xe),!_.projectToRenderScreen(be,t))continue}else if(t[2]>0&&i[2]<0){p(xe,Se,be);const e=_.frustum,t=-L(e[4],Se)/u(xe,C(e[4]));if(m(xe,xe,t),h(Se,Se,xe),!_.projectToRenderScreen(Se,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=w(t,i,Fe),s=E(r,T);if(!(s>=V)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,be,Se,T,_,x,A);if(s>=e*e)continue}V=s,f(Me,be),f(Ve,Se),F=e}}if(V<M*M){let e=Number.MAX_VALUE;if(v(w(Me,Ve,Fe),w(b,S,Re),Te)){p(Te,Te,b);const t=d(Te);m(Te,Te,1/t),e=t/g(b,S)}o(e,e,Te,F)}}intersectScreenPolygon(t,i,r,s){const{options:n,camera:a,screenPolygonPrimitiveProcessor:o}=r;if(!n.selectionMode||!t.visible)return null;if(!K(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Ye,m=u*a.pixelRatio,h=new X(4);for(const e of this._forEachTransformedLineSegment(be,Se,c,i,me(this.parameters,l)))for(const[t,i]of o.processLineSegment(Je,be,Se)){if(!J(a,t,i,je,Le))continue;const r=w(je,Le,Fe);let n=p/2+u;this.parameters.screenSizePerspective&&(_(ze,je,Le,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(r,t,i,ze,a,p,m)/a.pixelRatio)),a.renderToScreen(je,Ce),a.renderToScreen(Le,Ae),q(s,Ce,Ae,n)&&(x(w(t,i,Re),a.eye,we),h.updateIfCloserFromValues(g(a.eye,we),e,we,null))}return h}intersectScreenPolygonDraped({attributes:e},t,i,r,s){if(!i.options.selectionMode)return null;const n=he(this._getLineSize(e,!0),s,this.parameters.worldSized);for(const a of fe(Pe,ye,this.parameters,e,t))if(q(r,Pe,ye,n))return new G(a);return null}createBufferWriter(){return new pe(ie(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new le(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,n,a){const o=T(e,r);_(we,t,i,o),b(Ee,we,s.viewMatrix);const l=d(Ee),c=this.computeCameraAbsCosAngle(we,s,this._configuration.spherical);_e.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return _e.apply(n)*s.pixelRatio/2+a}computeCameraAbsCosAngle(e,t,i){return i?S(Te,e):c(Te,0,0,1),p(ve,e,t.eye),S(ve,ve),Math.abs(u(Te,ve))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const n=s?i.length-2:i.length-5;for(let a=0;a<n;a+=3){e[0]=i[a]+r[12],e[1]=i[a+1]+r[13],e[2]=i[a+2]+r[14];const s=(a+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield a/3}}}class le extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(se,e)}}class ce extends ${constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class pe{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=ge(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=r&&this._writeVertexBuffer(e,i,r,s)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,n=this._isClosed(t),{buffer:a,offset:o}=i,l=a.getField("position",M),c=a.getField("u0",V),p=a.getField("sizeFeatureAttribute",V),u=a.getField("size",V),m=a.getField("colorFeatureAttribute",V),h=a.getField("color",F),d=a.getField("olidColor",F),_=a.getField("timeStamps",R),b=a.getField("opacityFeatureAttribute",V),S=t.get("sizeFeatureAttribute")?.data,P=t.get("size")?.data,y=t.get("colorFeatureAttribute")?.data,w=t.get("color")?.data,E=t.get("opacityFeatureAttribute")?.data,v=t.get("distanceToStart")?.data,x=t.get("timeStamps");Q(null!==l,"Expected valid position field in texture buffer"),Q(null!==c,"Expected valid u0 field in texture buffer");let T=0;for(let j=0;j<s;++j){this._getTransformedPosition(Be,r.data,j,e),j>0&&(null!=v?T=v[j]??T:T+=g(Oe,Be));const t=o+j+1;if(l.setVec(t,Be),c.set(t,T),f(Oe,Be),p&&p.set(t,1===S?.length?S[0]:S?.[j]??0),u&&u.set(t,1===P?.length?P[0]:P?.[j]??1),m&&m.set(t,1===y?.length?y[0]:y?.[j]??0),h)if(null!=w){const e=Math.min(4*j,w.length-4);h.setValues(t,w[e],w[e+1],w[e+2],w[e+3])}else h.setValues(t,1,1,1,1);b&&b.set(t,1===E?.length?E[0]:E?.[j]??0)}if(null!=_&&null!=x){Q(4===x.size);const e=x.data;for(let t=0;t<s;++t){const i=4*t,r=o+t+1;_.set(r,0,e[i]),_.set(r,1,e[i+1]),_.set(r,2,e[i+2]),_.set(r,3,e[i+3])}}if(n){const e=o,t=o+1,i=o+2,r=o+s,n=r+1,p=r+2;a.copyItem(r,e),a.copyItem(t,n),a.copyItem(i,p),l.getVec(r,Oe),l.getVec(t,Be);const u=v?.[s]??T+g(Oe,Be);c.set(n,u)}else{const e=o,t=o+1,i=o+s,r=i+1;a.copyItem(t,e),a.copyItem(i,r)}const z=t.get("olidColor");W()&&null!=z&&null!=d&&ee(z,4,d,o)}_writeVertexBuffer(e,t,i,r){const{buffer:s,offset:n}=i,{layout:a}=this,o=t.get("position"),l=o.indices,c=o.data.length/3,p=this._isClosed(t),u=c+(p?3:2);l&&l.length!==2*(c-1)&&console.warn("RibbonLineMaterial does not support indices");const m=s.getField("textureElementIndex",O);Q(null!=m,"Missing texture buffer index field"),Q(null!=r,"Using a texture layout, but the texture range for this instance was not provided");const h=r.from;Q(r.numElements===u,"Expected number of elements in TextureBuffer to equal number of points");const f=new Float32Array(s.buffer),d=new Float16Array(s.buffer),g=new Uint32Array(s.buffer),_=a.stride/4;let b=n*_;const S=b,P=f.BYTES_PER_ELEMENT/d.BYTES_PER_ELEMENT,y=(e,t,i)=>{const r=i+1;g[b]=h+r,b++;let s=b*P;d[s++]=e,d[s++]=t,b=Math.ceil(s/P)};b+=_;let w=0,E=0;p?(w=0,E=c):(y(1,-4,0),y(1,4,0),w=1,E=c-1);for(let v=w;v<E;v++){y(0,-1,v),y(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const i=(t+1)/(e+1);y(i,-1,v),y(i,1,v)}y(1,-2,v),y(1,2,v)}p?(y(0,-1,E),y(0,1,E)):(y(0,-5,E),y(0,5,E)),ue(f,S+_,f,S,_);b=ue(f,b-_,f,b,_),this._parameters.wireframe&&this._addWireframeVertices(s,S,b,_)}_getTransformedPosition(e,t,i,r){const s=3*i;c(e,t[s+0],t[s+1],t[s+2]),r&&b(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),a=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=ue(n,e,s,o,a);for(let c=0;c<=n.length-4*a;c+=2*a)l(c),l(c+2*a),l(c+1*a),l(c+2*a),l(c+1*a),l(c+3*a)}}function ue(e,t,i,r,s){for(let n=0;n<s;n++)i[r++]=e[t++];return r}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t,i){return i?e/2+Ye*t:(e/2+Ye)*t}function*fe(e,t,i,r,s){const n=r.get("position").data,l=me(i,r)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;o(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const i=u%n.length;o(t,n[i]+c,n[i+1]+p),yield u/3,a(e,t)}}function de(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function ge(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return te+i}}const _e=new H,be=P(),Se=P(),Pe=l(),ye=l(),we=P(),Ee=P(),ve=P(),xe=P(),Te=P(),ze=P(),je=i(),Le=i(),Ce=r(),Ae=r(),Me=P(),Ve=P(),Fe=z(),Re=z(),Oe=P(),Be=P(),Ue=[i(),i(),i(),i()],Ie=[P(),P(),P(),P()],Ne=A(),ke=A(),We=A(),De=A(),Ye=4,Je=[P(),P()];export{ce as Parameters,oe as RibbonLineMaterial};
2
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as a,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as b,transformMat4 as _,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as E,distance2 as w,closestLineSegmentPoint as v,projectPoint as x,projectPointFraction as T,create as z}from"../../../../geometry/support/lineSegment.js";import{fromPoints as j,signedDistance as L,getNormal as A,create as C}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as M,BufferViewFloat as V,BufferViewVec4Unorm8 as O,BufferViewVec4f16 as F,BufferViewUint32 as R}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as B,isColor as I,isDepth as U,isColorHighlightOLIDOrDepth as N,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as W}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{LineMaterial as Y}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as G,DrapedHit as X}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{writeColor as ee}from"./internal/bufferWriterUtils.js";import{n as te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as se}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class oe extends Y{constructor(e,t){super(e,ce),this.produces=new Map([[2,e=>B(e)||I(e)&&8===this.parameters.renderOccluded],[3,e=>U(e)],[10,e=>N(e)&&8===this.parameters.renderOccluded],[11,e=>N(e)&&8===this.parameters.renderOccluded],[4,e=>I(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>I(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new ne(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&this.parameters.isImagePattern(),s=t&&(this.parameters.worldSized||r);this._configuration.draped=t,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ge(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&de(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.pbrMode=this.parameters.shadingEnabled?2:0,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!s,this._configuration.worldSized=s,this._configuration.imagePattern=r,I(e.output)&&this.parameters.shadingEnabled?(this._configuration.receiveAmbientOcclusion=null!=e.ssao,this._configuration.receiveGlobalIllumination=e.globalIlluminationEnabled):this._configuration.receiveAmbientOcclusion=this._configuration.receiveGlobalIllumination=!1}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},i,r,s,n,a){if(!i.options.selectionMode)return;const o=this._getLineSize(e,!0),l=r[0],c=r[1],p=he(o,a,this.parameters.worldSized);let u=Number.MAX_VALUE,m=0;for(const h of fe(Pe,ye,this.parameters,e)){const e=l-Pe[0],i=c-Pe[1],r=ye[0]-Pe[0],s=ye[1]-Pe[1],n=t((r*e+s*i)/(r*r+s*s),0,1),a=r*n-e,o=s*n-i,p=a*a+o*o;p<u&&(u=p,m=h)}u<p*p&&s(n.distance,n.renderDistance,n.normal,m)}intersectRay(t,i,r,s,n,o){const{options:l,camera:b,rayBegin:_,rayEnd:S}=r;if(!l.selectionMode||!t.visible||!b)return;if(!K(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,x=this._getLineSize(P),T=ze;a(T,r.point);const z=x*b.pixelRatio,C=Ye*b.pixelRatio,M=z/2+C;c(Ie[0],T[0]-M,T[1]+M,0),c(Ie[1],T[0]+M,T[1]+M,0),c(Ie[2],T[0]+M,T[1]-M,0),c(Ie[3],T[0]-M,T[1]-M,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(Ie[e],Ue[e]))return;j(b.eye,Ue[0],Ue[1],Ne),j(b.eye,Ue[1],Ue[2],ke),j(b.eye,Ue[2],Ue[3],We),j(b.eye,Ue[3],Ue[0],De);let V=Number.MAX_VALUE,O=0;for(const e of this._forEachTransformedLineSegment(_e,Se,y,i,me(this.parameters,P))){if(L(Ne,_e)<0&&L(Ne,Se)<0||L(ke,_e)<0&&L(ke,Se)<0||L(We,_e)<0&&L(We,Se)<0||L(De,_e)<0&&L(De,Se)<0)continue;const t=b.projectToRenderScreen(_e,je),i=b.projectToRenderScreen(Se,Le);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){p(xe,_e,Se);const e=b.frustum,i=-L(e[4],_e)/u(xe,A(e[4]));if(m(xe,xe,i),h(_e,_e,xe),!b.projectToRenderScreen(_e,t))continue}else if(t[2]>0&&i[2]<0){p(xe,Se,_e);const e=b.frustum,t=-L(e[4],Se)/u(xe,A(e[4]));if(m(xe,xe,t),h(Se,Se,xe),!b.projectToRenderScreen(Se,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=E(t,i,Oe),s=w(r,T);if(!(s>=V)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,_e,Se,T,b,x,C);if(s>=e*e)continue}V=s,f(Me,_e),f(Ve,Se),O=e}}if(V<M*M){let e=Number.MAX_VALUE;if(v(E(Me,Ve,Oe),E(_,S,Fe),Te)){p(Te,Te,_);const t=d(Te);m(Te,Te,1/t),e=t/g(_,S)}o(e,e,Te,O)}}intersectScreenPolygon(t,i,r,s){const{options:n,camera:a,screenPolygonPrimitiveProcessor:o}=r;if(!n.selectionMode||!t.visible)return null;if(!K(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Ye,m=u*a.pixelRatio,h=new G(4);for(const e of this._forEachTransformedLineSegment(_e,Se,c,i,me(this.parameters,l)))for(const[t,i]of o.processLineSegment(Je,_e,Se)){if(!J(a,t,i,je,Le))continue;const r=E(je,Le,Oe);let n=p/2+u;this.parameters.screenSizePerspective&&(b(ze,je,Le,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(r,t,i,ze,a,p,m)/a.pixelRatio)),a.renderToScreen(je,Ae),a.renderToScreen(Le,Ce),q(s,Ae,Ce,n)&&(x(E(t,i,Fe),a.eye,Ee),h.updateIfCloserFromValues(g(a.eye,Ee),e,Ee,null))}return h}intersectScreenPolygonDraped({attributes:e},t,i,r,s){if(!i.options.selectionMode)return null;const n=he(this._getLineSize(e,!0),s,this.parameters.worldSized);for(const a of fe(Pe,ye,this.parameters,e,t))if(q(r,Pe,ye,n))return new X(a);return null}createBufferWriter(){return new pe(ie(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new le(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,n,a){const o=T(e,r);b(Ee,t,i,o),_(we,Ee,s.viewMatrix);const l=d(we),c=this.computeCameraAbsCosAngle(Ee,s,this._configuration.spherical);be.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+a}computeCameraAbsCosAngle(e,t,i){return i?S(Te,e):c(Te,0,0,1),p(ve,e,t.eye),S(ve,ve),Math.abs(u(Te,ve))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const n=s?i.length-2:i.length-5;for(let a=0;a<n;a+=3){e[0]=i[a]+r[12],e[1]=i[a+1]+r[13],e[2]=i[a+2]+r[14];const s=(a+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield a/3}}}class le extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(se,e)}}class ce extends ${constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class pe{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=ge(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=r&&this._writeVertexBuffer(e,i,r,s)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,n=this._isClosed(t),{buffer:a,offset:o}=i,l=a.getField("position",M),c=a.getField("u0",V),p=a.getField("sizeFeatureAttribute",V),u=a.getField("size",V),m=a.getField("colorFeatureAttribute",V),h=a.getField("color",O),d=a.getField("olidColor",O),b=a.getField("timeStamps",F),_=a.getField("opacityFeatureAttribute",V),S=t.get("sizeFeatureAttribute")?.data,P=t.get("size")?.data,y=t.get("colorFeatureAttribute")?.data,E=t.get("color")?.data,w=t.get("opacityFeatureAttribute")?.data,v=t.get("distanceToStart")?.data,x=t.get("timeStamps");Q(null!==l,"Expected valid position field in texture buffer"),Q(null!==c,"Expected valid u0 field in texture buffer");let T=0;for(let j=0;j<s;++j){this._getTransformedPosition(Be,r.data,j,e),j>0&&(null!=v?T=v[j]??T:T+=g(Re,Be));const t=o+j+1;if(l.setVec(t,Be),c.set(t,T),f(Re,Be),p&&p.set(t,1===S?.length?S[0]:S?.[j]??0),u&&u.set(t,1===P?.length?P[0]:P?.[j]??1),m&&m.set(t,1===y?.length?y[0]:y?.[j]??0),h)if(null!=E){const e=Math.min(4*j,E.length-4);h.setValues(t,E[e],E[e+1],E[e+2],E[e+3])}else h.setValues(t,1,1,1,1);_&&_.set(t,1===w?.length?w[0]:w?.[j]??0)}if(null!=b&&null!=x){Q(4===x.size);const e=x.data;for(let t=0;t<s;++t){const i=4*t,r=o+t+1;b.set(r,0,e[i]),b.set(r,1,e[i+1]),b.set(r,2,e[i+2]),b.set(r,3,e[i+3])}}if(n){const e=o,t=o+1,i=o+2,r=o+s,n=r+1,p=r+2;a.copyItem(r,e),a.copyItem(t,n),a.copyItem(i,p),l.getVec(r,Re),l.getVec(t,Be);const u=v?.[s]??T+g(Re,Be);c.set(n,u)}else{const e=o,t=o+1,i=o+s,r=i+1;a.copyItem(t,e),a.copyItem(i,r)}const z=t.get("olidColor");W()&&null!=z&&null!=d&&ee(z,4,d,o)}_writeVertexBuffer(e,t,i,r){const{buffer:s,offset:n}=i,{layout:a}=this,o=t.get("position"),l=o.indices,c=o.data.length/3,p=this._isClosed(t),u=c+(p?3:2);l&&l.length!==2*(c-1)&&console.warn("RibbonLineMaterial does not support indices");const m=s.getField("textureElementIndex",R);Q(null!=m,"Missing texture buffer index field"),Q(null!=r,"Using a texture layout, but the texture range for this instance was not provided");const h=r.from;Q(r.numElements===u,"Expected number of elements in TextureBuffer to equal number of points");const f=new Float32Array(s.buffer),d=new Float16Array(s.buffer),g=new Uint32Array(s.buffer),b=a.stride/4;let _=n*b;const S=_,P=f.BYTES_PER_ELEMENT/d.BYTES_PER_ELEMENT,y=(e,t,i)=>{const r=i+1;g[_]=h+r,_++;let s=_*P;d[s++]=e,d[s++]=t,_=Math.ceil(s/P)};_+=b;let E=0,w=0;p?(E=0,w=c):(y(1,-4,0),y(1,4,0),E=1,w=c-1);for(let v=E;v<w;v++){y(0,-1,v),y(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const i=(t+1)/(e+1);y(i,-1,v),y(i,1,v)}y(1,-2,v),y(1,2,v)}p?(y(0,-1,w),y(0,1,w)):(y(0,-5,w),y(0,5,w)),ue(f,S+b,f,S,b);_=ue(f,_-b,f,_,b),this._parameters.wireframe&&this._addWireframeVertices(s,S,_,b)}_getTransformedPosition(e,t,i,r){const s=3*i;c(e,t[s+0],t[s+1],t[s+2]),r&&_(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),a=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=ue(n,e,s,o,a);for(let c=0;c<=n.length-4*a;c+=2*a)l(c),l(c+2*a),l(c+1*a),l(c+2*a),l(c+1*a),l(c+3*a)}}function ue(e,t,i,r,s){for(let n=0;n<s;n++)i[r++]=e[t++];return r}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t,i){return i?e/2+Ye*t:(e/2+Ye)*t}function*fe(e,t,i,r,s){const n=r.get("position").data,l=me(i,r)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;o(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const i=u%n.length;o(t,n[i]+c,n[i+1]+p),yield u/3,a(e,t)}}function de(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function ge(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return te+i}}const be=new H,_e=P(),Se=P(),Pe=l(),ye=l(),Ee=P(),we=P(),ve=P(),xe=P(),Te=P(),ze=P(),je=i(),Le=i(),Ae=r(),Ce=r(),Me=P(),Ve=P(),Oe=z(),Fe=z(),Re=P(),Be=P(),Ie=[i(),i(),i(),i()],Ue=[P(),P(),P(),P()],Ne=C(),ke=C(),We=C(),De=C(),Ye=4,Je=[P(),P()];export{ce as Parameters,oe as RibbonLineMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/NoPerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"./alphaCutoff.glsl.js";import"./AnimatedLine.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"./RibbonLineTextureBuffer.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build,n as numRoundJoinSubdivisions}from"../../../../chunks/RibbonLine.glsl.js";
2
+ import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/NoPerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"./alphaCutoff.glsl.js";import"./AnimatedLine.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"./RibbonLineTextureBuffer.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build,n as numRoundJoinSubdivisions}from"../../../../chunks/RibbonLine.glsl.js";