/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import o from"../../Camera.js";import{rad2deg as e,deg2rad as r}from"../../core/mathUtils.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as i,add as n}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../geometry/Point.js";import l from"../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as s}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as m}from"../../geometry/projection/projectBuffer.js";import{projectPointToVector as u}from"../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as p}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as f}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as A,viewModeDependentUtil as d}from"./support/viewingModeUtils.js";const O={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},R=[O.FINAL,O.COMPOSITE,O.OPAQUE,O.TRANSPARENT],T={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_CASTERS:"shadow-casters",SHADOW_HIGHLIGHT:"shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VOXEL:"voxel",VIEWSHED:"viewshed"},E=Array.from(Object.values(T)).concat(R);function I(o,e,r,t,i,n,a){return t=t||o.spatialReference,m(e,t,r,i,o.renderCoordsHelper.spatialReference,n,a)?i:null}function N(o,e,r,t,i,n,a){return n=n||o.spatialReference,m(e,o.renderCoordsHelper.spatialReference,r,t,n,i,a)?t:null}function g(o,e,r,i){return i||(i=t()),r=r||o.spatialReference,s(r,e,i,o.renderCoordsHelper.spatialReference)?i:null}function S(r,t,i){const n=r.renderSpatialReference,a=A(r,t.eye,t.viewForward,t.up,C);let s=r.spatialReference;return p(t.eye,n,L,s)||(s=l.WGS84,p(t.eye,n,L,s)),null==i?i=new o(new c(L,s),a.heading,a.tilt,e(t.fov)):(i.position.x=L[0],i.position.y=L[1],i.position.z=L[2],i.position.spatialReference=s,i.heading=a.heading,i.tilt=a.tilt,i.fov=e(t.fov)),i.layout.row=t.row,i.layout.rows=t.rows,i.layout.column=t.column,i.layout.columns=t.columns,i}function j(o,e){return y(o,e,void 0)}function y(o,e,t){if(!e)return null;const c=o.renderSpatialReference,l=d(o).headingTiltToDirectionUp,s=a();if(!u(e.position,s,c))return null;const m=l(s,e.heading,e.tilt);i(m.direction,m.direction,o.state.camera.distance),n(m.direction,m.direction,s);const p=f(o,s,m.direction,m.up,t);return p.fov=r(e.fov),p.row=e.layout.row,p.rows=e.layout.rows,p.column=e.layout.column,p.columns=e.layout.columns,p}const L=a(),C={heading:0,tilt:0};export{E as AllInternalRenderNodeOutputs,R as AllRenderNodeOutputs,T as InternalRenderCategory,O as RenderNodeOutput,S as fromRenderCamera,N as fromRenderCoordinates,g as renderCoordinateTransformAt,j as toRenderCamera,y as toRenderCameraWithScale,I as toRenderCoordinates};
