@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{_ as o}from"../../chunks/tslib.es6.js";import t from"../../core/Clonable.js";import{cyclicalDegrees as r}from"../../core/Cyclical.js";import e from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{cast as i}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{ensureNumber as a}from"../../core/accessorSupport/ensureType.js";import{computeOrientationTiltFromNormal as l,computeNormalFromOrientationTilt as p}from"./voxelPlaneUtils.js";let m=class extends(t.ClonableMixin(e)){constructor(o){super(o),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[o,t]=l(this.normal);return r.normalize(a(o),0,!0)}set orientation(o){const t=p(o,this.tilt);this._set("normal",t),this._set("orientation",o)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[o,t]=l(this.normal);return r.normalize(a(t),0,!0)}set tilt(o){const t=p(this.orientation,o);this._set("normal",t),this._set("tilt",o)}};o([s({type:Boolean,json:{default:!0,write:!0}})],m.prototype,"enabled",void 0),o([s({type:String,json:{write:!0}})],m.prototype,"label",void 0),o([s({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),i((o=>r.normalize(a(o),0,!0)))],m.prototype,"orientation",null),o([s({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),i((o=>r.normalize(a(o),0,!0)))],m.prototype,"tilt",null),o([s({type:[Number],json:{write:{isRequired:!0}}})],m.prototype,"normal",void 0),o([s({type:[Number],json:{write:{isRequired:!0}}})],m.prototype,"point",void 0),m=o([n("esri.layers.voxel.VoxelDynamicSection")],m);export{m as default};