UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 2.04 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as e}from"tslib";import r from"../../Color.js";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as l,subclass as s}from"../../core/accessorSupport/decorators.js";import n from"./MeshTexture.js";import u from"./MeshTextureTransform.js";import{getMeshMaterialCloneContext as i,addMeshTextureCloneContext as a}from"./meshUtils/meshCloneUtils.js";let m=class extends(o(t)){constructor(e){super(e),this.color=null,this.colorTextureTransform=null,this.normalTextureTransform=void 0,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}get colorTexture(){return this._get("colorTexture")}set colorTexture(e){this._set("colorTexture",null==e?null:n.from(e))}get normalTexture(){return this._get("normalTexture")}set normalTexture(e){this._set("normalTexture",null==e?null:n.from(e))}clone(e){const r=i(e),o=r?.materialMap?.get(this);if(o)return o;const t=super.clone(a(e));return r?.materialMap?.set(this,t),t}get memoryUsage(){return this.getMemoryUsage()}getMemoryUsage(){let e=0;return e+=null!=this.color?16:0,null!=this.colorTexture&&(e+=this.colorTexture.memoryUsage),e+=null!=this.colorTextureTransform?20:0,null!=this.normalTexture&&(e+=this.normalTexture.memoryUsage),e+=null!=this.normalTextureTransform?20:0,e}};e([l({type:r,json:{write:!0}})],m.prototype,"color",void 0),e([l({type:n,json:{write:!0},value:null})],m.prototype,"colorTexture",null),e([l({type:u,json:{write:!0}})],m.prototype,"colorTextureTransform",void 0),e([l({type:n,json:{write:!0},value:null})],m.prototype,"normalTexture",null),e([l({type:u,json:{write:!0}})],m.prototype,"normalTextureTransform",void 0),e([l({nonNullable:!0,json:{write:!0}})],m.prototype,"alphaMode",void 0),e([l({nonNullable:!0,json:{write:!0}})],m.prototype,"alphaCutoff",void 0),e([l({nonNullable:!0,json:{write:!0}})],m.prototype,"doubleSided",void 0),m=e([s("esri.geometry.support.MeshMaterial")],m);export{m as default};