/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../core/maybe","../../../../chunks/vec4","../../../../chunks/vec4f64","./Object3DVisualElement","../../webgl-engine/lib/GeometryUtil","../../webgl-engine/lib/Material","../../webgl-engine/materials/SlicePlaneMaterial"],(function(e,t,r,i,a,l,n,o,s){"use strict";let c=function(e){function l(t){var r;return(r=e.call(this,t)||this)._material=null,r._renderOccluded=o.RenderOccludedFlag.OccludeAndTransparent,r._gridWidth=1,r._gridColor=a.fromValues(1,0,0,1),r._backgroundColor=a.fromValues(1,0,0,1),r.applyProps(t),r}t._inheritsLoose(l,e);var c=l.prototype;return c.createExternalResources=function(){this._material=new s.SlicePlaneMaterial(this.materialParameters)},c.destroyExternalResources=function(){this._material=null},c.forEachExternalMaterial=function(e){r.isSome(this._material)&&e(this._material)},c.createGeometries=function(e){if(r.isSome(this._material)){const t=n.createSquareGeometry();e.addGeometry(t,this._material)}},c._updateMaterial=function(){r.isSome(this._material)&&this._material.setParameters(this.materialParameters)},t._createClass(l,[{key:"renderOccluded",get:function(){return this._renderOccluded},set:function(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}},{key:"gridWidth",get:function(){return this._gridWidth},set:function(e){this._gridWidth!==e&&(this._gridWidth=e,this._updateMaterial())}},{key:"gridColor",get:function(){return this._gridColor},set:function(e){i.copy(this._gridColor,e),this._updateMaterial()}},{key:"backgroundColor",get:function(){return this._backgroundColor},set:function(e){i.copy(this._backgroundColor,e),this._updateMaterial()}},{key:"materialParameters",get:function(){return{backgroundColor:this._backgroundColor,gridWidth:this._gridWidth,gridColor:this._gridColor,renderOccluded:this._renderOccluded}}}]),l}(l.Object3DVisualElement);e.SlicePlaneVisualElement=c,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
