UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.41 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as t}from"../../../chunks/tslib.es6.js";import r from"../../../core/Clonable.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import{cast as s}from"../../../core/accessorSupport/decorators/cast.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";let o=class extends r{constructor(){super(...arguments),this.mode="auto"}get near(){return this._get("near")}set near(t){this._set("near",t),t>=this._get("far")&&(this.far=t+1e-9),this.mode="manual"}castNear(t){return Math.max(1e-8,t)}get far(){return this._get("far")}set far(t){this._set("far",t),t<=this._get("near")&&(this.near=t-1e-9),this.mode="manual"}castFar(t){return Math.max(1e-8,t)}autoUpdate(t,r){"auto"===this.mode&&(this._get("near")!==t&&this._set("near",t),this._get("far")!==r&&this._set("far",r))}};t([e({type:Number,value:1e-8})],o.prototype,"near",null),t([s("near")],o.prototype,"castNear",null),t([e({type:Number,value:1e-8})],o.prototype,"far",null),t([s("far")],o.prototype,"castFar",null),t([e({type:["auto","manual"]})],o.prototype,"mode",void 0),o=t([a("esri.views.3d.constraints.ClipDistanceConstraint")],o);export{o as ClipDistanceConstraint};