/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import o from"../../core/Logger.js";import{property as s,cast as a,subclass as i}from"../../core/accessorSupport/decorators.js";import{ensureClass as p}from"../../core/accessorSupport/ensureType.js";import l from"./MeshMaterial.js";import m from"./MeshMaterialMetallicRoughness.js";import{castArray as n,writeTypedArray as c}from"./meshProperties.js";var u;let h=u=class extends(e(r)){static from(t){return p(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 n(t,Uint32Array,[Uint16Array],{loggerTag:".faces=",stride:3},o.getLogger(this))}castMaterial(t){return p(t&&"object"==typeof t&&("metallic"in t||"roughness"in t||"metallicRoughnessTexture"in t)?m:l,t)}get memoryUsage(){let t=0;return null!=this.faces&&(t+=this.faces.byteLength),null!=this.material&&(t+=this.material.memoryUsage),t}};t([s({json:{write:c}})],h.prototype,"faces",void 0),t([a("faces")],h.prototype,"castFaces",null),t([s({type:l,json:{write:!0}})],h.prototype,"material",void 0),t([a("material")],h.prototype,"castMaterial",null),t([s({json:{write:!0}})],h.prototype,"name",void 0),t([s({type:String,json:{write:!0}})],h.prototype,"shading",void 0),t([s({type:Boolean})],h.prototype,"trustSourceNormals",void 0),h=u=t([i("esri.geometry.support.MeshComponent")],h);export{h as default};
