@arcgis/core 6.0.0-next.14 → 6.0.0-next.15
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/08fe248e412bb170210d.js +1 -0
- package/assets/esri/core/workers/chunks/{fb444954be74c1962ced.js → 10d80e793019dfb45ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/5736feefa261589b6273.js +1 -0
- package/assets/esri/core/workers/chunks/8e19629899a5becf8e19.js +1 -0
- package/assets/esri/core/workers/chunks/94e427040edb469d58ad.js +1 -0
- package/assets/esri/core/workers/chunks/{aadfe34a99c9ec7a0e11.js → ae31fd416bbb41a81392.js} +1 -1
- package/assets/esri/core/workers/chunks/{22e8c0aad2fe75943865.js → ed8786fed345718ed684.js} +1 -1
- package/assets/esri/libs/pdfjs/wasm/openjpeg_nowasm_fallback.js +1 -0
- package/config.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/PooledArray.js +1 -1
- package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
- package/geometry/support/buffer/BufferPool.js +1 -1
- package/geometry/support/coordsUtils.js +1 -1
- package/geometry/support/meshUtils.d.ts +5 -6
- package/interfaces.d.ts +18 -9
- package/kernel.js +1 -1
- package/layers/GeospatialPDFLayer.d.ts +154 -4
- package/layers/Layer.d.ts +2 -0
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/support/LabelClass.d.ts +3 -2
- package/layers/support/PortalItemData.d.ts +31 -8
- package/layers/support/types.d.ts +4 -1
- package/package.json +2 -2
- package/rest/knowledgeGraph/ObjectValue.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js} +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccluded.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +10 -1
- package/widgets/Editor.d.ts +10 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +2 -2
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Legend.d.ts +1 -0
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +5 -2
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerCollection.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerCombobox.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerLabel.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerSlider.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/types.d.ts +2 -0
- package/assets/esri/core/workers/chunks/037a8cc19debbaaa4e10.js +0 -1
- package/assets/esri/core/workers/chunks/1c65ab9ed611c322ce27.js +0 -1
- package/assets/esri/core/workers/chunks/408e81c8f1eff8a7b379.js +0 -1
- package/assets/esri/core/workers/chunks/5bfea0c55aca826de536.js +0 -1
- /package/views/3d/analysis/LineOfSight/{lineOfSightPlacementUtils.js → placementUtils.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.15",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.21.2",
|
|
23
|
-
"@arcgis/toolkit": "6.0.0-next.
|
|
23
|
+
"@arcgis/toolkit": "6.0.0-next.15",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0-next.89",
|
|
26
26
|
"@vaadin/grid": "~25.3.2",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{isPlainObject as t}from"../../core/lang.js";import{subclass as n}from"../../core/accessorSupport/decorators.js";import r from"./GraphObject.js";import{writer as i}from"../../core/accessorSupport/decorators/writer.js";let a=class extends r{constructor(e){super(e)}writeProperties(e,t,n,r){t[n]=o(e,r)}};e([i(`properties`)],a.prototype,`writeProperties`,null),a=e([n(`esri.rest.knowledgeGraph.ObjectValue`)],a);function o(e,n){return e&&typeof e.write==`function`?e.write({},n):e&&typeof e.toJSON==`function`?e.toJSON(n):Array.isArray(e)?e.map(e=>o(e,n)):t(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,o(t,n)])):e}export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../core/has.js";import{abortMaybe as t,destroyMaybe as n}from"../../../core/maybe.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import o from"./AnalysisView3D.js";import{DirectLineMeasurementController as s}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as c}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";import l from"../interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js";import{connectAnalysisViewToTool as u,removeAnalysisViewTool as d,startPlaceOperation as f}from"../../analysis/analysisViewUtils.js";let p=class extends o{constructor(e){super(e),this.type=`direct-line-measurement-view-3d`,this.analysis=null,this.tool=null,this.result=null,this.measurementMode=0,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null,this.userOperation=null}initialize(){let{analysis:e,view:t}=this;this._analysisVisualization=new c({view:t,analysis:e,analysisView:this}),this._analysisController=new s({view:t,analysis:e,viewData:this}),this.addHandles(u(this,l))}destroy(){d(this),this.userOperation=t(this.userOperation),this._analysisController=n(this._analysisController),this._analysisVisualization=n(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages||!!this._analysisController?.updating}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(e){this._analysisVisualization.visualElementOrientation=e}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(e){this._analysisVisualization.allowVisualElementsOrientationChange=e}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(e){this._analysisVisualization.triangleCollapseRatioThreshold=e}get directLabelText(){return this._analysisVisualization.labels.direct?.text??``}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal?.text??``}get verticalLabelText(){return this._analysisVisualization.labels.vertical?.text??``}get unit(){return this.analysis.unit??this.view.options.displayUnits.length??a(this.view)}get testData(){}place(e){return f(this,{placementOptions:e})}};e([r()],p.prototype,`_analysisVisualization`,void 0),e([r()],p.prototype,`_analysisController`,void 0),e([r()],p.prototype,`updating`,null),e([r({readOnly:!0})],p.prototype,`type`,void 0),e([r({constructOnly:!0,nonNullable:!0})],p.prototype,`analysis`,void 0),e([r()],p.prototype,`tool`,void 0),e([r()],p.prototype,`result`,void 0),e([r()],p.prototype,`measurementMode`,void 0),e([r()],p.prototype,`elevationAlignedStartPoint`,void 0),e([r()],p.prototype,`elevationAlignedEndPoint`,void 0),e([r({readOnly:!0})],p.prototype,`viewMode`,null),e([r({readOnly:!0})],p.prototype,`actualVisualizedMeasurement`,null),e([r()],p.prototype,`visualElementOrientation`,null),e([r()],p.prototype,`allowVisualElementsOrientationChange`,null),e([r()],p.prototype,`triangleCollapseRatioThreshold`,null),e([r({readOnly:!0})],p.prototype,`directLabelText`,null),e([r({readOnly:!0})],p.prototype,`horizontalLabelText`,null),e([r({readOnly:!0})],p.prototype,`verticalLabelText`,null),e([r()],p.prototype,`unit`,null),e([r()],p.prototype,`userOperation`,void 0),p=e([i(`esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D`)],p);const m=p;export{m as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import{abortMaybe as t,destroyMaybe as n}from"../../../core/maybe.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import o from"./AnalysisView3D.js";import{DirectLineMeasurementController as s}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as c}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";import l from"../interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js";import{connectAnalysisViewToTool as u,removeAnalysisViewTool as d,startPlaceOperation as f}from"../../analysis/analysisViewUtils.js";let p=class extends o{constructor(e){super(e),this.type=`direct-line-measurement-view-3d`,this.analysis=null,this.tool=null,this.result=null,this.measurementMode=0,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null,this.userOperation=null}initialize(){let{analysis:e,view:t}=this;this._analysisVisualization=new c({view:t,analysis:e,analysisView:this}),this._analysisController=new s({view:t,analysis:e,viewData:this}),this.addHandles(u(this,l))}destroy(){d(this),this.userOperation=t(this.userOperation),this._analysisController=n(this._analysisController),this._analysisVisualization=n(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages||!!this._analysisController?.updating||!!this.tool?.updating}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(e){this._analysisVisualization.visualElementOrientation=e}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(e){this._analysisVisualization.allowVisualElementsOrientationChange=e}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(e){this._analysisVisualization.triangleCollapseRatioThreshold=e}get directLabelText(){return this._analysisVisualization.labels.direct?.text??``}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal?.text??``}get verticalLabelText(){return this._analysisVisualization.labels.vertical?.text??``}get unit(){return this.analysis.unit??this.view.options.displayUnits.length??a(this.view)}get testData(){}place(e){return f(this,{placementOptions:e})}};e([r()],p.prototype,`_analysisVisualization`,void 0),e([r()],p.prototype,`_analysisController`,void 0),e([r()],p.prototype,`updating`,null),e([r({readOnly:!0})],p.prototype,`type`,void 0),e([r({constructOnly:!0,nonNullable:!0})],p.prototype,`analysis`,void 0),e([r()],p.prototype,`tool`,void 0),e([r()],p.prototype,`result`,void 0),e([r()],p.prototype,`measurementMode`,void 0),e([r()],p.prototype,`elevationAlignedStartPoint`,void 0),e([r()],p.prototype,`elevationAlignedEndPoint`,void 0),e([r({readOnly:!0})],p.prototype,`viewMode`,null),e([r({readOnly:!0})],p.prototype,`actualVisualizedMeasurement`,null),e([r()],p.prototype,`visualElementOrientation`,null),e([r()],p.prototype,`allowVisualElementsOrientationChange`,null),e([r()],p.prototype,`triangleCollapseRatioThreshold`,null),e([r({readOnly:!0})],p.prototype,`directLabelText`,null),e([r({readOnly:!0})],p.prototype,`horizontalLabelText`,null),e([r({readOnly:!0})],p.prototype,`verticalLabelText`,null),e([r()],p.prototype,`unit`,null),e([r()],p.prototype,`userOperation`,void 0),p=e([i(`esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D`)],p);const m=p;export{m as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import i from"../../../../core/ReactiveMap.js";import{initial as a,watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{create as d,fromPoints as f}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as p}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as v}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{SnappingContext as E}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";const k=d(),A=Symbol(`inactiveManipulatorDisplay`);let j=class extends T{get _manipulatorsToHide(){let e=this._manipulatorByObject.values();return this.view.tools.some(e=>e.hasGrabbedManipulators)||e.some(e=>e.grabbing)?e.filter(e=>!e.grabbing).toArray():[]}constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new i,this._updatingHandles=new u,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null}initialize(){let{view:e}=this;this._interactionVisuals=new p({view:e}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),o(()=>this._manipulatorsToHide,e=>{let t=e.map(e=>e.disableDisplay());this.removeHandles(A),this.addHandles(t,A)},s)]),this.finishToolCreation()}destroy(){this.removeHandles(A),this._interactionVisuals=r(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.item.type===`observer`?new m(this.view,{deleting:!1,intersection:null,type:`observer`}):new h(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this.
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import i from"../../../../core/ReactiveMap.js";import{initial as a,watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{create as d,fromPoints as f}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as p}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as v}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{SnappingContext as E}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";const k=d(),A=Symbol(`inactiveManipulatorDisplay`);let j=class extends T{get _manipulatorsToHide(){let e=this._manipulatorByObject.values();return this.view.tools.some(e=>e.hasGrabbedManipulators)||e.some(e=>e.grabbing)?e.filter(e=>!e.grabbing).toArray():[]}constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new i,this._updatingHandles=new u,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null}initialize(){let{view:e}=this;this._interactionVisuals=new p({view:e}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),o(()=>this._manipulatorsToHide,e=>{let t=e.map(e=>e.disableDisplay());this.removeHandles(A),this.addHandles(t,A)},s)]),this.finishToolCreation()}destroy(){this.removeHandles(A),this._interactionVisuals=r(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.item.type===`observer`?new m(this.view,{deleting:!1,intersection:null,type:`observer`}):new h(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this._objectByItem.delete(e.item),this._manipulatorByObject.delete(e),this.manipulators.remove(t),t.destroy())}getManipulator(e){let t=this._objectByItem.get(e);return t==null?null:this._manipulatorByObject.get(t)}hasManipulatorAt(e,t){for(let n of this._manipulatorByObject.values())if(n.consumesClicks&&n.intersectionDistance(e,t)!=null)return!0;return!1}selectObject(e){let t=!1;for(let[n,r]of this._manipulatorByObject){let i=n===e;r.selected=i,t||=i}return this._syncManipulators(),t}onInputEvent(e){e.type===`hold`&&this._grabbedManipulator!=null&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),O(e,this.tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(e=>e.selected)||this.events.emit(`selection-cleared`)}_connectManipulator(e,t){let r=()=>this._syncManipulator(e,t);return n([e.on(`committed`,r),e.on(`modified-externally`,r),t.events.on(`immediate-click`,n=>{this.events.emit(`select-item`,{item:e.item}),n.button===b.Right&&t.metadata.type===`target`&&this.events.emit(`delete-item`,{target:t.metadata.target}),n.stopPropagation()}),t.events.on(`grab-changed`,({action:n})=>{n===`start`?(this.events.emit(`select-item`,{item:e.item}),this._grabbedManipulator=t):this._grabbedManipulator===t&&(this._grabbedManipulator=null,this.hideInteractionVisuals()),this._manipulatorByObject.set(e,t)}),t.events.on(`drag`,t=>{e.updateDragIntersection(t),t.action===`start`&&this.showInteractionVisuals(e)}),t.events.on(`location-update`,()=>this._syncInteractionVisuals()),this._createDragHandle(e,t)])}_createDragHandle(e,t){return x(t,(n,r,i,a)=>{let o=e.operations;if(o==null)return;let s=null,{cancelSnapping:c,snappingStep:l}=D({snappingContext:new E({editGeometryOperations:o,elevationInfo:e.elevationInfo,pointer:a,visualizer:new v}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});i.next(e=>(s?.undo(null),s=null,e)).next(c);let u=o.data.allVerticesUnordered.at(0);r.next(t=>(t.action===`start`&&(s=e.createUndoRecord()),{...t,snapOrigin:u?.pos})).next(S(this.view,t.elevationAlignedLocation)).next(y(this.view,o.data.geometry,e.elevationInfo,o.data.spatialReference)).next(C(this.view,e.elevationInfo)).next(...l).next(w(e)).next(e=>(e.action===`end`&&s!=null&&(this.events.emit(`record-undo`,{record:s}),s=null),e))})}_syncManipulators(){for(let[e,t]of this._manipulatorByObject)this._syncManipulator(e,t);this._syncInteractionVisuals()}_syncManipulator(e,t){let n=e.origin;if(t.available=this.visible&&e.visible&&n!=null,t.interactive=this.manipulatorsInteractive&&(this._grabbedManipulator==null||this._grabbedManipulator===t),n!=null&&(t.elevationAlignedLocation=n),e.item.type!==`target`)return;let r=this.analysisViewData.computations.find(t=>t.target===e.item),i=r==null||!r.computationResult.isValid?g.undefined:r.computationResult.isTargetVisible?g.visible:g.occluded;t.state=this.interacting&&t.selected?_(i):i}_syncInteractionVisuals(){let e=this._interactionVisuals,t=this._visualsManipulator,n=this.visible&&this.analysisViewData.visible;if(e==null||t==null||!n){e?.hide();return}let r=[...this._manipulatorByObject.entries()].find(([e])=>e.item.type===`observer`)?.[1];if(r==null){e.hide();return}let i=t===r?null:f(r.renderLocation,t.renderLocation,k);e.update({target:t.renderLocation,lineVerticalPlaneSegment:i,visible:!0})}};e([c({constructOnly:!0})],j.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],j.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],j.prototype,`view`,void 0),e([c({constructOnly:!0})],j.prototype,`tooltip`,void 0),e([c()],j.prototype,`automaticManipulatorSelection`,void 0),e([c()],j.prototype,`removeIncompleteOnCancel`,void 0),e([c()],j.prototype,`interacting`,void 0),e([c()],j.prototype,`manipulatorsInteractive`,void 0),e([c()],j.prototype,`_grabbedManipulator`,void 0),e([c()],j.prototype,`_manipulatorsToHide`,null),e([c()],j.prototype,`updating`,null),j=e([l(`esri.views.3d.analysis.LineOfSight.LineOfSightItemTool`)],j);export{j as LineOfSightItemTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{createLineOfSightPlacementRootPluginConfiguration as u}from"./LineOfSightPlacementRootPlugin.js";import{isLineOfSightTargetPlugin as d}from"./LineOfSightTargetPlugin.js";import{createDrawTool as f}from"./placementUtils.js";import{Manipulator3D as p}from"../../interactive/Manipulator3D.js";const m=Symbol(`hiddenManipulatorHandle`);let h=class extends t{get active(){return!!this._drawTool?.active}get canRedo(){return this._drawTool?.canRedo??!1}get canUndo(){return this._drawTool?.canUndo??!1}get updating(){return this._drawTool?.updating??!1}get activeTooltipInfo(){return this._drawTool?.activeTooltipInfo??null}get tooltip(){return this._drawTool?.tooltip??null}constructor(e){super(e),this.visible=!0,this.observerPlacementElevationInfo=null,this.targetPlacementElevationInfo=null,this._drawTool=null,this._renderer=null,this._observerSessionElevationInfo=null,this._targetSessionElevationInfo=null,this._sessionStartedWithValidAnalysis=!1}initialize(){this.addHandles([r(()=>!this.active,()=>{this.analysisViewData.cursorTarget=null},i),a(()=>this.activeTooltipInfo,e=>{e&&(e.elevationModeContext=this._elevationModeContext)},i)])}destroy(){this._destroyDrawTool()}get _placementElevationInfo(){return this.analysis.observer==null?this._observerSessionElevationInfo:this._targetSessionElevationInfo}get _effectiveElevationInfo(){return this._placementElevationInfo??c}get _elevationModeContext(){let e=this;return{get mode(){return e._effectiveElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(!t||!n||!r||e===this._effectiveElevationInfo.mode)return;let i=t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked===!0,{position:a,elevationInfo:o}=l({view:this.view,point:r,sourceElevationInfo:this._placementElevationInfo,mode:e,preserveZ:i}),s=()=>{t.defaultZ=a.z,this.analysis.observer==null?this._observerSessionElevationInfo=o:this._targetSessionElevationInfo=o,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a},c=t.mostDownstreamPlugin;d(c)?c.changeElevationMode(e,i,s):s(),this._renderer?.refresh()}continue(){if(this._drawTool?.active)return;this._sessionStartedWithValidAnalysis=this.analysis.valid,this._observerSessionElevationInfo=this.observerPlacementElevationInfo?.clone()??null,this._targetSessionElevationInfo=this.targetPlacementElevationInfo?.clone()??null;let{drawTool:e,renderer:t}=this._createDrawTool();this._drawTool=e,this._renderer=t,this.view.addAndActivateTool(e),e.begin([u({analysis:this.analysis,analysisViewData:this.analysisViewData,getObserverElevationInfo:()=>this._observerSessionElevationInfo,getTargetElevationInfo:()=>this._targetSessionElevationInfo,view:this.view})])}stop(){this._destroyDrawTool()}redo(){this._drawTool?.redo()}undo(){this._drawTool?.undo()}get testInfo(){}_createDrawTool(){return f({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,getSourceElevationInfo:()=>this._effectiveElevationInfo,getVisible:()=>this.visible,onCancel:e=>{e===this._drawTool&&!this._sessionStartedWithValidAnalysis&&this.analysis.observer==null&&(this.analysis.clear(),this.analysisViewData.cursorTarget=null),this._destroyDrawTool(e)},onComplete:e=>this._destroyDrawTool(e),onManipulatorCountChange:e=>this._hideManipulatorOnAppearance(e),shouldPreventVertexAdd:this.shouldPreventVertexAdd})}_destroyDrawTool(e=this._drawTool){if(e==null)return;let t=e===this._drawTool;this.view.activeTool===e&&(this.view.activeTool=null),this.view.tools.includes(e)&&this.view.tools.remove(e),e.destroy(),t&&(this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1)}_hideManipulatorOnAppearance(e){e.removeHandles(m),e.addHandles(e.manipulators.toArray().map(e=>e instanceof p?e.disableDisplay():null).filter(n),m)}};e([o({constructOnly:!0})],h.prototype,`view`,void 0),e([o({constructOnly:!0})],h.prototype,`analysis`,void 0),e([o({constructOnly:!0})],h.prototype,`analysisViewData`,void 0),e([o({constructOnly:!0})],h.prototype,`shouldPreventVertexAdd`,void 0),e([o({constructOnly:!0})],h.prototype,`snappingManager`,void 0),e([o()],h.prototype,`visible`,void 0),e([o()],h.prototype,`observerPlacementElevationInfo`,void 0),e([o()],h.prototype,`targetPlacementElevationInfo`,void 0),e([o()],h.prototype,`active`,null),e([o()],h.prototype,`canRedo`,null),e([o()],h.prototype,`canUndo`,null),e([o()],h.prototype,`updating`,null),e([o()],h.prototype,`activeTooltipInfo`,null),e([o()],h.prototype,`tooltip`,null),e([o()],h.prototype,`_drawTool`,void 0),e([o()],h.prototype,`_renderer`,void 0),e([o()],h.prototype,`_observerSessionElevationInfo`,void 0),e([o()],h.prototype,`_targetSessionElevationInfo`,void 0),e([o()],h.prototype,`_elevationModeContext`,null),h=e([s(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementController`)],h);export{h as LineOfSightPlacementController};
|
package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import r from"../../../../core/Collection.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as s,isMultipoint as c}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as l}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as u,createLineOfSightObserverPluginConfiguration as d}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as f}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as h}from"./LineOfSightTargetPlugin.js";import{PluginBase as g}from"../../../draw/plugins/PluginBase.js";let _=class extends g{constructor(){super(...arguments),this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new r,this._operationTargets=new r}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=i(this._intersector)}start(e){super.start(e),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,y(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),e.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(e){return{geometryType:`point`,useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:`cancel`}}attachPlugin(e){this._downstreamPlugin=e}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(e,r){if(this._downstreamPlugin===e&&(this._downstreamPlugin=null),m(e)&&this._clearCursorTarget(),r!==`complete`){this._syncAnalysisFromSession();return}let i=this._context?.getSession(e)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`point`});if(!i||!s(i)){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._truncateItemsToSession();let a=f(e)?e.preservedIntersection:null;if(u(e)){let n=e.observer??this._operationObserver??new t;if(!this._intersector||!l(this.view,n,this._intersector,i,{elevationInfo:this.getObserverElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationObserver=n}else if(m(e)){let t=e.target??new n;if(!this._intersector||!l(this.view,t,this._intersector,i,{elevationInfo:this.getTargetElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationTargets.add(t)}this._appendCommittedPoint(i),this._syncAnalysisFromSession(),this._restartDownstreamPlugin(),this._clearCursorTarget()}_appendCommittedPoint(e){let t=this._session;t&&(t.appendOrReplacePoint(null,e),t.appendOrReplacePart(null,[]),t.automaticRestart=!1,t.groupGeometryChanges())}_clearCursorTarget(){this.analysisViewData.cursorTarget=i(this.analysisViewData.cursorTarget)}_truncateItemsToSession(){let e=this._getCommittedPointCount();this._initialObserver==null&&e===0&&(this._operationObserver=null),this._operationTargets.splice(this._getCommittedOperationTargetCount(e))}_restartDownstreamPlugin(){let e=this.analysis.observer==null,t=e?this._createObserverPluginConfiguration():this._createTargetPluginConfiguration();e&&u(this._downstreamPlugin)||!e&&m(this._downstreamPlugin)||this._context?.requestBeginDownstreamPlugin(t,{cancelExisting:!0})}_createObserverPluginConfiguration(e=null){return d({observer:e,defaultCaptureMode:e?`grabbable-object`:`capture-always`,inputMapPosition:e?.position??null})}_createTargetPluginConfiguration(e=null){return h({analysis:this.analysis,analysisViewData:this.analysisViewData,defaultCaptureMode:e?`grabbable-object`:`capture-always`,getElevationInfo:this.getTargetElevationInfo,inputMapPosition:e?.position??null,target:e,view:this.view})}_syncAnalysisFromSession(){let e=this._getCommittedPointCount(),t=this._getCommittedOperationTargetCount(e);this.analysis.observer=this._getActiveObserver(e),y(this.analysis.targets,this._initialTargets.toArray().concat(this._operationTargets.toArray().slice(0,t)))}_getActiveObserver(e){return this._initialObserver==null?e>0?this._operationObserver:null:this._operationObserver??null}_getCommittedOperationTargetCount(e){return Math.max(0,e-(this._initialObserver==null?Math.min(e,1):0))}_getCommittedPointCount(){let e=this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`multipoint`});return e&&c(e)?e.points.length:0}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`getObserverElevationInfo`,void 0),e([a({constructOnly:!0})],_.prototype,`getTargetElevationInfo`,void 0),e([a()],_.prototype,`_intersector`,void 0),e([a()],_.prototype,`_downstreamPlugin`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import r from"../../../../core/Collection.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as s,isMultipoint as c}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as l}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as u,createLineOfSightObserverPluginConfiguration as d}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as f}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as h}from"./LineOfSightTargetPlugin.js";import{PluginBase as g}from"../../../draw/plugins/PluginBase.js";let _=class extends g{constructor(){super(...arguments),this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new r,this._operationTargets=new r}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=i(this._intersector)}start(e){super.start(e),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,y(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),e.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(e){return{geometryType:`point`,useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:`cancel`}}attachPlugin(e){this._downstreamPlugin=e}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(e,r){if(this._downstreamPlugin===e&&(this._downstreamPlugin=null),m(e)&&this._clearCursorTarget(),r!==`complete`){this._syncAnalysisFromSession();return}let i=this._context?.getSession(e)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`point`});if(!i||!s(i)){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._truncateItemsToSession();let a=f(e)?e.preservedIntersection:null;if(u(e)){let n=e.observer??this._operationObserver??new t;if(!this._intersector||!l(this.view,n,this._intersector,i,{elevationInfo:this.getObserverElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationObserver=n}else if(m(e)){let t=e.target??new n;if(!this._intersector||!l(this.view,t,this._intersector,i,{elevationInfo:this.getTargetElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationTargets.add(t)}this._appendCommittedPoint(i),this._syncAnalysisFromSession(),this._restartDownstreamPlugin(),this._clearCursorTarget()}_appendCommittedPoint(e){let t=this._session;t&&(t.appendOrReplacePoint(null,e),t.appendOrReplacePart(null,[]),t.automaticRestart=!1,t.groupGeometryChanges())}_clearCursorTarget(){this.analysisViewData.cursorTarget=i(this.analysisViewData.cursorTarget)}_truncateItemsToSession(){let e=this._getCommittedPointCount();this._initialObserver==null&&e===0&&(this._operationObserver=null),this._operationTargets.splice(this._getCommittedOperationTargetCount(e))}_restartDownstreamPlugin(){let e=this.analysis.observer==null,t=e?this._createObserverPluginConfiguration():this._createTargetPluginConfiguration();e&&u(this._downstreamPlugin)||!e&&m(this._downstreamPlugin)||this._context?.requestBeginDownstreamPlugin(t,{cancelExisting:!0})}_createObserverPluginConfiguration(e=null){return d({observer:e,defaultCaptureMode:e?`grabbable-object`:`capture-always`,inputMapPosition:e?.position??null})}_createTargetPluginConfiguration(e=null){return h({analysis:this.analysis,analysisViewData:this.analysisViewData,defaultCaptureMode:e?`grabbable-object`:`capture-always`,getElevationInfo:this.getTargetElevationInfo,inputMapPosition:e?.position??null,target:e,view:this.view})}_syncAnalysisFromSession(){let e=this._getCommittedPointCount(),t=this._getCommittedOperationTargetCount(e);this.analysis.observer=this._getActiveObserver(e),y(this.analysis.targets,this._initialTargets.toArray().concat(this._operationTargets.toArray().slice(0,t)))}_getActiveObserver(e){return this._initialObserver==null?e>0?this._operationObserver:null:this._operationObserver??null}_getCommittedOperationTargetCount(e){return Math.max(0,e-(this._initialObserver==null?Math.min(e,1):0))}_getCommittedPointCount(){let e=this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`multipoint`});return e&&c(e)?e.points.length:0}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`getObserverElevationInfo`,void 0),e([a({constructOnly:!0})],_.prototype,`getTargetElevationInfo`,void 0),e([a()],_.prototype,`_intersector`,void 0),e([a()],_.prototype,`_downstreamPlugin`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementRootPlugin`)],_);function v(e){return{uniqueId:Symbol(`line-of-sight-root-plugin`),kind:[`multipart`],geometryType:`multipoint`,hidden:!0,localizationKey:`line-of-sight-root`,icon:`point`,create:()=>new _(e)}}function y(e,t){let n=-1;for(let r=0;r<Math.min(e.length,t.length);r++)if(e.getItemAt(r)!==t[r]){n=r;break}if(n===-1){if(e.length===t.length)return;n=Math.min(e.length,t.length)}e.splice(n,e.length-n,...t.slice(n))}export{_ as LineOfSightPlacementRootPlugin,v as createLineOfSightPlacementRootPluginConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as s}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as c}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as l}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as u}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as d}from"../../../input/InputManager.js";import{AnalysisToolBase as f}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as p}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as m}from"../../../interactive/keybindings.js";import{acquire as h}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";const _={ready:`ready`,creating:`creating`,created:`created`};let v=class extends f{constructor(e){super(e),this._operationManager=new u,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;let{snappingManager:t}=this._snappingManagerResult=h(e.view);this._editIntersector=new l({view:e.view}),this._editTool=new s({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:this._editIntersector,snappingManager:t,view:e.view}),this._placementController=new c({...e,
|
|
2
|
+
import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as s}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as c}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as l}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as u}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as d}from"../../../input/InputManager.js";import{AnalysisToolBase as f}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as p}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as m}from"../../../interactive/keybindings.js";import{acquire as h}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";const _={ready:`ready`,creating:`creating`,created:`created`};let v=class extends f{constructor(e){super(e),this._operationManager=new u,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;let{snappingManager:t}=this._snappingManagerResult=h(e.view);this._editIntersector=new l({view:e.view}),this._editTool=new s({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:this._editIntersector,snappingManager:t,view:e.view}),this._placementController=new c({...e,snappingManager:t,shouldPreventVertexAdd:(e,t)=>this._editTool.hasManipulatorAt(e,t)})}get active(){return this._editTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get selectedItem(){return this._editTool.selectedItem}get state(){return this._placementController.active?_.creating:this.analysis.observer?.position==null?_.ready:_.created}get cursor(){return this._placementController.active?`crosshair`:null}get updating(){return this._editTool.updating||this._placementController.updating}initialize(){g(this),this.addHandles([this._snappingManagerResult,this.view.on(`key-down`,e=>this._onKeyDown(e),d.WIDGET),n(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),r),n(()=>this.state===_.created,e=>{e?this.finishToolCreation():this._set(`created`,!1)},r),n(()=>this.analysisViewData.visible,e=>{this.visible=e},r),n(()=>this.editable,e=>{this.analysisViewData.editable=e},r)])}destroy(){this._operationManager.destroy(),this._editTool.stop(),this._placementController.stop(),this._editTool.destroy(),this._placementController.destroy(),this._editIntersector.destroy()}place(e){return this.analysisViewData.interactive=!0,this._operationManager.start(`place`,async(i,a)=>{let{elevationInfo:o}=e??{},s=o&&`observer`in o?o.observer:o,c=o&&`targets`in o?o.targets:o;this._placementController.observerPlacementElevationInfo=y(s),this._placementController.targetPlacementElevationInfo=y(c);let l=this.analysis.clone(),u=!1,d=!1,f=()=>{if(d)return;if(d=!0,this.stop(),!this.analysis.valid){this.analysis.clear(),i.reject();return}if(a.aborted||this.analysis.equals(l)){i.reject();return}let e=this.analysis.targets.at(-1);e!=null&&this._editTool.selectItem(e),i.resolve({})};i.handles.push(t(()=>this.stop()),n(()=>this._placementController.active,e=>{e?u=!0:u&&f()},r)),this.continue()},e)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),!this.analysis.valid&&!this._placementController.active&&this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._editTool.setEditableFlag(1,!0),this._editTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideEditTool(){this._editTool.stop(),this._editTool.visible=!1}_onKeyDown(e){let t=e.key;t===m.undo&&this.canUndo?(e.stopPropagation(),this.undo()):t===m.redo&&this.canRedo?(e.stopPropagation(),this.redo()):m.delete.includes(t)&&!this.active?this._editTool.deleteSelectedItem()&&e.stopPropagation():t===m.cancel&&!this.active&&this._editTool.clearSelection()&&e.stopPropagation()}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active?this._placementController:this._canActivateEditTool?this._editTool:null:null}get _canActivateEditTool(){return this.visible&&this.editable&&this.analysis.valid&&this.analysis.observer?.position!=null}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{let e=this.analysisViewData.interactive,t=this._canActivateEditTool;if(this._placementController.visible=this.visible&&e,this._editTool.manipulatorsInteractive=e&&!this._placementController.active,!e){this._placementController.stop(),this._hideEditTool(),this.analysisViewData.cursorTarget=null,p(this.view,this);return}if(!this.visible){this._editTool.stop(),this._editTool.visible=!0,p(this.view,this);return}if(this._placementController.active){this._editTool.stop(),this._editTool.visible=this.visible,p(this.view,this);return}if(!t){this._hideEditTool(),p(this.view,this);return}this._editTool.visible=!0,this.analysisViewData.cursorTarget=null,p(this.view,this)}finally{this._syncingActiveTool=!1}}}};e([i({constructOnly:!0})],v.prototype,`view`,void 0),e([i({constructOnly:!0})],v.prototype,`analysis`,void 0),e([i({constructOnly:!0})],v.prototype,`analysisViewData`,void 0),e([i()],v.prototype,`active`,null),e([i()],v.prototype,`canRedo`,null),e([i()],v.prototype,`canUndo`,null),e([i()],v.prototype,`selectedItem`,null),e([i()],v.prototype,`state`,null),e([i()],v.prototype,`cursor`,null),e([i()],v.prototype,`updating`,null),e([i()],v.prototype,`removeIncompleteOnCancel`,void 0),e([i()],v.prototype,`snappingOptions`,null),e([i()],v.prototype,`_canActivateEditTool`,null),v=e([a(`esri.views.3d.analysis.LineOfSight.LineOfSightTool`)],v);function y(e){if(e==null)return null;let{featureExpressionInfo:t,mode:n,offset:r,unit:i}=e;return new o({featureExpressionInfo:t,mode:n,offset:r,unit:i})}export{v as LineOfSightTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as r,Cyclical as i}from"../../../../core/Cyclical.js";import{handlesGroup as a}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{sub as p,len as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as v}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as y}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as b,isSideHorizontal as x,flipSide as S}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as C}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as w}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as T}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as D}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as O}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as k,resetManipulatedObject as A,sceneSnappingAtLocation as j,dragManipulatedObject as M,sceneSnappingAtProjectedLocation as N,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const F=Symbol(`dragHandles`);let I=class extends t{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new _,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new b({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new w({view:this.view,tool:this.parentTool}),this._observerManipulator=new T(this.view,this.parentTool),this._observerManipulatedObject=new C({view:this.view,subTool:this}),this.addHandles([c(()=>this.elevationAlignedObserverRenderSpace,e=>{e!=null&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},l),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:t,operations:r},i)=>{this._grabbing&&t!==i?.observer||(this.removeHandles(F),e?.valid&&r!=null&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(n),F))},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e,analysisViewData:t}=this,n=t.visible&&(e?.valid??!1),r=t.selectedViewshed===e?.viewshed,i=n&&r,a=e?.effectiveElevationInfo.mode;return{controlsAvailable:i,selected:r,visibleAndValid:n,zManipulationAvailable:i&&a!==`on-the-ground`}},({controlsAvailable:e,selected:t,visibleAndValid:n,zManipulationAvailable:r})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=r,this._scaleOrientManipulation.available=e,this._observerManipulator.available=n,this._observerManipulator.collisionPriority=t?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;if(!e?.valid)return null;let{observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}=e;return{viewshedCompData:e,observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}},e=>{e!=null&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(`grab-changed`,t=>{this._grabbing=t.action===`start`,t.action===`end`&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e.setInteractive(!this._grabbing)}),this.setInteractive(t=>t===e||!this._grabbing)}),e.events.on(`drag`,e=>{e.action===`start`&&this.parentTool.updateInteractionVisualsVisibility()})])})}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){let t=this.viewshed;t!=null&&(t.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){let{dragging:e,grabbing:t}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:t||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){let{dragging:e,grabbing:t}=this._scaleOrientManipulation;return{dragging:e,grabbing:t}}setInteractive(e){let t=typeof e==`boolean`;this._observerManipulator.interactive=t?e:e(this._observerManipulator),this._forEachManipulation(n=>{n.interactive=t?e:n.someManipulator(e)})}hideInactiveManipulators(e){let t=[];return this._forEachManipulation(n=>{n.hasManipulator(e)?n!==this._moveManipulation&&t.push(a(n.mapManipulators(t=>t===e||n===this._fieldOfViewManipulation&&t.grabbing?null:t.disableDisplay?.()))):t.push(n.hideManipulators())}),this._observerManipulator!==e&&t.push(this._observerManipulator.disableDisplay()),a(t)}onManipulatorSelectionChanged(){this._someManipulatorSelected()||this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}hasManipulator(e){let t=!1;return this._forEachManipulator(n=>{t||=n===e}),t}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new O({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:D})}_buildObserverManipulatorDragPipeline(e){let{effectiveElevationInfo:t,viewshed:n}=e,r=this._observerManipulatedObject,i=r.operations;if(i==null)return null;let a=i.data.spatialReference;return k(this._observerManipulator,(e,o,s,c)=>{let{parentTool:l,view:u}=this,{intersector:d,snappingManager:f}=l,{geometry:p}=i.data;if(p.type!==`point`)return;let m=n.feature,h=A(r);s=s.next(e=>(n.feature=m,h(e)));let g=l.createObserverMoveSnappingPipeline(0,c,t,!0),_=o.next(E(u,p,t,a)).next(j(u,t));if(g!=null){let{snappingStep:e,cancelSnapping:t}=g;s.next(t),_=_.next(...e)}_.next(e=>(n.feature=v({intersector:d,snappingManager:f,screenPoint:e.screenEnd,view:u}),e)).next(M(r))})}_buildMoveManipulationDragPipeline(e){let{effectiveElevationInfo:t}=e,n=this._observerManipulatedObject,r=n.operations;return r==null?null:this._moveManipulation.createDragPipeline((e,r,i,a,o)=>{a=a.next(A(n));let s=this.parentTool.createObserverMoveSnappingPipeline(e,o,t);if(s!=null){let{snappingStep:e,cancelSnapping:r}=s;return a=a.next(r),i=i.next(N(this.view,t)).next(...e).next(M(n)),{steps:i,cancel:a}}return i=i.next(M(n)),{steps:i,cancel:a}},t,r.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let t=0,n=0;return this._fieldOfViewManipulation.createDragPipeline((i,a,o)=>{if(e==null)return{steps:a,cancel:o};let s=e.viewshed,c=null;return o=o.next(P(s,[`horizontalFieldOfView`,`verticalFieldOfView`])),{steps:a.next(i=>{i.action===`start`&&(c=null,t=e.horizontalFieldOfView,n=e.verticalFieldOfView);let a=i.deltaAngle;if(c==null&&a!==0){let e=i.side===`bottom`||i.side===`left`?a>0:a<0;c=x(i.side)?t===0&&e||t===360&&!e:n===0&&e}let o=c?S(i.side):i.side,l=0;switch(o){case`left`:l=t/2-a;break;case`right`:l=t/2+a;break;case`top`:l=n+a*2;break;case`bottom`:l=n-a*2}return x(o)?(l=r.normalize(l),l=l>270?0:l>180?180:l,s.horizontalFieldOfView=l*2):s.verticalFieldOfView=l,i}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let t=0,n=0,i=(t,n)=>(r,i,a)=>{if(e==null)return{steps:i,cancel:a};let o=e.viewshed;return a=a.next(P(o,[t])),i=i.next(n(o,e)),{steps:i,cancel:a}};return a([this._scaleOrientManipulation.createHeadingDragPipeline(i(`heading`,(t,i)=>i=>(i.action===`start`&&(n=e.heading),t.heading=r.normalize(n+i.deltaAngle),i)),e),this._scaleOrientManipulation.createTiltDragPipeline(i(`tilt`,(n,r)=>r=>{r.action===`start`&&(t=e.tilt);let i=t+r.deltaAngle;return i<-90?i=180:i>270&&(i=0),n.tilt=R.clamp(i),r}),e),this._scaleOrientManipulation.createDistanceDragPipeline(i(`farDistance`,(e,t)=>n=>{let r=p(L,n.renderEnd,t.elevationAlignedObserverRenderSpace),i=m(r)*t.metersPerUnit;return e.farDistance=h(r,t.targetDirection)<0?y.scaleOrientMinDistance:i,n}),e)])}_forEachManipulator(e){this._forEachManipulation(t=>{t.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],I.prototype,`analysis`,void 0),e([d({constructOnly:!0})],I.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0})],I.prototype,`parentTool`,void 0),e([d({constructOnly:!0,nonNullable:!0})],I.prototype,`view`,void 0),e([d()],I.prototype,`updating`,null),e([d()],I.prototype,`viewshed`,null),e([d()],I.prototype,`_grabbing`,void 0),e([d()],I.prototype,`grabbing`,null),e([d()],I.prototype,`viewshedComputedData`,void 0),e([d()],I.prototype,`observer`,null),e([d()],I.prototype,`elevationAlignedObserverRenderSpace`,null),I=e([f(`esri.views.3d.analysis.Viewshed.ViewshedSubTool`)],I);const L=g(),R=new i(0,180);export{I as ViewshedSubTool};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as r,Cyclical as i}from"../../../../core/Cyclical.js";import{handlesGroup as a}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{sub as p,len as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as v}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as y}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as b,isSideHorizontal as x,flipSide as S}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as C}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as w}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as T}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as D}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as O}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as k,resetManipulatedObject as A,sceneSnappingAtLocation as j,dragManipulatedObject as M,sceneSnappingAtProjectedLocation as N,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const F=Symbol(`dragHandles`);let I=class extends t{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new _,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new b({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new w({view:this.view,tool:this.parentTool}),this._observerManipulator=new T(this.view,this.parentTool),this._observerManipulatedObject=new C({view:this.view,subTool:this}),this.addHandles([c(()=>this.elevationAlignedObserverRenderSpace,e=>{e!=null&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},l),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:t,operations:r},i)=>{this._grabbing&&t!==i?.observer||(this.removeHandles(F),e?.valid&&r!=null&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(n),F))},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e,analysisViewData:t}=this,n=t.visible&&(e?.valid??!1),r=t.selectedViewshed===e?.viewshed,i=n&&r,a=e?.effectiveElevationInfo.mode;return{controlsAvailable:i,selected:r,visibleAndValid:n,zManipulationAvailable:i&&a!==`on-the-ground`}},({controlsAvailable:e,selected:t,visibleAndValid:n,zManipulationAvailable:r})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=r,this._scaleOrientManipulation.available=e,this._observerManipulator.available=n,this._observerManipulator.collisionPriority=t?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;if(!e?.valid)return null;let{observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}=e;return{viewshedCompData:e,observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}},e=>{e!=null&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(`grab-changed`,t=>{this._grabbing=t.action===`start`,t.action===`end`&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e.setInteractive(!this._grabbing)}),this.setInteractive(t=>t===e||!this._grabbing)}),e.events.on(`drag`,e=>{e.action===`start`&&this.parentTool.updateInteractionVisualsVisibility()})])})}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){let t=this.viewshed;t!=null&&(t.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){let{dragging:e,grabbing:t}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:t||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){let{dragging:e,grabbing:t}=this._scaleOrientManipulation;return{dragging:e,grabbing:t}}setInteractive(e){let t=typeof e==`boolean`;this._observerManipulator.interactive=t?e:e(this._observerManipulator),this._forEachManipulation(n=>{n.interactive=t?e:n.someManipulator(e)})}hideInactiveManipulators(e){let t=[];return this._forEachManipulation(n=>{n.hasManipulator(e)?n!==this._moveManipulation&&t.push(a(n.mapManipulators(t=>t===e||n===this._fieldOfViewManipulation&&t.grabbing?null:t.disableDisplay?.()))):t.push(n.hideManipulators())}),this._observerManipulator!==e&&t.push(this._observerManipulator.disableDisplay()),a(t)}onManipulatorSelectionChanged(){this._someManipulatorSelected()||this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}hasManipulator(e){let t=!1;return this._forEachManipulator(n=>{t||=n===e}),t}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new O({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:D})}_buildObserverManipulatorDragPipeline(e){let{effectiveElevationInfo:t,viewshed:n}=e,r=this._observerManipulatedObject,i=r.operations;if(i==null)return null;let a=i.data.spatialReference;return k(this._observerManipulator,(e,o,s,c)=>{let{parentTool:l,view:u}=this,{intersector:d,snappingManager:f}=l,{geometry:p}=i.data;if(p.type!==`point`)return;let m=n.feature,h=A(r);s=s.next(e=>(n.feature=m,h(e)));let g=l.createObserverMoveSnappingPipeline(0,c,t,!0),_=o.next(E(u,p,t,a)).next(j(u,t));if(g!=null){let{snappingStep:e,cancelSnapping:t}=g;s.next(t),_=_.next(...e)}_.next(e=>(n.feature=v({intersector:d,snappingManager:f,screenPoint:e.screenEnd,view:u}),e)).next(M(r))})}_buildMoveManipulationDragPipeline(e){let{effectiveElevationInfo:t}=e,n=this._observerManipulatedObject,r=n.operations;return r==null?null:this._moveManipulation.createDragPipeline((e,r,i,a,o)=>{a=a.next(A(n));let s=this.parentTool.createObserverMoveSnappingPipeline(e,o,t);if(s!=null){let{snappingStep:e,cancelSnapping:n}=s;a=a.next(n),i=i.next(N(this.view,t)).next(...e)}return i=i.next(M(n)),{steps:i,cancel:a}},t,r.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let t=0,n=0;return this._fieldOfViewManipulation.createDragPipeline((i,a,o)=>{let s=e.viewshed,c=null;return o=o.next(P(s,[`horizontalFieldOfView`,`verticalFieldOfView`])),{steps:a.next(i=>{i.action===`start`&&(c=null,t=e.horizontalFieldOfView,n=e.verticalFieldOfView);let a=i.deltaAngle;if(c==null&&a!==0){let e=i.side===`bottom`||i.side===`left`?a>0:a<0;c=x(i.side)?t===0&&e||t===360&&!e:n===0&&e}let o=c?S(i.side):i.side,l=0;switch(o){case`left`:l=t/2-a;break;case`right`:l=t/2+a;break;case`top`:l=n+a*2;break;case`bottom`:l=n-a*2}return x(o)?(l=r.normalize(l),l=l>270?0:l>180?180:l,s.horizontalFieldOfView=l*2):s.verticalFieldOfView=l,i}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let t=0,n=0,i=(t,n)=>(r,i,a)=>{let o=e.viewshed;return a=a.next(P(o,[t])),i=i.next(n(o,e)),{steps:i,cancel:a}};return a([this._scaleOrientManipulation.createHeadingDragPipeline(i(`heading`,(t,i)=>i=>(i.action===`start`&&(n=e.heading),t.heading=r.normalize(n+i.deltaAngle),i)),e),this._scaleOrientManipulation.createTiltDragPipeline(i(`tilt`,(n,r)=>r=>{r.action===`start`&&(t=e.tilt);let i=t+r.deltaAngle;return i<-90?i=180:i>270&&(i=0),n.tilt=R.clamp(i),r}),e),this._scaleOrientManipulation.createDistanceDragPipeline(i(`farDistance`,(e,t)=>n=>{let r=p(L,n.renderEnd,t.elevationAlignedObserverRenderSpace),i=m(r)*t.metersPerUnit;return e.farDistance=h(r,t.targetDirection)<0?y.scaleOrientMinDistance:i,n}),e)])}_forEachManipulator(e){this._forEachManipulation(t=>{t.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],I.prototype,`analysis`,void 0),e([d({constructOnly:!0})],I.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0})],I.prototype,`parentTool`,void 0),e([d({constructOnly:!0,nonNullable:!0})],I.prototype,`view`,void 0),e([d()],I.prototype,`updating`,null),e([d()],I.prototype,`viewshed`,null),e([d()],I.prototype,`_grabbing`,void 0),e([d()],I.prototype,`grabbing`,null),e([d()],I.prototype,`viewshedComputedData`,void 0),e([d()],I.prototype,`observer`,null),e([d()],I.prototype,`elevationAlignedObserverRenderSpace`,null),I=e([f(`esri.views.3d.analysis.Viewshed.ViewshedSubTool`)],I);const L=g(),R=new i(0,180);export{I as ViewshedSubTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as c}from"./toolLifecycleUtils.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";import{ViewshedPlacementController as u}from"./ViewshedPlacementController.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{acquire as f}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as p}from"../../../interactive/snapping/snappingUtils.js";let m=class extends t{constructor(e){super(e),this._editTool=null,this._updatingHandles=new s}initialize(){let{view:e}=this,t=d(e.state.viewingMode);this._snappingManagerResult=f(e),this.addHandles(this._snappingManagerResult),this._placementController=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e,callbacks:{cancelTool:()=>{e.activeTool!=null&&(e.activeTool=null)},findViewshedComputedData:e=>this._findViewshedComputedData(e),
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as c}from"./toolLifecycleUtils.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";import{ViewshedPlacementController as u}from"./ViewshedPlacementController.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{acquire as f}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as p}from"../../../interactive/snapping/snappingUtils.js";let m=class extends t{constructor(e){super(e),this._editTool=null,this._updatingHandles=new s}initialize(){let{view:e}=this,t=d(e.state.viewingMode);this._snappingManagerResult=f(e),this.addHandles(this._snappingManagerResult),this._placementController=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e,callbacks:{cancelTool:()=>{e.activeTool!=null&&(e.activeTool=null)},findViewshedComputedData:e=>this._findViewshedComputedData(e),setSelectedViewshed:e=>{this.analysisViewData.selectedViewshed=e}}}),p(this),this.addHandles([r(()=>({creationState:this._placementController.creationState,interactive:this.analysisViewData.interactive}),({creationState:n,interactive:r})=>{r?n==null?this._editTool||(this._editTool=new l({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e}),e.tools.add(this._editTool)):this._destroyEditTool():(this._placementController.cancelPlaceOperation(),this._destroyEditTool())},i),this._updatingHandles.add(()=>e.activeTool,e=>{e!=null&&e!==this._editTool&&this._placementController.creationState==null&&(this.analysisViewData.selectedViewshed=null)})])}destroy(){this._destroyEditTool(),n(this._placementController),this._updatingHandles.destroy()}get selectedViewshedComputedData(){return this._editTool?.selectedViewshedComputedData}get stagedViewshed(){return this._placementController.stagedViewshed}get active(){return this._placementController.active||(this._editTool?.active??!1)}get updating(){return this._updatingHandles.updating||this._placementController.updating||!!this._editTool?.updating}get creating(){return this._placementController.creationState!=null}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}async place(e,t){if(this.analysisViewData.interactive=!0,this._destroyEditTool(),await this._placementController.startPlaceOperation(e,t),e===`single`)return{}}_findViewshedComputedData(e){return this.analysisViewData.viewshedComputedDataHandles?.find(t=>t.viewshedComputedData.viewshed===e)?.viewshedComputedData}_destroyEditTool(){let e=this._editTool;this._editTool=null,e!=null&&(c(this.view,e),n(e))}get test(){}};e([a({constructOnly:!0})],m.prototype,`view`,void 0),e([a({constructOnly:!0})],m.prototype,`analysis`,void 0),e([a({constructOnly:!0})],m.prototype,`analysisViewData`,void 0),e([a()],m.prototype,`_placementController`,void 0),e([a()],m.prototype,`_editTool`,void 0),e([a()],m.prototype,`_snappingManagerResult`,void 0),e([a()],m.prototype,`selectedViewshedComputedData`,null),e([a()],m.prototype,`stagedViewshed`,null),e([a()],m.prototype,`active`,null),e([a()],m.prototype,`updating`,null),e([a()],m.prototype,`creating`,null),e([a()],m.prototype,`snappingOptions`,null),m=e([o(`esri.views.3d.analysis.Viewshed.ViewshedTool`)],m);const h=m;export{h as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as o}from"../../../../core/support/UpdatingHandles.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as o}from"../../../../core/support/UpdatingHandles.js";import{ringNeedsClosure as s,closeRings as c}from"../../../../geometry/support/coordsUtils.js";import{getGraphicEffectiveElevationInfo as l}from"../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as u}from"../manipulatorUtils.js";import{createGraphicGeometryUndoRecord as d}from"./undoRecords.js";import{GraphicState as f}from"../../layers/graphics/GraphicState.js";import{GraphicManipulator as p}from"../../../interactive/GraphicManipulator.js";import{EditGeometryOperations as m}from"../../../interactive/editGeometry/EditGeometryOperations.js";const h=Symbol();let g=class extends t{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}get elevationInfo(){return l(this.graphic)}get visible(){return this._graphicState.displaying}get isDraped(){return this._graphicState.isDraped}get origin(){return u(this.view,this.graphic)}constructor(e){super(e),this._updatingHandles=new o}destroy(){this._operations=n(this._operations),this._updatingHandles.destroy()}initialize(){this._graphicState=new f({graphic:this.graphic}),this._graphicState.on(`changed`,()=>this.emit(`committed`)),this.addHandles(this.view.trackGraphicState(this._graphicState)),this.addHandles(this._updatingHandles.add(()=>this.graphic.geometry,e=>{let t=this._operations?.data.geometry;if(e!==t){if(!e||e?.type===`multipoint`||e?.type===`extent`)n(this._operations),this.removeHandles(h),this._operations=null;else if(e.type===`polygon`&&e.rings.some(s)&&(e=e.clone(),c(e)),this._operations?.trySetGeometry(e))this.emit(`modified-externally`);else{n(this._operations),this.removeHandles(h);let t=m.fromGeometry(e,this.view.state.viewingMode);this._operations=t,this.addHandles(t.data.on(`change`,()=>this.graphic.geometry=t.data.geometry),h)}}},r))}createManipulator(e){return new p({view:this.view,graphic:this.graphic,...e})}maskOccludee(){return this.view.maskOccludee(this.graphic)}endInteraction(){this.graphic.geometry?.type===`mesh`&&this.graphic.notifyMeshTransformChanged()}toMap(e){return this.view.toMap(e,{include:[this.graphic]})}createUndoRecord(){let{graphic:{geometry:e}}=this;return d(e)}};e([i({constructOnly:!0})],g.prototype,`view`,void 0),e([i({constructOnly:!0})],g.prototype,`graphic`,void 0),e([i()],g.prototype,`_operations`,void 0),e([i()],g.prototype,`operations`,null),e([i()],g.prototype,`updating`,null),g=e([a(`esri.views.3d.interactive.editingTools.ManipulatedObject3DGraphic`)],g);export{g as ManipulatedObject3DGraphic};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import n from"../../../core/Logger.js";import{MemCacheStorage as r,MemCache as i}from"../../../core/MemCache.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{Milliseconds as o}from"../../../core/time.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{getLyr3DWasm as l}from"../layers/Lyr3DWasm.js";import{isMemoryManagedView as u}from"./MemoryManagedView.js";import{makeBudget as d}from"../../support/Scheduler.js";function f(e){return new
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import n from"../../../core/Logger.js";import{MemCacheStorage as r,MemCache as i}from"../../../core/MemCache.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{Milliseconds as o}from"../../../core/time.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{getLyr3DWasm as l}from"../layers/Lyr3DWasm.js";import{isMemoryManagedView as u}from"./MemoryManagedView.js";import{makeBudget as d}from"../../support/Scheduler.js";function f(e){return new _({view:e})}const p=.1,m=1.3,h=-4096,g=!!has(`esri-tests-disable-memory-pools`);let _=class extends t{constructor(e){super(e),this._quality=1,this._usedMemory=0,this._updating=!1,this._stableQuality=0,this._downscaleMemoryUsed=0,this._canFastRecover=!1,this._predictedMemory=0,this._cacheStorage=new r,this._warnMemoryUsage=null,this._numQualityChanges=0,this._maxMemory=g?4096:750,this._additionalCacheMemory=g?h:0,this.addHandles(a({prepare:()=>this._updateMemory()}))}destroy(){this._cacheStorage.destroy()}get maxMemory(){return this._maxMemory}set maxMemory(e){e==null||e<=0||g||(this._stableQuality=0,this._canFastRecover=!1,this._maxMemory<e&&this._updateQuality(1),this._maxMemory=e)}get additionalCacheMemory(){return this._additionalCacheMemory}set additionalCacheMemory(e){e!=null&&!g&&(this._additionalCacheMemory=e)}get memoryFactor(){return this._quality}get updating(){return this._updating}get usedMemory(){return this._usedMemory}get usedCacheMemory(){return this._cacheStorage.size}newCache(e,t,n){return new i(e,this._cacheStorage,t,n)}resetStableQuality(){this._stableQuality=0}disableMemCache(){this.additionalCacheMemory=h}update(){if(this._predictedMemory<=0&&!this._updating)return;let e=this._layersUpdating();if(this._predictedMemory<.6&&this._canFastRecover)this._downscaleMemoryUsed=0,this._stableQuality=0,this._canFastRecover=!1,this._updateQuality(1);else if(e){if(this._predictedMemory>1.1||this._usedMemory>1){if(this._stableQuality>0)this._downscaleMemoryUsed=0,this._updateQuality(this._stableQuality);else if(this._quality>p&&this._downscaleMemoryUsed<this._usedMemory){if(this._compactAndUpdate())return;this._updateQuality(this._quality/m),this._downscaleMemoryUsed=this._usedMemory,this._canFastRecover=!1}}}else if(this._downscaleMemoryUsed=0,this._usedMemory>1){if(this._compactAndUpdate())return;this._stableQuality=0,this._canFastRecover=!1,e=this._updateQuality(this._quality/m),this._downscaleMemoryUsed=this._predictedMemory}else this._stableQuality!==this._quality&&(this._usedMemory<.75&&this._quality<1?(this._stableQuality=this._quality,e=this._updateQuality(this._quality+.05)):this._quality<1&&(this._canFastRecover=!0));this._updating=e}_compactAndUpdate(){let e=d(o(100)),t=this.view.stage.compact(e);return this.view.overlayManager.renderer.compact(e)||t}_updateQuality(e){return e=Math.min(Math.max(e,p),1),e!==this._quality&&(this._quality=e,++this._numQualityChanges,!0)}_layersUpdating(){return this.view.allLayerViews.some(e=>!!e.updating)}_updateMemory(){if(!this.view?.updating||this.view.destroyed||this.view.destroying)return;this.view.stage?.renderer?.tick();let e=this.view.stage?.renderer?.usedMemory,t=(this.view.basemapTerrain?.usedMemory??0)+(e?e.fbos+e.edges+e.plugins+e.clouds:0)+this.view.deconflictor?.usedMemory+this.view.labeler?.usedMemory+(l(this.view)?.lyr3DInternalMemoryBytes??0),r=0;this.view.allLayerViews&&this.view.allLayerViews.forEach(e=>{if(u(e)){let n=e.ignoresMemoryFactor?this._quality:1;t+=e.usedMemory*n,r+=e.unloadedMemory*n}});let i=this._warnMemoryUsage==null||Math.round(t*10)!==Math.round(this._warnMemoryUsage*10),a=this.maxMemory*1048576;if(t>a&&i){this._warnMemoryUsage=t;let e=e=>(e/1048576).toLocaleString(void 0,{maximumFractionDigits:1})+` MB`,i=Math.round(this._quality*100);n.getLogger(this).warn(`Memory Limit exceeded! Limit: ${e(a)} Current: ${e(t)} Projected: ${e(t+r)} Quality: ${i}%`)}this._usedMemory=t/a,this._predictedMemory=(t+r)/a;let o=a-t;this._cacheStorage.maxSize=Math.max(0,o+this.additionalCacheMemory*1048576)}get test(){}};e([s({constructOnly:!0})],_.prototype,`view`,void 0),e([s()],_.prototype,`maxMemory`,null),e([s()],_.prototype,`_quality`,void 0),e([s()],_.prototype,`_usedMemory`,void 0),e([s()],_.prototype,`_updating`,void 0),e([s()],_.prototype,`_stableQuality`,void 0),e([s()],_.prototype,`_maxMemory`,void 0),e([s()],_.prototype,`_additionalCacheMemory`,void 0),_=e([c(`esri.views.3d.support.MemoryController`)],_);export{p as minQuality,f as newMemoryController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
const e={type:`empty-tile`};function t(e){return e!=null&&`type`in e&&e.type===`vector-tile`}function n(e){return e!=null&&`type`in e&&e.type===`raster-tile`}function r(e){return e!=null&&`type`in e&&e.type===`tile-texture`}function i(e){return e
|
|
2
|
+
const e={type:`empty-tile`};function t(e){return e!=null&&`type`in e&&e.type===`vector-tile`}function n(e){return e!=null&&`type`in e&&e.type===`raster-tile`}function r(e){return e!=null&&`type`in e&&e.type===`tile-texture`}function i(e){return e==null||`type`in e&&e.type===`empty-tile`}function a(e){return e!=null&&`type`in e&&`bitmap`in e}export{e as emptyTile,a as isCreateBitmapResult,i as isEmptyTile,n as isRasterTile,r as isTileTexture,t as isVectorTile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Collection.js";import{isEarth as t}from"../../../geometry/ellipsoidUtils.js";import{isCGCS2000 as n}from"../../../geometry/support/spatialReferenceUtils.js";import{getTileMaxtrixSetFromActiveLayer as r}from"../../../layers/support/layerUtils.js";import{isRasterTile as i,isCreateBitmapResult as a,isTileTexture as o,isVectorTile as s}from"./TerrainData.js";import{t as c}from"../../../chunks/terrainUtilsPlanar.js";import{t as l}from"../../../chunks/terrainUtilsSpherical.js";const u={1:l,2:c};function d(e,t){e||console.warn(`Terrain: `+t)}let f=!1,p=!1;function m(e){p=e,f||=e}function h(e){f=e}function g(e,t){if(f&&!e){let e=Error().stack?.slice(5);throw console.warn(`Terrain internal: `+(t??``)+` at `+e),Error(`Assertion failed`+(t?`: `+t:``))}}function _(e){return e?.type===`imagery-tile`||e?.type===`wcs`}function v(e){return e?.type===`imagery-tile-3d`}function y(e){return e?.type===`tile-3d`}function b(e){return e?.type===`vector-tile-3d`}function x(e){return e?.type===`wmts-3d`}function S(e){return e?.type===`elevation-3d`}function C(e){return e?.type===`group`}function w(e){return e&&(y(e)||x(e)||v(e)||b(e))}function T(e){return e&&(y(e)||v(e)||b(e)||x(e))}function E(e){return T(e)||S(e)}function D(e){return i(e?.sourceLayerInfo?.data)}function O(e){return j(e
|
|
2
|
+
import e from"../../../core/Collection.js";import{isEarth as t}from"../../../geometry/ellipsoidUtils.js";import{isCGCS2000 as n}from"../../../geometry/support/spatialReferenceUtils.js";import{getTileMaxtrixSetFromActiveLayer as r}from"../../../layers/support/layerUtils.js";import{isRasterTile as i,isCreateBitmapResult as a,isTileTexture as o,isVectorTile as s}from"./TerrainData.js";import{t as c}from"../../../chunks/terrainUtilsPlanar.js";import{t as l}from"../../../chunks/terrainUtilsSpherical.js";const u={1:l,2:c};function d(e,t){e||console.warn(`Terrain: `+t)}let f=!1,p=!1;function m(e){p=e,f||=e}function h(e){f=e}function g(e,t){if(f&&!e){let e=Error().stack?.slice(5);throw console.warn(`Terrain internal: `+(t??``)+` at `+e),Error(`Assertion failed`+(t?`: `+t:``))}}function _(e){return e?.type===`imagery-tile`||e?.type===`wcs`}function v(e){return e?.type===`imagery-tile-3d`}function y(e){return e?.type===`tile-3d`}function b(e){return e?.type===`vector-tile-3d`}function x(e){return e?.type===`wmts-3d`}function S(e){return e?.type===`elevation-3d`}function C(e){return e?.type===`group`}function w(e){return e&&(y(e)||x(e)||v(e)||b(e))}function T(e){return e&&(y(e)||v(e)||b(e)||x(e))}function E(e){return T(e)||S(e)}function D(e){return i(e?.sourceLayerInfo?.data)}function O(e){return e?.sourceLayerInfo?.data!=null&&j(e.sourceLayerInfo)||!!e?.isVTLBackground}function k(e){return o(e?.sourceLayerInfo?.data)}function A(e){let t=e?.sourceLayerInfo?.data;return a(t)}function j(e){return s(e?.data)}function M(e){return e!=null&&`release`in e&&e.release(),null}function N(e,t,n,r,i){return u[r].checkIfTileInfoSupportedForViewSR(e,n,t,i)}function P(e,t,n){let r=null,i=null;if(e?.type===`wmts`){let a=F(e,t,n);r=a.tileInfo,i=a.fullExtent}else{i=_(e)?e.getCompatibleFullExtent(t):e.fullExtent;let a=n===2;r=_(e)?e.getCompatibleTileInfo(t,i,a):e?.type===`vector-tile`?a&&!I(t)||L.force512VTL?e.tileInfo:e.tileInfo.getCompatibleForVTL(256):e.tileInfo}let a=`tilemapCache`in e?e.tilemapCache?.effectiveMaxLOD:void 0;return r!=null&&i!=null&&N(r,i,t,n,a)==null?{tileInfo:r,fullExtent:i}:null}function F(t,n,i){let a=r(t);if(a!=null){if(e.isCollection(a)){let e=a.find(e=>N(e.tileInfo,e.fullExtent,n,i)==null);if(e)return{tileInfo:e.tileInfo,fullExtent:e.fullExtent}}else return{tileInfo:a.tileInfo,fullExtent:a.fullExtent}}return{tileInfo:null,fullExtent:null}}function I(e){return e.isWGS84||e.isWebMercator||n(e)||!t(e)}const L={force512VTL:!1};function R(e){return`[`+e[0]+`,`+e[1]+`,`+e[2]+`]`}function z(e){return`(`+e[0]+`,`+e[1]+`,`+e[2]+`)`}function B(e,t,n=Z){return Math.abs(e-t)<n}function V(e){return e===1?5:e===7?3:e===5?1:7}function H(e){return e===0?4:e===2?6:e===4?0:2}function U(e){return e===7||e===5}function W(e){return e===7||e===1}function G(e){return e===7||e===6||e===5}function K(e){return e===1||e===2||e===3}function q(e){return e===3||e===4||e===5}function J(e){return e===1||e===0||e===7}const Y=[0,2,4,6],X=[1,3,5,7],Z=1e-5;export{B as almostEquals,N as checkIfTileInfoSupportedForView,h as enableInternalTerrainChecks,f as enableTerrainInternalChecks,m as enableTerrainWaterproofChecks,p as enableWaterproofTests,Z as eps,F as getTileInfoAndExtentFromWMTSLayer,P as getTiledLayerInfo,g as internalAssert,w as isBlendableLayerView,K as isEast,S as isElevationLayerView,C as isGroupLayerView,A as isImageSourceRenderInfo,v as isImageryTileLayerView,D as isImageryTileRenderInfo,T as isMapTileLayerView,J as isNorth,W as isNorthCorner,_ as isProjectableRasterLayer,q as isSouth,E as isSurfaceLayerView,k as isTextureTileRenderInfo,y as isTileLayerView,b as isVectorTileLayerView,j as isVectorTilePerLayerInfo,O as isVectorTileRenderInfo,x as isWMTSLayerView,G as isWest,U as isWestCorner,R as lij2s,X as neighborCornerIndices,Y as neighborEdgeIndices,V as oppositeCorner,H as oppositeEdge,M as releaseTerrainData,L as test,z as v32s,I as vtlAssumes256PixelSizeAsDefault,d as weakAssert};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{remove as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{isPromiseLike as t,createAbortError as n}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{getEmissions as i}from"./emissive/emissions.js";import{DepthRange as a}from"../lib/DepthRange.js";class o{constructor(e){this.context=e,this._renderPlugins=[],this._slots=[],this._version=r(0);for(let e=0;e<20;++e)this._slots[e]=[]}destroy(){this._renderPlugins.forEach(e=>e.destroy()),this._renderPlugins.length=0}get plugins(){return this._renderPlugins}add(e,r){let i=()=>{if(r?.aborted)throw e.uninitializeRenderContext(),n();this._renderPlugins.push(e),e.produces.forEach((t,n)=>this._slots[n].push(e)),this.context.requestRender(),this._version.value++},a=e.initializeRenderContext(this.context,r);if(t(a))return a.then(i);i()}remove(t){e(this._renderPlugins,t),t.uninitializeRenderContext();for(let e=0;e<this._slots.length;++e)this._slots[e]=this._slots[e].filter(e=>e!==t);this.context.requestRender(),this._version.value++}sortTestsTransparentOrderedSlots(e){if(process.env.NODE_ENV===`test`&&this._renderPlugins.some(e=>e.testsTransparentRenderOrder!==0))for(let t of e)this._slots[t].sort((e,t)=>(e.testsTransparentRenderOrder??0)-(t.testsTransparentRenderOrder??0))}prepareRender(){this._renderPlugins.forEach(e=>e.prepareRender?.(this.context.renderContext))}updateAnimation(e){let t=!1;return this._renderPlugins.forEach(n=>t=n.updateAnimation?.(e)||t),t}precompile(...e){++this.context.techniques.precompiling;let t=this.context.renderContext.bind.slot;for(let t of e)this.context.renderContext.bind.slot=t,this._forEachRender(()=>{});this.context.renderContext.bind.slot=t,--this.context.techniques.precompiling}render(...e){for(let t of e)this.context.renderContext.bind.slot=t,this._forEachRender((e,t)=>e.render(this.context.renderContext,t))}_forEachRender(e){let t=this.context.renderContext.bind.slot,n=this.context.renderContext.output;this._slots[t].forEach(r=>{if(!r.produces.get(t)?.(n)||r.isDecoration&&!this.context.renderContext.bind.decorations)return;let i=r.acquireTechniques(this.context.renderContext);i&&e(r,i)})}queryDepthRange(e){return this._renderPlugins.reduce((t,n)=>t.union(n.queryDepthRange?.(e)),new a)}get updating(){return this._version.value>=0&&this._renderPlugins.some(e=>e.readyToRun)}produces(e,...t){return t.some(t=>this._slots[t].some(n=>{let r=n.produces.get(t);return r?r(e):!1}))}hasHighlight(e){return s.some(t=>this._slots[t].some(t=>t.hasHighlight(e)))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get hasOccludees(){return this._renderPlugins.some(e=>e.hasOccludees)}get emissions(){return i(this._renderPlugins)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,t)=>e|(t.renderOccludedFlags??0),0)}get usedMemory(){return this._renderPlugins.reduce((e,t)=>t.material?e:e+(t.usedMemory??0),0)}get test(){}}const s=[2,4,18,12,13,14];export{o as RenderPluginManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/PooledArray.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as i}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as a}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{Blit as s}from"../blit/Blit.js";import{DepthStencilAttachment as c}from"../../../../webgl/enums.js";let l=class extends o{constructor(e){super(e),this.consumes={required:[a.OCCLUDED]},this.produces=a.OCCLUDED,this._blit=new s(e.view.stage.renderView.techniques,2)}precompile(){let e=this.view.stage.renderer;e.plugins.plugins.forEach(t=>{e.precompileSlots(t,9,11),t.material&&e.precompileOccludedSlots(t,f)})}render(){let e=this.input;return this._renderOccludedAndTransparentStencil(e),this._renderOccludedComposite(e),e}_renderOccludedAndTransparentStencil(e){let t=this.view.stage.renderer,n=u;this._acquirePlugins(n,8),n.length!==0&&(t.renderSlots(n,10),this._renderAndComposite(e,e.getAttachment(c),.5,()=>t.renderSlots(n,11),!1,!1),n.clear())}_renderOccludedComposite(e){let t=this.view.stage.renderer,n=u,r=this._acquirePlugins(n,p);if(n.length===0)return;let i=this._getDepthStencilAttachment(e),a=i.clearStencil;for(let o of f)r&o&&(this._renderAndComposite(e,i.depth,o===16?1:.5,()=>t.renderOccludedSlots(n,o),!0,a),a=!1);i.release(),n.clear()}_acquirePlugins(e,t){let n=this.view.stage.renderer;e.clear();let r=0,i=!1;for(let a of n.plugins.plugins){let n=a.renderOccludedFlags&t;r|=n,n&&(e.push(a),i||=a.testsTransparentRenderOrder!==0)}return i&&e.sort((e,t)=>e.testsTransparentRenderOrder-t.testsTransparentRenderOrder),r}_renderAndComposite(e,t,n,r,a,o){let s=this.renderingContext,{width:c,height:l}=e.fbo,u=this.fboCache.acquire(c,l,`tmp color`);u.attachDepth(t),s.bindFramebuffer(u.fbo),s.clearFramebuffer(i,a,o),r(),u.detachDepth(),this._blit.blend(u,e,this.bindParameters,n),u.release()}_getDepthStencilAttachment(e){let{width:t,height:n}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){let e=this.fboCache.acquireDepth(14,t,n,`retained stencil`);return{depth:e,release:()=>e.release(),clearStencil:!0}}let r=this.fboCache.acquire(t,n,`retained stencil`,14);return this.renderingContext.blitFramebuffer(e.fbo,r.fbo,1024),{depth:r.getAttachment(c),release:()=>r.release(),clearStencil:!1}}};e([n()],l.prototype,`consumes`,void 0),e([n()],l.prototype,`produces`,void 0),l=e([r(`esri.views.3d.webgl-engine.effects.geometry.RenderOccluded`)],l);const u=new t;function d(){u.prune()}const f=[4,2,16],p=f.reduce((e,t)=>e|t,0);export{l as RenderOccluded,d as cleanupRenderOccluded};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/PooledArray.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as i}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as a}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{Blit as s}from"../blit/Blit.js";import{DepthStencilAttachment as c}from"../../../../webgl/enums.js";let l=class extends o{constructor(e){super(e),this.consumes={required:[a.OCCLUDED]},this.produces=a.OCCLUDED,this._blit=new s(e.view.stage.renderView.techniques,2)}precompile(){let e=this.view.stage.renderer;e.plugins.plugins.forEach(t=>{e.precompileSlots(t,9,11),t.material&&e.precompileOccludedSlots(t,f)})}render(){let e=this.input;return this._renderOccludedAndTransparentStencil(e),this._renderOccludedComposite(e),e}_renderOccludedAndTransparentStencil(e){let t=this.view.stage.renderer,n=u;this._acquirePlugins(n,8),n.length!==0&&(t.renderSlots(n,10),this._renderAndComposite(e,e.getAttachment(c),.5,()=>t.renderSlots(n,11),!1,!1),n.clear())}_renderOccludedComposite(e){let t=this.view.stage.renderer,n=u,r=this._acquirePlugins(n,p);if(n.length===0)return;let i=this._getDepthStencilAttachment(e),a=i.clearStencil;for(let o of f)r&o&&(this._renderAndComposite(e,i.depth,o===16?1:.5,()=>t.renderOccludedSlots(n,o),!0,a),a=!1);i.release(),n.clear()}_acquirePlugins(e,t){let n=this.view.stage.renderer;e.clear();let r=0,i=!1;for(let a of n.plugins.plugins){let n=a.renderOccludedFlags&t;r|=n,n&&(e.push(a),i||=a.testsTransparentRenderOrder!==0)}return i&&(process.env.NODE_ENV===`test`?e.stableSort((e,t)=>e.testsTransparentRenderOrder-t.testsTransparentRenderOrder):e.sort((e,t)=>e.testsTransparentRenderOrder-t.testsTransparentRenderOrder)),r}_renderAndComposite(e,t,n,r,a,o){let s=this.renderingContext,{width:c,height:l}=e.fbo,u=this.fboCache.acquire(c,l,`tmp color`);u.attachDepth(t),s.bindFramebuffer(u.fbo),s.clearFramebuffer(i,a,o),r(),u.detachDepth(),this._blit.blend(u,e,this.bindParameters,n),u.release()}_getDepthStencilAttachment(e){let{width:t,height:n}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){let e=this.fboCache.acquireDepth(14,t,n,`retained stencil`);return{depth:e,release:()=>e.release(),clearStencil:!0}}let r=this.fboCache.acquire(t,n,`retained stencil`,14);return this.renderingContext.blitFramebuffer(e.fbo,r.fbo,1024),{depth:r.getAttachment(c),release:()=>r.release(),clearStencil:!1}}};e([n()],l.prototype,`consumes`,void 0),e([n()],l.prototype,`produces`,void 0),l=e([r(`esri.views.3d.webgl-engine.effects.geometry.RenderOccluded`)],l);const u=new t;function d(){u.prune()}const f=[4,2,16],p=f.reduce((e,t)=>e|t,0);export{l as RenderOccluded,d as cleanupRenderOccluded};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as t}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as n
|
|
2
|
+
import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as t}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as n}from"../../../../geometry/support/Indices.js";import{newShortArray as r}from"../../../../geometry/support/ShortArray.js";import{pathNumProfilesPerJoin as i,pathNumJoinSubdivisions as a}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{compressNormal as o,encodeInt16 as s}from"./Normals.js";import{PathEvaluator as c}from"./PathEvaluator.js";import{encodePathVertexInfo as l}from"./PathVertexInfo.js";class u{constructor(o,s,l,u,d){this.path=o,this.profile=s,this.extruder=l,this.cap=u,this._extrusionVertexCount=0,this._extrusionFrameCount=0;let f=this.path.vertices.length-2;this.numExtrusionProfiles=i*f+2,this.numVerticesTotal=s.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=this.path.vertices.length;let p=this.cap.numVertices;this.startCapGeometryVertexOffset=this.numVerticesTotal,this.numVerticesTotal+=p,this.endCapGeometryVertexOffset=this.numVerticesTotal,this.numVerticesTotal+=p,this.profileRightAxes=r(this.numExtrusionFrames*2),this.profileUpAxes=r(this.numExtrusionFrames*2);let m=d===1;this.profileRotationFrameUpAxes=m?r(this.numExtrusionFrames*2):null,this.pathMaxStretchDistances=t(this.numExtrusionFrames),this.profileRotations=r(this.numExtrusionFrames),this.framePositionIndices=n(this.numExtrusionFrames),this.pathVertexInfos=new Uint32Array(this.numVerticesTotal),this.positions=e(o.positions,o.offset,o.vertices.length*3);let h=l.join===2;this._numJoinTriangles=s.joinTriangleBudgets[d][l.join];let g=2*s.numSegments*(h?a:1);this._compressed=this._numJoinTriangles<g;let _=2*s.numSegments*(f+1)+this._numJoinTriangles*f;this.vertexIndices=n(_*3+2*this.cap.numIndices,this.numVerticesTotal),this._rebuildGeometry(),this._buildTopology(),this.evaluator=new c(this,s,l,u.type,d)}emitVertexDescriptor(e){let t=this._extrusionVertexCount;this.pathVertexInfos[t]=l(e),++this._extrusionVertexCount}emitExtrusionFrame(e,t){let{frame:n,rotationFrameUp:r,rotationAngle:i,maxStretchDistance:a}=e,c=this._extrusionFrameCount;return o(this.profileRightAxes,c,n.right[0],n.right[1],n.right[2]),o(this.profileUpAxes,c,n.up[0],n.up[1],n.up[2]),this.profileRotations[c]=s(i/Math.PI),this.profileRotationFrameUpAxes&&o(this.profileRotationFrameUpAxes,c,r[0],r[1],r[2]),this.pathMaxStretchDistances[c]=a,this.framePositionIndices[c]=t,this._extrusionFrameCount++}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;let{vertices:e}=this.path,{profile:t}=this;this._updatePositions();for(let t=0;t<e.length;++t)this.emitExtrusionFrame(e[t],t);for(let e=0;e<t.vertices.length;++e)this.emitVertexDescriptor({frameIndex:0,sourceIndex:e,subdivision:0,type:1,capSide:0});let n=(e,t,n)=>{this.emitVertexDescriptor({frameIndex:e,sourceIndex:t,subdivision:n,type:0,capSide:0})};for(let t=1;t<e.length-1;++t)this.extruder.extrude(t,this.profile,n);let r=e.length-1;for(let e=0;e<t.vertices.length;++e)this.emitVertexDescriptor({frameIndex:r,sourceIndex:e,subdivision:0,type:1,capSide:1});this.cap.rebuildCapGeometry((e,t,n)=>this.emitVertexDescriptor({frameIndex:0,sourceIndex:e,subdivision:t,type:n,capSide:0})),this.cap.rebuildCapGeometry((e,t,n)=>this.emitVertexDescriptor({frameIndex:r,sourceIndex:e,subdivision:t,type:n,capSide:1}))}_updatePositions(){let{positions:e,offset:t,vertices:n}=this.path;if(!Array.isArray(e))return;let r=n.length*3,i=this.positions;for(let n=0;n<r;++n)i[n]=e[t+n]}_buildTopology(){let e=this.profile.vertices.length*(this.numExtrusionProfiles-1),{vertexIndices:t}=this,n=0,r=(e,r,i)=>{t[n++]=e,t[n++]=r,t[n++]=i};this.extruder.buildTopology(this.path,this.profile,0,this.profileRotationFrameUpAxes!=null,this._compressed,this._numJoinTriangles,(e,t)=>{for(let n=0;n<this.profile.numSegments;++n){let i=this.profile.indices[n*2],a=this.profile.indices[n*2+1];r(e+i,t+i,t+a),r(e+i,t+a,e+a)}},r),this.cap.buildTopology(r,0,this.startCapGeometryVertexOffset,0),this.cap.buildTopology(r,1,this.endCapGeometryVertexOffset,e)}onPathChanged(){this._rebuildGeometry(),this._buildTopology()}}export{u as PathBuilder};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{pathNumRoundCapExtrusionSubdivisions as e}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class t{constructor(){this.numVertices=0,this.numIndices=0,this.type=0}rebuildCapGeometry(){}buildTopology(){}}class n{constructor(e,t){this._profile=e,this.type=t}get numVertices(){return this._profile.vertices.length}get numIndices(){return
|
|
2
|
+
import{pathNumRoundCapExtrusionSubdivisions as e}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class t{constructor(){this.numVertices=0,this.numIndices=0,this.type=0}rebuildCapGeometry(){}buildTopology(){}}class n{constructor(e,t){this._profile=e,this.type=t}get numVertices(){return this._profile.vertices.length}get numIndices(){return(this._profile.numSegments-1)*3}rebuildCapGeometry(e){let t=this._profile;for(let n=0;n<t.vertices.length;++n)e(n,0,2)}buildTopology(e,t,n){let r=this._profile,i=n+r.indices[0],a=t===1;for(let t=1;t<r.numSegments;++t){let o=r.indices[t*2],s=r.indices[t*2+1],c=n+o,l=n+s;a?e(l,c,i):e(i,c,l)}}}class r{constructor(e,t){this._profile=e,this._breakNormals=t,this.type=3}get numVertices(){let t=this._profile.vertices.length*(e-1)+this._profile.poles.length;return this._breakNormals&&(t+=this._profile.vertices.length),t}get numIndices(){let t=0,n=this._profile;t+=n.numSegments*2*(e-1);for(let e=0;e<n.numSegments;++e){let r=n.indices[e*2],i=n.indices[e*2+1];n.poleIndices[r]===n.poleIndices[i]?t+=1:t+=2}return t*3}rebuildCapGeometry(t){let n=this._profile;for(let e=0;e<n.poles.length;++e)t(e,0,2);if(this._breakNormals)for(let e=0;e<n.vertices.length;++e)t(e,0,1);for(let r=0;r<e-1;++r)for(let e=0;e<n.vertices.length;++e)t(e,r,3)}buildTopology(t,n,r,i){let a=this._profile,o=this._breakNormals?r+a.poles.length:i,s=this._breakNormals?r+a.poles.length+a.vertices.length:r+a.poles.length,c=n===1;for(let n=0;n<a.numSegments;++n){let i=a.indices[n*2],l=a.indices[n*2+1],u=r+a.poleIndices[i],d=r+a.poleIndices[l],f=o+i,p=o+l;for(let n=0;n<e-1;++n){let e=s+n*a.vertices.length+i,r=s+n*a.vertices.length+l;c?(t(e,p,f),t(p,e,r)):(t(f,p,e),t(r,e,p)),f=e,p=r}c?(t(u,p,f),u!==d&&t(u,d,p)):(t(f,p,u),u!==d&&t(p,d,u))}}}export{t as NoCapBuilder,r as RoundCapBuilder,n as TriangulationCapBuilder};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as r}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as a,copy as o,length as s,scale as c,set as l,dot as u,add as d,subtract as f,normalize as p,transformMat2 as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{
|
|
2
|
+
import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as r}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as a,copy as o,length as s,scale as c,set as l,dot as u,add as d,subtract as f,normalize as p,transformMat2 as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as h,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as _,set as v,transformQuat as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{pathNumJoinSubdivisions as x,pathNumRoundCapExtrusionSubdivisions as S}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{decodeInt16 as C,decompressNormal as w}from"./Normals.js";import{PathFrame2D as T}from"./PathFrame2D.js";import{constructPathRotationRight as E,isOuterJoinVertex as D}from"./pathGeometryUtils.js";import{decodePathVertexInfo as O}from"./PathVertexInfo.js";class k{constructor(e,t,n,r,i){this.builder=e,this.profile=t,this.extruder=n,this.capType=r,this.upVectorAlignment=i}evaluateVertexPosition(e,t,n,r){let{framePositionIndices:i,positions:f}=this.builder,p=H;this._evaluateExtrudedVertex(p,n);let m=I,h=0,g=p.frameIndex,y=p.frame.right,b=p.frame.up,x=i[g]*3,S=a(L,p.profileVertex,t);if(p.isCap)_(m,b,y),h=p.capPositionOffset*t[0];else{let e=R,n=z;o(e,p.rotationRight);let r=p.maxDistance;a(e,e,t);let i=s(e);i>0?c(e,e,1/i):l(e,0,0);let f=u(S,e);if(Math.abs(f)>r){l(n,-e[1],e[0]);let t=u(S,n);c(e,e,r*Math.sign(f)),c(n,n,t),d(S,e,n)}v(m,0,0,0)}let C=y[0]*S[0]+b[0]*S[1],w=y[1]*S[0]+b[1]*S[1],T=y[2]*S[0]+b[2]*S[1],E=r*3;e[E]=f[x]+C+m[0]*h,e[E+1]=f[x+1]+w+m[1]*h,e[E+2]=f[x+2]+T+m[2]*h}_evaluateExtrudedVertex(e,t){let{profileRotations:n,profileUpAxes:i,profileRightAxes:a,profileRotationFrameUpAxes:s,pathMaxStretchDistances:l,pathVertexInfos:u}=this.builder,{extruder:m,profile:g,upVectorAlignment:_}=this,{cutoffAngle:v,join:b}=m,T=A[_],k=this.upVectorAlignment===1,P=O(u[t]),I=P.frameIndex;e.frameIndex=I;let L=C(n[I])*Math.PI,R=l[I];switch(w(e.frame.right,a,I),w(e.frame.up,i,I),e.maxDistance=0,P.type){case 0:{e.isCap=!1;let t=g.vertices[P.sourceIndex],n=Math.abs(L)>=v,i=k?w(B,s,I):e.frame.up,a=E(F,e.frame,i,k),c=D(t,a,L);if(n&&c){o(e.profileVertex,t);let n=b===2?(-.5+P.subdivision/x)*L:(-.5+Math.floor(P.subdivision/2))*L;n!==0&&(r(V,i,n),k&&y(e.frame.up,e.frame.up,V),y(e.frame.right,e.frame.right,V))}else{let n=T(N,t,L,a);o(e.profileVertex,n)}o(e.rotationRight,c?h:a),e.maxDistance=c?0:R;break}case 1:{e.isCap=!0;let t=g.vertices[P.sourceIndex];switch(o(e.profileVertex,t),this.capType){case 0:case 1:case 3:e.capPositionOffset=0;break;case 2:e.capPositionOffset=j(P)?.5:-.5}break}case 2:{e.isCap=!0;let t=j(P)?1:-1;switch(this.capType){case 1:case 2:{let n=g.vertices[P.sourceIndex],r=this.capType===2?t*.5:0;o(e.profileVertex,n),e.capPositionOffset=r;break}case 3:{let n=t*.5,r=g.poles[P.sourceIndex],i=r.position;r.normal,o(e.profileVertex,i),e.capPositionOffset=n;break}}break}case 3:{e.isCap=!0;let t=(j(P)?1:-1)*.5,n=(1-(P.subdivision+1)/S)*Math.PI*.5,r=Math.sin(n),i=Math.cos(n),a=g.poleIndices[P.sourceIndex],s=g.poles[a],l=s.position,u=s.normal,m=g.vertices[P.sourceIndex];f(N,m,l),c(N,N,r),u?(d(N,N,l),o(e.profileVertex,N),e.capPositionOffset=t*i):(p(M,N),c(M,M,r),d(N,N,l),o(e.profileVertex,N),e.capPositionOffset=t*i);break}default:P.type}}}const A={0:(t,n,r)=>{if(Math.abs(r)<=0)return n;let i=e(Math.cos(.5*r));return l(t,(1+(i-1))*n[0],n[1])},1:(n,r,i,a)=>{if(Math.abs(i)===0)return r;let o=e(Math.cos(.5*i)),s=t(P,1+(o-1)*a[0]*a[0],(o-1)*a[0]*a[1],(o-1)*a[0]*a[1],1+(o-1)*a[1]*a[1]);return m(n,r,s)}};function j(e){return e.capSide===1}const M=g(),N=g(),P=n(),F=g(),I=b(),L=g(),R=g(),z=g(),B=b(),V=i(),H={profileVertex:g(),rotationRight:g(),maxDistance:0,capPositionOffset:0,isCap:!1,frame:new T,frameIndex:0};export{k as PathEvaluator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumProfilesPerJoin as t,pathNumJoinSubdivisions as n}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{constructPathRotationRight as r,needsJoinSubdivisions as i}from"./pathGeometryUtils.js";class a{constructor(e){this.join=e,this.cutoffAngle=this.join===0?.8*Math.PI:0}extrude(e,n,r){for(let i=0;i<t;++i)for(let t=0;t<n.vertices.length;++t)r(e,t,i)}buildTopology(e,t,n,r,i,a,o,s){i?this._buildCompressedTopology(e,t,n,r,a,o,s):this._buildFixedTopology(e,t,n,o)}_buildCompressedTopology(e,r,i,a,o,s,c){let l=r.vertices.length,u=this.join===2?n:1,d=Array(l).fill(!1),f=i;for(let i=1;i<e.vertices.length-1;++i){let p=l*(1+(i-1)*t);s(f,p),this._classifyJoinVertices(e.vertices[i],r,a,d);let m=o-r.indices.reduce((e,t)=>e+(d[t]?0:u),0);this._emitCompressedJoinTopology(r,p,d,c);for(let e=0;e<m;++e)c(p,p,p);f=p+n*l}let p=l*(1+(e.vertices.length-2)*t);s(f,p)}_buildFixedTopology(e,r,i,a){let o=r.vertices.length,s=this.join===2,c=+!s,l=s?n:2,u=i;for(let r=1;r<e.vertices.length-1;++r){let e=o*(1+(r-1)*t);a(u,e);for(let t=c;t<l;++t){let n=e+t*o;a(n,n+o)}u=e+n*o}let d=o*(1+(e.vertices.length-2)*t);a(u,d)}_classifyJoinVertices(e,t,n,a){let s=e.rotationAngle,c=r(o,e.frame,e.rotationFrameUp,n);for(let e=0;e<a.length;++e){let n=t.vertices[e];a[e]=!i(n,c,s)}}_emitCompressedJoinTopology(e,t,r,i){let a=e.vertices.length,o=this.join===2,s=+!o,c=o?n:2;for(let n=0;n<e.numSegments;++n){let o=e.indices[n*2],l=e.indices[n*2+1];if(!(r[o]&&r[l]))for(let e=s;e<c;++e){let n=t+e*a,s=n+a,c=n+o,u=s+o,d=s+l,f=n+l;r[o]||i(c,u,d),r[l]||i(c,d,f)}}}}const o=e();export{a as PathExtruder};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{cyclical2PI as e}from"../../../../core/Cyclical.js";import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{exactEquals as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as r,clone as i,UNIT_X as a,ZEROS as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumJoinSubdivisions as s,pathNumCircleProfileSubdivisions as c}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{needsJoinSubdivisions as l,classificationTolerance as u}from"./pathGeometryUtils.js";const d=Math.acos(-2*u),f=c,p={0:{indexCount:f*2,poleCount:1,vertexCount:f},1:{indexCount:8,poleCount:4,vertexCount:8}};class m{constructor(e){this.type=e,this.vertices=[],this.normals=[],this.indices=[],this.poles=[],this.poleIndices=[],this.joinTriangleBudgets={0:{0:0,1:0,2:0},1:{0:0,1:0,2:0}}}addVertex(e,t){return this.vertices.push(i(e)),this.normals.push(i(t)),this.vertices.length-1}addPole(e,t=null){return this.poles.push({position:i(e),normal:t?i(t):null}),this.poles.length-1}addSegment(e,t=null){this.indices.push(e.v0),this.indices.push(e.v1),t&&(this.poleIndices.push(t.v0),this.poleIndices.push(t.v1))}get numSegments(){return this.indices.length/2}translate(e,t){for(let n of this.vertices)n[0]+=e,n[1]+=t;for(let n of this.poles)n.position[0]+=e,n.position[1]+=t}get usedMemory(){return this.vertices.length*t(this.vertices[0])*2+t(this.indices)}}const h={top:[0,-.5],bottom:[0,.5]};function g(e){let t=.5,n=c,i=new m(0),a={v0:0,v1:0};i.addPole(r(0,0));for(let e=0;e<n;++e){let a=e*2*Math.PI/n,o=Math.cos(a),s=Math.sin(a),c=r(o*t,s*t),l=r(o,s);i.addVertex(c,l)}for(let e=0;e<n-1;++e){let t={v0:e,v1:e+1};i.addSegment(t,a)}let o={v0:n-1,v1:0};if(i.addSegment(o,a),e!==`center`){let t=h[e];i.translate(t[0],t[1])}return b(i,2)}const _={center:g(`center`),top:g(`top`),bottom:g(`bottom`)},v={center:y(`center`),top:y(`top`),bottom:y(`bottom`)};function y(e){let t=new m(1),n=r(-.5,-.5),i=r(.5,-.5),a=r(.5,.5),o=r(-.5,.5),s=r(0,-1),c=r(1,0),l=r(0,1),u=r(-1,0);if(t.addPole(r(0,.5),l),t.addPole(r(0,.5)),t.addPole(r(0,-.5)),t.addPole(r(0,-.5),s),t.addVertex(n,s),t.addVertex(i,s),t.addSegment({v0:0,v1:1},{v0:3,v1:3}),t.addVertex(i,c),t.addVertex(a,c),t.addSegment({v0:2,v1:3},{v0:2,v1:1}),t.addVertex(a,l),t.addVertex(o,l),t.addSegment({v0:4,v1:5},{v0:0,v1:0}),t.addVertex(o,u),t.addVertex(n,u),t.addSegment({v0:6,v1:7},{v0:1,v1:2}),e!==`center`){let n=h[e];t.translate(n[0],n[1])}return b(t,1)}function b(e,t){let n=x(e,t),r=S(e,t);return e.joinTriangleBudgets={0:{0:n,1:n,2:s*n},1:{0:r,1:r,2:s*r}},e}function x(e,t){let n=0,r=0;for(let i=0;i<e.vertices.length;++i){let o=e.vertices[i];n+=l(o,a,1)?t:0,r+=l(o,a,-1)?t:0}return Math.max(n,r)}function S(t,r){let i=[],a=0;for(let s=0;s<t.vertices.length;++s){let c=t.vertices[s];if(n(c,o))continue;let l=Math.atan2(c[1],c[0]),u=e.normalize(l-d,0,!0),f=e.normalize(l+d,0,!0);i.push({angle:u,diff:r},{angle:f,diff:-r}),u>f&&(a+=r)}i.sort((e,t)=>e.angle-t.angle||t.diff-e.diff);let s=a;for(let e of i)a+=e.diff,s=Math.max(s,a);return s}export{m as PathProfile,_ as circleProfiles,p as pathProfileUniformLayout,v as quadProfiles};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{set as e,exactEquals as t,dot as n,length as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as i}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{dot as a,scale as o,add as s,normalize as c,copy as l,set as u,length as d,cross as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,fromPositionAndNormal as h,intersectRay as g}from"../../../../geometry/support/plane.js";import{wrap as _}from"../../../../geometry/support/ray.js";import{makeOrthoBasisDirUpFallback as v}from"./GeometryUtil.js";function y(e,t){let n=null,r=e.vertices.length,i=.99619469809,a=p(),o=p(),y=p(),b=p(),x=p(),S=p(),C=m(),T=e.vertices[0];l(o,t),u(a,0,1,0),v(T.vRight,o,a,a,y,o,i),l(T.frame.up,o),l(T.frame.right,y);let E=e.positions,D=e.offset;n=T;for(let t=1;t<r;++t){T=e.vertices[t],s(x,T.vLeft,T.vRight);let r=d(x);r>0?(r=1/Math.sqrt(r),x[0]*=r,x[1]*=r,x[2]*=r):(x[0]=T.vRight[0],x[1]=T.vRight[1],x[2]=T.vRight[2]),S[0]=E[D]+n.frame.up[0],S[1]=E[D+1]+n.frame.up[1],S[2]=E[D+2]+n.frame.up[2],D+=3;let p=u(w,E[D],E[D+1],E[D+2]);h(p,x,C),g(C,_(S,T.vLeft),b)?(b[0]-=E[D],b[1]-=E[D+1],b[2]-=E[D+2],c(o,b),f(y,x,o),c(y,y)):v(x,n.frame.up,n.frame.right,a,y,o,i),l(T.frame.up,o),l(T.frame.right,y),n=T}}const b=.001;function x(t,n,r,i){if(!i)return e(t,1,0);let l=a(r,n.up),u=a(r,n.right);return o(w,n.right,l),o(T,n.up,-u),s(w,w,T),c(w,w),e(t,a(w,n.right),a(w,n.up))}function S(e,t,i,a=0){return n(e,t)*Math.sign(i)>=-a*r(e)}function C(e,n,r){return r!==0&&!t(e,i)&&S(e,n,r,b)}const w=p(),T=p();export{b as classificationTolerance,y as computeMinimumRotationTangentFrame,x as constructPathRotationRight,S as isOuterJoinVertex,C as needsJoinSubdivisions};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as n}from"../../../../core/asyncUtils.js";import r from"../../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../../core/MapUtils.js";import{abortMaybe as a}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as s}from"../../../../core/promiseUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{validateDomainValue as d}from"../../../../layers/support/domainUtils.js";import{castArcadeValue as f}from"../../expressions/expressionUtils.js";import{makeUseId as p}from"./inputUtils.js";import{isEmptyValue as m}from"../../../support/forms/formUtils.js";let h=class extends t{constructor(e){super(e),this.initialEvaluationInProgress=!1,this.filterValue=``,this._choices=[],this._evaluated=!1,this._choicesByCode=new Map,this._expressionTask=null,this._interactionActive=!1,this._updatingHandles=new u}initialize(){!this._codedValueDomain&&!m(this.fieldInput.value)&&(this.initialEvaluationInProgress=!0,this.evaluateChoiceExpression().finally(()=>{this.initialEvaluationInProgress=!1}))}destroy(){a(this._expressionTask),this._updatingHandles.destroy()}get arcadeContextInfo(){return this.fieldInput.expressionsManager.arcadeContext}get choices(){return this._choices}get evaluating(){return this._updatingHandles.updating}get evaluated(){return this._evaluated}get inputValue(){if(this._interactionActive)return this.filterValue;let e=this.fieldInput.value;return e==null?``:this.getLabel(e)}get features(){return this.fieldInput.features}get filteredChoices(){let e=this.choices,t=this.filterValue.trim().toLocaleLowerCase();return t?e.filter((e,n)=>this._normalizedChoiceNames[n].includes(t)):e}get input(){return this.fieldInput.input}get _codedValueDomain(){let e=this.fieldInput.domain;return e?.type===`coded-value`?e:null}get _normalizedChoiceNames(){return this._choices.map(({code:e,name:t})=>`${t}\n${this.getLabel(e)}`.toLocaleLowerCase())}beginInteraction(){this._interactionActive||(this._interactionActive=!0,this.filterValue=``,this.evaluateChoiceExpression())}getChoice(e){return this._choicesByCode.get(e)}getLabel(e){
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as n}from"../../../../core/asyncUtils.js";import r from"../../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../../core/MapUtils.js";import{abortMaybe as a}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as s}from"../../../../core/promiseUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{validateDomainValue as d}from"../../../../layers/support/domainUtils.js";import{castArcadeValue as f}from"../../expressions/expressionUtils.js";import{makeUseId as p}from"./inputUtils.js";import{isEmptyValue as m}from"../../../support/forms/formUtils.js";let h=class extends t{constructor(e){super(e),this.initialEvaluationInProgress=!1,this.filterValue=``,this._choices=[],this._evaluated=!1,this._choicesByCode=new Map,this._expressionTask=null,this._interactionActive=!1,this._previouslySelectedChoice=void 0,this._updatingHandles=new u}initialize(){!this._codedValueDomain&&!m(this.fieldInput.value)&&(this.initialEvaluationInProgress=!0,this.evaluateChoiceExpression().finally(()=>{this.initialEvaluationInProgress=!1}))}destroy(){a(this._expressionTask),this._updatingHandles.destroy()}get arcadeContextInfo(){return this.fieldInput.expressionsManager.arcadeContext}get choices(){return this._choices}get evaluating(){return this._updatingHandles.updating}get evaluated(){return this._evaluated}get inputValue(){if(this._interactionActive)return this.filterValue;let e=this.fieldInput.value;return e==null?``:this.getLabel(e)}get interactionActive(){return this._interactionActive}get features(){return this.fieldInput.features}get filteredChoices(){let e=this.choices,t=this.filterValue.trim().toLocaleLowerCase();return t?e.filter((e,n)=>this._normalizedChoiceNames[n].includes(t)):e}get input(){return this.fieldInput.input}get _codedValueDomain(){let e=this.fieldInput.domain;return e?.type===`coded-value`?e:null}get _normalizedChoiceNames(){return this._choices.map(({code:e,name:t})=>`${t}\n${this.getLabel(e)}`.toLocaleLowerCase())}beginInteraction(){this._interactionActive||(this._interactionActive=!0,this.filterValue=``,this.evaluateChoiceExpression())}getChoice(e){return this._choicesByCode.get(e)}getLabel(e){return this._codedValueDomain?.getName(e)??this.getChoice(e)?.name??(this._previouslySelectedChoice?.code===e?this._previouslySelectedChoice.name:String(e))}endInteraction(){this._interactionActive=!1,this.filterValue=``}async evaluateChoiceExpression(){this._expressionTask=a(this._expressionTask);let e=n(e=>this._evaluateChoiceExpression(e));this._expressionTask=e;try{return await o(this._updatingHandles.addPromise(e.promise))??this.choices}finally{this._expressionTask===e&&(this._expressionTask=null)}}async _evaluateChoiceExpression(e){let t=await import(`../../../../arcade/languageUtils.js`);s(e);let n=this.arcadeContextInfo,r=this.fieldInput.field,i=this.fieldInput.template;await this.requestDeferredExpressionEvaluation({features:this.features.toArray(),getExecutor:e=>i.getExpressionExecutorsForLayer(e)?.choiceExpression}),s(e),this._evaluated=!0;let a=[];for(let e of this.features){let i=this._lookupExpressionOutcome(e),o=i?.result?this._parseChoices(i.result,n,r,t):[];if(a.push(o),o.length===0)break}let o=this.fieldInput.domain,c=v(_(a)).filter(({code:e})=>d(r,e,o)===null),l=this.fieldInput.value,u=l==null?void 0:this.getChoice(l)??(this._previouslySelectedChoice?.code===l?this._previouslySelectedChoice:void 0);return this._choicesByCode=new Map(c.map(e=>[e.code,e])),this._previouslySelectedChoice=u&&!this._choicesByCode.has(u.code)?u:void 0,this._choices=c,c}_lookupExpressionOutcome(e){return this.fieldInput.expressionsManager.outcomes.get(e)?.get(p({elementId:this.fieldInput.template.elementId,executorPurpose:`choiceExpression`}))}_parseChoices(e,t,n,r){if(!y(e,r))return x(this),[];let i=b(e,`choices`),a=r.isImmutableArray(i)?i.toArray():Array.isArray(i)?i:[],o=[];for(let e of a){if(!y(e,r)){x(this);continue}let i=b(e,`name`),a=b(e,`code`);if(typeof i!=`string`||a===void 0||r.isVoid(a)||r.isFunctionParameter(a)){x(this);continue}let s=f(a,n,t.timeZone,r);s!=null&&o.push({name:i,code:s})}return o}};e([c()],h.prototype,`arcadeContextInfo`,null),e([c()],h.prototype,`choices`,null),e([c()],h.prototype,`evaluating`,null),e([c()],h.prototype,`evaluated`,null),e([c()],h.prototype,`initialEvaluationInProgress`,void 0),e([c()],h.prototype,`inputValue`,null),e([c()],h.prototype,`interactionActive`,null),e([c()],h.prototype,`features`,null),e([c({constructOnly:!0})],h.prototype,`fieldInput`,void 0),e([c()],h.prototype,`filteredChoices`,null),e([c()],h.prototype,`filterValue`,void 0),e([c()],h.prototype,`input`,null),e([c()],h.prototype,`requestDeferredExpressionEvaluation`,void 0),e([c()],h.prototype,`_choices`,void 0),e([c()],h.prototype,`_codedValueDomain`,null),e([c()],h.prototype,`_evaluated`,void 0),e([c()],h.prototype,`_choicesByCode`,void 0),e([c()],h.prototype,`_interactionActive`,void 0),e([c()],h.prototype,`_normalizedChoiceNames`,null),e([c()],h.prototype,`_previouslySelectedChoice`,void 0),h=e([l(`esri.widgets.BatchAttributeForm.inputs.support.DynamicChoiceController`)],h);const g=h;function _(e){let[t,...n]=e;if(!t||t.length===0)return[];let r=t;for(let e of n.sort((e,t)=>e.length-t.length)){if(!e.length)return[];let t=new Map;for(let{code:n,name:r}of e)i(t,n,()=>new Set).add(r);if(r=r.filter(({code:e,name:n})=>t.get(e)?.has(n)),!r.length)break}return r}function v(e){let t=new Set;return e.filter(({code:e})=>!t.has(e)&&(t.add(e),!0))}function y(e,t){return t.isDictionary(e)&&typeof e.field==`function`&&typeof e.keys==`function`}function b(e,t){let n=e.keys().find(e=>e.toLowerCase()===t);return n==null?void 0:e.field(n)}function x(e){r.getLogger(e).error(`Value returned by choice expression does not conform to specification.`)}export{g as default};
|