UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.14 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/JSONSupport.js";import{clone as e}from"../../core/lang.js";import s from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../../core/accessorSupport/ensureType.js";import n from"./MeshMaterial.js";import l from"./MeshMaterialMetallicRoughness.js";import{castArray as m,writeTypedArray as p}from"./meshProperties.js";var u;let h=u=class extends r{static from(t){return c(u,t)}constructor(t){super(t),this.faces=null,this.material=null,this.name=void 0,this.shading="source",this.trustSourceNormals=!1}castFaces(t){return m(t,Uint32Array,[Uint16Array],{loggerTag:".faces=",stride:3},s.getLogger(this))}castMaterial(t){return c(t&&"object"==typeof t&&("metallic"in t||"roughness"in t||"metallicRoughnessTexture"in t)?l:n,t)}clone(){return new u({faces:e(this.faces),shading:this.shading,material:e(this.material),trustSourceNormals:this.trustSourceNormals,name:this.name})}cloneWithDeduplication(t,r){const s={faces:e(this.faces),shading:this.shading,material:this.material?this.material.cloneWithDeduplication(t,r):null,trustSourceNormals:this.trustSourceNormals,name:this.name};return new u(s)}get memoryUsage(){let t=0;return null!=this.faces&&(t+=this.faces.byteLength),null!=this.material&&(t+=this.material.memoryUsage),t}};t([o({json:{write:p}})],h.prototype,"faces",void 0),t([a("faces")],h.prototype,"castFaces",null),t([o({type:n,json:{write:!0}})],h.prototype,"material",void 0),t([a("material")],h.prototype,"castMaterial",null),t([o({json:{write:!0}})],h.prototype,"name",void 0),t([o({type:String,json:{write:!0}})],h.prototype,"shading",void 0),t([o({type:Boolean})],h.prototype,"trustSourceNormals",void 0),h=u=t([i("esri.geometry.support.MeshComponent")],h);export{h as default};