@arcgis/core 5.1.0-next.112 → 5.1.0-next.113
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.
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0e6a388d51d9dbae46ba.js → 02c0640005b09007bb70.js} +1 -1
- package/assets/esri/core/workers/chunks/{beff5b4e15edee12bd4c.js → 271e42b7cd3c3441839e.js} +3 -3
- package/assets/esri/core/workers/chunks/32f128a1615d71bbe899.js +2 -0
- package/assets/esri/core/workers/chunks/40df608337d562553ce1.js +2 -0
- package/assets/esri/core/workers/chunks/{711d1873c760313e287f.js → 52a91c314afec70199bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe8334352d256d691a95.js → 5c6742728fa705d2e16e.js} +1 -1
- package/assets/esri/core/workers/chunks/{481dc7503587972a6bd2.js → 701125f6cdd91ff3655f.js} +2 -2
- package/assets/esri/core/workers/chunks/7995e6983456c779adf9.js +1 -0
- package/assets/esri/core/workers/chunks/860465c4f44c373d0a1c.js +1 -0
- package/assets/esri/core/workers/chunks/{08efd64acdfe46985293.js → 9a11ff75009fef45b8c1.js} +1 -1
- package/assets/esri/core/workers/chunks/a70fa35b2d19460637e9.js +2 -0
- package/assets/esri/core/workers/chunks/ae74f722fb385e45fcf1.js +1 -0
- package/assets/esri/core/workers/chunks/{b02a68bbab07557cf02d.js → b4badbcf1bdb7823d825.js} +1 -1
- package/assets/esri/core/workers/chunks/b78fb24b47d9f31f18c6.js +1 -0
- package/assets/esri/core/workers/chunks/e95ce76b5b816256a519.js +1 -0
- package/assets/esri/core/workers/chunks/fbcf09526dc1bbe94b91.js +2 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +22 -6
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/Features/t9n/Features_en.json +1 -1
- package/chunks/GaussianSplatShadow.glsl.js +11 -9
- package/chunks/ShadowCastVisualize.glsl.js +26 -18
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/layers/KnowledgeGraphLayer.d.ts +6 -4
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/linkChart/LinkChartProperties.js +1 -1
- package/linkChart/utils.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/types.d.ts +45 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +3 -3
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +17 -3
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +25 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.d.ts +46 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +1 -1
- package/widgets/BatchAttributeForm.d.ts +2 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.d.ts +3 -3
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +66 -6
- package/widgets/support/SelectionToolbar/types.d.ts +20 -1
- package/assets/esri/core/workers/chunks/03babc21d1781142a974.js +0 -1
- package/assets/esri/core/workers/chunks/340c68d09d2e8bef6727.js +0 -2
- package/assets/esri/core/workers/chunks/8a1751187a20b6578875.js +0 -1
- package/assets/esri/core/workers/chunks/9ebc461529d5286fa2c2.js +0 -2
- package/assets/esri/core/workers/chunks/aca9591d3467a24f8329.js +0 -1
- package/assets/esri/core/workers/chunks/d00b9c1fd0865bf8f317.js +0 -1
- package/assets/esri/core/workers/chunks/d02aa7438f46c1c2167a.js +0 -2
- package/assets/esri/core/workers/chunks/deab352545c34cac148c.js +0 -1
- package/assets/esri/core/workers/chunks/e5854a3f69dffaf9464d.js +0 -2
- /package/assets/esri/core/workers/chunks/{e5854a3f69dffaf9464d.js.LICENSE.txt → 32f128a1615d71bbe899.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{340c68d09d2e8bef6727.js.LICENSE.txt → 40df608337d562553ce1.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{481dc7503587972a6bd2.js.LICENSE.txt → 701125f6cdd91ff3655f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d02aa7438f46c1c2167a.js.LICENSE.txt → a70fa35b2d19460637e9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{9ebc461529d5286fa2c2.js.LICENSE.txt → fbcf09526dc1bbe94b91.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import i from"../../../../core/Accessor.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import s from"../../../../core/ReactiveMap.js";import{property as o,subclass as
|
|
2
|
+
import{__decorate as t}from"tslib";import i from"../../../../core/Accessor.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import s from"../../../../core/ReactiveMap.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{copy as a,scaleAndAdd as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{creationVerticalOffset as u}from"./ViewshedConfiguration.js";import{ViewshedInteractionVisuals as h}from"./ViewshedInteractionVisuals.js";import{ViewshedSphereManipulator as p}from"./viewshedToolManipulatorUtils.js";let _=class extends i{constructor(t){super(t),this._active=!1,this.analysisVisible=!0,this._visuals=new s,this._placementLocation=c(),this._hasPlacementLocation=!1,this._interactionVisuals=null,this._sphereManipulator=null,this._sphereManipulatorTool=null}initialize(){this._interactionVisuals=new h({view:this.view}),this.addHandles(r(()=>this.analysisVisible,()=>this._refreshInteractionVisuals()))}destroy(){this._visuals.clear(),this._interactionVisuals=e(this._interactionVisuals);const t=this._sphereManipulator;null!=t&&(this._sphereManipulatorTool?.manipulators.remove(t),this._sphereManipulator=e(t),this._sphereManipulatorTool=null)}get _interactionPoint(){let t=null;for(const i of this._visuals.values()){const e=d(i.geometry);if(null!=e){if("cursor"===i.role&&"active"===i.state)return e;("cursor"===i.role||null==t&&"outputGeometry"===i.role)&&(t=e)}}return t}activate(){this._active=!0,this._refreshInteractionVisuals()}deactivate(){this._active=!1,this._interactionVisuals?.setVisibility(!1);const t=this._sphereManipulator;null!=t&&(t.available=!1)}addSphereManipulator(t){null==this._sphereManipulator&&(this._sphereManipulatorTool=t,this._sphereManipulator=new p(this.view,t),this._refreshInteractionVisuals())}addOrUpdateGraphic(t,i){}updatePlacementLocation(t){const i=null!=t;this._hasPlacementLocation=i,i&&a(this._placementLocation,t),this._refreshInteractionVisuals()}addOrUpdateVisual(t,i){this._visuals.set(t,f(i,this._visuals.get(t))),this._refreshInteractionVisuals()}removeGraphic(t){}removeVisual(t){this._visuals.delete(t),this._refreshInteractionVisuals()}hitTestVisualDistance(t,i){return null}_refreshInteractionVisuals(){const t=!this._hasPlacementLocation,i=this._getInteractionLocation(V),e=null!=i&&t?m(this.view,i):i,s=null!=e&&this._active&&this.analysisVisible;this._interactionVisuals?.update({location:e,laserlineVisible:s,verticalLineVisible:s});const r=this._sphereManipulator;if(null==r)return;const o=this._active&&this.analysisVisible&&null!=e;o&&(r.renderLocation=e),r.available=o}_getInteractionLocation(t){if(this._hasPlacementLocation)return this._placementLocation;const i=this._interactionPoint;return null!=i&&this.view.renderCoordsHelper.toRenderCoords(i,t)?t:null}};function m(t,i){const{renderCoordsHelper:e}=t,s=u/e.unitInMeters;return l(y,i,e.worldUpAtPosition(i,w),s)}function d(t){if(!t)return null;switch(t.type){case"point":return t;case"multipoint":return v(t);default:return null}}function v(t){return 0===t.points.length?null:t.getPoint(t.points.length-1)}function f(t,i={geometry:null,role:"outputGeometry",state:"idle"}){return{...i,...t}}t([o({constructOnly:!0})],_.prototype,"view",void 0),t([o()],_.prototype,"_active",void 0),t([o()],_.prototype,"analysisVisible",void 0),t([o()],_.prototype,"_interactionPoint",null),_=t([n("esri.views.3d.analysis.Viewshed.ViewshedDrawToolRenderer")],_);const V=c(),y=c(),w=c();export{_ as ViewshedDrawToolRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as a,throwIfAborted as o,onAbort as s}from"../../../../core/promiseUtils.js";import{watch as n,sync as r}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as l}from"../../../../core/units.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{createDrawTool as d,createPlacementResult as p}from"./placementUtils.js";import{detachToolFromView as m}from"./toolLifecycleUtils.js";import{creationVerticalOffset as _}from"./ViewshedConfiguration.js";import u from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as w}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as v}from"./viewshedToolUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as a,throwIfAborted as o,onAbort as s}from"../../../../core/promiseUtils.js";import{watch as n,sync as r}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as l}from"../../../../core/units.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{createDrawTool as d,createPlacementResult as p}from"./placementUtils.js";import{detachToolFromView as m}from"./toolLifecycleUtils.js";import{creationVerticalOffset as _}from"./ViewshedConfiguration.js";import u from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as w}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as v}from"./viewshedToolUtils.js";import{DrawManipulator3D as P}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as g}from"../../../input/InputManager.js";import{sketchKeys as y}from"../../../interactive/keybindings.js";import O from"../../../interactive/sketch/SketchOptions.js";const b="multiple",C=new O({tooltips:{enabled:!0}}),T=Symbol("hiddenManipulatorHandle");let f=class extends i{constructor(e){super(e),this.placementMode=b,this.creationState=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null}initialize(){this.addHandles([this.view.on("key-down",e=>this._handleKeyDown(e),g.DEFAULT),n(()=>{const{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:null!=e&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{null==e||t||this.analysis.viewsheds.add(e)},r)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(a()),o(t);const{resolve:i,reject:n,promise:r}=Promise.withResolvers(),l=s(t,()=>this._cancelPlacementOperation());return this._placeOperation=new u({abortHandle:l,reject:n,resolve:i}),this.place(e),r}place(e){this.callbacks.setSelectedViewshed(null),this.placementMode=e,this._startObserverPlacement()}cancelPlaceOperation(){null==this.creationState&&null==this._placeOperation||(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return null!=this.creationState&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){null!=this.creationState&&(y.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):y.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&"multiple"===this.placementMode)return this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement();this._destroyDrawTool(),this._abortCreation()}_removeStaged(){const{stagedViewshed:e}=this;return this.stagedViewshed=null,!!e&&(this.analysis.viewsheds.remove(e),!0)}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e){const i=l(e.mapPoint.spatialReference);e.mapPoint.z=(e.mapPoint.z??0)+_/i;const a=new t({observer:e.mapPoint.clone(),feature:e.feature});this.analysis.viewsheds.add(a),this.stagedViewshed=a,this.creationState="placing-target",this._updateStagedViewshed(e.scenePoint),this.callbacks.setSelectedViewshed(null)}_onCancel(e){const t=this._removeStaged();return"placing-observer"===this.creationState?t&&"multiple"===this.placementMode?(this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement()):(this._destroyDrawTool(e),void this._abortCreation()):t?(this.creationState="placing-observer",this.callbacks.setSelectedViewshed(null),void("multiple"!==this.placementMode?(this._destroyDrawTool(e),this._abortCreation()):this._startPointPlacement())):(this._destroyDrawTool(e),void this._abortCreation())}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e.scenePoint);const t=this.stagedViewshed;this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),"multiple"!==this.placementMode||(this.creationState="placing-observer")}_handleTargetPlacementPreview(e){this._updateStagedViewshed(e.scenePoint)}_resolvePlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.resolve())}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){const t=this._placeOperation;this._placeOperation=null,e(t)}_startObserverPlacement(){this.creationState="placing-observer",this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);const{drawTool:e,intersector:t,renderer:i}=d({analysisViewData:this.analysisViewData,view:this.view,sketchOptions:C,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e)});this._drawTool=e,this._renderer=i;try{this.view.addAndActivateTool(e),e.begin([w({mode:this.placementMode,onObserverComplete:i=>this._onObserverMapPointComplete(e,t,i),onTargetComplete:i=>this._onTargetMapPointComplete(e,t,i),onTargetPreview:i=>this._onTargetMapPointPreview(e,t,i)})])}catch(a){this._destroyDrawTool(e),this._rejectPlaceOperation(a instanceof Error?a:new Error(String(a)))}}_onComplete(e){this._removeStaged(),this._resolvePlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t,i){const a=p({drawTool:e,intersector:t,mapPoint:i,view:this.view});a?(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleObserverPlacementComplete(a)):this._onCancel(e)}_onTargetMapPointComplete(e,t,i){const a=p({drawTool:e,intersector:t,mapPoint:i,view:this.view});a?(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleTargetPlacementComplete(a),"multiple"===this.placementMode&&this._renderer?.updatePlacementLocation(null)):this._onCancel(e)}_onTargetMapPointPreview(e,t,i){const a=p({drawTool:e,intersector:t,mapPoint:i,view:this.view});a&&(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleTargetPlacementPreview(a))}_onManipulatorCountChange(e){e.removeHandles(T);const t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof P&&t.push(e.disableDisplay())}),e.addHandles(t,T)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&m(this.view,e)}_updateStagedViewshed(e){const t=this.stagedViewshed;if(!t)return;const i=this.callbacks.findViewshedComputedData(t);if(!i)return;const{heading:a,tilt:o,farDistance:s}=v(this.view,i,e);t.farDistance=s,t.tilt=o,t.heading=a}get test(){}};e([c({constructOnly:!0})],f.prototype,"analysis",void 0),e([c({constructOnly:!0})],f.prototype,"analysisViewData",void 0),e([c({constructOnly:!0})],f.prototype,"view",void 0),e([c({constructOnly:!0})],f.prototype,"callbacks",void 0),e([c()],f.prototype,"placementMode",void 0),e([c()],f.prototype,"creationState",void 0),e([c()],f.prototype,"stagedViewshed",void 0),e([c()],f.prototype,"_placeOperation",void 0),e([c()],f.prototype,"_drawTool",void 0),e([c()],f.prototype,"_renderer",void 0),e([c()],f.prototype,"updating",null),e([c()],f.prototype,"active",null),f=e([h("esri.views.3d.analysis.Viewshed.ViewshedPlacementController")],f);export{f as ViewshedPlacementController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as n,Cyclical as o}from"../../../../core/Cyclical.js";import{handlesGroup as r}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as s}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as c,initial as v}from"../../../../core/reactiveUtils.js";import{property as g,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{sub as f,len as b,dot as M}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProject as w}from"../../../../geometry/projectionUtils.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{viewshedToolManipulatorConfiguration as V}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as y,isSideHorizontal as T,flipSide as D}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedScaleOrientManipulation as H}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as S}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as j}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as F,sceneSnappingAtLocation as x,dragManipulatedObject as A}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as P}from"../../../interactive/editGeometry/EditGeometryOperations.js";const k=Symbol("dragHandles"),E=Symbol("hideManipulators"),z=Symbol("hideFoVManipulators"),U=Symbol("hideObserverManipulator");let R=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new y({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new H({view:this.view,tool:this.parentTool}),this._observerManipulator=new S(this.view,this.parentTool),this.addHandles([d(()=>this.elevationAlignedObserverRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},c),d(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=s(90-e))},v),d(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace}},({viewshedComputedData:e,observer:i},a)=>{this._grabbing&&i!==a?.observer||(this.removeHandles(k),e?.valid&&this.addHandles([this._buildObserverDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),k))},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},v),d(()=>{const e=this.analysisViewData.visible&&(this.viewshedComputedData?.valid??!1),i=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData,{creating:t,isPlacingTarget:a}=this.parentTool;return{fovManipulationAvailable:e&&!a,nonFOVManipulationAvailable:e&&(!t||i)}},({fovManipulationAvailable:e,nonFOVManipulationAvailable:i})=>{this._moveManipulation.available=i,this._scaleOrientManipulation.available=i,this._observerManipulator.available=i,this._fieldOfViewManipulation.available=e},v),d(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},v)]);const e=e=>{this.addHandles([e.events.on("focus-changed",()=>{const e=this._someManipulatorHovering();e&&this.parentTool.subToolHandles.forEach(({subTool:e})=>{e._resetHoveringTask()}),this._someManipulatorSelected()||e||(this._forceHoveringTask=a(async e=>{await(this._forceHoveringTestPromise??h(V.hoverTimeoutMilliseconds,e)),u(e),this._forceHoveringTask=null,this._updateManipulatorVisibility()}))}),e.events.on("grab-changed",i=>{this._grabbing="start"===i.action,"end"===i.action&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(i=>i.hasManipulator(e)||!this._grabbing)}),e.events.on("drag",e=>{"start"===e.action&&this.parentTool.updateInteractionVisualsVisibility()})])};this._forEachManipulator(e)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get updating(){return null!=this._forceHoveringTask&&!this._forceHoveringTask.finished}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:e,grabbing:i}=this._moveManipulation;return{dragging:e,grabbing:i}}get scaleOrientInteractionState(){const{dragging:e,grabbing:i}=this._scaleOrientManipulation;return{dragging:e,grabbing:i}}_setInteractive(e){const i="boolean"==typeof e;this._forEachManipulation(t=>t.interactive=i?e:e(t))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(e){let i=!1;return this._forEachManipulator(t=>{i=i||t===e}),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new j({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(e){const i={mode:"absolute-height",offset:0},t=e.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline((n,o,r,s,l)=>{s=s.next(F(this,["observer"]));const p=w(t,a),h=w(e.elevationAlignedObserver,a);if(null==p||null==h)return{steps:r,cancel:s};const u=P.fromGeometry(p,O(this.view.viewingMode)),d=P.fromGeometry(h,O(this.view.viewingMode)),c=this.parentTool.createObserverMoveSnappingPipeline?.(n,d,l);if(null!=c){const{snappingStep:e,cancelSnapping:t}=c,{coordinateHelper:a}=d.data;s=s.next(t);return{steps:r.next(e=>({...e,snapOrigin:a.pointToVector(h)})).next(x(this.view,i)).next(...e).next(A({operations:u})).next(e=>(this.observer=u.data.geometry,e)),cancel:s}}return{steps:r.next(A({operations:u})).next(e=>(this.observer=u.data.geometry,e)),cancel:s}},i,a,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((a,o,r)=>{if(null==e)return{steps:o,cancel:r};const s=e.viewshed;let l=null;r=r.next(F(s,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:o.next(a=>{"start"===a.action&&(l=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const o=a.deltaAngle;if(null==l&&0!==o){const e="bottom"===a.side||"left"===a.side?o>0:o<0;l=T(a.side)?0===i&&e||360===i&&!e:0===t&&e}const r=l?D(a.side):a.side;let p=0;switch(r){case"left":p=i/2-o;break;case"right":p=i/2+o;break;case"top":p=t+2*o;break;case"bottom":p=t-2*o}return T(r)?(p=n.normalize(p),p=p>270?0:p>180?180:p,s.horizontalFieldOfView=2*p):s.verticalFieldOfView=p,a}),cancel:r}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const a=(i,t)=>(a,n,o)=>{if(null==e)return{steps:n,cancel:o};const r=e.viewshed;return o=o.next(F(r,[i])),{steps:n=n.next(t(r,e)),cancel:o}};return r([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",(i,a)=>a=>("start"===a.action&&(t=e.heading),i.heading=n.normalize(t+a.deltaAngle),a)),e),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let n=i+a.deltaAngle;return n<-90?n=180:n>270&&(n=0),t.tilt=G.clamp(n),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",(e,i)=>t=>{const a=f(I,t.renderEnd,i.elevationAlignedObserverRenderSpace),n=b(a)*i.metersPerUnit,o=M(a,i.targetDirection)<0?V.scaleOrientMinDistance:n;return e.farDistance=o,t}),e)])}_updateManipulatorVisibility(){const e=this._someManipulatorSelected(),i=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let n=[];const o=e=>{n.push(e.disableDisplay())};e||!a&&i?this.removeHandles(E):(this._scaleOrientManipulation.forEachManipulator(o),this._moveManipulation.forEachManipulator(o),this.addHandles(n,E),n=[]),e||!a&&i||a&&t?this.removeHandles(z):(this._fieldOfViewManipulation.forEachManipulator(o),this.addHandles(n,z)),e||!a?this.removeHandles(U):this.addHandles(this._observerManipulator.disableDisplay(),U)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(e){this._forEachManipulation(i=>{i.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:e=>{this._forceHoveringTestPromise=e}}}};e([g({constructOnly:!0})],R.prototype,"analysis",void 0),e([g({constructOnly:!0})],R.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],R.prototype,"parentTool",void 0),e([g({constructOnly:!0,nonNullable:!0})],R.prototype,"view",void 0),e([g()],R.prototype,"_forceHoveringTask",void 0),e([g()],R.prototype,"updating",null),e([g()],R.prototype,"viewshed",null),e([g()],R.prototype,"_grabbing",void 0),e([g()],R.prototype,"grabbing",null),e([g()],R.prototype,"viewshedComputedData",void 0),e([g()],R.prototype,"observer",null),e([g()],R.prototype,"elevationAlignedObserverRenderSpace",null),R=e([m("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],R);const I=_(),G=new o(0,180);export{R as ViewshedSubTool};
|
|
2
|
+
import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as n,Cyclical as o}from"../../../../core/Cyclical.js";import{handlesGroup as r}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as s}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as c,initial as v}from"../../../../core/reactiveUtils.js";import{property as g,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{sub as f,len as b,dot as M}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProject as w}from"../../../../geometry/projectionUtils.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{viewshedToolManipulatorConfiguration as V}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as y,isSideHorizontal as T,flipSide as D}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedScaleOrientManipulation as H}from"./ViewshedScaleOrientManipulation.js";import{ViewshedSphereManipulator as S}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as j}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as F,sceneSnappingAtLocation as x,dragManipulatedObject as A}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as P}from"../../../interactive/editGeometry/EditGeometryOperations.js";const k=Symbol("dragHandles"),E=Symbol("hideManipulators"),z=Symbol("hideFoVManipulators"),U=Symbol("hideObserverManipulator");let R=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new y({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new H({view:this.view,tool:this.parentTool}),this._observerManipulator=new S(this.view,this.parentTool),this.addHandles([d(()=>this.elevationAlignedObserverRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},c),d(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=s(90-e))},v),d(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace}},({viewshedComputedData:e,observer:i},a)=>{this._grabbing&&i!==a?.observer||(this.removeHandles(k),e?.valid&&this.addHandles([this._buildObserverDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),k))},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},v),d(()=>{const e=this.analysisViewData.visible&&(this.viewshedComputedData?.valid??!1),i=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData,{creating:t,isPlacingTarget:a}=this.parentTool;return{fovManipulationAvailable:e&&!a,nonFOVManipulationAvailable:e&&(!t||i)}},({fovManipulationAvailable:e,nonFOVManipulationAvailable:i})=>{this._moveManipulation.available=i,this._scaleOrientManipulation.available=i,this._observerManipulator.available=i,this._fieldOfViewManipulation.available=e},v),d(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},v)]);const e=e=>{this.addHandles([e.events.on("focus-changed",()=>{const e=this._someManipulatorHovering();e&&this.parentTool.subToolHandles.forEach(({subTool:e})=>{e._resetHoveringTask()}),this._someManipulatorSelected()||e||(this._forceHoveringTask=a(async e=>{await(this._forceHoveringTestPromise??h(V.hoverTimeoutMilliseconds,e)),u(e),this._forceHoveringTask=null,this._updateManipulatorVisibility()}))}),e.events.on("grab-changed",i=>{this._grabbing="start"===i.action,"end"===i.action&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(i=>i.hasManipulator(e)||!this._grabbing)}),e.events.on("drag",e=>{"start"===e.action&&this.parentTool.updateInteractionVisualsVisibility()})])};this._forEachManipulator(e)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get updating(){return null!=this._forceHoveringTask&&!this._forceHoveringTask.finished}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:e,grabbing:i}=this._moveManipulation;return{dragging:e,grabbing:i}}get scaleOrientInteractionState(){const{dragging:e,grabbing:i}=this._scaleOrientManipulation;return{dragging:e,grabbing:i}}_setInteractive(e){const i="boolean"==typeof e;this._forEachManipulation(t=>t.interactive=i?e:e(t))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(e){let i=!1;return this._forEachManipulator(t=>{i=i||t===e}),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new j({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(e){const i={mode:"absolute-height",offset:0},t=e.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline((n,o,r,s,l)=>{s=s.next(F(this,["observer"]));const p=w(t,a),h=w(e.elevationAlignedObserver,a);if(null==p||null==h)return{steps:r,cancel:s};const u=P.fromGeometry(p,O(this.view.viewingMode)),d=P.fromGeometry(h,O(this.view.viewingMode)),c=this.parentTool.createObserverMoveSnappingPipeline?.(n,d,l);if(null!=c){const{snappingStep:e,cancelSnapping:t}=c,{coordinateHelper:a}=d.data;s=s.next(t);return{steps:r.next(e=>({...e,snapOrigin:a.pointToVector(h)})).next(x(this.view,i)).next(...e).next(A({operations:u})).next(e=>(this.observer=u.data.geometry,e)),cancel:s}}return{steps:r.next(A({operations:u})).next(e=>(this.observer=u.data.geometry,e)),cancel:s}},i,a,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((a,o,r)=>{if(null==e)return{steps:o,cancel:r};const s=e.viewshed;let l=null;r=r.next(F(s,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:o.next(a=>{"start"===a.action&&(l=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const o=a.deltaAngle;if(null==l&&0!==o){const e="bottom"===a.side||"left"===a.side?o>0:o<0;l=T(a.side)?0===i&&e||360===i&&!e:0===t&&e}const r=l?D(a.side):a.side;let p=0;switch(r){case"left":p=i/2-o;break;case"right":p=i/2+o;break;case"top":p=t+2*o;break;case"bottom":p=t-2*o}return T(r)?(p=n.normalize(p),p=p>270?0:p>180?180:p,s.horizontalFieldOfView=2*p):s.verticalFieldOfView=p,a}),cancel:r}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const a=(i,t)=>(a,n,o)=>{if(null==e)return{steps:n,cancel:o};const r=e.viewshed;return o=o.next(F(r,[i])),{steps:n=n.next(t(r,e)),cancel:o}};return r([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",(i,a)=>a=>("start"===a.action&&(t=e.heading),i.heading=n.normalize(t+a.deltaAngle),a)),e),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let n=i+a.deltaAngle;return n<-90?n=180:n>270&&(n=0),t.tilt=G.clamp(n),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",(e,i)=>t=>{const a=f(I,t.renderEnd,i.elevationAlignedObserverRenderSpace),n=b(a)*i.metersPerUnit,o=M(a,i.targetDirection)<0?V.scaleOrientMinDistance:n;return e.farDistance=o,t}),e)])}_updateManipulatorVisibility(){const e=this._someManipulatorSelected(),i=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let n=[];const o=e=>{n.push(e.disableDisplay())};e||!a&&i?this.removeHandles(E):(this._scaleOrientManipulation.forEachManipulator(o),this._moveManipulation.forEachManipulator(o),this.addHandles(n,E),n=[]),e||!a&&i||a&&t?this.removeHandles(z):(this._fieldOfViewManipulation.forEachManipulator(o),this.addHandles(n,z)),e||!a?this.removeHandles(U):this.addHandles(this._observerManipulator.disableDisplay(),U)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(e){this._forEachManipulation(i=>{i.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:e=>{this._forceHoveringTestPromise=e}}}};e([g({constructOnly:!0})],R.prototype,"analysis",void 0),e([g({constructOnly:!0})],R.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],R.prototype,"parentTool",void 0),e([g({constructOnly:!0,nonNullable:!0})],R.prototype,"view",void 0),e([g()],R.prototype,"_forceHoveringTask",void 0),e([g()],R.prototype,"updating",null),e([g()],R.prototype,"viewshed",null),e([g()],R.prototype,"_grabbing",void 0),e([g()],R.prototype,"grabbing",null),e([g()],R.prototype,"viewshedComputedData",void 0),e([g()],R.prototype,"observer",null),e([g()],R.prototype,"elevationAlignedObserverRenderSpace",null),R=e([m("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],R);const I=_(),G=new o(0,180);export{R as ViewshedSubTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,sync as t,initial as r}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{clone as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../../geometry/Point.js";import{pointEquals as l}from"../../../../layers/graphics/dehydratedFeatureComparison.js";import{makeDehydratedPoint as c}from"../../../../layers/graphics/dehydratedPoint.js";import{absoluteHeightElevationInfo as p}from"../../../../support/elevationInfoUtils.js";import{ViewshedDrawToolRenderer as d}from"./ViewshedDrawToolRenderer.js";import{Intersector as m}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as u}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{DrawTool as f}from"../../../draw/DrawTool.js";import{acquire as g}from"../../../interactive/snapping/SnappingManagerPool.js";function j(o){const{analysisViewData:i,view:a,sketchOptions:s,onCancel:l,onComplete:c,onManipulatorCountChange:u}=o,j=new d({view:a}),P=g(a),w=new m(a.state.viewingMode),b=new f({elevationInfo:p,enableVertexVisuals:!1,hasZ:!0,renderer:j,sketchOptions:s,snappingManager:P.snappingManager,view:a});return b.addHandles([P,e(j),b.on("cancel",()=>l(b)),b.on("complete",()=>c(b)),n(()=>b.manipulators.length,()=>u(b),t),n(()=>i.visible,e=>j.analysisVisible=e,r)]),{drawTool:b,intersector:w,renderer:j}}function P({drawTool:e,intersector:n,mapPoint:t,view:r}){const{interactiveHandleManager:o,lastScreenPosition:s}=e,l=e.getVertexSnappingCandidates(),c=a();if(!r.renderCoordsHelper.toRenderCoords(t,c))return null;const p=o?.capturingHandle??o?.allhandles?.at(0),d=p?.screenPosition??s,m=null!=p?w({handle:p,spatialReference:r.spatialReference,vertexSnappingCandidates:l}):null,u=null!=d?v(d,r,n):null;return{mapPoint:(u?.mapPoint??t).clone(),scenePoint:u?.scenePoint?i(u.scenePoint):c,feature:null!=m?h(m):u?.feature}}function w({handle:e,spatialReference:n,vertexSnappingCandidates:t}){const r=e.selectedSnappingResult;if(!r)return null;const o=r.spatialReference??n;return t.find(({targetPoint:e})=>l(r,c(e.x,e.y,e.z,o)))}const b={mapPoint:new s,scenePoint:a(),feature:null};function v(e,n,t){n.sceneIntersectionHelper.intersectToolIntersectorScreen(o(e.x,e.y),t);const r=b,i=t.results.min;return i.getIntersectionPoint(r.scenePoint)?(r.mapPoint.spatialReference=n.spatialReference,n.renderCoordsHelper.fromRenderCoords(r.scenePoint,r.mapPoint),r.feature=u(i,n),r):null}function h(e){const n={id:e.layer.id,objectIdField:"objectIdField"in e.layer?e.layer.objectIdField:void 0};return{attributes:{[n.objectIdField??"ObjectId"]:e.objectId},layer:n,objectId:e.objectId,uid:null}}export{j as createDrawTool,P as createPlacementResult};
|
|
2
|
+
import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,sync as t,initial as r}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{clone as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../../geometry/Point.js";import{pointEquals as l}from"../../../../layers/graphics/dehydratedFeatureComparison.js";import{makeDehydratedPoint as c}from"../../../../layers/graphics/dehydratedPoint.js";import{absoluteHeightElevationInfo as p}from"../../../../support/elevationInfoUtils.js";import{ViewshedDrawToolRenderer as d}from"./ViewshedDrawToolRenderer.js";import{Intersector as m}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as u}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{DrawTool as f}from"../../../draw/DrawTool.js";import{acquire as g}from"../../../interactive/snapping/SnappingManagerPool.js";function j(o){const{analysisViewData:i,view:a,sketchOptions:s,onCancel:l,onComplete:c,onManipulatorCountChange:u}=o,j=new d({view:a}),P=g(a),w=new m(a.state.viewingMode),b=new f({elevationInfo:p,enableVertexVisuals:!1,hasZ:!0,renderer:j,sketchOptions:s,snappingManager:P.snappingManager,view:a});return j.addSphereManipulator(b),b.addHandles([P,e(j),b.on("cancel",()=>l(b)),b.on("complete",()=>c(b)),n(()=>b.manipulators.length,()=>u(b),t),n(()=>i.visible,e=>j.analysisVisible=e,r)]),{drawTool:b,intersector:w,renderer:j}}function P({drawTool:e,intersector:n,mapPoint:t,view:r}){const{interactiveHandleManager:o,lastScreenPosition:s}=e,l=e.getVertexSnappingCandidates(),c=a();if(!r.renderCoordsHelper.toRenderCoords(t,c))return null;const p=o?.capturingHandle??o?.allhandles?.at(0),d=p?.screenPosition??s,m=null!=p?w({handle:p,spatialReference:r.spatialReference,vertexSnappingCandidates:l}):null,u=null!=d?v(d,r,n):null;return{mapPoint:(u?.mapPoint??t).clone(),scenePoint:u?.scenePoint?i(u.scenePoint):c,feature:null!=m?h(m):u?.feature}}function w({handle:e,spatialReference:n,vertexSnappingCandidates:t}){const r=e.selectedSnappingResult;if(!r)return null;const o=r.spatialReference??n;return t.find(({targetPoint:e})=>l(r,c(e.x,e.y,e.z,o)))}const b={mapPoint:new s,scenePoint:a(),feature:null};function v(e,n,t){n.sceneIntersectionHelper.intersectToolIntersectorScreen(o(e.x,e.y),t);const r=b,i=t.results.min;return i.getIntersectionPoint(r.scenePoint)?(r.mapPoint.spatialReference=n.spatialReference,n.renderCoordsHelper.fromRenderCoords(r.scenePoint,r.mapPoint),r.feature=u(i,n),r):null}function h(e){const n={id:e.layer.id,objectIdField:"objectIdField"in e.layer?e.layer.objectIdField:void 0};return{attributes:{[n.objectIdField??"ObjectId"]:e.objectId},layer:n,objectId:e.objectId,uid:null}}export{j as createDrawTool,P as createPlacementResult};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import r from"../../../../core/Handles.js";import{watch as t,initial as o}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators.js";import{viewshedToolManipulatorConfiguration as s}from"./ViewshedConfiguration.js";import{Manipulator3D as a}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as c}from"../../interactive/manipulatorUtils.js";import{RenderObject as n}from"../../interactive/RenderObject.js";import{createSphereGeometry as l}from"../../webgl-engine/lib/GeometryUtil.js";class m extends a{constructor(e,i){super({view:e,autoScaleRenderObjects:!1,worldSized:!1,radius:s.observerSize,interactive:!1}),this._handles=new r;const a=c(this._color);this.renderObjects=[new n(l(a,s.observerSize,32,32))],i.manipulators.add(this),this._handles.add([t(()=>this._color,e=>{a.setParameters({color:e})},o)])}destroy(){this._handles.remove(),super.destroy()}get _color(){return this.view.effectiveTheme.accentColor.toUnitRGBA()}}e([i()],m.prototype,"_color",null);export{m as
|
|
2
|
+
import{__decorate as e}from"tslib";import r from"../../../../core/Handles.js";import{watch as t,initial as o}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators.js";import{viewshedToolManipulatorConfiguration as s}from"./ViewshedConfiguration.js";import{Manipulator3D as a}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as c}from"../../interactive/manipulatorUtils.js";import{RenderObject as n}from"../../interactive/RenderObject.js";import{createSphereGeometry as l}from"../../webgl-engine/lib/GeometryUtil.js";class m extends a{constructor(e,i){super({view:e,autoScaleRenderObjects:!1,worldSized:!1,radius:s.observerSize,interactive:!1}),this._handles=new r;const a=c(this._color);this.renderObjects=[new n(l(a,s.observerSize,32,32))],i.manipulators.add(this),this._handles.add([t(()=>this._color,e=>{a.setParameters({color:e})},o)])}destroy(){this._handles.remove(),super.destroy()}get _color(){return this.view.effectiveTheme.accentColor.toUnitRGBA()}}e([i()],m.prototype,"_color",null);export{m as ViewshedSphereManipulator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import"../../../core/has.js";import{watch as i,sync as n,syncAndInitial as r,when as
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import"../../../core/has.js";import{watch as i,sync as n,syncAndInitial as r,when as o}from"../../../core/reactiveUtils.js";import{property as s,subclass as a}from"../../../core/accessorSupport/decorators.js";import{length as h,equals as l,copy as c,scale as g,lerp as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as p,create as m,fromValues as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEarth as v,getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{isLoadedOrLoadFor as f}from"../../../geometry/projectionUtils.js";import w from"../../../geometry/SpatialReference.js";import{projectPointToVector as y}from"../../../geometry/projection/projectPointToVector.js";import{getGCSForPlanet as b}from"../../../geometry/support/planetGCSUtils.js";import{heightLimit as P}from"./weather.js";import{positionToTimezoneInfo as T}from"../support/earthUtils.js";import{ColorAndIntensity as L,computeColorAndIntensity as j,computeVirtualLightDirection as E}from"../support/sunUtils.js";import{MainLight as U,AmbientLight as G,FillLight as H}from"../webgl-engine/lighting/Lightsources.js";let S=class extends t{constructor(e){super(e),this.view=null,this._tmpLightParameters=new L,this._defaultLightParameters=new L,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey="viewHandles",this._trackingEnabled=!1,this._mainLight=new U,this._ambientLight=new G,this._moonLight=new H,this._disableWeather=!1,this._resetReferencePosition()}destroy(){this.disconnectView()}get updating(){return!this._canProjectCameraPosition}get weatherEnabled(){return null!=this.view&&null!=this.view.stage&&null!=this.view.stage.renderer&&null!=this.view.stage.renderer.weatherFader&&this.view.environment.atmosphereEnabled&&!this._disableWeather&&1===this.view.state?.viewingMode&&v(this.view.spatialReference)}get _weatherAvailable(){return null!=this.view&&this.weatherEnabled&&h(this.view.state.camera.eye)-_(this.view.spatialReference).radius<=P}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){const e=this.view?.stateManager?.camera?.position?.spatialReference??w.WGS84,t=b(e);return f(e,t)}connectView(e){this.view=e;const t=()=>e.stage.renderer.modifyShadowsEnabled(),s=()=>this._cameraHandler();this.addHandles([i(()=>e.environment.lighting,e=>this._updateLightingHandler(e),n),i(()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null,e=>this._lightingDateHandler(e),n),i(()=>e.environment.lighting.directShadowsEnabled,t,n),i(()=>e.spatialReference,()=>this._resetReferencePosition(!0),n),i(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),n),i(()=>e.environment,e=>e.setComputeWeatherAvailable(()=>this._weatherAvailable),r),i(()=>e.viewingMode,()=>this._resetReferencePosition(!0),r),i(()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),r),i(()=>e.state.camera,s,r),o(()=>this._canProjectCameraPosition,()=>this._resetReferencePosition(!0),n)],this._viewHandlesKey),this.view.stage.renderer.modifyShadowsEnabled(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition()}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this.view?.stage.renderer.modifyShadowsEnabled()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{if(!this.view)return;const e=this.view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){if(!this.view)return;const t=this.view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),null!=this._referencePositionGeographic)){const e=T(this._referencePositionGeographic,this._tmpTz);null!=e&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){this.view&&!this._trackingEnabled&&"virtual"!==this.view.environment.lighting.type&&this.view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this.view;if(!t||!t.ready)return;const i=t.stateManager.camera;if(!i)return;const n=i.position,r=n.spatialReference??w.WGS84,o=b(r);if(!y(n,R,o,z)){if(null==this._referencePositionGeographic)return;return this._referencePositionGeographic=null,void this._updateLighting()}this._referencePositionGeographic?l(this._referencePositionGeographic,R)||(c(this._referencePositionGeographic,R),this.notifyChange("referencePositionGeographic")):this._referencePositionGeographic=p(R),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e)}_updateLighting(e,t=0){const i=this.view;if(!i)return;const{lighting:n}=i.environment,r="virtual"===n.type,o=this._referencePositionGeographic,s=null!=o?this._tmpLightParameters:this._defaultLightParameters;if(o){e??=r?null:n.date;const t=this._weatherAvailable?i.environment.weather.type:"disabled";j(e,o,i.state.viewingMode,t,i.state.camera,s)}else r&&E(i.state.camera,i.state.viewingMode,s.direct.directionToLightSource);const a=this._mainLight,h=s.direct;g(a.intensity,h.color,h.intensity*Math.PI),c(a.direction,h.directionToLightSource),a.specularStrength=s.specularStrength,a.environmentStrength=s.environmentStrength;const l=this._ambientLight;g(l.intensity,s.ambient.color,s.ambient.intensity);const p=this._moonLight;d(p.intensity,C,k,s.globalFactor);const m=(1-.5*s.globalFactor)*(1-.4*s.noonFactor*(1-s.globalFactor));g(p.intensity,p.intensity,m),c(p.direction,h.directionToLightSource),i.stage.renderer.updateLighting([a,l,p],s.noonFactor,s.globalFactor,this._weatherAvailable?t:0),i.stage.renderer.modifyShadowsEnabled()}_autoUpdateTimezone(e,t=null){if(!this.view||"virtual"===this.view.environment.lighting.type||!this.view.environment.lighting.cameraTrackingEnabled||null==e)return!1;const i=this._tmpDate;i.setTime((t||this.view.environment.lighting.date).getTime());const n=T(e,this._tmpTz);if(null==n)return!1;let r=this.view.environment.lighting.positionTimezoneInfo;if(r.autoUpdated){if(r.hours===n.hours&&r.minutes===n.minutes&&r.seconds===n.seconds)return!1}else r=n;const o=i.getUTCHours()-(n.hours-r.hours),s=i.getUTCMinutes()-(n.minutes-r.minutes),a=i.getUTCSeconds()-(n.seconds-r.seconds);return i.setUTCHours(o),i.setUTCMinutes(s),i.setUTCSeconds(a),!t&&this.view.environment.lighting.autoUpdate(i,n)}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}get test(){}};e([s()],S.prototype,"view",void 0),e([s({type:Boolean,readOnly:!0})],S.prototype,"updating",null),e([s()],S.prototype,"_disableWeather",void 0),e([s()],S.prototype,"weatherEnabled",null),e([s()],S.prototype,"_weatherAvailable",null),e([s()],S.prototype,"referencePositionGeographic",null),e([s()],S.prototype,"_referencePositionGeographic",void 0),e([s()],S.prototype,"_canProjectCameraPosition",null),S=e([a("esri.views.3d.environment.EnvironmentManager")],S);const C=u(.22,.22,.33),k=u(.22,.22,.22),R=m(),z={zConversionDisabled:!0};export{S as EnvironmentManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{signal as e}from"../../../../core/signal.js";import{Milliseconds as i}from"../../../../core/time.js";class t{static{this.fadeInEase=e=>e*(2-e)}static{this.fadeOutEase=e=>e*e}static{this.inverseFadeInEase=e=>1-Math.sqrt(1-e)}static{this.inverseFadeOutEase=e=>Math.sqrt(1-e)}static{this.minimumFadeDuration=i(80)}static{this.resetFadeDurationInterval=i(1e3)}constructor(t){this.layerView=t,this._numFadingTiles=e(0),this._tmpFullyFadedOutTiles=new Array,this._previousNumFadingTiles=0,this._lastStoppedFading=i(0),this._currentFadeDuration=this.baseFadeDuration}get numFadingTiles(){return this._numFadingTiles.value}fadeTile(e,i,t){const a=this._getTargetOpacity(i);if(e.fadeDirection=i,!this.fadingEnabled)return void this._instantTileFading(e,a);const s=e.opacityModifier;if(s!==a){const a=this._getFadeProgressFromOpacity(s,i);this._startTileFading(e,a,t)}else this._stopTileFading(e)}updateAllTileFading(e){const i=this._tmpFullyFadedOutTiles;i.length=0,this.layerView.tileHandles.forEach(t=>{this._updateTileFading(t,e)&&i.push(t)});i.length>0&&(this.layerView.notifyTileObbsChanged(i),0===this._numFadingTiles.value&&this.layerView.updateGaussians()),this._numFadingTiles.value>0&&this.layerView.view.stage?.renderView.requestRender(2)}onFadeDurationChanged(e){0===e&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(e){return null!=e.fadeProgress&&1===e.fadeDirection}onTileDiscarded(e){null!=e.fadeProgress&&(this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=i(performance.now())))}updateFadeDuration(){if(this.numFadingTiles&&this.numFadingTiles>=this._previousNumFadingTiles){const e=.95*this._currentFadeDuration;this._currentFadeDuration=i(Math.max(e,t.minimumFadeDuration))}else 0===this.numFadingTiles&&performance.now()-this._lastStoppedFading>t.resetFadeDurationInterval&&(this._currentFadeDuration=this.baseFadeDuration);return this._previousNumFadingTiles=this.numFadingTiles,
|
|
2
|
+
import{signal as e}from"../../../../core/signal.js";import{Milliseconds as i}from"../../../../core/time.js";class t{static{this.fadeInEase=e=>e*(2-e)}static{this.fadeOutEase=e=>e*e}static{this.inverseFadeInEase=e=>1-Math.sqrt(1-e)}static{this.inverseFadeOutEase=e=>Math.sqrt(1-e)}static{this.minimumFadeDuration=i(80)}static{this.resetFadeDurationInterval=i(1e3)}constructor(t){this.layerView=t,this._numFadingTiles=e(0),this._tmpFullyFadedOutTiles=new Array,this._previousNumFadingTiles=0,this._lastStoppedFading=i(0),this._currentFadeDuration=this.baseFadeDuration}get numFadingTiles(){return this._numFadingTiles.value}fadeTile(e,i,t){const a=this._getTargetOpacity(i);if(e.fadeDirection=i,!this.fadingEnabled)return void this._instantTileFading(e,a);const s=e.opacityModifier;if(s!==a){const a=this._getFadeProgressFromOpacity(s,i);this._startTileFading(e,a,t)}else this._stopTileFading(e)}updateAllTileFading(e){const i=this._tmpFullyFadedOutTiles;i.length=0,this.layerView.tileHandles.forEach(t=>{this._updateTileFading(t,e)&&i.push(t)});i.length>0&&(this.layerView.notifyTileObbsChanged(i),0===this._numFadingTiles.value&&this.layerView.updateGaussians()),this._numFadingTiles.value>0&&this.layerView.view.stage?.renderView.requestRender(2)}onFadeDurationChanged(e){0===e&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(e){return null!=e.fadeProgress&&1===e.fadeDirection}onTileDiscarded(e){null!=e.fadeProgress&&(this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=i(performance.now())))}updateFadeDuration(){if(this.numFadingTiles&&this.numFadingTiles>=this._previousNumFadingTiles){const e=.95*this._currentFadeDuration;this._currentFadeDuration=i(Math.max(e,t.minimumFadeDuration))}else 0===this.numFadingTiles&&performance.now()-this._lastStoppedFading>t.resetFadeDurationInterval&&(this._currentFadeDuration=this.baseFadeDuration);return this._previousNumFadingTiles=this.numFadingTiles,this._currentFadeDuration}get updating(){return this._numFadingTiles.value>0}get baseFadeDuration(){return this.layerView.view.qualitySettings.fadeDuration}get fadingEnabled(){return 0!==this.baseFadeDuration}_startTileFading(e,i,t){null==e.fadeProgress&&this._numFadingTiles.value++,e.fadeDuration=t,e.fadeProgress=i}_stopTileFading(e){null!=e.fadeProgress&&(1===e.fadeDirection&&this._onTileFullyFadedOut(e),this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=i(performance.now())),e.fadeDuration=null,e.fadeProgress=null)}_updateTileFading(e,i){const{fadeProgress:a,fadeDirection:s}=e;if(null==a)return!1;const n=this._fadeDirectionToSign(s),r=e.fadeDuration,d=this._getTargetOpacity(s),l=i/Math.abs(r||1),u=Math.min(a+l,1),o=n*(1-(0===s?t.fadeInEase:t.fadeOutEase)(u)),h=1===u;if(e.opacityModifier=h?d:d-o,h){const i=1===s;return this._stopTileFading(e),this._updateOpacityModifier(e),i}return e.fadeProgress=u,this._updateOpacityModifier(e),!1}_updateOpacityModifier(e){const i=255*e.opacityModifier;for(let t=0;t<e.pageIds.length;t++){const a=e.pageIds[t];this.layerView.data.fadingTexture.updateBuffer(i,a)}}_instantTileFading(e,i){e.fadeDuration=null,e.fadeProgress=null,e.opacityModifier=i,this._updateOpacityModifier(e),1===e.fadeDirection&&this._onTileFullyFadedOut(e)}_instantlyFullyFadeAllTiles(){const e=this._tmpFullyFadedOutTiles;e.length=0,this.layerView.tileHandles.forEach(i=>{if(null!=i.fadeProgress){const t=1===i.fadeDirection;this._instantTileFading(i,this._getTargetOpacity(i.fadeDirection)),t&&e.push(i)}});e.length>0&&(this.layerView.updateGaussians(),this.layerView.notifyTileObbsChanged(e)),this._numFadingTiles.value=0}_onTileFullyFadedOut(e){e.lifecycleState=0,this.layerView.moveTileToCache(e)}_fadeDirectionToSign(e){return 0===e?1:-1}_getTargetOpacity(e){return 0===e?1:0}_getFadeProgressFromOpacity(e,i){const a=Math.max(0,Math.min(e,1));return 0===i?t.inverseFadeInEase(a):t.inverseFadeOutEase(a)}}export{t as GaussianSplatFadeHelper};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import{glsl as t}from"../../shaderModules/glsl.js";function a(a,e){switch(e.output){case 5:case 6:case 7:case 8:a.fragment.code.add(t`float _calculateFragDepth(const in float depth) {
|
|
3
|
-
const float
|
|
4
|
-
const float
|
|
3
|
+
const float slope_scale = 2.0;
|
|
4
|
+
const float bias = 20.0 * .000015259;
|
|
5
5
|
float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
|
|
6
|
-
return depth +
|
|
6
|
+
return depth + slope_scale * m + bias;
|
|
7
7
|
}
|
|
8
8
|
void outputDepth(float _linearDepth){
|
|
9
9
|
float fragDepth = _calculateFragDepth(_linearDepth);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as m,sync as u}from"../../../../core/reactiveUtils.js";import{signal as _}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as I,create as E}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as S,InternalRenderCategory as R,AllRenderNodeOutputs as O,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as G}from"../../support/debugFlags.js";import{FBOCache as N}from"../core/FBOCache.js";import{RenderPassManager as H}from"../core/renderPasses/RenderPassManager.js";import{isColor as x}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as y}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as v}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as L}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as q}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as j,renderHighlightBuffer as B}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Q}from"./BoundingInfo.js";import{Compositor as z}from"./Compositor.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as X}from"./depthRangeUtils.js";import{MainFramebuffer as $}from"./MainFramebuffer.js";import{RenderContext as J,defaultRenderOccludedMask as K}from"./RenderContext.js";import{RendererBase as Z}from"./RendererBase.js";import{setupFeatureDefaults as ee}from"./RenderFeature.js";import{RenderPluginInput as te}from"./RenderPluginInput.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ie}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as de,PixelType as le,ColorAttachment2 as me,ColorAttachment0 as ue,DrawBufferNone as _e}from"../../../webgl/enums.js";let pe=class extends Z{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new H,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new re,this.sceneDepthRange=_(Y.Infinite),this._state=_(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=_(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new te,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Se)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new N(i),this._compositor=new z(i,s),this._renderStateFeatures=_(ee(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new J(this._rctx,a,s),this._framebuffer=new $(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(s),this._shadowAccumulator=new se(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,i)=>{const r=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,i,!0,r),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},r),this._nodes=new v(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new L({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>G.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},m),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=y,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>r(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},m),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,Q.prune(),ae.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new V(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=ee(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._plugins.hasEmissions}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ge(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,I)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...Ee),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(S.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(R.CUTFILL_COLOR),this._renderOverlay(),r.setGLViewport(this._rctx);const m=this._framebuffer,u=m.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),_=this._needsLastFrameColor;_?(u?.retain(_-1),u?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=u):u?.release(),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ae),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...be),this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!i),m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPreTransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPreTransparent(),this._bindParameters.emissions=2),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),m.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(R.VIEWSHED,e)),m.update(e=>this._renderNodes(R.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),m.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),m.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.GROUND_DEPTH),m.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(S.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this.hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=m.color.obtainAttachment(de)),m.update(e=>this._renderNodes(R.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&m.update(e=>this._renderHUD(b,e)),m.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||m.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,m.update(e=>this._renderNodes(R.MAGNIFIER,e)),m.update(e=>this._renderNodes(S.FINAL,e)),i&&this._blit.toFramebuffer(m.color,this._bindParameters),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),m.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=m.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(f,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const t=this._bindParameters,s=t.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(s,R.OPAQUE_ENVIRONMENT,R.GAUSSIAN_SPLAT,R.OPAQUE_OCCLUSION_QUERY,R.VOXEL);if(2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2),this._bindParameters.output=3,this._plugins.precompile(...fe),this._bindParameters.output=0,this._plugins.precompile(...fe),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1),this._precompileTransparentGeometry()}this._nodes.precompile(s,R.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(s,R.TRANSPARENT_ENVIRONMENT,R.VIEWSHED,R.CUTFILL_COMPUTATION,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(s,R.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(s,S.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),s&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,"olid");return i.acquireDepth(14),i=this._nodes.render(i,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(oe.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,le.UNSIGNED_BYTE,t),r.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(R.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(R.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=t===this._bindParameters.shadowMap&&6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowCasterNodes();t.finish(e),this._bindParameters.output=s}_renderShadowCasterNodes(){if(!this._nodes.produces(R.SHADOW_CASTERS))return;const e=this._bindParameters.shadowMap.renderTarget;if(!e)return;const t=e.name;e.setName(R.SHADOW_CASTERS),this._pluginInput.set(R.SHADOW_CASTERS,e);try{this._nodes.render(e,this._pluginInput,this._releaseNodeInputs)}finally{e.setName(t),this._pluginInput.set(R.SHADOW_CASTERS,null)}}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(R.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(oe.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(oe.DEPTH)}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=X(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),this._bindParameters.shadowMap.enabled&&t.union(this._nodes.queryDepthRange(R.SHADOW_CASTERS,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Y.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<q)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=X(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...O,R.VIEWSHED,R.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,ge),this._needsDepth&&this._precompilePlugins(3,Pe)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,R.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&(this._shadowAccumulator.precompilePrepass(),this._precompileAllGeometry(5)),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals",5);i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...ge);const r=this._nodes.optional("normals",...O,R.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(oe.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const e=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this._bindParameters.globalIlluminationEnabled=!0,this.hasGlobalIlluminationHighQuality?this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION_HIGH_QUALITY):this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor),this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination),this._bindParameters.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...fe),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ie);this._renderContext.renderOccludedMask=K}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Ie),this._renderContext.renderOccludedMask=K}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,Te)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Te),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,R.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Pe)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...ce),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...ce)}_renderTransparentGeometry(){this._plugins.render(...be),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...fe)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...Ee),this._bindParameters.output=2,this._plugins.precompile(...Ee),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...Ee)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(de);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>j?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),B(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...we),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&(this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){x(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...be),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...be),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...be)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",m=this.fboCache.acquire(i,r,l,o),u=h.hasEmission&&(0===e||1!==t);u&&m.acquireColor(de,o,"oit emissive");const _=u?me:de;m.acquireColor(_,this.hasFloatBlend?7:0,"oit alpha"),s||m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,C),a(),m.detachDepth(),h.output=2;const p=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");u&&p.acquireColor(de,o,"oit front emissive"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(_,0,"hud occlusion"),this._rctx.clearBuffer(_-ue,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,m,p,h,u,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(_)),p.release(),m.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...ce)||this.plugins.produces(5,...ce)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(R.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(S.OPAQUE,t,e)),this.fboCache.debugCallback?.(S.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(R.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(R.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(R.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.VOXEL,e)),this.fboCache.debugCallback?.(R.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(S.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(S.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),this._renderTransparentEnvironment()}_renderTransparentEnvironment(){if(this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(oe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([_e,de]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const i=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(i,t.fbo);const r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),r}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=I);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(f(Oe,t.viewMatrix),f(Re,t.projectionMatrix),g(De,Oe,Re),g(De,s.viewMatrix,De),g(De,s.projectionMatrix,De),this._reprojectionMatrix=De):this._reprojectionMatrix=I,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(Fe,s.viewMatrix,Oe),P(t,Fe)):P(t,I)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],pe.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],pe.prototype,"highResolutionAtmosphere",null),e([p()],pe.prototype,"_edgeView",void 0),e([p()],pe.prototype,"updating",null),pe=e([c("esri.views.3d.webgl-engine.lib.Renderer")],pe);const ce=[0,1,2,3],be=[7,6,4,5],fe=[7,6],ge=[0,1,2,4,...fe],Pe=[3,5],Ie=[2,4,8],Ee=[16,12,14,13],we=[4,5,2,3,0,1,...fe],Ae=[4,8,5,11],Ce={0:[13],1:[12],2:[13,12],3:[13,12]},Te=[0,1,...fe],Se=["normals","highlights"],Re=E(),Oe=E(),De=E(),Fe=E();function Ge(e){return t=>e.immediate.schedule(t)}export{pe as Renderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as m,sync as u}from"../../../../core/reactiveUtils.js";import{signal as _}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as I,create as E}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as S}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as T,InternalRenderCategory as R,AllRenderNodeOutputs as O,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as G}from"../../support/debugFlags.js";import{computeShadowsEnabled as N}from"../../support/sunUtils.js";import{FBOCache as H}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{isColor as y}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as v}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as M}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{WeatherFader as q}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as U}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as V}from"../effects/highlight/Highlight.js";import{OITBlend as k}from"../effects/transparency/OITBlend.js";import{AnimationTimer as W}from"./AnimationTimer.js";import{AnimationTimeStep as Q}from"./AnimationTimeStep.js";import{BoundingInfo as z}from"./BoundingInfo.js";import{Compositor as Y}from"./Compositor.js";import{DepthRange as X}from"./DepthRange.js";import{depthRangeFromScene as $}from"./depthRangeUtils.js";import{MainFramebuffer as J}from"./MainFramebuffer.js";import{RenderContext as K,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as se}from"./RenderPluginInput.js";import{ShadowAccumulator as ie}from"./ShadowAccumulator.js";import{ShadowMap as re}from"./ShadowMap.js";import ae from"./SliceHelper.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as he}from"../parts/renderUtils.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as le,PixelType as me,ColorAttachment2 as ue,ColorAttachment0 as _e,DrawBufferNone as pe}from"../../../webgl/enums.js";let ce=class extends ee{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new x,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ae,this.sceneDepthRange=_(X.Infinite),this._state=_(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasAnimations=!1,this._animationTimestep=new Q,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=_(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new se,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new H(i),this._compositor=new Y(i,s),this._renderStateFeatures=_(te(e.view.qualityProfile));const a=new re(this._fboCache,e.viewingMode);this._renderContext=new K(this._rctx,a,s),this._framebuffer=new J(this._fboCache,this._bindParameters),this._performanceInfo=new oe(this._rctx),this._blit=new j(s),this._shadowAccumulator=new ie(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,i)=>{const r=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,i,!0,r),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},r),this._nodes=new M(this._renderContext),this._plugins=new L({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new q({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>G.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},m),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=v,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>r(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},m),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,z.prune(),ne.prune(),S()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new k(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._plugins.hasEmissions}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ne(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,I)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}modifyShadowsEnabled(){const e=this.stage.view.environmentManager.referencePositionGeographic,t=null==e||N(e[2],this.stage.viewingMode),s=this.stage.view.environment.lighting.directShadowsEnabled&&t;this._bindParameters.shadowMap.enabled!==s&&(this._bindParameters.shadowMap.enabled=s,this._requestRender(1))}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new W(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new he(this._pluginInput.get(T.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(R.CUTFILL_COLOR),this._renderOverlay(),r.setGLViewport(this._rctx);const m=this._framebuffer,u=m.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),_=this._needsLastFrameColor;_?(u?.retain(_-1),u?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=u):u?.release(),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ce),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...fe),this._precompilePrepasses(),this.performanceInfo.advance(de.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!i),m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPreTransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPreTransparent(),this._bindParameters.emissions=2),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),m.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(R.VIEWSHED,e)),m.update(e=>this._renderNodes(R.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),m.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),m.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.GROUND_DEPTH),m.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(T.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this.hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=m.color.obtainAttachment(le)),m.update(e=>this._renderNodes(R.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&m.update(e=>this._renderHUD(b,e)),m.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||m.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,m.update(e=>this._renderNodes(R.MAGNIFIER,e)),m.update(e=>this._renderNodes(T.FINAL,e)),i&&this._blit.toFramebuffer(m.color,this._bindParameters),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),m.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=m.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new he(f,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const t=this._bindParameters,s=t.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(s,R.OPAQUE_ENVIRONMENT,R.GAUSSIAN_SPLAT,R.OPAQUE_OCCLUSION_QUERY,R.VOXEL);if(2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2),this._bindParameters.output=3,this._plugins.precompile(...ge),this._bindParameters.output=0,this._plugins.precompile(...ge),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1),this._precompileTransparentGeometry()}this._nodes.precompile(s,R.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(s,R.TRANSPARENT_ENVIRONMENT,R.VIEWSHED,R.CUTFILL_COMPUTATION,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(s,R.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(s,T.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),s&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(de.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,"olid");return i.acquireDepth(14),i=this._nodes.render(i,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,me.UNSIGNED_BYTE,t),r.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?de.OPAQUE_EDGES:de.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(de.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(R.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(de.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(R.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=t===this._bindParameters.shadowMap&&6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowCasterNodes();t.finish(e),this._bindParameters.output=s}_renderShadowCasterNodes(){if(!this._nodes.produces(R.SHADOW_CASTERS))return;const e=this._bindParameters.shadowMap.renderTarget;if(!e)return;const t=e.name;e.setName(R.SHADOW_CASTERS),this._pluginInput.set(R.SHADOW_CASTERS,e);try{this._nodes.render(e,this._pluginInput,this._releaseNodeInputs)}finally{e.setName(t),this._pluginInput.set(R.SHADOW_CASTERS,null)}}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(R.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(de.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(de.DEPTH)}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return X.Zero;const t=$(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),this._bindParameters.shadowMap.enabled&&t.union(this._nodes.queryDepthRange(R.SHADOW_CASTERS,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=X.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<U)return void(this.sceneDepthRange.value=X.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=$(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...O,R.VIEWSHED,R.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Ie)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,R.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&(this._shadowAccumulator.precompilePrepass(),this._precompileAllGeometry(5)),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals",5);i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe);const r=this._nodes.optional("normals",...O,R.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(de.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const e=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this._bindParameters.globalIlluminationEnabled=!0,this.hasGlobalIlluminationHighQuality?this.performanceInfo.advance(de.AMBIENT_ILLUMINATION_HIGH_QUALITY):this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor),this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination),this._bindParameters.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...ge),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ee);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Ee),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Se[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,Te)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Te),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,R.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ie)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...be),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...be)}_renderTransparentGeometry(){this._plugins.render(...fe),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...ge)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(le);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?de.HUD_OCCLUDED:de.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>B?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),V(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(de.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ae),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&(this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){y(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...fe),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...fe),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...fe)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",m=this.fboCache.acquire(i,r,l,o),u=h.hasEmission&&(0===e||1!==t);u&&m.acquireColor(le,o,"oit emissive");const _=u?ue:le;m.acquireColor(_,this.hasFloatBlend?7:0,"oit alpha"),s||m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,C),a(),m.detachDepth(),h.output=2;const p=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");u&&p.acquireColor(le,o,"oit front emissive"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(_,0,"hud occlusion"),this._rctx.clearBuffer(_-_e,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,m,p,h,u,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(_)),p.release(),m.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...be)||this.plugins.produces(5,...be)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(R.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(T.OPAQUE,t,e)),this.fboCache.debugCallback?.(T.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(R.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(R.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(R.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.VOXEL,e)),this.fboCache.debugCallback?.(R.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(T.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(T.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),this._renderTransparentEnvironment()}_renderTransparentEnvironment(){if(this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(de.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([pe,le]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const i=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(i,t.fbo);const r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),r}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=I);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(f(De,t.viewMatrix),f(Oe,t.projectionMatrix),g(Fe,De,Oe),g(Fe,s.viewMatrix,Fe),g(Fe,s.projectionMatrix,Fe),this._reprojectionMatrix=Fe):this._reprojectionMatrix=I,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(Ge,s.viewMatrix,De),P(t,Ge)):P(t,I)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],ce.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const be=[0,1,2,3],fe=[7,6,4,5],ge=[7,6],Pe=[0,1,2,4,...ge],Ie=[3,5],Ee=[2,4,8],we=[16,12,14,13],Ae=[4,5,2,3,0,1,...ge],Ce=[4,8,5,11],Se={0:[13],1:[12],2:[13,12],3:[13,12]},Te=[0,1,...ge],Re=["normals","highlights"],Oe=E(),De=E(),Fe=E(),Ge=E();function Ne(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{equals as s}from"../../../../core/arrayUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{property as r,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{exactEquals as o,copy as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{equals as s}from"../../../../core/arrayUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{property as r,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{exactEquals as o,copy as n,equals as h}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{createQuadVAO as l}from"./glUtil3D.js";import{vvColorNumber as d}from"../materials/VisualVariablePassParameters.js";import{a as _}from"../../../../chunks/ShadowCastVisualize.glsl.js";import{ShadowCastVisualizeTechnique as m}from"../shaders/ShadowCastVisualizeTechnique.js";import{ShadowCastVisualizeTechniqueConfiguration as u}from"../shaders/ShadowCastVisualizeTechniqueConfiguration.js";import{ColorAttachment0 as p}from"../../../webgl/enums.js";const c=4e4,b=5e4,f=1/512;let g=class extends t{constructor(e,t,s,i){super({}),this._fbos=e,this._techniques=t,this._data=s,this._requestRender=i,this._configuration=new u,this._enabled=!1,this._passParameters=new _(this._data),this._vao=l(e.rctx)}dispose(){this._stop(),this._vao=i(this._vao)}precompile(){this._showVisualization&&this._techniques.precompile(m,this._configuration)}render(e,t){if(!this._showVisualization)return;const[s,i]=this._data.computedSamples;this._passParameters.sampleScale=[s?1/s:0,i?1/i:0];const r=this._techniques.get(m,this._configuration),a=null!=t,o=this._rctx.boundFramebuffer;let n=null;a&&(n=this._fbos.acquire(e.camera.width,e.camera.height,"shadow cast masked draw"),n.attachDepth(t),this._rctx.bindFramebuffer(n.fbo),this._rctx.blitFramebuffer(o,n.fbo,16384)),this._rctx.bindVAO(this._vao),this._rctx.bindTechnique(r,e,this._passParameters),this._rctx.setDrawBuffers([p]),this._rctx.drawArrays(r.primitiveType,0,this._vao.vertexCount("geometry")),null!=n&&(this._rctx.bindFramebuffer(o),this._rctx.blitFramebuffer(n.fbo,o,16384),n.detachDepth(),n.release())}get _rctx(){return this._fbos.rctx}setOptions(e){void 0!==e.enabled&&this._setEnabled(e.enabled),void 0!==e.thresholdColor&&this._setThresholdColor(e.thresholdColor),void 0!==e.gradientColorRamp&&this._setGradientColorRamp(e.gradientColorRamp),void 0!==e.bandedGradientColorRamp&&this._setBandedGradientColorRamp(e.bandedGradientColorRamp),void 0!==e.threshold&&(this._threshold=e.threshold),void 0!==e.rendersSunlight&&(this._rendersSunlight=e.rendersSunlight),void 0!==e.visualization&&(this._visualization=e.visualization),void 0!==e.bandSize&&(this._bandSize=e.bandSize),void 0!==e.analysisVolume&&(this._configuration.useMask=null!==e.analysisVolume)}get opacityFromElevation(){return this._passParameters.opacityFromElevation}set opacityFromElevation(e){this._passParameters.opacityFromElevation!==e&&(this._passParameters.opacityFromElevation=e,this.notifyChange("opacityFromElevation"))}get _showVisualization(){return this._enabled&&(this._data.computedSamples[0]>0||this._data.computedSamples[1]>0)&&this.opacityFromElevation>f}get _threshold(){return this._passParameters.threshold}set _threshold(e){this._threshold!==e&&(this._passParameters.threshold=e,this._requestRenderIfEnabled())}get _rendersSunlight(){return this._configuration.rendersSunlight}set _rendersSunlight(e){this._rendersSunlight!==e&&(this._configuration.rendersSunlight=e,this._requestRenderIfEnabled())}get _visualization(){return this._configuration.visualization}set _visualization(e){e!==this._visualization&&(this._configuration.visualization=e,this._requestRenderIfEnabled())}get _bandSize(){return this._passParameters.bandSize}set _bandSize(e){e!==this._bandSize&&(this._passParameters.bandSize=e,this._requestRenderIfEnabled())}_setThresholdColor(e){const t=this._passParameters.thresholdColor;o(e,t)||(n(this._passParameters.thresholdColor,e),this._requestRenderIfEnabled())}_setGradientColorRamp(e){e.length>d&&(e=e.slice(0,d));v(this._passParameters.gradientColorRamp,e)||(this._passParameters.gradientColorRamp=e,this._requestRenderIfEnabled())}_setBandedGradientColorRamp(e){e.length>d&&(e=e.slice(0,d));v(this._passParameters.bandedGradientColorRamp,e)||(this._passParameters.bandedGradientColorRamp=e,this._requestRenderIfEnabled())}_setEnabled(e){e!==this._enabled&&(e?this._start():this._stop())}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}_start(){this._enabled=!0,this._requestRender()}_stop(){this._enabled=!1,this._requestRender()}};function v(e,t){return s(e,t,([e,t],[s,i])=>e===s&&h(t,i))}e([r()],g.prototype,"opacityFromElevation",null),g=e([a("esri.views.3d.webgl-engine.lib.ShadowCastRenderer")],g);export{g as ShadowCastRenderer,b as shadowCastDisableElevationMax,c as shadowCastDisableElevationMin,f as shadowCastDisabledElevationThreshold};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/
|
|
2
|
+
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"../../../webgl/ShaderBuilder.js";export{a as GaussianSplatShadowPassParameters,b as build}from"../../../../chunks/GaussianSplatShadow.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as o}from"tslib";import{parameter as t,ShaderTechniqueConfiguration as
|
|
2
|
+
import{__decorate as o}from"tslib";import{parameter as t,ShaderTechniqueConfiguration as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class e extends i{constructor(){super(...arguments),this.visualization=0,this.rendersSunlight=!1,this.useMask=!1}}o([t({count:4})],e.prototype,"visualization",void 0),o([t()],e.prototype,"rendersSunlight",void 0),o([t()],e.prototype,"useMask",void 0);export{e as ShadowCastVisualizeTechniqueConfiguration};
|
|
@@ -14,7 +14,7 @@ import type { AssociationsLayerUnion, AttachmentsChangeEvent, AttributeFormSuppo
|
|
|
14
14
|
import type { FormInput } from "./inputs/types.js";
|
|
15
15
|
import type { EditType } from "../support/forms/types.js";
|
|
16
16
|
|
|
17
|
-
export interface BatchAttributeFormViewModelProperties extends Partial<Pick<BatchAttributeFormViewModel, "activeFeatureIndex" | "disabled" | "editType" | "features" | "layerInfos" | "map" | "readOnly" | "selectedAttachment" | "selectedAttachmentAddElementId" | "selectedAttachmentListElementId" | "submitHasBeenAttempted" | "timeZone" | "userHasChangedValues">> {}
|
|
17
|
+
export interface BatchAttributeFormViewModelProperties extends Partial<Pick<BatchAttributeFormViewModel, "activeFeatureIndex" | "disabled" | "editType" | "features" | "layerInfos" | "map" | "readOnly" | "selectedAttachment" | "selectedAttachmentAddElementId" | "selectedAttachmentListElementId" | "showingSelectedAttachmentReplacePage" | "submitHasBeenAttempted" | "timeZone" | "userHasChangedValues">> {}
|
|
18
18
|
|
|
19
19
|
export interface BatchAttributeFormViewModelEvents {
|
|
20
20
|
/**
|
|
@@ -220,6 +220,8 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
220
220
|
get selectedAttachmentListInput(): AttachmentElementInput | null;
|
|
221
221
|
/** The set of form inputs used in `batch` editing [mode](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/BatchAttributeFormViewModel/#mode). */
|
|
222
222
|
get sharedForm(): BatchFormInputs;
|
|
223
|
+
/** @internal */
|
|
224
|
+
accessor showingSelectedAttachmentReplacePage: boolean;
|
|
223
225
|
/**
|
|
224
226
|
* Indicates whether the view model is ready to be used. Upon construction,
|
|
225
227
|
* and then again any time the `features` Collection is modified or
|
|
@@ -308,6 +310,12 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
308
310
|
* @internal
|
|
309
311
|
*/
|
|
310
312
|
goHome(): Promise<void>;
|
|
313
|
+
/**
|
|
314
|
+
* @param elementId - Attachment element identifier.
|
|
315
|
+
* @param attachmentGlobalId - Global identifier of the attachment whose staged changes should be cleared.
|
|
316
|
+
* @internal
|
|
317
|
+
*/
|
|
318
|
+
resetAttachmentChanges(elementId: string, attachmentGlobalId: string): void;
|
|
311
319
|
/**
|
|
312
320
|
* Used to specify a specific input to view associated layers for.
|
|
313
321
|
* Related to the 'viewing-associated-layers' page.
|
|
@@ -346,6 +354,11 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
346
354
|
* @internal
|
|
347
355
|
*/
|
|
348
356
|
setSelectedAttachmentListElementId(elementId: string | null | undefined): void;
|
|
357
|
+
/**
|
|
358
|
+
* @param value - Whether the selected attachment replace page should be shown.
|
|
359
|
+
* @internal
|
|
360
|
+
*/
|
|
361
|
+
setShowingSelectedAttachmentReplacePage(value: boolean): void;
|
|
349
362
|
/**
|
|
350
363
|
* @param elementId - Attachment element identifier.
|
|
351
364
|
* @param files - Files to stage for addition.
|
|
@@ -365,7 +378,7 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
365
378
|
* @param name - New attachment name.
|
|
366
379
|
* @internal
|
|
367
380
|
*/
|
|
368
|
-
stageRenameAttachment(elementId: string, attachmentGlobalId: string, name: string): void
|
|
381
|
+
stageRenameAttachment(elementId: string, attachmentGlobalId: string, name: string): Promise<void>;
|
|
369
382
|
/**
|
|
370
383
|
* @param elementId - Attachment element identifier.
|
|
371
384
|
* @param attachmentGlobalId - Global identifier of the attachment to replace.
|
|
@@ -376,6 +389,7 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
376
389
|
/**
|
|
377
390
|
* This method triggers the `"submit"` event, and causes [submitHasBeenAttempted](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/BatchAttributeFormViewModel/#submitHasBeenAttempted) to become `true`. It does _not_ do anything to persist the updated values. It is up to the client to verify if these values are appropriate. For example, calling [FeatureLayer.applyEdits()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#applyEdits) method to update the features' attributes.
|
|
378
391
|
*
|
|
392
|
+
* @returns Resolves after any pending attachment hydration completes and the `"submit"` event has been emitted.
|
|
379
393
|
* @example
|
|
380
394
|
* // Listen for when 'submit' is called on the form.
|
|
381
395
|
* // Once it is fired, update the feature.
|
|
@@ -384,7 +398,7 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
384
398
|
* // execute the 'submit()' method.
|
|
385
399
|
* document.getElementById("btnUpdate").addEventListener("click", () => form.submit());
|
|
386
400
|
*/
|
|
387
|
-
submit(): void
|
|
401
|
+
submit(): Promise<void>;
|
|
388
402
|
/**
|
|
389
403
|
* Determines if user input has caused the given feature to become invalid. Only returns `true` if _all_ of the following three conditions are true of the given feature:
|
|
390
404
|
* 1. It had no validation errors at the start of the editing session.
|