/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{generateUID as t}from"../../../../core/uid.js";import{copy as r,multiply as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{NullSphere as s,Sphere as n}from"../../../../geometry/support/sphere.js";import{maxScale as a}from"../../support/mathUtils.js";class h{constructor(r,i={}){this.geometry=r,this.screenToWorldRatio=1,this._transformation=e(),this._shaderTransformation=null,this._boundingSphere=null,this.id=t(),this.layerViewUid=i.layerViewUid,this.graphicUid=i.graphicUid,this.castShadow=i.castShadow??!1,i.objectShaderTransformation&&this.objectShaderTransformationChanged(i.objectShaderTransformation)}get transformation(){return this._transformation}set transformation(t){r(this._transformation,t),this._boundingSphere=null}get boundingInfo(){return this.geometry.boundingInfo}objectShaderTransformationChanged(t){null==t?this._shaderTransformation=null:(this._shaderTransformation??=e(),i(this._shaderTransformation,t,this.geometry.transformation)),this._boundingSphere=null}get boundingSphere(){return this.boundingInfo?(null==this._boundingSphere&&(this._boundingSphere??=new n,o(this._boundingSphere.center,this.boundingInfo.center,this.shaderTransformation),this._boundingSphere.radius=this.boundingInfo.radius*a(this.shaderTransformation)),this._boundingSphere):s}get material(){return this.geometry.material}get type(){return this.geometry.type}get shaderTransformation(){return this._shaderTransformation??this.transformation}get attributes(){return this.geometry.attributes}get positionAttribute(){return this.geometry.positionAttribute}get primitivePositionIndices(){return this.geometry.primitivePositionIndices}foreachHighlightOptions(t){this.geometry.foreachHighlightOptions(t)}get hasHighlights(){return this.geometry.hasHighlights}get occludees(){return this.geometry.occludees}get visible(){return this.geometry.visible}set visible(t){this.geometry.visible=t}}class m extends h{}export{h as RenderGeometry,m as ValidatedRenderGeometry};
