@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.83 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{c as r}from"../../../../chunks/vec42.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Object3DVisualElement as t}from"./Object3DVisualElement.js";import{createSquareGeometry as i}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as a}from"../../webgl-engine/lib/Material.js";import{SlicePlaneMaterial as s}from"../../webgl-engine/materials/SlicePlaneMaterial.js";class d extends t{constructor(r){super(r),this._material=null,this._renderOccluded=a.OccludeAndTransparent,this._gridWidth=1,this._gridColor=e(1,0,0,1),this._backgroundColor=e(1,0,0,1),this.applyProperties(r)}get renderOccluded(){return this._renderOccluded}set renderOccluded(r){r!==this._renderOccluded&&(this._renderOccluded=r,this._updateMaterial())}get gridWidth(){return this._gridWidth}set gridWidth(r){this._gridWidth!==r&&(this._gridWidth=r,this._updateMaterial())}get gridColor(){return this._gridColor}set gridColor(e){r(this._gridColor,e),this._updateMaterial()}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){r(this._backgroundColor,e),this._updateMaterial()}createExternalResources(){this._material=new s(this._materialParameters)}destroyExternalResources(){this._material=null}forEachMaterial(r){r(this._material)}createGeometries(r){if(null!=this._material){const e=i(this._material);r.addGeometry(e)}}get _materialParameters(){return{backgroundColor:this._backgroundColor,gridWidth:this._gridWidth,gridColor:this._gridColor,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateMaterial(){this._material?.setParameters(this._materialParameters)}}export{d as SlicePlaneVisualElement};