@arcgis/core 4.28.0-rc.2 → 4.28.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{0e354096ad8817971eed.js → 02d235849ba93541d7ad.js} +1 -1
  3. package/assets/esri/core/workers/chunks/0422c5160491fbcf01dc.js +1 -0
  4. package/assets/esri/core/workers/chunks/224e79f6c172da444e0a.js +1 -0
  5. package/assets/esri/core/workers/chunks/{ca3d5803cdf035d7389d.js → 30776102fbab294bfe7b.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{61dec8399919b278b636.js → 3ac9001b19a90faf5573.js} +1 -1
  7. package/assets/esri/core/workers/chunks/41081c921037e543a22f.js +1 -0
  8. package/assets/esri/core/workers/chunks/4564a7885d045a850887.js +1 -0
  9. package/assets/esri/core/workers/chunks/4adf3a8c6b49c381a633.js +1 -0
  10. package/assets/esri/core/workers/chunks/{2721aa6b6941b28b9758.js → 63c8bf00120a4e67f5b0.js} +1 -1
  11. package/assets/esri/core/workers/chunks/74951370a341f02d3714.js +1 -0
  12. package/assets/esri/core/workers/chunks/{fa6103e3d4e857b0035b.js → 78e2fa121760383b08ec.js} +9 -6
  13. package/assets/esri/core/workers/chunks/7b8377b3a9f78f9d3613.js +1 -0
  14. package/assets/esri/core/workers/chunks/{fd28400141a6751327ae.js → 7cf7f2b991a7cbdad2ce.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{1a723bb4a341f645e5fe.js → 83b8141f0c80e3448012.js} +1 -1
  16. package/assets/esri/core/workers/chunks/934c32c49bb9e21482fd.js +1 -0
  17. package/assets/esri/core/workers/chunks/969a82b674eda9f8720f.js +1 -0
  18. package/assets/esri/core/workers/chunks/a1e16c33f1843dbdce26.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d07235ce2765a25b9be4.js → a50ec5b647a160199cb2.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{77923afde29ae1ff10ca.js → b6e86e179f99b5cf8dff.js} +1 -1
  21. package/assets/esri/core/workers/chunks/c3ddf5dbc34f118002df.js +1 -0
  22. package/assets/esri/core/workers/chunks/{7b3d5f044c96e2c2af11.js → d191267d91a53db42956.js} +1 -1
  23. package/assets/esri/core/workers/chunks/ffa330a19a09679212fb.js +1 -0
  24. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +3 -9
  25. package/assets/esri/themes/base/widgets/_Legend.scss +1 -1
  26. package/assets/esri/themes/base/widgets/_TimeZoneLabel.scss +3 -3
  27. package/assets/esri/themes/dark/main.css +1 -1
  28. package/assets/esri/themes/light/main.css +1 -1
  29. package/assets/esri/themes/light/view.css +1 -1
  30. package/geometry/support/meshUtils/georeference.js +1 -1
  31. package/interfaces.d.ts +1254 -262
  32. package/kernel.js +1 -1
  33. package/layers/GroupLayer.js +1 -1
  34. package/layers/SceneLayer.js +1 -1
  35. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  36. package/layers/graphics/data/queryValidationUtils.js +1 -1
  37. package/layers/mixins/ArcGISMapService.js +1 -1
  38. package/layers/save/groupLayerUtils.js +1 -1
  39. package/layers/save/utils.js +1 -1
  40. package/layers/support/ImageElement.js +1 -1
  41. package/layers/support/Sublayer.js +1 -1
  42. package/layers/support/Subtype.d.ts +4 -0
  43. package/layers/support/Subtype.js +1 -1
  44. package/layers/support/imageryRendererUtils.js +1 -1
  45. package/networks/Network.js +1 -1
  46. package/package.json +1 -1
  47. package/portal/support/jsonContext.js +1 -1
  48. package/portal/support/layersLoader.js +1 -1
  49. package/rest/featureService/FeatureService.d.ts +4 -0
  50. package/rest/featureService/FeatureService.js +1 -1
  51. package/rest/featureService/utils.d.ts +4 -0
  52. package/rest/query/operations/query.js +1 -1
  53. package/support/basemapUtils.js +1 -1
  54. package/support/revision.js +1 -1
  55. package/versionManagement/VersionManagementService.d.ts +4 -0
  56. package/versionManagement/VersionManagementService.js +1 -1
  57. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  58. package/views/2d/engine/webgl/Overlay.js +1 -1
  59. package/views/2d/input/handlers/KeyPan.js +1 -1
  60. package/views/2d/interactive/editingTools/manipulations/DragManipulation.js +1 -1
  61. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  62. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  63. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  64. package/views/3d/layers/I3SMeshView3D.js +1 -1
  65. package/views/3d/layers/MediaLayerView3D.js +1 -1
  66. package/views/3d/layers/SceneLayerWorker.js +1 -1
  67. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  68. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  69. package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
  70. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  71. package/views/3d/support/MemoryController.js +1 -1
  72. package/views/3d/support/PBFDecoder.js +1 -1
  73. package/views/3d/support/ResourceController.js +1 -1
  74. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  75. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  76. package/views/3d/webgl-engine/core/FBOPool.js +5 -0
  77. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +9 -6
  78. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  79. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  80. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  81. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  82. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  83. package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
  84. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  85. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  86. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  87. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +1 -1
  88. package/views/draw/DrawOperation.js +1 -1
  89. package/views/draw/support/Reshape.js +1 -1
  90. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  91. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  92. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  93. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  94. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  95. package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
  96. package/widgets/BasemapGallery.js +1 -1
  97. package/widgets/DirectionalPad.js +1 -1
  98. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  99. package/widgets/Editor/EditorViewModel.js +1 -1
  100. package/widgets/Editor/UpdateWorkflow.js +1 -1
  101. package/widgets/Editor/workflowUtils.js +1 -1
  102. package/widgets/FeatureForm.js +1 -1
  103. package/widgets/Features.js +1 -1
  104. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  105. package/widgets/OrientedImageryViewer.js +1 -1
  106. package/widgets/TimeSlider.js +1 -1
  107. package/widgets/TimeZoneLabel.js +1 -1
  108. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  109. package/widgets/UtilityNetworkTrace.js +1 -1
  110. package/assets/esri/core/workers/chunks/00da3c16741a9bc47f3a.js +0 -1
  111. package/assets/esri/core/workers/chunks/0e4646d14fa0775bf463.js +0 -1
  112. package/assets/esri/core/workers/chunks/4e0bf30da4281070e453.js +0 -1
  113. package/assets/esri/core/workers/chunks/51b8913dff24e693bd25.js +0 -1
  114. package/assets/esri/core/workers/chunks/5e907ec0ee1565b5fbbc.js +0 -1
  115. package/assets/esri/core/workers/chunks/7388fd97e7b1a2142744.js +0 -1
  116. package/assets/esri/core/workers/chunks/92d8f75e616afa5c761e.js +0 -1
  117. package/assets/esri/core/workers/chunks/a877a4826cd6a46ec99b.js +0 -1
  118. package/assets/esri/core/workers/chunks/b251d8a856dc8b9406e0.js +0 -1
  119. package/assets/esri/core/workers/chunks/d8c696da42f8f8919b83.js +0 -1
  120. package/assets/esri/core/workers/chunks/fac3e57784d7f37053af.js +0 -1
  121. package/assets/esri/core/workers/chunks/fc95b1a36ed68b851400.js +0 -1
  122. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +0 -4
  123. package/widgets/DirectionalPad.d.ts +0 -4
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../geometry/SpatialReference.js";import{toFloat64Array as r}from"../../../geometry/support/DoubleArray.js";import t from"../../../geometry/support/MeshGeoreferencedRelativeVertexSpace.js";import o from"../../../geometry/support/MeshLocalVertexSpace.js";import{a as n,n as s}from"../../../chunks/vec32.js";import{IndexType as i}from"../../../libs/i3s/enums.js";import{get as a}from"../../../libs/i3s/I3SModule.js";import{NodeIMModificationImpact as f}from"./i3s/I3SNode.js";async function c(e){g=await j();const r=[e.geometryBuffer];return{result:w(g,e,r),transferList:r}}async function l(e){g=await j();const r=[e.geometryBuffer],{geometryBuffer:t}=e,o=t.byteLength,n=g._malloc(o),s=new Uint8Array(g.HEAPU8.buffer,n,o);s.set(new Uint8Array(t));const i=g.dracoDecompressPointCloudData(n,s.byteLength);if(g._free(n),i.error.length>0)throw new Error(`i3s.wasm: ${i.error}`);const a=i.featureIds?.length>0?i.featureIds.slice():null,f=i.positions.slice();return a&&r.push(a.buffer),r.push(f.buffer),{result:{positions:f,featureIds:a},transferList:r}}async function u(e){await j(),L(e);const r={buffer:e.buffer};return{result:r,transferList:[r.buffer]}}async function m(e){await j(),E(e)}async function y(e){g=await j(),g.setLegacySchema(e.context,e.jsonSchema)}async function p(n){const{localMatrix:s,origin:i,positions:a,vertexSpace:f}=n,c=e.fromJSON(n.inSpatialReference),l=e.fromJSON(n.outSpatialReference);let u;if("georeferenced"===f.type){const[{projectBuffer:e},{initializeProjection:r}]=await Promise.all([import("../../../geometry/projection/projectBuffer.js"),import("../../../geometry/projection.js")]);await r(c,l),u=new Float64Array(a.length),e(a,c,0,u,l,0,u.length/3)}else{const e="georeferencedRelative"===f.type?t.fromJSON(f):o.fromJSON(f),{project:n}=await import("../../../geometry/support/meshUtils/georeference.js");u=r(n({positions:a,transform:s?{localMatrix:s}:void 0,vertexSpace:e,inSpatialReference:c,outSpatialReference:l}))}const m=u.length,[y,p,d]=i;for(let e=0;e<m;e+=3)u[e]-=y,u[e+1]-=p,u[e+2]-=d;return{result:{projected:u,original:a},transferList:[u.buffer,a.buffer]}}async function d({normalMatrix:e,normals:r}){const t=new Float32Array(r.length);return n(t,r,e),s(t,t),{result:{transformed:t,original:r},transferList:[t.buffer,r.buffer]}}function b(e){S(e)}let h,g;function E(e){if(!g)return;const r=e.modifications,t=g._malloc(8*r.length),o=new Float64Array(g.HEAPU8.buffer,t,r.length);for(let n=0;n<r.length;++n)o[n]=r[n];g.setModifications(e.context,t,r.length,e.isGeodetic),g._free(t)}function w(e,r,t){const{context:o,localOrigin:n,globalTrafo:s,mbs:a,obb:f,elevationOffset:c,geometryBuffer:l,geometryDescriptor:u,indexToVertexProjector:m,vertexToRenderProjector:y}=r,p=e._malloc(l.byteLength),d=33,b=e._malloc(d*Float64Array.BYTES_PER_ELEMENT),h=new Uint8Array(e.HEAPU8.buffer,p,l.byteLength);h.set(new Uint8Array(l));const g=new Float64Array(e.HEAPU8.buffer,b,d);_(g,n);let E=g.byteOffset+3*g.BYTES_PER_ELEMENT,w=new Float64Array(g.buffer,E);_(w,s),E+=16*g.BYTES_PER_ELEMENT,w=new Float64Array(g.buffer,E),_(w,a),E+=4*g.BYTES_PER_ELEMENT,null!=f&&(w=new Float64Array(g.buffer,E),_(w,f.center),E+=3*g.BYTES_PER_ELEMENT,w=new Float64Array(g.buffer,E),_(w,f.halfSize),E+=3*g.BYTES_PER_ELEMENT,w=new Float64Array(g.buffer,E),_(w,f.quaternion));const A=u,L={isDraco:!1,isLegacy:!1,color:r.layouts.some((e=>e.some((e=>"color"===e.name)))),normal:r.needNormals&&r.layouts.some((e=>e.some((e=>"normalCompressed"===e.name)))),uv0:r.layouts.some((e=>e.some((e=>"uv0"===e.name)))),uvRegion:r.layouts.some((e=>e.some((e=>"uvRegion"===e.name)))),featureIndex:A.featureIndex},S=e.process(o,!!r.obb,p,h.byteLength,A,L,b,c,m,y,r.normalReferenceFrame);if(e._free(b),e._free(p),S.error.length>0)throw new Error(`i3s.wasm: ${S.error}`);if(S.discarded)return null;const I=S.componentOffsets.length>0?S.componentOffsets.slice():null,j=S.featureIds.length>0?S.featureIds.slice():null,P=S.anchorIds.length>0?Array.from(S.anchorIds):null,T=S.anchors.length>0?Array.from(S.anchors):null,x=S.interleavedVertedData.slice().buffer,R=S.indicesType===i.Int16?new Uint16Array(S.indices.buffer,S.indices.byteOffset,S.indices.byteLength/2).slice():new Uint32Array(S.indices.buffer,S.indices.byteOffset,S.indices.byteLength/4).slice(),M=S.positions.slice(),U=S.positionIndicesType===i.Int16?new Uint16Array(S.positionIndices.buffer,S.positionIndices.byteOffset,S.positionIndices.byteLength/2).slice():new Uint32Array(S.positionIndices.buffer,S.positionIndices.byteOffset,S.positionIndices.byteLength/4).slice(),v={layout:r.layouts[0],interleavedVertexData:x,indices:R,hasColors:S.hasColors,hasModifications:S.hasModifications,positionData:{data:M,indices:U}};return j&&t.push(j.buffer),I&&t.push(I.buffer),t.push(x),t.push(R.buffer),t.push(M.buffer),t.push(U.buffer),{componentOffsets:I,featureIds:j,anchorIds:P,anchors:T,transformedGeometry:v,obb:S.obb}}function A(e){return 0===e?f.Unmodified:1===e?f.PotentiallyModified:2===e?f.Culled:f.Unknown}function L(e){if(!g)return;const{context:r,buffer:t}=e,o=g._malloc(t.byteLength),n=t.byteLength/Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(g.HEAPU8.buffer,o,n),i=new Float64Array(t);s.set(i),g.filterOBBs(r,o,n),i.set(s),g._free(o)}function S(e){g&&0===g.destroy(e)&&(g=null)}function _(e,r){for(let t=0;t<r.length;++t)e[t]=r[t]}async function I(){g||await j()}function j(){return g?Promise.resolve(g):(h||(h=a().then((e=>(g=e,h=null,g)))),h)}const P={transform:(e,r)=>g&&w(g,e,r),destroy:S};export{b as destroyContext,l as dracoDecompressPointCloudData,u as filterObbsForModifications,L as filterObbsForModificationsSync,I as initialize,A as interpretObbModificationResults,c as process,p as project,y as setLegacySchema,m as setModifications,E as setModificationsSync,P as test,d as transformNormals};
5
+ import e from"../../../geometry/SpatialReference.js";import{toFloat64Array as r}from"../../../geometry/support/DoubleArray.js";import t from"../../../geometry/support/MeshGeoreferencedRelativeVertexSpace.js";import o from"../../../geometry/support/MeshLocalVertexSpace.js";import{a as n,n as s}from"../../../chunks/vec32.js";import{IndexType as i}from"../../../libs/i3s/enums.js";import{get as a}from"../../../libs/i3s/I3SModule.js";import{NodeIMModificationImpact as f}from"./i3s/I3SNode.js";async function l(e){g=await j();const r=[e.geometryBuffer];return{result:w(g,e,r),transferList:r}}async function c(e){g=await j();const r=[e.geometryBuffer],{geometryBuffer:t}=e,o=t.byteLength,n=g._malloc(o),s=new Uint8Array(g.HEAPU8.buffer,n,o);s.set(new Uint8Array(t));const i=g.dracoDecompressPointCloudData(n,s.byteLength);if(g._free(n),i.error.length>0)throw new Error(`i3s.wasm: ${i.error}`);const a=i.featureIds?.length>0?i.featureIds.slice():null,f=i.positions.slice();return a&&r.push(a.buffer),r.push(f.buffer),{result:{positions:f,featureIds:a},transferList:r}}async function u(e){await j(),L(e);const r={buffer:e.buffer};return{result:r,transferList:[r.buffer]}}async function m(e){await j(),E(e)}async function y(e){g=await j(),g.setLegacySchema(e.context,e.jsonSchema)}async function p(n){const{localMatrix:s,origin:i,positions:a,vertexSpace:f,localMode:l}=n,c=e.fromJSON(n.inSpatialReference),u=e.fromJSON(n.outSpatialReference);let m;if("georeferenced"===f.type){const[{projectBuffer:e},{initializeProjection:r}]=await Promise.all([import("../../../geometry/projection/projectBuffer.js"),import("../../../geometry/projection.js")]);await r(c,u),m=new Float64Array(a.length),e(a,c,0,m,u,0,m.length/3)}else{const e="georeferencedRelative"===f.type?t.fromJSON(f):o.fromJSON(f),{project:n}=await import("../../../geometry/support/meshUtils/georeference.js");m=r(n({positions:a,transform:s?{localMatrix:s}:void 0,vertexSpace:e,inSpatialReference:c,outSpatialReference:u,localMode:l}))}const y=m.length,[p,d,b]=i;for(let e=0;e<y;e+=3)m[e]-=p,m[e+1]-=d,m[e+2]-=b;return{result:{projected:m,original:a},transferList:[m.buffer,a.buffer]}}async function d({normalMatrix:e,normals:r}){const t=new Float32Array(r.length);return n(t,r,e),s(t,t),{result:{transformed:t,original:r},transferList:[t.buffer,r.buffer]}}function b(e){S(e)}let h,g;function E(e){if(!g)return;const r=e.modifications,t=g._malloc(8*r.length),o=new Float64Array(g.HEAPU8.buffer,t,r.length);for(let n=0;n<r.length;++n)o[n]=r[n];g.setModifications(e.context,t,r.length,e.isGeodetic),g._free(t)}function w(e,r,t){const{context:o,localOrigin:n,globalTrafo:s,mbs:a,obb:f,elevationOffset:l,geometryBuffer:c,geometryDescriptor:u,indexToVertexProjector:m,vertexToRenderProjector:y}=r,p=e._malloc(c.byteLength),d=33,b=e._malloc(d*Float64Array.BYTES_PER_ELEMENT),h=new Uint8Array(e.HEAPU8.buffer,p,c.byteLength);h.set(new Uint8Array(c));const g=new Float64Array(e.HEAPU8.buffer,b,d);_(g,n);let E=g.byteOffset+3*g.BYTES_PER_ELEMENT,w=new Float64Array(g.buffer,E);_(w,s),E+=16*g.BYTES_PER_ELEMENT,w=new Float64Array(g.buffer,E),_(w,a),E+=4*g.BYTES_PER_ELEMENT,null!=f&&(w=new Float64Array(g.buffer,E),_(w,f.center),E+=3*g.BYTES_PER_ELEMENT,w=new Float64Array(g.buffer,E),_(w,f.halfSize),E+=3*g.BYTES_PER_ELEMENT,w=new Float64Array(g.buffer,E),_(w,f.quaternion));const A=u,L={isDraco:!1,isLegacy:!1,color:r.layouts.some((e=>e.some((e=>"color"===e.name)))),normal:r.needNormals&&r.layouts.some((e=>e.some((e=>"normalCompressed"===e.name)))),uv0:r.layouts.some((e=>e.some((e=>"uv0"===e.name)))),uvRegion:r.layouts.some((e=>e.some((e=>"uvRegion"===e.name)))),featureIndex:A.featureIndex},S=e.process(o,!!r.obb,p,h.byteLength,A,L,b,l,m,y,r.normalReferenceFrame);if(e._free(b),e._free(p),S.error.length>0)throw new Error(`i3s.wasm: ${S.error}`);if(S.discarded)return null;const I=S.componentOffsets.length>0?S.componentOffsets.slice():null,j=S.featureIds.length>0?S.featureIds.slice():null,M=S.anchorIds.length>0?Array.from(S.anchorIds):null,P=S.anchors.length>0?Array.from(S.anchors):null,T=S.interleavedVertedData.slice().buffer,x=S.indicesType===i.Int16?new Uint16Array(S.indices.buffer,S.indices.byteOffset,S.indices.byteLength/2).slice():new Uint32Array(S.indices.buffer,S.indices.byteOffset,S.indices.byteLength/4).slice(),R=S.positions.slice(),U=S.positionIndicesType===i.Int16?new Uint16Array(S.positionIndices.buffer,S.positionIndices.byteOffset,S.positionIndices.byteLength/2).slice():new Uint32Array(S.positionIndices.buffer,S.positionIndices.byteOffset,S.positionIndices.byteLength/4).slice(),v={layout:r.layouts[0],interleavedVertexData:T,indices:x,hasColors:S.hasColors,hasModifications:S.hasModifications,positionData:{data:R,indices:U}};return j&&t.push(j.buffer),I&&t.push(I.buffer),t.push(T),t.push(x.buffer),t.push(R.buffer),t.push(U.buffer),{componentOffsets:I,featureIds:j,anchorIds:M,anchors:P,transformedGeometry:v,obb:S.obb}}function A(e){return 0===e?f.Unmodified:1===e?f.PotentiallyModified:2===e?f.Culled:f.Unknown}function L(e){if(!g)return;const{context:r,buffer:t}=e,o=g._malloc(t.byteLength),n=t.byteLength/Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(g.HEAPU8.buffer,o,n),i=new Float64Array(t);s.set(i),g.filterOBBs(r,o,n),i.set(s),g._free(o)}function S(e){g&&0===g.destroy(e)&&(g=null)}function _(e,r){for(let t=0;t<r.length;++t)e[t]=r[t]}async function I(){g||await j()}function j(){return g?Promise.resolve(g):(h||(h=a().then((e=>(g=e,h=null,g)))),h)}const M={transform:(e,r)=>g&&w(g,e,r),destroy:S};export{b as destroyContext,c as dracoDecompressPointCloudData,u as filterObbsForModifications,L as filterObbsForModificationsSync,I as initialize,A as interpretObbModificationResults,l as process,p as project,y as setLegacySchema,m as setModifications,E as setModificationsSync,M as test,d as transformNormals};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import"../../../../core/has.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{f as r,t as o}from"../../../../chunks/mat3.js";import{a}from"../../../../chunks/mat3f64.js";import{d as s,m as n,i,B as l}from"../../../../chunks/mat4.js";import{a as c,I as u,b as m}from"../../../../chunks/mat4f64.js";import{s as h,g as f,i as p,j as d,n as g,f as x,b as _}from"../../../../chunks/vec3.js";import{Z as T,O as y,c as b}from"../../../../chunks/vec3f64.js";import{O as v}from"../../../../chunks/vec4f64.js";import{canProjectWithoutEngine as C}from"../../../../geometry/projection.js";import{computeTranslationToOriginAndRotation as w}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as j}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToDehydratedPoint as O}from"../../../../geometry/projection/projectVectorToDehydratedPoint.js";import{create as M,empty as P,expandWithBuffer as R,intersectsClippingArea as A}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as E}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as I,getZeroIndexArray as N}from"../../../../geometry/support/Indices.js";import B from"../../../../geometry/support/MeshComponent.js";import F from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import S from"../../../../geometry/support/MeshTextureTransform.js";import{t as U,a as L}from"../../../../chunks/vec32.js";import{project as $}from"../../../../geometry/support/meshUtils/georeference.js";import{transformNormal as G,projectNormalToPCPF as V,transformTangent as D,projectTangentToPCPF as k}from"../../../../geometry/support/meshUtils/projection.js";import{makeDehydratedPoint as H}from"../../../../layers/graphics/dehydratedPoint.js";import{MeshTransformUpdateAction as q}from"../../../../layers/graphics/sources/interfaces.js";import{ViewingMode as W}from"../../../ViewingMode.js";import{isEncodedMeshTexture as z}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as Y}from"../../glTF/internal/TextureTransformUtils.js";import{perObjectElevationAligner as Z}from"./ElevationAligners.js";import{needsElevationUpdates3D as J,evaluateElevationInfoAtPoint as K}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as Q}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as X}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as ee}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as te,MeshFastUpdateProcessor as re}from"./MeshFastUpdateProcessor.js";import{createMaterial as oe}from"../support/edgeUtils.js";import{parseColorMixMode as ae,encodeSymbolColor as se}from"../support/symbolColorUtils.js";import{debugFlags as ne}from"../../support/debugFlags.js";import{Attribute as ie}from"../../webgl-engine/lib/Attribute.js";import{AlphaDiscardMode as le,CullFaceOptions as ce}from"../../webgl-engine/lib/basicInterfaces.js";import{ContentObjectType as ue}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as me}from"../../webgl-engine/lib/Geometry.js";import{Object3D as he}from"../../webgl-engine/lib/Object3D.js";import{Texture as fe}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as pe}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as de}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as ge}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as xe,defaultSchematicMRRFactors as _e,defaultAdvancedMRRFactors as Te}from"../../webgl-engine/materials/pbrUtils.js";import{TextureWrapMode as ye}from"../../../webgl/enums.js";const be=["mesh"];class ve extends ee{constructor(e,t,r,o){super(e,t,r,o),this._materialInfoCache=new te,this._fastUpdateProcessor=new re,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){ne.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new ge({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new ge({color:[0,1,1,1]}))}destroy(){super.destroy(),this._textures.forEach((e=>e.unload())),this._context.stage.removeMany(this._materialInfoCache.materials),this._context.stage.removeMany(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy(this._context.stage)}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,be,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache,this._context)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters((e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>t(e)?.layerOpacityChanged(r,this._context.isAsync)))}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,J)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters((({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),e.forEach((e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync))),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters((({material:t})=>t.setParameters({usePBR:e}))),!0}updateTransform(e,t,r,o){const a=this._context.renderCoordsHelper.spatialReference,s=Ee,{origin:n,transform:i}=r;switch(w(t,h(je,n.x,n.y,n.z??0),s,a),o){case q.EnableFastUpdates:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case q.DisableFastUpdates:this._fastUpdateProcessor.disable(e,this._materialInfoCache,this._context);break;case q.UpdateFastLocalOrigin:e.updateFastLocalOrigin(s,i,this._context.localOriginFactory)}const{elevationContext:l}=e;l.centerPointInElevationSR=this._getCenterPointInElevationSR(s);const{elevationProvider:c,renderCoordsHelper:u}=this._context,m=(e,t)=>K(e,c,l,u,t);return e.alignedSampledElevation=Z(e,l,c.spatialReference,m,u,s),e.updateTransform(s,i,this._context.isAsync),!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,a=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:a,uid:`vc:${o},vt:${a},vct${t},svc:${r}`}}_textureTransformUid(e){const{offset:t,scale:r,rotation:o}=e??Be;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:a,colorTexture:s,colorTextureTransform:n,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,h=this._colorOrTextureUid(a),f=this._colorOrTextureUid(s),p=this._textureTransformUid(n),d=this._colorOrTextureUid(i),g=this._textureTransformUid(l);if(o.color=a,o.colorTexture=s,o.normalTexture=i,o.uid=`${o.uid},cmuid:${h},ctmuid:${f},cttuid:${p},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof F){const{metallic:e,roughness:r,metallicRoughnessTexture:a,metallicRoughnessTextureTransform:s,emissiveColor:i,emissiveTexture:c,emissiveTextureTransform:u,occlusionTexture:m,occlusionTextureTransform:h}=t.material,f=this._colorOrTextureUid(a),p=this._textureTransformUid(s),d=this._colorOrTextureUid(i),g=this._colorOrTextureUid(c),x=this._textureTransformUid(u),_=this._colorOrTextureUid(m),T=this._textureTransformUid(h);o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=a,o.emissiveColor=i,o.emissiveTexture=c,o.occlusionTexture=m,o.colorTextureTransform=this._convertTextureTransform(n),o.normalTextureTransform=this._convertTextureTransform(l),o.emissiveTextureTransform=this._convertTextureTransform(u),o.occlusionTextureTransform=this._convertTextureTransform(h),o.metallicRoughnessTextureTransform=this._convertTextureTransform(s),o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${f},mrtt:${p},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${T}`}return o}_convertTextureTransform(e){if(!e)return null;const{scale:r,offset:o,rotation:a}=e;return{scale:r,offset:o,rotation:t(a)}}_setInternalColorValueParameters(t,r){r.diffuse=e.toUnitRGB(t),r.opacity=t.a}_getLoadableTextureResource(e){return e.data??e.url}_getInternalTextureId(e){const t=this._getInternalTexture(e,le.Opaque);return t?.id}_getInternalTexture(e,t){const r=this._getLoadableTextureResource(e);if(!r)return null;const o=`${e.contentHash}/${t}`;let a=this._textures.get(o);if(!a){let s=null;const n=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,i={wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,maxAnisotropy:n,mipmap:n>1};z(r)?(s=r.data,i.preMultiplyAlpha=!1,i.encoding=r.encoding):(s=r,i.preMultiplyAlpha=t!==le.Opaque,i.downsampleUncompressed=this._context.graphicsCoreOwner.view.qualitySettings.graphics3D.uncompressedTextureDownsamplingEnabled),a=new fe(s,i),this._textures.set(o,a),a.load(this._context.stage.renderView.renderingContext),this._context.stage.add(a)}return a}_castTextureWrap(e="repeat"){if("string"==typeof e){const t=this._castTextureWrapIndividual(e);return{s:t,t}}return{s:this._castTextureWrapIndividual(e.horizontal),t:this._castTextureWrapIndividual(e.vertical)}}_castTextureWrapIndividual(e){switch(e){case"clamp":return ye.CLAMP_TO_EDGE;case"mirror":return ye.MIRRORED_REPEAT;default:return ye.REPEAT}}_setInternalMaterialParameters(t,r){if(null!=t.color&&this._setInternalColorValueParameters(t.color,r),null!=t.colorTexture){const e=this._getInternalTexture(t.colorTexture,r.textureAlphaMode);e?(r.textureId=e.id,r.textureAlphaPremultiplied=!!e.parameters.preMultiplyAlpha):r.textureId=void 0}t.normalTexture&&(r.normalTextureId=this._getInternalTextureId(t.normalTexture)),t.emissiveColor&&(r.emissiveFactor=e.toUnitRGB(t.emissiveColor)),t.emissiveTexture&&(r.emissiveTextureId=this._getInternalTextureId(t.emissiveTexture)),t.occlusionTexture&&(r.occlusionTextureId=this._getInternalTextureId(t.occlusionTexture)),t.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTextureId(t.metallicRoughnessTexture)),r.colorTextureTransformMatrix=Y(t.colorTextureTransform),r.normalTextureTransformMatrix=Y(t.normalTextureTransform),r.occlusionTextureTransformMatrix=Y(t.occlusionTextureTransform),r.emissiveTextureTransformMatrix=Y(t.emissiveTextureTransform),r.metallicRoughnessTextureTransformMatrix=Y(t.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t){const r=this._drivenProperties.color;let o=this.symbolLayer.material?.colorMixMode??null;if(r)t.externalColor=v;else{const r=this.symbolLayer.material?.color??null;r?t.externalColor=e.toUnitRGBA(r):(o=null,t.externalColor=v)}o&&(t.colorMixMode=o),t.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}_getOrCreateMaterial(t,r){const o=r.material?.color,a=r.material?.colorTexture,s=r.material?.alphaMode,n="blend"===s,i=!("opaque"===s)&&(this._hasTransparentVertexColors(t)||null!=o&&o.a<1||a?.transparent||n),l=this._materialProperties(t,r,i),c=this._materialInfoCache.byUid(l.uid);if(c)return c.material;const u={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=xe({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),h={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:T,diffuse:y,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:ce.None,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,initTextureTransparent:!0};h.mrrFactors=m?[..._e]:[l.metallic,l.roughness,Te[2]],r.material&&(h.doubleSided=r.material.doubleSided,h.cullFace=r.material.doubleSided?ce.None:ce.Back,h.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(h),this._setMaterialTransparentParameter(h,u),this._setInternalMaterialParameters(l,h);const f=new de(h);return u.material=f,this._materialInfoCache.set(l.uid,u),this._context.stage.add(f),f}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTransparentParameter(e,t){e.transparent=this.needsDrivenTransparentPass||t.isComponentTransparent||e.layerOpacity<1||e.opacity<1||e.externalColor&&e.externalColor[3]<1,"auto"===t.alphaMode?e.textureAlphaMode=e.transparent?le.MaskBlend:le.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?le.Opaque:"mask"===t.alphaMode?le.Mask:le.Blend}_addDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,a=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),s=[],n=[],i=[],l=[];for(let h=0;h<r;h++){const e=t[h],r=e.attributes.get(pe.POSITION),o=e.attributes.get(pe.NORMAL),c=r.data,u=r.indices,m=o.data,d=o.indices;for(let t=0;t<u.length;t++){const e=3*u[t],r=3*d[t];for(let t=0;t<3;t++)s.push(c[e+t]);for(let t=0;t<3;t++)s.push(c[e+t]+m[r+t]*a);if(n.push(n.length),n.push(n.length),t%3==0){this._calculateFaceNormal(c,u,t,Pe),this._getFaceVertices(c,u,t,je,Oe,Me),f(je,je,Oe),f(je,je,Me),p(je,je,1/3);for(let e=0;e<3;e++)i.push(je[e]);for(let e=0;e<3;e++)i.push(je[e]+Pe[e]*a);l.push(l.length),l.push(l.length)}}}const c=t[0].transformation,u=new me(this._debugVertexNormalMaterial,[[pe.POSITION,new ie(s,n,3,!0)]],null,ue.Line);t.push(u),u.transformation=c;const m=new me(this._debugFaceNormalMaterial,[[pe.POSITION,new ie(i,l,3,!0)]],null,ue.Line);m.transformation=c,t.push(m)}_createAs3DShape(e,t,r,o){const a=e.geometry;if("mesh"!==a.type)return null;const s=this._createGeometryInfo(a,t,o);if(null==s)return null;const{geometries:n,objectTransformation:i}=s;ne.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(a,n);const l=new he({geometries:n,layerUid:this._context.layer.uid,graphicUid:o});l.transformation=i;const c=oe(this.symbolLayer,{opacity:this._getLayerOpacity()}),u=c?new X(n[0].material,[c],{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}):null,m=new Q(this,l,n,null,null,Z,r,u);this._fastUpdateProcessor.onAddGraphic(),m.needsElevationUpdates=J(r.mode),m.useObjectOriginAsAttachmentOrigin=!0,r.centerPointInElevationSR=this._getCenterPointInElevationSR(l.transformation);const{elevationProvider:h,renderCoordsHelper:f}=this._context,p=(e,t)=>K(e,h,r,f,t);return m.alignedSampledElevation=Z(m,r,h.spatialReference,p,f),m}_getCenterPointInElevationSR(e){const t=H(0,0,0,null!=this._context.elevationProvider.spatialReference?this._context.elevationProvider.spatialReference:null);return O([e[12],e[13],e[14]],this._context.renderCoordsHelper.spatialReference,t),t}_createComponentNormals(e,t,r,o){switch(r.shading||"flat"){default:case"source":return this._createComponentNormalsSource(e,t,r,o);case"flat":return this._createComponentNormalsFlat(e,o);case"smooth":return this._createComponentNormalsSmooth(e,o)}}_createComponentNormalsSource(e,t,r,o){if(null==t)return this._createComponentNormalsFlat(e,o);let a=!1;if(!r.trustSourceNormals)for(let s=0;s<o.length;s+=3){this._calculateFaceNormal(e,o,s,Pe);for(let e=0;e<3;e++){const r=3*o[s+e];je[0]=t[r],je[1]=t[r+1],je[2]=t[r+2],d(Pe,je)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],a=!0)}}return new Ce(t,o,a)}_createComponentNormalsFlat(e,t){const r=E(t.length),o=new Array(3*t.length);for(let a=0;a<t.length;a+=3){const s=this._calculateFaceNormal(e,t,a,Pe);for(let e=0;e<3;e++)r[a+e]=s[e],o[a+e]=a/3}return new Ce(r,o,!1)}_createComponentNormalsSmooth(e,t){const r={};for(let s=0;s<t.length;s+=3){const o=this._calculateFaceNormal(e,t,s,Pe);for(let e=0;e<3;e++){const a=t[s+e];let n=r[a];n||(n={normal:b(),count:0},r[a]=n),f(n.normal,n.normal,o),n.count++}}const o=E(3*t.length),a=new Array(3*t.length);for(let s=0;s<t.length;s++){const e=r[t[s]];1!==e.count&&(g(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*s+t]=e.normal[t];a[s]=s}return new Ce(o,a,!1)}_getFaceVertices(e,t,r,o,a,s){const n=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],a[0]=e[i],a[1]=e[i+1],a[2]=e[i+2],s[0]=e[l],s[1]=e[l+1],s[2]=e[l+2]}_calculateFaceNormal(e,t,r,o){return this._getFaceVertices(e,t,r,je,Oe,Me),x(Oe,Oe,je),x(Me,Me,je),_(je,Oe,Me),g(o,je),o}_getOrCreateComponents(e){return e.components??Ne}_createPositionBuffer(e,t){let r=e.vertexAttributes.position;const o=t.reprojection===Fe.ECEF?t.transformBeforeProject:null;if(o&&(r=U(new Float64Array(r.length),r,o)),t.reprojection===Fe.NONE)return t.needsBufferCopy?new Float64Array(r):r;const a=o?r:new Float64Array(r.length);return j(r,e.spatialReference,0,a,this._context.renderCoordsHelper.spatialReference,0,r.length/3),a}_createNormalBuffer(e,t,r){let o=e.vertexAttributes.normal;if(null==o)return null;const a=r.reprojection===Fe.ECEF?r.transformBeforeProject:null;a&&(o=G(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Fe.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const s=e.vertexAttributes.position,n=a?o:new Float32Array(o.length);return V(o,s,t,e.spatialReference,n)}_createTangentBuffer(e,t,r){let o=e.vertexAttributes.tangent;if(null==o)return null;const a=r.reprojection===Fe.ECEF?r.transformBeforeProject:null;a&&(o=D(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Fe.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const s=e.vertexAttributes.position,n=a?o:new Float32Array(o.length);return k(o,s,t,e.spatialReference,n)}_createColorBuffer(e){return e.vertexAttributes.color}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=ae(this.symbolLayer?.material?.colorMixMode),o=new Uint8Array(4);return se(t,r,o),o}return null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,a=e.vertexAttributes.uv,s=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(s&&s.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const n=this._computeReprojectionInfo(e),i=this._createPositionBuffer(e,n),l=this._createColorBuffer(e),u=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,n),h=this._createTangentBuffer(e,i,n);return{positionBuffer:i,normalBuffer:m,tangentBuffer:h,uvBuffer:a,colorBuffer:l,symbolColorBuffer:u,objectTransformation:n.reprojection===Fe.NONE&&n.objectTransformation?n.objectTransformation:this._transformOriginLocal(e,i,m,h),geometryTransformation:n.reprojection===Fe.NONE&&n.geometryTransformation?n.geometryTransformation:c()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r=t.isRelative,o=t.isGeoreferenced?this._context.renderCoordsHelper.viewingMode===W.Local?Fe.NONE:Fe.ECEF:Fe.NONE;if(r){const{origin:r}=t,a=c(),i=e.transform?.localMatrix??u;if(o===Fe.NONE){w(e.spatialReference,r,a,this._context.renderCoordsHelper.spatialReference);return{reprojection:o,objectTransformation:a,geometryTransformation:m(i),needsBufferCopy:!1}}const l=s(c(),r);return n(l,l,i),{reprojection:o,transformBeforeProject:l,needsBufferCopy:!0}}return{reprojection:o,needsBufferCopy:!0}}_transformOriginLocal(e,t,a,s){const n=this._context.renderCoordsHelper.spatialReference,l=e.anchor;we[0]=l.x,we[1]=l.y,we[2]=l.z??0;const u=c();return w(e.spatialReference,we,u,n),i(Re,u),U(t,t,Re),(a||s)&&(r(Ae,u),o(Ae,Ae),a&&L(a,a,Ae),s&&L(s,s,Ae,4)),u}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_getOrCreateFaces(e,t){return t.faces??I(e.vertexAttributes.position.length/3)}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=$({positions:t,transform:e.transform,vertexSpace:e.vertexSpace,inSpatialReference:e.spatialReference,outSpatialReference:r??e.spatialReference}),a=o.length/3;return P(Ie),R(Ie,o,0,a),!A(Ie,this._context.clippingExtent)}_createGeometryInfo(e,t,r){if(!C(e.spatialReference,this._context.graphicsCoreOwner.view.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:a,uvBuffer:s,colorBuffer:n,symbolColorBuffer:i,normalBuffer:c,tangentBuffer:u,objectTransformation:m,geometryTransformation:h}=o,f=this._getOrCreateComponents(e),p=new Array;let d=!1;const g=l(je,m),x=this._context.localOriginFactory.getOrigin(g);for(const l of f){if(!this._validateFaces(e,l))return null;const t=this._getOrCreateFaces(e,l);if(0===t.length)continue;const o=this._createComponentNormals(a,c,l,t);o.didFlipNormals&&(d=!0);const m=[[pe.POSITION,new ie(a,t,3,!0)],[pe.NORMAL,new ie(o.normals,o.indices,3,!0)]];n&&m.push([pe.COLOR,new ie(n,t,4,!0)]),i&&m.push([pe.SYMBOLCOLOR,new ie(i,N(t.length),4,!0)]),s&&m.push([pe.UV0,new ie(s,t,2,!0)]),u&&m.push([pe.TANGENT,new ie(u,t,4,!0)]);const f=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerUid:this._context.layer.uid}),g=this._getOrCreateMaterial(e,l),_=new me(g,m,null,ue.Mesh,f);_.transformation=h,_.localOrigin=x,p.push(_)}return d&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:p,objectTransformation:m}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial(((e,t)=>{t.setParameters(e.parameters)}))}test(){return{...super.test(),materials:this._materialInfoCache.materials}}}class Ce{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}const we=b(),je=b(),Oe=b(),Me=b(),Pe=b(),Re=c(),Ae=a(),Ee=c(),Ie=M(),Ne=[new B],Be=new S;var Fe;!function(e){e[e.NONE=0]="NONE",e[e.ECEF=1]="ECEF"}(Fe||(Fe={}));export{ve as Graphics3DMeshFillSymbolLayer};
5
+ import e from"../../../../Color.js";import"../../../../core/has.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{f as r,t as o}from"../../../../chunks/mat3.js";import{a}from"../../../../chunks/mat3f64.js";import{d as s,m as n,i,B as l}from"../../../../chunks/mat4.js";import{a as c,I as u,b as m}from"../../../../chunks/mat4f64.js";import{s as h,g as f,i as p,j as d,n as g,f as x,b as _}from"../../../../chunks/vec3.js";import{Z as T,O as y,c as b}from"../../../../chunks/vec3f64.js";import{O as v}from"../../../../chunks/vec4f64.js";import{canProjectWithoutEngine as C}from"../../../../geometry/projection.js";import{computeTranslationToOriginAndRotation as w}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as j}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToDehydratedPoint as M}from"../../../../geometry/projection/projectVectorToDehydratedPoint.js";import{create as O,empty as P,expandWithBuffer as R,intersectsClippingArea as A}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as E}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as I,getZeroIndexArray as N}from"../../../../geometry/support/Indices.js";import B from"../../../../geometry/support/MeshComponent.js";import F from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import S from"../../../../geometry/support/MeshTextureTransform.js";import{t as U,a as L}from"../../../../chunks/vec32.js";import{project as $}from"../../../../geometry/support/meshUtils/georeference.js";import{transformNormal as G,projectNormalToPCPF as V,transformTangent as D,projectTangentToPCPF as k}from"../../../../geometry/support/meshUtils/projection.js";import{makeDehydratedPoint as H}from"../../../../layers/graphics/dehydratedPoint.js";import{MeshTransformUpdateAction as q}from"../../../../layers/graphics/sources/interfaces.js";import{ViewingMode as W}from"../../../ViewingMode.js";import{isEncodedMeshTexture as z}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as Y}from"../../glTF/internal/TextureTransformUtils.js";import{perObjectElevationAligner as Z}from"./ElevationAligners.js";import{needsElevationUpdates3D as J,evaluateElevationInfoAtPoint as K}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as Q}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as X}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as ee}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as te,MeshFastUpdateProcessor as re}from"./MeshFastUpdateProcessor.js";import{createMaterial as oe}from"../support/edgeUtils.js";import{parseColorMixMode as ae,encodeSymbolColor as se}from"../support/symbolColorUtils.js";import{debugFlags as ne}from"../../support/debugFlags.js";import{Attribute as ie}from"../../webgl-engine/lib/Attribute.js";import{AlphaDiscardMode as le,CullFaceOptions as ce}from"../../webgl-engine/lib/basicInterfaces.js";import{ContentObjectType as ue}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as me}from"../../webgl-engine/lib/Geometry.js";import{Object3D as he}from"../../webgl-engine/lib/Object3D.js";import{Texture as fe}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as pe}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as de}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as ge}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as xe,defaultSchematicMRRFactors as _e,defaultAdvancedMRRFactors as Te}from"../../webgl-engine/materials/pbrUtils.js";import{TextureWrapMode as ye}from"../../../webgl/enums.js";const be=["mesh"];class ve extends ee{constructor(e,t,r,o){super(e,t,r,o),this._materialInfoCache=new te,this._fastUpdateProcessor=new re,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){ne.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new ge({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new ge({color:[0,1,1,1]}))}destroy(){super.destroy(),this._textures.forEach((e=>e.unload())),this._context.stage.removeMany(this._materialInfoCache.materials),this._context.stage.removeMany(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy(this._context.stage)}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,be,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache,this._context)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters((e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>t(e)?.layerOpacityChanged(r,this._context.isAsync)))}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,J)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters((({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),e.forEach((e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync))),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters((({material:t})=>t.setParameters({usePBR:e}))),!0}updateTransform(e,t,r,o){const a=this._context.renderCoordsHelper.spatialReference,s=Ee,{origin:n,transform:i}=r;switch(w(t,h(je,n.x,n.y,n.z??0),s,a),o){case q.EnableFastUpdates:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case q.DisableFastUpdates:this._fastUpdateProcessor.disable(e,this._materialInfoCache,this._context);break;case q.UpdateFastLocalOrigin:e.updateFastLocalOrigin(s,i,this._context.localOriginFactory)}const{elevationContext:l}=e;l.centerPointInElevationSR=this._getCenterPointInElevationSR(s);const{elevationProvider:c,renderCoordsHelper:u}=this._context,m=(e,t)=>K(e,c,l,u,t);return e.alignedSampledElevation=Z(e,l,c.spatialReference,m,u,s),e.updateTransform(s,i,this._context.isAsync),!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,a=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:a,uid:`vc:${o},vt:${a},vct${t},svc:${r}`}}_textureTransformUid(e){const{offset:t,scale:r,rotation:o}=e??Be;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:a,colorTexture:s,colorTextureTransform:n,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,h=this._colorOrTextureUid(a),f=this._colorOrTextureUid(s),p=this._textureTransformUid(n),d=this._colorOrTextureUid(i),g=this._textureTransformUid(l);if(o.color=a,o.colorTexture=s,o.normalTexture=i,o.uid=`${o.uid},cmuid:${h},ctmuid:${f},cttuid:${p},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof F){const{metallic:e,roughness:r,metallicRoughnessTexture:a,metallicRoughnessTextureTransform:s,emissiveColor:i,emissiveTexture:c,emissiveTextureTransform:u,occlusionTexture:m,occlusionTextureTransform:h}=t.material,f=this._colorOrTextureUid(a),p=this._textureTransformUid(s),d=this._colorOrTextureUid(i),g=this._colorOrTextureUid(c),x=this._textureTransformUid(u),_=this._colorOrTextureUid(m),T=this._textureTransformUid(h);o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=a,o.emissiveColor=i,o.emissiveTexture=c,o.occlusionTexture=m,o.colorTextureTransform=this._convertTextureTransform(n),o.normalTextureTransform=this._convertTextureTransform(l),o.emissiveTextureTransform=this._convertTextureTransform(u),o.occlusionTextureTransform=this._convertTextureTransform(h),o.metallicRoughnessTextureTransform=this._convertTextureTransform(s),o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${f},mrtt:${p},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${T}`}return o}_convertTextureTransform(e){if(!e)return null;const{scale:r,offset:o,rotation:a}=e;return{scale:r,offset:o,rotation:t(a)}}_setInternalColorValueParameters(t,r){r.diffuse=e.toUnitRGB(t),r.opacity=t.a}_getLoadableTextureResource(e){return e.data??e.url}_getInternalTextureId(e){const t=this._getInternalTexture(e,le.Opaque);return t?.id}_getInternalTexture(e,t){const r=this._getLoadableTextureResource(e);if(!r)return null;const o=`${e.contentHash}/${t}`;let a=this._textures.get(o);if(!a){let s=null;const n=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,i={wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,maxAnisotropy:n,mipmap:n>1};z(r)?(s=r.data,i.preMultiplyAlpha=!1,i.encoding=r.encoding):(s=r,i.preMultiplyAlpha=t!==le.Opaque,i.downsampleUncompressed=this._context.graphicsCoreOwner.view.qualitySettings.graphics3D.uncompressedTextureDownsamplingEnabled),a=new fe(s,i),this._textures.set(o,a),a.load(this._context.stage.renderView.renderingContext),this._context.stage.add(a)}return a}_castTextureWrap(e="repeat"){if("string"==typeof e){const t=this._castTextureWrapIndividual(e);return{s:t,t}}return{s:this._castTextureWrapIndividual(e.horizontal),t:this._castTextureWrapIndividual(e.vertical)}}_castTextureWrapIndividual(e){switch(e){case"clamp":return ye.CLAMP_TO_EDGE;case"mirror":return ye.MIRRORED_REPEAT;default:return ye.REPEAT}}_setInternalMaterialParameters(t,r){if(null!=t.color&&this._setInternalColorValueParameters(t.color,r),null!=t.colorTexture){const e=this._getInternalTexture(t.colorTexture,r.textureAlphaMode);e?(r.textureId=e.id,r.textureAlphaPremultiplied=!!e.parameters.preMultiplyAlpha):r.textureId=void 0}t.normalTexture&&(r.normalTextureId=this._getInternalTextureId(t.normalTexture)),t.emissiveColor&&(r.emissiveFactor=e.toUnitRGB(t.emissiveColor)),t.emissiveTexture&&(r.emissiveTextureId=this._getInternalTextureId(t.emissiveTexture)),t.occlusionTexture&&(r.occlusionTextureId=this._getInternalTextureId(t.occlusionTexture)),t.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTextureId(t.metallicRoughnessTexture)),r.colorTextureTransformMatrix=Y(t.colorTextureTransform),r.normalTextureTransformMatrix=Y(t.normalTextureTransform),r.occlusionTextureTransformMatrix=Y(t.occlusionTextureTransform),r.emissiveTextureTransformMatrix=Y(t.emissiveTextureTransform),r.metallicRoughnessTextureTransformMatrix=Y(t.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t){const r=this._drivenProperties.color;let o=this.symbolLayer.material?.colorMixMode??null;if(r)t.externalColor=v;else{const r=this.symbolLayer.material?.color??null;r?t.externalColor=e.toUnitRGBA(r):(o=null,t.externalColor=v)}o&&(t.colorMixMode=o),t.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}_getOrCreateMaterial(t,r){const o=r.material?.color,a=r.material?.colorTexture,s=r.material?.alphaMode,n="blend"===s,i=!("opaque"===s)&&(this._hasTransparentVertexColors(t)||null!=o&&o.a<1||a?.transparent||n),l=this._materialProperties(t,r,i),c=this._materialInfoCache.byUid(l.uid);if(c)return c.material;const u={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=xe({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),h={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:T,diffuse:y,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:ce.None,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,initTextureTransparent:!0};h.mrrFactors=m?[..._e]:[l.metallic,l.roughness,Te[2]],r.material&&(h.doubleSided=r.material.doubleSided,h.cullFace=r.material.doubleSided?ce.None:ce.Back,h.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(h),this._setMaterialTransparentParameter(h,u),this._setInternalMaterialParameters(l,h);const f=new de(h);return u.material=f,this._materialInfoCache.set(l.uid,u),this._context.stage.add(f),f}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTransparentParameter(e,t){e.transparent=this.needsDrivenTransparentPass||t.isComponentTransparent||e.layerOpacity<1||e.opacity<1||e.externalColor&&e.externalColor[3]<1,"auto"===t.alphaMode?e.textureAlphaMode=e.transparent?le.MaskBlend:le.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?le.Opaque:"mask"===t.alphaMode?le.Mask:le.Blend}_addDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,a=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),s=[],n=[],i=[],l=[];for(let h=0;h<r;h++){const e=t[h],r=e.attributes.get(pe.POSITION),o=e.attributes.get(pe.NORMAL),c=r.data,u=r.indices,m=o.data,d=o.indices;for(let t=0;t<u.length;t++){const e=3*u[t],r=3*d[t];for(let t=0;t<3;t++)s.push(c[e+t]);for(let t=0;t<3;t++)s.push(c[e+t]+m[r+t]*a);if(n.push(n.length),n.push(n.length),t%3==0){this._calculateFaceNormal(c,u,t,Pe),this._getFaceVertices(c,u,t,je,Me,Oe),f(je,je,Me),f(je,je,Oe),p(je,je,1/3);for(let e=0;e<3;e++)i.push(je[e]);for(let e=0;e<3;e++)i.push(je[e]+Pe[e]*a);l.push(l.length),l.push(l.length)}}}const c=t[0].transformation,u=new me(this._debugVertexNormalMaterial,[[pe.POSITION,new ie(s,n,3,!0)]],null,ue.Line);t.push(u),u.transformation=c;const m=new me(this._debugFaceNormalMaterial,[[pe.POSITION,new ie(i,l,3,!0)]],null,ue.Line);m.transformation=c,t.push(m)}_createAs3DShape(e,t,r,o){const a=e.geometry;if("mesh"!==a.type)return null;const s=this._createGeometryInfo(a,t,o);if(null==s)return null;const{geometries:n,objectTransformation:i}=s;ne.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(a,n);const l=new he({geometries:n,layerUid:this._context.layer.uid,graphicUid:o});l.transformation=i;const c=oe(this.symbolLayer,{opacity:this._getLayerOpacity()}),u=c?new X(n[0].material,[c],{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}):null,m=new Q(this,l,n,null,null,Z,r,u);this._fastUpdateProcessor.onAddGraphic(),m.needsElevationUpdates=J(r.mode),m.useObjectOriginAsAttachmentOrigin=!0,r.centerPointInElevationSR=this._getCenterPointInElevationSR(l.transformation);const{elevationProvider:h,renderCoordsHelper:f}=this._context,p=(e,t)=>K(e,h,r,f,t);return m.alignedSampledElevation=Z(m,r,h.spatialReference,p,f),m}_getCenterPointInElevationSR(e){const t=H(0,0,0,null!=this._context.elevationProvider.spatialReference?this._context.elevationProvider.spatialReference:null);return M([e[12],e[13],e[14]],this._context.renderCoordsHelper.spatialReference,t),t}_createComponentNormals(e,t,r,o){switch(r.shading||"flat"){default:case"source":return this._createComponentNormalsSource(e,t,r,o);case"flat":return this._createComponentNormalsFlat(e,o);case"smooth":return this._createComponentNormalsSmooth(e,o)}}_createComponentNormalsSource(e,t,r,o){if(null==t)return this._createComponentNormalsFlat(e,o);let a=!1;if(!r.trustSourceNormals)for(let s=0;s<o.length;s+=3){this._calculateFaceNormal(e,o,s,Pe);for(let e=0;e<3;e++){const r=3*o[s+e];je[0]=t[r],je[1]=t[r+1],je[2]=t[r+2],d(Pe,je)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],a=!0)}}return new Ce(t,o,a)}_createComponentNormalsFlat(e,t){const r=E(t.length),o=new Array(3*t.length);for(let a=0;a<t.length;a+=3){const s=this._calculateFaceNormal(e,t,a,Pe);for(let e=0;e<3;e++)r[a+e]=s[e],o[a+e]=a/3}return new Ce(r,o,!1)}_createComponentNormalsSmooth(e,t){const r={};for(let s=0;s<t.length;s+=3){const o=this._calculateFaceNormal(e,t,s,Pe);for(let e=0;e<3;e++){const a=t[s+e];let n=r[a];n||(n={normal:b(),count:0},r[a]=n),f(n.normal,n.normal,o),n.count++}}const o=E(3*t.length),a=new Array(3*t.length);for(let s=0;s<t.length;s++){const e=r[t[s]];1!==e.count&&(g(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*s+t]=e.normal[t];a[s]=s}return new Ce(o,a,!1)}_getFaceVertices(e,t,r,o,a,s){const n=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],a[0]=e[i],a[1]=e[i+1],a[2]=e[i+2],s[0]=e[l],s[1]=e[l+1],s[2]=e[l+2]}_calculateFaceNormal(e,t,r,o){return this._getFaceVertices(e,t,r,je,Me,Oe),x(Me,Me,je),x(Oe,Oe,je),_(je,Me,Oe),g(o,je),o}_getOrCreateComponents(e){return e.components??Ne}_createPositionBuffer(e,t){let r=e.vertexAttributes.position;const o=t.reprojection===Fe.ECEF?t.transformBeforeProject:null;if(o&&(r=U(new Float64Array(r.length),r,o)),t.reprojection===Fe.NONE)return t.needsBufferCopy?new Float64Array(r):r;const a=o?r:new Float64Array(r.length);return j(r,e.spatialReference,0,a,this._context.renderCoordsHelper.spatialReference,0,r.length/3),a}_createNormalBuffer(e,t,r){let o=e.vertexAttributes.normal;if(null==o)return null;const a=r.reprojection===Fe.ECEF?r.transformBeforeProject:null;a&&(o=G(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Fe.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const s=e.vertexAttributes.position,n=a?o:new Float32Array(o.length);return V(o,s,t,e.spatialReference,n)}_createTangentBuffer(e,t,r){let o=e.vertexAttributes.tangent;if(null==o)return null;const a=r.reprojection===Fe.ECEF?r.transformBeforeProject:null;a&&(o=D(o,new Float32Array(o.length),a));if("local"===this._context.graphicsCoreOwner.view.viewingMode||r.reprojection===Fe.NONE)return r.needsBufferCopy&&e.vertexAttributes.normal===o?new Float32Array(o):o;const s=e.vertexAttributes.position,n=a?o:new Float32Array(o.length);return k(o,s,t,e.spatialReference,n)}_createColorBuffer(e){return e.vertexAttributes.color}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=ae(this.symbolLayer?.material?.colorMixMode),o=new Uint8Array(4);return se(t,r,o),o}return null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,a=e.vertexAttributes.uv,s=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(s&&s.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const n=this._computeReprojectionInfo(e),i=this._createPositionBuffer(e,n),l=this._createColorBuffer(e),u=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,n),h=this._createTangentBuffer(e,i,n);return{positionBuffer:i,normalBuffer:m,tangentBuffer:h,uvBuffer:a,colorBuffer:l,symbolColorBuffer:u,objectTransformation:n.reprojection===Fe.NONE&&n.objectTransformation?n.objectTransformation:this._transformOriginLocal(e,i,m,h),geometryTransformation:n.reprojection===Fe.NONE&&n.geometryTransformation?n.geometryTransformation:c()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r=t.isRelative,o=t.isGeoreferenced?this._context.renderCoordsHelper.viewingMode===W.Local?Fe.NONE:Fe.ECEF:Fe.NONE;if(r){const{origin:r}=t,a=c(),i=e.transform?.localMatrix??u;if(o===Fe.NONE){w(e.spatialReference,r,a,this._context.renderCoordsHelper.spatialReference);return{reprojection:o,objectTransformation:a,geometryTransformation:m(i),needsBufferCopy:!1}}const l=s(c(),r);return n(l,l,i),{reprojection:o,transformBeforeProject:l,needsBufferCopy:!0}}return{reprojection:o,needsBufferCopy:!0}}_transformOriginLocal(e,t,a,s){const n=this._context.renderCoordsHelper.spatialReference,l=e.anchor;we[0]=l.x,we[1]=l.y,we[2]=l.z??0;const u=c();return w(e.spatialReference,we,u,n),i(Re,u),U(t,t,Re),(a||s)&&(r(Ae,u),o(Ae,Ae),a&&L(a,a,Ae),s&&L(s,s,Ae,4)),u}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_getOrCreateFaces(e,t){return t.faces??I(e.vertexAttributes.position.length/3)}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=$({positions:t,transform:e.transform,vertexSpace:e.vertexSpace,inSpatialReference:e.spatialReference,outSpatialReference:r??e.spatialReference,localMode:this._context.stage.viewingMode===W.Local}),a=o.length/3;return P(Ie),R(Ie,o,0,a),!A(Ie,this._context.clippingExtent)}_createGeometryInfo(e,t,r){if(!C(e.spatialReference,this._context.graphicsCoreOwner.view.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:a,uvBuffer:s,colorBuffer:n,symbolColorBuffer:i,normalBuffer:c,tangentBuffer:u,objectTransformation:m,geometryTransformation:h}=o,f=this._getOrCreateComponents(e),p=new Array;let d=!1;const g=l(je,m),x=this._context.localOriginFactory.getOrigin(g);for(const l of f){if(!this._validateFaces(e,l))return null;const t=this._getOrCreateFaces(e,l);if(0===t.length)continue;const o=this._createComponentNormals(a,c,l,t);o.didFlipNormals&&(d=!0);const m=[[pe.POSITION,new ie(a,t,3,!0)],[pe.NORMAL,new ie(o.normals,o.indices,3,!0)]];n&&m.push([pe.COLOR,new ie(n,t,4,!0)]),i&&m.push([pe.SYMBOLCOLOR,new ie(i,N(t.length),4,!0)]),s&&m.push([pe.UV0,new ie(s,t,2,!0)]),u&&m.push([pe.TANGENT,new ie(u,t,4,!0)]);const f=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerUid:this._context.layer.uid}),g=this._getOrCreateMaterial(e,l),_=new me(g,m,null,ue.Mesh,f);_.transformation=h,_.localOrigin=x,p.push(_)}return d&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:p,objectTransformation:m}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial(((e,t)=>{t.setParameters(e.parameters)}))}test(){return{...super.test(),materials:this._materialInfoCache.materials}}}class Ce{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}const we=b(),je=b(),Me=b(),Oe=b(),Pe=b(),Re=c(),Ae=a(),Ee=c(),Ie=O(),Ne=[new B],Be=new S;var Fe;!function(e){e[e.NONE=0]="NONE",e[e.ECEF=1]="ECEF"}(Fe||(Fe={}));export{ve as Graphics3DMeshFillSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../core/compilerUtils.js";import{defaultPrimitive as r}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{pathNumRoundCapExtrusionSubdivisions as t,pathNumCircleProfileSubdivisions as a,pathNumRoundJoinSubdivisions as s}from"./Graphics3DPathSymbolLayerConstants.js";import{primitiveLodResources as u}from"./primitiveObjectSymbolUtils.js";import{EstimatedSymbolComplexity as o,SymbolComplexityMemory as b,EstimatedAggregateSymbolComplexity as i,AggregateSymbolComplexity as y,SymbolComplexity as c}from"./SymbolComplexity.js";import{hasEdges as n}from"../support/edgeUtils.js";import{DefaultMaterial as l}from"../../webgl-engine/materials/DefaultMaterial.js";const P=new o({});function m(e){if("web-style"===e.type)return P;return F(e.symbolLayers.toArray().map((r=>L(e,r))))}function F(e){let r=0,t=0,a=0,s=!1,u=0;const o=new b;for(const b of e)null!=b&&(r+=b.verticesPerFeature,t+=b.verticesPerCoordinate,a+=b.drawCallsPerFeature,o.bytesPerFeature+=b.memory.bytesPerFeature,o.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,o.resourceBytes+=b.memory.resourceBytes,o.draped.bytesPerFeature+=b.memory.bytesPerFeature,o.draped.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,s=s||b.estimated,++u);return s?new i(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o}):new y(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o})}function d(e){const r=F(e);return r.numComplexities>0&&(r.verticesPerFeature/=r.numComplexities,r.verticesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.resourceBytes/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities),r}const p={};function L(u,b){const i=C(u,b),y=n(b)?2:0;switch(b.type){case"extrude":return new c({verticesPerFeature:-12,verticesPerCoordinate:12,drawCallsPerFeature:y,memory:i});case"fill":if("mesh-3d"===u.type)return new c({drawCallsPerFeature:y,memory:i});if(null!=b.outline&&b.outline.size>0)return new c({verticesPerFeature:-12,verticesPerCoordinate:9,memory:i});case"water":return new c({verticesPerFeature:-6,verticesPerCoordinate:3,memory:i});case"line":return new c({verticesPerFeature:-6,verticesPerCoordinate:6,memory:i});case"object":return b.resource?.href?new o({verticesPerFeature:100,memory:i}):{...f(b.resource?.primitive??r),memory:i};case"path":{let r=0,u=0;switch(b.profile){case"circle":r=a;break;case"quad":r=4;break;default:return void e(b.profile)}switch(b.join??"simple"){case"round":u=s;break;case"miter":case"bevel":u=1;break;default:return}const o=2*r,y=r*u*2,n=y+o;let l=-2*y-o;switch(b.cap){case"none":break;case"butt":case"square":l+=2*(r-1);break;case"round":l+=2*(r*(t-1)*2+r);break;default:return}return new c({verticesPerFeature:l,verticesPerCoordinate:n,memory:i})}case"text":case"icon":return new c({verticesPerFeature:6,memory:i});default:return}}function C(r,t){const a="point-3d"===r.type;switch(t.type){case"extrude":return t.edges&&t.edges.size>0?E.EXTRUDE_EDGES:E.EXTRUDE;case"fill":return null!=t.outline&&t.outline.size>0?E.FILL_OUTLINE:E.FILL;case"water":return E.FILL;case"line":return"round"===t.join?E.LINE_ROUND:E.LINE_MITER;case"path":switch(t.join){case"round":switch(t.profile){case"circle":return E.PATH_ROUND_CIRCLE;case"quad":return E.PATH_ROUND_QUAD;default:return void e(t.profile)}case"miter":case"bevel":switch(t.profile){case"circle":return E.PATH_MITER_CIRCLE;case"quad":return E.PATH_MITER_QUAD;default:return void e(t.profile)}default:return}case"object":return a?E.OBJECT_POINT:E.OBJECT_POLYGON;case"icon":case"text":return a?E.ICON_POINT:E.ICON_POLYGON;default:return}}function f(e){const r=p[e];if(r)return r;const t=w(u(e,new l({})).levels);return p[e]=new c({verticesPerFeature:t}),p[e]}function w(e){return e.reduce(((e,r,t)=>e+r.numVertices*(1/10**t)),0)/e.reduce(((e,r,t)=>e+1/10**t),0)}const E={ICON_POINT:{bytesPerFeature:2363.599934241429,bytesPerFeatureLabel:815.07596,resourceBytes:0,draped:{bytesPerFeature:2085.012145608268,bytesPerFeatureLabel:801.60564}},ICON_POLYGON:{bytesPerFeature:3030.805209830123,bytesPerFeatureLabel:812.4497266666668,resourceBytes:0,draped:{bytesPerFeature:2783.910489353391,bytesPerFeatureLabel:812.4097266666666}},OBJECT_POINT:{bytesPerFeature:905.2554945984032,bytesPerFeatureLabel:665.4821000000001,resourceBytes:0,draped:{bytesPerFeature:905.2554945984032,bytesPerFeatureLabel:665.4821000000001}},OBJECT_POLYGON:{bytesPerFeature:1414.9723403462062,bytesPerFeatureLabel:671.3657766666669,resourceBytes:0,draped:{bytesPerFeature:1414.9723403462062,bytesPerFeatureLabel:671.3657766666669}},LINE_MITER:{bytesPerFeature:3192.8357442450183,bytesPerFeatureLabel:764.9131800000001,resourceBytes:0,draped:{bytesPerFeature:2835.870502146822,bytesPerFeatureLabel:761.4855466666667}},LINE_ROUND:{bytesPerFeature:3210.916285012623,bytesPerFeatureLabel:766.8721866666666,resourceBytes:0,draped:{bytesPerFeature:2833.692990678465,bytesPerFeatureLabel:763.3892400000001}},PATH_MITER_CIRCLE:{bytesPerFeature:42564.93445709702,bytesPerFeatureLabel:790.5263,resourceBytes:0,draped:{bytesPerFeature:42564.93445709702,bytesPerFeatureLabel:790.5263}},PATH_ROUND_CIRCLE:{bytesPerFeature:47173.74541218924,bytesPerFeatureLabel:783.9499,resourceBytes:0,draped:{bytesPerFeature:47173.74541218924,bytesPerFeatureLabel:783.9499}},PATH_MITER_QUAD:{bytesPerFeature:28983.270935044096,bytesPerFeatureLabel:804.3963000000001,resourceBytes:0,draped:{bytesPerFeature:28983.270935044096,bytesPerFeatureLabel:804.3963000000001}},PATH_ROUND_QUAD:{bytesPerFeature:44385.09713873295,bytesPerFeatureLabel:771.3578,resourceBytes:0,draped:{bytesPerFeature:44385.09713873295,bytesPerFeatureLabel:771.3578}},FILL:{bytesPerFeature:3284.478981374941,bytesPerFeatureLabel:823.1919666666668,resourceBytes:0,draped:{bytesPerFeature:2817.882880358244,bytesPerFeatureLabel:812.2166999999998}},FILL_OUTLINE:{bytesPerFeature:4750.193272274322,bytesPerFeatureLabel:811.6416666666667,resourceBytes:0,draped:{bytesPerFeature:4140.516732393648,bytesPerFeatureLabel:819.1875866666666}},EXTRUDE:{bytesPerFeature:7789.075068040583,bytesPerFeatureLabel:812.6264266666668,resourceBytes:0,draped:{bytesPerFeature:7789.075068040583,bytesPerFeatureLabel:812.6264266666668}},EXTRUDE_EDGES:{bytesPerFeature:3004.536288922884,bytesPerFeatureLabel:520.7339666666668,resourceBytes:0,draped:{bytesPerFeature:3004.536288922884,bytesPerFeatureLabel:520.7339666666668}}};export{d as averageSymbolComplexities,m as defaultSymbolComplexity,L as defaultSymbolLayerComplexity,C as defaultSymbolLayerMemoryComplexity,P as emptySymbolComplexity,w as estimateNumVerticesForLods,E as memoryEstimators,F as totalSymbolComplexities};
5
+ import{neverReached as e}from"../../../../core/compilerUtils.js";import{defaultPrimitive as r}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{pathNumRoundCapExtrusionSubdivisions as t,pathNumCircleProfileSubdivisions as a,pathNumRoundJoinSubdivisions as s}from"./Graphics3DPathSymbolLayerConstants.js";import{primitiveLodResources as u}from"./primitiveObjectSymbolUtils.js";import{EstimatedSymbolComplexity as o,SymbolComplexityMemory as b,EstimatedAggregateSymbolComplexity as i,AggregateSymbolComplexity as y,SymbolComplexity as c}from"./SymbolComplexity.js";import{hasEdges as n}from"../support/edgeUtils.js";import{DefaultMaterial as l}from"../../webgl-engine/materials/DefaultMaterial.js";const P=new o({});function m(e){if("web-style"===e.type)return P;return F(e.symbolLayers.toArray().map((r=>L(e,r))))}function F(e){let r=0,t=0,a=0,s=!1,u=0;const o=new b;for(const b of e)null!=b&&(r+=b.verticesPerFeature,t+=b.verticesPerCoordinate,a+=b.drawCallsPerFeature,o.bytesPerFeature+=b.memory.bytesPerFeature,o.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,o.resourceBytes+=b.memory.resourceBytes,o.draped.bytesPerFeature+=b.memory.bytesPerFeature,o.draped.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,s=s||b.estimated,++u);return s?new i(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o}):new y(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o})}function d(e){const r=F(e);return r.numComplexities>0&&(r.verticesPerFeature/=r.numComplexities,r.verticesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.resourceBytes/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities),r}const p={};function L(u,b){const i=C(u,b),y=n(b)?2:0;switch(b.type){case"extrude":return new c({verticesPerFeature:-12,verticesPerCoordinate:12,drawCallsPerFeature:y,memory:i});case"fill":if("mesh-3d"===u.type)return new c({drawCallsPerFeature:y,memory:i});if(null!=b.outline&&b.outline.size>0)return new c({verticesPerFeature:-12,verticesPerCoordinate:9,memory:i});case"water":return new c({verticesPerFeature:-6,verticesPerCoordinate:3,memory:i});case"line":return new c({verticesPerFeature:-6,verticesPerCoordinate:6,memory:i});case"object":return b.resource?.href?new o({verticesPerFeature:100,memory:i}):{...f(b.resource?.primitive??r),memory:i};case"path":{let r=0,u=0;switch(b.profile){case"circle":r=a;break;case"quad":r=4;break;default:return void e(b.profile)}switch(b.join??"simple"){case"round":u=s;break;case"miter":case"bevel":u=1;break;default:return}const o=2*r,y=r*u*2,n=y+o;let l=-2*y-o;switch(b.cap){case"none":break;case"butt":case"square":l+=2*(r-1);break;case"round":l+=2*(r*(t-1)*2+r);break;default:return}return new c({verticesPerFeature:l,verticesPerCoordinate:n,memory:i})}case"text":case"icon":return new c({verticesPerFeature:6,memory:i});default:return}}function C(r,t){const a="point-3d"===r.type;switch(t.type){case"extrude":return t.edges&&t.edges.size>0?E.EXTRUDE_EDGES:E.EXTRUDE;case"fill":return null!=t.outline&&t.outline.size>0?E.FILL_OUTLINE:E.FILL;case"water":return E.FILL;case"line":return"round"===t.join?E.LINE_ROUND:E.LINE_MITER;case"path":switch(t.join){case"round":switch(t.profile){case"circle":return E.PATH_ROUND_CIRCLE;case"quad":return E.PATH_ROUND_QUAD;default:return void e(t.profile)}case"miter":case"bevel":switch(t.profile){case"circle":return E.PATH_MITER_CIRCLE;case"quad":return E.PATH_MITER_QUAD;default:return void e(t.profile)}default:return}case"object":return a?E.OBJECT_POINT:E.OBJECT_POLYGON;case"icon":case"text":return a?E.ICON_POINT:E.ICON_POLYGON;default:return}}function f(e){const r=p[e];if(r)return r;const t=w(u(e,new l({})).levels);return p[e]=new c({verticesPerFeature:t}),p[e]}function w(e){return e.reduce(((e,r,t)=>e+r.numVertices*(1/10**t)),0)/e.reduce(((e,r,t)=>e+1/10**t),0)}const E={ICON_POINT:{bytesPerFeature:2111.586639736967,bytesPerFeatureLabel:870.520855,resourceBytes:0,draped:{bytesPerFeature:1799.2619971817762,bytesPerFeatureLabel:857.4890149999999}},ICON_POLYGON:{bytesPerFeature:2829.8183316810564,bytesPerFeatureLabel:858.0951816666667,resourceBytes:0,draped:{bytesPerFeature:2521.242008227286,bytesPerFeatureLabel:869.6919750000001}},OBJECT_POINT:{bytesPerFeature:607.8007336777831,bytesPerFeatureLabel:715.7017950000001,resourceBytes:0,draped:{bytesPerFeature:607.8007336777831,bytesPerFeatureLabel:715.7017950000001}},OBJECT_POLYGON:{bytesPerFeature:1111.4123028075749,bytesPerFeatureLabel:684.5498416666667,resourceBytes:0,draped:{bytesPerFeature:1111.4123028075749,bytesPerFeatureLabel:684.5498416666667}},LINE_MITER:{bytesPerFeature:3053.034748007272,bytesPerFeatureLabel:804.5473016666666,resourceBytes:0,draped:{bytesPerFeature:2649.5661560225844,bytesPerFeatureLabel:843.3404083333334}},LINE_ROUND:{bytesPerFeature:3225.35183564197,bytesPerFeatureLabel:807.296835,resourceBytes:0,draped:{bytesPerFeature:2650.9229994933276,bytesPerFeatureLabel:861.108335}},PATH_MITER_CIRCLE:{bytesPerFeature:38664.832646351235,bytesPerFeatureLabel:862.95665,resourceBytes:0,draped:{bytesPerFeature:38664.832646351235,bytesPerFeatureLabel:862.95665}},PATH_ROUND_CIRCLE:{bytesPerFeature:42462.97022293504,bytesPerFeatureLabel:851.35885,resourceBytes:0,draped:{bytesPerFeature:42462.97022293504,bytesPerFeatureLabel:851.35885}},PATH_MITER_QUAD:{bytesPerFeature:25558.22153327986,bytesPerFeatureLabel:838.56885,resourceBytes:0,draped:{bytesPerFeature:25558.22153327986,bytesPerFeatureLabel:838.56885}},PATH_ROUND_QUAD:{bytesPerFeature:42274.86801764233,bytesPerFeatureLabel:867.5658500000001,resourceBytes:0,draped:{bytesPerFeature:42274.86801764233,bytesPerFeatureLabel:867.5658500000001}},FILL:{bytesPerFeature:3124.272297197038,bytesPerFeatureLabel:850.6966816666666,resourceBytes:0,draped:{bytesPerFeature:2630.99580851019,bytesPerFeatureLabel:845.464495}},FILL_OUTLINE:{bytesPerFeature:4501.643043274039,bytesPerFeatureLabel:866.3982816666668,resourceBytes:0,draped:{bytesPerFeature:3841.8870233416183,bytesPerFeatureLabel:854.9969683333334}},EXTRUDE:{bytesPerFeature:7545.975968446941,bytesPerFeatureLabel:859.7106016666668,resourceBytes:0,draped:{bytesPerFeature:7545.975968446941,bytesPerFeatureLabel:859.7106016666668}},EXTRUDE_EDGES:{bytesPerFeature:2872.306473115409,bytesPerFeatureLabel:604.556581666667,resourceBytes:0,draped:{bytesPerFeature:2872.306473115409,bytesPerFeatureLabel:604.556581666667}}};export{d as averageSymbolComplexities,m as defaultSymbolComplexity,L as defaultSymbolLayerComplexity,C as defaultSymbolLayerMemoryComplexity,P as emptySymbolComplexity,w as estimateNumVerticesForLods,E as memoryEstimators,F as totalSymbolComplexities};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../geometry.js";import{throwIfAborted as e}from"../../../../core/promiseUtils.js";import{makeDehydratedPoint as o}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationInfo as t}from"../../../../support/elevationInfoUtils.js";import{evaluateElevationInfoAtPoint as r,SampleElevationInfo as n}from"./elevationAlignmentUtils.js";import{ElevationContext as s}from"./ElevationContext.js";import{extractExpressionInfo as i,createContext as a}from"./featureExpressionInfoUtils.js";import p from"../../../../geometry/SpatialReference.js";async function f(o,n,s,p,f){const{elevationProvider:d,renderCoordsHelper:j,spatialReference:u}=o,{elevationInfo:v}=n,y=i(v,!0),I=await a(y,u,f);e(f);const g=[],x=new Set,h=new Set;for(const{objectId:e,points:i}of p){const a=s(e);if(null==a){for(const e of i)g.push(e.z??0);x.add(e);continue}a.isDraped&&h.add(e);const p=a.graphic.geometry;c.setFromElevationInfo(t(p,v)),c.updateFeatureExpressionInfoContext(I,a.graphic,n),l.spatialReference=o.spatialReference;for(const{x:e,y:o,z:t}of i)l.x=e,l.y=o,l.z=t??0,r(l,d,c,j,m),g.push(m.z)}return{elevations:g,drapedObjectIds:h,failedObjectIds:x}}const c=new s,l=o(0,0,0,p.WGS84),m=new n;export{f as elevationAlignPointsInFeatures};
5
+ import"../../../../geometry.js";import{throwIfAborted as e}from"../../../../core/promiseUtils.js";import{makeDehydratedPoint as o}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationInfo as t}from"../../../../support/elevationInfoUtils.js";import{evaluateElevationInfoAtPoint as r,SampleElevationInfo as n}from"./elevationAlignmentUtils.js";import{ElevationContext as s}from"./ElevationContext.js";import{extractExpressionInfo as i,createContext as a}from"./featureExpressionInfoUtils.js";import p from"../../../../geometry/SpatialReference.js";async function f(o,n,s,f,d){const{elevationProvider:j,renderCoordsHelper:u}=o,{elevationInfo:I}=n,{pointsInFeatures:v,spatialReference:y}=f,g=p.fromJSON(y),x=i(I,!0),h=await a(x,g,d);e(d);const w=[],S=new Set,z=new Set;c.spatialReference=g;for(const{objectId:e,points:i}of v){const o=s(e);if(null==o){for(const e of i)w.push(e.z??0);S.add(e);continue}o.isDraped&&z.add(e);const a=o.graphic.geometry;m.setFromElevationInfo(t(a,I)),m.updateFeatureExpressionInfoContext(h,o.graphic,n);for(const{x:e,y:t,z:n}of i)c.x=e,c.y=t,c.z=n??0,r(c,j,m,u,l),w.push(l.z)}return{elevations:w,drapedObjectIds:z,failedObjectIds:S}}const m=new s,c=o(0,0,0,p.WGS84),l=new n;export{f as elevationAlignPointsInFeatures};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{assertIsSome as t}from"../../../../core/maybe.js";import{minPriority as o}from"../../../../core/MemCache.js";import{throwIfAborted as r}from"../../../../core/promiseUtils.js";import{generateUUID as n}from"../../../../core/uuid.js";import{n as s}from"../../../../chunks/mat3.js";import{a}from"../../../../chunks/mat3f64.js";import{h as i}from"../../../../chunks/vec3.js";import{O as l}from"../../../../chunks/vec3f64.js";import{projectBoundingSphere as d}from"../../../../geometry/projection/projectBoundingSphere.js";import{k as u}from"../../../../chunks/sphere.js";import{convertMeshMaterialToPBRMaterial as c}from"./I3SClientMaterialUtil.js";class m{constructor(e,t,o,r,n){this._uid=e,this._indexSR=t,this._renderSR=o,this._worker=n,this._id2Meta=new Map,this._oid2Meta=new Map,this._memCache=r.newCache(`sl-client-mesh-data-${this._uid}`)}get uid(){return this._uid}get worker(){return this._worker}get indexSR(){return this._indexSR}get renderSR(){return this._renderSR}createMeshNodeInfo(e,t){const o=`mesh${t}`,r=e.extent,n=r.spatialReference,s=this._indexSR,a=h(r,e.origin);d(a,n,a,s);return{type:"mesh",id:o,version:x(e),oid:t,mbs:a,componentNodeIds:[],unloadedMesh:e,nodeIndex:null,loadMeshPromise:null}}addMeshNode(t,o){if(null!=this.getMeshNodeIndex(o.oid))throw new e(`I3SClientNodeLoader: client side mesh for feature oid=${o.oid} already exists`);o.nodeIndex=t,this._id2Meta.set(o.id,o),this._oid2Meta.set(o.oid,o)}getMeshNodeIndex(e){const t=this._oid2Meta.get(e);return null==t||"mesh"!==t.type?null:t.nodeIndex}removeNode(e){const t=this._id2Meta.get(e);null!=t&&(this._id2Meta.delete(e),"mesh"===t.type&&this._oid2Meta.delete(t.oid))}async loadNodeJSON(t){const o=this._id2Meta.get(t);if(null==o)throw new e(`I3SClientNodeLoader::loadNodeJSON unable to find node ${t}`);switch(o.type){case"mesh":return this._loadMeshNodeJSON(o);case"mesh-component":return this._loadMeshComponentNodeJSON(o);default:throw new e(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${t}`)}}async _loadMeshNodeJSON(e){const t=e.id,o=(await this._getMeshData(e)).loadedMesh;if(null==o.components||0===o.components.length)return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const r=[],n=o.components;for(let s=0;s<n.length;++s){const o=`${t}-component${s}`,n={type:"mesh-component",id:o,mbs:e.mbs,componentIndex:s,meshNodeInfo:e,textureData:new Map};this._id2Meta.set(n.id,n),e.componentNodeIds.push(o),r.push({id:n.id,href:null,mbs:n.mbs,obb:null})}return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:r}}updateNodeIndex(e,t,o){const r=this._id2Meta.get(e);r&&"mesh"===r.type&&(r.nodeIndex=o)}async _loadMeshComponentNodeJSON(e){return{id:e.id,version:e.meshNodeInfo.version,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null,isEmpty:!1}}async loadNodeData(o,n){const s=this._id2Meta.get(o);if(null==s||"mesh-component"!==s.type)throw new e(`Failed to load client node data for node ${o} (unexpected node info)`);const a=s.meshNodeInfo,i=await this._getMeshData(a),l=i.loadedMesh,d=a.oid;if(null==l.components)throw new e(`Failed to load client node data for node ${o} (unexpected null reference)`);const u=l.components[s.componentIndex],{material:m,requiredTextures:h,textureData:y}=await c(u.material);if(null!=y)for(const e of y)null!=e&&s.textureData.set(e.id,e);const x={params:{material:m},type:"ArrayBufferView"},{vertexSpace:g,origin:M,transform:w}=l,_=[M.x,M.y,M.z??0],N={featureDataPosition:_,featureIds:[],geometries:[x]},b={attributeData:{},loadedAttributes:[]};i.projectionPromise||(t(this._worker,"SceneLayerWorker is needed to project mesh"),i.projectionPromise=this._worker.project({positions:l.vertexAttributes.position,localMatrix:w?.localMatrix,vertexSpace:g.toJSON(),origin:_,inSpatialReference:l.spatialReference.toJSON(),outSpatialReference:this._indexSR.toJSON()},n));const{projected:S,original:D}=await i.projectionPromise;l.vertexAttributes.position=D;const{transformed:v,original:I}=await f(u,i,this._worker,n);l.vertexAttributes.normal=I,r(n);const{geometryBuffer:j,geometryDescriptor:A}=p(S,u.faces,v,l.vertexAttributes.uv,l.vertexAttributes.color,d);return{geometryData:N,attributeDataInfo:b,geometryBuffer:j,geometryDescriptor:A,requiredTextures:h,textureData:y}}async loadAttributes(e,t,o){const r=e.numFeatures,n={};for(const{field:{name:s}}of t)n[s]=new Array(r);return n}async loadTextures(e,t,o){const r=e.id,n=this._id2Meta.get(r);if(null==n||"mesh-component"!==n.type)throw new Error(`Failed to load textures for node ${e.id} (unexpected node info)`);const s=[];for(const a of t)s.push(n.textureData.get(a.id)||null);return s}async _getMeshData(e){const t=e.version,r=this._memCache.get(t);if(null==r){if(null!=e.loadMeshPromise)return e.loadMeshPromise;const r=async(r,n)=>{const s=e.unloadedMesh.clone();try{await s.load()}catch(l){n(l)}const a=s.memoryUsage,i={loadedMesh:s,projectionPromise:null,normalsTransformPromise:null,usedMemoryInBytes:a};this._memCache.put(t,i,a,o),e.loadMeshPromise=null,r(i)};return e.loadMeshPromise=new Promise(((e,t)=>r(e,t))),e.loadMeshPromise}return r}}function h(e,t){const{spatialReference:o}=e,r=[1,-1],n=[.5*e.width,.5*e.height,e.hasZ?.5*(e.zmax-e.zmin):0],s=o.isGeographic?o.metersPerUnit:1,a=e.center;let i=0;if(e.hasZ)for(let l=0;l<2;++l)for(let e=0;e<2;++e)for(let o=0;o<2;++o){const d=(a.x+r[l]*n[0]-t.x)*s,u=(a.y+r[e]*n[1]-t.y)*s,c=a.z+r[o]*n[2]-t.z;i=Math.max(d*d+u*u+c*c,i)}else for(let l=0;l<2;++l)for(let e=0;e<2;++e){const o=(a.x+r[l]*n[0]-t.x)*s,d=(a.y+r[e]*n[1]-t.y)*s;i=Math.max(o*o+d*d,i)}return u([t.x,t.y,t.z],Math.sqrt(i))}async function f(e,o,r,n){const{transform:d,vertexAttributes:u}=o.loadedMesh,c="source"===e.shading?u.normal:null;if(!(null!=c&&null!=d&&(0!==d.rotationAngle||!i(d.scale,l))))return{transformed:c,original:u.normal};if(!o.normalsTransformPromise){t(r,"SceneLayerWorker is needed to transform mesh normals");const e=a();s(e,d.localMatrix),o.normalsTransformPromise=r.transformNormals({normalMatrix:e,normals:c},n)}return o.normalsTransformPromise}function p(e,t,o,r,n,s){const a=1,i=t.length/3,l=3*i;let d=0,u=0,c=!1,m=0,h=!1,f=0,p=!1,x=0,N=0,b=0;d+=g,d+=g,u=d,d+=3*l*M,null!=o&&(c=!0,m=d,d+=3*l*M),null!=r&&(h=!0,f=d,d+=2*l*M),null!=n&&(p=!0,x=d,d+=4*l*w),N=d,d+=a*_,b=d,d+=2*a*g;const S=new ArrayBuffer(d),D=new Uint8Array(S);y(D,0,l),y(D,g,a);const v=new Float32Array(S,u),I=null!=o?new Float32Array(S,m):null,j=null!=r?new Float32Array(S,f):null,A=null!=n?new Uint8Array(S,x):null;for(let y=0;y<i;++y){const s=3*y;for(let a=0;a<3;++a){const i=t[s+a],l=3*i,d=9*y+3*a;if(v[d]=e[l],v[d+1]=e[l+1],v[d+2]=e[l+2],null!=I&&(I[d]=o[l],I[d+1]=o[l+1],I[d+2]=o[l+2]),null!=j){const e=2*i,t=6*y+2*a;j[t]=r[e],j[t+1]=r[e+1]}if(null!=A){const e=4*i,t=12*y+4*a;A[t]=n[e],A[t+1]=n[e+1],A[t+2]=n[e+2],A[t+3]=n[e+3]}}}y(D,N,s),y(D,N+g,s/2**32),y(D,b,0),y(D,b+g,i-1);return{geometryBuffer:S,geometryDescriptor:{isDraco:!1,isLegacy:!0,color:p,normal:c,uv0:h,uvRegion:!1,featureIndex:!0}}}function y(e,t,o){e[t]=255&o,e[t+1]=255&o>>8,e[t+2]=255&o>>16,e[t+3]=255&o>>24}function x(e){const t=e.metadata.displaySource?.source;if(null==t||!Array.isArray(t)||!t.length||t[0]instanceof File)return n();const o=t;let r="";for(const n of o)r+=n.makeHash();return r+JSON.stringify(null!=e.transform?e.transform.toJSON():"")+(e.vertexSpace.isRelative?JSON.stringify(e.vertexSpace.origin):"")}const g=4,M=4,w=1,_=8;export{m as I3SClientNodeLoader,h as createSphereFromExtent,M as sizeOfFloat32,g as sizeOfInt32,_ as sizeOfUInt64,w as sizeOfUInt8,f as transformNormals};
5
+ import e from"../../../../core/Error.js";import{assertIsSome as t}from"../../../../core/maybe.js";import{minPriority as o}from"../../../../core/MemCache.js";import{throwIfAborted as r}from"../../../../core/promiseUtils.js";import{generateUUID as n}from"../../../../core/uuid.js";import{n as s}from"../../../../chunks/mat3.js";import{a}from"../../../../chunks/mat3f64.js";import{h as i}from"../../../../chunks/vec3.js";import{O as l}from"../../../../chunks/vec3f64.js";import{projectBoundingSphere as d}from"../../../../geometry/projection/projectBoundingSphere.js";import{k as u}from"../../../../chunks/sphere.js";import{convertMeshMaterialToPBRMaterial as c}from"./I3SClientMaterialUtil.js";class m{constructor(e,t,o,r){this._uid=e,this._worker=r,this._id2Meta=new Map,this._oid2Meta=new Map,this._indexSR=t.indexSR,this._vertexSR=t.vertexSR,this._renderSR=t.renderSR,this._localMode=t.localMode,this._memCache=o.newCache(`sl-client-mesh-data-${this._uid}`)}get uid(){return this._uid}get worker(){return this._worker}get indexSR(){return this._indexSR}get renderSR(){return this._renderSR}createMeshNodeInfo(e,t){const o=`mesh${t}`,r=e.extent,n=r.spatialReference,s=this._indexSR,a=h(r,e.origin);d(a,n,a,s);return{type:"mesh",id:o,version:y(e),oid:t,mbs:a,componentNodeIds:[],unloadedMesh:e,nodeIndex:null,loadMeshPromise:null}}addMeshNode(t,o){if(null!=this.getMeshNodeIndex(o.oid))throw new e(`I3SClientNodeLoader: client side mesh for feature oid=${o.oid} already exists`);o.nodeIndex=t,this._id2Meta.set(o.id,o),this._oid2Meta.set(o.oid,o)}getMeshNodeIndex(e){const t=this._oid2Meta.get(e);return null==t||"mesh"!==t.type?null:t.nodeIndex}removeNode(e){const t=this._id2Meta.get(e);null!=t&&(this._id2Meta.delete(e),"mesh"===t.type&&this._oid2Meta.delete(t.oid))}async loadNodeJSON(t){const o=this._id2Meta.get(t);if(null==o)throw new e(`I3SClientNodeLoader::loadNodeJSON unable to find node ${t}`);switch(o.type){case"mesh":return this._loadMeshNodeJSON(o);case"mesh-component":return this._loadMeshComponentNodeJSON(o);default:throw new e(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${t}`)}}async _loadMeshNodeJSON(e){const t=e.id,o=(await this._getMeshData(e)).loadedMesh;if(null==o.components||0===o.components.length)return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const r=[],n=o.components;for(let s=0;s<n.length;++s){const o=`${t}-component${s}`,n={type:"mesh-component",id:o,mbs:e.mbs,componentIndex:s,meshNodeInfo:e,textureData:new Map};this._id2Meta.set(n.id,n),e.componentNodeIds.push(o),r.push({id:n.id,href:null,mbs:n.mbs,obb:null})}return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:r}}updateNodeIndex(e,t,o){const r=this._id2Meta.get(e);r&&"mesh"===r.type&&(r.nodeIndex=o)}async _loadMeshComponentNodeJSON(e){return{id:e.id,version:e.meshNodeInfo.version,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null,isEmpty:!1}}async loadNodeData(o,n){const s=this._id2Meta.get(o);if(null==s||"mesh-component"!==s.type)throw new e(`Failed to load client node data for node ${o} (unexpected node info)`);const a=s.meshNodeInfo,i=await this._getMeshData(a),l=i.loadedMesh,d=a.oid;if(null==l.components)throw new e(`Failed to load client node data for node ${o} (unexpected null reference)`);const u=l.components[s.componentIndex],{material:m,requiredTextures:h,textureData:x}=await c(u.material);if(null!=x)for(const e of x)null!=e&&s.textureData.set(e.id,e);const y={params:{material:m},type:"ArrayBufferView"},{vertexSpace:M,origin:g,transform:_}=l,S=[g.x,g.y,g.z??0],w={featureDataPosition:S,featureIds:[],geometries:[y]},N={attributeData:{},loadedAttributes:[]};i.projectionPromise||(t(this._worker,"SceneLayerWorker is needed to project mesh"),i.projectionPromise=this._worker.project({positions:l.vertexAttributes.position,localMatrix:_?.localMatrix,vertexSpace:M.toJSON(),origin:S,inSpatialReference:l.spatialReference.toJSON(),outSpatialReference:this._vertexSR.toJSON(),localMode:this._localMode},n));const{projected:b,original:v}=await i.projectionPromise;l.vertexAttributes.position=v;const{transformed:D,original:R}=await f(u,i,this._worker,n);l.vertexAttributes.normal=R,r(n);const{geometryBuffer:I,geometryDescriptor:j}=p(b,u.faces,D,l.vertexAttributes.uv,l.vertexAttributes.color,d);return{geometryData:w,attributeDataInfo:N,geometryBuffer:I,geometryDescriptor:j,requiredTextures:h,textureData:x,normalReferenceFrame:this._vertexSR.isGeographic?"east-north-up":"vertex-reference-frame"}}async loadAttributes(e,t,o){const r=e.numFeatures,n={};for(const{field:{name:s}}of t)n[s]=new Array(r);return n}async loadTextures(e,t,o){const r=e.id,n=this._id2Meta.get(r);if(null==n||"mesh-component"!==n.type)throw new Error(`Failed to load textures for node ${e.id} (unexpected node info)`);const s=[];for(const a of t)s.push(n.textureData.get(a.id)||null);return s}async _getMeshData(e){const t=e.version,r=this._memCache.get(t);if(null==r){if(null!=e.loadMeshPromise)return e.loadMeshPromise;const r=async(r,n)=>{const s=e.unloadedMesh.clone();try{await s.load()}catch(l){n(l)}const a=s.memoryUsage,i={loadedMesh:s,projectionPromise:null,normalsTransformPromise:null,usedMemoryInBytes:a};this._memCache.put(t,i,a,o),e.loadMeshPromise=null,r(i)};return e.loadMeshPromise=new Promise(((e,t)=>r(e,t))),e.loadMeshPromise}return r}}function h(e,t){const{spatialReference:o}=e,r=[1,-1],n=[.5*e.width,.5*e.height,e.hasZ?.5*(e.zmax-e.zmin):0],s=o.isGeographic?o.metersPerUnit:1,a=e.center;let i=0;if(e.hasZ)for(let l=0;l<2;++l)for(let e=0;e<2;++e)for(let o=0;o<2;++o){const d=(a.x+r[l]*n[0]-t.x)*s,u=(a.y+r[e]*n[1]-t.y)*s,c=a.z+r[o]*n[2]-t.z;i=Math.max(d*d+u*u+c*c,i)}else for(let l=0;l<2;++l)for(let e=0;e<2;++e){const o=(a.x+r[l]*n[0]-t.x)*s,d=(a.y+r[e]*n[1]-t.y)*s;i=Math.max(o*o+d*d,i)}return u([t.x,t.y,t.z],Math.sqrt(i))}async function f(e,o,r,n){const{transform:d,vertexAttributes:u}=o.loadedMesh,c="source"===e.shading?u.normal:null;if(!(null!=c&&null!=d&&(0!==d.rotationAngle||!i(d.scale,l))))return{transformed:c,original:u.normal};if(!o.normalsTransformPromise){t(r,"SceneLayerWorker is needed to transform mesh normals");const e=a();s(e,d.localMatrix),o.normalsTransformPromise=r.transformNormals({normalMatrix:e,normals:c},n)}return o.normalsTransformPromise}function p(e,t,o,r,n,s){const a=1,i=t.length/3,l=3*i;let d=0,u=0,c=!1,m=0,h=!1,f=0,p=!1,y=0,w=0,N=0;d+=M,d+=M,u=d,d+=3*l*g,null!=o&&(c=!0,m=d,d+=3*l*g),null!=r&&(h=!0,f=d,d+=2*l*g),null!=n&&(p=!0,y=d,d+=4*l*_),w=d,d+=a*S,N=d,d+=2*a*M;const b=new ArrayBuffer(d),v=new Uint8Array(b);x(v,0,l),x(v,M,a);const D=new Float32Array(b,u),R=null!=o?new Float32Array(b,m):null,I=null!=r?new Float32Array(b,f):null,j=null!=n?new Uint8Array(b,y):null;for(let x=0;x<i;++x){const s=3*x;for(let a=0;a<3;++a){const i=t[s+a],l=3*i,d=9*x+3*a;if(D[d]=e[l],D[d+1]=e[l+1],D[d+2]=e[l+2],null!=R&&(R[d]=o[l],R[d+1]=o[l+1],R[d+2]=o[l+2]),null!=I){const e=2*i,t=6*x+2*a;I[t]=r[e],I[t+1]=r[e+1]}if(null!=j){const e=4*i,t=12*x+4*a;j[t]=n[e],j[t+1]=n[e+1],j[t+2]=n[e+2],j[t+3]=n[e+3]}}}x(v,w,s),x(v,w+M,s/2**32),x(v,N,0),x(v,N+M,i-1);return{geometryBuffer:b,geometryDescriptor:{isDraco:!1,isLegacy:!0,color:p,normal:c,uv0:h,uvRegion:!1,featureIndex:!0}}}function x(e,t,o){e[t]=255&o,e[t+1]=255&o>>8,e[t+2]=255&o>>16,e[t+3]=255&o>>24}function y(e){const t=e.metadata.displaySource?.source;if(null==t||!Array.isArray(t)||!t.length||t[0]instanceof File)return n();const o=t;let r="";for(const n of o)r+=n.makeHash();return r+JSON.stringify(null!=e.transform?e.transform.toJSON():"")+(e.vertexSpace.isRelative?JSON.stringify(e.vertexSpace.origin):"")}const M=4,g=4,_=1,S=8;export{m as I3SClientNodeLoader,h as createSphereFromExtent,g as sizeOfFloat32,M as sizeOfInt32,S as sizeOfUInt64,_ as sizeOfUInt8,f as transformNormals};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Logger.js";import{MemCacheStorage as s,MemCache as r}from"../../../core/MemCache.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{isMemoryManagedView as h}from"./MemoryManagedView.js";function y(e){return new _({view:e})}const u=.1,l=1,m=1,d=.75,n=.6,c=1.3;let _=class extends t{constructor(e){super(e),this._quality=1,this._usedMemory=0,this._updating=!1,this._stableQuality=0,this._downscaleMemoryUsed=0,this._canFastRecover=!1,this._memoryPredicted=0,this._cacheStorage=new s,this._warnMemoryUsage=null,this._numQualityChanges=0,this._maxMemory=750,this._additionalCacheMemory=0}destroy(){this._cacheStorage.destroy()}get maxMemory(){return this._maxMemory}set maxMemory(e){null==e||e<=0||(this._stableQuality=0,this._canFastRecover=!1,this._maxMemory<e&&this._updateQuality(l),this._maxMemory=e)}get additionalCacheMemory(){return this._additionalCacheMemory}set additionalCacheMemory(e){null!=e&&(this._additionalCacheMemory=e)}get memoryFactor(){return this._quality}get updating(){return this._updating}get usedMemory(){return this._usedMemory}get usedCacheMemory(){return this._cacheStorage.size}newCache(e,t){return new r(e,this._cacheStorage,t)}resetStableQuality(){this._stableQuality=0}disableMemCache(){this.additionalCacheMemory=-4096}update(){if(this._updateMemory(),this._memoryPredicted<=0&&!this._updating)return;let e=this._layersUpdating();if(this._memoryPredicted<n&&this._canFastRecover)this._downscaleMemoryUsed=0,this._stableQuality=0,this._canFastRecover=!1,this._updateQuality(l);else if(e)(this._memoryPredicted>1.1*m||this._usedMemory>m)&&(this._stableQuality>0?(this._downscaleMemoryUsed=0,this._updateQuality(this._stableQuality)):this._quality>u&&this._downscaleMemoryUsed<this._usedMemory&&(this._updateQuality(this._quality/c),this._downscaleMemoryUsed=this._usedMemory,this._canFastRecover=!1));else if(this._downscaleMemoryUsed=0,this._usedMemory>m)this._stableQuality=0,this._canFastRecover=!1,e=this._updateQuality(this._quality/c),this._downscaleMemoryUsed=this._memoryPredicted;else if(this._stableQuality!==this._quality)if(this._usedMemory<d&&this._quality<l){this._stableQuality=this._quality;const t=.05;e=this._updateQuality(this._quality+t)}else this._quality<1&&(this._canFastRecover=!0);this._updating=e}_updateQuality(e){return(e=Math.min(Math.max(e,u),l))!==this._quality&&(this._quality=e,++this._numQualityChanges,!0)}_layersUpdating(){return this.view.allLayerViews.some((e=>!!e.updating))}_updateMemory(){if(!this.view)return;let e=(this.view.basemapTerrain?.usedMemory??0)+(this.view._stage?.renderer?.usedMemory??0),t=0;this.view.allLayerViews&&this.view.allLayerViews.forEach((i=>{if(h(i)){const s=i.ignoresMemoryFactor?this._quality:1;e+=i.usedMemory*s,t+=i.unloadedMemory*s}}));const s=null==this._warnMemoryUsage||Math.round(10*e)!==Math.round(10*this._warnMemoryUsage),r=1048576*this.maxMemory;if(e>r&&s){this._warnMemoryUsage=e;const s=e=>(e/1048576).toLocaleString(void 0,{maximumFractionDigits:1})+" MB",a=Math.round(100*this._quality);i.getLogger(this).warn(`Memory Limit exceeded! Limit: ${s(r)} Current: ${s(e)} Projected: ${s(e+t)} Quality: ${a}%`)}this._usedMemory=e/r,this._memoryPredicted=(e+t)/r;const a=r-e;this._cacheStorage.maxSize=Math.max(0,a+1048576*this.additionalCacheMemory)}get test(){const e=this;return{cacheStorage:this._cacheStorage,resetQualityChanges:()=>{const t=e._numQualityChanges;return e._numQualityChanges=0,t}}}};e([a({constructOnly:!0})],_.prototype,"view",void 0),e([a()],_.prototype,"maxMemory",null),e([a()],_.prototype,"additionalCacheMemory",null),e([a({readOnly:!0})],_.prototype,"memoryFactor",null),e([a({readOnly:!0})],_.prototype,"updating",null),e([a({readOnly:!0})],_.prototype,"usedMemory",null),e([a({readOnly:!0})],_.prototype,"usedCacheMemory",null),e([a()],_.prototype,"_quality",void 0),e([a()],_.prototype,"_usedMemory",void 0),e([a()],_.prototype,"_updating",void 0),e([a()],_.prototype,"_stableQuality",void 0),e([a()],_.prototype,"_maxMemory",void 0),e([a()],_.prototype,"_additionalCacheMemory",void 0),_=e([o("esri.views.3d.support.MemoryController")],_);export{u as minQuality,y as newMemoryController};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Logger.js";import{MemCacheStorage as s,MemCache as r}from"../../../core/MemCache.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{isMemoryManagedView as y}from"./MemoryManagedView.js";function u(e){return new p({view:e})}const l=.1,d=1,m=1,n=.75,c=.6,_=1.3;let p=class extends t{constructor(e){super(e),this._quality=1,this._usedMemory=0,this._updating=!1,this._stableQuality=0,this._downscaleMemoryUsed=0,this._canFastRecover=!1,this._memoryPredicted=0,this._cacheStorage=new s,this._warnMemoryUsage=null,this._numQualityChanges=0,this._maxMemory=750,this._additionalCacheMemory=0,this.addHandles(a({prepare:()=>this._updateMemory()}))}destroy(){this._cacheStorage.destroy()}get maxMemory(){return this._maxMemory}set maxMemory(e){null==e||e<=0||(this._stableQuality=0,this._canFastRecover=!1,this._maxMemory<e&&this._updateQuality(d),this._maxMemory=e)}get additionalCacheMemory(){return this._additionalCacheMemory}set additionalCacheMemory(e){null!=e&&(this._additionalCacheMemory=e)}get memoryFactor(){return this._quality}get updating(){return this._updating}get usedMemory(){return this._usedMemory}get usedCacheMemory(){return this._cacheStorage.size}newCache(e,t){return new r(e,this._cacheStorage,t)}resetStableQuality(){this._stableQuality=0}disableMemCache(){this.additionalCacheMemory=-4096}update(){if(this._memoryPredicted<=0&&!this._updating)return;let e=this._layersUpdating();if(this._memoryPredicted<c&&this._canFastRecover)this._downscaleMemoryUsed=0,this._stableQuality=0,this._canFastRecover=!1,this._updateQuality(d);else if(e)(this._memoryPredicted>1.1*m||this._usedMemory>m)&&(this._stableQuality>0?(this._downscaleMemoryUsed=0,this._updateQuality(this._stableQuality)):this._quality>l&&this._downscaleMemoryUsed<this._usedMemory&&(this._updateQuality(this._quality/_),this._downscaleMemoryUsed=this._usedMemory,this._canFastRecover=!1));else if(this._downscaleMemoryUsed=0,this._usedMemory>m)this._stableQuality=0,this._canFastRecover=!1,e=this._updateQuality(this._quality/_),this._downscaleMemoryUsed=this._memoryPredicted;else if(this._stableQuality!==this._quality)if(this._usedMemory<n&&this._quality<d){this._stableQuality=this._quality;const t=.05;e=this._updateQuality(this._quality+t)}else this._quality<1&&(this._canFastRecover=!0);this._updating=e}_updateQuality(e){return(e=Math.min(Math.max(e,l),d))!==this._quality&&(this._quality=e,++this._numQualityChanges,!0)}_layersUpdating(){return this.view.allLayerViews.some((e=>!!e.updating))}_updateMemory(){if(!this.view)return;this.view._stage?.renderer?.tick();let e=(this.view.basemapTerrain?.usedMemory??0)+(this.view._stage?.renderer?.usedMemory??0),t=0;this.view.allLayerViews&&this.view.allLayerViews.forEach((i=>{if(y(i)){const s=i.ignoresMemoryFactor?this._quality:1;e+=i.usedMemory*s,t+=i.unloadedMemory*s}}));const s=null==this._warnMemoryUsage||Math.round(10*e)!==Math.round(10*this._warnMemoryUsage),r=1048576*this.maxMemory;if(e>r&&s){this._warnMemoryUsage=e;const s=e=>(e/1048576).toLocaleString(void 0,{maximumFractionDigits:1})+" MB",a=Math.round(100*this._quality);i.getLogger(this).warn(`Memory Limit exceeded! Limit: ${s(r)} Current: ${s(e)} Projected: ${s(e+t)} Quality: ${a}%`)}this._usedMemory=e/r,this._memoryPredicted=(e+t)/r;const a=r-e;this._cacheStorage.maxSize=Math.max(0,a+1048576*this.additionalCacheMemory)}get test(){const e=this;return{cacheStorage:this._cacheStorage,resetQualityChanges:()=>{const t=e._numQualityChanges;return e._numQualityChanges=0,t}}}};e([o({constructOnly:!0})],p.prototype,"view",void 0),e([o()],p.prototype,"maxMemory",null),e([o()],p.prototype,"additionalCacheMemory",null),e([o({readOnly:!0})],p.prototype,"memoryFactor",null),e([o({readOnly:!0})],p.prototype,"updating",null),e([o({readOnly:!0})],p.prototype,"usedMemory",null),e([o({readOnly:!0})],p.prototype,"usedCacheMemory",null),e([o()],p.prototype,"_quality",void 0),e([o()],p.prototype,"_usedMemory",void 0),e([o()],p.prototype,"_updating",void 0),e([o()],p.prototype,"_stableQuality",void 0),e([o()],p.prototype,"_maxMemory",void 0),e([o()],p.prototype,"_additionalCacheMemory",void 0),p=e([h("esri.views.3d.support.MemoryController")],p);export{l as minQuality,u as newMemoryController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Graphic.js";import{nativeArrayMaxSize as r}from"../../../core/typedArrayUtil.js";import{WorkerHandle as s}from"../../../core/workers/WorkerHandle.js";import t from"../../../geometry/SpatialReference.js";import o from"../../../layers/support/Field.js";class a{constructor(e){this._controller=e,this._handle=new i((r=>e.schedule(r)))}destroy(){this._handle.destroy()}invoke(r,s){return r.buffer&&0!==r.buffer.byteLength?(r.options.sourceSpatialReference&&r.options.sourceSpatialReference instanceof t&&(r.options={...r.options,sourceSpatialReference:r.options.sourceSpatialReference.toJSON()}),this._handle.invoke(r,s).then((r=>{let s=0,a=0;const i=async l=>{if(r.spatialReference=t.fromJSON(r.spatialReference),r.fields)for(;s<r.fields.length;)if(r.fields[s]=o.fromJSON(r.fields[s]),s++,l.madeProgress())return this._controller.reschedule((e=>i(e)));const c=r.spatialReference;for(;a<r.features.length;){const s=r.features[a];if(++a,s.uid=e.generateUID(),null!=s.geometry&&(s.geometry.spatialReference=c,n(s.geometry),l.madeProgress()))return this._controller.reschedule((e=>i(e)))}return r};return this._controller.schedule((e=>i(e)))}))):Promise.resolve(null)}}function n(e){switch(e.type){case"polyline":e.paths.reduce(((e,r)=>e+r.length),0)<r&&(e.paths=e.hasZ||e.hasM?e.paths.map((e=>e.map((e=>[e[0],e[1],e[2]])))):e.paths.map((e=>e.map((e=>[e[0],e[1]])))));break;case"polygon":e.rings.reduce(((e,r)=>e+r.length),0)<r&&(e.rings=e.hasZ||e.hasM?e.rings.map((e=>e.map((e=>[e[0],e[1],e[2]])))):e.rings.map((e=>e.map((e=>[e[0],e[1]])))))}}class i extends s{constructor(e){super("PBFDecoderWorker","_parseFeatureQuery",{_parseFeatureQuery:e=>[e.buffer]},e)}}export{a as PBFDecoder};
5
+ import e from"../../../Graphic.js";import{nativeArrayMaxSize as r}from"../../../core/typedArrayUtil.js";import{WorkerHandle as s}from"../../../core/workers/WorkerHandle.js";import t from"../../../geometry/SpatialReference.js";import o from"../../../layers/support/Field.js";class a{constructor(e){this._controller=e,this._handle=new i((r=>e.schedule(r)))}destroy(){this._handle.destroy()}invoke(r,s){return r.buffer&&0!==r.buffer.byteLength?(r.options.sourceSpatialReference&&r.options.sourceSpatialReference instanceof t&&(r.options={...r.options,sourceSpatialReference:r.options.sourceSpatialReference.toJSON()}),this._handle.invoke(r,s).then((r=>{let s=0,a=0;const i=t.fromJSON(r.spatialReference);r.spatialReference=i;const l=async t=>{if(r.fields)for(;s<r.fields.length;)if(r.fields[s]=o.fromJSON(r.fields[s]),s++,t.madeProgress())return this._controller.reschedule((e=>l(e)));for(;a<r.features.length;){const s=r.features[a];if(++a,s.uid=e.generateUID(),null!=s.geometry&&(s.geometry.spatialReference=i,n(s.geometry),t.madeProgress()))return this._controller.reschedule((e=>l(e)))}return r};return this._controller.schedule((e=>l(e)))}))):Promise.resolve(null)}}function n(e){switch(e.type){case"polyline":e.paths.reduce(((e,r)=>e+r.length),0)<r&&(e.paths=e.hasZ||e.hasM?e.paths.map((e=>e.map((e=>[e[0],e[1],e[2]])))):e.paths.map((e=>e.map((e=>[e[0],e[1]])))));break;case"polygon":e.rings.reduce(((e,r)=>e+r.length),0)<r&&(e.rings=e.hasZ||e.hasM?e.rings.map((e=>e.map((e=>[e[0],e[1],e[2]])))):e.rings.map((e=>e.map((e=>[e[0],e[1]])))))}}class i extends s{constructor(e){super("PBFDecoderWorker","_parseFeatureQuery",{_parseFeatureQuery:e=>[e.buffer]},e)}}export{a as PBFDecoder};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{removeMaybe as s,destroyMaybe as o}from"../../../core/maybe.js";import{watch as a,sync as i}from"../../../core/reactiveUtils.js";import{addFrameTask as m}from"../../../core/scheduling.js";import{signal as l}from"../../../core/signal.js";import{secondsFromMilliseconds as d}from"../../../core/time.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{maxDownloadSlots as p,downloadSlotsPerClient as h}from"./index.js";import{newMemoryController as c}from"./MemoryController.js";import{StreamDataLoader as _}from"./StreamDataLoader.js";import{ImmediateTask as y,newScheduler as g,TaskPriority as v}from"../../support/Scheduler.js";let f=class extends t{constructor(){super(...arguments),this.updating=!1}};function T(e){return new j({view:e})}e([n({readOnly:!0})],f.prototype,"updating",void 0),f=e([u("esri.views.3d.support.ResourceControllerMain")],f);let j=class extends f{constructor(){super(...arguments),this._immediateTask=y,this._normalTask=y,this._updatingObjects=l([]),this._frameTask=null}get immediate(){return this._immediateTask}get normal(){return this._normalTask}initialize(){this._scheduler=g(),this._memoryController=c(this.view),this._streamDataLoader=new _,this._streamDataLoader.setup(p,h,this._scheduler),this.addHandles([a((()=>this.view.state?.mode),(e=>{null!=e&&(this._scheduler.state=e)}),i),a((()=>this.view.stationary),(()=>this._stationaryChangedHandler()))]),this._frameTask=m({update:e=>this._frame(e)}),this._immediateTask=this._scheduler.registerTask(v.RESOURCE_CONTROLLER_IMMEDIATE),this._normalTask=this._scheduler.registerTask(v.RESOURCE_CONTROLLER)}destroy(){this._immediateTask.remove(),this._normalTask.remove(),this._frameTask=s(this._frameTask),this._streamDataLoader=o(this._streamDataLoader),this._memoryController=o(this._memoryController),this._scheduler=o(this._scheduler),this.view=null}get updating(){return!!(this._memoryController?.updating||this._streamDataLoader?.updating||this._immediateTask?.updating)||this._updatingObjects?.value.some((e=>e.updating))}get scheduler(){return this._scheduler}get memoryController(){return this._memoryController}createStreamDataRequester(e){const t=this._streamDataLoader;return{request:(r,s,o)=>t.request(r,s,e,o),get busy(){return!t.hasDownloadSlots(e)}}}addUpdatingObject(e){const t=this._updatingObjects;return t.value=[...t.value,e],r((()=>{t.value=t.value.filter((t=>t!==e))}))}_frame(e){this.view.suspended||this.view.stateManager&&(this.view.stateManager.step(d(e.deltaTime)),!this._scheduler)||(this._scheduler.updateBudget(e)?(this._memoryController.update(),this._scheduler.frame()):this._memoryController.updating&&this._memoryController.update())}_stationaryChangedHandler(){this.memoryController.resetStableQuality()}get test(){return{getQueueStats:e=>this._streamDataLoader.test.loadQueue.getStatsForType(e)}}};e([n()],j.prototype,"view",void 0),e([n()],j.prototype,"_scheduler",void 0),e([n()],j.prototype,"_memoryController",void 0),e([n()],j.prototype,"_streamDataLoader",void 0),e([n()],j.prototype,"_immediateTask",void 0),e([n()],j.prototype,"_normalTask",void 0),e([n()],j.prototype,"_updatingObjects",void 0),e([n({readOnly:!0})],j.prototype,"updating",null),j=e([u("esri.views.3d.support.ResourceControllerImpl")],j);export{T as newResourceController};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{removeMaybe as s,destroyMaybe as o}from"../../../core/maybe.js";import{watch as a,sync as i}from"../../../core/reactiveUtils.js";import{addFrameTask as m}from"../../../core/scheduling.js";import{signal as l}from"../../../core/signal.js";import{secondsFromMilliseconds as d}from"../../../core/time.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{maxDownloadSlots as p,downloadSlotsPerClient as h}from"./index.js";import{newMemoryController as c}from"./MemoryController.js";import{StreamDataLoader as _}from"./StreamDataLoader.js";import{ImmediateTask as y,newScheduler as g,TaskPriority as v}from"../../support/Scheduler.js";let f=class extends t{constructor(){super(...arguments),this.updating=!1}};function T(e){return new j({view:e})}e([n({readOnly:!0})],f.prototype,"updating",void 0),f=e([u("esri.views.3d.support.ResourceControllerMain")],f);let j=class extends f{constructor(){super(...arguments),this._immediateTask=y,this._normalTask=y,this._updatingObjects=l([]),this._frameTask=null}get immediate(){return this._immediateTask}get normal(){return this._normalTask}initialize(){this._scheduler=g(),this._memoryController=c(this.view),this._streamDataLoader=new _,this._streamDataLoader.setup(p,h,this._scheduler),this.addHandles([a((()=>this.view.state?.mode),(e=>{null!=e&&(this._scheduler.state=e)}),i),a((()=>this.view.stationary),(()=>this._stationaryChangedHandler()))]),this._frameTask=m({update:e=>this._frame(e)}),this._immediateTask=this._scheduler.registerTask(v.RESOURCE_CONTROLLER_IMMEDIATE),this._normalTask=this._scheduler.registerTask(v.RESOURCE_CONTROLLER)}destroy(){this._immediateTask.remove(),this._normalTask.remove(),this._frameTask=s(this._frameTask),this._streamDataLoader=o(this._streamDataLoader),this._memoryController=o(this._memoryController),this._scheduler=o(this._scheduler),this.view=null}get updating(){return!!(this._memoryController?.updating||this._streamDataLoader?.updating||this._immediateTask?.updating)||this._updatingObjects?.value.some((e=>e.updating))}get scheduler(){return this._scheduler}get memoryController(){return this._memoryController}createStreamDataRequester(e){const t=this._streamDataLoader;return{request:(r,s,o)=>t.request(r,s,e,o),get busy(){return!t.hasDownloadSlots(e)}}}addUpdatingObject(e){const t=this._updatingObjects;return t.value=[...t.value,e],r((()=>{t.value=t.value.filter((t=>t!==e))}))}_frame(e){this.view.suspended||this.view.stateManager&&(this.view.stateManager.step(d(e.deltaTime)),!this._scheduler)||(this._memoryController.update(),this._scheduler.updateBudget(e)&&this._scheduler.frame())}_stationaryChangedHandler(){this.memoryController.resetStableQuality()}get test(){return{getQueueStats:e=>this._streamDataLoader.test.loadQueue.getStatsForType(e)}}};e([n()],j.prototype,"view",void 0),e([n()],j.prototype,"_scheduler",void 0),e([n()],j.prototype,"_memoryController",void 0),e([n()],j.prototype,"_streamDataLoader",void 0),e([n()],j.prototype,"_immediateTask",void 0),e([n()],j.prototype,"_normalTask",void 0),e([n()],j.prototype,"_updatingObjects",void 0),e([n({readOnly:!0})],j.prototype,"updating",null),j=e([u("esri.views.3d.support.ResourceControllerImpl")],j);export{T as newResourceController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{releaseMaybe as e}from"../../../core/maybe.js";class t{constructor(e,t){this._fbos=e,this._format=t}get valid(){return null!=this._handle}dispose(){this._handle=e(this._handle)}get texture(){return this._handle?.colorTexture}bind(t,h,i){this._handle&&this._handle.fbo.width===h&&this._handle.fbo.height===i||(e(this._handle),this._handle=this._fbos.acquire(this._format,h,i)),t.bindFramebuffer(this._handle?.fbo)}generateMipMap(){this._handle?.colorTexture?.descriptor?.hasMipmap&&this._handle?.colorTexture?.generateMipmap()}}export{t as OverlayFramebufferObject};
5
+ import{releaseMaybe as e}from"../../../core/maybe.js";class t{constructor(e,t){this._fbos=e,this._format=t}get valid(){return null!=this._handle}dispose(){this._handle=e(this._handle)}get texture(){return this._handle?.colorTexture}bind(e,t,h){this._handle&&this._handle.fbo.width===t&&this._handle.fbo.height===h||(this._handle?.release(),this._handle=this._fbos.acquire(this._format,t,h)),e.bindFramebuffer(this._handle?.fbo)}generateMipMap(){this._handle?.colorTexture?.descriptor?.hasMipmap&&this._handle?.colorTexture?.generateMipmap()}}export{t as OverlayFramebufferObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{releaseMaybe as e}from"../../../../core/maybe.js";import{MemCachePool as t}from"../../../../core/MemCachePool.js";import{PixelFormat as r,SizedPixelFormat as o,TextureWrapMode as a,PixelType as s,TextureSamplingMode as h,RenderbufferFormat as c,ColorAttachment as i}from"../../../webgl/enums.js";import{FramebufferObject as n}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as p}from"../../../webgl/Texture.js";import{TextureDescriptor as d}from"../../../webgl/TextureDescriptor.js";class u{constructor(e){this.rctx=e,this._peakMemoryUsage=0,this._allocatedMemory=new Set,this._cache=new t(e.newCache,"FBOCache"),this._depthCache=new t(e.newCache,"DepthAttachmentCache"),this._colorCache=new t(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}resetPeakMemoryUsage(){this._peakMemoryUsage=this._accumulateMemory()}get peakMemoryUsage(){return this._peakMemoryUsage}acquire(e,t,r){const o=D(e,t,r),a=this._cache.pop(o)||new E(new n(this.rctx,{...y[e],width:t,height:r}),(e=>(a.releaseDepth(),a.depth=this._acquireDepth(e,a.fbo.width,a.fbo.height),a.fbo.attachDepthStencil(a.depth.attachment),a)),((e,o)=>{const s=this._acquireColor(e,t,r);return a.colors??=new Map,a.colors.set(o,s),a.fbo.attachColorTexture(s.attachment,o),a}));return a.release=()=>{this._allocatedMemory.delete(a),a.releaseDepth(),this._cache.put(o,a),a.release=()=>console.log(`Double FBO release in ${(new Error).stack}`)},this.rctx.unbindTexture(a.fbo.colorTexture),this._trackHandle(a)}acquireDepth(e,t,r){return this._acquireDepth(e,t,r)}_acquireDepth(e,t,r){const o=D(e,t,r),a=this._depthCache.pop(o);if(a)return this._trackHandle(a);const s=e===x.DEPTH_STENCIL_TEXTURE?new T(new p(this.rctx,{...B[e],width:t,height:r}),(()=>{this._allocatedMemory.delete(s),this._depthCache.put(o,s)})):new T(new l(this.rctx,{...B[e],width:t,height:r}),(()=>{this._allocatedMemory.delete(s),this._depthCache.put(o,s)}));return this._trackHandle(s)}_acquireColor(e,t,r){const o=D(e,t,r),a=this._colorCache.pop(o);if(a)return this._trackHandle(a);const s=new M(new p(this.rctx,{...y[e],width:t,height:r}),(()=>{this._allocatedMemory.delete(s),this._colorCache.put(o,s)}));return this._trackHandle(s)}_trackHandle(e){return this._allocatedMemory.add(e),this._peakMemoryUsage=Math.max(this._peakMemoryUsage,this._accumulateMemory()),e}_accumulateMemory(){return Array.from(this._allocatedMemory.values()).reduce(((e,t)=>e+("colorTexture"in t?t.colorTexture?.gpuMemoryUsage??0:t.usedMemory)),0)}}class E{constructor(e,t,r){this.fbo=e,this.acquireDepth=t,this.acquireColor=r,this.release=()=>{}}dispose(){this.fbo.dispose()}releaseDepth(){this.fbo.detachDepthStencilTexture(),this.fbo.detachDepthStencilBuffer(),this.depth=e(this.depth)}detachDepth(){const e=this.depth;return this.depth=void 0,this.fbo.detachDepthStencilTexture(),this.fbo.detachDepthStencilBuffer(),e}attachDepth(e){return this.releaseDepth(),e&&(this.fbo.attachDepthStencil(e.attachment),this.depth=e),this}releaseColor(t){this.fbo.detachColorTexture(t);const r=this.colors?.get(t);this.colors?.delete(t),e(r)}get colorTexture(){return this.fbo?.colorTexture}getColorTexture(e=i.COLOR_ATTACHMENT0){return this.fbo?.getColorTexture(e)}get usedMemory(){return this.fbo.gpuMemoryUsage}}class m{constructor(e,t){this.attachment=e,this.release=t}dispose(){this.attachment.dispose()}get usedMemory(){return this.attachment.gpuMemoryUsage}}class T extends m{}class M extends m{constructor(e,t){super(e,t),this.attachment=e,this.release=t}}function D(e,t,r){return`${e}x${t}x${r}`}var R;!function(e){e[e.RED=0]="RED",e[e.RG=1]="RG",e[e.RGBA4=2]="RGBA4",e[e.RGBA=3]="RGBA",e[e.RGBA_MIPMAP=4]="RGBA_MIPMAP",e[e.R16F=5]="R16F",e[e.RGBA16F=6]="RGBA16F"}(R||(R={}));const w=new d;w.pixelFormat=r.RED,w.internalFormat=o.R8,w.wrapMode=a.CLAMP_TO_EDGE;const C=new d;C.pixelFormat=r.RG,C.internalFormat=o.RG8,C.wrapMode=a.CLAMP_TO_EDGE;const F=new d;F.internalFormat=o.RGBA4,F.dataType=s.UNSIGNED_SHORT_4_4_4_4,F.wrapMode=a.CLAMP_TO_EDGE;const f=new d;f.wrapMode=a.CLAMP_TO_EDGE;const A=new d;A.wrapMode=a.CLAMP_TO_EDGE,A.samplingMode=h.LINEAR_MIPMAP_LINEAR,A.hasMipmap=!0,A.maxAnisotropy=8;const g=new d;g.pixelFormat=r.RED,g.dataType=s.HALF_FLOAT,g.internalFormat=o.R16F,g.samplingMode=h.NEAREST;const P=new d;P.dataType=s.HALF_FLOAT,P.internalFormat=o.RGBA16F,P.samplingMode=h.NEAREST;const y={[R.RED]:w,[R.RG]:C,[R.RGBA4]:F,[R.RGBA]:f,[R.RGBA_MIPMAP]:A,[R.R16F]:g,[R.RGBA16F]:P};var x;!function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH_STENCIL_BUFFER=1]="DEPTH_STENCIL_BUFFER",e[e.DEPTH24_BUFFER=2]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=3]="DEPTH16_BUFFER"}(x||(x={}));const b=new d;b.pixelFormat=r.DEPTH_STENCIL,b.dataType=s.UNSIGNED_INT_24_8,b.samplingMode=h.NEAREST,b.wrapMode=a.CLAMP_TO_EDGE;const B={[x.DEPTH_STENCIL_TEXTURE]:b,[x.DEPTH_STENCIL_BUFFER]:new _(c.DEPTH24_STENCIL8,4),[x.DEPTH24_BUFFER]:new _(c.DEPTH_COMPONENT24,4),[x.DEPTH16_BUFFER]:new _(c.DEPTH_COMPONENT16,4)};export{R as ColorFormat,x as DepthFormat,u as FBOCache};
5
+ import{releaseMaybe as e}from"../../../../core/maybe.js";import{FBOPool as t}from"./FBOPool.js";import{PixelFormat as r,SizedPixelFormat as h,TextureWrapMode as s,PixelType as o,TextureSamplingMode as i,RenderbufferFormat as a,ColorAttachment as c}from"../../../webgl/enums.js";import{FramebufferObject as n}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as _}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as p}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as d}from"../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../webgl/TextureDescriptor.js";class u{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new t(e.newCache,"FBOCache"),this._depthCache=new t(e.newCache,"DepthAttachmentCache"),this._colorCache=new t(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}tick(){this._cache.tick(),this._colorCache.tick(),this._depthCache.tick()}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("colorTexture"in t?t.colorTexture?.gpuMemoryUsage??0:t.usedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(e,t,r){const h=R(e,t,r),s=this._cache.pop(h)||new E(h,new n(this.rctx,{...b[e],width:t,height:r}),(e=>(s.releaseDepth(),s.depth=this._acquireDepth(e,s.fbo.width,s.fbo.height),s.fbo.attachDepthStencil(s.depth.attachment),s)),((e,h)=>{const o=this._acquireColor(e,t,r);return s.colors??=new Map,s.colors.set(h,o),s.fbo.attachColorTexture(o.attachment,h),s}));return s.release=()=>{this._acquired.delete(s),s.releaseDepth(),this._cache.put(s),s.release=()=>console.log(`Double FBO release in ${(new Error).stack}`)},this.rctx.unbindTexture(s.fbo.colorTexture),this._trackHandle(s)}acquireDepth(e,t,r){return this._acquireDepth(e,t,r)}_acquireDepth(e,t,r){const h=R(e,t,r),s=this._depthCache.pop(h);if(s)return this._trackHandle(s);const o=e===g.DEPTH_STENCIL_TEXTURE?new m(h,new d(this.rctx,{...G[e],width:t,height:r}),(()=>{this._acquired.delete(o),this._depthCache.put(o)})):new m(h,new _(this.rctx,{...G[e],width:t,height:r}),(()=>{this._acquired.delete(o),this._depthCache.put(o)}));return this._trackHandle(o)}_acquireColor(e,t,r){const h=R(e,t,r),s=this._colorCache.pop(h);if(s)return this._trackHandle(s);const o=new D(h,new d(this.rctx,{...b[e],width:t,height:r}),(()=>{this._acquired.delete(o),this._colorCache.put(o)}));return this._trackHandle(o)}_trackHandle(e){return this._acquired.add(e),e}}class E{constructor(e,t,r,h){this.key=e,this.fbo=t,this.acquireDepth=r,this.acquireColor=h,this.release=()=>{},this.incarnation=0}dispose(){this.fbo.dispose()}releaseDepth(){this.fbo.detachDepthStencilTexture(),this.fbo.detachDepthStencilBuffer(),this.depth=e(this.depth)}detachDepth(){const e=this.depth;return this.depth=void 0,this.fbo.detachDepthStencilTexture(),this.fbo.detachDepthStencilBuffer(),e}attachDepth(e){return this.releaseDepth(),e&&(this.fbo.attachDepthStencil(e.attachment),this.depth=e),this}releaseColor(t){this.fbo.detachColorTexture(t);const r=this.colors?.get(t);this.colors?.delete(t),e(r)}get colorTexture(){return this.fbo?.colorTexture}getColorTexture(e=c.COLOR_ATTACHMENT0){return this.fbo?.getColorTexture(e)}get usedMemory(){return this.fbo.gpuMemoryUsage}}class T{constructor(e,t,r){this.key=e,this.attachment=t,this.release=r,this.incarnation=0}dispose(){this.attachment.dispose()}get usedMemory(){return this.attachment.gpuMemoryUsage}}class m extends T{}class D extends T{constructor(e,t,r){super(e,t,r),this.attachment=t,this.release=r}}function R(e,t,r){return`${e}x${t}x${r}`}var C;!function(e){e[e.RED=0]="RED",e[e.RG=1]="RG",e[e.RGBA4=2]="RGBA4",e[e.RGBA=3]="RGBA",e[e.RGBA_MIPMAP=4]="RGBA_MIPMAP",e[e.R16F=5]="R16F",e[e.RGBA16F=6]="RGBA16F"}(C||(C={}));const w=new l;w.pixelFormat=r.RED,w.internalFormat=h.R8,w.wrapMode=s.CLAMP_TO_EDGE;const F=new l;F.pixelFormat=r.RG,F.internalFormat=h.RG8,F.wrapMode=s.CLAMP_TO_EDGE;const f=new l;f.internalFormat=h.RGBA4,f.dataType=o.UNSIGNED_SHORT_4_4_4_4,f.wrapMode=s.CLAMP_TO_EDGE;const A=new l;A.wrapMode=s.CLAMP_TO_EDGE;const M=new l;M.wrapMode=s.CLAMP_TO_EDGE,M.samplingMode=i.LINEAR_MIPMAP_LINEAR,M.hasMipmap=!0,M.maxAnisotropy=8;const P=new l;P.pixelFormat=r.RED,P.dataType=o.HALF_FLOAT,P.internalFormat=h.R16F,P.samplingMode=i.NEAREST;const x=new l;x.dataType=o.HALF_FLOAT,x.internalFormat=h.RGBA16F,x.samplingMode=i.NEAREST;const b={[C.RED]:w,[C.RG]:F,[C.RGBA4]:f,[C.RGBA]:A,[C.RGBA_MIPMAP]:M,[C.R16F]:P,[C.RGBA16F]:x};var g;!function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH_STENCIL_BUFFER=1]="DEPTH_STENCIL_BUFFER",e[e.DEPTH24_BUFFER=2]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=3]="DEPTH16_BUFFER"}(g||(g={}));const B=new l;B.pixelFormat=r.DEPTH_STENCIL,B.dataType=o.UNSIGNED_INT_24_8,B.samplingMode=i.NEAREST,B.wrapMode=s.CLAMP_TO_EDGE;const G={[g.DEPTH_STENCIL_TEXTURE]:B,[g.DEPTH_STENCIL_BUFFER]:new p(a.DEPTH24_STENCIL8,4),[g.DEPTH24_BUFFER]:new p(a.DEPTH_COMPONENT24,4),[g.DEPTH16_BUFFER]:new p(a.DEPTH_COMPONENT16,4)};export{C as ColorFormat,g as DepthFormat,u as FBOCache};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
+ */
5
+ import{MemCachePool as t}from"../../../../core/MemCachePool.js";import s from"../../../../core/PooledArray.js";class i{constructor(i,e){this._last=new s,this._incarnation=0,this._cache=new t(i,e)}destroy(){this._last?.forAll((t=>t.dispose())),this._last=null,this._cache.destroy()}set interactive(t){t&&!this._last?this._last=new s:t||(this._last?.forAll((t=>t.dispose())),this._last=null)}tick(){this._last?.filterInPlace((t=>!(t.incarnation<this._incarnation)||(this._cache.put(t.key,t),!1))),++this._incarnation}pop(t){if(this._last){const s=this._last.find((s=>s.key===t));if(s)return this._last.removeUnordered(s),s}return this._cache.pop(t)}put(t){t.incarnation=this._incarnation,this._last?this._last.push(t):this._cache.put(t.key,t)}get usedMemory(){return this._last?.reduce(((t,s)=>t+s.usedMemory),0)??0}}export{i as FBOPool};
@@ -2,25 +2,28 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{n as r}from"../../../../../../chunks/mat3.js";import{a as o}from"../../../../../../chunks/mat3f64.js";import{I as n}from"../../../../../../chunks/mat4f64.js";import{s as a}from"../../../../../../chunks/vec3.js";import{c as i}from"../../../../../../chunks/vec3f64.js";import{ShaderOutput as t}from"../ShaderOutput.js";import{DoublePrecision as s}from"../util/DoublePrecision.glsl.js";import{addViewNormal as l}from"../util/View.glsl.js";import{Float3DrawUniform as m}from"../../shaderModules/Float3DrawUniform.js";import{NoParameters as c,glsl as d}from"../../shaderModules/interfaces.js";import{Matrix3PassUniform as u}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4PassUniform as v}from"../../shaderModules/Matrix4PassUniform.js";import{ShaderTechniqueConfiguration as p,parameter as M}from"../../shaderTechnique/ShaderTechniqueConfiguration.js";import{VertexAttribute as f}from"../../../lib/VertexAttribute.js";import{encodeDoubleHi as x,encodeDoubleLo as g}from"../../../../../webgl/doublePrecisionUtils.js";class O extends p{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}e([M()],O.prototype,"instancedDoublePrecision",void 0),e([M()],O.prototype,"hasModelTransformation",void 0);class h extends c{constructor(){super(...arguments),this.modelTransformation=null}}const w=o();function N(e,o){const i=o.hasModelTransformation,c=o.instancedDoublePrecision;i&&(e.vertex.uniforms.add(new v("model",(e=>e.modelTransformation??n))),e.vertex.uniforms.add(new u("normalLocalOriginFromModel",(e=>(r(w,e.modelTransformation??n),w))))),o.instanced&&c&&(e.attributes.add(f.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(f.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(f.INSTANCEMODEL,"mat3"),e.attributes.add(f.INSTANCEMODELNORMAL,"mat3"));const p=e.vertex;c&&(p.include(s,o),p.uniforms.add(new m("viewOriginHi",((e,r)=>x(a(T,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]),T))),new m("viewOriginLo",((e,r)=>g(a(T,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]),T))))),p.code.add(d`
5
+ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{n as o}from"../../../../../../chunks/mat3.js";import{a as r}from"../../../../../../chunks/mat3f64.js";import{I as n}from"../../../../../../chunks/mat4f64.js";import{s as a}from"../../../../../../chunks/vec3.js";import{c as i}from"../../../../../../chunks/vec3f64.js";import{ShaderOutput as t}from"../ShaderOutput.js";import{DoublePrecision as s}from"../util/DoublePrecision.glsl.js";import{addViewNormal as m}from"../util/View.glsl.js";import{Float3DrawUniform as l}from"../../shaderModules/Float3DrawUniform.js";import{NoParameters as c,glsl as d}from"../../shaderModules/interfaces.js";import{Matrix3PassUniform as u}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4PassUniform as p}from"../../shaderModules/Matrix4PassUniform.js";import{ShaderTechniqueConfiguration as v,parameter as f}from"../../shaderTechnique/ShaderTechniqueConfiguration.js";import{VertexAttribute as M}from"../../../lib/VertexAttribute.js";import{encodeDoubleHi as g,encodeDoubleLo as x}from"../../../../../webgl/doublePrecisionUtils.js";class h extends v{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}e([f()],h.prototype,"instancedDoublePrecision",void 0),e([f()],h.prototype,"hasModelTransformation",void 0);class O extends c{constructor(){super(...arguments),this.modelTransformation=null}}const w=r();function N(e,r){const i=r.hasModelTransformation,c=r.instancedDoublePrecision;i&&(e.vertex.uniforms.add(new p("model",(e=>e.modelTransformation??n))),e.vertex.uniforms.add(new u("normalLocalOriginFromModel",(e=>(o(w,e.modelTransformation??n),w))))),r.instanced&&c&&(e.attributes.add(M.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(M.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(M.INSTANCEMODEL,"mat3"),e.attributes.add(M.INSTANCEMODELNORMAL,"mat3"));const v=e.vertex;c&&(v.include(s,r),v.uniforms.add(new l("viewOriginHi",((e,o)=>g(a(T,o.camera.viewInverseTransposeMatrix[3],o.camera.viewInverseTransposeMatrix[7],o.camera.viewInverseTransposeMatrix[11]),T))),new l("viewOriginLo",((e,o)=>x(a(T,o.camera.viewInverseTransposeMatrix[3],o.camera.viewInverseTransposeMatrix[7],o.camera.viewInverseTransposeMatrix[11]),T))))),v.code.add(d`
6
6
  vec3 getVertexInLocalOriginSpace() {
7
7
  return ${i?c?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":c?"instanceModel * localPosition().xyz":"localPosition().xyz"};
8
8
  }
9
9
 
10
10
  vec3 subtractOrigin(vec3 _pos) {
11
11
  ${c?d`
12
- vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -instanceModelOriginHi, -instanceModelOriginLo);
12
+ // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped
13
+ // working for macOS 14+ and iOS 17+.
14
+ // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
15
+ vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo);
13
16
  return _pos - originDelta;`:"return vpos;"}
14
17
  }
15
- `),p.code.add(d`
18
+ `),v.code.add(d`
16
19
  vec3 dpNormal(vec4 _normal) {
17
20
  return normalize(${i?c?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":c?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
18
21
  }
19
- `),o.output===t.Normal&&(l(p),p.code.add(d`
22
+ `),r.output===t.Normal&&(m(v),v.code.add(d`
20
23
  vec3 dpNormalView(vec4 _normal) {
21
24
  return normalize((viewNormal * ${i?c?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":c?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
22
25
  }
23
- `)),o.hasVertexTangents&&p.code.add(d`
26
+ `)),r.hasVertexTangents&&v.code.add(d`
24
27
  vec4 dpTransformVertexTangent(vec4 _tangent) {
25
28
  ${i?c?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":c?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
26
- }`)}const T=i();export{O as InstancedDoubleConfiguration,h as InstancedDoublePassParameters,N as InstancedDoublePrecision};
29
+ }`)}const T=i();export{h as InstancedDoubleConfiguration,O as InstancedDoublePassParameters,N as InstancedDoublePrecision};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{s as n}from"../../../../../chunks/vec2.js";import{ColorFormat as c}from"../../core/FBOCache.js";import{SyncRenderPlugin as m,ConsumesDepthNormal as l,ConsumesNone as u}from"../RenderPlugin.js";import{SSAOBlurTechnique as h}from"./SSAOBlurTechnique.js";import{noiseData as p}from"./SSAONoiseData.js";import{SSAOPassParameters as _,BlurDrawParameters as d}from"./SSAOParameters.js";import{SSAOTechnique as b}from"./SSAOTechnique.js";import{RenderFeature as f}from"../../lib/RenderFeature.js";import{RenderSlot as w}from"../../lib/RenderSlot.js";import{g as T}from"../../../../../chunks/SSAO.glsl.js";import{TextureWrapMode as x,PixelFormat as P,ClearBufferBit as S}from"../../../../webgl/enums.js";import{Texture as q}from"../../../../webgl/Texture.js";import{TextureDescriptor as j}from"../../../../webgl/TextureDescriptor.js";const R=2;let y=class extends m{constructor(e){super(e),this._context=null,this._passParameters=new _,this._drawParameters=new d,this.produces=new Map([[w.SSAO,()=>this._produces()]])}_produces(){return null!=this._enableTime&&null!=this._context}consumes(){return this._produces()?l:u}initializeRenderContext(e){this._context=e,this.addHandles([r((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(f.SSAO)),(e=>e?this._enable():this._disable()),s)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=t(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;const e=Uint8Array.from(atob(p),(e=>e.charCodeAt(0))),t=new j;t.wrapMode=x.CLAMP_TO_EDGE,t.pixelFormat=P.RGB,t.wrapMode=x.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new q(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(b)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(h)),this._enableTime=i(0),this._context?.requestRender()}renderNode(e,t,r){const s=e.bindParameters,i=s.linearDepth?.colorTexture,o=r?.normal?.colorTexture;if(null==this._enableTime||null==this._context||null==i||!o)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,m=s.camera,l=this.view.qualitySettings.fadeDuration,u=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=o,this._passParameters.depthTexture=i,this._passParameters.projScale=1/m.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*O/T(m)**6*u;const h=m.fullViewport[2],p=m.fullViewport[3],_=h/R,d=p/R,b=this._context.fbos,f=b.acquire(c.RED,h,p);a.bindFramebuffer(f.fbo),a.setViewport(0,0,h,p);a.bindTechnique(this._ssaoTechnique,this._passParameters,s).bindDraw(this._drawParameters,s,this._passParameters),a.screen.draw();const w=a.bindTechnique(this._blurTechnique,this._passParameters,s);a.setViewport(0,0,_,d);const x=b.acquire(c.RED,_,d);a.bindFramebuffer(x.fbo),this._drawParameters.colorTexture=f.colorTexture,n(this._drawParameters.blurSize,0,R/p),w.bindDraw(this._drawParameters,s,this._passParameters),a.setViewport(0,0,_,d),a.screen.draw(),f.release();const P=b.acquire(c.RED,_,d);return a.bindFramebuffer(P.fbo),a.setViewport(0,0,h,p),a.setClearColor(1,1,1,0),a.clear(S.COLOR_BUFFER_BIT),a.setViewport(0,0,_,d),this._drawParameters.colorTexture=x.colorTexture,n(this._drawParameters.blurSize,R/h,0),w.bindDraw(this._drawParameters,s,this._passParameters),a.screen.draw(),a.setViewport4fv(m.fullViewport),x.release(),u<1&&this._context.requestRender(),P}};e([o({constructOnly:!0})],y.prototype,"view",void 0),e([o()],y.prototype,"_context",void 0),y=e([a("esri.views.3d.webgl-engine.effects.ssao.SSAO")],y);const O=.5;export{y as SSAO,R as blurSizePixels};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{s as n}from"../../../../../chunks/vec2.js";import{ColorFormat as c}from"../../core/FBOCache.js";import{SyncRenderPlugin as m,ConsumesDepthNormal as u,ConsumesNone as l}from"../RenderPlugin.js";import{SSAOBlurTechnique as h}from"./SSAOBlurTechnique.js";import{noiseData as p}from"./SSAONoiseData.js";import{SSAOPassParameters as _,BlurDrawParameters as d}from"./SSAOParameters.js";import{SSAOTechnique as b}from"./SSAOTechnique.js";import{RenderFeature as f}from"../../lib/RenderFeature.js";import{RenderSlot as w}from"../../lib/RenderSlot.js";import{g as T}from"../../../../../chunks/SSAO.glsl.js";import{TextureWrapMode as x,PixelFormat as P,ClearBufferBit as S}from"../../../../webgl/enums.js";import{Texture as q}from"../../../../webgl/Texture.js";import{TextureDescriptor as j}from"../../../../webgl/TextureDescriptor.js";const R=2;let y=class extends m{constructor(e){super(e),this._context=null,this._passParameters=new _,this._drawParameters=new d,this.produces=new Map([[w.SSAO,()=>this._produces()]])}_produces(){return null!=this._enableTime&&null!=this._context}consumes(){return this._produces()?u:l}initializeRenderContext(e){this._context=e,this.addHandles([r((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(f.SSAO)),(e=>e?this._enable():this._disable()),s)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=t(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;const e=Uint8Array.from(atob(p),(e=>e.charCodeAt(0))),t=new j;t.wrapMode=x.CLAMP_TO_EDGE,t.pixelFormat=P.RGB,t.wrapMode=x.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new q(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(b)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(h)),this._enableTime=i(0),this._context?.requestRender()}renderNode(e,t,r){const s=e.bindParameters,i=s.linearDepth?.colorTexture,o=r?.normal?.colorTexture;if(null==this._enableTime||null==this._context||null==i||!o)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,m=s.camera,u=this.view.qualitySettings.fadeDuration,l=u>0?Math.min(u,e.time-this._enableTime)/u:1;this._passParameters.normalTexture=o,this._passParameters.depthTexture=i,this._passParameters.projScale=1/m.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*O/T(m)**6*l;const h=m.fullViewport[2],p=m.fullViewport[3],_=Math.round(h/R),d=Math.round(p/R),b=this._context.fbos,f=b.acquire(c.RED,h,p);a.bindFramebuffer(f.fbo),a.setViewport(0,0,h,p);a.bindTechnique(this._ssaoTechnique,this._passParameters,s).bindDraw(this._drawParameters,s,this._passParameters),a.screen.draw();const w=a.bindTechnique(this._blurTechnique,this._passParameters,s);a.setViewport(0,0,_,d);const x=b.acquire(c.RED,_,d);a.bindFramebuffer(x.fbo),this._drawParameters.colorTexture=f.colorTexture,n(this._drawParameters.blurSize,0,R/p),w.bindDraw(this._drawParameters,s,this._passParameters),a.setViewport(0,0,_,d),a.screen.draw(),f.release();const P=b.acquire(c.RED,_,d);return a.bindFramebuffer(P.fbo),a.setViewport(0,0,h,p),a.setClearColor(1,1,1,0),a.clear(S.COLOR_BUFFER_BIT),a.setViewport(0,0,_,d),this._drawParameters.colorTexture=x.colorTexture,n(this._drawParameters.blurSize,R/h,0),w.bindDraw(this._drawParameters,s,this._passParameters),a.screen.draw(),a.setViewport4fv(m.fullViewport),x.release(),l<1&&this._context.requestRender(),P}};e([o({constructOnly:!0})],y.prototype,"view",void 0),e([o()],y.prototype,"_context",void 0),y=e([a("esri.views.3d.webgl-engine.effects.ssao.SSAO")],y);const O=.5;export{y as SSAO,R as blurSizePixels};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import e from"../../../../core/Logger.js";import{lerp as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as h}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{h as a,m as p,q as u,a as _,i as v,t as l,u as c}from"../../../../chunks/mat4.js";import{a as w}from"../../../../chunks/mat4f64.js";import{j as d,m as y}from"../../../../chunks/vec2.js";import{f as g}from"../../../../chunks/vec2f64.js";import{f,o as m,c as x,h as M,u as T,j as D,F as j,y as R,i as P,l as F,s as O,b as V,n as S,C}from"../../../../chunks/vec3.js";import{c as I}from"../../../../chunks/vec3f64.js";import{b,e as E,h as L,c as H,i as k,t as U}from"../../../../chunks/vec4.js";import{f as B,c as G}from"../../../../chunks/vec4f64.js";import{create as A,copy as z,fromMatrix as W}from"../../../../geometry/support/frustum.js";import{create as X}from"../../../../geometry/support/ray.js";import{projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{ViewingMode as q}from"../../../ViewingMode.js";import{fovd2fovx as N,fovx2fovd as J,fovd2fovy as K,fovy2fovd as Q}from"./fov.js";var Z;let $=Z=class extends i{constructor(t={}){super(t),this._center=I(),this._up=I(),this._viewUp=I(),this._viewForward=I(),this._viewRight=I(),this._ray=X(),this._viewport=B(0,0,1,1),this._padding=B(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=g(1,1e3),this._viewDirty=!0,this._viewMatrix=w(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=w(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=w(),this._frustumDirty=!0,this._frustum=A(),this._fullViewport=G(),this._pixelRatio=1,this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return f(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){a(this._viewMatrix,t),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),this._viewForward}get viewUp(){return this._ensureViewClean(),this._viewUp}get viewRight(){return this._ensureViewClean(),this._viewRight}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=b(G(),this._viewport,1/this.pixelRatio),i=this._get("screenViewport");return i&&E(t,i)?i:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=b(G(),this._padding,1/this.pixelRatio),i=this._get("screenPadding");return i&&E(t,i)?i:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[ht.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[ht.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[ht.RIGHT]+this._padding[ht.LEFT]}set fullWidth(t){this.width=t-(this._padding[ht.RIGHT]+this._padding[ht.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[ht.TOP]+this._padding[ht.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[ht.TOP]+this._padding[ht.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[ht.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[ht.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){L(this._padding,t)||(this._viewport[0]+=t[ht.LEFT]-this._padding[ht.LEFT],this._viewport[1]+=t[ht.BOTTOM]-this._padding[ht.BOTTOM],this._viewport[2]-=t[ht.RIGHT]+t[ht.LEFT]-(this._padding[ht.RIGHT]+this._padding[ht.LEFT]),this._viewport[3]-=t[ht.TOP]+t[ht.BOTTOM]-(this._padding[ht.TOP]+this._padding[ht.BOTTOM]),H(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(p(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2),r=e*this._aspect,s=u(w(),-r*(1+2*this._padding[ht.LEFT]/t),r*(1+2*this._padding[ht.RIGHT]/t),-e*(1+2*this._padding[ht.BOTTOM]/i),e*(1+2*this._padding[ht.TOP]/i),this.near,this.far),h=this._get("projectionMatrix");return h&&_(h,s)?h:s}get inverseProjectionMatrix(){return v(w(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||w()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return N(this._fov,this.width,this.height)}set fovX(t){this._fov=J(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return K(this._fov,this.width,this.height)}set fovY(t){this._fov=Q(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return m(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(v(this._viewInverseTransposeMatrix,this.viewMatrix),l(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const i=2*t-1;return 2*this.near*this.far/(this.far+this.near-i*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}copyFrom(t){x(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,H(this._viewport,t.viewport),this.notifyChange("_viewport"),H(this._padding,t.padding),this.notifyChange("_padding"),d(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(a(this._viewMatrix,t.viewMatrix),x(this._viewRight,t.viewRight),x(this._viewUp,t.viewUp),x(this._viewForward,t.viewForward)),this._viewProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(z(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(a(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),H(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up}clone(){return(new Z).copyFrom(this)}equals(t){return M(this.eye,t.eye)&&M(this.center,t.center)&&M(this.up,t.up)&&L(this._viewport,t.viewport)&&L(this._padding,t.padding)&&y(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation}almostEquals(t){const i=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||k(t.screenPadding,this.screenPadding)>=i||k(this.screenViewport,t.screenViewport)>=i)return!1;T(et,t.eye,t.center),T(rt,this.eye,this.center);const e=D(et,rt),r=j(et),s=j(rt),h=5e-4;return e*e>=(1-1e-10)*r*s&&R(t.eye,this.eye)<Math.max(r,s)*h*h}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(Y(this.viewForward,f(et,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[ht.LEFT]+this.width/2)/this.pixelRatio,t[1]=(this.padding[ht.TOP]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[ht.LEFT]+this.width*i,t[1]=this.padding[ht.BOTTOM]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,i){t!==tt&&x(tt,t),tt[3]=1,U(tt,tt,this.projectionMatrix);const e=Math.abs(tt[3]);P(tt,tt,1/e);const s=this.fullViewport;i[0]=r(0,s[0]+s[2],.5+.5*tt[0]),i[1]=r(0,s[1]+s[3],.5+.5*tt[1]),i[2]=.5*(tt[2]+1),i[3]=e}unapplyProjection(t,i){const e=this.fullViewport;tt[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],tt[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],tt[2]=(2*t[2]-1)*t[3],tt[3]=t[3],null!=this.inverseProjectionMatrix&&(U(tt,tt,this.inverseProjectionMatrix),i[0]=tt[0],i[1]=tt[1],i[2]=tt[2])}projectToScreen(t,i){return this.projectToRenderScreen(t,st),this.renderToScreen(st,i),i}projectToRenderScreen(t,i){if(tt[0]=t[0],tt[1]=t[1],tt[2]=t[2],tt[3]=1,U(tt,tt,this.viewProjectionMatrix),0===tt[3])return null;P(tt,tt,1/Math.abs(tt[3]));const e=this.fullViewport;return"x"in i?(i.x=r(0,e[0]+e[2],.5+.5*tt[0]),i.y=r(0,e[1]+e[3],.5+.5*tt[1])):(i[0]=r(0,e[0]+e[2],.5+.5*tt[0]),i[1]=r(0,e[1]+e[3],.5+.5*tt[1]),i.length>2&&(i[2]=.5*(tt[2]+1))),i}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,st),i)}unprojectFromRenderScreen(t,i){if(p(it,this.projectionMatrix,this.viewMatrix),!v(it,it))return null;const e=this.fullViewport;return tt[0]=2*(t[0]-e[0])/e[2]-1,tt[1]=2*(t[1]-e[1])/e[3]-1,tt[2]=2*t[2]-1,tt[3]=1,U(tt,tt,it),0===tt[3]?null:(i[0]=tt[0]/tt[3],i[1]=tt[1]/tt[3],i[2]=tt[2]/tt[3],i)}constrainWindowSize(t,i,e,r){const s=t*this.pixelRatio,h=i*this.pixelRatio,o=Math.max(s-e/2,0),n=Math.max(this.fullHeight-h-r/2,0),a=-Math.min(s-e/2,0),p=-Math.min(this.fullHeight-h-r/2,0);return[o,n,e-a- -Math.min(this.fullWidth-s-e/2,0),r-p- -Math.min(h-r/2,0)]}computeUp(t){t===q.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;i[0]=e,i[1]=r}_computeUpGlobal(){f(et,this.center,this.eye);const t=F(this.center);t<1?(O(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(D(et,this.center))>.9999*F(et)*t||(V(this._up,et,this.center),V(this._up,this._up,et),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){C(et,this.eye,this.center),Math.abs(et[2])<=.9999&&(P(et,et,et[2]),O(this._up,-et[0],-et[1],1-et[2]),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(t,i,r=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?M(t,i)||(x(i,t),this._markViewDirty(),r.length&&this.notifyChange(r)):e.getLogger("esri.views.3d.webgl-engine.lib.Camera").warn("Camera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(W(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(c(this._viewMatrix,this.eye,this.center,this.up),O(this._viewForward,-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10]),O(this._viewUp,this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9]),O(this._viewRight,this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8]),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};t([o()],$.prototype,"_center",void 0),t([o()],$.prototype,"_up",void 0),t([o()],$.prototype,"_viewport",void 0),t([o()],$.prototype,"_padding",void 0),t([o()],$.prototype,"_fov",void 0),t([o()],$.prototype,"_nearFar",void 0),t([o()],$.prototype,"_pixelRatio",void 0),t([o()],$.prototype,"pixelRatio",null),t([o()],$.prototype,"eye",null),t([o()],$.prototype,"center",null),t([o()],$.prototype,"up",null),t([o({readOnly:!0})],$.prototype,"nearFar",null),t([o()],$.prototype,"near",null),t([o()],$.prototype,"far",null),t([o()],$.prototype,"viewport",null),t([o({readOnly:!0})],$.prototype,"screenViewport",null),t([o({readOnly:!0})],$.prototype,"screenPadding",null),t([o()],$.prototype,"x",null),t([o()],$.prototype,"y",null),t([o()],$.prototype,"width",null),t([o()],$.prototype,"height",null),t([o()],$.prototype,"fullWidth",null),t([o()],$.prototype,"fullHeight",null),t([o({readOnly:!0})],$.prototype,"_aspect",null),t([o()],$.prototype,"padding",null),t([o({readOnly:!0})],$.prototype,"projectionMatrix",null),t([o({readOnly:!0})],$.prototype,"inverseProjectionMatrix",null),t([o()],$.prototype,"fov",null),t([o()],$.prototype,"fovX",null),t([o()],$.prototype,"fovY",null),$=Z=t([n("esri.views.3d.webgl-engine.lib.Camera")],$);const tt=G(),it=w(),et=I(),rt=I(),st=h();var ht;!function(t){t[t.TOP=0]="TOP",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT"}(ht||(ht={}));export{$ as Camera,ht as PaddingSide};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import e from"../../../../core/Logger.js";import{lerp as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as h}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{h as a,m as p,q as u,a as _,i as v,t as l,u as c}from"../../../../chunks/mat4.js";import{a as w}from"../../../../chunks/mat4f64.js";import{j as d,m as y}from"../../../../chunks/vec2.js";import{f as g}from"../../../../chunks/vec2f64.js";import{f,o as m,c as x,h as M,u as T,j as D,F as j,y as R,i as P,l as F,s as O,b as V,n as S,C}from"../../../../chunks/vec3.js";import{c as I}from"../../../../chunks/vec3f64.js";import{b,e as E,h as L,c as H,i as k,t as U}from"../../../../chunks/vec4.js";import{f as B,c as G}from"../../../../chunks/vec4f64.js";import{create as A,copy as z,fromMatrix as W}from"../../../../geometry/support/frustum.js";import{create as X}from"../../../../geometry/support/ray.js";import{projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{ViewingMode as q}from"../../../ViewingMode.js";import{fovd2fovx as N,fovx2fovd as J,fovd2fovy as K,fovy2fovd as Q}from"./fov.js";var Z;let $=Z=class extends i{constructor(t={}){super(t),this._center=I(),this._up=I(),this._viewUp=I(),this._viewForward=I(),this._viewRight=I(),this._ray=X(),this._viewport=B(0,0,1,1),this._padding=B(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=g(1,1e3),this._viewDirty=!0,this._viewMatrix=w(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=w(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=w(),this._frustumDirty=!0,this._frustum=A(),this._fullViewport=G(),this._pixelRatio=1,this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return f(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){a(this._viewMatrix,t),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),this._viewForward}get viewUp(){return this._ensureViewClean(),this._viewUp}get viewRight(){return this._ensureViewClean(),this._viewRight}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=b(G(),this._viewport,1/this.pixelRatio),i=this._get("screenViewport");return i&&E(t,i)?i:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=b(G(),this._padding,1/this.pixelRatio),i=this._get("screenPadding");return i&&E(t,i)?i:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[ht.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[ht.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[ht.RIGHT]+this._padding[ht.LEFT]}set fullWidth(t){this.width=t-(this._padding[ht.RIGHT]+this._padding[ht.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[ht.TOP]+this._padding[ht.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[ht.TOP]+this._padding[ht.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[ht.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[ht.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){L(this._padding,t)||(this._viewport[0]+=t[ht.LEFT]-this._padding[ht.LEFT],this._viewport[1]+=t[ht.BOTTOM]-this._padding[ht.BOTTOM],this._viewport[2]-=t[ht.RIGHT]+t[ht.LEFT]-(this._padding[ht.RIGHT]+this._padding[ht.LEFT]),this._viewport[3]-=t[ht.TOP]+t[ht.BOTTOM]-(this._padding[ht.TOP]+this._padding[ht.BOTTOM]),H(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(p(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2),r=e*this._aspect,s=u(w(),-r*(1+2*this._padding[ht.LEFT]/t),r*(1+2*this._padding[ht.RIGHT]/t),-e*(1+2*this._padding[ht.BOTTOM]/i),e*(1+2*this._padding[ht.TOP]/i),this.near,this.far),h=this._get("projectionMatrix");return h&&_(h,s)?h:s}get inverseProjectionMatrix(){return v(w(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||w()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return N(this._fov,this.width,this.height)}set fovX(t){this._fov=J(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return K(this._fov,this.width,this.height)}set fovY(t){this._fov=Q(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return m(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(v(this._viewInverseTransposeMatrix,this.viewMatrix),l(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const i=2*t-1;return 2*this.near*this.far/(this.far+this.near-i*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}copyFrom(t){x(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,H(this._viewport,t.viewport),this.notifyChange("_viewport"),H(this._padding,t.padding),this.notifyChange("_padding"),d(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(a(this._viewMatrix,t.viewMatrix),x(this._viewRight,t.viewRight),x(this._viewUp,t.viewUp),x(this._viewForward,t.viewForward)),this._viewProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(z(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(a(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),H(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up}clone(){return(new Z).copyFrom(this)}equals(t){return M(this.eye,t.eye)&&M(this.center,t.center)&&M(this.up,t.up)&&L(this._viewport,t.viewport)&&L(this._padding,t.padding)&&y(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation}almostEquals(t){const i=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||k(t.screenPadding,this.screenPadding)>=i||k(this.screenViewport,t.screenViewport)>=i)return!1;T(et,t.eye,t.center),T(rt,this.eye,this.center);const e=D(et,rt),r=j(et),s=j(rt),h=5e-4;return e*e>=(1-1e-10)*r*s&&R(t.eye,this.eye)<Math.max(r,s)*h*h}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(Y(this.viewForward,f(et,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[ht.LEFT]+this.width/2)/this.pixelRatio,t[1]=(this.padding[ht.TOP]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[ht.LEFT]+this.width*i,t[1]=this.padding[ht.BOTTOM]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,i){t!==tt&&x(tt,t),tt[3]=1,U(tt,tt,this.projectionMatrix);const e=Math.abs(tt[3]);P(tt,tt,1/e);const s=this.fullViewport;i[0]=r(0,s[0]+s[2],.5+.5*tt[0]),i[1]=r(0,s[1]+s[3],.5+.5*tt[1]),i[2]=.5*(tt[2]+1),i[3]=e}unapplyProjection(t,i){const e=this.fullViewport;tt[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],tt[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],tt[2]=(2*t[2]-1)*t[3],tt[3]=t[3],null!=this.inverseProjectionMatrix&&(U(tt,tt,this.inverseProjectionMatrix),i[0]=tt[0],i[1]=tt[1],i[2]=tt[2])}projectToScreen(t,i){return this.projectToRenderScreen(t,st),this.renderToScreen(st,i),i}projectToRenderScreen(t,i){if(tt[0]=t[0],tt[1]=t[1],tt[2]=t[2],tt[3]=1,U(tt,tt,this.viewProjectionMatrix),0===tt[3])return null;P(tt,tt,1/Math.abs(tt[3]));const e=this.fullViewport;return"x"in i?(i.x=r(0,e[0]+e[2],.5+.5*tt[0]),i.y=r(0,e[1]+e[3],.5+.5*tt[1])):(i[0]=r(0,e[0]+e[2],.5+.5*tt[0]),i[1]=r(0,e[1]+e[3],.5+.5*tt[1]),i.length>2&&(i[2]=.5*(tt[2]+1))),i}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,st),i)}unprojectFromRenderScreen(t,i){if(p(it,this.projectionMatrix,this.viewMatrix),!v(it,it))return null;const e=this.fullViewport;return tt[0]=2*(t[0]-e[0])/e[2]-1,tt[1]=2*(t[1]-e[1])/e[3]-1,tt[2]=2*t[2]-1,tt[3]=1,U(tt,tt,it),0===tt[3]?null:(i[0]=tt[0]/tt[3],i[1]=tt[1]/tt[3],i[2]=tt[2]/tt[3],i)}constrainWindowSize(t,i,e,r){const s=t*this.pixelRatio,h=i*this.pixelRatio,o=Math.max(s-e/2,0),n=Math.max(this.fullHeight-h-r/2,0),a=-Math.min(s-e/2,0),p=-Math.min(this.fullHeight-h-r/2,0),u=e-a- -Math.min(this.fullWidth-s-e/2,0),_=r-p- -Math.min(h-r/2,0);return[Math.round(o),Math.round(n),Math.round(u),Math.round(_)]}computeUp(t){t===q.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;i[0]=e,i[1]=r}_computeUpGlobal(){f(et,this.center,this.eye);const t=F(this.center);t<1?(O(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(D(et,this.center))>.9999*F(et)*t||(V(this._up,et,this.center),V(this._up,this._up,et),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){C(et,this.eye,this.center),Math.abs(et[2])<=.9999&&(P(et,et,et[2]),O(this._up,-et[0],-et[1],1-et[2]),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(t,i,r=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?M(t,i)||(x(i,t),this._markViewDirty(),r.length&&this.notifyChange(r)):e.getLogger("esri.views.3d.webgl-engine.lib.Camera").warn("Camera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(W(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(c(this._viewMatrix,this.eye,this.center,this.up),O(this._viewForward,-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10]),O(this._viewUp,this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9]),O(this._viewRight,this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8]),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};t([o()],$.prototype,"_center",void 0),t([o()],$.prototype,"_up",void 0),t([o()],$.prototype,"_viewport",void 0),t([o()],$.prototype,"_padding",void 0),t([o()],$.prototype,"_fov",void 0),t([o()],$.prototype,"_nearFar",void 0),t([o()],$.prototype,"_pixelRatio",void 0),t([o()],$.prototype,"pixelRatio",null),t([o()],$.prototype,"eye",null),t([o()],$.prototype,"center",null),t([o()],$.prototype,"up",null),t([o({readOnly:!0})],$.prototype,"nearFar",null),t([o()],$.prototype,"near",null),t([o()],$.prototype,"far",null),t([o()],$.prototype,"viewport",null),t([o({readOnly:!0})],$.prototype,"screenViewport",null),t([o({readOnly:!0})],$.prototype,"screenPadding",null),t([o()],$.prototype,"x",null),t([o()],$.prototype,"y",null),t([o()],$.prototype,"width",null),t([o()],$.prototype,"height",null),t([o()],$.prototype,"fullWidth",null),t([o()],$.prototype,"fullHeight",null),t([o({readOnly:!0})],$.prototype,"_aspect",null),t([o()],$.prototype,"padding",null),t([o({readOnly:!0})],$.prototype,"projectionMatrix",null),t([o({readOnly:!0})],$.prototype,"inverseProjectionMatrix",null),t([o()],$.prototype,"fov",null),t([o()],$.prototype,"fovX",null),t([o()],$.prototype,"fovY",null),$=Z=t([n("esri.views.3d.webgl-engine.lib.Camera")],$);const tt=G(),it=w(),et=I(),rt=I(),st=h();var ht;!function(t){t[t.TOP=0]="TOP",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT"}(ht||(ht={}));export{$ as Camera,ht as PaddingSide};