12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../analysis/SliceAnalysis.js";import t from"../../core/Collection.js";import{isNone as r,applySome as o,unwrapOr as l,isSome as a}from"../../core/maybe.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{AnalysisViewModel as d}from"../support/AnalysisViewModel.js";const c=new Set;let u=class extends d{constructor(e){super(e),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="SliceViewModel is only supported in 3D views.",c.add(this)}destroy(){c.delete(this)}get state(){return this.disabled||!this.ready?"disabled":r(this.tool)?"ready":this.tool.state}get shape(){return this.analysis.shape}set shape(e){this.analysis.shape=e}get tiltEnabled(){return this.analysis.tiltEnabled}set tiltEnabled(e){this.analysis.tiltEnabled=e}get layersMode(){const e=o(this.tool,(e=>e.layersMode));return l(e,"none")}get excludedLayers(){return this.analysis.excludedLayers}set excludedLayers(e){this.analysis.excludedLayers=t.isCollection(e)?e:new t(e)}get excludeGroundSurface(){return this.analysis.excludeGroundSurface}set excludeGroundSurface(e){this.analysis.excludeGroundSurface=e}async start(){await super.start(),c.forEach((e=>{e.view===this.view&&e!==this&&e.clear()})),a(this.analysisView)&&(this.analysisView.active=!0)}enterExcludeLayerMode(){a(this.tool)&&this.tool.enterExcludeLayerMode()}exitExcludeLayerMode(){a(this.tool)&&this.tool.exitExcludeLayerMode()}onConnectToAnalysisView(e){e.active=!0}constructAnalysis(){return new s}};e([i({type:s})],u.prototype,"analysis",void 0),e([i({readOnly:!0})],u.prototype,"state",null),e([i()],u.prototype,"shape",null),e([i()],u.prototype,"tiltEnabled",null),e([i()],u.prototype,"layersMode",null),e([i()],u.prototype,"excludedLayers",null),e([i({nonNullable:!0})],u.prototype,"excludeGroundSurface",null),u=e([n("esri.widgets.Slice.SliceViewModel")],u);const p=u;export{p as default};
|