@arcgis/core 6.0.0-next.22 → 6.0.0-next.23

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 (217) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/analysis/LineOfSightAnalysis.d.ts +1 -1
  3. package/analysis/LineOfSightAnalysisObserver.d.ts +5 -4
  4. package/analysis/LineOfSightAnalysisTarget.d.ts +4 -4
  5. package/analysis/Viewshed.d.ts +4 -4
  6. package/arcgisGlobal.d.ts +0 -5
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/{3c277a0f099d67090d07.js → 02335385b1476fe322eb.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{4911ce62421a6c3320b0.js → 13c64087be3b2985a21b.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{8e19629899a5becf8e19.js → 150e7a7bd5df25693da7.js} +1 -1
  11. package/assets/esri/core/workers/chunks/2c0cb214fedb29487eef.js +1 -0
  12. package/assets/esri/core/workers/chunks/{2e096537a3a5555a4a93.js → 4cb751dc8d00bdaeb04c.js} +1 -1
  13. package/assets/esri/core/workers/chunks/517106048980a3cbe072.js +1 -0
  14. package/assets/esri/core/workers/chunks/{d08ff41e2a9bcd58b64a.js → 636cd05abfbdff19029e.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{84940d8e14caf5a27e04.js → 64b360625c68cb863a08.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{814751e705c05099f864.js → 7c75a8ee266c36baa902.js} +1 -1
  17. package/assets/esri/core/workers/chunks/947674b2ca8be65b9bcc.js +1 -0
  18. package/assets/esri/core/workers/chunks/{baed828b7846c0863289.js → 96c4ea9cfa3930f1c3fb.js} +21 -17
  19. package/assets/esri/core/workers/chunks/{8a485130781b49dbf608.js → 9d40786c5ceface786ba.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{a35c69a4751d28c39907.js → 9e7c4eda135c4911b268.js} +1 -1
  21. package/assets/esri/core/workers/chunks/ad96132bc89671e595f3.js +1 -0
  22. package/assets/esri/themes/base/_core.scss +0 -2
  23. package/assets/esri/themes/dark/main.css +1 -1
  24. package/assets/esri/themes/light/main.css +1 -1
  25. package/assets/esri/themes/light/view.css +1 -1
  26. package/chunks/Component.glsl.js +9 -12
  27. package/chunks/DefaultMaterial.glsl.js +4 -5
  28. package/chunks/Path.glsl.js +2 -4
  29. package/chunks/RealisticTree.glsl.js +3 -3
  30. package/chunks/SSAO.glsl.js +1 -2
  31. package/config.js +1 -1
  32. package/geometry/support/clipRay.js +1 -1
  33. package/geometry/support/plane.js +1 -1
  34. package/interfaces.d.ts +0 -55
  35. package/kernel.js +1 -1
  36. package/layers/ElevationLayer.d.ts +6 -2
  37. package/layers/GeoJSONLayer.d.ts +2 -107
  38. package/layers/IntegratedMeshLayer.js +1 -1
  39. package/layers/SceneLayer.d.ts +40 -16
  40. package/layers/ViewshedLayer.d.ts +10 -4
  41. package/layers/WMSLayer.d.ts +2 -69
  42. package/layers/mixins/TemporalLayer.d.ts +70 -48
  43. package/layers/mixins/TiledImagery.d.ts +0 -11
  44. package/package.json +2 -2
  45. package/popup/content.d.ts +38 -1
  46. package/popup/content.js +1 -1
  47. package/smartMapping/popup/support/clusterUtils.js +1 -1
  48. package/smartMapping/popup/support/utils.js +2 -2
  49. package/smartMapping/renderers/size.js +1 -1
  50. package/smartMapping/renderers/support/regenerateUtils.js +1 -1
  51. package/support/timeUtils.d.ts +11 -0
  52. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  53. package/views/2d/layers/features/Processor.js +1 -1
  54. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  55. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  56. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  57. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  58. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  59. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  60. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  61. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  62. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  63. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  64. package/views/2d/layers/features/processor/AggregateStrategy.js +1 -1
  65. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  66. package/views/2d/layers/features/processor/bins/BinAdapter.js +1 -1
  67. package/views/2d/layers/features/processor/bins/BinLevelState.js +1 -1
  68. package/views/2d/layers/features/processor/clusters/ClusterAdapter.js +1 -1
  69. package/views/2d/layers/features/processor/clusters/ClusterLevelState.js +1 -1
  70. package/views/2d/layers/features/processor/tracks/TrackAdapter.js +1 -1
  71. package/views/2d/layers/features/processor/tracks/TrackLevelState.js +1 -1
  72. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  73. package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
  74. package/views/2d/layers/features/sources/strategies/chunks/ByReferenceTileSourceChunk.js +1 -1
  75. package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
  76. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  77. package/views/2d/layers/features/sources/strategies/chunks/ParquetSnapshotSourceChunk.js +1 -1
  78. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  79. package/views/2d/layers/features/sources/strategies/chunks/StreamSourceChunk.js +1 -1
  80. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  81. package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
  82. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  83. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  84. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  85. package/views/3d/environment/SunLighting.d.ts +0 -1
  86. package/views/3d/environment/SunLighting.js +1 -1
  87. package/views/3d/environment/VirtualLighting.d.ts +0 -1
  88. package/views/3d/environment/VirtualLighting.js +1 -1
  89. package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
  90. package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
  91. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  92. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  93. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  94. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -2
  95. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +1 -2
  96. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +9 -4
  97. package/views/3d/webgl-engine/effects/snowcover/applySnow.glsl.js +18 -0
  98. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  99. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  100. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  101. package/views/3d/webgl-engine/materials/internal/worldSizedRibbonLineIntersectionUtils.js +2 -0
  102. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  103. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  104. package/views/layers/LineOfSightLayerView.d.ts +2 -2
  105. package/views/layers/ViewshedLayerView.d.ts +2 -1
  106. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  107. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  108. package/widgets/Locate.d.ts +1 -1
  109. package/widgets/Search/SearchViewModel.js +1 -1
  110. package/widgets/Search/support/layerSearchUtils.js +1 -1
  111. package/widgets/Sketch/SketchViewModel.js +1 -1
  112. package/widgets/Sketch/support/PluginManager.js +1 -1
  113. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  114. package/widgets/support/GeolocationPositioning.d.ts +1 -2
  115. package/assets/esri/core/workers/chunks/42045cf46497828cd3c0.js +0 -1
  116. package/assets/esri/core/workers/chunks/576248e9ae2654569420.js +0 -1
  117. package/assets/esri/core/workers/chunks/6059853ef3b6cddbe869.js +0 -1
  118. package/assets/esri/core/workers/chunks/a679207c3458cc0b1fec.js +0 -1
  119. package/assets/esri/themes/base/widgets/_DirectionalPad.scss +0 -85
  120. package/assets/esri/widgets/DirectionalPad/t9n/messages.ar.json +0 -1
  121. package/assets/esri/widgets/DirectionalPad/t9n/messages.bg.json +0 -1
  122. package/assets/esri/widgets/DirectionalPad/t9n/messages.bs.json +0 -1
  123. package/assets/esri/widgets/DirectionalPad/t9n/messages.ca.json +0 -1
  124. package/assets/esri/widgets/DirectionalPad/t9n/messages.cs.json +0 -1
  125. package/assets/esri/widgets/DirectionalPad/t9n/messages.da.json +0 -1
  126. package/assets/esri/widgets/DirectionalPad/t9n/messages.de.json +0 -1
  127. package/assets/esri/widgets/DirectionalPad/t9n/messages.el.json +0 -1
  128. package/assets/esri/widgets/DirectionalPad/t9n/messages.en.json +0 -1
  129. package/assets/esri/widgets/DirectionalPad/t9n/messages.es.json +0 -1
  130. package/assets/esri/widgets/DirectionalPad/t9n/messages.et.json +0 -1
  131. package/assets/esri/widgets/DirectionalPad/t9n/messages.fi.json +0 -1
  132. package/assets/esri/widgets/DirectionalPad/t9n/messages.fr.json +0 -1
  133. package/assets/esri/widgets/DirectionalPad/t9n/messages.he.json +0 -1
  134. package/assets/esri/widgets/DirectionalPad/t9n/messages.hr.json +0 -1
  135. package/assets/esri/widgets/DirectionalPad/t9n/messages.hu.json +0 -1
  136. package/assets/esri/widgets/DirectionalPad/t9n/messages.id.json +0 -1
  137. package/assets/esri/widgets/DirectionalPad/t9n/messages.it.json +0 -1
  138. package/assets/esri/widgets/DirectionalPad/t9n/messages.ja.json +0 -1
  139. package/assets/esri/widgets/DirectionalPad/t9n/messages.ko.json +0 -1
  140. package/assets/esri/widgets/DirectionalPad/t9n/messages.lt.json +0 -1
  141. package/assets/esri/widgets/DirectionalPad/t9n/messages.lv.json +0 -1
  142. package/assets/esri/widgets/DirectionalPad/t9n/messages.nl.json +0 -1
  143. package/assets/esri/widgets/DirectionalPad/t9n/messages.no.json +0 -1
  144. package/assets/esri/widgets/DirectionalPad/t9n/messages.pl.json +0 -1
  145. package/assets/esri/widgets/DirectionalPad/t9n/messages.pt-BR.json +0 -1
  146. package/assets/esri/widgets/DirectionalPad/t9n/messages.pt-PT.json +0 -1
  147. package/assets/esri/widgets/DirectionalPad/t9n/messages.ro.json +0 -1
  148. package/assets/esri/widgets/DirectionalPad/t9n/messages.ru.json +0 -1
  149. package/assets/esri/widgets/DirectionalPad/t9n/messages.sk.json +0 -1
  150. package/assets/esri/widgets/DirectionalPad/t9n/messages.sl.json +0 -1
  151. package/assets/esri/widgets/DirectionalPad/t9n/messages.sr.json +0 -1
  152. package/assets/esri/widgets/DirectionalPad/t9n/messages.sv.json +0 -1
  153. package/assets/esri/widgets/DirectionalPad/t9n/messages.th.json +0 -1
  154. package/assets/esri/widgets/DirectionalPad/t9n/messages.tr.json +0 -1
  155. package/assets/esri/widgets/DirectionalPad/t9n/messages.uk.json +0 -1
  156. package/assets/esri/widgets/DirectionalPad/t9n/messages.vi.json +0 -1
  157. package/assets/esri/widgets/DirectionalPad/t9n/messages.zh-CN.json +0 -1
  158. package/assets/esri/widgets/DirectionalPad/t9n/messages.zh-HK.json +0 -1
  159. package/assets/esri/widgets/DirectionalPad/t9n/messages.zh-TW.json +0 -1
  160. package/assets/esri/widgets/Track/t9n/messages.ar.json +0 -1
  161. package/assets/esri/widgets/Track/t9n/messages.bg.json +0 -1
  162. package/assets/esri/widgets/Track/t9n/messages.bs.json +0 -1
  163. package/assets/esri/widgets/Track/t9n/messages.ca.json +0 -1
  164. package/assets/esri/widgets/Track/t9n/messages.cs.json +0 -1
  165. package/assets/esri/widgets/Track/t9n/messages.da.json +0 -1
  166. package/assets/esri/widgets/Track/t9n/messages.de.json +0 -1
  167. package/assets/esri/widgets/Track/t9n/messages.el.json +0 -1
  168. package/assets/esri/widgets/Track/t9n/messages.en.json +0 -1
  169. package/assets/esri/widgets/Track/t9n/messages.es.json +0 -1
  170. package/assets/esri/widgets/Track/t9n/messages.et.json +0 -1
  171. package/assets/esri/widgets/Track/t9n/messages.fi.json +0 -1
  172. package/assets/esri/widgets/Track/t9n/messages.fr.json +0 -1
  173. package/assets/esri/widgets/Track/t9n/messages.he.json +0 -1
  174. package/assets/esri/widgets/Track/t9n/messages.hr.json +0 -1
  175. package/assets/esri/widgets/Track/t9n/messages.hu.json +0 -1
  176. package/assets/esri/widgets/Track/t9n/messages.id.json +0 -1
  177. package/assets/esri/widgets/Track/t9n/messages.it.json +0 -1
  178. package/assets/esri/widgets/Track/t9n/messages.ja.json +0 -1
  179. package/assets/esri/widgets/Track/t9n/messages.ko.json +0 -1
  180. package/assets/esri/widgets/Track/t9n/messages.lt.json +0 -1
  181. package/assets/esri/widgets/Track/t9n/messages.lv.json +0 -1
  182. package/assets/esri/widgets/Track/t9n/messages.nl.json +0 -1
  183. package/assets/esri/widgets/Track/t9n/messages.no.json +0 -1
  184. package/assets/esri/widgets/Track/t9n/messages.pl.json +0 -1
  185. package/assets/esri/widgets/Track/t9n/messages.pt-BR.json +0 -1
  186. package/assets/esri/widgets/Track/t9n/messages.pt-PT.json +0 -1
  187. package/assets/esri/widgets/Track/t9n/messages.ro.json +0 -1
  188. package/assets/esri/widgets/Track/t9n/messages.ru.json +0 -1
  189. package/assets/esri/widgets/Track/t9n/messages.sk.json +0 -1
  190. package/assets/esri/widgets/Track/t9n/messages.sl.json +0 -1
  191. package/assets/esri/widgets/Track/t9n/messages.sr.json +0 -1
  192. package/assets/esri/widgets/Track/t9n/messages.sv.json +0 -1
  193. package/assets/esri/widgets/Track/t9n/messages.th.json +0 -1
  194. package/assets/esri/widgets/Track/t9n/messages.tr.json +0 -1
  195. package/assets/esri/widgets/Track/t9n/messages.uk.json +0 -1
  196. package/assets/esri/widgets/Track/t9n/messages.vi.json +0 -1
  197. package/assets/esri/widgets/Track/t9n/messages.zh-CN.json +0 -1
  198. package/assets/esri/widgets/Track/t9n/messages.zh-HK.json +0 -1
  199. package/assets/esri/widgets/Track/t9n/messages.zh-TW.json +0 -1
  200. package/views/2d/layers/features/FeatureSpatialIndex.js +0 -2
  201. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +0 -2
  202. package/views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js +0 -12
  203. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +0 -85
  204. package/widgets/DirectionalPad/DirectionalPadViewModel.js +0 -2
  205. package/widgets/DirectionalPad/VisibleElements.d.ts +0 -40
  206. package/widgets/DirectionalPad/VisibleElements.js +0 -2
  207. package/widgets/DirectionalPad/constants.js +0 -2
  208. package/widgets/DirectionalPad/css.js +0 -2
  209. package/widgets/DirectionalPad/types.d.ts +0 -27
  210. package/widgets/DirectionalPad/utils.js +0 -2
  211. package/widgets/DirectionalPad.d.ts +0 -156
  212. package/widgets/DirectionalPad.js +0 -2
  213. package/widgets/Track/TrackViewModel.d.ts +0 -131
  214. package/widgets/Track/TrackViewModel.js +0 -2
  215. package/widgets/Track/types.d.ts +0 -6
  216. package/widgets/Track.d.ts +0 -278
  217. package/widgets/Track.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/SunLighting.js";var a;let o=a=class extends t(i){static calculateTimezoneOffset({hours:e,minutes:t,seconds:n}){return Math.round(e+t/60+n/3600)}constructor(e){super(e),this.cameraTrackingEnabled=!0,this.globalIllumination=!1,this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0},this.type=`sun`;let t=new Date().getFullYear(),n=new Date(`March 15, `+t+` 12:00:00 UTC`);this._set(`defaultDate`,n),this._set(`date`,n)}get defaultDate(){return new Date(this._get(`defaultDate`))}static fromWebsceneLighting(e){return new a(e.cloneConstructProperties())}set defaultDate(e){let t=this._get(`date`)===this._get(`defaultDate`);e=new Date(e),this._set(`defaultDate`,e),t&&this._set(`date`,e)}set date(e){e!=null&&(this.positionTimezoneInfo.autoUpdated=!1,this._set(`date`,new Date(e)))}autoUpdate(e,t){let n=a.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=t.hours,this.positionTimezoneInfo.minutes=t.minutes,this.positionTimezoneInfo.seconds=t.seconds;let r=null;e!=null&&(this.positionTimezoneInfo.autoUpdated=!0,isNaN(e.getTime())?(r=this.defaultDate.getTime(),this._set(`date`,this.defaultDate)):(r=this.date&&this.date.getTime(),this._set(`date`,new Date(e))));let i=a.calculateTimezoneOffset(this.positionTimezoneInfo);if(n!==i&&(s.target=this,s.timezoneOffset=i,this.emit(`timezone-will-change`,s),s.target=null),e!=null)return isNaN(e.getTime())||r!==e.getTime()}clone(){let e=this._get(`date`)===this._get(`defaultDate`),t=new a({...this.cloneConstructProperties(),...this.cloneNonPersistentConstructProperties(),defaultDate:this.defaultDate});return e&&t._set(`date`,t._get(`defaultDate`)),t.positionTimezoneInfo.autoUpdated=this.positionTimezoneInfo.autoUpdated,t.positionTimezoneInfo.hours=this.positionTimezoneInfo.hours,t.positionTimezoneInfo.minutes=this.positionTimezoneInfo.minutes,t.positionTimezoneInfo.seconds=this.positionTimezoneInfo.seconds,t}cloneWithWebsceneLighting(e){let t=this.clone();return e.date!=null&&(t.date=e.date),t.directShadowsEnabled=e.directShadowsEnabled,t.glow=e.glow?.clone(),t.displayUTCOffset=e.displayUTCOffset,t}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled,globalIllumination:this.globalIllumination}}};e([n({type:Boolean})],o.prototype,`cameraTrackingEnabled`,void 0),e([n({type:Boolean})],o.prototype,`globalIllumination`,void 0),e([n({type:Date})],o.prototype,`defaultDate`,null),e([n({type:Date})],o.prototype,`date`,null),e([n({readOnly:!0,type:[`sun`],json:{write:!0}})],o.prototype,`type`,void 0),o=a=e([r(`esri.views.3d.environment.SunLighting`)],o);const s={target:null,timezoneOffset:0},c=o;export{c as default};
2
+ import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import has from"../../../core/has.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/SunLighting.js";var a;let o=a=class extends t(i){static calculateTimezoneOffset({hours:e,minutes:t,seconds:n}){return Math.round(e+t/60+n/3600)}constructor(e){super(e),this.cameraTrackingEnabled=!0,this.globalIllumination=has(`enable-feature:global-illumination`)??!1,this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0},this.type=`sun`;let t=new Date().getFullYear(),n=new Date(`March 15, `+t+` 12:00:00 UTC`);this._set(`defaultDate`,n),this._set(`date`,n)}get defaultDate(){return new Date(this._get(`defaultDate`))}static fromWebsceneLighting(e){return new a(e.cloneConstructProperties())}set defaultDate(e){let t=this._get(`date`)===this._get(`defaultDate`);e=new Date(e),this._set(`defaultDate`,e),t&&this._set(`date`,e)}set date(e){e!=null&&(this.positionTimezoneInfo.autoUpdated=!1,this._set(`date`,new Date(e)))}autoUpdate(e,t){let n=a.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=t.hours,this.positionTimezoneInfo.minutes=t.minutes,this.positionTimezoneInfo.seconds=t.seconds;let r=null;e!=null&&(this.positionTimezoneInfo.autoUpdated=!0,isNaN(e.getTime())?(r=this.defaultDate.getTime(),this._set(`date`,this.defaultDate)):(r=this.date&&this.date.getTime(),this._set(`date`,new Date(e))));let i=a.calculateTimezoneOffset(this.positionTimezoneInfo);if(n!==i&&(s.target=this,s.timezoneOffset=i,this.emit(`timezone-will-change`,s),s.target=null),e!=null)return isNaN(e.getTime())||r!==e.getTime()}clone(){let e=this._get(`date`)===this._get(`defaultDate`),t=new a({...this.cloneConstructProperties(),...this.cloneNonPersistentConstructProperties(),defaultDate:this.defaultDate});return e&&t._set(`date`,t._get(`defaultDate`)),t.positionTimezoneInfo.autoUpdated=this.positionTimezoneInfo.autoUpdated,t.positionTimezoneInfo.hours=this.positionTimezoneInfo.hours,t.positionTimezoneInfo.minutes=this.positionTimezoneInfo.minutes,t.positionTimezoneInfo.seconds=this.positionTimezoneInfo.seconds,t}cloneWithWebsceneLighting(e){let t=this.clone();return e.date!=null&&(t.date=e.date),t.directShadowsEnabled=e.directShadowsEnabled,t.glow=e.glow?.clone(),t.displayUTCOffset=e.displayUTCOffset,t}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled,globalIllumination:this.globalIllumination}}};e([n({type:Boolean})],o.prototype,`cameraTrackingEnabled`,void 0),e([n({type:Boolean})],o.prototype,`globalIllumination`,void 0),e([n({type:Date})],o.prototype,`defaultDate`,null),e([n({type:Date})],o.prototype,`date`,null),e([n({readOnly:!0,type:[`sun`],json:{write:!0}})],o.prototype,`type`,void 0),o=a=e([r(`esri.views.3d.environment.SunLighting`)],o);const s={target:null,timezoneOffset:0},c=o;export{c as default};
@@ -52,7 +52,6 @@ export default class VirtualLighting extends VirtualLightingSuperclass {
52
52
  * - May produce temporarily noisy lighting after camera or scene changes.
53
53
  * - May reduce rendering performance.
54
54
  *
55
- * @default false
56
55
  * @beta
57
56
  * @since 5.2
58
57
  */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/VirtualLighting.js";var a;let o=a=class extends t(i){constructor(e){super(e),this.cameraTrackingEnabled=!0,this.globalIllumination=!1,this.type=`virtual`}clone(){return new a({...this.cloneConstructProperties(),...this.cloneNonPersistentConstructProperties()})}static fromWebsceneLighting(e){return new a(e.cloneConstructProperties())}cloneWithWebsceneLighting(e){let t=this.clone();return t.directShadowsEnabled=e.directShadowsEnabled,t.glow=e.glow?.clone(),t}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled,globalIllumination:this.globalIllumination}}};e([n({type:Boolean})],o.prototype,`cameraTrackingEnabled`,void 0),e([n({type:Boolean})],o.prototype,`globalIllumination`,void 0),e([n({readOnly:!0,type:[`virtual`],json:{write:{isRequired:!0}}})],o.prototype,`type`,void 0),o=a=e([r(`esri.views.3d.environment.VirtualLighting`)],o);const s=o;export{s as default};
2
+ import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../../core/Evented.js";import has from"../../../core/has.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../webscene/VirtualLighting.js";var a;let o=a=class extends t(i){constructor(e){super(e),this.cameraTrackingEnabled=!0,this.globalIllumination=has(`enable-feature:global-illumination`)??!1,this.type=`virtual`}clone(){return new a({...this.cloneConstructProperties(),...this.cloneNonPersistentConstructProperties()})}static fromWebsceneLighting(e){return new a(e.cloneConstructProperties())}cloneWithWebsceneLighting(e){let t=this.clone();return t.directShadowsEnabled=e.directShadowsEnabled,t.glow=e.glow?.clone(),t}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled,globalIllumination:this.globalIllumination}}};e([n({type:Boolean})],o.prototype,`cameraTrackingEnabled`,void 0),e([n({type:Boolean})],o.prototype,`globalIllumination`,void 0),e([n({readOnly:!0,type:[`virtual`],json:{write:{isRequired:!0}}})],o.prototype,`type`,void 0),o=a=e([r(`esri.views.3d.environment.VirtualLighting`)],o);const s=o;export{s as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{ignoreAbortErrors as e}from"../../../../../core/promiseUtils.js";import{createScreenPointArray as t}from"../../../../../core/screenUtils.js";import{copy as n,subtract as r,add as i,distance as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as s}from"../../../../../geometry/ellipsoidUtils.js";import{fromRenderCamera as c}from"../../../webgl.js";import{shortenTranslation as l}from"../../../state/utils/groundNavigationUtils.js";import{pickPointAndInitSphere as u}from"../../../state/utils/navigationUtils.js";import{OffsetCorrectionController as d}from"../../../state/utils/OffsetCorrectionController.js";import f from"../../../webgl/RenderCamera.js";import{InputHandler as p}from"../../../../input/InputHandler.js";import{eventMatchesPointerAction as m}from"../../../../input/handlers/support.js";class h extends p{constructor(e,t){super(!0),this._view=e,this._tmpTranslation=o(),this._tmpTargetLocation=o(),this._tmpCenterOffset=o(),this.registerIncoming(`double-click`,t,e=>this._handleDoubleClick(e)),this._offsetCorrectionController=new d(this._view)}_handleDoubleClick(e){if(this._view.navigation.mode.type!==`ground`)return;let{data:t}=e;m(t,`primary`)&&(this._move(e),e.stopPropagation())}_move(o){let d=this._view.state.camera,p=new f().copyFrom(d),m=t(o.data.x,o.data.y);if(this._view.state.isGlobal){let e=u(this._view,this._view.state.camera,m,s(this._view.spatialReference).radius,1,{});if(e.scenePickPoint==null||!e.hasGeometryIntersection)return;n(this._tmpTargetLocation,e.scenePickPoint)}else if(!this._view.sceneIntersectionHelper.intersectScreenFreePointFallback(m,this._tmpTargetLocation,{}))return;r(this._tmpTranslation,this._tmpTargetLocation,d.eye),l(this._tmpTranslation,this._tmpTranslation,.99,2),i(this._tmpTargetLocation,d.eye,this._tmpTranslation),r(this._tmpCenterOffset,p.center,p.eye),p.eye=this._tmpTargetLocation,p.center=i(this._tmpCenterOffset,this._tmpTargetLocation,this._tmpCenterOffset),this._offsetCorrectionController.immediatelyCorrectGroundElevation({camera:p,correctionLimit:1e3}),e(this._view.goTo(c(this._view,p),{liftOffDisabled:!0,duration:500*Math.max(1,Math.sqrt(a(p.eye,this._view.state.camera.eye)/100))}))}}export{h as GroundDoubleClickMove};
2
+ import{clock as e}from"../../../../../core/clock.js";import{removeMaybe as t}from"../../../../../core/maybe.js";import{ignoreAbortErrors as n}from"../../../../../core/promiseUtils.js";import{createScreenPointArray as r}from"../../../../../core/screenUtils.js";import{copy as i,subtract as a,add as o,distance as s}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../../../geometry/ellipsoidUtils.js";import{fromRenderCamera as u}from"../../../webgl.js";import{shortenTranslation as d}from"../../../state/utils/groundNavigationUtils.js";import{pickPointAndInitSphere as f}from"../../../state/utils/navigationUtils.js";import{OffsetCorrectionController as p}from"../../../state/utils/OffsetCorrectionController.js";import m from"../../../webgl/RenderCamera.js";import{InputHandler as h}from"../../../../input/InputHandler.js";import{eventMatchesPointerAction as g}from"../../../../input/handlers/support.js";class _ extends h{constructor(e,t){super(!0),this._view=e,this._tmpTranslation=c(),this._tmpTargetLocation=c(),this._tmpCenterOffset=c(),this._errorCursorHandle=null,this._errorTimeout=null,this.registerIncoming(`double-click`,t,e=>this._handleDoubleClick(e)),this._offsetCorrectionController=new p(this._view)}_handleDoubleClick(e){if(this._view.navigation.mode.type!==`ground`)return;let{data:t}=e;g(t,`primary`)&&(this._move(e),e.stopPropagation())}_move(e){let t=this._view.navigation.mode;if(t.type!==`ground`)return;let c=this._view.state.camera,p=new m().copyFrom(c),h=r(e.data.x,e.data.y);if(this._view.state.isGlobal){let e=f(this._view,this._view.state.camera,h,l(this._view.spatialReference).radius,1,{include:t.include,exclude:t.exclude});if(e.scenePickPoint==null||!e.hasGeometryIntersection){this._showErrorCursor();return}i(this._tmpTargetLocation,e.scenePickPoint)}else if(!this._view.sceneIntersectionHelper.intersectScreenFreePointFallback(h,this._tmpTargetLocation,{include:t.include,exclude:t.exclude})){this._showErrorCursor();return}a(this._tmpTranslation,this._tmpTargetLocation,c.eye),d(this._tmpTranslation,this._tmpTranslation,.99,2),o(this._tmpTargetLocation,c.eye,this._tmpTranslation),a(this._tmpCenterOffset,p.center,p.eye),p.eye=this._tmpTargetLocation,p.center=o(this._tmpCenterOffset,this._tmpTargetLocation,this._tmpCenterOffset),this._offsetCorrectionController.immediatelyCorrectGroundElevation({camera:p,correctionLimit:1e3}),n(this._view.goTo(u(this._view,p),{liftOffDisabled:!0,duration:500*Math.max(1,Math.sqrt(s(p.eye,this._view.state.camera.eye)/100))}))}onUninstall(){this._errorTimeout=t(this._errorTimeout),this._errorCursorHandle=t(this._errorCursorHandle),super.onUninstall()}_showErrorCursor(){this._errorTimeout=t(this._errorTimeout),this._errorCursorHandle=t(this._errorCursorHandle),this._errorCursorHandle=this._view.acquireCursor(`not-allowed`,`high`),this._errorTimeout=e.setTimeout(()=>{this._errorCursorHandle=t(this._errorCursorHandle),this._errorTimeout=null},500)}}export{_ as GroundDoubleClickMove};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../Camera.js";import{clock as n}from"../../../../core/clock.js";import r from"../../../../core/Logger.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{onAbort as a}from"../../../../core/promiseUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{property as s,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{subtract as l,add as u,copy as d,cross as f,normalize as p,scale as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../../../../geometry/Point.js";import{shortenTranslation as v}from"../../state/utils/groundNavigationUtils.js";import{OffsetCorrectionController as y}from"../../state/utils/OffsetCorrectionController.js";import b from"../../webgl/RenderCamera.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";let S=class extends x{constructor(e){super(e),this.isGroundNavigationPlacementTool=!0,this._internalAbortController=new AbortController,this._tmpMouseDirection=g(),this._tmpWorldUp=g(),this._tmpHorizontalForward=g(),this._tmpTranslation=g(),this._tmpScratchVector=g(),this._hasErrorCursor=!1}initialize(){this.signal&&this.addHandles([a(this.signal,()=>{this.cancel(),this.active&&(this.view.activeTool=null)})]),this.finishToolCreation()}cancel(){super.cancel(),this._internalAbortController?.abort()}onDeactivate(){this.emit(`cancel`)}get cursor(){return this.active?this._hasErrorCursor?`not-allowed`:`crosshair`:null}async onInputEvent(e){if(!this.active||e.type!==`immediate-click`)return;e.stopPropagation();let n=this.view.state.camera,i=this.view.sceneIntersectionHelper,a=g();if(!i.intersectScreen(o(e.x,e.y),a)){r.getLogger(this).warn(`The clicked location did not produce a valid target. Try again by clicking in a different location.`),this._showErrorCursor();return}if(l(this._tmpTranslation,a,n.eye),v(this._tmpTranslation,this._tmpTranslation,.999,.5),u(a,n.eye,this._tmpTranslation),this.groundMode?.offset){let e=new b().copyFrom(n);e.eye=a,new y(this.view).immediatelyCorrectGroundElevation({camera:e,navigationModeOverride:this.groundMode}),d(a,e.eye)}let s=this.cameraTurningEnabled?this._computeHeadingOffset(n,a):0,c=this.view.renderCoordsHelper.fromRenderCoords(a,new _({spatialReference:this.view.spatialReference})),f=new t({position:c,heading:this.view.camera.heading+s,tilt:85});this.emit(`success`,f),this.view.activeTool=null}_computeHeadingOffset(e,t){let n=this.view.renderCoordsHelper.worldUpAtPosition(t,this._tmpWorldUp),r=f(this._tmpHorizontalForward,n,e.viewRight);l(this._tmpMouseDirection,t,e.eye),p(this._tmpMouseDirection,this._tmpMouseDirection),l(this._tmpMouseDirection,this._tmpMouseDirection,m(this._tmpScratchVector,n,h(n,this._tmpMouseDirection))),p(this._tmpMouseDirection,this._tmpMouseDirection);let a=f(g(),this._tmpMouseDirection,r),o=Math.sign(h(a,n)),s=Math.acos(h(this._tmpMouseDirection,r));return o*i(s)}_showErrorCursor(){this._hasErrorCursor=!0,this._errorTimeout?.remove(),this._errorTimeout=n.setTimeout(()=>{this._hasErrorCursor=!1,this._errorTimeout=void 0},500)}};e([s({constructOnly:!0})],S.prototype,`view`,void 0),e([s({constructOnly:!0})],S.prototype,`signal`,void 0),e([s({constructOnly:!0})],S.prototype,`cameraTurningEnabled`,void 0),e([s({constructOnly:!0})],S.prototype,`groundMode`,void 0),e([s()],S.prototype,`_hasErrorCursor`,void 0),e([s({readOnly:!0})],S.prototype,`cursor`,null),S=e([c(`esri.views.3d.interactive.placementTools.GroundNavigationPlacementTool3D`)],S);export{S as GroundNavigationPlacementTool3D};
2
+ import{__decorate as e}from"tslib";import t from"../../../../Camera.js";import{clock as n}from"../../../../core/clock.js";import r from"../../../../core/Logger.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{removeMaybe as a}from"../../../../core/maybe.js";import{onAbort as o}from"../../../../core/promiseUtils.js";import{createScreenPointArray as s}from"../../../../core/screenUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{subtract as u,add as d,copy as f,cross as p,normalize as m,scale as h,dot as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../../../geometry/Point.js";import{shortenTranslation as y}from"../../state/utils/groundNavigationUtils.js";import{OffsetCorrectionController as b}from"../../state/utils/OffsetCorrectionController.js";import x from"../../webgl/RenderCamera.js";import{InteractiveToolBase as S}from"../../../interactive/InteractiveToolBase.js";let C=class extends S{constructor(e){super(e),this.isGroundNavigationPlacementTool=!0,this._internalAbortController=new AbortController,this._tmpMouseDirection=_(),this._tmpWorldUp=_(),this._tmpHorizontalForward=_(),this._tmpTranslation=_(),this._tmpScratchVector=_(),this._hasErrorCursor=!1,this._errorTimeout=null}initialize(){this.signal&&this.addHandles([o(this.signal,()=>{this.cancel(),this.active&&(this.view.activeTool=null)})]),this.finishToolCreation()}cancel(){super.cancel(),this._internalAbortController?.abort()}onDeactivate(){this.emit(`cancel`)}get cursor(){return this.active?this._hasErrorCursor?`not-allowed`:`crosshair`:null}async onInputEvent(e){if(!this.active||e.type!==`immediate-click`)return;e.stopPropagation();let n=this.view.state.camera,i=this.view.sceneIntersectionHelper,a=_();if(!i.intersectScreen(s(e.x,e.y),a,{include:this.groundMode?.include,exclude:this.groundMode?.exclude})){r.getLogger(this).warn(`The clicked location did not produce a valid target. Try again by clicking in a different location.`),this._showErrorCursor();return}if(u(this._tmpTranslation,a,n.eye),y(this._tmpTranslation,this._tmpTranslation,.999,.5),d(a,n.eye,this._tmpTranslation),this.groundMode?.offset){let e=new x().copyFrom(n);e.eye=a,new b(this.view).immediatelyCorrectGroundElevation({camera:e,navigationModeOverride:this.groundMode}),f(a,e.eye)}let o=this.cameraTurningEnabled?this._computeHeadingOffset(n,a):0,c=this.view.renderCoordsHelper.fromRenderCoords(a,new v({spatialReference:this.view.spatialReference})),l=new t({position:c,heading:this.view.camera.heading+o,tilt:85});this.emit(`success`,l),this.view.activeTool=null}_computeHeadingOffset(e,t){let n=this.view.renderCoordsHelper.worldUpAtPosition(t,this._tmpWorldUp),r=p(this._tmpHorizontalForward,n,e.viewRight);u(this._tmpMouseDirection,t,e.eye),m(this._tmpMouseDirection,this._tmpMouseDirection),u(this._tmpMouseDirection,this._tmpMouseDirection,h(this._tmpScratchVector,n,g(n,this._tmpMouseDirection))),m(this._tmpMouseDirection,this._tmpMouseDirection);let a=p(_(),this._tmpMouseDirection,r),o=Math.sign(g(a,n)),s=Math.acos(g(this._tmpMouseDirection,r));return o*i(s)}_showErrorCursor(){this._hasErrorCursor=!0,this._errorTimeout=a(this._errorTimeout),this._errorTimeout=n.setTimeout(()=>{this._hasErrorCursor=!1,this._errorTimeout=null},500)}};e([c({constructOnly:!0})],C.prototype,`view`,void 0),e([c({constructOnly:!0})],C.prototype,`signal`,void 0),e([c({constructOnly:!0})],C.prototype,`cameraTurningEnabled`,void 0),e([c({constructOnly:!0})],C.prototype,`groundMode`,void 0),e([c()],C.prototype,`_hasErrorCursor`,void 0),e([c({readOnly:!0})],C.prototype,`cursor`,null),C=e([l(`esri.views.3d.interactive.placementTools.GroundNavigationPlacementTool3D`)],C);export{C as GroundNavigationPlacementTool3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{lerp as e}from"../../../../core/mathUtils.js";import t from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as n,createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as a}from"../../../../core/units.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{add as c,normalize as l,dot as u,distance as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,copy as h,negativeInfinity as g,expandWithNestedArray as _}from"../../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as v}from"../../../../geometry/support/normalizeUtils.js";import{create as y}from"../../../../geometry/support/ray.js";import{sv3d as b}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as x}from"../../../../support/elevationInfoUtils.js";import{g as S}from"../../../../chunks/cameraUtilsSpherical.js";import{computeMapPointFromVec3d as C}from"../../support/hitTest.js";import{fromRenderAtEye as w,fromScreen as T}from"../../support/geometryUtils/ray.js";import{defaultTolerance as E,Intersector as D,defaultScreenPolygonPrimitiveProcessor as O}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as k,DrapedScreenPolygonIntersectionQuery as A}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j}from"../../webgl-engine/lib/IntersectorResult.js";import{SliceScreenPolygonPrimitiveProcessor as M,createSliceExtrusionHalfspacePlanes as N,clipPolygonAgainstSlicedAwayHalfspaces as P,sliceFilterPredicate as F}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as I}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";import{TaskPriority as L}from"../../../support/Scheduler.js";class R{constructor(e,n,r){this.viewingMode=e,this._forEachLayer=n,this._view=r,this._externalIntersectionHandlers=new t,this._tolerance=E,this._tmpRay=y(),this._tmpRegion=m(),this._validateHUDIntersector=new D(this.viewingMode),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(L.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}get screenPolygonIntersectionTask(){return this._screenPolygonIntersectionTask}intersectScreen(e,t,n){return this.intersectRay(this._getPickRay(e,this._tmpRay),H(this.viewingMode),t,n)}intersectScreenFreePointFallback(e,t,n){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,n)}intersectRayFreePointFallback(e,t,n){return this.intersectRay(e,H(this.viewingMode),t,n)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,n,r){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,r),t.results.min?t.results.min.getIntersectionPoint(n):!1}getCenterRayWithSubpixelOffset(e,t,n=.5,r=.5){return e.getRenderCenter(Z,n,r),Z[0]+=.0466,Z[1]-=.0123,w(e,Z,t)}intersectIntersectorScreen(e,t,n){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,n)}async intersectIntersectorScreenPolygon(e,t,n){t.polygonResults.init();let r=this._view.state.camera,i=await I(r,e);i!=null&&await this._screenPolygonIntersectionTask.scheduleGenerator(e=>this._intersectIntersectorScreenPolygon(r,t,i,n,e))}*_intersectIntersectorScreenPolygon(e,t,n,r,i){let a=new U(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r),t.camera=e,t.point=null,t.screenPolygonPrimitiveProcessor=O,yield*t.intersectScreenPolygon(a.layers,n);let o=this._view.slice.plane,s=o?new M(o):null;t.screenPolygonPrimitiveProcessor=s??O,yield*t.intersectScreenPolygon(a.sliceableLayers,n),t.screenPolygonPrimitiveProcessor=O,yield*this._intersectPolygonHandlersGenerator(t,a,n,null,s,void 0,!0,i),yield*this._intersectDrapedScreenPolygon(t,a,n,r),yield*t.intersectHUDScreenPolygon(a.layers,n),t.screenPolygonPrimitiveProcessor=s??O,yield*t.intersectHUDScreenPolygon(a.sliceableLayers,n),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,n){let r=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(r,t,n)}intersectToolIntersectorRay(e,t,n){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,n);let r=t.results.min;this._view.groundView.opaque||j(r)&&r.intersector!==7||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,n))}setTolerance(e=E){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}removeIntersectionHandler(e){this._externalIntersectionHandlers.removeUnordered(e)!=null&&this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}_getPickRay(e,t){let n=this._view.state.camera;return T(n,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==2||e==null||c(t,e.origin,l(b.get(),e.direction)),!1}intersectElevationFromScreen(e,t,n=0,r=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,n,r)}_intersectElevation(e,t,r=0,i=null){if(e==null)return null;let o=this._view,{renderCoordsHelper:s}=o,c=a(o.spatialReference),d=t==null?`absolute-height`:t.mode,f=x(t)/c,p=(d===`on-the-ground`?0:f+r)*c/s.unitInMeters,{camera:m}=o.state;if(d===`absolute-height`){let t=s?.getAltitude(m.eye),n=u(l(K,e.direction),s.worldUpAtPosition(m.eye,q));if(t<p&&n<0||t>=p&&n>0)return null;if(s.intersectInfiniteManifold(e,p,K)){let e=C(o,K);return e.z??=0,e.z-=f,e}return null}let h=m.projectToRenderScreen(e.origin,n(b.get())),g=new U(null,this._forEachLayer),_=o.slice.plane,v=_?F(_):null,y=new D(this.viewingMode);y.options.store=0,y.options.verticalOffset=p,y.options.normalRequired=!1;let S=this._createRayIntersectionQuery(e,h,!1);y.reset(S.beginPoint,S.endPoint,m),y.point=h;let w=null;if(i&&`type`in i&&i.type===`graphics`){let e=o.allLayerViews.find(e=>e.layer===i)?.uid;w=e?t=>t.layerViewUid===e:null}else i&&(w=e=>e.graphicUid!==i.uid);switch(d){case`relative-to-scene`:y.intersect(g.layers,S.screenPoint,this._tolerance,null,e=>(!w||w(e))&&!!e.lastValidElevationBB),this._intersectRayHandlers(y,g,S,v,!1,e=>e.type===2||e.type===7||e.type===8,!1);break;case`on-the-ground`:case`relative-to-ground`:this._intersectRayHandlers(y,g,S,v,!1,e=>e.isGround,!1)}if(y.results.min.getIntersectionPoint(K)){let e=C(o,K);return e.z=r,e}return null}computeIntersection(e,t,r,i){if(e==null)return;let a=this._view.state.camera,o=a.projectToRenderScreen(e.origin,n(b.get())),s=new U(i,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!i||!(`include`in i||`exclude`in i);let c=this._createRayIntersectionQuery(e,o,r);t.reset(c.beginPoint,c.endPoint,a),t.intersect(s.layers,c.screenPoint,this._tolerance,null,s.objectFilter);let l=this._view.slice.plane,u=l?F(l):null;t.intersect(s.sliceableLayers,c.screenPoint,this._tolerance,u,s.objectFilter);let d=i&&(i.requiresGroundFeedback||i.enableDraped);this._intersectRayHandlers(t,s,c,u,!!d,e=>s.allowedIntersectorTypes==null||s.allowedIntersectorTypes.has(e.type));let f=b.get(),p=this._view,m=p.groundView.spatialReference;if(i&&i.enableDraped&&m!=null&&t.results.ground.getIntersectionPoint(f)){let e=p.overlayManager.renderer,n=p.renderCoordsHelper.spatialReference,r=b.get();p.renderCoordsHelper.fromRenderCoords(f,r,m),r[2]=p.elevationProvider?.getElevation(f[0],f[1],f[2],n,`ground`)??0,e.intersectRay(t,r,t.results.ground,e=>s.filterRenderGeometry(e))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){let t=e.results.hud;h(this._tmpRegion,g);let n=[],r=this._tmpRegion,i=e=>{n.push(new z(e))};e.sortResults(t.all),t.min.distance!=null&&i(t.min);for(let e of t.all)t.min.target.object!==e.target.object&&t.max.target.object!==e.target.object&&i(e);if(t.max.distance!=null&&t.max.target.object!==t.min.target.object&&i(t.max),!n.length)return;r[0]===r[2]&&(r[2]+=1),r[1]===r[3]&&(r[3]+=1);let a=!0,o=e.results.max.distance==null,s=0;for(let t of n)a&&=(e.results.min.copy(t.result),!1),o&&e.results.max.copy(t.result),e.options.store===2&&e.results.all.splice(s++,0,t.result)}_createRayIntersectionQuery(e,t,n){return new k(e.origin,c(f(),e.origin,e.direction),t,n)}_intersectRayHandlers(e,t,n,r,i,a=()=>!0,o=!0){let{options:s}=e,c=s.isFiltered,l=s.filteredLayerViewUids;for(let{handler:c,filterPredicate:l,isFiltered:u,filteredLayerViewUids:d}of this._getFilteredIntersectionHandlers(t,r,null,a,o))(!u||c.isGround&&i)&&(s.isFiltered=u,s.filteredLayerViewUids=d,c.intersectRay(e,l,e.rayBegin,e.rayEnd,n.screenPoint,n.isVerticalRay));s.isFiltered=c,s.filteredLayerViewUids=l}*_intersectPolygonHandlersGenerator(e,t,n,r,i,a=()=>!0,o=!0,s){let{options:c}=e,l=c.isFiltered,u=c.filteredLayerViewUids,d=e.screenPolygonPrimitiveProcessor;for(let{handler:l,screenPolygonPrimitiveProcessor:u,isFiltered:d,filteredLayerViewUids:f}of this._getFilteredIntersectionHandlers(t,r,i,a,o))d||l.intersectScreenPolygon==null||(c.isFiltered=d,c.filteredLayerViewUids=f,e.screenPolygonPrimitiveProcessor=u??O,yield*l.intersectScreenPolygon(e,n,s));c.isFiltered=l,c.filteredLayerViewUids=u,e.screenPolygonPrimitiveProcessor=d}*_intersectDrapedScreenPolygon(e,t,n,r){let{basemapTerrain:i,overlayManager:a}=this._view,o=this._view.groundView.spatialReference!=null&&!a.renderer.isEmpty;if(!e.options.selectionMode||!r?.enableDraped||!o)return;let s=yield*this._createDrapedPolygonIntersectionQueries(n,i.slicePlaneEnabled?this._view.slice.plane:null);s!=null&&(yield*this._view.overlayManager.renderer.intersectScreenPolygon(e,s,e=>t.filterRenderGeometry(e)))}*_createDrapedPolygonIntersectionQueries(t,n){let{state:{camera:{eye:r}},pointsOfInterest:i}=this._view,a=this._view.groundView.spatialReference,c=[],l=n?[]:null,u=S(this._view,i.focus.renderLocation),f=v(a),m=1/0,h=null,g=K,_=q,y=e=>{if(!this._intersectDrapedScreenPolygonPoint(g,_,e))return!1;let t=h!=null&&f?h+f.shortestSignedDiff(h,g[0]):g[0];return h=t,c.push(s(t,g[1])),l&&l.push(p(_)),m=Math.min(m,d(r,_)),!0},{points:b}=t,{length:x}=b;for(let t=0;t<x;t++){let n=b[t],r=b[(t+1)%x];for(let t=0;t<u;t++){let i=t/u;if(!y(t===0?n:o(Y,e(n[0],r[0],i),e(n[1],r[1],i))))return null;yield}}if(!Number.isFinite(m))return null;if(n==null||!l)return[G(c,m)];let C=this._clipDrapedScreenPolygonIntersectionQueries(l,n,f,r);return C.length>0?C:null}_clipDrapedScreenPolygonIntersectionQueries(e,t,n,r){let i=[],a=N(t);for(let t of P(a,e)){let e=this._createDrapedQueryFromRenderPolygon(t,n,r);e!=null&&i.push(e)}return i.sort((e,t)=>e.distance-t.distance),i}_createDrapedQueryFromRenderPolygon(e,t,n){let{renderCoordsHelper:r}=this._view,i=this._view.groundView.spatialReference,a=[],o=1/0,c=null;for(let l of e){if(!r.fromRenderCoords(l,X,i))return null;let e=c!=null&&t?c+t.shortestSignedDiff(c,X[0]):X[0];c=e,a.push(s(e,X[1])),o=Math.min(o,d(n,l))}return a.length>=3&&Number.isFinite(o)?G(a,o):null}_intersectDrapedScreenPolygonPoint(e,t,n){let r=this._getPickRay(n,this._tmpRay);if(r==null)return!1;let{renderCoordsHelper:i}=this._view;this._intersectGroundPoint(t,r,n)||i.intersectManifoldClosestSilhouette(r,0,t);let a=this._view.groundView.spatialReference;return!!i.fromRenderCoords(t,e,a)}_intersectGroundPoint(e,t,n){let r=this._view.state.camera,i=new U(null,this._forEachLayer),a=new D(this.viewingMode);J[0]=n[0],J[1]=n[1],J[2]=0;let o=this._createRayIntersectionQuery(t,J,!1);return a.options.selectionMode=!0,a.options.store=0,a.options.normalRequired=!1,a.options.selectOpaqueTerrainOnly=!1,a.reset(o.beginPoint,o.endPoint,r),this._intersectRayHandlers(a,i,o,null,!0,e=>e.isGround,!1),a.results.ground.getIntersectionPoint(e)}*_getFilteredIntersectionHandlers(e,t,n,r=()=>!0,i=!0){for(let a of this._externalIntersectionHandlers){if(!r(a))continue;let o=!1,s=[];if(i){let t=a.layerViewUid,n=a.sublayerId,r=Array.isArray(t),i=r?t:[t],c=!1;for(let t of i)e.filterLayerViewUid(t,n)?c=!0:r&&s.push(t);o=!c}yield new B(a,a.slicePlaneEnabled?t:null,a.slicePlaneEnabled?n:null,o,s)}}}class z{constructor(e){this.result=e,this.screenPoint=r()}}class B{constructor(e,t,n,r,i){this.handler=e,this.filterPredicate=t,this.screenPolygonPrimitiveProcessor=n,this.isFiltered=r,this.filteredLayerViewUids=i}}let V;function H(e){return V&&V.viewingMode===e||(V=new D(e)),V}class U{constructor(e,t){this.layers=[],this.sliceableLayers=[],this.include=e?.include,this.exclude=e?.exclude,this.objectFilter=e?.objectFilter,this.allowedIntersectorTypes=e?.allowedIntersectorTypes,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){let{include:n,exclude:r}=this;if(e==null)return n==null&&r==null;let i=n instanceof Map?n.get(e)??!1:n?.has(e),a=r instanceof Map?r.get(e)??!1:r?.has(e);return(i==null||(typeof i==`boolean`?i:t!=null&&i.has(t)))&&(a==null||!(typeof a==`boolean`?a:t!=null&&a.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function W(e){return typeof e==`object`&&!!e&&`intersectRay`in e}function G(e,t){return new A(e,_(m(g),e),t)}const K=f(),q=f(),J=r(),Y=i(),X=f(),Z=r();export{R as SceneIntersectionHelper,W as isIntersectionHandler};
2
+ import{lerp as e}from"../../../../core/mathUtils.js";import t from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as n,createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as a}from"../../../../core/units.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{add as c,normalize as l,dot as u,distance as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,copy as h,negativeInfinity as g,expandWithNestedArray as _}from"../../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as v}from"../../../../geometry/support/normalizeUtils.js";import{create as y}from"../../../../geometry/support/ray.js";import{sv3d as b}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as x}from"../../../../support/elevationInfoUtils.js";import{g as S}from"../../../../chunks/cameraUtilsSpherical.js";import{computeMapPointFromVec3d as C}from"../../support/hitTest.js";import{fromRenderAtEye as w,fromScreen as T}from"../../support/geometryUtils/ray.js";import{defaultTolerance as E,Intersector as D,defaultScreenPolygonPrimitiveProcessor as O}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as k,DrapedScreenPolygonIntersectionQuery as A}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j}from"../../webgl-engine/lib/IntersectorResult.js";import{SliceScreenPolygonPrimitiveProcessor as M,createSliceExtrusionHalfspacePlanes as N,clipPolygonAgainstSlicedAwayHalfspaces as P,sliceFilterPredicate as F}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as I}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";import{TaskPriority as L}from"../../../support/Scheduler.js";class R{constructor(e,n,r){this.viewingMode=e,this._forEachLayer=n,this._view=r,this._externalIntersectionHandlers=new t,this._tolerance=E,this._tmpRay=y(),this._tmpRegion=m(),this._validateHUDIntersector=new D(this.viewingMode),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(L.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}get screenPolygonIntersectionTask(){return this._screenPolygonIntersectionTask}intersectScreen(e,t,n){return this.intersectRay(this._getPickRay(e,this._tmpRay),H(this.viewingMode),t,n)}intersectScreenFreePointFallback(e,t,n){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,n)}intersectRayFreePointFallback(e,t,n){return this.intersectRay(e,H(this.viewingMode),t,n)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,n,r){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,r),t.results.min?t.results.min.getIntersectionPoint(n):!1}getCenterRayWithSubpixelOffset(e,t,n=.5,r=.5){return e.getRenderCenter(Z,n,r),Z[0]+=.0466,Z[1]-=.0123,w(e,Z,t)}intersectIntersectorScreen(e,t,n){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,n)}async intersectIntersectorScreenPolygon(e,t,n){t.polygonResults.init();let r=this._view.state.camera,i=await I(r,e);i!=null&&await this._screenPolygonIntersectionTask.scheduleGenerator(e=>this._intersectIntersectorScreenPolygon(r,t,i,n,e))}*_intersectIntersectorScreenPolygon(e,t,n,r,i){let a=new U(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r),t.camera=e,t.point=null,t.screenPolygonPrimitiveProcessor=O,yield*t.intersectScreenPolygon(a.layers,n);let o=this._view.slice.plane,s=o?new M(o):null;t.screenPolygonPrimitiveProcessor=s??O,yield*t.intersectScreenPolygon(a.sliceableLayers,n),t.screenPolygonPrimitiveProcessor=O,yield*this._intersectPolygonHandlersGenerator(t,a,n,null,s,void 0,!0,i),yield*this._intersectDrapedScreenPolygon(t,a,n,r),yield*t.intersectHUDScreenPolygon(a.layers,n),t.screenPolygonPrimitiveProcessor=s??O,yield*t.intersectHUDScreenPolygon(a.sliceableLayers,n),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,n){let r=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(r,t,n)}intersectToolIntersectorRay(e,t,n){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,n);let r=t.results.min;this._view.groundView.opaque||j(r)&&r.intersector!==7||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,n))}setTolerance(e=E){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}removeIntersectionHandler(e){this._externalIntersectionHandlers.removeUnordered(e)!=null&&this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}_getPickRay(e,t){let n=this._view.state.camera;return T(n,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==2||e==null||c(t,e.origin,l(b.get(),e.direction)),!1}intersectElevationFromScreen(e,t,n=0,r=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,n,r)}_intersectElevation(e,t,r=0,i=null){if(e==null)return null;let o=this._view,{renderCoordsHelper:s}=o,c=a(o.spatialReference),d=t==null?`absolute-height`:t.mode,f=x(t)/c,p=(d===`on-the-ground`?0:f+r)*c/s.unitInMeters,{camera:m}=o.state;if(d===`absolute-height`){let t=s?.getAltitude(m.eye),n=u(l(K,e.direction),s.worldUpAtPosition(m.eye,q));if(t<p&&n<0||t>=p&&n>0)return null;if(s.intersectInfiniteManifold(e,p,K)){let e=C(o,K);return e.z??=0,e.z-=f,e}return null}let h=m.projectToRenderScreen(e.origin,n(b.get())),g=new U(null,this._forEachLayer),_=o.slice.plane,v=_?F(_):null,y=new D(this.viewingMode);y.options.store=0,y.options.verticalOffset=p,y.options.normalRequired=!1;let S=this._createRayIntersectionQuery(e,h,!1);y.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,y.reset(S.beginPoint,S.endPoint,m),y.point=h;let w=null;if(i&&`type`in i&&i.type===`graphics`){let e=o.allLayerViews.find(e=>e.layer===i)?.uid;w=e?t=>t.layerViewUid===e:null}else i&&(w=e=>e.graphicUid!==i.uid);switch(d){case`relative-to-scene`:y.intersect(g.layers,S.screenPoint,this._tolerance,null,e=>(!w||w(e))&&!!e.lastValidElevationBB),this._intersectRayHandlers(y,g,S,v,!1,e=>e.type===2||e.type===7||e.type===8,!1);break;case`on-the-ground`:case`relative-to-ground`:this._intersectRayHandlers(y,g,S,v,!1,e=>e.isGround,!1)}if(y.results.min.getIntersectionPoint(K)){let e=C(o,K);return e.z=r,e}return null}computeIntersection(e,t,r,i){if(e==null)return;let a=this._view.state.camera,o=a.projectToRenderScreen(e.origin,n(b.get())),s=new U(i,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!i||!(`include`in i||`exclude`in i);let c=this._createRayIntersectionQuery(e,o,r);t.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,t.reset(c.beginPoint,c.endPoint,a),t.intersect(s.layers,c.screenPoint,this._tolerance,null,s.objectFilter);let l=this._view.slice.plane,u=l?F(l):null;t.intersect(s.sliceableLayers,c.screenPoint,this._tolerance,u,s.objectFilter);let d=i&&(i.requiresGroundFeedback||i.enableDraped);this._intersectRayHandlers(t,s,c,u,!!d,e=>s.allowedIntersectorTypes==null||s.allowedIntersectorTypes.has(e.type));let f=b.get(),p=this._view,m=p.groundView.spatialReference;if(i&&i.enableDraped&&m!=null&&t.results.ground.getIntersectionPoint(f)){let e=p.overlayManager.renderer,n=p.renderCoordsHelper.spatialReference,r=b.get();p.renderCoordsHelper.fromRenderCoords(f,r,m),r[2]=p.elevationProvider?.getElevation(f[0],f[1],f[2],n,`ground`)??0,e.intersectRay(t,r,t.results.ground,e=>s.filterRenderGeometry(e))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){let t=e.results.hud;h(this._tmpRegion,g);let n=[],r=this._tmpRegion,i=e=>{n.push(new z(e))};e.sortResults(t.all),t.min.distance!=null&&i(t.min);for(let e of t.all)t.min.target.object!==e.target.object&&t.max.target.object!==e.target.object&&i(e);if(t.max.distance!=null&&t.max.target.object!==t.min.target.object&&i(t.max),!n.length)return;r[0]===r[2]&&(r[2]+=1),r[1]===r[3]&&(r[3]+=1);let a=!0,o=e.results.max.distance==null,s=0;for(let t of n)a&&=(e.results.min.copy(t.result),!1),o&&e.results.max.copy(t.result),e.options.store===2&&e.results.all.splice(s++,0,t.result)}_createRayIntersectionQuery(e,t,n){return new k(e.origin,c(f(),e.origin,e.direction),t,n)}_intersectRayHandlers(e,t,n,r,i,a=()=>!0,o=!0){let{options:s}=e,c=s.isFiltered,l=s.filteredLayerViewUids;for(let{handler:c,filterPredicate:l,isFiltered:u,filteredLayerViewUids:d}of this._getFilteredIntersectionHandlers(t,r,null,a,o))(!u||c.isGround&&i)&&(s.isFiltered=u,s.filteredLayerViewUids=d,c.intersectRay(e,l,e.rayBegin,e.rayEnd,n.screenPoint,n.isVerticalRay));s.isFiltered=c,s.filteredLayerViewUids=l}*_intersectPolygonHandlersGenerator(e,t,n,r,i,a=()=>!0,o=!0,s){let{options:c}=e,l=c.isFiltered,u=c.filteredLayerViewUids,d=e.screenPolygonPrimitiveProcessor;for(let{handler:l,screenPolygonPrimitiveProcessor:u,isFiltered:d,filteredLayerViewUids:f}of this._getFilteredIntersectionHandlers(t,r,i,a,o))d||l.intersectScreenPolygon==null||(c.isFiltered=d,c.filteredLayerViewUids=f,e.screenPolygonPrimitiveProcessor=u??O,yield*l.intersectScreenPolygon(e,n,s));c.isFiltered=l,c.filteredLayerViewUids=u,e.screenPolygonPrimitiveProcessor=d}*_intersectDrapedScreenPolygon(e,t,n,r){let{basemapTerrain:i,overlayManager:a}=this._view,o=this._view.groundView.spatialReference!=null&&!a.renderer.isEmpty;if(!e.options.selectionMode||!r?.enableDraped||!o)return;let s=yield*this._createDrapedPolygonIntersectionQueries(n,i.slicePlaneEnabled?this._view.slice.plane:null);s!=null&&(yield*this._view.overlayManager.renderer.intersectScreenPolygon(e,s,e=>t.filterRenderGeometry(e)))}*_createDrapedPolygonIntersectionQueries(t,n){let{state:{camera:{eye:r}},pointsOfInterest:i}=this._view,a=this._view.groundView.spatialReference,c=[],l=n?[]:null,u=S(this._view,i.focus.renderLocation),f=v(a),m=1/0,h=null,g=K,_=q,y=e=>{if(!this._intersectDrapedScreenPolygonPoint(g,_,e))return!1;let t=h!=null&&f?h+f.shortestSignedDiff(h,g[0]):g[0];return h=t,c.push(s(t,g[1])),l&&l.push(p(_)),m=Math.min(m,d(r,_)),!0},{points:b}=t,{length:x}=b;for(let t=0;t<x;t++){let n=b[t],r=b[(t+1)%x];for(let t=0;t<u;t++){let i=t/u;if(!y(t===0?n:o(Y,e(n[0],r[0],i),e(n[1],r[1],i))))return null;yield}}if(!Number.isFinite(m))return null;if(n==null||!l)return[G(c,m)];let C=this._clipDrapedScreenPolygonIntersectionQueries(l,n,f,r);return C.length>0?C:null}_clipDrapedScreenPolygonIntersectionQueries(e,t,n,r){let i=[],a=N(t);for(let t of P(a,e)){let e=this._createDrapedQueryFromRenderPolygon(t,n,r);e!=null&&i.push(e)}return i.sort((e,t)=>e.distance-t.distance),i}_createDrapedQueryFromRenderPolygon(e,t,n){let{renderCoordsHelper:r}=this._view,i=this._view.groundView.spatialReference,a=[],o=1/0,c=null;for(let l of e){if(!r.fromRenderCoords(l,X,i))return null;let e=c!=null&&t?c+t.shortestSignedDiff(c,X[0]):X[0];c=e,a.push(s(e,X[1])),o=Math.min(o,d(n,l))}return a.length>=3&&Number.isFinite(o)?G(a,o):null}_intersectDrapedScreenPolygonPoint(e,t,n){let r=this._getPickRay(n,this._tmpRay);if(r==null)return!1;let{renderCoordsHelper:i}=this._view;this._intersectGroundPoint(t,r,n)||i.intersectManifoldClosestSilhouette(r,0,t);let a=this._view.groundView.spatialReference;return!!i.fromRenderCoords(t,e,a)}_intersectGroundPoint(e,t,n){let r=this._view.state.camera,i=new U(null,this._forEachLayer),a=new D(this.viewingMode);J[0]=n[0],J[1]=n[1],J[2]=0;let o=this._createRayIntersectionQuery(t,J,!1);return a.options.selectionMode=!0,a.options.store=0,a.options.normalRequired=!1,a.options.selectOpaqueTerrainOnly=!1,a.reset(o.beginPoint,o.endPoint,r),this._intersectRayHandlers(a,i,o,null,!0,e=>e.isGround,!1),a.results.ground.getIntersectionPoint(e)}*_getFilteredIntersectionHandlers(e,t,n,r=()=>!0,i=!0){for(let a of this._externalIntersectionHandlers){if(!r(a))continue;let o=!1,s=[];if(i){let t=a.layerViewUid,n=a.sublayerId,r=Array.isArray(t),i=r?t:[t],c=!1;for(let t of i)e.filterLayerViewUid(t,n)?c=!0:r&&s.push(t);o=!c}yield new B(a,a.slicePlaneEnabled?t:null,a.slicePlaneEnabled?n:null,o,s)}}}class z{constructor(e){this.result=e,this.screenPoint=r()}}class B{constructor(e,t,n,r,i){this.handler=e,this.filterPredicate=t,this.screenPolygonPrimitiveProcessor=n,this.isFiltered=r,this.filteredLayerViewUids=i}}let V;function H(e){return V&&V.viewingMode===e||(V=new D(e)),V}class U{constructor(e,t){this.layers=[],this.sliceableLayers=[],this.include=e?.include,this.exclude=e?.exclude,this.objectFilter=e?.objectFilter,this.allowedIntersectorTypes=e?.allowedIntersectorTypes,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){let{include:n,exclude:r}=this;if(e==null)return n==null&&r==null;let i=n instanceof Map?n.get(e)??!1:n?.has(e),a=r instanceof Map?r.get(e)??!1:r?.has(e);return(i==null||(typeof i==`boolean`?i:t!=null&&i.has(t)))&&(a==null||!(typeof a==`boolean`?a:t!=null&&a.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function W(e){return typeof e==`object`&&!!e&&`intersectRay`in e}function G(e,t){return new A(e,_(m(g),e),t)}const K=f(),q=f(),J=r(),Y=i(),X=f(),Z=r();export{R as SceneIntersectionHelper,W as isIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{distance as n,normalize as r,cross as i,add as a,crossAndNormalize as o,subtract as s,dot as c,scaleAndAdd as l,scale as u,copy as d,length as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../../geometry/ellipsoidUtils.js";import{fromValues as h}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPositionAndNormal as _,distance as v,projectPoint as y,projectVector as b,intersectLineSegment as x}from"../../../../geometry/support/plane.js";import{create as S}from"../../../../geometry/support/ray.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{fromRenderCamera as w}from"../../webgl.js";import{getVoxelWasm as T}from"../../layers/VoxelWasm.js";import{pickPointAndInitSphere as E,sphereOrPlanePointFromScreenPoint as D,intersectPlaneFromScreenPoint as O,searchAreaSize as k}from"./navigationUtils.js";import{OffsetCorrectionController as ee}from"./OffsetCorrectionController.js";import{fromScreenAtEye as te}from"../../support/geometryUtils/ray.js";import ne from"../../webgl/RenderCamera.js";import{Intersector as A}from"../../webgl-engine/lib/Intersector.js";const j=1.5,M={xSpeedMultiplier:j,ySpeedMultiplier:j,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12},N=p(),P=p(),re=t(),F=p(),I=g(),L=p(),R=p(),z=p(),B=p(),V=p(),ie=p(),H=p(),U=p(),W=p(),G=p(),K=t(),q=S(),J=new C,Y=p(),ae=g(),X=p(),oe=p();function se(e,t){return b(t,e.viewForward,N),a(P,e.eye,N),e.projectToScreen(P,re),re[1]}function ce(e,t,d){let f=e.eye;if(n(t.center,f)<t.radius)return r(V,f),i(ie,V,e.viewRight),a(P,f,ie),e.projectToScreen(P,K),K[1];let p=e.up;te(e,d,q);let m=t.radius;if(o(F,p,q.direction),_(f,F,I),v(I,t.center)>m)return null;y(I,t.center,L);let h=n(t.center,L),g=Math.sqrt(m**2-h**2);s(R,f,L),r(z,R),o(B,F,z);let b=c(R,z),x=c(R,B),S=Math.sqrt(b**2+x**2),C=Math.sqrt(S**2-g**2),w=g**2/S**2,T=g/S**2*C,E=w*b,D=T*-x,O=w*x,k=T*b,ee=E+D,ne=E-D,A=O+k,j=O-k;return a(H,L,l(H,u(H,z,ee),B,A)),a(U,L,l(U,u(U,z,ne),B,j)),s(W,H,f),r(W,W),s(G,U,f),r(G,G),c(e.viewForward,W)>=c(e.viewForward,G)?e.projectToScreen(H,K):e.projectToScreen(U,K),K[1]}function le(e,t,n=!0){return n?e<t:e<=t}function Z(e,t,n=!0){return n?e>t:e>=t}function ue(e,t,n){return t?e>n:e<n}function Q(e,t){let n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(M.minimumHorizonPadding,M.relativeHorizonPadding*r)}function de(e,t){return[fe(e,t),pe(e,t)]}function fe(e,t){let n=e.fullHeight/e.pixelRatio;return Math.min(n,t+Q(e,t))}function pe(e,t){return Math.max(0,t-Q(e,t))}function me(e,t,n){let r={translation:e,location:t};return n&&(r.normal=n),r}function he(e){let{view:t}=e;return t.viewingMode===`global`?ge(e):_e(e)}function ge(e){let{view:t,originalScreenPoint:i,horizonY:a,horizonPadding:o,outTranslation:s,outGrabLocation:c,outGrabNormal:l,intersectionOptions:u,depthSearchSize:f}=e,p=t.state.camera,h=me(s,c,l);J.radius=m(t.spatialReference).radius;let g=E(t,p,i,J.radius,1,u);if(g.scenePickPoint==null)return!1;let _=g.hasGeometryIntersection;d(Y,g.scenePickPoint),d(h.location,Y);let v=g.sphere;h.normal&&g.normal&&d(h.normal,g.normal);let y=ye(i,a,o,_),b=_?n(Y,p.eye):1/0;return y.wasAdjusted&&be({view:t,screenAdjustment:y,intersector:$(t),fallbackCheck:(e,t,n)=>{let i=D(v,p,e,t);return i&&n&&r(n,t),i},output:h,intersectionOptions:u}),Se({view:t,screenPoint:y.adjustedScreenPoint,camera:p,initialDistance:b,depthSearchSize:f??k,output:h}),!0}function _e(e){let{view:t,originalScreenPoint:i,horizonY:a,horizonPadding:o,outTranslation:s,outGrabLocation:c,outGrabNormal:u,intersectionOptions:f,depthSearchSize:p}=e,m=t.sceneIntersectionHelper,h=t.state.camera,g=$(t),v=me(s,c,u);m.intersectIntersectorScreen(i,g,f);let y=g.results.min.getIntersectionPoint(Y),b=y?n(Y,h.eye):1/0;y&&(d(v.location,Y),v.normal&&d(v.normal,g.results.min.normal)),t.renderCoordsHelper.worldUpAtPosition(h.eye,V),l(X,h.eye,V,-h.relativeElevation),_(X,V,ae);let x=ye(i,a,o,y);return x.wasAdjusted&&be({view:t,screenAdjustment:x,intersector:g,fallbackCheck:(e,t,n)=>{let i=O(ae,h,e,t);return i&&n&&r(n,V),i},output:v,intersectionOptions:f}),Se({view:t,screenPoint:x.adjustedScreenPoint,camera:h,initialDistance:b,depthSearchSize:p??k,output:v}),!0}function ve(e,t,n,r){return!r&&le(e,t)||r&&ue(e,!1,n[0])?n[0]:!r&&Z(e,t,!1)?n[1]:null}function ye(e,n,r,i){let a=ve(e[1],n,r,i);return{originalScreenPoint:e,adjustedScreenPoint:t(e[0],a??e[1]),horizonY:n,horizonPadding:r,wasAdjusted:a!==null}}function $(e){let t=new A(e.state.viewingMode);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function be(e){let{view:t,screenAdjustment:n,fallbackCheck:r,intersector:i,output:a,intersectionOptions:o}=e,s=t.sceneIntersectionHelper;s.intersectIntersectorScreen(n.adjustedScreenPoint,i,{...o,requiresGroundFeedback:!0});let c=i.results.min.getIntersectionPoint(a.location);if(c){a.normal&&d(a.normal,i.results.min.normal);return}let l=xe(n);s.intersectIntersectorScreen(l,i,{...o,requiresGroundFeedback:!0}),c=i.results.min.getIntersectionPoint(a.location),c?a.normal&&d(a.normal,i.results.min.normal):(c=r(n.adjustedScreenPoint,a.location,a.normal),!c&&r(l,a.location,a.normal))}function xe(e){let{originalScreenPoint:n,adjustedScreenPoint:r,horizonY:i,horizonPadding:a}=e,o=Z(r[1],i)?Math.min(a[1],n[1]):Math.max(a[0],n[1]);return t(r[0],o)}function Se(e){Ce(e),we(e)}function Ce(e){let{view:t,camera:n,output:r}=e,{offset:i}=t.navigation.mode;if(!i)return;let{translation:a,location:o}=r;t.renderCoordsHelper.worldUpAtPosition(n.eye,V),l(X,n.eye,V,-i),_(X,V,I),x(I,h(n.eye,s(N,o,n.eye)),X)&&(d(o,X),s(a,o,n.eye))}function we(e){let{view:t,screenPoint:n,camera:i,initialDistance:o,depthSearchSize:c,output:l}=e,d=c>0?t.stage.renderView.getMinimalDepthForArea(T(t),n[0],n[1],i,c):null;s(l.translation,l.location,i.eye);let p=Math.min(f(l.translation),o);d&&d<=p&&(p=d),r(l.translation,l.translation),u(l.translation,l.translation,p),a(l.location,l.translation,i.eye)}async function Te(t,r){if(t.navigation.mode.type!==`ground`){e.getLogger(`esri`).warn(`Can only advance while in ground navigation mode!`);return}let{camera:i}=t.state;t.renderCoordsHelper.worldUpAtPosition(i.eye,V);let c=t.sceneIntersectionHelper,l=$(t),p=o(N,V,i.viewRight);d(q.origin,i.eye),u(q.direction,p,r);let m=c.intersectRay(q,l,Y),h=new ne().copyFrom(i),g=s(oe,i.center,i.eye);return!m||n(Y,i.eye)>r?h.eye=a(N,q.origin,q.direction):(s(N,Y,i.eye),f(N)>2&&(Ee(N,N,.25,2),h.eye=a(N,i.eye,N))),h.center=a(N,h.eye,g),new ee(t).immediatelyCorrectGroundElevation({camera:h,correctionLimit:100}),t.goTo(w(t,h),{duration:500,liftOffDisabled:!0})}function Ee(e,t,n,r){let i=f(e),a=Math.min(n,Math.max(i-r,0)/i);u(t,e,a)}export{Q as computeHorizonPadding,de as computeHorizonPaddingLimits,he as findGroundNavigationGrabLocation,se as findPlaneHorizonY,ce as findSphereHorizonY,Te as groundNavigationAdvance,M as groundNavigationConstants,le as isAboveHorizon,Z as isBelowHorizon,Ee as shortenTranslation,ue as shouldClampScreenY};
2
+ import e from"../../../../core/Logger.js";import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{distance as n,normalize as r,cross as i,add as a,crossAndNormalize as o,subtract as s,dot as c,scaleAndAdd as l,scale as u,copy as d,length as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../../geometry/ellipsoidUtils.js";import{fromValues as h}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPositionAndNormal as _,distance as v,projectPoint as y,projectVector as b,intersectLineSegment as x}from"../../../../geometry/support/plane.js";import{create as S}from"../../../../geometry/support/ray.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{fromRenderCamera as w}from"../../webgl.js";import{getVoxelWasm as T}from"../../layers/VoxelWasm.js";import{pickPointAndInitSphere as E,sphereOrPlanePointFromScreenPoint as D,intersectPlaneFromScreenPoint as O,searchAreaSize as k}from"./navigationUtils.js";import{OffsetCorrectionController as ee}from"./OffsetCorrectionController.js";import{fromScreenAtEye as te}from"../../support/geometryUtils/ray.js";import ne from"../../webgl/RenderCamera.js";import{Intersector as A}from"../../webgl-engine/lib/Intersector.js";const j=1.5,M={xSpeedMultiplier:j,ySpeedMultiplier:j,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12},N=p(),P=p(),re=t(),F=p(),I=g(),L=p(),R=p(),z=p(),B=p(),V=p(),ie=p(),H=p(),U=p(),W=p(),G=p(),K=t(),q=S(),J=new C,Y=p(),ae=g(),X=p(),oe=p();function se(e,t){return b(t,e.viewForward,N),a(P,e.eye,N),e.projectToScreen(P,re),re[1]}function ce(e,t,d){let f=e.eye;if(n(t.center,f)<t.radius)return r(V,f),i(ie,V,e.viewRight),a(P,f,ie),e.projectToScreen(P,K),K[1];let p=e.up;te(e,d,q);let m=t.radius;if(o(F,p,q.direction),_(f,F,I),v(I,t.center)>m)return null;y(I,t.center,L);let h=n(t.center,L),g=Math.sqrt(m**2-h**2);s(R,f,L),r(z,R),o(B,F,z);let b=c(R,z),x=c(R,B),S=Math.sqrt(b**2+x**2),C=Math.sqrt(S**2-g**2),w=g**2/S**2,T=g/S**2*C,E=w*b,D=T*-x,O=w*x,k=T*b,ee=E+D,ne=E-D,A=O+k,j=O-k;return a(H,L,l(H,u(H,z,ee),B,A)),a(U,L,l(U,u(U,z,ne),B,j)),s(W,H,f),r(W,W),s(G,U,f),r(G,G),c(e.viewForward,W)>=c(e.viewForward,G)?e.projectToScreen(H,K):e.projectToScreen(U,K),K[1]}function le(e,t,n=!0){return n?e<t:e<=t}function Z(e,t,n=!0){return n?e>t:e>=t}function ue(e,t,n){return t?e>n:e<n}function Q(e,t){let n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(M.minimumHorizonPadding,M.relativeHorizonPadding*r)}function de(e,t){return[fe(e,t),pe(e,t)]}function fe(e,t){let n=e.fullHeight/e.pixelRatio;return Math.min(n,t+Q(e,t))}function pe(e,t){return Math.max(0,t-Q(e,t))}function me(e,t,n){let r={translation:e,location:t};return n&&(r.normal=n),r}function he(e){let{view:t}=e;return t.viewingMode===`global`?ge(e):_e(e)}function ge(e){let{view:t,originalScreenPoint:i,horizonY:a,horizonPadding:o,outTranslation:s,outGrabLocation:c,outGrabNormal:l,intersectionOptions:u,depthSearchSize:f}=e,p=t.state.camera,h=me(s,c,l);J.radius=m(t.spatialReference).radius;let g=E(t,p,i,J.radius,1,u);if(g.scenePickPoint==null)return!1;let _=g.hasGeometryIntersection;d(Y,g.scenePickPoint),d(h.location,Y);let v=g.sphere;h.normal&&g.normal&&d(h.normal,g.normal);let y=ye(i,a,o,_),b=_?n(Y,p.eye):1/0;return y.wasAdjusted&&be({view:t,screenAdjustment:y,intersector:$(t),fallbackCheck:(e,t,n)=>{let i=D(v,p,e,t);return i&&n&&r(n,t),i},output:h,intersectionOptions:u}),Se({view:t,screenPoint:y.adjustedScreenPoint,camera:p,initialDistance:b,depthSearchSize:f??k,output:h}),!0}function _e(e){let{view:t,originalScreenPoint:i,horizonY:a,horizonPadding:o,outTranslation:s,outGrabLocation:c,outGrabNormal:u,intersectionOptions:f,depthSearchSize:p}=e,m=t.sceneIntersectionHelper,h=t.state.camera,g=$(t),v=me(s,c,u);m.intersectIntersectorScreen(i,g,f);let y=g.results.min.getIntersectionPoint(Y),b=y?n(Y,h.eye):1/0;y&&(d(v.location,Y),v.normal&&d(v.normal,g.results.min.normal)),t.renderCoordsHelper.worldUpAtPosition(h.eye,V),l(X,h.eye,V,-h.relativeElevation),_(X,V,ae);let x=ye(i,a,o,y);return x.wasAdjusted&&be({view:t,screenAdjustment:x,intersector:g,fallbackCheck:(e,t,n)=>{let i=O(ae,h,e,t);return i&&n&&r(n,V),i},output:v,intersectionOptions:f}),Se({view:t,screenPoint:x.adjustedScreenPoint,camera:h,initialDistance:b,depthSearchSize:p??k,output:v}),!0}function ve(e,t,n,r){return!r&&le(e,t)||r&&ue(e,!1,n[0])?n[0]:!r&&Z(e,t,!1)?n[1]:null}function ye(e,n,r,i){let a=ve(e[1],n,r,i);return{originalScreenPoint:e,adjustedScreenPoint:t(e[0],a??e[1]),horizonY:n,horizonPadding:r,wasAdjusted:a!==null}}function $(e){let t=new A(e.state.viewingMode);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function be(e){let{view:t,screenAdjustment:n,fallbackCheck:r,intersector:i,output:a,intersectionOptions:o}=e,s=t.sceneIntersectionHelper;s.intersectIntersectorScreen(n.adjustedScreenPoint,i,{...o,requiresGroundFeedback:!0});let c=i.results.min.getIntersectionPoint(a.location);if(c){a.normal&&d(a.normal,i.results.min.normal);return}let l=xe(n);s.intersectIntersectorScreen(l,i,{...o,requiresGroundFeedback:!0}),c=i.results.min.getIntersectionPoint(a.location),c?a.normal&&d(a.normal,i.results.min.normal):(c=r(n.adjustedScreenPoint,a.location,a.normal),!c&&r(l,a.location,a.normal))}function xe(e){let{originalScreenPoint:n,adjustedScreenPoint:r,horizonY:i,horizonPadding:a}=e,o=Z(r[1],i)?Math.min(a[1],n[1]):Math.max(a[0],n[1]);return t(r[0],o)}function Se(e){Ce(e),we(e)}function Ce(e){let{view:t,camera:n,output:r}=e,{offset:i}=t.navigation.mode;if(!i)return;let{translation:a,location:o}=r;t.renderCoordsHelper.worldUpAtPosition(n.eye,V),l(X,n.eye,V,-i),_(X,V,I),x(I,h(n.eye,s(N,o,n.eye)),X)&&(d(o,X),s(a,o,n.eye))}function we(e){let{view:t,screenPoint:n,camera:i,initialDistance:o,depthSearchSize:c,output:l}=e,d=c>0?t.stage.renderView.getMinimalDepthForArea(T(t),n[0],n[1],i,c):null;s(l.translation,l.location,i.eye);let p=Math.min(f(l.translation),o);d&&d<=p&&(p=d),r(l.translation,l.translation),u(l.translation,l.translation,p),a(l.location,l.translation,i.eye)}async function Te(t,r){let i=t.navigation.mode;if(i.type!==`ground`){e.getLogger(`esri`).warn(`Can only advance while in ground navigation mode!`);return}let{camera:c}=t.state;t.renderCoordsHelper.worldUpAtPosition(c.eye,V);let l=t.sceneIntersectionHelper,p=$(t),m=o(N,V,c.viewRight);d(q.origin,c.eye),u(q.direction,m,r);let h=l.intersectRay(q,p,Y,{include:i.include,exclude:i.exclude}),g=new ne().copyFrom(c),_=s(oe,c.center,c.eye);return!h||n(Y,c.eye)>r?g.eye=a(N,q.origin,q.direction):(s(N,Y,c.eye),f(N)>2&&(Ee(N,N,.25,2),g.eye=a(N,c.eye,N))),g.center=a(N,g.eye,_),new ee(t).immediatelyCorrectGroundElevation({camera:g,correctionLimit:100}),t.goTo(w(t,g),{duration:500,liftOffDisabled:!0})}function Ee(e,t,n,r){let i=f(e),a=Math.min(n,Math.max(i-r,0)/i);u(t,e,a)}export{Q as computeHorizonPadding,de as computeHorizonPaddingLimits,he as findGroundNavigationGrabLocation,se as findPlaneHorizonY,ce as findSphereHorizonY,Te as groundNavigationAdvance,M as groundNavigationConstants,le as isAboveHorizon,Z as isBelowHorizon,Ee as shortenTranslation,ue as shouldClampScreenY};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"./ComponentData.glsl.js";import"../../../core/shaderLibrary/bindUniforms.js";import"../../../core/shaderLibrary/forwardLinearDepthToWriteShadow.glsl.js";import"../../../core/shaderLibrary/ShaderOutput.js";import"../../../core/shaderLibrary/Slice.glsl.js";import"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../../../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../../../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import"../../../core/shaderLibrary/output/DepthConversion.glsl.js";import"../../../core/shaderLibrary/output/OutputDepth.glsl.js";import"../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../../../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../../../core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js";import"../../../core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import"../../../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../../../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../../../core/shaderLibrary/shading/lightingUniforms.js";import"../../../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../../../core/shaderLibrary/shading/pbrGlobals.glsl.js";import"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../../../core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import"../../../core/shaderLibrary/shading/readShadow.glsl.js";import"../../../core/shaderLibrary/terrain/Overlay.glsl.js";import"../../../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../../../core/shaderModules/BooleanDrawUniform.js";import"../../../core/shaderModules/FloatDrawUniform.js";import"../../../core/shaderModules/glsl.js";import"../../../effects/snowcover/SnowCover.glsl.js";import"../../../shaders/alphaCutoff.glsl.js";import"../../../shaders/OutputColorHighlightOLID.glsl.js";import"../../../shaders/SphereDepthInterpolate.glsl.js";import"../../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../../chunks/Component.glsl.js";
2
+ import"./ComponentData.glsl.js";import"../../../core/shaderLibrary/bindUniforms.js";import"../../../core/shaderLibrary/forwardLinearDepthToWriteShadow.glsl.js";import"../../../core/shaderLibrary/ShaderOutput.js";import"../../../core/shaderLibrary/Slice.glsl.js";import"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../../../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../../../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import"../../../core/shaderLibrary/output/DepthConversion.glsl.js";import"../../../core/shaderLibrary/output/OutputDepth.glsl.js";import"../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../../../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../../../core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js";import"../../../core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import"../../../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../../../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../../../core/shaderLibrary/shading/lightingUniforms.js";import"../../../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../../../core/shaderLibrary/shading/pbrGlobals.glsl.js";import"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../../../core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import"../../../core/shaderLibrary/shading/readShadow.glsl.js";import"../../../core/shaderLibrary/terrain/Overlay.glsl.js";import"../../../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../../../core/shaderModules/BooleanDrawUniform.js";import"../../../core/shaderModules/FloatDrawUniform.js";import"../../../core/shaderModules/glsl.js";import"../../../effects/snowcover/applySnow.glsl.js";import"../../../shaders/alphaCutoff.glsl.js";import"../../../shaders/OutputColorHighlightOLID.glsl.js";import"../../../shaders/SphereDepthInterpolate.glsl.js";import"../../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../../chunks/Component.glsl.js";
@@ -69,8 +69,7 @@ return groundRelative;
69
69
  aux.posModel += modelOffset;
70
70
  vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz;
71
71
  aux.posView += viewOffset;
72
- // Since we elevate the object, we need to take that into account
73
- // in the distance to ground
72
+ // Since we elevate the object, we need to take that into account in the distance to ground
74
73
  pointGroundDistance += worldOffset;`:``}
75
74
 
76
75
  float groundRelative = applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView);
@@ -69,8 +69,7 @@ import{depthMap as e}from"../bindUniforms.js";import{ReadDepth as t}from"../outp
69
69
 
70
70
  float projectedCoordDirectionLength = length(projectedCoordDirection);
71
71
 
72
- // normalize the projection direction depending on maximum steps
73
- // this determines how blocky the ray march looks
72
+ // normalize the projection direction depending on maximum steps this determines how blocky the ray march looks
74
73
  vec2 projectedStep = clampedRayMarchDistance * projectedCoordDirection / (rayMarchMaxSteps * projectedCoordDirectionLength);
75
74
 
76
75
  // Normalize the homogeneous camera space coordinates
@@ -25,13 +25,18 @@ float dispersionPerPixel = getDistanceFalloff(depth, rayDir, scattering * 0.5);
25
25
  float mainPoint = pow(dispersionPerPixel, 2.0);
26
26
  vec3 emission = vec3(0.0);
27
27
  float weights = 0.0;
28
- float sigmaSq = (0.1 / maxScattering * scattering + 0.003) + 0.03 * (boost - 1.0);
29
- for(float level = floor(mainPoint); level < levels; ++level) {
28
+ float baseSigmaSq = 0.003 + 0.03 * (boost - 1.0);
29
+ float sigmaSq = baseSigmaSq + 0.1 * scattering / maxScattering;
30
+ float minPoint = mainPoint - 0.5;
31
+ float fullPoint = (minPoint + mainPoint) * 0.5;
32
+ for(float level = 0.0; level < levels; ++level) {
30
33
  float point = level / levels;
31
- float dist = abs(point - mainPoint);
32
- float weight = gauss(dist, sigmaSq);
34
+ float dist = point - mainPoint;
35
+ float weight = gauss(dist, sigmaSq) * smoothstep(minPoint, fullPoint, point);
36
+ if(weight > 0.0) {
33
37
  emission += readEmission(point) * weight;
34
38
  weights += weight;
35
39
  }
40
+ }
36
41
  return emission * boost / weights;
37
42
  }`)}export{d as BlurEmissionPassParameters,f as applyEmissiveGlow};
@@ -0,0 +1,18 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{Gamma as e}from"../../core/shaderLibrary/shading/Gamma.glsl.js";import{pbrGlobals as t}from"../../core/shaderLibrary/shading/pbrGlobals.glsl.js";import{FloatBindUniform as n}from"../../core/shaderModules/FloatBindUniform.js";import{glsl as r}from"../../core/shaderModules/glsl.js";function i(i,a){a.snowCover&&(i.include(e),i.uniforms.add(new n(`snowCover`,e=>e.snowCover)).code.add(r`float applySnow(vec3 normal, vec3 groundNormal, inout vec3 albedo, inout float ssao) {
3
+ float snow = smoothstep(0.5, 0.55, dot(normal, groundNormal)) * snowCover;
4
+ albedo = delinearizeGamma(mix(linearizeGamma(albedo), vec3(1), snow));
5
+ ssao = mix(ssao, 0.5 + 0.5 * ssao, snow);
6
+ return snow;
7
+ }
8
+ float applyRealisticTreeSnow(vec3 faceNormal, vec3 shadingNormal, vec3 groundNormal, inout vec3 albedo, inout float ssao) {
9
+ float snow = min(1.0, smoothstep(0.5, 0.55, dot(faceNormal, groundNormal)) +
10
+ smoothstep(0.5, 0.55, dot(-faceNormal, groundNormal)) +
11
+ smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal))) *
12
+ snowCover;
13
+ albedo = delinearizeGamma(mix(linearizeGamma(albedo), vec3(1), snow));
14
+ ssao = mix(ssao, 0.5 + 0.5 * ssao, snow);
15
+ return snow;
16
+ }`),i.include(t),i.code.add(r`void applySnowToMRR(float snow) {
17
+ mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
18
+ }`))}export{i as applySnow};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{fromTranslation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{add as n,transformMat4 as r,copy as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as o}from"../../../../geometry/support/frustumPlanes.js";import{create as s,fromPoints as c,copy as l}from"../../../../geometry/support/ray.js";import u from"../../webgl/RenderCamera.js";import{HUDTarget as d,HUDIntersectorResult as f}from"./HUDIntersectorResult.js";import{IntersectorOptions as p}from"./IntersectorInterfaces.js";import{IntersectorResultRay as m,compareOrderedIntersectionHits as h}from"./IntersectorResult.js";import{ObjectTarget as g}from"./ObjectTarget.js";import{PolygonIntersectionResults as _}from"./PolygonIntersectionResults.js";import{IntersectorTransform as v,getVerticalOffsetObject3D as y}from"./verticalOffsetUtils.js";const b=1e-5,x=t();class S{constructor(e){this.options=new p,this._results=new C,this.polygonResults=new _,this.transform=new v,this.camera=new u,this.screenPolygonPrimitiveProcessor=w,this.tolerance=b,this.verticalOffset=null,this._ray=s(),this._rayEnd=a(),this._rayBeginTransformed=a(),this._rayEndTransformed=a(),this.viewingMode=e??1}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(e,t,n){this.resetWithRay(c(e,t,this._ray),n)}resetWithRay(e,t){this.camera=t,e!==this._ray&&l(e,this._ray),this.options.verticalOffset===0?this.verticalOffset=null:this.viewingMode===2?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset,n(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray),this.polygonResults.init()}intersect(e=null,t,n,r,i){this.point=t,this.filterPredicate=r,this.tolerance=n??b;let a=y(this.verticalOffset);if(e&&e.length>0){let t=i?e=>{i(e)&&this.intersectObject(e)}:e=>{this.intersectObject(e)};for(let n of e){let e=n.getSpatialQueryAccelerator?.();e==null?n.objects.forEach(e=>t(e)):(a==null?e.forEachAlongRay(this._ray.origin,this._ray.direction,t):e.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,t,a),this.options.selectionMode&&this.options.hud&&e.forEachDegenerateObject(t))}}this.sortResults()}*intersectScreenPolygon(e=null,t){if(this.verticalOffset=null,e?.length)for(let n of e){let e=n.getSpatialQueryAccelerator?.();if(e!=null)for(let n of e.intersectingFrustumValues(t.broadPhaseFrustum,e=>e.visible))yield*this._intersectScreenPolygonObject(n,t);else for(let e of n.objects.values())e.visible&&o(t.broadPhaseFrustum,e.boundingVolumeWorldSpace.sphere)&&(yield*this._intersectScreenPolygonObject(e,t))}}*intersectHUDScreenPolygon(e=null,t){if(this.verticalOffset=null,this.options.selectionMode&&this.options.hud&&e?.length)for(let n of e){let e=(n.getSpatialQueryAccelerator?.())?.degenerateObjectValues()??n.objects.values();for(let n of e)yield*this._intersectScreenPolygonObject(n,t)}}*_intersectScreenPolygonObject(e,t){let n=e.geometries;if(!e.visible||!n)return;let r=e.effectiveTransformation;for(let i of n){if(!i.visible)continue;let{material:n,id:a}=i;if(!n.visible||!n.intersectScreenPolygon)continue;this._setGeometryTransform(r,i);let o=n.intersectScreenPolygon(i,this.transform.transform,this,t);o?.valid&&this._handleObjectScreenPolygonIntersection(o.type,new g(e,a,o.primitiveIndex),o.distance,o.renderDistance,o.point),yield}}intersectObject(e){let t=e.geometries;if(!t)return;let n=e.effectiveTransformation,i=y(this.verticalOffset);for(let a of t){if(!a.visible)continue;let{material:t,id:o}=a;if(!t.visible)continue;this._setGeometryTransform(n,a),r(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),r(this._rayEndTransformed,this.rayEnd,this.transform.inverse);let s=this.transform.transform;i!=null&&(i.objectTransform=this.transform),t.intersectRay(a,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(t,n,r,i,a)=>this.handleObjectIntersection({object:e,geometryId:o,primitiveIndex:i},t,n,r,s,a))}}_setGeometryTransform(t,n){let r=n.type===1?e(x,n.localOrigin.vec3):n.transformation;this.transform.setAndInvalidateLazyTransforms(t,r)}handleObjectIntersection(e,t,n,r,i,a){if(t<0||this.filterPredicate!=null&&!this.filterPredicate(this._ray.origin,this._rayEnd,n))return;let o=a?this._results.hud:this._results;e=a?new d(e,a):e;let s=a?i=>i.set(1,e,t,n,r):a=>a.set(4,e,t,n,r,i);if((o.min.renderDistance==null||n<o.min.renderDistance)&&s(o.min),this.options.store!==0&&(o.max.renderDistance==null||n>o.max.renderDistance)&&s(o.max),this.options.store===2){if(a){let e=new f(this._ray);s(e),this._results.hud.all.push(e)}else{let e=new m(this._ray);s(e),this._results.all.push(e)}}}_handleObjectScreenPolygonIntersection(e,t,n,r,i){n<0||(this.filterPredicate==null||i!=null&&this.filterPredicate(this.camera.eye,i,1))&&this.polygonResults.add(e,e===1&&i?new d(t,i):t,n,r)}sortResults(e=this._results.all){e.sort(h)}}class C{constructor(){this.min=new m(s()),this.max=new m(s()),this.hud={min:new f(s()),max:new f(s()),all:[]},this.ground=new m(s()),this.all=[]}init(e){this.min.init(e),this.max.init(e),this.ground.init(e),this.all.length=0,this.hud.min.init(e),this.hud.max.init(e),this.hud.all.length=0}}const w={*processTriangle(e){yield e},*processLineSegment(e,t,n){i(e[0],t),i(e[1],n),yield e},validatePoint(){return!0}};export{S as Intersector,w as defaultScreenPolygonPrimitiveProcessor,b as defaultTolerance};
2
+ import{fromTranslation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{add as n,transformMat4 as r,copy as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as o}from"../../../../geometry/support/frustumPlanes.js";import{create as s,fromPoints as c,copy as l}from"../../../../geometry/support/ray.js";import u from"../../webgl/RenderCamera.js";import{HUDTarget as d,HUDIntersectorResult as f}from"./HUDIntersectorResult.js";import{IntersectorOptions as p}from"./IntersectorInterfaces.js";import{IntersectorResultRay as m,compareOrderedIntersectionHits as h}from"./IntersectorResult.js";import{ObjectTarget as g}from"./ObjectTarget.js";import{PolygonIntersectionResults as _}from"./PolygonIntersectionResults.js";import{IntersectorTransform as v,getVerticalOffsetObject3D as y}from"./verticalOffsetUtils.js";const b=1e-5,x=t();class S{constructor(e){this.options=new p,this._results=new C,this.polygonResults=new _,this.transform=new v,this.camera=new u,this.metersPerRenderUnit=1,this.screenPolygonPrimitiveProcessor=w,this.tolerance=b,this.verticalOffset=null,this._ray=s(),this._rayEnd=a(),this._rayBeginTransformed=a(),this._rayEndTransformed=a(),this.viewingMode=e??1}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(e,t,n){this.resetWithRay(c(e,t,this._ray),n)}resetWithRay(e,t){this.camera=t,e!==this._ray&&l(e,this._ray),this.options.verticalOffset===0?this.verticalOffset=null:this.viewingMode===2?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset,n(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray),this.polygonResults.init()}intersect(e=null,t,n,r,i){this.point=t,this.filterPredicate=r,this.tolerance=n??b;let a=y(this.verticalOffset);if(e&&e.length>0){let t=i?e=>{i(e)&&this.intersectObject(e)}:e=>{this.intersectObject(e)};for(let n of e){let e=n.getSpatialQueryAccelerator?.();e==null?n.objects.forEach(e=>t(e)):(a==null?e.forEachAlongRay(this._ray.origin,this._ray.direction,t):e.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,t,a),this.options.selectionMode&&this.options.hud&&e.forEachDegenerateObject(t))}}this.sortResults()}*intersectScreenPolygon(e=null,t){if(this.verticalOffset=null,e?.length)for(let n of e){let e=n.getSpatialQueryAccelerator?.();if(e!=null)for(let n of e.intersectingFrustumValues(t.broadPhaseFrustum,e=>e.visible))yield*this._intersectScreenPolygonObject(n,t);else for(let e of n.objects.values())e.visible&&o(t.broadPhaseFrustum,e.boundingVolumeWorldSpace.sphere)&&(yield*this._intersectScreenPolygonObject(e,t))}}*intersectHUDScreenPolygon(e=null,t){if(this.verticalOffset=null,this.options.selectionMode&&this.options.hud&&e?.length)for(let n of e){let e=(n.getSpatialQueryAccelerator?.())?.degenerateObjectValues()??n.objects.values();for(let n of e)yield*this._intersectScreenPolygonObject(n,t)}}*_intersectScreenPolygonObject(e,t){let n=e.geometries;if(!e.visible||!n)return;let r=e.effectiveTransformation;for(let i of n){if(!i.visible)continue;let{material:n,id:a}=i;if(!n.visible||!n.intersectScreenPolygon)continue;this._setGeometryTransform(r,i);let o=n.intersectScreenPolygon(i,this.transform.transform,this,t);o?.valid&&this._handleObjectScreenPolygonIntersection(o.type,new g(e,a,o.primitiveIndex),o.distance,o.renderDistance,o.point),yield}}intersectObject(e){let t=e.geometries;if(!t)return;let n=e.effectiveTransformation,i=y(this.verticalOffset);for(let a of t){if(!a.visible)continue;let{material:t,id:o}=a;if(!t.visible)continue;this._setGeometryTransform(n,a),r(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),r(this._rayEndTransformed,this.rayEnd,this.transform.inverse);let s=this.transform.transform;i!=null&&(i.objectTransform=this.transform),t.intersectRay(a,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(t,n,r,i,a)=>this.handleObjectIntersection({object:e,geometryId:o,primitiveIndex:i},t,n,r,s,a))}}_setGeometryTransform(t,n){let r=n.type===1?e(x,n.localOrigin.vec3):n.transformation;this.transform.setAndInvalidateLazyTransforms(t,r)}handleObjectIntersection(e,t,n,r,i,a){if(t<0||this.filterPredicate!=null&&!this.filterPredicate(this._ray.origin,this._rayEnd,n))return;let o=a?this._results.hud:this._results;e=a?new d(e,a):e;let s=a?i=>i.set(1,e,t,n,r):a=>a.set(4,e,t,n,r,i);if((o.min.renderDistance==null||n<o.min.renderDistance)&&s(o.min),this.options.store!==0&&(o.max.renderDistance==null||n>o.max.renderDistance)&&s(o.max),this.options.store===2){if(a){let e=new f(this._ray);s(e),this._results.hud.all.push(e)}else{let e=new m(this._ray);s(e),this._results.all.push(e)}}}_handleObjectScreenPolygonIntersection(e,t,n,r,i){n<0||(this.filterPredicate==null||i!=null&&this.filterPredicate(this.camera.eye,i,1))&&this.polygonResults.add(e,e===1&&i?new d(t,i):t,n,r)}sortResults(e=this._results.all){e.sort(h)}}class C{constructor(){this.min=new m(s()),this.max=new m(s()),this.hud={min:new f(s()),max:new f(s()),all:[]},this.ground=new m(s()),this.all=[]}init(e){this.min.init(e),this.max.init(e),this.ground.init(e),this.all.length=0,this.hud.min.init(e),this.hud.max.init(e),this.hud.all.length=0}}const w={*processTriangle(e){yield e},*processLineSegment(e,t,n){i(e[0],t),i(e[1],n),yield e},validatePoint(){return!0}};export{S as Intersector,w as defaultScreenPolygonPrimitiveProcessor,b as defaultTolerance};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/snowcover/SnowCover.glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";
2
+ import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/snowcover/applySnow.glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as C,closestLineSegmentPoint as w,projectPoint as T,projectPointFraction as E,create as D}from"../../../../geometry/support/lineSegment.js";import{fromPoints as O,signedDistance as k,getNormal as ee,create as A}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as j,BufferViewFloat as M,BufferViewVec4Unorm8 as N,BufferViewVec4f16 as te,BufferViewUint32 as ne}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as re,isColor as ie,isDepth as ae,isColorHighlightOLIDOrDepth as oe,is2DGeometryOutput as se}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as ce}from"../effects/geometry/olidUtils.js";import le from"../lib/GLMaterial.js";import{LineMaterial as ue}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as de,screenPolygonIntersectsBufferedSegment as fe}from"../lib/screenPolygonOverlapUtils.js";import{Hit as pe,DrapedHit as me}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as he}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as ge,assert as P}from"../lib/Util.js";import{isImagePattern as _e}from"./lineStippleUtils.js";import{VisualVariablePassParameters as ve}from"./VisualVariablePassParameters.js";import{writeColor as ye}from"./internal/bufferWriterUtils.js";import{n as be}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as xe,getTextureBufferLayout as Se}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Ce}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as we}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Te}from"../../../../webscene/support/AlphaCutoff.js";class Ee extends ue{constructor(e,t){super(e,Oe),this.produces=new Map([[2,e=>re(e)||ie(e)&&this.parameters.renderOccluded===8],[3,e=>ae(e)],[10,e=>oe(e)&&this.parameters.renderOccluded===8],[11,e=>oe(e)&&this.parameters.renderOccluded===8],[4,e=>ie(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>ie(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>se(e)]]),this._configuration=new we(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Ne(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Me(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n}get visible(){return this.parameters.color[3]>=Te||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Te}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=r[0],u=r[1],d=Ae(c,o,s,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let n of je(z,B,this.parameters,e)){let e=l-z[0],r=u-z[1],i=B[0]-z[0],a=B[1]-z[1],o=i*e+a*r,s=i*i+a*a,c=t(o/s,0,1),d=i*c-e,m=a*c-r,h=d*d+m*m;h<f&&(f=h,p=n)}f<d*d&&i(a.distance,a.renderDistance,a.normal,p)}intersectRay(t,n,r,i,a,s){let{options:c,camera:_,rayBegin:v,rayEnd:y}=r;if(!c.selectionMode||!t.visible||!_)return;if(!ge(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let b=t.attributes,x=b.get(`position`).data,T=this._getLineSize(b),E=Ie;o(E,r.point);let D=T*_.pixelRatio,A=$*_.pixelRatio,j=D/2+A;l(X[0],E[0]-j,E[1]+j,0),l(X[1],E[0]+j,E[1]+j,0),l(X[2],E[0]+j,E[1]-j,0),l(X[3],E[0]-j,E[1]-j,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(X[e],Z[e]))return;O(_.eye,Z[0],Z[1],He),O(_.eye,Z[1],Z[2],Ue),O(_.eye,Z[2],Z[3],We),O(_.eye,Z[3],Z[0],Q);let M=Number.MAX_VALUE,N=0;for(let e of this._forEachTransformedLineSegment(L,R,x,n,I(this.parameters,b))){if(k(He,L)<0&&k(He,R)<0||k(Ue,L)<0&&k(Ue,R)<0||k(We,L)<0&&k(We,R)<0||k(Q,L)<0&&k(Q,R)<0)continue;let t=_.projectToRenderScreen(L,G),n=_.projectToRenderScreen(R,K);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(U,L,R);let e=_.frustum,n=-k(e[4],L)/d(U,ee(e[4]));if(f(U,U,n),p(L,L,U),!_.projectToRenderScreen(L,t))continue}else if(t[2]>0&&n[2]<0){u(U,R,L);let e=_.frustum,t=-k(e[4],R)/d(U,ee(e[4]));if(f(U,U,t),p(R,R,U),!_.projectToRenderScreen(R,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let r=S(t,n,q),i=C(r,E);if(!(i>=M)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(r,L,R,E,_,T,A);if(i>=e*e)continue}M=i,m(ze,L),m(Be,R),N=e}}if(M<j*j){let e=Number.MAX_VALUE;if(w(S(ze,Be,q),S(v,y,Ve),W)){u(W,W,v);let t=h(W);f(W,W,1/t),e=t/g(v,y)}s(e,e,W,N)}}intersectScreenPolygon(t,n,r,i){let{options:a,camera:o,screenPolygonPrimitiveProcessor:s}=r;if(!a.selectionMode||!t.visible)return null;if(!ge(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let c=t.attributes,l=c.get(`position`).data,u=this._getLineSize(c),d=$,f=d*o.pixelRatio,p=new pe(4);for(let e of this._forEachTransformedLineSegment(L,R,l,n,I(this.parameters,c)))for(let[t,n]of s.processLineSegment(Ke,L,R)){if(!de(o,t,n,G,K))continue;let r=S(G,K,q),a=u/2+d;this.parameters.screenSizePerspective&&(_(Ie,G,K,.5),a=Math.max(a,this.computeScreenSizePerspectiveWidth(r,t,n,Ie,o,u,f)/o.pixelRatio)),o.renderToScreen(G,Le),o.renderToScreen(K,Re),fe(i,Le,Re,a)&&(T(S(t,n,Ve),o.eye,V),p.updateIfCloserFromValues(g(o.eye,V),e,V,null))}return p}intersectScreenPolygonDraped({attributes:e},t,n,r,i,a){if(!n.options.selectionMode)return null;let o=Ae(this._getLineSize(e,!0),i,a,this.parameters.usesWorldSizedWidth());for(let n of je(z,B,this.parameters,e,t))if(fe(r,z,B,o))return new me(n);return null}createBufferWriter(){return new ke(xe(this.parameters),Se(this.parameters),this.parameters,this._isAssumedMetalDriver)}createGLMaterial(e){return new De(e)}validateParameters(e){e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=E(e,r);_(V,t,n,s),v(Fe,V,i.viewMatrix);let c=h(Fe),l=this.computeCameraAbsCosAngle(V,i,this._configuration.spherical);return Pe.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Pe.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(W,e):l(W,0,0,1),u(H,e,t.eye),y(H,H),Math.abs(d(W,H))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=e.get(`sizeFeatureAttribute`).data[0];Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*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,n,r,i){let a=i?n.length-2:n.length-5;for(let i=0;i<a;i+=3){e[0]=n[i]+r[12],e[1]=n[i+1]+r[13],e[2]=n[i+2]+r[14];let a=(i+3)%n.length;t[0]=n[a]+r[12],t[1]=n[a+1]+r[13],t[2]=n[a+2]+r[14],yield i/3}}}class De extends le{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Ce,e)}}class Oe extends ve{constructor(){super(...arguments),this._width=0,this.color=x,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=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(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||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return _e(this.stipplePattern)&&this.stippleTexture!=null}}class ke{constructor(e,t,n,r){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this._isAssumedMetalDriver=r,this.numJoinSubdivisions=Ne(this._parameters.join,this._parameters.stipplePattern!=null)}_isClosed(e){return I(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){let t=e.get(`position`).indices.length/2+1,n=this._isClosed(e),r=n?2:4,i=+!n,a=n?t:t-1,o=this.numJoinSubdivisions*2+(this._isAssumedMetalDriver?8:4);return r+=(a-i)*o,r+=2,this._parameters.wireframe&&(r=2+(r-2)*4),r}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(e,n,r,i)}_writeTextureBuffer(e,t,n){let r=t.get(`position`),i=r.data.length/3,a=this._isClosed(t),{buffer:o,offset:s}=n,c=o.getField(`position`,j),l=o.getField(`u0`,M),u=o.getField(`sizeFeatureAttribute`,M),d=o.getField(`size`,M),f=o.getField(`colorFeatureAttribute`,M),p=o.getField(`color`,N),h=o.getField(`olidColor`,N),_=o.getField(`timeStamps`,te),v=o.getField(`opacityFeatureAttribute`,M),y=t.get(`sizeFeatureAttribute`)?.data,b=t.get(`size`)?.data,x=t.get(`colorFeatureAttribute`)?.data,S=t.get(`color`)?.data,C=t.get(`opacityFeatureAttribute`)?.data,w=t.get(`distanceToStart`)?.data,T=t.get(`timeStamps`);P(c!==null,`Expected valid position field in texture buffer`),P(l!==null,`Expected valid u0 field in texture buffer`);let E=0;for(let t=0;t<i;++t){this._getTransformedPosition(Y,r.data,t,e),t>0&&(w==null?E+=g(J,Y):E=w[t]??E);let n=s+t+1;if(c.setVec(n,Y),l.set(n,E),m(J,Y),u&&u.set(n,y?.length===1?y[0]:y?.[t]??0),d&&d.set(n,b?.length===1?b[0]:b?.[t]??1),f&&f.set(n,x?.length===1?x[0]:x?.[t]??0),p){if(S!=null){let e=Math.min(t*4,S.length-4);p.setValues(n,S[e],S[e+1],S[e+2],S[e+3])}else p.setValues(n,1,1,1,1)}v&&v.set(n,C?.length===1?C[0]:C?.[t]??0)}if(_!=null&&T!=null){P(T.size===4);let e=T.data;for(let t=0;t<i;++t){let n=t*4,r=s+t+1;_.set(r,0,e[n]),_.set(r,1,e[n+1]),_.set(r,2,e[n+2]),_.set(r,3,e[n+3])}}if(a){let e=s,t=s+1,n=s+2,r=s+i,a=r+1,u=r+2;o.copyItem(r,e),o.copyItem(t,a),o.copyItem(n,u),c.getVec(r,J),c.getVec(t,Y);let d=w?.[i]??E+g(J,Y);l.set(a,d)}else{let e=s,t=s+1,n=s+i,r=n+1;o.copyItem(t,e),o.copyItem(n,r)}let D=t.get(`olidColor`);ce()&&D!=null&&h!=null&&ye(D,4,h,s)}_writeVertexBuffer(e,t,n,r){let{buffer:i,offset:a}=n,{layout:o}=this,s=t.get(`position`),c=s.indices,l=s.data.length/3,u=this._isClosed(t),d=l+(u?3:2);c&&c.length!==2*(l-1)&&console.warn(`RibbonLineMaterial does not support indices`);let f=i.getField(`textureElementIndex`,ne);P(f!=null,`Missing texture buffer index field`),P(r!=null,`Using a texture layout, but the texture range for this instance was not provided`);let p=r.from;P(r.numElements===d,`Expected number of elements in TextureBuffer to equal number of points`);let m=new Float32Array(i.buffer),h=new Float16Array(i.buffer),g=new Uint32Array(i.buffer),_=o.stride/4,v=a*_,y=v,b=m.BYTES_PER_ELEMENT/h.BYTES_PER_ELEMENT,x=(e,t,n,r=!1)=>{let i=n+1;g[v]=p+i,v++;let a=v*b;h[a++]=e,h[a++]=t+(r?Math.sign(t)*8:0),v=Math.ceil(a/b)};v+=_;let S=0,C=0;u?(S=0,C=l):(x(1,-4,0),x(1,4,0),S=1,C=l-1);let w=this._isAssumedMetalDriver;for(let e=S;e<C;e++){x(0,-1,e),x(0,1,e),w&&(x(0,-1,e,!0),x(0,1,e,!0));let t=this.numJoinSubdivisions;for(let n=0;n<t;++n){let r=(n+1)/(t+1);x(r,-1,e,w),x(r,1,e,w)}x(1,-2,e,w),x(1,2,e,w),w&&(x(1,-2,e),x(1,2,e))}u?(x(0,-1,C),x(0,1,C)):(x(0,-5,C),x(0,5,C)),F(m,y+_,m,y,_),v=F(m,v-_,m,v,_),this._parameters.wireframe&&this._addWireframeVertices(i,y,v,_)}_getTransformedPosition(e,t,n,r){let i=n*3;l(e,t[i+0],t[i+1],t[i+2]),r&&v(e,e,r)}_addWireframeVertices(e,t,n,r){let i=new Uint8Array(e.buffer,n*Float32Array.BYTES_PER_ELEMENT),a=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(n-t)*Float32Array.BYTES_PER_ELEMENT),o=r*Float32Array.BYTES_PER_ELEMENT,s=0,c=e=>s=F(a,e,i,s,o);for(let e=0;e<=a.length-4*o;e+=o*2)c(e),c(e+2*o),c(e+1*o),c(e+2*o),c(e+1*o),c(e+3*o)}}function F(e,t,n,r,i){for(let a=0;a<i;a++)n[r++]=e[t++];return r}function I(e,t){return e.isClosed?t.get(`position`).indices.length>2:!1}function Ae(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*je(e,t,n,r,i){let a=r.get(`position`).data,c=I(n,r)?a.length-2:a.length-5,l=i?.[0]??0,u=i?.[1]??0;s(e,a[0]+l,a[1]+u);for(let n=3;n<c+3;n+=3){let r=n%a.length;s(t,a[r]+l,a[r+1]+u),yield n/3,o(e,t)}}function Me(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}function Ne(e,t){let n=+!!t;switch(e){case`miter`:case`bevel`:return n;case`round`:return be+n}}const Pe=new he,L=b(),R=b(),z=c(),B=c(),V=b(),Fe=b(),H=b(),U=b(),W=b(),Ie=b(),G=n(),K=n(),Le=r(),Re=r(),ze=b(),Be=b(),q=D(),Ve=D(),J=b(),Y=b(),X=[n(),n(),n(),n()],Z=[b(),b(),b(),b()],He=A(),Ue=A(),We=A(),Q=A(),$=4,Ge={getDrapedRibbonLineMaxDistance:Ae},Ke=[b(),b()];export{Oe as Parameters,Ee as RibbonLineMaterial,Ge as test};
2
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as C,closestLineSegmentPoint as w,projectPoint as T,projectPointFraction as E,create as D}from"../../../../geometry/support/lineSegment.js";import{fromPoints as O,signedDistance as k,getNormal as ee,create as A}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as te,BufferViewFloat as j,BufferViewVec4Unorm8 as ne,BufferViewVec4f16 as re,BufferViewUint32 as ie}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as ae,isColor as M,isDepth as oe,isColorHighlightOLIDOrDepth as se,is2DGeometryOutput as ce}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as le}from"../effects/geometry/olidUtils.js";import ue from"../lib/GLMaterial.js";import{LineMaterial as de}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as fe,screenPolygonIntersectsBufferedSegment as pe}from"../lib/screenPolygonOverlapUtils.js";import{Hit as me,DrapedHit as he}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as ge}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as _e,assert as N}from"../lib/Util.js";import{isImagePattern as ve}from"./lineStippleUtils.js";import{VisualVariablePassParameters as ye}from"./VisualVariablePassParameters.js";import{writeColor as be}from"./internal/bufferWriterUtils.js";import{intersectRayWithWorldSizedLineSegment as xe}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{n as Se}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as Ce,getTextureBufferLayout as we}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Te}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Ee}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as De}from"../../../../webscene/support/AlphaCutoff.js";class Oe extends de{constructor(e,t){super(e,Ae),this.produces=new Map([[2,e=>ae(e)||M(e)&&this.parameters.renderOccluded===8],[3,e=>oe(e)],[10,e=>se(e)&&this.parameters.renderOccluded===8],[11,e=>se(e)&&this.parameters.renderOccluded===8],[4,e=>M(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>M(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>ce(e)]]),this._configuration=new Ee(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Pe(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Ne(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n}get visible(){return this.parameters.color[3]>=De||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>De}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=r[0],u=r[1],d=I(c,o,s,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let n of Me(z,B,this.parameters,e)){let e=l-z[0],r=u-z[1],i=B[0]-z[0],a=B[1]-z[1],o=i*e+a*r,s=i*i+a*a,c=t(o/s,0,1),d=i*c-e,m=a*c-r,h=d*d+m*m;h<f&&(f=h,p=n)}f<d*d&&i(a.distance,a.renderDistance,a.normal,p)}intersectRay(t,n,r,i,a,o){let{options:s,camera:c}=r;if(!s.selectionMode||!t.visible||!c)return;if(!_e(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let l=this._getLineSize(t.attributes);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(t,n,r,l,o):this._intersectRayWithScreenSizedLine(t,n,r,l,o)}_intersectRayWithScreenSizedLine(e,t,n,r,i){let{camera:a}=n,s=e.attributes,c=s.get(`position`).data,_=G;o(_,n.point);let v=r*a.pixelRatio,y=$*a.pixelRatio,b=v/2+y;l(Z[0],_[0]-b,_[1]+b,0),l(Z[1],_[0]+b,_[1]+b,0),l(Z[2],_[0]+b,_[1]-b,0),l(Z[3],_[0]-b,_[1]-b,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(Z[e],Q[e]))return;O(a.eye,Q[0],Q[1],Ue),O(a.eye,Q[1],Q[2],We),O(a.eye,Q[2],Q[3],Ge),O(a.eye,Q[3],Q[0],Ke);let x=Number.MAX_VALUE,T=0;for(let e of this._forEachTransformedLineSegment(L,R,c,t,F(this.parameters,s))){if(k(Ue,L)<0&&k(Ue,R)<0||k(We,L)<0&&k(We,R)<0||k(Ge,L)<0&&k(Ge,R)<0||k(Ke,L)<0&&k(Ke,R)<0)continue;let t=a.projectToRenderScreen(L,K),n=a.projectToRenderScreen(R,q);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(U,L,R);let e=a.frustum,n=-k(e[4],L)/d(U,ee(e[4]));if(f(U,U,n),p(L,L,U),!a.projectToRenderScreen(L,t))continue}else if(t[2]>0&&n[2]<0){u(U,R,L);let e=a.frustum,t=-k(e[4],R)/d(U,ee(e[4]));if(f(U,U,t),p(R,R,U),!a.projectToRenderScreen(R,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let i=S(t,n,J),o=C(i,_);if(!(o>=x)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(i,L,R,_,a,r,y);if(o>=e*e)continue}x=o,m(ze,L),m(Be,R),T=e}}if(x<b*b){let{rayBegin:e,rayEnd:t}=n,r=Number.MAX_VALUE;if(w(S(ze,Be,J),S(e,t,He),W)){u(W,W,e);let n=h(W);f(W,W,1/n),r=n/g(e,t)}i(r,r,W,T)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,c=e.attributes,l=c.get(`position`).data,u=r/(2*s),d=1/0,f=0;for(let e of this._forEachTransformedLineSegment(L,R,l,t,F(this.parameters,c))){let t=xe(L,R,u,a,o,Ve);if(t!=null&&t<d&&(d=t,f=e,m(W,Ve),t===0))break}d<1/0&&i(d,d,W,f)}intersectScreenPolygon(t,n,r,i){let{options:a,camera:o,screenPolygonPrimitiveProcessor:s}=r;if(!a.selectionMode||!t.visible)return null;if(!_e(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let c=t.attributes,l=c.get(`position`).data,u=this._getLineSize(c),d=$,f=d*o.pixelRatio,p=new me(4);for(let e of this._forEachTransformedLineSegment(L,R,l,n,F(this.parameters,c)))for(let[t,n]of s.processLineSegment(Je,L,R)){if(!fe(o,t,n,K,q))continue;let r=S(K,q,J),a=u/2+d;this.parameters.screenSizePerspective&&(_(G,K,q,.5),a=Math.max(a,this.computeScreenSizePerspectiveWidth(r,t,n,G,o,u,f)/o.pixelRatio)),o.renderToScreen(K,Le),o.renderToScreen(q,Re),pe(i,Le,Re,a)&&(T(S(t,n,He),o.eye,V),p.updateIfCloserFromValues(g(o.eye,V),e,V,null))}return p}intersectScreenPolygonDraped({attributes:e},t,n,r,i,a){if(!n.options.selectionMode)return null;let o=I(this._getLineSize(e,!0),i,a,this.parameters.usesWorldSizedWidth());for(let n of Me(z,B,this.parameters,e,t))if(pe(r,z,B,o))return new he(n);return null}createBufferWriter(){return new je(Ce(this.parameters),we(this.parameters),this.parameters,this._isAssumedMetalDriver)}createGLMaterial(e){return new ke(e)}validateParameters(e){e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=E(e,r);_(V,t,n,s),v(Ie,V,i.viewMatrix);let c=h(Ie),l=this.computeCameraAbsCosAngle(V,i,this._configuration.spherical);return Fe.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Fe.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(W,e):l(W,0,0,1),u(H,e,t.eye),y(H,H),Math.abs(d(W,H))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=e.get(`sizeFeatureAttribute`).data[0];Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*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,n,r,i){let a=i?n.length-2:n.length-5;for(let i=0;i<a;i+=3){e[0]=n[i]+r[12],e[1]=n[i+1]+r[13],e[2]=n[i+2]+r[14];let a=(i+3)%n.length;t[0]=n[a]+r[12],t[1]=n[a+1]+r[13],t[2]=n[a+2]+r[14],yield i/3}}}class ke extends ue{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Te,e)}}class Ae extends ye{constructor(){super(...arguments),this._width=0,this.color=x,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=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(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||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return ve(this.stipplePattern)&&this.stippleTexture!=null}}class je{constructor(e,t,n,r){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this._isAssumedMetalDriver=r,this.numJoinSubdivisions=Pe(this._parameters.join,this._parameters.stipplePattern!=null)}_isClosed(e){return F(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){let t=e.get(`position`).indices.length/2+1,n=this._isClosed(e),r=n?2:4,i=+!n,a=n?t:t-1,o=this.numJoinSubdivisions*2+(this._isAssumedMetalDriver?8:4);return r+=(a-i)*o,r+=2,this._parameters.wireframe&&(r=2+(r-2)*4),r}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(e,n,r,i)}_writeTextureBuffer(e,t,n){let r=t.get(`position`),i=r.data.length/3,a=this._isClosed(t),{buffer:o,offset:s}=n,c=o.getField(`position`,te),l=o.getField(`u0`,j),u=o.getField(`sizeFeatureAttribute`,j),d=o.getField(`size`,j),f=o.getField(`colorFeatureAttribute`,j),p=o.getField(`color`,ne),h=o.getField(`olidColor`,ne),_=o.getField(`timeStamps`,re),v=o.getField(`opacityFeatureAttribute`,j),y=t.get(`sizeFeatureAttribute`)?.data,b=t.get(`size`)?.data,x=t.get(`colorFeatureAttribute`)?.data,S=t.get(`color`)?.data,C=t.get(`opacityFeatureAttribute`)?.data,w=t.get(`distanceToStart`)?.data,T=t.get(`timeStamps`);N(c!==null,`Expected valid position field in texture buffer`),N(l!==null,`Expected valid u0 field in texture buffer`);let E=0;for(let t=0;t<i;++t){this._getTransformedPosition(X,r.data,t,e),t>0&&(w==null?E+=g(Y,X):E=w[t]??E);let n=s+t+1;if(c.setVec(n,X),l.set(n,E),m(Y,X),u&&u.set(n,y?.length===1?y[0]:y?.[t]??0),d&&d.set(n,b?.length===1?b[0]:b?.[t]??1),f&&f.set(n,x?.length===1?x[0]:x?.[t]??0),p){if(S!=null){let e=Math.min(t*4,S.length-4);p.setValues(n,S[e],S[e+1],S[e+2],S[e+3])}else p.setValues(n,1,1,1,1)}v&&v.set(n,C?.length===1?C[0]:C?.[t]??0)}if(_!=null&&T!=null){N(T.size===4);let e=T.data;for(let t=0;t<i;++t){let n=t*4,r=s+t+1;_.set(r,0,e[n]),_.set(r,1,e[n+1]),_.set(r,2,e[n+2]),_.set(r,3,e[n+3])}}if(a){let e=s,t=s+1,n=s+2,r=s+i,a=r+1,u=r+2;o.copyItem(r,e),o.copyItem(t,a),o.copyItem(n,u),c.getVec(r,Y),c.getVec(t,X);let d=w?.[i]??E+g(Y,X);l.set(a,d)}else{let e=s,t=s+1,n=s+i,r=n+1;o.copyItem(t,e),o.copyItem(n,r)}let D=t.get(`olidColor`);le()&&D!=null&&h!=null&&be(D,4,h,s)}_writeVertexBuffer(e,t,n,r){let{buffer:i,offset:a}=n,{layout:o}=this,s=t.get(`position`),c=s.indices,l=s.data.length/3,u=this._isClosed(t),d=l+(u?3:2);c&&c.length!==2*(l-1)&&console.warn(`RibbonLineMaterial does not support indices`);let f=i.getField(`textureElementIndex`,ie);N(f!=null,`Missing texture buffer index field`),N(r!=null,`Using a texture layout, but the texture range for this instance was not provided`);let p=r.from;N(r.numElements===d,`Expected number of elements in TextureBuffer to equal number of points`);let m=new Float32Array(i.buffer),h=new Float16Array(i.buffer),g=new Uint32Array(i.buffer),_=o.stride/4,v=a*_,y=v,b=m.BYTES_PER_ELEMENT/h.BYTES_PER_ELEMENT,x=(e,t,n,r=!1)=>{let i=n+1;g[v]=p+i,v++;let a=v*b;h[a++]=e,h[a++]=t+(r?Math.sign(t)*8:0),v=Math.ceil(a/b)};v+=_;let S=0,C=0;u?(S=0,C=l):(x(1,-4,0),x(1,4,0),S=1,C=l-1);let w=this._isAssumedMetalDriver;for(let e=S;e<C;e++){x(0,-1,e),x(0,1,e),w&&(x(0,-1,e,!0),x(0,1,e,!0));let t=this.numJoinSubdivisions;for(let n=0;n<t;++n){let r=(n+1)/(t+1);x(r,-1,e,w),x(r,1,e,w)}x(1,-2,e,w),x(1,2,e,w),w&&(x(1,-2,e),x(1,2,e))}u?(x(0,-1,C),x(0,1,C)):(x(0,-5,C),x(0,5,C)),P(m,y+_,m,y,_),v=P(m,v-_,m,v,_),this._parameters.wireframe&&this._addWireframeVertices(i,y,v,_)}_getTransformedPosition(e,t,n,r){let i=n*3;l(e,t[i+0],t[i+1],t[i+2]),r&&v(e,e,r)}_addWireframeVertices(e,t,n,r){let i=new Uint8Array(e.buffer,n*Float32Array.BYTES_PER_ELEMENT),a=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(n-t)*Float32Array.BYTES_PER_ELEMENT),o=r*Float32Array.BYTES_PER_ELEMENT,s=0,c=e=>s=P(a,e,i,s,o);for(let e=0;e<=a.length-4*o;e+=o*2)c(e),c(e+2*o),c(e+1*o),c(e+2*o),c(e+1*o),c(e+3*o)}}function P(e,t,n,r,i){for(let a=0;a<i;a++)n[r++]=e[t++];return r}function F(e,t){return e.isClosed?t.get(`position`).indices.length>2:!1}function I(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*Me(e,t,n,r,i){let a=r.get(`position`).data,c=F(n,r)?a.length-2:a.length-5,l=i?.[0]??0,u=i?.[1]??0;s(e,a[0]+l,a[1]+u);for(let n=3;n<c+3;n+=3){let r=n%a.length;s(t,a[r]+l,a[r+1]+u),yield n/3,o(e,t)}}function Ne(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}function Pe(e,t){let n=+!!t;switch(e){case`miter`:case`bevel`:return n;case`round`:return Se+n}}const Fe=new ge,L=b(),R=b(),z=c(),B=c(),V=b(),Ie=b(),H=b(),U=b(),W=b(),G=b(),K=n(),q=n(),Le=r(),Re=r(),ze=b(),Be=b(),Ve=b(),J=D(),He=D(),Y=b(),X=b(),Z=[n(),n(),n(),n()],Q=[b(),b(),b(),b()],Ue=A(),We=A(),Ge=A(),Ke=A(),$=4,qe={getDrapedRibbonLineMaxDistance:I},Je=[b(),b()];export{Ae as Parameters,Oe as RibbonLineMaterial,qe as test};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{fromMat4 as e,transpose as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{subtract as r,dot as i,scaleAndAdd as a,set as o,length as s,scale as c,transformMat4 as l,transformMat3 as u,cross as d,squaredLength as f,normalize as p}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as h,clipSlab as g,create as _,getStart as v}from"../../../../../geometry/support/clipRay.js";import{clipClosedNegativeHalfspace as y}from"../../../../../geometry/support/plane.js";import{wrap as b}from"../../../../../geometry/support/ray.js";import{Sphere as x}from"../../../../../geometry/support/sphere.js";function S(e,t,n,s,c,l){h(c,0,1/0,N);for(let r of[0,1,2])if(!g(r,Math.min(e[r],t[r])-n,Math.max(e[r],t[r])+n,N))return null;if(!y(s.frustum[4],N)||!y(s.frustum[5],N))return null;let u=w(e,t,s,D,O,l);if(u===0)return null;r(k,c.origin,e);let d=i(k,l),f=i(c.direction,l),p=T(c.direction,l);if(Math.abs(f)>p){let e=-d/f;return e<N.c0||e>N.c1?null:(a(k,k,c.direction,e),E(i(k,D),i(k,O),u,n*n)?e:null)}if(Math.abs(d)>T(k,l))return null;let m=i(k,D),_=i(k,O),v=i(c.direction,D),b=i(c.direction,O);return o(N.ray.origin,m,_,0),o(N.ray.direction,v,b,0),!g(0,-n,u+n,N)||!g(1,-n,n,N)?null:C(N,u,n)}function C(e,t,n){let r=v(e,k);if(E(r[0],r[1],t,n*n))return e.c0;o(P.center,r[0]<0?0:t,0,0),P.radius=n;let i=e.ray.direction;if(!P.intersectRay(b(r,i),F))return null;let a=Math.abs(i[0])>Math.abs(i[1])?0:1,s=e.c0+(F[a]-r[a])/i[a];return s<=e.c1?s:null}function w(n,i,a,m,h,g){r(m,i,n);let _=s(m);if(_===0)return 0;c(m,m,1/_);let v=a.viewMatrix;l(A,n,v),e(j,v),u(M,m,j);let y=a.projectionMatrix,b=y[11]*A[2]+y[15],x=y[11]*M[2],S=y[0]*(M[0]*b-A[0]*x),C=y[5]*(M[1]*b-A[1]*x),w=a.fullViewport,T=C*w[3]/(y[0]*w[2]),E=-S*w[2]/(y[5]*w[3]),D=Math.hypot(T,E);if(D===0)return 0;let O=T/D,k=E/D;return o(h,O,k,0),t(j,j),u(h,h,j),d(g,m,h),f(g)===0?0:(p(g,g),d(h,g,m),_)}function T(e,t){return 16*2**-52*(Math.abs(e[0]*t[0])+Math.abs(e[1]*t[1])+Math.abs(e[2]*t[2]))}function E(e,t,n,r){let i=e<0?e:e>n?e-n:0;return i*i+t*t<=r}const D=m(),O=m(),k=m(),A=m(),j=n(),M=m(),N=_(),P=new x,F=m();export{S as intersectRayWithWorldSizedLineSegment};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js";import"../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/snowcover/SnowCover.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
2
+ import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js";import"../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/snowcover/applySnow.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/snowcover/SnowCover.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/RealisticTree.glsl.js";
2
+ import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/snowcover/applySnow.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/RealisticTree.glsl.js";
@@ -11,8 +11,8 @@ export interface LineOfSightLayerViewProperties extends LayerViewProperties, Par
11
11
  * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/) of a [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/)
12
12
  * after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/) in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
13
13
  *
14
- * The line of sight layer view controls whether the [LineOfSightLayer.analysis](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/#analysis) in its associated
15
- * [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/) can be created or edited interactively.
14
+ * The line of sight layer view controls whether the [LineOfSightAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/) in its associated
15
+ * [LineOfSightLayer.analysis](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/#analysis) can be created or edited interactively.
16
16
  *
17
17
  * It allows to create an observer and/or targets interactively using the [place()](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/#place) method, query the [results](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/#results),
18
18
  * or make an existing analysis editable by enabling the [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/#interactive) property.
@@ -10,7 +10,7 @@ export interface ViewshedLayerViewProperties extends LayerViewProperties, Partia
10
10
  * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/) of a [ViewshedLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/)
11
11
  * after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/) in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
12
12
  *
13
- * The viewshed layer view controls whether the viewsheds in its associated
13
+ * The viewshed layer view controls whether the [ViewshedAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ViewshedAnalysis/) in its associated
14
14
  * [ViewshedLayer.source](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/#source) can be created or edited interactively.
15
15
  *
16
16
  * It allows to create new viewsheds interactively using the [place()](https://developers.arcgis.com/javascript/latest/references/core/views/layers/ViewshedLayerView/#place) method,
@@ -43,6 +43,7 @@ export interface ViewshedLayerViewProperties extends LayerViewProperties, Partia
43
43
  * @see [Viewshed](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/)
44
44
  * @see [ViewshedAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ViewshedAnalysis/)
45
45
  * @see [ViewshedAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/)
46
+ * @see [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/)
46
47
  * @see [Sample - ViewshedLayer in slides](https://developers.arcgis.com/javascript/latest/sample-code/layers-viewshed/)
47
48
  * @see [Async cancellation with AbortController](https://developers.arcgis.com/javascript/latest/async-cancellation-with-abortcontroller/)
48
49
  */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{createTask as r}from"../../../core/asyncUtils.js";import{abortMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as o,initial as s,when as c}from"../../../core/reactiveUtils.js";import{throttle as l}from"../../../core/throttle.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import f from"../../../geometry/Point.js";import{MediaContent as p,TextContent as m,FieldsContent as h}from"../../../popup/content.js";import g from"../../../popup/ElementExpressionInfo.js";import{compileExpression as _}from"../../../popup/support/arcadeFeatureUtils.js";import v from"../FeatureContent/FeatureContentViewModel.js";import y from"../FeatureFields/FeatureFieldsViewModel.js";import b from"../FeatureMedia/FeatureMediaViewModel.js";let x=class extends n{constructor(e){super(e),this._compileTask=null,this._evaluateTask=null,this.expressionInfo=null,this.graphic=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._createVM=()=>{let e=this.contentElement?.type;this.contentElementViewModel?.destroy();let t=e===`fields`?new y:e===`media`?new b:e===`text`?new v:null;this._set(`contentElementViewModel`,t)},this._compileThrottled=l(this._startCompile,()=>this.notifyChange(`state`),1,this),this._evaluateThrottled=l(this._startEvaluate,()=>this.notifyChange(`state`),1,this),this.addHandles([o(()=>[this.expressionInfo,this.graphic],()=>this._compileThrottled(),s),o(()=>[this.contentElement],()=>this._createVM(),s),c(()=>{if(!this._compileTask?.finished)return null;let e=this._compileTask.value,t=e?.dependencies;return[e,this.spatialReference,this.map,this.view,t?.has(`view-scale`)?this.view?.scale:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.start:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.end:null]},([e])=>this._evaluateThrottled(e))])}initialize(){this.addHandles([this._compileThrottled,this._evaluateThrottled])}destroy(){this._compileTask=i(this._compileTask),this._evaluateTask=i(this._evaluateTask),this.contentElementViewModel?.destroy(),this._set(`contentElementViewModel`,null)}get contentElement(){return this._evaluateTask?.value}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){let{contentElement:e,contentElementViewModel:t}=this;return this._compileThrottled.hasPendingUpdates()||this._evaluateThrottled.hasPendingUpdates()||!this._compileTask?.finished||!this._evaluateTask?.finished?`loading`:!e&&!t?`disabled`:`ready`}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}_startCompile(){this._evaluateTask=i(this._evaluateTask),this._compileTask=i(this._compileTask),this._compileTask=r(async e=>{let{expressionInfo:t,graphic:n}=this,r=t?.expression;if(!r||!n)return null;let i=await _({expression:r,graphic:n});return a(e),i})}_startEvaluate(e){this._evaluateTask=i(this._evaluateTask),this._evaluateTask=r(async t=>{let{graphic:n}=this;if(!e||!n)return null;let{interceptor:r,spatialReference:i,map:o,location:s,view:c}=this,l=await e.evaluate({graphic:n,interceptor:r,location:s,map:o,options:{signal:t},spatialReference:i,view:c});a(t);let u=l;if(!u||u.declaredClass!==`esri.arcade.Dictionary`)return null;let d=await u.castAsJsonAsync(t);a(t);let f=d?.type,g=f===`media`?p.fromJSON(d):f===`text`?m.fromJSON(d):f===`fields`?h.fromJSON(d):null;return g.type===`media`&&!g.mediaInfos||g.type===`fields`&&!g.fieldInfos||g.type===`text`&&!g.text?null:g})}};e([u()],x.prototype,`_compileTask`,void 0),e([u()],x.prototype,`_evaluateTask`,void 0),e([u({type:g})],x.prototype,`expressionInfo`,void 0),e([u({type:t})],x.prototype,`graphic`,void 0),e([u({readOnly:!0})],x.prototype,`contentElement`,null),e([u({readOnly:!0})],x.prototype,`contentElementViewModel`,void 0),e([u()],x.prototype,`interceptor`,void 0),e([u({type:f})],x.prototype,`location`,void 0),e([u()],x.prototype,`spatialReference`,null),e([u({readOnly:!0})],x.prototype,`state`,null),e([u()],x.prototype,`map`,null),e([u()],x.prototype,`view`,void 0),x=e([d(`esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel`)],x);export{x as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{createTask as r}from"../../../core/asyncUtils.js";import{abortMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as o,initial as s,when as c}from"../../../core/reactiveUtils.js";import{throttle as l}from"../../../core/throttle.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import f from"../../../geometry/Point.js";import p from"../../../popup/ElementExpressionInfo.js";import m from"../../../popup/content/FieldsContent.js";import h from"../../../popup/content/MediaContent.js";import g from"../../../popup/content/TextContent.js";import{compileExpression as _}from"../../../popup/support/arcadeFeatureUtils.js";import v from"../FeatureContent/FeatureContentViewModel.js";import y from"../FeatureFields/FeatureFieldsViewModel.js";import b from"../FeatureMedia/FeatureMediaViewModel.js";let x=class extends n{constructor(e){super(e),this._compileTask=null,this._evaluateTask=null,this.expressionInfo=null,this.graphic=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._createVM=()=>{let e=this.contentElement?.type;this.contentElementViewModel?.destroy();let t=e===`fields`?new y:e===`media`?new b:e===`text`?new v:null;this._set(`contentElementViewModel`,t)},this._compileThrottled=l(this._startCompile,()=>this.notifyChange(`state`),1,this),this._evaluateThrottled=l(this._startEvaluate,()=>this.notifyChange(`state`),1,this),this.addHandles([o(()=>[this.expressionInfo,this.graphic],()=>this._compileThrottled(),s),o(()=>[this.contentElement],()=>this._createVM(),s),c(()=>{if(!this._compileTask?.finished)return null;let e=this._compileTask.value,t=e?.dependencies;return[e,this.spatialReference,this.map,this.view,t?.has(`view-scale`)?this.view?.scale:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.start:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.end:null]},([e])=>this._evaluateThrottled(e))])}initialize(){this.addHandles([this._compileThrottled,this._evaluateThrottled])}destroy(){this._compileTask=i(this._compileTask),this._evaluateTask=i(this._evaluateTask),this.contentElementViewModel?.destroy(),this._set(`contentElementViewModel`,null)}get contentElement(){return this._evaluateTask?.value}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){let{contentElement:e,contentElementViewModel:t}=this;return this._compileThrottled.hasPendingUpdates()||this._evaluateThrottled.hasPendingUpdates()||!this._compileTask?.finished||!this._evaluateTask?.finished?`loading`:!e&&!t?`disabled`:`ready`}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}_startCompile(){this._evaluateTask=i(this._evaluateTask),this._compileTask=i(this._compileTask),this._compileTask=r(async e=>{let{expressionInfo:t,graphic:n}=this,r=t?.expression;if(!r||!n)return null;let i=await _({expression:r,graphic:n});return a(e),i})}_startEvaluate(e){this._evaluateTask=i(this._evaluateTask),this._evaluateTask=r(async t=>{let{graphic:n}=this;if(!e||!n)return null;let{interceptor:r,spatialReference:i,map:o,location:s,view:c}=this,l=await e.evaluate({graphic:n,interceptor:r,location:s,map:o,options:{signal:t},spatialReference:i,view:c});a(t);let u=l;if(!u||u.declaredClass!==`esri.arcade.Dictionary`)return null;let d=await u.castAsJsonAsync(t);a(t);let f=d?.type,p=f===`media`?h.fromJSON(d):f===`text`?g.fromJSON(d):f===`fields`?m.fromJSON(d):null;return p.type===`media`&&!p.mediaInfos||p.type===`fields`&&!p.fieldInfos||p.type===`text`&&!p.text?null:p})}};e([u()],x.prototype,`_compileTask`,void 0),e([u()],x.prototype,`_evaluateTask`,void 0),e([u({type:p})],x.prototype,`expressionInfo`,void 0),e([u({type:t})],x.prototype,`graphic`,void 0),e([u({readOnly:!0})],x.prototype,`contentElement`,null),e([u({readOnly:!0})],x.prototype,`contentElementViewModel`,void 0),e([u()],x.prototype,`interceptor`,void 0),e([u({type:f})],x.prototype,`location`,void 0),e([u()],x.prototype,`spatialReference`,null),e([u({readOnly:!0})],x.prototype,`state`,null),e([u()],x.prototype,`map`,null),e([u()],x.prototype,`view`,void 0),x=e([d(`esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel`)],x);export{x as default};