@arcgis/core 4.34.0-next.56 → 4.34.0-next.58
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.
- package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +4 -0
- package/analysis/VolumeMeasurement/{CutFillOptions.js → VolumeMeasurementCutFillOptions.js} +1 -1
- package/analysis/VolumeMeasurementAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00ee6f84119bc55a222f.js +1 -0
- package/assets/esri/core/workers/chunks/02a31483e09652a1a1a2.js +1 -0
- package/assets/esri/core/workers/chunks/047d6f7b1677cc7ab271.js +1 -0
- package/assets/esri/core/workers/chunks/04e652df94790f5ca08a.js +1 -0
- package/assets/esri/core/workers/chunks/06b65105b15abf4d0fbf.js +1 -0
- package/assets/esri/core/workers/chunks/0b53bc76d38e85902748.js +1 -0
- package/assets/esri/core/workers/chunks/0d946a226b846b3c0849.js +1 -0
- package/assets/esri/core/workers/chunks/{9b5e04d87116ce2b68b2.js → 0e4976f92b66793137c4.js} +1 -1
- package/assets/esri/core/workers/chunks/0fb2dcbd54175e75d94d.js +971 -0
- package/assets/esri/core/workers/chunks/14c6461ffd36319e1d74.js +1 -0
- package/assets/esri/core/workers/chunks/1612d1c1d78c122dfef6.js +1 -0
- package/assets/esri/core/workers/chunks/17abab49db1813d3e192.js +1 -0
- package/assets/esri/core/workers/chunks/182383fd00008606bfaa.js +1 -0
- package/assets/esri/core/workers/chunks/18f878ec695617650a96.js +1 -0
- package/assets/esri/core/workers/chunks/19e5e011f929b6b940fe.js +1 -0
- package/assets/esri/core/workers/chunks/1c61cf137a989bc52bb8.js +1 -0
- package/assets/esri/core/workers/chunks/{dd2b5f115d156b5b212e.js → 22ec2b0a853911692dc8.js} +1 -1
- package/assets/esri/core/workers/chunks/232c76f122b1f519e099.js +1 -0
- package/assets/esri/core/workers/chunks/26975e5b3fb7f2ed45a4.js +1 -0
- package/assets/esri/core/workers/chunks/27334cda1b877abcba1b.js +1 -0
- package/assets/esri/core/workers/chunks/{d0124b0dd62b331afe58.js → 2cd27b06226e30aec5da.js} +1 -1
- package/assets/esri/core/workers/chunks/{19391d60c76a1dc7c262.js → 2f7e192ee2066f863e1d.js} +1 -1
- package/assets/esri/core/workers/chunks/327b0da744426ce40e60.js +1 -0
- package/assets/esri/core/workers/chunks/373c9e17e2834dfc1839.js +1 -0
- package/assets/esri/core/workers/chunks/{722931d1a60be461e521.js → 3e7c9a43e52ed6a1b018.js} +1 -1
- package/assets/esri/core/workers/chunks/{10b46438885916d18425.js → 3f634580055b30dbfc8e.js} +1 -1
- package/assets/esri/core/workers/chunks/{0e8d3d38e9b1f6abf6f2.js → 3fd09a7c05583a57a317.js} +1 -1
- package/assets/esri/core/workers/chunks/4050ddb580d364d9e205.js +353 -0
- package/assets/esri/core/workers/chunks/462b30fc40a5f337ba10.js +1 -0
- package/assets/esri/core/workers/chunks/4753793daf0b7ff8b5ff.js +1 -0
- package/assets/esri/core/workers/chunks/497214e9e82b936fc94e.js +1 -0
- package/assets/esri/core/workers/chunks/4ac127cefa3aa5e93e78.js +1 -0
- package/assets/esri/core/workers/chunks/4b1daffa97fd90a554a0.js +1 -0
- package/assets/esri/core/workers/chunks/4d7fcec769369c576847.js +1 -0
- package/assets/esri/core/workers/chunks/516864fb68025acc7db6.js +1 -0
- package/assets/esri/core/workers/chunks/54b43876ae6fb078eb38.js +1 -0
- package/assets/esri/core/workers/chunks/{5c556468e2a598ab793a.js → 55bb794bcdd9cc788322.js} +1 -1
- package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +1 -0
- package/assets/esri/core/workers/chunks/5787101b2b814c5d2439.js +33 -0
- package/assets/esri/core/workers/chunks/5b7e5ec6aea1f7f9b005.js +1 -0
- package/assets/esri/core/workers/chunks/{ff42b24b48019a03d841.js → 5cb238318a24b70d5ac3.js} +1 -1
- package/assets/esri/core/workers/chunks/5cfec58c7c31e6d8c6ea.js +1 -0
- package/assets/esri/core/workers/chunks/5de7c2a80bd9c81cefe2.js +1 -0
- package/assets/esri/core/workers/chunks/5e1afea05b624b315d9f.js +1 -0
- package/assets/esri/core/workers/chunks/5ed7e139c72cd2b3ddba.js +1 -0
- package/assets/esri/core/workers/chunks/5f079be7f322768aef21.js +1 -0
- package/assets/esri/core/workers/chunks/6531f33d6710960079e9.js +1 -0
- package/assets/esri/core/workers/chunks/{ad93a2621f75270f06cb.js → 69fbe363bb130fdd8146.js} +1 -1
- package/assets/esri/core/workers/chunks/700b5a536f97233bc4af.js +1 -0
- package/assets/esri/core/workers/chunks/757717416d909059df2f.js +1 -0
- package/assets/esri/core/workers/chunks/7597ef10d1699e7088e5.js +1 -0
- package/assets/esri/core/workers/chunks/781e424a383c71ca904d.js +1 -0
- package/assets/esri/core/workers/chunks/79933271a76a1756584f.js +1 -0
- package/assets/esri/core/workers/chunks/{c2f184e9f579152aa29a.js → 7b17f52019762aa21af8.js} +1 -1
- package/assets/esri/core/workers/chunks/{6130bc641aa7c1bcaaa8.js → 7c23be93d394f1bee941.js} +1 -1
- package/assets/esri/core/workers/chunks/7c86af4f60cea383ed96.js +1 -0
- package/assets/esri/core/workers/chunks/7eda1c400658b6a99be8.js +1 -0
- package/assets/esri/core/workers/chunks/80bd5988180f4618fd61.js +1 -0
- package/assets/esri/core/workers/chunks/{b47688e3263099540873.js → 81e518dd62bd95611d00.js} +1 -1
- package/assets/esri/core/workers/chunks/{a778a72456fefdf40115.js → 81eb7785d626aa975033.js} +1 -1
- package/assets/esri/core/workers/chunks/8374d87176486c1fc90e.js +1 -0
- package/assets/esri/core/workers/chunks/893e5eb5c028c4704317.js +1 -0
- package/assets/esri/core/workers/chunks/{6dc0009889f2b7cc8cff.js → 897f9775f06ddbf6486f.js} +1 -1
- package/assets/esri/core/workers/chunks/8c0e11f781607239749d.js +1 -0
- package/assets/esri/core/workers/chunks/8c2fcfcfbb6b70f7bada.js +1 -0
- package/assets/esri/core/workers/chunks/90540fdfb0c5f68aa959.js +1 -0
- package/assets/esri/core/workers/chunks/{c7d4c296011c5393bcaa.js → 9275313e0f1f521b2658.js} +1 -1
- package/assets/esri/core/workers/chunks/9280edff80fd87860a5e.js +1 -0
- package/assets/esri/core/workers/chunks/944d1608f935516951c4.js +1 -0
- package/assets/esri/core/workers/chunks/94f1005222bff1870ef1.js +1 -0
- package/assets/esri/core/workers/chunks/{e6bf4f3f6868dc9028e3.js → 96102a9296afd1bfe1a9.js} +1 -1
- package/assets/esri/core/workers/chunks/977582cb3c8f17a2cb4c.js +1 -0
- package/assets/esri/core/workers/chunks/{853b9f29b4d62fa621b9.js → 997a2a1a51039ce7e4e3.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e2b125e6e3945985a54.js → 9f93513037a6e87433c4.js} +1 -1
- package/assets/esri/core/workers/chunks/a16b471c3706ee37f9b6.js +1 -0
- package/assets/esri/core/workers/chunks/a2150baf0661e2f28011.js +1 -0
- package/assets/esri/core/workers/chunks/a244afea77127e54dd3a.js +1 -0
- package/assets/esri/core/workers/chunks/{ab3c018c406dcd81ef9e.js → a2f4b6d8da93f106852c.js} +1 -1
- package/assets/esri/core/workers/chunks/a532614aa65fb52dee7b.js +1 -0
- package/assets/esri/core/workers/chunks/{adf11d31f95481f89a55.js → a700f57af6856cb5313c.js} +1 -1
- package/assets/esri/core/workers/chunks/ae1cb4c65d72217ae4d4.js +1 -0
- package/assets/esri/core/workers/chunks/af5ae7c36e1178077cbc.js +1 -0
- package/assets/esri/core/workers/chunks/{97ae2fdb6cb98249f5fa.js → b29144ee58b43f769d9a.js} +1 -1
- package/assets/esri/core/workers/chunks/b30de4936caa654d7817.js +1 -0
- package/assets/esri/core/workers/chunks/b6c6f82df3b60c2f831f.js +1 -0
- package/assets/esri/core/workers/chunks/{faf4002f9547a0cc4e33.js → bafd9b0f6e817252cb31.js} +1 -1
- package/assets/esri/core/workers/chunks/{22334a464f798b5279b2.js → bb2ab663e3e5597f2104.js} +1 -1
- package/assets/esri/core/workers/chunks/bb67d491f62a5cce96cd.js +1 -0
- package/assets/esri/core/workers/chunks/bc9f54a6b577c43189fd.js +1 -0
- package/assets/esri/core/workers/chunks/{6fe738748ce837811ff4.js → bd4125d163f372a7e978.js} +1 -1
- package/assets/esri/core/workers/chunks/bf6b76027c60b4ffa507.js +1 -0
- package/assets/esri/core/workers/chunks/{854bfda25bb406814929.js → c34a164a8ece4cb33e81.js} +1 -1
- package/assets/esri/core/workers/chunks/c4ff5c78fc8668af9c05.js +1 -0
- package/assets/esri/core/workers/chunks/c696615cae5daefa2d98.js +1 -0
- package/assets/esri/core/workers/chunks/c71dac67f95d694bf67e.js +1 -0
- package/assets/esri/core/workers/chunks/{e982cf44906eb26164f2.js → c75b0243e5bb84738419.js} +1 -1
- package/assets/esri/core/workers/chunks/{3490d47cac7c8dec70cd.js → c9c109d43a1e5160955d.js} +2 -2
- package/assets/esri/core/workers/chunks/cc748d4f4adb9c584aa4.js +1 -0
- package/assets/esri/core/workers/chunks/d707538b150d79050336.js +1 -0
- package/assets/esri/core/workers/chunks/d71836cf70b9604832f1.js +1 -0
- package/assets/esri/core/workers/chunks/d83bdc13c3cad3eee7be.js +1 -0
- package/assets/esri/core/workers/chunks/{2cda605c302176905e84.js → db7678104b18534482e3.js} +1 -1
- package/assets/esri/core/workers/chunks/dbcef57073075e9cfdfe.js +1 -0
- package/assets/esri/core/workers/chunks/de4da985c398c8bcf2e7.js +1 -0
- package/assets/esri/core/workers/chunks/{cb57cdff976d2d4b0b41.js → e1b25b1ce3bd4f0f2cda.js} +1 -1
- package/assets/esri/core/workers/chunks/e36d538915261ee0373f.js +1 -0
- package/assets/esri/core/workers/chunks/e97250ae8da4bd0d6bc9.js +1 -0
- package/assets/esri/core/workers/chunks/ed8863c3d334f438b625.js +1 -0
- package/assets/esri/core/workers/chunks/f636ca5c811c3a2a962f.js +1 -0
- package/assets/esri/core/workers/chunks/f6d91256c4e5f8a0d5c0.js +1 -0
- package/assets/esri/core/workers/chunks/f718f630a8b81496c646.js +1 -0
- package/assets/esri/core/workers/chunks/{4d5abcf57a6ded4750ba.js → fa0f94318173db2034de.js} +1 -1
- package/assets/esri/core/workers/chunks/fd1fdb97a294a1b7041d.js +1 -0
- package/assets/esri/core/workers/chunks/ff14b632f147cb68ed59.js +1 -0
- package/assets/esri/core/workers/chunks/{d42fd0effc560eefb14b.js → ff2614d96ca5228e9685.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff8a4bf1bceb362d67ab.js → ff7962063d132c1ec814.js} +1 -1
- package/assets/esri/themes/base/widgets/_Editor.scss +5 -3
- package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +6 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_en.json +1 -1
- package/chunks/ColorMaterial.glsl.js +1 -1
- package/chunks/ComponentShader.glsl.js +2 -2
- package/chunks/CutFillDepth.glsl.js +15 -0
- package/chunks/CutFillReduction.glsl.js +12 -0
- package/chunks/CutFillTargetDepth.glsl.js +6 -0
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/HUDMaterial.glsl.js +4 -4
- package/chunks/ImageMaterial.glsl.js +2 -2
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/Path.glsl.js +6 -6
- package/chunks/Pattern.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +2 -2
- package/chunks/ShadedColorMaterial.glsl.js +1 -1
- package/chunks/SimpleAtmosphere.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +4 -4
- package/chunks/WaterSurface.glsl.js +3 -3
- package/chunks/offsetOperator.js +1 -1
- package/config.js +1 -1
- package/core/Clonable.js +1 -1
- package/effects/FocusArea.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/operators/offsetOperator.js +1 -1
- package/geometry/support/boundsUtils.js +1 -1
- package/geometry/support/contains.js +1 -1
- package/geometry/support/curves/circleUtils.js +1 -1
- package/geometry/support/curves/circularArcUtils.js +1 -1
- package/geometry/support/curves/curveUtils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/curves/rotate.js +5 -0
- package/geometry/support/extentUtils.js +1 -1
- package/geometry/support/rotate.js +1 -1
- package/graphic/ImageryGraphicOrigin.js +5 -0
- package/graphic/ImageryTileGraphicOrigin.js +5 -0
- package/graphic/WCSGraphicOrigin.js +5 -0
- package/graphic/isImageryGraphicOrigin.js +5 -0
- package/graphic/isImageryTileGraphicOrigin.js +5 -0
- package/graphic/isWCSGraphicOrigin.js +5 -0
- package/interfaces.d.ts +14 -17
- package/kernel.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GroundLayer.js +5 -0
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.js +1 -1
- package/layers/graphics/hydratedFeatures.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/support/SceneFilter.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/webgl/Profiler.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementComputation.js → VolumeMeasurementCutFillComputation.js} +1 -1
- package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementController.js → VolumeMeasurementCutFillController.js} +1 -1
- package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementVisualization.js → VolumeMeasurementCutFillVisualization.js} +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/CSVLayerView3D.js +1 -1
- package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GeoJSONLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/StreamLayerView3D.js +1 -1
- package/views/3d/layers/WFSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/layers/graphics/StreamController.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/terrain/OverlayRenderTargets.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +2 -2
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +2 -0
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/ObjectAndLayerIDRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.js +5 -0
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/CutFillDepth.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/CutFillDepthTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/CutFillReduction.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/CutFillReductionTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/CutFillTargetDepth.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/CutFillTargetDepthTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/drawUtils.js +1 -1
- package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
- package/views/interactive/editGeometry/operations/curveOperationUtils.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/analysis/VolumeMeasurement/CutFillOptions.d.ts +0 -4
- package/assets/esri/core/workers/chunks/01e8b9dc77a57d1c2a52.js +0 -1
- package/assets/esri/core/workers/chunks/027cfcde29fe87aa2ffe.js +0 -1
- package/assets/esri/core/workers/chunks/03ee4d63aa8de44958ab.js +0 -1
- package/assets/esri/core/workers/chunks/07eea90733834313e9fa.js +0 -1
- package/assets/esri/core/workers/chunks/0a4586e596413ef7a4b5.js +0 -1
- package/assets/esri/core/workers/chunks/0a6d33d013628f671aea.js +0 -1
- package/assets/esri/core/workers/chunks/1166ed298cf5ca7ad444.js +0 -1
- package/assets/esri/core/workers/chunks/13797036850dcc3671c3.js +0 -1
- package/assets/esri/core/workers/chunks/18ceea59e469a0f2721b.js +0 -1
- package/assets/esri/core/workers/chunks/1a2278b9fe9666342728.js +0 -1
- package/assets/esri/core/workers/chunks/1e01aaebdeffdfc0c6bd.js +0 -1
- package/assets/esri/core/workers/chunks/1eee7cf11df01a52c1bf.js +0 -1
- package/assets/esri/core/workers/chunks/222f981e876f60ae282f.js +0 -1
- package/assets/esri/core/workers/chunks/24ac204d8a045aa821be.js +0 -1
- package/assets/esri/core/workers/chunks/27197b0a2ffb2b6104ea.js +0 -1
- package/assets/esri/core/workers/chunks/277941bec15525dbd3a0.js +0 -1
- package/assets/esri/core/workers/chunks/2c0241a5958aef9cda61.js +0 -1
- package/assets/esri/core/workers/chunks/2cb14d040e67a261b31c.js +0 -1
- package/assets/esri/core/workers/chunks/31c088966ccfff2ea1db.js +0 -1
- package/assets/esri/core/workers/chunks/3245d20ea4bb779f87ef.js +0 -1
- package/assets/esri/core/workers/chunks/3264d58aeef8cf074b86.js +0 -1
- package/assets/esri/core/workers/chunks/4162c633efefc63c5506.js +0 -1
- package/assets/esri/core/workers/chunks/435169b455fd2846799b.js +0 -1
- package/assets/esri/core/workers/chunks/46a470bea2a3601182dc.js +0 -1
- package/assets/esri/core/workers/chunks/4874aabdb5c60ca66216.js +0 -1
- package/assets/esri/core/workers/chunks/4b58da6cb91f7bf6af8b.js +0 -1
- package/assets/esri/core/workers/chunks/4fc267552939583a81a0.js +0 -1
- package/assets/esri/core/workers/chunks/527557b603400189d49a.js +0 -1
- package/assets/esri/core/workers/chunks/554c789f4e875d7e6fd5.js +0 -1
- package/assets/esri/core/workers/chunks/5900dde7a201a7d47469.js +0 -1
- package/assets/esri/core/workers/chunks/5b2ff220aebe464dac23.js +0 -1
- package/assets/esri/core/workers/chunks/5d331f7628514a572f82.js +0 -1
- package/assets/esri/core/workers/chunks/5f28470304b57e24d94c.js +0 -1
- package/assets/esri/core/workers/chunks/5f518931a660b3c4f519.js +0 -1
- package/assets/esri/core/workers/chunks/6530449cd1975deb61f1.js +0 -1
- package/assets/esri/core/workers/chunks/65e1f5b20a585e04655a.js +0 -1
- package/assets/esri/core/workers/chunks/66f3659ba18f92cd623e.js +0 -1
- package/assets/esri/core/workers/chunks/67355372ac5fd8a15d18.js +0 -1
- package/assets/esri/core/workers/chunks/6801b92bce7a918fda6f.js +0 -1
- package/assets/esri/core/workers/chunks/6940bb6524938894a246.js +0 -1
- package/assets/esri/core/workers/chunks/6b11476b2004b4db576e.js +0 -1
- package/assets/esri/core/workers/chunks/719450ccd455f503d81a.js +0 -1
- package/assets/esri/core/workers/chunks/71cac356874b36f9a383.js +0 -1
- package/assets/esri/core/workers/chunks/77ee4afaa4a1c7047940.js +0 -1
- package/assets/esri/core/workers/chunks/790e97ddbe318bc75415.js +0 -1
- package/assets/esri/core/workers/chunks/7b560ac0be93c6aa9940.js +0 -1
- package/assets/esri/core/workers/chunks/7bdfc7c7ce1d94c00745.js +0 -353
- package/assets/esri/core/workers/chunks/83737d86584bf1b32368.js +0 -1
- package/assets/esri/core/workers/chunks/855f25ce748aaef44b1a.js +0 -1
- package/assets/esri/core/workers/chunks/862fe2f96d4b777ff5b8.js +0 -1
- package/assets/esri/core/workers/chunks/87f68c2b9361bd3f8cac.js +0 -1
- package/assets/esri/core/workers/chunks/8fa50cac57b6e1ecec76.js +0 -1
- package/assets/esri/core/workers/chunks/9307108821d82c131654.js +0 -1
- package/assets/esri/core/workers/chunks/97a38d700f2cb8807d51.js +0 -1
- package/assets/esri/core/workers/chunks/9928e432b884c75c3436.js +0 -1
- package/assets/esri/core/workers/chunks/9b10e70f28873cff44f5.js +0 -1
- package/assets/esri/core/workers/chunks/9e9be7f6ea32957f1088.js +0 -33
- package/assets/esri/core/workers/chunks/9f178cf73c63caaea190.js +0 -1
- package/assets/esri/core/workers/chunks/a999f804fc2f00b2e7ae.js +0 -1
- package/assets/esri/core/workers/chunks/ae73ac81bd10614c2b53.js +0 -1
- package/assets/esri/core/workers/chunks/af4412e79275c5a87539.js +0 -1
- package/assets/esri/core/workers/chunks/b8158c681456d4cf2395.js +0 -1
- package/assets/esri/core/workers/chunks/c86e339e45900c54c9f5.js +0 -1
- package/assets/esri/core/workers/chunks/c91217d977a6baaee74a.js +0 -1
- package/assets/esri/core/workers/chunks/ca7c9756802214e41c56.js +0 -1
- package/assets/esri/core/workers/chunks/cb8f2ce22274990b359c.js +0 -1
- package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +0 -1
- package/assets/esri/core/workers/chunks/d3a7747f23e91d1f1b5e.js +0 -1
- package/assets/esri/core/workers/chunks/d3ae88fcde2d7fb3e2e2.js +0 -1
- package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +0 -1
- package/assets/esri/core/workers/chunks/d87fdc64a5cc6be4bd69.js +0 -1
- package/assets/esri/core/workers/chunks/db5d3feeb61ccb5ede98.js +0 -1
- package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +0 -1
- package/assets/esri/core/workers/chunks/e666ca4d14b6490485d6.js +0 -1
- package/assets/esri/core/workers/chunks/ead1acf95c3385630da8.js +0 -1001
- package/assets/esri/core/workers/chunks/f1c50f37a81c672263a1.js +0 -1
- package/assets/esri/core/workers/chunks/f3e3c2340452c1d60c95.js +0 -1
- package/assets/esri/core/workers/chunks/f4d7cbd33ef8710d7316.js +0 -1
- package/assets/esri/core/workers/chunks/f74b0cdc1c2b56bac5f0.js +0 -1
- package/assets/esri/core/workers/chunks/f807e7fc90e0e7ce6b67.js +0 -1
- package/assets/esri/core/workers/chunks/ff323db554c9e09749e8.js +0 -1
- package/assets/esri/core/workers/chunks/ff4e15a872de94d2b438.js +0 -1
- /package/assets/esri/core/workers/chunks/{3490d47cac7c8dec70cd.js.LICENSE.txt → c9c109d43a1e5160955d.js.LICENSE.txt} +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as h}from"../../../../chunks/sphere.js";import{OverlayTarget as c}from"../../terrain/Intersector.js";import{ChangeSet as l,RenderGeometryUpdate as p}from"./ChangeSet.js";import{IntersectorResult as u}from"./IntersectorResult.js";import{RendererBase as g}from"./RendererBase.js";import{noBudget as m}from"../../../support/Scheduler.js";let y=class extends g{constructor(e){super(e),this._pending=new _,this._changes=new l,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,m,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(
|
|
5
|
+
import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as h}from"../../../../chunks/sphere.js";import{OverlayTarget as c}from"../../terrain/Intersector.js";import{ChangeSet as l,RenderGeometryUpdate as p}from"./ChangeSet.js";import{IntersectorResult as u}from"./IntersectorResult.js";import{RendererBase as g}from"./RendererBase.js";import{noBudget as m}from"../../../support/Scheduler.js";let y=class extends g{constructor(e){super(e),this._pending=new _,this._changes=new l,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,m,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(9)}),this._hasWater=s(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(3)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);switch(s&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=new p;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere[0]-n.boundingSphere[3]<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere[0]+n.boundingSphere[3]>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],G[0]=t[0]-s,G[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,i,G,(t,s,o)=>{f(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(h(e.boundingSphere))),e}get test(){}};e([o({constructOnly:!0})],y.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],y.prototype,"rendererContext",void 0),e([o()],y.prototype,"updating",null),e([o()],y.prototype,"rctx",null),e([o()],y.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],y.prototype,"isEmpty",null),e([o()],y.prototype,"_geometries",void 0),y=e([d("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],y);class _{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function f(e,r,t,s,i,n,o){const d=new c(n,o,r),a=r=>{r.set(3,d,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&a(i.results.min),0!==i.options.store&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&a(i.results.max),2===i.options.store){const e=new u(i.ray);a(e),i.results.all.push(e)}}const G=a();export{y as SortedRenderGeometryRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{clamp as t}from"../../../../core/mathUtils.js";import{releaseMaybe as e}from"../../../../core/maybe.js";import{fromRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as r,f as a,u as o,t as h}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyTextureResizeModulo as n}from"./textureUtils.js";import{ViewshedFaceCamera as l}from"./ViewshedFaceCamera.js";import{DepthStencilAttachment as u,SizedDepthFormat as m}from"../../../webgl/enums.js";import{isSizedDepthStencilFormat as f}from"../../../webgl/textureUtils.js";class d{constructor(){this.textureSizeQuality=1,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.textureSizeMultiple=128,this.toleranceSides=5,this.toleranceBottomTop=10}textureSizeModifier(t){const e=t?this.textureSizeModHighQuality:this.textureSizeModLowQuality;return this.textureSizeQuality*e}textureResizeModulo(t){return Math.ceil(t/this.textureSizeMultiple)*this.textureSizeMultiple}}const p=["front","left","right","back","top","bottom"];function g(t){return!["top","bottom"].includes(t)}class _{constructor(t){this._fbos=t,this._faces={},this._width=0,this._height=0,this.settings=new d,this._maxTextureSize=Math.min(has("esri-mobile")?4096:16384,t.rctx.parameters.maxTextureSize)}get depthTexture(){return this._handle?.getTexture(u)}get ready(){return null!=this.depthTexture&&0!==this._width&&0!==this._height}get nearFar(){const t=this.faces;return 0===t.length?null:t[0].nearFar}get numActiveFaces(){const t=this._faces;let e=0;return Object.keys(t).forEach(i=>{t[i]&&(e+=1)}),e}get faces(){const t=this._faces,e=[];for(const i of p){const s=t[i];s&&e.push(s)}return e}get atlasRegions(){return this.faces.map(t=>[t.x/this._width,(t.x+t.width)/this._width,t.y/this._height,(t.y+t.height)/this._height])}get viewshedProjectionMatrices(){return this.faces.map(t=>t.projectionMatrix)}get viewshedViewMatrices(){return this.faces.map(t=>t.viewMatrix)}_setupFaceCamera(e,n,u,m){const{effectiveObserverRenderSpace:f,tiltedUpVector:d,targetRenderSpace:p,farDistanceRenderSpace:_,horizontalFieldOfView:x,verticalFieldOfView:w}=n,b=c();r(b,p,f);const M=c(),S=c(),F=(t,e)=>{const r=c(),o=s();return i(o,t,e),h(r,b,o),a(r,f,r),r};let z,T=d;const v=Math.min(90,x),O=Math.min(90,Math.max(0,(x-90)/2));let j=-45,B=45,y=-45,k=45;if(g(e)){const e=e=>t(e,-45,45);y=e(-w/2)-this.settings.toleranceBottomTop,k=e(+w/2)+this.settings.toleranceBottomTop}switch(e){case"front":z=p,j=-v/2,B=v/2;break;case"left":z=F(Math.PI/2,d),j=45-O;break;case"right":z=F(-Math.PI/2,d),B=-45+O;break;case"top":z=a(M,f,d),T=o(S,b);break;case"bottom":z=r(M,f,d),T=b;break;case"back":z=F(Math.PI,d)}const V=new l({center:z,eye:f,up:T,far:_});V.sectionAnglesDeg=[j-this.settings.toleranceSides,B+this.settings.toleranceSides,y,k],V.fovY=Math.PI/2;const P=V.setViewport(u,m);return this._faces[e]=V,P}isActive(t){return this._computeActiveFaces(t).size>0}_computeActiveFaces(t){const e=new Set,{horizontalFieldOfView:i,verticalFieldOfView:s}=t,r=-s/2,a=s/2;return 0===i||0===s||(r<=45&&a>=-45&&e.add("front"),i>90&&(e.add("left"),e.add("right")),i>270&&e.add("back"),a>45-this.settings.toleranceBottomTop&&e.add("top"),r<-45+this.settings.toleranceBottomTop&&e.add("bottom")),e}_computeBaseTextureSize({pixelRatio:t,fullWidth:e,fullHeight:i},s,r,a){const o=s/t,h=this.settings.textureSizeModifier(r);return n(Math.max(e,i)*o*h,this._maxTextureSize/a)}_ensureFBO(t){const e=this._width,i=this._height,s=this._handle?.fbo;s&&s.width===e&&s.height===i&&t===f(s.depthStencilTexture?.descriptor?.internalFormat??m.DEPTH_COMPONENT16)||(this._handle?.release(),this._handle=this._allocateFBO(t))}_allocateFBO(t){const{_width:e,_height:i}=this,s=t?11
|
|
5
|
+
import has from"../../../../core/has.js";import{clamp as t}from"../../../../core/mathUtils.js";import{releaseMaybe as e}from"../../../../core/maybe.js";import{fromRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as r,f as a,u as o,t as h}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyTextureResizeModulo as n}from"./textureUtils.js";import{ViewshedFaceCamera as l}from"./ViewshedFaceCamera.js";import{DepthStencilAttachment as u,SizedDepthFormat as m}from"../../../webgl/enums.js";import{isSizedDepthStencilFormat as f}from"../../../webgl/textureUtils.js";class d{constructor(){this.textureSizeQuality=1,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.textureSizeMultiple=128,this.toleranceSides=5,this.toleranceBottomTop=10}textureSizeModifier(t){const e=t?this.textureSizeModHighQuality:this.textureSizeModLowQuality;return this.textureSizeQuality*e}textureResizeModulo(t){return Math.ceil(t/this.textureSizeMultiple)*this.textureSizeMultiple}}const p=["front","left","right","back","top","bottom"];function g(t){return!["top","bottom"].includes(t)}class _{constructor(t){this._fbos=t,this._faces={},this._width=0,this._height=0,this.settings=new d,this._maxTextureSize=Math.min(has("esri-mobile")?4096:16384,t.rctx.parameters.maxTextureSize)}get depthTexture(){return this._handle?.getTexture(u)}get ready(){return null!=this.depthTexture&&0!==this._width&&0!==this._height}get nearFar(){const t=this.faces;return 0===t.length?null:t[0].nearFar}get numActiveFaces(){const t=this._faces;let e=0;return Object.keys(t).forEach(i=>{t[i]&&(e+=1)}),e}get faces(){const t=this._faces,e=[];for(const i of p){const s=t[i];s&&e.push(s)}return e}get atlasRegions(){return this.faces.map(t=>[t.x/this._width,(t.x+t.width)/this._width,t.y/this._height,(t.y+t.height)/this._height])}get viewshedProjectionMatrices(){return this.faces.map(t=>t.projectionMatrix)}get viewshedViewMatrices(){return this.faces.map(t=>t.viewMatrix)}_setupFaceCamera(e,n,u,m){const{effectiveObserverRenderSpace:f,tiltedUpVector:d,targetRenderSpace:p,farDistanceRenderSpace:_,horizontalFieldOfView:x,verticalFieldOfView:w}=n,b=c();r(b,p,f);const M=c(),S=c(),F=(t,e)=>{const r=c(),o=s();return i(o,t,e),h(r,b,o),a(r,f,r),r};let z,T=d;const v=Math.min(90,x),O=Math.min(90,Math.max(0,(x-90)/2));let j=-45,B=45,y=-45,k=45;if(g(e)){const e=e=>t(e,-45,45);y=e(-w/2)-this.settings.toleranceBottomTop,k=e(+w/2)+this.settings.toleranceBottomTop}switch(e){case"front":z=p,j=-v/2,B=v/2;break;case"left":z=F(Math.PI/2,d),j=45-O;break;case"right":z=F(-Math.PI/2,d),B=-45+O;break;case"top":z=a(M,f,d),T=o(S,b);break;case"bottom":z=r(M,f,d),T=b;break;case"back":z=F(Math.PI,d)}const V=new l({center:z,eye:f,up:T,far:_});V.sectionAnglesDeg=[j-this.settings.toleranceSides,B+this.settings.toleranceSides,y,k],V.fovY=Math.PI/2;const P=V.setViewport(u,m);return this._faces[e]=V,P}isActive(t){return this._computeActiveFaces(t).size>0}_computeActiveFaces(t){const e=new Set,{horizontalFieldOfView:i,verticalFieldOfView:s}=t,r=-s/2,a=s/2;return 0===i||0===s||(r<=45&&a>=-45&&e.add("front"),i>90&&(e.add("left"),e.add("right")),i>270&&e.add("back"),a>45-this.settings.toleranceBottomTop&&e.add("top"),r<-45+this.settings.toleranceBottomTop&&e.add("bottom")),e}_computeBaseTextureSize({pixelRatio:t,fullWidth:e,fullHeight:i},s,r,a){const o=s/t,h=this.settings.textureSizeModifier(r);return n(Math.max(e,i)*o*h,this._maxTextureSize/a)}_ensureFBO(t){const e=this._width,i=this._height,s=this._handle?.fbo;s&&s.width===e&&s.height===i&&t===f(s.depthStencilTexture?.descriptor?.internalFormat??m.DEPTH_COMPONENT16)||(this._handle?.release(),this._handle=this._allocateFBO(t))}_allocateFBO(t){const{_width:e,_height:i}=this,s=t?12:11,r=this._fbos.acquire(e,i,"viewshed shadow map",s);return r.getTexture(u)?.setShadowFiltering(!1),r}clearFBO(t){const e=this._fbos.rctx;this._ensureFBO(t),e.bindFramebuffer(this._handle?.fbo),e.setClearColor(1,1,1,1),e.clear(16640)}dispose(){this._debugFBO||(this._handle=e(this._handle))}start(t,e,i,s,r=!1){this._faces={};const a=this._computeActiveFaces(e),o=a.size;if(0===o)return!1;const h=this._computeBaseTextureSize(t,s,i,o);let c=0,n=0,l=0;return p.filter(t=>a.has(t)).forEach(t=>{const i=x(t,o);i>n&&(l=Math.max(l,c),c=0),n=i;const s=i*h;c+=this._setupFaceCamera(t,e,[c,s],h)}),l=Math.max(l,c),this._width=this.settings.textureResizeModulo(l),this._height=w(o)*h,this.clearFBO(r),!0}finish(){}get test(){}}function x(t,e){if(e<4)return 0;const i="front"===t||"left"===t;return 4===e?i?0:1:i||"right"===t?0:1}function w(t){return t<4?1:2}export{_ as ViewshedShadowMap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import s from"../../../../../core/Error.js";import{someMap as r,getOrCreateMapValue as n}from"../../../../../core/MapUtils.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{isAborted as i,throwIfAborted as o}from"../../../../../core/promiseUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d,e as u,t as m}from"../../../../../chunks/vec32.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as p,freeze as _}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{debugFlags as g}from"../../../support/debugFlags.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import v from"../../../webgl/RenderCamera.js";import{AsyncRenderPlugin as b}from"../../effects/RenderPlugin.js";import{DepthRange as I}from"../DepthRange.js";import{assert as C}from"../Util.js";import{InstanceData as D}from"./InstanceData.js";import{InstanceOctree as R}from"./InstanceOctree.js";import{LevelSelector as E}from"./LevelSelector.js";import{LodLevel as x}from"./LodLevel.js";import{getRenderInstanceDataLayout as S,RenderInstanceData as w}from"./RenderInstanceData.js";import{colorMixModes as L}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as j}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as U}from"../../shaders/DefaultMaterialTechnique.js";import{defaultHighlightName as T}from"../../../../support/HighlightDefaults.js";import{TaskPriority as O,noBudget as A}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as M}from"../../../../webgl/Util.js";import{fromLayout as q}from"../../../../webgl/VertexAttributeLocations.js";const B=e=>{const t=e.baseBoundingSphere.radius,s=e.levels.map(e=>e.minScreenSpaceRadius);return new E(t,s)};let F=class extends b{constructor(e,t){super(e),this.type=6,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDatas=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new v,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[2,e=>this._produces(e)],[4,e=>!!this._hasTransparentLevels()&&this._produces(e)]]),this._instanceData=new D({shaderTransformation:e.shaderTransformation},e.symbol.materialParameters),this.addHandles(t.registerTask(O.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=S(this.symbol.materialParameters),this._glInstanceBufferLayout=y(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){return[this._defaultRenderInstanceData,...this._highlightRenderInstanceDatas.values()]}get _allRenderInstanceDataExceptHighlightShadow(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDatas)t[0]!==T&&e.push(t[1]);return e}hasHighlight(e){return this._highlightRenderInstanceDatas.has(e)}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerViewUid(){return this.metadata.layerViewUid}get instanceData(){return this._instanceData}get hasEmissions(){return this._levels.some(e=>e.components.some(e=>e.material.hasEmissions))}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((e,t)=>e+t.usedMemory,e),this._levels.reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.usedMemory,0),0))}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((e,s)=>{const r=this._allRenderInstanceData[0][s].size+this._allRenderInstanceData[1][s].size,n=e.triangleCount;t.push({renderedInstances:r,renderedTriangles:r*n,trianglesPerInstance:n})}),{totalInstances:e,renderedInstances:t.reduce((e,t)=>e+t.renderedInstances,0),renderedTriangles:t.reduce((e,t)=>e+t.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(){const{rctx:e}=this._context.renderContext;return this.symbol.levels.map(t=>new w(e,this._instanceBufferLayout))}async initializeRenderContext(e,s){this._context=e,this._defaultRenderInstanceData=this._createRenderInstanceDataArray();const r=await Promise.allSettled(this.symbol.levels.map(t=>x.create(e,t,s))),n=r.map(e=>"fulfilled"===e.status?e.value:null).filter(t);if(i(s)||n.length!==r.length){n.forEach(e=>e.destroy()),o(s);for(const e of r)if("rejected"===e.status)throw e.reason}this._levels=n,this._levelSelector=B(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDatas.forEach(e=>e.forEach(e=>e.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(e=>{const t=e.material.produces.get(4);return t?.(0)}))}hasHighlights(){return r(this._highlightRenderInstanceDatas,e=>e.some(e=>e.size>0))}_produces(e){return(8!==e||this.hasHighlights())&&(5!==e||this.hasHighlight(T))}prepareRender(e){if(!g.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(A),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const s=new Array,r=this.levels;return t.forEach(t=>r.forEach(({components:r},n)=>r.forEach(r=>s.push(this._beginComponent(e,t[n],r))))),s}render(e,t){const s=this._getInstanceDatas(e);if(!s||null==t)return;let r=0;const n=this.levels;s.forEach(s=>n.forEach(({components:n},a)=>n.forEach(n=>this._renderComponent(e,t[r++],s[a],n,a)))),e.rctx.unbindBuffer(34962),e.rctx.bindVAO(null)}_getInstanceDatas(e){const{output:t,bind:s}=e,r=8===t,n=5===t,a=6!==t;if(!r&&!n)return a?this._allRenderInstanceData:this._allRenderInstanceDataExceptHighlightShadow;const{_highlightRenderInstanceDatas:i}=this;if(a){if(r){const e=s.highlight?.name;if(!e)return null;const t=i.get(e);return t?[t]:null}const e=i.get(T);return n?e?[e]:null:Array.from(i.values())}return null}intersect(e,t,s,r){if(!this.baseMaterial.visible||null==this._octree)return;const n=f();d(n,r,s);const a=n=>{this._instanceData.getCombinedModelTransform(n,N),e.transform.set(N),m(W,s,e.transform.inverse),m(k,r,e.transform.inverse);const a=this._instanceData.getState(n),i=this._instanceData.getLodLevel(n),o=this._levels.length;C(!!(18&a),"invalid instance state"),C(i>=0&&i<o,"invaid lod level"),this._levels[i].intersect(e,t,W,k,n,this.metadata,o)};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(a):this._octree.forEachAlongRay(s,n,a)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new R(e,this.baseBoundingSphere);for(let s=0;s<e.capacity;++s)18&t.get(s)&&this._octreeCached.addInstance(s)}return this._octreeCached}_invalidateOctree(){this._octreeCached=a(this._octreeCached)}queryDepthRange(e){if(null==this._octree)return new I;const t=e.viewForward,s=this._octree.findClosest(t,1,e.frustum),r=this._octree.findClosest(t,-1,e.frustum);if(null==s||null==r)return new I;const n=e.eye,a=this._instanceData.view;a.boundingSphere.getVec(s,z),d(z,z,n);const i=u(z,t)-z[3];a.boundingSphere.getVec(r,z),d(z,z,n);const o=u(z,t)+z[3];return new I(i,o)}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.startUpdateCycle()))}get readyToRun(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:r,_levelSelector:a}=this;this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.beginUpdate()));const i=this._instanceData,o=i.view;let l=i.size;const c=i.capacity;let h=this._instanceIndex;const d=Math.ceil(c/500),{_highlightRenderInstanceDatas:u}=this;for(let m=0;m<l&&!e.done;++m){h===this._cycleStartIndex&&this._startUpdateCycle();const m=o.state.get(h);let f=0;if(!(1&m)){h=h+1===c?0:h+1,l++;continue}const p=o.lodLevel.get(h);if(2&m&&this._defaultRenderInstanceData[p].freeTail(),16&m){const e=i.geHighlightOptionsPrev(h);if(e){const t=u.get(e);if(!t)throw new s("internal:lod-renderer","Internal error in lodRenderer");t[p].freeTail(),t.every(e=>e.isEmpty)&&(t.forEach(e=>e.destroy()),u.delete(e))}}if(32&m)i.freeInstance(h);else if(4&m){let e=0;if(t&&(o.modelOrigin.getVec(h,V),e=a.selectLevel(V,i.getCombinedMedianScaleFactor(h),r)),f=-83&m,e>=0)if(8&m){const t=i.getHighlightName(h);if(t){const r=()=>{const e=this._createRenderInstanceDataArray();return e.forEach(e=>e.beginUpdate()),e},a=n(u,t,r);if(e>=a.length)throw new s("internal:lod-renderer",`LodRenderer internal error - missing lodLevel ${e}`);H(a[e],o,h)}f|=16}else H(this._defaultRenderInstanceData[e],o,h),f|=2;o.state.set(h,f),o.lodLevel.set(h,e)}else f=-83&m,o.state.set(h,f);if(null!=this._octreeCached){const e=!!(18&m),t=!!(18&f);!e&&t?this._octreeCached.addInstance(h):e&&!t?this._octreeCached.removeInstance(h):e&&t&&64&m&&(this._octreeCached.removeInstance(h),this._octreeCached.addInstance(h))}h=h+1===c?0:h+1,h%d===0&&e.madeProgress()}this._instanceIndex=h,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.endUpdate())),this._context.requestRender()}_beginComponent(e,t,s){if(0===t.size)return null;const r=s.glMaterials.load(e.rctx,e.bind.slot,e.output);return r?.beginSlot(e.bind)}_renderComponent(e,t,s,r,n){if(!t)return;const{bind:a,rctx:i}=e;i.runAppleAmdDriverHelper();const o=i.bindTechnique(t,a,r.material.parameters,Y),l=this._glInstanceBufferLayout;o.assertCompatibleVertexAttributeLocations(r.vao,q(l)),i.bindVAO(r.vao),g.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&0===e.output&&(o.setUniform4fv("externalColor",G[Math.min(n,G.length-1)]),o.setUniform1i("symbolColorMixMode",L.replace));const c=s.capacity,h=s.headIndex,d=s.tailIndex,u=s.firstIndex,m=(e,n)=>{M(i,o.locations,s.buffer,e),i.drawArraysInstanced(t.primitiveType,0,r.numVertices,n-e)};r.material.transparent&&null!=u?h>d?(C(u>=d&&u<=h,"invalid firstIndex"),m(u,h),m(d,u)):h<d&&(u<=h?(C(u>=0&&u<=h,"invalid firstIndex"),m(u,h),m(d,c),m(0,u)):(C(u>=d&&u<=c,"invalid firstIndex"),m(u,c),m(0,h),m(d,u))):h>d?m(d,h):h<d&&(m(0,h),m(d,c))}};function H(e,t,s){const r=e.allocateHead();P(t,s,e.view,r)}function P(e,t,s,r){j(e.modelOrigin,t,s.modelOriginHi,s.modelOriginLo,r),s.model.copyFrom(r,e.model,t),s.modelNormal.copyFrom(r,e.modelNormal,t),e.color&&s.color&&s.color.copyFrom(r,e.color,t),e.olidColor&&s.olidColor&&s.olidColor.copyFrom(r,e.olidColor,t),e.featureAttribute&&s.featureAttribute&&s.featureAttribute.copyFrom(r,e.featureAttribute,t)}e([l({constructOnly:!0})],F.prototype,"symbol",void 0),e([l({constructOnly:!0})],F.prototype,"metadata",void 0),e([l({constructOnly:!0})],F.prototype,"shaderTransformation",void 0),e([l()],F.prototype,"_instanceData",void 0),e([l()],F.prototype,"_cycleStartIndex",void 0),e([l({readOnly:!0})],F.prototype,"_enableLevelSelection",null),e([l()],F.prototype,"_updateCyclesWithStaticCamera",void 0),e([l({readOnly:!0})],F.prototype,"readyToRun",null),F=e([c("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],F);const V=f(),z=p(),N=h(),W=f(),k=f(),G=[_(1,0,1,1),_(0,0,1,1),_(0,1,0,1),_(1,1,0,1),_(1,0,0,1)],Y=new U;export{F as LodRenderer};
|
|
5
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import s from"../../../../../core/Error.js";import{someMap as r,getOrCreateMapValue as n}from"../../../../../core/MapUtils.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{isAborted as i,throwIfAborted as o}from"../../../../../core/promiseUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d,e as u,t as m}from"../../../../../chunks/vec32.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as p,freeze as _}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{debugFlags as g}from"../../../support/debugFlags.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import v from"../../../webgl/RenderCamera.js";import{AsyncRenderPlugin as b}from"../../effects/RenderPlugin.js";import{DepthRange as I}from"../DepthRange.js";import{assert as C}from"../Util.js";import{InstanceData as D}from"./InstanceData.js";import{InstanceOctree as R}from"./InstanceOctree.js";import{LevelSelector as E}from"./LevelSelector.js";import{LodLevel as x}from"./LodLevel.js";import{getRenderInstanceDataLayout as S,RenderInstanceData as w}from"./RenderInstanceData.js";import{colorMixModes as L}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as j}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as U}from"../../shaders/DefaultMaterialTechnique.js";import{defaultHighlightName as T}from"../../../../support/HighlightDefaults.js";import{TaskPriority as O,noBudget as A}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as M}from"../../../../webgl/Util.js";import{fromLayout as q}from"../../../../webgl/VertexAttributeLocations.js";const B=e=>{const t=e.baseBoundingSphere.radius,s=e.levels.map(e=>e.minScreenSpaceRadius);return new E(t,s)};let F=class extends b{constructor(e,t){super(e),this.type=6,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDatas=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new v,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[2,e=>this._produces(e)],[4,e=>!!this._hasTransparentLevels()&&this._produces(e)]]),this._instanceData=new D({shaderTransformation:e.shaderTransformation},e.symbol.materialParameters),this.addHandles(t.registerTask(O.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=S(this.symbol.materialParameters),this._glInstanceBufferLayout=y(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){return[this._defaultRenderInstanceData,...this._highlightRenderInstanceDatas.values()]}get _allRenderInstanceDataExceptHighlightShadow(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDatas)t[0]!==T&&e.push(t[1]);return e}hasHighlight(e){return this._highlightRenderInstanceDatas.has(e)}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerViewUid(){return this.metadata.layerViewUid}get instanceData(){return this._instanceData}get hasEmissions(){return this._levels.some(e=>e.components.some(e=>e.material.hasEmissions))}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((e,t)=>e+t.usedMemory,e),this._levels.reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.usedMemory,0),0))}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((e,s)=>{const r=this._allRenderInstanceData[0][s].size+this._allRenderInstanceData[1][s].size,n=e.triangleCount;t.push({renderedInstances:r,renderedTriangles:r*n,trianglesPerInstance:n})}),{totalInstances:e,renderedInstances:t.reduce((e,t)=>e+t.renderedInstances,0),renderedTriangles:t.reduce((e,t)=>e+t.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(){const{rctx:e}=this._context.renderContext;return this.symbol.levels.map(t=>new w(e,this._instanceBufferLayout))}async initializeRenderContext(e,s){this._context=e,this._defaultRenderInstanceData=this._createRenderInstanceDataArray();const r=await Promise.allSettled(this.symbol.levels.map(t=>x.create(e,t,s))),n=r.map(e=>"fulfilled"===e.status?e.value:null).filter(t);if(i(s)||n.length!==r.length){n.forEach(e=>e.destroy()),o(s);for(const e of r)if("rejected"===e.status)throw e.reason}this._levels=n,this._levelSelector=B(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDatas.forEach(e=>e.forEach(e=>e.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(e=>{const t=e.material.produces.get(4);return t?.(0)}))}hasHighlights(){return r(this._highlightRenderInstanceDatas,e=>e.some(e=>e.size>0))}_produces(e){return(9!==e||this.hasHighlights())&&(5!==e||this.hasHighlight(T))}prepareRender(e){if(!g.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(A),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const s=new Array,r=this.levels;return t.forEach(t=>r.forEach(({components:r},n)=>r.forEach(r=>s.push(this._beginComponent(e,t[n],r))))),s}render(e,t){const s=this._getInstanceDatas(e);if(!s||null==t)return;let r=0;const n=this.levels;s.forEach(s=>n.forEach(({components:n},a)=>n.forEach(n=>this._renderComponent(e,t[r++],s[a],n,a)))),e.rctx.unbindBuffer(34962),e.rctx.bindVAO(null)}_getInstanceDatas(e){const{output:t,bind:s}=e,r=9===t,n=5===t,a=6!==t;if(!r&&!n)return a?this._allRenderInstanceData:this._allRenderInstanceDataExceptHighlightShadow;const{_highlightRenderInstanceDatas:i}=this;if(a){if(r){const e=s.highlight?.name;if(!e)return null;const t=i.get(e);return t?[t]:null}const e=i.get(T);return n?e?[e]:null:Array.from(i.values())}return null}intersect(e,t,s,r){if(!this.baseMaterial.visible||null==this._octree)return;const n=f();d(n,r,s);const a=n=>{this._instanceData.getCombinedModelTransform(n,N),e.transform.set(N),m(W,s,e.transform.inverse),m(k,r,e.transform.inverse);const a=this._instanceData.getState(n),i=this._instanceData.getLodLevel(n),o=this._levels.length;C(!!(18&a),"invalid instance state"),C(i>=0&&i<o,"invaid lod level"),this._levels[i].intersect(e,t,W,k,n,this.metadata,o)};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(a):this._octree.forEachAlongRay(s,n,a)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new R(e,this.baseBoundingSphere);for(let s=0;s<e.capacity;++s)18&t.get(s)&&this._octreeCached.addInstance(s)}return this._octreeCached}_invalidateOctree(){this._octreeCached=a(this._octreeCached)}queryDepthRange(e){if(null==this._octree)return new I;const t=e.viewForward,s=this._octree.findClosest(t,1,e.frustum),r=this._octree.findClosest(t,-1,e.frustum);if(null==s||null==r)return new I;const n=e.eye,a=this._instanceData.view;a.boundingSphere.getVec(s,z),d(z,z,n);const i=u(z,t)-z[3];a.boundingSphere.getVec(r,z),d(z,z,n);const o=u(z,t)+z[3];return new I(i,o)}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.startUpdateCycle()))}get readyToRun(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:r,_levelSelector:a}=this;this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.beginUpdate()));const i=this._instanceData,o=i.view;let l=i.size;const c=i.capacity;let h=this._instanceIndex;const d=Math.ceil(c/500),{_highlightRenderInstanceDatas:u}=this;for(let m=0;m<l&&!e.done;++m){h===this._cycleStartIndex&&this._startUpdateCycle();const m=o.state.get(h);let f=0;if(!(1&m)){h=h+1===c?0:h+1,l++;continue}const p=o.lodLevel.get(h);if(2&m&&this._defaultRenderInstanceData[p].freeTail(),16&m){const e=i.geHighlightOptionsPrev(h);if(e){const t=u.get(e);if(!t)throw new s("internal:lod-renderer","Internal error in lodRenderer");t[p].freeTail(),t.every(e=>e.isEmpty)&&(t.forEach(e=>e.destroy()),u.delete(e))}}if(32&m)i.freeInstance(h);else if(4&m){let e=0;if(t&&(o.modelOrigin.getVec(h,V),e=a.selectLevel(V,i.getCombinedMedianScaleFactor(h),r)),f=-83&m,e>=0)if(8&m){const t=i.getHighlightName(h);if(t){const r=()=>{const e=this._createRenderInstanceDataArray();return e.forEach(e=>e.beginUpdate()),e},a=n(u,t,r);if(e>=a.length)throw new s("internal:lod-renderer",`LodRenderer internal error - missing lodLevel ${e}`);H(a[e],o,h)}f|=16}else H(this._defaultRenderInstanceData[e],o,h),f|=2;o.state.set(h,f),o.lodLevel.set(h,e)}else f=-83&m,o.state.set(h,f);if(null!=this._octreeCached){const e=!!(18&m),t=!!(18&f);!e&&t?this._octreeCached.addInstance(h):e&&!t?this._octreeCached.removeInstance(h):e&&t&&64&m&&(this._octreeCached.removeInstance(h),this._octreeCached.addInstance(h))}h=h+1===c?0:h+1,h%d===0&&e.madeProgress()}this._instanceIndex=h,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.endUpdate())),this._context.requestRender()}_beginComponent(e,t,s){if(0===t.size)return null;const r=s.glMaterials.load(e.rctx,e.bind.slot,e.output);return r?.beginSlot(e.bind)}_renderComponent(e,t,s,r,n){if(!t)return;const{bind:a,rctx:i}=e;i.runAppleAmdDriverHelper();const o=i.bindTechnique(t,a,r.material.parameters,Y),l=this._glInstanceBufferLayout;o.assertCompatibleVertexAttributeLocations(r.vao,q(l)),i.bindVAO(r.vao),g.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&0===e.output&&(o.setUniform4fv("externalColor",G[Math.min(n,G.length-1)]),o.setUniform1i("symbolColorMixMode",L.replace));const c=s.capacity,h=s.headIndex,d=s.tailIndex,u=s.firstIndex,m=(e,n)=>{M(i,o.locations,s.buffer,e),i.drawArraysInstanced(t.primitiveType,0,r.numVertices,n-e)};r.material.transparent&&null!=u?h>d?(C(u>=d&&u<=h,"invalid firstIndex"),m(u,h),m(d,u)):h<d&&(u<=h?(C(u>=0&&u<=h,"invalid firstIndex"),m(u,h),m(d,c),m(0,u)):(C(u>=d&&u<=c,"invalid firstIndex"),m(u,c),m(0,h),m(d,u))):h>d?m(d,h):h<d&&(m(0,h),m(d,c))}};function H(e,t,s){const r=e.allocateHead();P(t,s,e.view,r)}function P(e,t,s,r){j(e.modelOrigin,t,s.modelOriginHi,s.modelOriginLo,r),s.model.copyFrom(r,e.model,t),s.modelNormal.copyFrom(r,e.modelNormal,t),e.color&&s.color&&s.color.copyFrom(r,e.color,t),e.olidColor&&s.olidColor&&s.olidColor.copyFrom(r,e.olidColor,t),e.featureAttribute&&s.featureAttribute&&s.featureAttribute.copyFrom(r,e.featureAttribute,t)}e([l({constructOnly:!0})],F.prototype,"symbol",void 0),e([l({constructOnly:!0})],F.prototype,"metadata",void 0),e([l({constructOnly:!0})],F.prototype,"shaderTransformation",void 0),e([l()],F.prototype,"_instanceData",void 0),e([l()],F.prototype,"_cycleStartIndex",void 0),e([l({readOnly:!0})],F.prototype,"_enableLevelSelection",null),e([l()],F.prototype,"_updateCyclesWithStaticCamera",void 0),e([l({readOnly:!0})],F.prototype,"readyToRun",null),F=e([c("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],F);const V=f(),z=p(),N=h(),W=f(),k=f(),G=[_(1,0,1,1),_(0,0,1,1),_(0,1,0,1),_(1,1,0,1),_(1,0,0,1)],Y=new U;export{F as LodRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrColorEmissionOrOID as r,isDepth as e,is2DGeometryOutput as s,isColorOrColorEmission as i}from"../core/shaderLibrary/ShaderOutput.js";import a from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as o}from"../lib/OrderIndependentTransparency.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{TriangleMaterial as h}from"./TriangleMaterial.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{getLayout as u,ColorMaterialTechnique as c}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as l}from"../shaders/ColorMaterialTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class m extends h{constructor(t){super(t,_),this._configuration=new l,this.supportsEdges=!0,this.produces=new Map([[2,t=>this._isOpaqueMaterialPass(t)],[3,t=>this._isOpaqueNoSSAODepthPass(t)],[4,t=>r(t)&&this._transparent&&this.parameters.writeDepth],[5,t=>e(t)&&this._transparent&&this.parameters.writeDepth],[8,t=>r(t)&&this._transparent&&!this.parameters.writeDepth],[18,t=>s(t)]])}getConfiguration(t,r){return super.getConfiguration(t,r,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this._transparent,this._configuration.discardInvisibleFragments=this._transparent&&!this._isOpaquePass(t)&&this.parameters.discardInvisibleFragments,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=r.hasOccludees,this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation<o,this._configuration.terrainDepthTest=r.terrainDepthTest&&i(t),this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration}get visible(){return this.parameters.color[3]>=f}get _transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}_isOpaquePass(t){return this._isOpaqueMaterialPass(t)||this._isOpaqueNoSSAODepthPass(t)}_isOpaqueMaterialPass(t){return
|
|
5
|
+
import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrColorEmissionOrOID as r,isDepth as e,is2DGeometryOutput as s,isColorOrColorEmission as i}from"../core/shaderLibrary/ShaderOutput.js";import a from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as o}from"../lib/OrderIndependentTransparency.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{TriangleMaterial as h}from"./TriangleMaterial.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{getLayout as u,ColorMaterialTechnique as c}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as l}from"../shaders/ColorMaterialTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class m extends h{constructor(t){super(t,_),this._configuration=new l,this.supportsEdges=!0,this.produces=new Map([[2,t=>this._isOpaqueMaterialPass(t)],[3,t=>this._isOpaqueNoSSAODepthPass(t)],[4,t=>r(t)&&this._transparent&&this.parameters.writeDepth],[5,t=>e(t)&&this._transparent&&this.parameters.writeDepth],[8,t=>r(t)&&this._transparent&&!this.parameters.writeDepth],[18,t=>s(t)]])}getConfiguration(t,r){return super.getConfiguration(t,r,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this._transparent,this._configuration.discardInvisibleFragments=this._transparent&&!this._isOpaquePass(t)&&this.parameters.discardInvisibleFragments,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=r.hasOccludees,this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation<o,this._configuration.terrainDepthTest=r.terrainDepthTest&&i(t),this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration}get visible(){return this.parameters.color[3]>=f}get _transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}_isOpaquePass(t){return this._isOpaqueMaterialPass(t)||this._isOpaqueNoSSAODepthPass(t)}_isOpaqueMaterialPass(t){return 9===t||r(t)&&!this._transparent}_isOpaqueNoSSAODepthPass(t){return e(t)&&this.parameters.writeDepth&&!this._transparent}createGLMaterial(t){return new g(t)}createBufferWriter(){return new n(u(this.parameters))}}class g extends a{beginSlot(t){return this.getTechnique(c,t)}}class _ extends p{constructor(){super(...arguments),this.color=t,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=0,this.draped=!1,this.discardInvisibleFragments=!1}}export{m as ColorMaterial,_ as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{InstancedDoubleConfiguration as i}from"../core/shaderLibrary/attributes/InstancedDoubleConfiguration.js";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class e extends i{constructor(){super(...arguments),this.output=0,this.oitPass=0,this.hasSlicePlane=!1,this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0}}t([o({count:
|
|
5
|
+
import{__decorate as t}from"tslib";import{InstancedDoubleConfiguration as i}from"../core/shaderLibrary/attributes/InstancedDoubleConfiguration.js";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class e extends i{constructor(){super(...arguments),this.output=0,this.oitPass=0,this.hasSlicePlane=!1,this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0}}t([o({count:11})],e.prototype,"output",void 0),t([o({count:3})],e.prototype,"oitPass",void 0),t([o()],e.prototype,"hasSlicePlane",void 0),t([o()],e.prototype,"hasHighlightMixTexture",void 0);export{e as DefaultTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{i as e,G as t,t as r}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as s}from"../../../../geometry/support/float16.js";import{isColor as a,isDepth as o,isColorHighlightOrDepth as n,isColorOrColorEmission as h}from"../core/shaderLibrary/ShaderOutput.js";import c from"../lib/GLMaterial.js";import{Material as p}from"../lib/Material.js";import{VisualVariablePassParameters as m}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as l}from"./internal/bufferWriterUtils.js";import{getLayout as u,LineMarkerTechnique as d}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as f}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class _ extends p{constructor(e){super(e,b),this._configuration=new f,this.produces=new Map([[2,e=>
|
|
5
|
+
import{i as e,G as t,t as r}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as s}from"../../../../geometry/support/float16.js";import{isColor as a,isDepth as o,isColorHighlightOrDepth as n,isColorOrColorEmission as h}from"../core/shaderLibrary/ShaderOutput.js";import c from"../lib/GLMaterial.js";import{Material as p}from"../lib/Material.js";import{VisualVariablePassParameters as m}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as l}from"./internal/bufferWriterUtils.js";import{getLayout as u,LineMarkerTechnique as d}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as f}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class _ extends p{constructor(e){super(e,b),this._configuration=new f,this.produces=new Map([[2,e=>9===e||a(e)&&8===this.parameters.renderOccluded],[3,e=>o(e)],[10,e=>n(e)&&8===this.parameters.renderOccluded],[11,e=>n(e)&&8===this.parameters.renderOccluded],[4,e=>a(e)&&this.parameters.writeDepth],[8,e=>a(e)&&!this.parameters.writeDepth],[18,e=>h(e)||9===e]]),this.intersectDraped=void 0}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.space=18===t.slot?0:this.parameters.worldSpace?2:1,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=t.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&h(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color[3]>=g}intersect(){}createBufferWriter(){return new w(u(this.parameters),this.parameters)}createGLMaterial(e){return new v(e)}}class v extends c{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(d,e)}}class b extends m{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.markerTexture=null}}class w{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,a,o,n,h,c){const p=o.get("position").data,m=p.length/3;let u=[1,0,0];const d=o.get("normal");this._parameters.worldSpace&&null!=d&&(u=d.data);let f=1,g=0;this._parameters.vvSize?g=o.get("sizeFeatureAttribute").data[0]:o.has("size")&&(f=o.get("size").data[0]);let _=[1,1,1,1],v=0;this._parameters.vvColor?v=o.get("colorFeatureAttribute").data[0]:o.has("color")&&(_=o.get("color").data);let b=0;this._parameters.vvOpacity&&(b=o.get("opacityFeatureAttribute").data[0]);const w=new Float32Array(h.buffer),P=s(h.buffer),k=new Uint8Array(h.buffer);let O=c*(this.layout.stride/4);const V=w.BYTES_PER_ELEMENT/P.BYTES_PER_ELEMENT,j=4/V,y=(e,t,r,i)=>{w[O++]=e[0],w[O++]=e[1],w[O++]=e[2],l(t,e,P,O*V),O+=j;let s=O*V;if(P[s++]=r[0],P[s++]=r[1],O=Math.ceil(s/V),this._parameters.vvColor)w[O++]=v;else{const e=Math.min(4*i,_.length-4),t=4*O++;k[t]=255*_[e],k[t+1]=255*_[e+1],k[t+2]=255*_[e+2],k[t+3]=255*_[e+3]}this._parameters.vvOpacity&&(w[O++]=b),s=O*V,this._parameters.vvSize?(w[O++]=g,s+=2):P[s++]=f,this._parameters.worldSpace&&(P[s++]=u[0],P[s++]=u[1],P[s++]=u[2]),O=Math.ceil(s/V)},M=(s,a)=>{const o=e(S,p[3*s],p[3*s+1],p[3*s+2]),n=T;let h=s+a;do{e(n,p[3*h],p[3*h+1],p[3*h+2]),h+=a}while(t(o,n)&&h>=0&&h<m);i&&(r(o,o,i),r(n,n,i)),y(o,n,[-1,-1],s),y(o,n,[1,-1],s),y(o,n,[1,1],s),y(o,n,[-1,-1],s),y(o,n,[1,1],s),y(o,n,[-1,1],s)},C=this._parameters.placement;return"begin"!==C&&"begin-end"!==C||M(0,1),"end"!==C&&"begin-end"!==C||M(m-1,-1),null}}const S=i(),T=i();export{_ as LineMarkerMaterial,b as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../core/Logger.js";import{clamp as e}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as r}from"../../../../core/time.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as a,d as o,e as n,g as l,f as h,c as p,l as m,j as c,t as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as g}from"../../../../geometry/support/float16.js";import{distance2 as b,fromPoints as _,create as S,closestLineSegmentPoint as v}from"../../../../geometry/support/lineSegment.js";import{fromPoints as P,create as y,signedDistance as j,getNormal as E}from"../../../../geometry/support/plane.js";import{isHighlightOrOID as w,isColorOrColorEmission as A,isDepth as T,isColorEmissionHighlightOIDOrDepth as z,is2DGeometryOutput as C}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as L}from"../effects/geometry/olidUtils.js";import M from"../lib/GLMaterial.js";import{Material as O}from"../lib/Material.js";import{isTranslationMatrix as V}from"../lib/Util.js";import{VisualVariablePassParameters as R}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as x}from"./internal/bufferWriterUtils.js";import{r as F}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as N,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as U}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as D}from"../../../../webscene/support/AlphaCutoff.js";class B extends O{constructor(t){super(t,J),this._configuration=new U,this.produces=new Map([[2,t=>w(t)||A(t)&&8===this.parameters.renderOccluded],[3,t=>T(t)],[10,t=>z(t)&&8===this.parameters.renderOccluded],[11,t=>z(t)&&8===this.parameters.renderOccluded],[4,t=>A(t)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,t=>A(t)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,t=>C(t)]])}getConfiguration(t,e){super.getConfiguration(t,e,this._configuration),this._configuration.oitPass=e.oitPass,this._configuration.draped=18===e.slot;const i=null!=this.parameters.stipplePattern&&8!==t;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&G(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.terrainDepthTest=e.terrainDepthTest&&A(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.hasEmissions?1:0,this._configuration}get visible(){return this.parameters.color[3]>=D||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>D}setParameters(t,e){t.animation=this.parameters.animation,super.setParameters(t,e)}intersectDraped({attributes:t,screenToWorldRatio:i},r,s,a,o){if(!r.options.selectionMode)return;const n=t.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const i=t.get("sizeFeatureAttribute").data[0];Number.isNaN(i)?l*=this.parameters.vvSize.fallback[0]:l*=e(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else n&&(l*=n.data[0]);const h=s[0],p=s[1],m=(l/2+4)*i;let c=Number.MAX_VALUE,u=0;const f=t.get("position").data,d=X(this.parameters,t)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const t=f[g],i=f[g+1],r=(g+3)%f.length,s=h-t,a=p-i,o=f[r]-t,n=f[r+1]-i,l=e((o*s+n*a)/(o*o+n*n),0,1),m=o*l-s,d=n*l-a,b=m*m+d*d;b<c&&(c=b,u=g/3)}c<m*m&&a(o.distance,o.normal,u)}intersect(i,r,u,f,d,g){const{options:S,camera:y,rayBegin:w,rayEnd:A}=u;if(!S.selectionMode||!i.visible||!y)return;if(!V(r))return void t.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const T=i.attributes,z=T.get("position").data;let C=this.parameters.width;if(this.parameters.vvSize){const t=T.get("sizeFeatureAttribute").data[0];Number.isNaN(t)||(C*=e(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else T.has("size")&&(C*=T.get("size").data[0]);const L=Z;s(L,u.point);const M=C*y.pixelRatio/2+4*y.pixelRatio;a(ht[0],L[0]-M,L[1]+M,0),a(ht[1],L[0]+M,L[1]+M,0),a(ht[2],L[0]+M,L[1]-M,0),a(ht[3],L[0]-M,L[1]-M,0);for(let t=0;t<4;t++)if(!y.unprojectFromRenderScreen(ht[t],pt[t]))return;P(y.eye,pt[0],pt[1],mt),P(y.eye,pt[1],pt[2],ct),P(y.eye,pt[2],pt[3],ut),P(y.eye,pt[3],pt[0],ft);let O=Number.MAX_VALUE,R=0;const x=X(this.parameters,T)?z.length-2:z.length-5;for(let t=0;t<x;t+=3){H[0]=z[t]+r[12],H[1]=z[t+1]+r[13],H[2]=z[t+2]+r[14];const e=(t+3)%z.length;if(I[0]=z[e]+r[12],I[1]=z[e+1]+r[13],I[2]=z[e+2]+r[14],j(mt,H)<0&&j(mt,I)<0||j(ct,H)<0&&j(ct,I)<0||j(ut,H)<0&&j(ut,I)<0||j(ft,H)<0&&j(ft,I)<0)continue;if(y.projectToRenderScreen(H,$),y.projectToRenderScreen(I,tt),$[2]<0&&tt[2]>0){o(K,H,I);const t=y.frustum,e=-j(t[4],H)/n(K,E(t[4]));l(K,K,e),h(H,H,K),y.projectToRenderScreen(H,$)}else if($[2]>0&&tt[2]<0){o(K,I,H);const t=y.frustum,e=-j(t[4],I)/n(K,E(t[4]));l(K,K,e),h(I,I,K),y.projectToRenderScreen(I,tt)}else if($[2]<0&&tt[2]<0)continue;$[2]=0,tt[2]=0;const i=b(_($,tt,rt),L);i<O&&(O=i,p(et,H),p(it,I),R=t/3)}if(O<M*M){let t=Number.MAX_VALUE;if(v(_(et,it,rt),_(w,A,st),Q)){o(Q,Q,w);const e=m(Q);l(Q,Q,1/e),t=e/c(w,A)}g(t,Q,R)}}get hasEmissions(){return this.parameters.emissiveStrength>0}createBufferWriter(){return new Y(N(this.parameters),this.parameters)}createGLMaterial(t){return new W(t)}validateParameters(t){"miter"!==t.join&&(t.miterLimit=0),null!=t.markerParameters&&(t.markerScale=t.markerParameters.width/t.width)}update(t){const{hasAnimation:e,animationSpeed:i}=this.parameters;return!!e&&(this.setParameters({timeElapsed:r(t.time)*i},!1),0!==t.dt)}}class W extends M{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(t){const e=this._material.parameters.stipplePattern;return this._stipplePattern!==e&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(e,this._stipplePattern)}),this._stipplePattern=e),this.getTechnique(k,t)}}class J extends R{constructor(){super(...arguments),this.width=0,this.color=d,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=0,this.animation=0,this.animationSpeed=1,this.trailLength=1,this.emissiveStrength=0}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}}class Y{constructor(t,e){this.layout=t,this._parameters=e;const i=e.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=i;break;case"round":this.numJoinSubdivisions=F+i}}_isClosed(t){return X(this._parameters,t)}allocate(t){return this.layout.createBuffer(t)}elementCount(t){const e=2,i=t.get("position").indices.length/2+1,r=this._isClosed(t);let s=r?2:2*e;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(t,e,i,r,s,o){const n=i.get("position"),l=n.indices,h=n.data.length/3,m=i.get("distanceToStart")?.data;l&&l.length!==2*(h-1)&&console.warn("RibbonLineMaterial does not support indices");const f=(this.layout.fields.has("sizeFeatureAttribute")?i.get("sizeFeatureAttribute")?.data[0]:i.get("size")?.data[0])??1;let d=[1,1,1,1],b=0;const _=this.layout.fields.has("colorFeatureAttribute");_?b=i.get("colorFeatureAttribute").data[0]:i.has("color")&&(d=i.get("color").data);const S=i.get("timeStamps")?.data,v=S&&this.layout.fields.has("timeStamps"),P=this.layout.fields.has("opacityFeatureAttribute"),y=P?i.get("opacityFeatureAttribute").data[0]:0,j=new Float32Array(s.buffer),E=g(s.buffer),w=new Uint8Array(s.buffer),A=this.layout.stride/4;let T=o*A;const z=T;let C=0;const M=m?(t,e,i)=>C=m[i]:(t,e,i)=>C+=c(t,e),O=j.BYTES_PER_ELEMENT/E.BYTES_PER_ELEMENT,V=4/O,R=(t,e,i,s,a,o,n,l)=>{j[T++]=e[0],j[T++]=e[1],j[T++]=e[2],x(t,e,E,T*O),T+=V,x(i,e,E,T*O),T+=V,j[T++]=l;let h=T*O;if(E[h++]=a,E[h++]=o,T=Math.ceil(h/O),_)j[T]=b;else{const t=Math.min(4*n,d.length-4),e=4*T;w[e]=255*d[t],w[e+1]=255*d[t+1],w[e+2]=255*d[t+2],w[e+3]=255*d[t+3]}if(T++,j[T++]=f,P&&(j[T++]=y),L()){let t=4*T;r?(w[t++]=r[0],w[t++]=r[1],w[t++]=r[2],w[t++]=r[3]):(w[t++]=0,w[t++]=0,w[t++]=0,w[t++]=0),T=Math.ceil(.25*t)}v&&(h=T*O,E[h++]=s[0],E[h++]=s[1],E[h++]=s[2],T=Math.ceil(h/O))};T+=A,a(ot,n.data[0],n.data[1],n.data[2]),v&&a(lt,S[0],S[1],S[2]),t&&u(ot,ot,t);const F=this._isClosed(i);if(F){const e=n.data.length-3;a(at,n.data[e],n.data[e+1],n.data[e+2]),t&&u(at,at,t)}else a(nt,n.data[3],n.data[4],n.data[5]),t&&u(nt,nt,t),R(ot,ot,nt,lt,1,-4,0,0),R(ot,ot,nt,lt,1,4,0,0),p(at,ot),p(ot,nt),v&&a(lt,S[3],S[4],S[5]);const N=F?0:1,k=F?h:h-1;for(let c=N;c<k;c++){const e=(c+1)%h*3;a(nt,n.data[e],n.data[e+1],n.data[e+2]),t&&u(nt,nt,t),M(at,ot,c),R(at,ot,nt,lt,0,-1,c,C),R(at,ot,nt,lt,0,1,c,C);const i=this.numJoinSubdivisions;for(let t=0;t<i;++t){const e=(t+1)/(i+1);R(at,ot,nt,lt,e,-1,c,C),R(at,ot,nt,lt,e,1,c,C)}R(at,ot,nt,lt,1,-2,c,C),R(at,ot,nt,lt,1,2,c,C),p(at,ot),p(ot,nt),v&&a(lt,S[e],S[e+1],S[e+2])}F?(a(nt,n.data[3],n.data[4],n.data[5]),t&&u(nt,nt,t),C=M(at,ot,k),R(at,ot,nt,lt,0,-1,N,C),R(at,ot,nt,lt,0,1,N,C)):(C=M(at,ot,k),R(at,ot,ot,lt,0,-5,k,C),R(at,ot,ot,lt,0,5,k,C)),q(j,z+A,j,z,A);return T=q(j,T-A,j,T,A),this._parameters.wireframe&&this._addWireframeVertices(s,z,T,A),null}_addWireframeVertices(t,e,i,r){const s=new Float32Array(t.buffer,i*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(t.buffer,e*Float32Array.BYTES_PER_ELEMENT,i-e);let o=0;const n=t=>o=q(a,t,s,o,r);for(let l=0;l<a.length-1;l+=2*r)n(l),n(l+2*r),n(l+1*r),n(l+2*r),n(l+1*r),n(l+3*r)}}function q(t,e,i,r,s){for(let a=0;a<s;a++)i[r++]=t[e++];return r}function X(t,e){if(!t.isClosed)return!1;return e.get("position").indices.length>2}function G(t){return 1===t.anchor&&t.hideOnShortSegments&&"begin-end"===t.placement&&t.worldSpace}const H=f(),I=f(),K=f(),Q=f(),Z=f(),$=i(),tt=i(),et=f(),it=f(),rt=S(),st=S(),at=f(),ot=f(),nt=f(),lt=f(),ht=[i(),i(),i(),i()],pt=[f(),f(),f(),f()],mt=y(),ct=y(),ut=y(),ft=y();export{J as Parameters,B as RibbonLineMaterial};
|
|
5
|
+
import t from"../../../../core/Logger.js";import{clamp as e}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as r}from"../../../../core/time.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as a,d as o,e as n,g as l,f as h,c as p,l as m,j as c,t as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as g}from"../../../../geometry/support/float16.js";import{distance2 as b,fromPoints as _,create as S,closestLineSegmentPoint as v}from"../../../../geometry/support/lineSegment.js";import{fromPoints as P,create as y,signedDistance as j,getNormal as E}from"../../../../geometry/support/plane.js";import{isHighlightOrOID as w,isColorOrColorEmission as A,isDepth as T,isColorEmissionHighlightOIDOrDepth as z,is2DGeometryOutput as C}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as L}from"../effects/geometry/olidUtils.js";import M from"../lib/GLMaterial.js";import{Material as O}from"../lib/Material.js";import{isTranslationMatrix as V}from"../lib/Util.js";import{VisualVariablePassParameters as R}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as x}from"./internal/bufferWriterUtils.js";import{r as F}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as N,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as U}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as D}from"../../../../webscene/support/AlphaCutoff.js";class B extends O{constructor(t){super(t,J),this._configuration=new U,this.produces=new Map([[2,t=>w(t)||A(t)&&8===this.parameters.renderOccluded],[3,t=>T(t)],[10,t=>z(t)&&8===this.parameters.renderOccluded],[11,t=>z(t)&&8===this.parameters.renderOccluded],[4,t=>A(t)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,t=>A(t)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,t=>C(t)]])}getConfiguration(t,e){super.getConfiguration(t,e,this._configuration),this._configuration.oitPass=e.oitPass,this._configuration.draped=18===e.slot;const i=null!=this.parameters.stipplePattern&&9!==t;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&G(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.terrainDepthTest=e.terrainDepthTest&&A(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.hasEmissions?1:0,this._configuration}get visible(){return this.parameters.color[3]>=D||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>D}setParameters(t,e){t.animation=this.parameters.animation,super.setParameters(t,e)}intersectDraped({attributes:t,screenToWorldRatio:i},r,s,a,o){if(!r.options.selectionMode)return;const n=t.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const i=t.get("sizeFeatureAttribute").data[0];Number.isNaN(i)?l*=this.parameters.vvSize.fallback[0]:l*=e(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else n&&(l*=n.data[0]);const h=s[0],p=s[1],m=(l/2+4)*i;let c=Number.MAX_VALUE,u=0;const f=t.get("position").data,d=X(this.parameters,t)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const t=f[g],i=f[g+1],r=(g+3)%f.length,s=h-t,a=p-i,o=f[r]-t,n=f[r+1]-i,l=e((o*s+n*a)/(o*o+n*n),0,1),m=o*l-s,d=n*l-a,b=m*m+d*d;b<c&&(c=b,u=g/3)}c<m*m&&a(o.distance,o.normal,u)}intersect(i,r,u,f,d,g){const{options:S,camera:y,rayBegin:w,rayEnd:A}=u;if(!S.selectionMode||!i.visible||!y)return;if(!V(r))return void t.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const T=i.attributes,z=T.get("position").data;let C=this.parameters.width;if(this.parameters.vvSize){const t=T.get("sizeFeatureAttribute").data[0];Number.isNaN(t)||(C*=e(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else T.has("size")&&(C*=T.get("size").data[0]);const L=Z;s(L,u.point);const M=C*y.pixelRatio/2+4*y.pixelRatio;a(ht[0],L[0]-M,L[1]+M,0),a(ht[1],L[0]+M,L[1]+M,0),a(ht[2],L[0]+M,L[1]-M,0),a(ht[3],L[0]-M,L[1]-M,0);for(let t=0;t<4;t++)if(!y.unprojectFromRenderScreen(ht[t],pt[t]))return;P(y.eye,pt[0],pt[1],mt),P(y.eye,pt[1],pt[2],ct),P(y.eye,pt[2],pt[3],ut),P(y.eye,pt[3],pt[0],ft);let O=Number.MAX_VALUE,R=0;const x=X(this.parameters,T)?z.length-2:z.length-5;for(let t=0;t<x;t+=3){H[0]=z[t]+r[12],H[1]=z[t+1]+r[13],H[2]=z[t+2]+r[14];const e=(t+3)%z.length;if(I[0]=z[e]+r[12],I[1]=z[e+1]+r[13],I[2]=z[e+2]+r[14],j(mt,H)<0&&j(mt,I)<0||j(ct,H)<0&&j(ct,I)<0||j(ut,H)<0&&j(ut,I)<0||j(ft,H)<0&&j(ft,I)<0)continue;if(y.projectToRenderScreen(H,$),y.projectToRenderScreen(I,tt),$[2]<0&&tt[2]>0){o(K,H,I);const t=y.frustum,e=-j(t[4],H)/n(K,E(t[4]));l(K,K,e),h(H,H,K),y.projectToRenderScreen(H,$)}else if($[2]>0&&tt[2]<0){o(K,I,H);const t=y.frustum,e=-j(t[4],I)/n(K,E(t[4]));l(K,K,e),h(I,I,K),y.projectToRenderScreen(I,tt)}else if($[2]<0&&tt[2]<0)continue;$[2]=0,tt[2]=0;const i=b(_($,tt,rt),L);i<O&&(O=i,p(et,H),p(it,I),R=t/3)}if(O<M*M){let t=Number.MAX_VALUE;if(v(_(et,it,rt),_(w,A,st),Q)){o(Q,Q,w);const e=m(Q);l(Q,Q,1/e),t=e/c(w,A)}g(t,Q,R)}}get hasEmissions(){return this.parameters.emissiveStrength>0}createBufferWriter(){return new Y(N(this.parameters),this.parameters)}createGLMaterial(t){return new W(t)}validateParameters(t){"miter"!==t.join&&(t.miterLimit=0),null!=t.markerParameters&&(t.markerScale=t.markerParameters.width/t.width)}update(t){const{hasAnimation:e,animationSpeed:i}=this.parameters;return!!e&&(this.setParameters({timeElapsed:r(t.time)*i},!1),0!==t.dt)}}class W extends M{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(t){const e=this._material.parameters.stipplePattern;return this._stipplePattern!==e&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(e,this._stipplePattern)}),this._stipplePattern=e),this.getTechnique(k,t)}}class J extends R{constructor(){super(...arguments),this.width=0,this.color=d,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=0,this.animation=0,this.animationSpeed=1,this.trailLength=1,this.emissiveStrength=0}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}}class Y{constructor(t,e){this.layout=t,this._parameters=e;const i=e.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=i;break;case"round":this.numJoinSubdivisions=F+i}}_isClosed(t){return X(this._parameters,t)}allocate(t){return this.layout.createBuffer(t)}elementCount(t){const e=2,i=t.get("position").indices.length/2+1,r=this._isClosed(t);let s=r?2:2*e;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(t,e,i,r,s,o){const n=i.get("position"),l=n.indices,h=n.data.length/3,m=i.get("distanceToStart")?.data;l&&l.length!==2*(h-1)&&console.warn("RibbonLineMaterial does not support indices");const f=(this.layout.fields.has("sizeFeatureAttribute")?i.get("sizeFeatureAttribute")?.data[0]:i.get("size")?.data[0])??1;let d=[1,1,1,1],b=0;const _=this.layout.fields.has("colorFeatureAttribute");_?b=i.get("colorFeatureAttribute").data[0]:i.has("color")&&(d=i.get("color").data);const S=i.get("timeStamps")?.data,v=S&&this.layout.fields.has("timeStamps"),P=this.layout.fields.has("opacityFeatureAttribute"),y=P?i.get("opacityFeatureAttribute").data[0]:0,j=new Float32Array(s.buffer),E=g(s.buffer),w=new Uint8Array(s.buffer),A=this.layout.stride/4;let T=o*A;const z=T;let C=0;const M=m?(t,e,i)=>C=m[i]:(t,e,i)=>C+=c(t,e),O=j.BYTES_PER_ELEMENT/E.BYTES_PER_ELEMENT,V=4/O,R=(t,e,i,s,a,o,n,l)=>{j[T++]=e[0],j[T++]=e[1],j[T++]=e[2],x(t,e,E,T*O),T+=V,x(i,e,E,T*O),T+=V,j[T++]=l;let h=T*O;if(E[h++]=a,E[h++]=o,T=Math.ceil(h/O),_)j[T]=b;else{const t=Math.min(4*n,d.length-4),e=4*T;w[e]=255*d[t],w[e+1]=255*d[t+1],w[e+2]=255*d[t+2],w[e+3]=255*d[t+3]}if(T++,j[T++]=f,P&&(j[T++]=y),L()){let t=4*T;r?(w[t++]=r[0],w[t++]=r[1],w[t++]=r[2],w[t++]=r[3]):(w[t++]=0,w[t++]=0,w[t++]=0,w[t++]=0),T=Math.ceil(.25*t)}v&&(h=T*O,E[h++]=s[0],E[h++]=s[1],E[h++]=s[2],T=Math.ceil(h/O))};T+=A,a(ot,n.data[0],n.data[1],n.data[2]),v&&a(lt,S[0],S[1],S[2]),t&&u(ot,ot,t);const F=this._isClosed(i);if(F){const e=n.data.length-3;a(at,n.data[e],n.data[e+1],n.data[e+2]),t&&u(at,at,t)}else a(nt,n.data[3],n.data[4],n.data[5]),t&&u(nt,nt,t),R(ot,ot,nt,lt,1,-4,0,0),R(ot,ot,nt,lt,1,4,0,0),p(at,ot),p(ot,nt),v&&a(lt,S[3],S[4],S[5]);const N=F?0:1,k=F?h:h-1;for(let c=N;c<k;c++){const e=(c+1)%h*3;a(nt,n.data[e],n.data[e+1],n.data[e+2]),t&&u(nt,nt,t),M(at,ot,c),R(at,ot,nt,lt,0,-1,c,C),R(at,ot,nt,lt,0,1,c,C);const i=this.numJoinSubdivisions;for(let t=0;t<i;++t){const e=(t+1)/(i+1);R(at,ot,nt,lt,e,-1,c,C),R(at,ot,nt,lt,e,1,c,C)}R(at,ot,nt,lt,1,-2,c,C),R(at,ot,nt,lt,1,2,c,C),p(at,ot),p(ot,nt),v&&a(lt,S[e],S[e+1],S[e+2])}F?(a(nt,n.data[3],n.data[4],n.data[5]),t&&u(nt,nt,t),C=M(at,ot,k),R(at,ot,nt,lt,0,-1,N,C),R(at,ot,nt,lt,0,1,N,C)):(C=M(at,ot,k),R(at,ot,ot,lt,0,-5,k,C),R(at,ot,ot,lt,0,5,k,C)),q(j,z+A,j,z,A);return T=q(j,T-A,j,T,A),this._parameters.wireframe&&this._addWireframeVertices(s,z,T,A),null}_addWireframeVertices(t,e,i,r){const s=new Float32Array(t.buffer,i*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(t.buffer,e*Float32Array.BYTES_PER_ELEMENT,i-e);let o=0;const n=t=>o=q(a,t,s,o,r);for(let l=0;l<a.length-1;l+=2*r)n(l),n(l+2*r),n(l+1*r),n(l+2*r),n(l+1*r),n(l+3*r)}}function q(t,e,i,r,s){for(let a=0;a<s;a++)i[r++]=t[e++];return r}function X(t,e){if(!t.isClosed)return!1;return e.get("position").indices.length>2}function G(t){return 1===t.anchor&&t.hideOnShortSegments&&"begin-end"===t.placement&&t.worldSpace}const H=f(),I=f(),K=f(),Q=f(),Z=f(),$=i(),tt=i(),et=f(),it=f(),rt=S(),st=S(),at=f(),ot=f(),nt=f(),lt=f(),ht=[i(),i(),i(),i()],pt=[f(),f(),f(),f()],mt=y(),ct=y(),ut=y(),ft=y();export{J as Parameters,B as RibbonLineMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{n as e,i as t,g as r,f as s}from"../../../../chunks/vec32.js";import{fromValues as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as o,scale as p}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOID as h,isColorOrColorEmission as l}from"../core/shaderLibrary/ShaderOutput.js";import u from"../lib/GLMaterial.js";import{Material as f,MaterialParameters as m}from"../lib/Material.js";import{intersectTriangleGeometry as g}from"../lib/RayIntersections.js";import{assert as d}from"../lib/Util.js";import{writeAttributes as b,writePosition as _}from"./internal/bufferWriterUtils.js";import{getLayout as S,ShadedColorMaterialTechnique as j}from"../shaders/ShadedColorMaterialTechnique.js";import{ShadedColorMaterialTechniqueConfiguration as w}from"../shaders/ShadedColorMaterialTechniqueConfiguration.js";import{alphaCutoff as T}from"../../../../webscene/support/AlphaCutoff.js";class x extends f{constructor(e){super(e,D),this._configuration=new w,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>
|
|
5
|
+
import{n as e,i as t,g as r,f as s}from"../../../../chunks/vec32.js";import{fromValues as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as o,scale as p}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOID as h,isColorOrColorEmission as l}from"../core/shaderLibrary/ShaderOutput.js";import u from"../lib/GLMaterial.js";import{Material as f,MaterialParameters as m}from"../lib/Material.js";import{intersectTriangleGeometry as g}from"../lib/RayIntersections.js";import{assert as d}from"../lib/Util.js";import{writeAttributes as b,writePosition as _}from"./internal/bufferWriterUtils.js";import{getLayout as S,ShadedColorMaterialTechnique as j}from"../shaders/ShadedColorMaterialTechnique.js";import{ShadedColorMaterialTechniqueConfiguration as w}from"../shaders/ShadedColorMaterialTechniqueConfiguration.js";import{alphaCutoff as T}from"../../../../webscene/support/AlphaCutoff.js";class x extends f{constructor(e){super(e,D),this._configuration=new w,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>9===e||h(e)&&!this.parameters.transparent],[4,e=>h(e)&&this.parameters.transparent&&this.parameters.writeDepth],[8,e=>h(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&l(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color[3]>=T}intersect(e,t,r,s,i,a){this._intersect(e,r,s,i,a)}intersectDraped(e,t,r,s){return this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],this._intersect(e,t,this._pp0,this._pp1,s)}_intersect(e,i,a,n,c){if(this.parameters.screenSizeEnabled){const h=e.attributes.get("offset"),l={applyToVertex:(e,a,n,o)=>{const p=t(E,h.data[3*o],h.data[3*o+1],h.data[3*o+2]),c=t(M,e,a,n);return r(p,p,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(p)??1)),s(c,c,p),[c[0],c[1],c[2]]},applyToAabb:e=>{const t=o(e,E);return p(e,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(t)??1))}};g(e,i,a,n,l,c)}else g(e,i,a,n,void 0,c)}createGLMaterial(e){return new z(e)}createBufferWriter(){return new y(S(this.parameters))}}class z extends u{beginSlot(e){return this.getTechnique(j,e)}}class D extends m{constructor(){super(...arguments),this.color=n(1,1,1,1),this.shadingTint=n(0,0,0,.25),this.shadingDirection=e(a(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class y{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,s,i,a){const n=b(r,s,this.layout,e,t,i,a),o=i.getField("offset",c);if(o&&r.has("offset")){const e=r.get("offset");d(3===e.size),_(e,t,o,a)}return n}}const E=a(),M=a();export{D as Parameters,x as ShadedColorMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{WaterDistortionPassParameters as e}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as o,getDrawBuffers as a,depthWrite as i,oitDepthTest as n,blending as l}from"../lib/OrderIndependentTransparency.js";import{PositionUvf32OlidLayout as d,PositionUvf32Layout as c}from"./DefaultLayouts.js";import{W as p}from"../../../../chunks/WaterSurface.glsl.js";import{makePipelineState as f,defaultColorWrite as m}from"../../../webgl/renderState.js";class u extends e{}class h extends t{constructor(e,t){super(e,t,new r(p,()=>import("../shaders/WaterSurface.glsl.js")),s()?d.locations:c.locations)}initializePipeline(e){const{oitPass:r,output:t,transparent:s,draped:d}=e;return f({blending:3!==t&&
|
|
5
|
+
import{WaterDistortionPassParameters as e}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as o,getDrawBuffers as a,depthWrite as i,oitDepthTest as n,blending as l}from"../lib/OrderIndependentTransparency.js";import{PositionUvf32OlidLayout as d,PositionUvf32Layout as c}from"./DefaultLayouts.js";import{W as p}from"../../../../chunks/WaterSurface.glsl.js";import{makePipelineState as f,defaultColorWrite as m}from"../../../webgl/renderState.js";class u extends e{}class h extends t{constructor(e,t){super(e,t,new r(p,()=>import("../shaders/WaterSurface.glsl.js")),s()?d.locations:c.locations)}initializePipeline(e){const{oitPass:r,output:t,transparent:s,draped:d}=e;return f({blending:3!==t&&9!==t&&10!==t&&s?l(r):null,depthTest:d?null:{func:n(r)},depthWrite:i(e),drawBuffers:a(r,t),colorWrite:m,polygonOffset:o(e)})}}export{u as WaterMaterialPassParameters,h as WaterTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import i from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{disposeMaybe as e}from"../../../../../core/maybe.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{GLMaterials as a}from"../../lib/GLMaterials.js";import{DrawParameters as o}from"../DrawParameters.js";import{defaultHighlightName as n}from"../../../../support/HighlightDefaults.js";let h=class extends i{constructor(t){super(t),this._glMaterials=null,this._drawParameters=new o,this._highlightNames=new Set,this._produces=new Map}initialize(){this._updateProduces()}destroy(){this.uninitializeRenderContext()}get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(t){return this._highlightNames.has(t)}get produces(){return this._produces}_updateProduces(){this.material.produces.forEach((t,i)=>{this._produces.set(i,i=>!(0===this.dataByOrigin.size||!(
|
|
5
|
+
import{__decorate as t}from"tslib";import i from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{disposeMaybe as e}from"../../../../../core/maybe.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{GLMaterials as a}from"../../lib/GLMaterials.js";import{DrawParameters as o}from"../DrawParameters.js";import{defaultHighlightName as n}from"../../../../support/HighlightDefaults.js";let h=class extends i{constructor(t){super(t),this._glMaterials=null,this._drawParameters=new o,this._highlightNames=new Set,this._produces=new Map}initialize(){this._updateProduces()}destroy(){this.uninitializeRenderContext()}get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(t){return this._highlightNames.has(t)}get produces(){return this._produces}_updateProduces(){this.material.produces.forEach((t,i)=>{this._produces.set(i,i=>!(0===this.dataByOrigin.size||!(9!==i&&5!==i||this._hasHighlights))&&t(i))})}initializeRenderContext(t){this._glMaterials=new a(this.material,t.materials)}uninitializeRenderContext(){this._glMaterials=e(this._glMaterials)}acquireTechniques(t){if(!this.material.shouldRender(t))return null;const{output:i,bind:e}=t,s=this.material.produces.get(e.slot);if(!s?.(i))return null;const{highlight:r,slot:a}=e,o=5===i,h=9===i,l=h||o,g=r?.name;if(l&&(0===this._highlightNames.size||h&&g&&!this._highlightNames.has(g)))return null;const d=t=>h&&!!g&&!t.has(g),m=6===i,u=!(l||m);for(const{buffers:c}of this.dataByOrigin.values())for(const s of c){if(d(s.highlightNames))continue;const r=o?s.drawCommandsHighlights.get(n):l?g?s.drawCommandsHighlights.get(g):s.drawCommandsHighlights.size>0:((m&&s.needsMultipleCommands?s.drawCommandsShadowHighlightRest:s.drawCommandsDefault)||null)?.length??!1,h=u&&s.drawCommandsOccludees||null;if(r||h?.length){const s=this._glMaterials.load(t.rctx,a,i),r=s?.beginSlot(e);if(r)return r}}return null}render(t,i){const{output:e,bind:s}=t,{slot:r,highlight:a}=s,o=9===e,h=a?.name??"";if(o&&!a)return;const l=5===e,g=o||l,d=6===e,m=!(g||d),u=10===r||11===r?r:null,{rctx:c}=t;c.runAppleAmdDriverHelper();const p=c.bindTechnique(i,s,this.material.parameters);for(const f of this.dataByOrigin.values())for(const t of f.buffers){if(o&&(!t.hasHighlights||!t.drawCommandsHighlights.has(h)))continue;if(l&&(!t.hasHighlights||!t.drawCommandsHighlights.has(n)))continue;const e=g&&!l?t.drawCommandsHighlights.get(h)??null:null,r=l?t.drawCommandsHighlights.get(n):g?e:d&&t.needsMultipleCommands?t.drawCommandsShadowHighlightRest:t.drawCommandsDefault,a=null!=r,w=m&&t.drawCommandsOccludees||null;if(a||w?.length){if(this._drawParameters.origin=f.origin,p.bindDraw(s,this.material.parameters,this._drawParameters),i.ensureAttributeLocations(t.vao),c.bindVAO(t.vao),a)for(const t of r)c.setPipelineState(i.getPipeline(!1,u)),c.drawArrays(i.primitiveType,t.first,t.count);if(w?.length){c.setPipelineState(i.getPipeline(!0,u));for(const t of w)c.drawArrays(i.primitiveType,t.first,t.count)}}}}updateHighlights(){const{_highlightNames:t}=this;t.clear();for(const i of this.dataByOrigin.values())for(const e of i.buffers)for(const i of e.highlightNames)t.add(i);this._updateProduces()}get test(){}};t([s({constructOnly:!0})],h.prototype,"material",void 0),t([s({constructOnly:!0})],h.prototype,"dataByOrigin",void 0),h=t([r("esri.views.3d.webgl-engine.materials.renderers.VaoRenderer")],h);export{h as VaoRenderer};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/output/ReadDepth.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{C as CutFillDepthParameters,b as build}from"../../../../chunks/CutFillDepth.glsl.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos2Locations as t}from"../lib/DefaultVertexBufferLayouts.js";import{a as o}from"../../../../chunks/CutFillDepth.glsl.js";import{makePipelineState as i,defaultColorWrite as l}from"../../../webgl/renderState.js";class s extends r{constructor(r,i){super(r,i,new e(o,()=>import("./CutFillDepth.glsl.js")),t)}initializePipeline(){return i({colorWrite:l})}}export{s as CutFillDepthTechnique};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{C as CutFillReductionParameters,b as build}from"../../../../chunks/CutFillReduction.glsl.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos2Locations as o}from"../lib/DefaultVertexBufferLayouts.js";import{a as t}from"../../../../chunks/CutFillReduction.glsl.js";import{makePipelineState as i,defaultColorWrite as l}from"../../../webgl/renderState.js";class s extends r{constructor(r,i){super(r,i,new e(t,()=>import("./CutFillReduction.glsl.js")),o)}initializePipeline(){return i({colorWrite:l})}}export{s as CutFillReductionTechnique};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4PassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{C as CutFillTargetDepthParameters,b as build}from"../../../../chunks/CutFillTargetDepth.glsl.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos3Locations as t}from"../lib/DefaultVertexBufferLayouts.js";import{a as o}from"../../../../chunks/CutFillTargetDepth.glsl.js";import{makePipelineState as i,defaultDepthWrite as s,defaultColorWrite as l}from"../../../webgl/renderState.js";class a extends r{constructor(r,i){super(r,i,new e(o,()=>import("./CutFillTargetDepth.glsl.js")),t)}initializePipeline(){return i({colorWrite:l,depthWrite:s,depthTest:{func:519}})}}export{a as CutFillTargetDepthTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as o}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{getDrawBuffers as i,oitBlending as n}from"../lib/OrderIndependentTransparency.js";import{H as l}from"../../../../chunks/HUDMaterial.glsl.js";import{PrimitiveType as a}from"../../../webgl/enums.js";import{makePipelineState as c,defaultColorWrite as f,defaultDepthWrite as u,premultipliedAlpha as p}from"../../../webgl/renderState.js";class d extends t{constructor(e,r){super(e,r,new o(l,()=>import("./HUDMaterial.glsl.js")),(s()?v:h).locations),this.primitiveType=r.occlusionPass?a.POINTS:a.TRIANGLES}initializePipeline(e){const{oitPass:o,hasPolygonOffset:t,draped:s,output:l,depthTestEnabled:a,occlusionPass:d}=e,h=0===o,v=a&&!s&&!(1===o)&&!d&&!(
|
|
5
|
+
import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as o}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{getDrawBuffers as i,oitBlending as n}from"../lib/OrderIndependentTransparency.js";import{H as l}from"../../../../chunks/HUDMaterial.glsl.js";import{PrimitiveType as a}from"../../../webgl/enums.js";import{makePipelineState as c,defaultColorWrite as f,defaultDepthWrite as u,premultipliedAlpha as p}from"../../../webgl/renderState.js";class d extends t{constructor(e,r){super(e,r,new o(l,()=>import("./HUDMaterial.glsl.js")),(s()?v:h).locations),this.primitiveType=r.occlusionPass?a.POINTS:a.TRIANGLES}initializePipeline(e){const{oitPass:o,hasPolygonOffset:t,draped:s,output:l,depthTestEnabled:a,occlusionPass:d}=e,h=0===o,v=a&&!s&&!(1===o)&&!d&&!(9===l);return c({blending:r(l)?h?p:n(o):null,depthTest:a&&!s?{func:515}:null,depthWrite:v?u:null,drawBuffers:i(o,l),colorWrite:f,polygonOffset:t?m:null})}}const m={factor:0,units:-4},h=e().vec3f("position").vec3f("normal").vec2i16("uvi").vec4u8("color").vec2f("size").f32("rotation").vec4f("centerOffsetAndDistance").vec4f("featureAttribute"),v=h.clone().vec4u8("olidColor");export{d as HUDMaterialTechnique,h as layout,v as olidLayout};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isColorOrColorEmission as o,isColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as l}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as i}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as s}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{If as a,glsl as t}from"../core/shaderModules/glsl.js";import{alphaCutoff as e}from"../../../../webscene/support/AlphaCutoff.js";function n(n,u){n.include(i,u),n.include(l,u),n.fragment.include(s);const{output:f,oitPass:d,discardInvisibleFragments:m,snowCover:p}=u,c=
|
|
5
|
+
import{isColorOrColorEmission as o,isColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as l}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as i}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as s}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{If as a,glsl as t}from"../core/shaderModules/glsl.js";import{alphaCutoff as e}from"../../../../webscene/support/AlphaCutoff.js";function n(n,u){n.include(i,u),n.include(l,u),n.fragment.include(s);const{output:f,oitPass:d,discardInvisibleFragments:m,snowCover:p}=u,c=10===f,g=r(f),C=o(f)&&1===d,h=o(f)&&1!==d;let v=0;(h||g||C)&&n.outputs.add("fragColor","vec4",v++),g&&n.outputs.add("fragEmission","vec4",v++),C&&n.outputs.add("fragAlpha","float",v++),n.fragment.code.add(t`
|
|
6
6
|
void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveSymbolColor ${a(p,", float snow")}) {
|
|
7
7
|
${a(c,"finalColor.a = 1.0;")}
|
|
8
8
|
|
package/views/3d/webgl.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import o from"../../Camera.js";import{rad2deg as e,deg2rad as r}from"../../core/mathUtils.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as
|
|
5
|
+
import o from"../../Camera.js";import{rad2deg as e,deg2rad as r}from"../../core/mathUtils.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as i,f as n}from"../../chunks/vec32.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"../../geometry/Point.js";import a from"../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as s}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as p}from"../../geometry/projection/projectBuffer.js";import{projectPointToVector as m}from"../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as f}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as u}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as d,viewModeDependentUtil as R}from"./support/viewingModeUtils.js";const g={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},j={SSAO:"ssao",LASERLINES:"laserline-color",ANTIALIASING:"aa-color",HIGHLIGHTS:"highlight-color",MAGNIFIER:"magnifier-color",OCCLUDED:"occluded-color",VIEWSHED:"viewshed-color",CUTFILL_DEPTH:"cutfill-depth",OPAQUE_TERRAIN:"opaque-terrain-color",OPAQUE_ENVIRONMENT:"opaque-environment-color",TRANSPARENT_ENVIRONMENT:"transparent-environment-color",FOCUSAREA:"focusarea",FOCUSAREA_COLOR:"focusarea-color"};function A(o,e,r,t,i,n,c){return t=t||o.spatialReference,p(e,t,r,i,o.renderCoordsHelper.spatialReference,n,c)?i:null}function E(o,e,r,t,i,n,c){return n=n||o.spatialReference,p(e,o.renderCoordsHelper.spatialReference,r,t,n,i,c)?t:null}function y(o,e,r,i){return i||(i=t()),r=r||o.spatialReference,s(r,e,i,o.renderCoordsHelper.spatialReference)?i:null}function T(r,t,i){const n=r.renderSpatialReference,c=d(r,t.eye,t.viewForward,t.up,I);let s=r.spatialReference;return f(t.eye,n,S,s)||(s=a.WGS84,f(t.eye,n,S,s)),null==i?i=new o(new l(S,s),c.heading,c.tilt,e(t.fov)):(i.position.x=S[0],i.position.y=S[1],i.position.z=S[2],i.position.spatialReference=s,i.heading=c.heading,i.tilt=c.tilt,i.fov=e(t.fov)),i.layout.row=t.row,i.layout.rows=t.rows,i.layout.column=t.column,i.layout.columns=t.columns,i}function N(o,e){if(!e)return null;const t=o.renderSpatialReference,l=R(o).headingTiltToDirectionUp,a=c();if(!m(e.position,a,t))return null;const s=l(a,e.heading,e.tilt);i(s.direction,s.direction,o.state.camera.distance),n(s.direction,s.direction,a);const p=u(o,a,s.direction,s.up);return p.fov=r(e.fov),p.row=e.layout.row,p.rows=e.layout.rows,p.column=e.layout.column,p.columns=e.layout.columns,p}const S=c(),I={heading:0,tilt:0};export{j as InternalRenderCategory,g as RenderCategory,T as fromRenderCamera,E as fromRenderCoordinates,y as renderCoordinateTransformAt,N as toRenderCamera,A as toRenderCoordinates};
|
package/views/GroundView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../core/Accessor.js";import t from"../core/Collection.js";import{when as s}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{isLayerGroundReplacement as a}from"../layers/GroundLayer.js";import{toExtent as n}from"./3d/support/cameraUtils.js";import p from"./support/GroundViewElevationSampler.js";let d=class extends r{constructor(e){super(e),this.view=null,this.layerViews=new t}initialize(){this.addHandles(s(()=>this.view?.map?.ground,async e=>e.load())),"3d"===this.view.type&&this.addHandles([s(()=>this.view.map?.basemap,e=>{e.groundLayers.on("after-changes",()=>this._groundLayersChanged())},{initial:!0}),s(()=>"3d"===this.view.type&&(this.view?.basemapTerrain??!1),async()=>{this._groundLayersChanged()})])}_groundLayersChanged(){const e=this.view.map.basemap?.groundLayers.some(a),{view:r}=this;if("3d"===r?.type){const t=r.basemapTerrain;t&&t.enable(!e)}}get ground(){return this.view?.map?.ground}destroy(){this._set("view",null);for(const e of this.layerViews)e.destroy();this.layerViews.length=0}get elevationSampler(){return"2d"!==this.view?.type&&this.view?.ready&&this.view?.basemapTerrain?.ready?new p({view:this.view}):null}get extent(){const e=this.view;return e&&"2d"!==e.type&&e.ready?n(e,e.state.camera,e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation):null}get updating(){return!this.suspended&&this.layerViews.some(e=>e.updating)}get suspended(){return this.view?.suspended??!0}};e([o({readOnly:!0})],d.prototype,"elevationSampler",null),e([o({readOnly:!0})],d.prototype,"extent",null),e([o({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([o({constructOnly:!0})],d.prototype,"view",void 0),e([o({type:t,readOnly:!0})],d.prototype,"layerViews",void 0),e([o({readOnly:!0})],d.prototype,"suspended",null),d=e([i("esri.views.GroundView")],d);const l=d;export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{EventedAccessor as i}from"../../../core/Evented.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{zeroMeters as o}from"../../../core/quantityUtils.js";import{when as r,watch as a,syncAndInitial as h,initial as c}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Point.js";import _ from"../../../geometry/Polygon.js";import d from"../../../geometry/Polyline.js";import{create as m}from"../../../geometry/support/aaBoundingRect.js";import{getRingsOrPathsBounds as g}from"../../../geometry/support/boundsUtils.js";import{geometryToCoordinates as u}from"../../../geometry/support/coordsUtils.js";import y from"../../../geometry/support/rotate.js";import v from"../../../symbols/SimpleFillSymbol.js";import f from"../../../symbols/SimpleLineSymbol.js";import G from"../../../symbols/SimpleMarkerSymbol.js";import{cloneMove as b,scale as x,getScaleRatio as w,getRotationAngle as S}from"./drawUtils.js";import k from"./GraphicMover.js";import R from"./HighlightHelper.js";import{addUniqueLayer as C}from"./layerUtils.js";import{settings as M}from"./settings.js";import H from"../../interactive/sketch/SketchOptions.js";import{makeTooltip as I}from"../../interactive/tooltip/tooltipCommonUtils.js";import{ExtentRotateTooltipInfo as O}from"../../interactive/tooltip/infos/ExtentRotateTooltipInfo.js";import{ExtentScaleTooltipInfo as j}from"../../interactive/tooltip/infos/ExtentScaleTooltipInfo.js";import{TranslateTooltipInfo as T}from"../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{autoSize2D as L}from"../../support/extentUtils.js";const E=M.transformGraphics,z={centerIndicator:new G({style:"cross",size:E.center.size,color:E.center.color}),fill:{default:new v({color:E.fill.color,outline:{color:E.fill.outlineColor,join:"round",width:1}}),active:new v({color:E.fill.stagedColor,outline:{color:E.fill.outlineColor,join:"round",style:"dash",width:1}})},handles:{default:new G({style:"square",size:E.vertex.size,color:E.vertex.color,outline:{color:E.vertex.outlineColor,width:1}}),hover:new G({style:"square",size:E.vertex.hoverSize,color:E.vertex.hoverColor,outline:{color:E.vertex.hoverOutlineColor,width:1}})},rotator:{default:new G({style:"circle",size:E.vertex.size,color:E.vertex.color,outline:{color:E.vertex.outlineColor,width:1}}),hover:new G({style:"circle",size:E.vertex.hoverSize,color:E.vertex.hoverColor,outline:{color:E.vertex.hoverOutlineColor,width:1}})},rotatorLine:new f({color:E.line.color,width:1})},B=Symbol();let N=class extends i{constructor(t){super(t),this._activeHandleGraphic=null,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._centerGraphic=null,this._backgroundGraphic=null,this._vertexGraphics=[],this._rotateHandleGraphic=null,this._rotateGraphicOffset=20,this._angleOfRotation=0,this._rotateLineGraphic=null,this._startInfo=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this.tooltip=null,this.type="box",this.callbacks={onMoveStart(){},onMove(){},onMoveStop(){},onScaleStart(){},onScale(){},onScaleStop(){},onRotateStart(){},onRotate(){},onRotateStop(){},onGraphicClick(){}},this.enableMovement=!0,this.enableRotation=!0,this.enableScaling=!0,this.graphics=[],this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.preserveAspectRatio=!1,this.showCenterGraphic=!0,this.symbols=z,this.sketchOptions=new H,this.view=null,this._getBounds=(()=>{const t=m();return(e,i)=>{e[0]=Number.POSITIVE_INFINITY,e[1]=Number.POSITIVE_INFINITY,e[2]=Number.NEGATIVE_INFINITY,e[3]=Number.NEGATIVE_INFINITY;for(const s of i){if(!s)continue;let i,o,r,a;if("point"===s.type)i=r=s.x,o=a=s.y;else if("extent"===s.type)[i,o,r,a]=[s.xmin,s.ymin,s.xmax,s.ymax];else{const e=u(s);[i,o,r,a]=g(t,e)}e[0]=Math.min(i,e[0]),e[1]=Math.min(o,e[1]),e[2]=Math.max(r,e[2]),e[3]=Math.max(a,e[3])}return e}})()}initialize(){const t=this.view;this._highlightHelper=new R({view:t}),this._setup(),this.addHandles([r(()=>t?.ready,()=>{const{layer:t,view:e}=this;C(e,t)},{once:!0,initial:!0}),a(()=>this.preserveAspectRatio,()=>{this._activeHandleGraphic&&(this._scaleGraphic(this._activeHandleGraphic),this._updateGraphics(),this._updateTooltip(this._activeHandleGraphic))}),a(()=>t?.scale,()=>{this._updateRotateGraphic(),this._updateRotateLineGraphic()}),a(()=>this.graphics,()=>this.refresh()),a(()=>this.layer,(t,e)=>{e&&this._resetGraphics(e),this.refresh()}),a(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),a(()=>this.sketchOptions.tooltips.effectiveEnabled,e=>{this.tooltip=e?I(()=>({view:t,options:this.sketchOptions.tooltips})):s(this.tooltip)},h),a(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),c),this.on("move-start",t=>this.callbacks?.onMoveStart?.(t)),this.on("move",t=>this.callbacks?.onMove?.(t)),this.on("move-stop",t=>this.callbacks?.onMoveStop?.(t)),this.on("rotate-start",t=>this.callbacks?.onRotateStart?.(t)),this.on("rotate",t=>this.callbacks?.onRotate?.(t)),this.on("rotate-stop",t=>this.callbacks?.onRotateStop?.(t)),this.on("scale-start",t=>this.callbacks?.onScaleStart?.(t)),this.on("scale",t=>this.callbacks?.onScale?.(t)),this.on("scale-stop",t=>this.callbacks?.onScaleStop?.(t))])}destroy(){this._reset(),this.tooltip=s(this.tooltip)}get state(){const t=this.view?.ready??!1,e=this.graphics.length&&this.layer;return t&&e?"active":t?"ready":"disabled"}isUIGraphic(t){return this._vertexGraphics.includes(t)||t===this._backgroundGraphic||t===this._centerGraphic||t===this._rotateHandleGraphic||t===this._rotateLineGraphic}move(t,e){if(this._mover&&this.graphics.length){for(const i of this.graphics){const s=i.geometry,o=b(s,t,e,this.view);i.geometry=o}this.refresh(),this.emit("move-stop",{graphics:this.graphics,mover:null,dx:t,dy:e,type:"move-stop"})}}scale(t,e){if(this._mover&&this.graphics.length){for(const i of this.graphics){const s=i.geometry,o=x(s,t,e);i.geometry=o}this.refresh(),this.emit("scale-stop",{graphics:this.graphics,mover:null,xScale:t,yScale:e,type:"scale-stop"})}}rotate(t,e){if(this._mover&&this.graphics.length){if(!e){const t=this._vertexGraphics[1].geometry.x,i=this._vertexGraphics[3].geometry.y;e=new p(t,i,this.view.spatialReference)}for(const i of this.graphics){const s=i.geometry,o=y(s,t,e);i.geometry=o}this.refresh(),this.emit("rotate-stop",{graphics:this.graphics,mover:null,angle:t,type:"rotate-stop"})}}refresh(){this._reset(),this._setup()}reset(){this.graphics=[]}_setup(){"active"===this.state&&(this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._updateGraphics())}_reset(){this._highlightHelper?.removeAll(),this._resetGraphicStateVars(),this._resetGraphics(),this._updateTooltip(),this._mover?.destroy(),this._mover=null,this.removeHandles(B)}_resetGraphicStateVars(){this._startInfo=null,this._activeHandleGraphic=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this._angleOfRotation=0}_resetGraphics(t){(t=t||this.layer)&&(t.removeMany(this._vertexGraphics),t.remove(this._backgroundGraphic),t.remove(this._centerGraphic),t.remove(this._rotateHandleGraphic),t.remove(this._rotateLineGraphic)),this._vertexGraphics.forEach(t=>!t.destroyed&&t.destroy()),!this._backgroundGraphic.destroyed&&this._backgroundGraphic.destroy(),!this._centerGraphic.destroyed&&this._centerGraphic.destroy(),!this._rotateHandleGraphic.destroyed&&this._rotateHandleGraphic.destroy(),!this._rotateLineGraphic.destroyed&&this._rotateLineGraphic.destroy(),this._vertexGraphics=[],this._backgroundGraphic=null,this._centerGraphic=null,this._rotateHandleGraphic=null,this._rotateLineGraphic=null}_setupMover(){let t=[];this.enableScaling&&(t=t.concat(this._vertexGraphics)),this.enableRotation&&t.push(this._rotateHandleGraphic),this.enableMovement&&(t=t.concat(this.graphics,this._backgroundGraphic)),this.showCenterGraphic&&t.push(this._centerGraphic),this._mover=new k({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,view:this.view,graphics:t,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setCursor(t){this.addHandles(this.view.acquireCursor(t,"high"),B)}_getStartInfo(t){const[e,i,s,o]=this._getBoxBounds(m()),r=Math.abs(s-e),a=Math.abs(o-i),h=(s+e)/2,c=(o+i)/2,{x:n,y:l}=t.geometry;return{width:r,height:a,centerX:h,centerY:c,startX:n,startY:l,graphicInfos:this._getGraphicInfos(),box:this._backgroundGraphic.geometry,rotate:this._rotateHandleGraphic.geometry}}_getGraphicInfos(){return this.graphics.map(t=>this._getGraphicInfo(t))}_getGraphicInfo(t){const e=t.geometry,[i,s,o,r]=this._getBounds(m(),[e]);return{width:Math.abs(o-i),height:Math.abs(r-s),centerX:(o+i)/2,centerY:(r+s)/2,geometry:e}}_onGraphicClickCallback(t){t.viewEvent.stopPropagation(),this.emit("graphic-click",t),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(t)}_onGraphicMoveStartCallback(t){const{_angleOfRotation:e,_xScale:i,_yScale:s,_backgroundGraphic:o,_vertexGraphics:r,_rotateHandleGraphic:a,symbols:h,graphics:c}=this,{graphic:n,dx:l,dy:p,viewEvent:_}=t;this._resetGraphicStateVars(),this._hideGraphicsBeforeUpdate(),o.symbol=h.fill.active,this._startInfo=this._getStartInfo(n),this._updateTooltip(n,_),n===a?(this._setCursor("grabbing"),this.emit("rotate-start",{type:"rotate-start",mover:n,graphics:c,angle:e})):r.includes(n)?(this._activeHandleGraphic=n,this.emit("scale-start",{type:"scale-start",mover:n,graphics:c,xScale:i,yScale:s})):this.emit("move-start",{type:"move-start",graphics:c,mover:n,dx:l,dy:p})}_onGraphicMoveCallback(t){const e=t.graphic;if(!this._startInfo)return;const{_xScale:i,_yScale:s,_angleOfRotation:o,graphics:r}=this;if(this._vertexGraphics.includes(e))this._scaleGraphic(e),this._updateTooltip(e,t.viewEvent),this.emit("scale",{type:"scale",graphics:r,mover:e,xScale:i,yScale:s});else if(e===this._rotateHandleGraphic)this._rotateGraphic(e),this._updateTooltip(e,t.viewEvent),this.emit("rotate",{type:"rotate",graphics:r,mover:e,angle:o});else{const{dx:i,dy:s}=t;this._totalDx+=i,this._totalDy+=s,this._moveGraphic(e,i,s),this._updateTooltip(e,t.viewEvent),this.emit("move",{type:"move",graphics:r,mover:e,dx:i,dy:s})}}_onGraphicMoveStopCallback(t){const e=t.graphic;if(!this._startInfo)return void this.refresh();const{_angleOfRotation:i,_totalDx:s,_totalDy:o,_xScale:r,_yScale:a,_vertexGraphics:h,_rotateHandleGraphic:c,graphics:n}=this;this.refresh(),e===c?(this._setCursor("pointer"),this.emit("rotate-stop",{type:"rotate-stop",graphics:n,mover:e,angle:i})):h.includes(e)?this.emit("scale-stop",{type:"scale-stop",mover:e,graphics:n,xScale:r,yScale:a}):this.emit("move-stop",{type:"move-stop",graphics:n,mover:e,dx:s,dy:o})}_onGraphicPointerOverCallback(t){const{_backgroundGraphic:e,_vertexGraphics:i,graphics:s,_rotateHandleGraphic:o,symbols:r,view:a}=this,h=t.graphic;if(this._hoveredGraphic=h,h===o)return o.symbol=r.rotator.hover,this._setCursor("pointer"),void this._updateTooltip(h);if(s.includes(h)||h===e)return void this._setCursor("move");if(!i.includes(h))return void this._setCursor("pointer");this._updateTooltip(h),t.graphic.symbol=r.handles.hover;const c=a.rotation;let n,l=t.index;switch(l<8&&(c>=0&&c<45?l%=8:l=c>=45&&c<90?(l+1)%8:c>=90&&c<135?(l+2)%8:c>=135&&c<180?(l+3)%8:c>=180&&c<225?(l+4)%8:c>=225&&c<270?(l+5)%8:c>=270&&c<315?(l+6)%8:(l+7)%8),l){case 0:case 4:n="nwse-resize";break;case 1:case 5:n="ns-resize";break;case 2:case 6:n="nesw-resize";break;case 3:case 7:n="ew-resize";break;default:n="pointer"}this._setCursor(n)}_onGraphicPointerOutCallback(t){const{_vertexGraphics:e,_rotateHandleGraphic:i,symbols:s}=this;this._hoveredGraphic=null,t.graphic===i?i.symbol=s.rotator.default:e.includes(t.graphic)&&(t.graphic.symbol=s.handles.default),this.removeHandles(B),this._updateTooltip()}_scaleGraphic(t){const{_startInfo:e,_vertexGraphics:i,preserveAspectRatio:s,view:o}=this,{centerX:r,centerY:a,graphicInfos:h,height:c,startX:n,startY:l,width:_}=e,{resolution:d,transform:m}=o.state,g=i.indexOf(t);1!==g&&5!==g||this._updateX(t,r),3!==g&&7!==g||this._updateY(t,a);const{x:u,y}=t.geometry,v=m[0]*u+m[2]*y+m[4],f=m[1]*u+m[3]*y+m[5],G=h?.map(t=>t.geometry)??[],S=G.every(t=>"point"===t.type);if((0===_||0===c)&&S){const t=U((u-n)/d),i=U((l-y)/d);for(let e=0;e<G.length;e++)this.graphics[e].geometry=b(G[e],t,i,o,!0);return this._centerGraphic.geometry=new p(u,y,o.spatialReference),void(this._backgroundGraphic.geometry=b(e.box,t,i,o,!0))}if(s){const t=U(m[0]*r+m[2]*a+m[4],2),e=U(m[1]*r+m[3]*a+m[5],2),i=U(m[0]*n+m[2]*l+m[4],2),s=U(m[1]*n+m[3]*l+m[5],2);let o=w(t,e,i,s,v,f);0!==o&&Math.abs(o)!==1/0||(o=1),this._xScale=this._yScale=o;for(const h of G){const t=G.indexOf(h);this.graphics[t].geometry=x(h,this._xScale,this._yScale,[r,a])}this._updateBackgroundGraphic()}else{let t=u-n,i=l-y;if(1===g||5===g?t=0:3!==g&&7!==g||(i=0),0===t&&0===i)return;const s=r+t/2,h=a+i/2;let m=(_+(n>r?t:-1*t))/_,v=(c+(l<a?i:-1*i))/c;1!==g&&5!==g&&0!==m&&Math.abs(m)!==1/0||(m=1),3!==g&&7!==g&&0!==v&&Math.abs(v)!==1/0||(v=1),this._xScale=m,this._yScale=v;const f=(s-r)/d,w=(h-a)/d,S=x(e.box,this._xScale,this._yScale);this._backgroundGraphic.geometry=b(S,f,w,o,!0);const{centerX:k,centerY:R}=this._getGraphicInfo(this._backgroundGraphic),C=(k-r)/d,M=-1*(R-a)/d;for(const e of G){const t=G.indexOf(e),i=x(e,this._xScale,this._yScale,[r,a]);this.graphics[t].geometry=b(i,C,M,o,!0)}this._centerGraphic.geometry=new p(k,R,o.spatialReference)}}_rotateGraphic(t){const{centerX:e,centerY:i,startX:s,startY:o,box:r,rotate:a}=this._startInfo,h=this.view.spatialReference,c=new p(s,o,h),n=new p(e,i,h),l=t.geometry;this._angleOfRotation=S(c,l,n);const _=this._startInfo.graphicInfos?.map(t=>t.geometry)??[];for(const p of _){const t=_.indexOf(p),e=y(p,this._angleOfRotation,n);this.graphics[t].geometry=e}this._backgroundGraphic.geometry=y(r,this._angleOfRotation,n),this._rotateHandleGraphic.geometry=y(a,this._angleOfRotation,n)}_moveGraphic(t,e,i){if(this.graphics.includes(t)){const s=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=b(s,e,i,this.view);for(const o of this.graphics)o!==t&&(o.geometry=b(o.geometry,e,i,this.view))}else if(t===this._centerGraphic){const t=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=b(t,e,i,this.view)}if(t===this._backgroundGraphic||t===this._centerGraphic)for(const s of this.graphics)s.geometry=b(s.geometry,e,i,this.view)}_setUpHighlights(){this.highlightsEnabled&&this.graphics.length&&this._highlightHelper?.add(this.graphics,this.highlightName)}_setupGraphics(){const{_graphicAttributes:t,symbols:i}=this;this._centerGraphic=new e({symbol:i.centerIndicator,attributes:t}),this.showCenterGraphic&&this.layer.add(this._centerGraphic),this._backgroundGraphic=new e({symbol:i.fill.default,attributes:t}),this.layer.add(this._backgroundGraphic),this._rotateLineGraphic=new e({symbol:i.rotatorLine,attributes:t}),this._rotateHandleGraphic=new e({symbol:i.rotator.default,attributes:t}),this.enableRotation&&!this._hasExtentGraphic()&&this.layer.addMany([this._rotateLineGraphic,this._rotateHandleGraphic]);for(let s=0;s<8;s++)this._vertexGraphics.push(new e({symbol:i.handles.default,attributes:t}));this.enableScaling&&this.layer.addMany(this._vertexGraphics)}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={...this.symbols,fill:{active:this.symbols.fill.active?.clone().set("outline.color",t),default:this.symbols.fill.default?.clone().set("outline.color",t)},handles:{...this.symbols.handles,default:this.symbols.handles.default.clone().set("outline.color",t)},rotator:{...this.symbols.rotator,default:this.symbols.rotator.default.clone().set("outline.color",t)},rotatorLine:this.symbols.rotatorLine.clone().set("color",t)};for(const e of this._vertexGraphics)e.symbol=e===this._hoveredGraphic?this.symbols.handles.hover:this.symbols.handles.default;this._backgroundGraphic.symbol=this.symbols.fill.default,this._rotateHandleGraphic.symbol=this._rotateHandleGraphic===this._hoveredGraphic?this.symbols.rotator.hover:this.symbols.rotator.default,this._rotateLineGraphic.symbol=this.symbols.rotatorLine}_updateGraphics(){this._updateBackgroundGraphic(),this._updateHandleGraphics(),this._updateCenterGraphic(),this._updateRotateGraphic(),this._updateRotateLineGraphic()}_hideGraphicsBeforeUpdate(){this._centerGraphic.visible=!1,this._rotateHandleGraphic.visible=!1,this._rotateLineGraphic.visible=!1,this._vertexGraphics.forEach(t=>t.visible=!1)}_updateHandleGraphics(){const t=this._getCoordinates(!0);this._vertexGraphics.forEach((e,i)=>{const[s,o]=t[i];this._updateXY(e,s,o)})}_updateBackgroundGraphic(){const t=this._getCoordinates().map(([t,e])=>[t,e]);this._backgroundGraphic.geometry=new _({rings:[t],spatialReference:this.view.spatialReference})}_updateCenterGraphic(){const[t,e,i,s]=this._getBoxBounds(m()),o=(i+t)/2,r=(s+e)/2;this._centerGraphic.geometry=new p(o,r,this.view.spatialReference)}_updateRotateGraphic(){if(!this._vertexGraphics.length)return;const{x:t,y:e}=this._vertexGraphics[1].geometry,i=e+this.view.state.resolution*this._rotateGraphicOffset;this._rotateHandleGraphic.geometry=new p(t,i,this.view.spatialReference)}_updateRotateLineGraphic(){if(!this._vertexGraphics.length||!this._rotateHandleGraphic?.geometry)return;const t=this._vertexGraphics[1].geometry,e=this._rotateHandleGraphic.geometry;this._rotateLineGraphic.geometry=new d({paths:[[[t.x,t.y],[e.x,e.y]]],spatialReference:this.view.spatialReference})}_updateXY(t,e,i){t.geometry=new p(e,i,this.view.spatialReference)}_updateX(t,e){const i=t.geometry.y;t.geometry=new p(e,i,this.view.spatialReference)}_updateY(t,e){const i=t.geometry.x;t.geometry=new p(i,e,this.view.spatialReference)}_hasExtentGraphic(){return this.graphics.some(t=>null!=t?.geometry&&"extent"===t.geometry.type)}_getBoxBounds(t){const e=this.graphics.map(t=>t.geometry);return this._getBounds(t,e)}_getCoordinates(t){const[e,i,s,o]=this._getBoxBounds(m());if(t){const t=(e+s)/2,r=(o+i)/2;return[[e,o],[t,o],[s,o],[s,r],[s,i],[t,i],[e,i],[e,r]]}return[[e,o],[s,o],[s,i],[e,i]]}_updateTooltip(t,e){if(null==this.tooltip)return;if(!t)return void this.tooltip.clear();const{_backgroundGraphic:i,graphics:s,_vertexGraphics:o,_rotateHandleGraphic:r}=this;t===r?this._updateRotateTooltip():o.includes(t)?this._updateScaleTooltip():(s.includes(t)||t===i)&&this._updateMoveTooltip(e)}_updateRotateTooltip(){null!=this.tooltip&&(this.tooltip.info=new O({sketchOptions:this.sketchOptions,angle:-this._angleOfRotation}))}_updateScaleTooltip(){const{tooltip:t,_xScale:e,_yScale:i,sketchOptions:s,view:o,automaticLengthMeasurementUtils:r}=this;if(null==t)return;const a=this._getCoordinates(),h=L({topLeft:a[0],topRight:a[1],bottomRight:a[2],bottomLeft:a[3],spatialReference:o.spatialReference,automaticLengthMeasurementUtils:r});if(null==h)return;const{xSize:c,ySize:n}=h,l=Math.abs(e),p=Math.abs(i);t.info=new j({sketchOptions:s,xScale:l,yScale:p,xSize:c,ySize:n})}_updateMoveTooltip(t){const{tooltip:e,sketchOptions:i,view:s,automaticLengthMeasurementUtils:r}=this;if(null==e)return;const a=new T({sketchOptions:i});if(t){const{x:e,y:i}=t.origin,h=s.toMap(t),c=s.toMap({x:e,y:i}),n=r.autoDistanceBetweenPoints2D(c,h);a.distance=null!=n?n:o}e.info=a}};function U(t,e=2){return Number.parseFloat(t.toFixed(e))}t([n()],N.prototype,"tooltip",void 0),t([n({readOnly:!0})],N.prototype,"type",void 0),t([n()],N.prototype,"callbacks",void 0),t([n()],N.prototype,"enableMovement",void 0),t([n()],N.prototype,"enableRotation",void 0),t([n()],N.prototype,"enableScaling",void 0),t([n()],N.prototype,"graphics",void 0),t([n()],N.prototype,"highlightName",void 0),t([n()],N.prototype,"highlightsEnabled",void 0),t([n()],N.prototype,"layer",void 0),t([n()],N.prototype,"preserveAspectRatio",void 0),t([n()],N.prototype,"showCenterGraphic",void 0),t([n({readOnly:!0})],N.prototype,"state",null),t([n()],N.prototype,"symbols",void 0),t([n({type:H})],N.prototype,"sketchOptions",void 0),t([n({constructOnly:!0})],N.prototype,"view",void 0),t([n({constructOnly:!0})],N.prototype,"automaticLengthMeasurementUtils",void 0),N=t([l("esri.views.draw.support.Box")],N);const Y=N;export{Y as default};
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{EventedAccessor as i}from"../../../core/Evented.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{zeroMeters as o}from"../../../core/quantityUtils.js";import{when as r,watch as a,syncAndInitial as h,initial as c}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Point.js";import _ from"../../../geometry/Polygon.js";import d from"../../../geometry/Polyline.js";import{create as m,center as g}from"../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as u}from"../../../geometry/support/boundsUtils.js";import y from"../../../geometry/support/rotate.js";import v from"../../../symbols/SimpleFillSymbol.js";import f from"../../../symbols/SimpleLineSymbol.js";import G from"../../../symbols/SimpleMarkerSymbol.js";import{cloneMove as b,scale as x,getScaleRatio as w,getRotationAngle as S}from"./drawUtils.js";import k from"./GraphicMover.js";import R from"./HighlightHelper.js";import{addUniqueLayer as C}from"./layerUtils.js";import{settings as M}from"./settings.js";import H from"../../interactive/sketch/SketchOptions.js";import{makeTooltip as I}from"../../interactive/tooltip/tooltipCommonUtils.js";import{ExtentRotateTooltipInfo as O}from"../../interactive/tooltip/infos/ExtentRotateTooltipInfo.js";import{ExtentScaleTooltipInfo as T}from"../../interactive/tooltip/infos/ExtentScaleTooltipInfo.js";import{TranslateTooltipInfo as j}from"../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{autoSize2D as L}from"../../support/extentUtils.js";const E=M.transformGraphics,B={centerIndicator:new G({style:"cross",size:E.center.size,color:E.center.color}),fill:{default:new v({color:E.fill.color,outline:{color:E.fill.outlineColor,join:"round",width:1}}),active:new v({color:E.fill.stagedColor,outline:{color:E.fill.outlineColor,join:"round",style:"dash",width:1}})},handles:{default:new G({style:"square",size:E.vertex.size,color:E.vertex.color,outline:{color:E.vertex.outlineColor,width:1}}),hover:new G({style:"square",size:E.vertex.hoverSize,color:E.vertex.hoverColor,outline:{color:E.vertex.hoverOutlineColor,width:1}})},rotator:{default:new G({style:"circle",size:E.vertex.size,color:E.vertex.color,outline:{color:E.vertex.outlineColor,width:1}}),hover:new G({style:"circle",size:E.vertex.hoverSize,color:E.vertex.hoverColor,outline:{color:E.vertex.hoverOutlineColor,width:1}})},rotatorLine:new f({color:E.line.color,width:1})},z=Symbol();let N=class extends i{constructor(t){super(t),this._activeHandleGraphic=null,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._centerGraphic=null,this._backgroundGraphic=null,this._vertexGraphics=[],this._rotateHandleGraphic=null,this._rotateGraphicOffset=20,this._angleOfRotation=0,this._rotateLineGraphic=null,this._startInfo=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this.tooltip=null,this.type="box",this.callbacks={onMoveStart(){},onMove(){},onMoveStop(){},onScaleStart(){},onScale(){},onScaleStop(){},onRotateStart(){},onRotate(){},onRotateStop(){},onGraphicClick(){}},this.enableMovement=!0,this.enableRotation=!0,this.enableScaling=!0,this.graphics=[],this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.preserveAspectRatio=!1,this.showCenterGraphic=!0,this.symbols=B,this.sketchOptions=new H,this.view=null,this._getBounds=(()=>{const t=m();return(e,i)=>{e[0]=Number.POSITIVE_INFINITY,e[1]=Number.POSITIVE_INFINITY,e[2]=Number.NEGATIVE_INFINITY,e[3]=Number.NEGATIVE_INFINITY;for(const s of i){if(!s)continue;let i,o,r,a;if("point"===s.type)i=r=s.x,o=a=s.y;else if("extent"===s.type)[i,o,r,a]=[s.xmin,s.ymin,s.xmax,s.ymax];else{const e=u(t,s);[i,o,r,a]=e}e[0]=Math.min(i,e[0]),e[1]=Math.min(o,e[1]),e[2]=Math.max(r,e[2]),e[3]=Math.max(a,e[3])}return e}})()}initialize(){const t=this.view;this._highlightHelper=new R({view:t}),this._setup(),this.addHandles([r(()=>t?.ready,()=>{const{layer:t,view:e}=this;C(e,t)},{once:!0,initial:!0}),a(()=>this.preserveAspectRatio,()=>{this._activeHandleGraphic&&(this._scaleGraphic(this._activeHandleGraphic),this._updateGraphics(),this._updateTooltip(this._activeHandleGraphic))}),a(()=>t?.scale,()=>{this._updateRotateGraphic(),this._updateRotateLineGraphic()}),a(()=>this.graphics,()=>this.refresh()),a(()=>this.layer,(t,e)=>{e&&this._resetGraphics(e),this.refresh()}),a(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),a(()=>this.sketchOptions.tooltips.effectiveEnabled,e=>{this.tooltip=e?I(()=>({view:t,options:this.sketchOptions.tooltips})):s(this.tooltip)},h),a(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),c),this.on("move-start",t=>this.callbacks?.onMoveStart?.(t)),this.on("move",t=>this.callbacks?.onMove?.(t)),this.on("move-stop",t=>this.callbacks?.onMoveStop?.(t)),this.on("rotate-start",t=>this.callbacks?.onRotateStart?.(t)),this.on("rotate",t=>this.callbacks?.onRotate?.(t)),this.on("rotate-stop",t=>this.callbacks?.onRotateStop?.(t)),this.on("scale-start",t=>this.callbacks?.onScaleStart?.(t)),this.on("scale",t=>this.callbacks?.onScale?.(t)),this.on("scale-stop",t=>this.callbacks?.onScaleStop?.(t))])}destroy(){this._reset(),this.tooltip=s(this.tooltip)}get state(){const t=this.view?.ready??!1,e=this.graphics.length&&this.layer;return t&&e?"active":t?"ready":"disabled"}isUIGraphic(t){return this._vertexGraphics.includes(t)||t===this._backgroundGraphic||t===this._centerGraphic||t===this._rotateHandleGraphic||t===this._rotateLineGraphic}move(t,e){if(this._mover&&this.graphics.length){for(const i of this.graphics){const s=i.geometry,o=b(s,t,e,this.view);i.geometry=o}this.refresh(),this.emit("move-stop",{graphics:this.graphics,mover:null,dx:t,dy:e,type:"move-stop"})}}scale(t,e){if(!this._mover||!this.graphics.length)return;const i=this._getBoxBounds(m()),s=g(i);for(const o of this.graphics){const i=o.geometry,r=x(i,t,e,s);o.geometry=r}this.refresh(),this.emit("scale-stop",{graphics:this.graphics,mover:null,xScale:t,yScale:e,type:"scale-stop"})}rotate(t,e){if(this._mover&&this.graphics.length){if(!e){const t=this._vertexGraphics[1].geometry.x,i=this._vertexGraphics[3].geometry.y;e=new p(t,i,this.view.spatialReference)}for(const i of this.graphics){const s=i.geometry,o=y(s,t,e);i.geometry=o}this.refresh(),this.emit("rotate-stop",{graphics:this.graphics,mover:null,angle:t,type:"rotate-stop"})}}refresh(){this._reset(),this._setup()}reset(){this.graphics=[]}_setup(){"active"===this.state&&(this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._updateGraphics())}_reset(){this._highlightHelper?.removeAll(),this._resetGraphicStateVars(),this._resetGraphics(),this._updateTooltip(),this._mover?.destroy(),this._mover=null,this.removeHandles(z)}_resetGraphicStateVars(){this._startInfo=null,this._activeHandleGraphic=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this._angleOfRotation=0}_resetGraphics(t){(t=t||this.layer)&&(t.removeMany(this._vertexGraphics),t.remove(this._backgroundGraphic),t.remove(this._centerGraphic),t.remove(this._rotateHandleGraphic),t.remove(this._rotateLineGraphic)),this._vertexGraphics.forEach(t=>!t.destroyed&&t.destroy()),!this._backgroundGraphic.destroyed&&this._backgroundGraphic.destroy(),!this._centerGraphic.destroyed&&this._centerGraphic.destroy(),!this._rotateHandleGraphic.destroyed&&this._rotateHandleGraphic.destroy(),!this._rotateLineGraphic.destroyed&&this._rotateLineGraphic.destroy(),this._vertexGraphics=[],this._backgroundGraphic=null,this._centerGraphic=null,this._rotateHandleGraphic=null,this._rotateLineGraphic=null}_setupMover(){let t=[];this.enableScaling&&(t=t.concat(this._vertexGraphics)),this.enableRotation&&t.push(this._rotateHandleGraphic),this.enableMovement&&(t=t.concat(this.graphics,this._backgroundGraphic)),this.showCenterGraphic&&t.push(this._centerGraphic),this._mover=new k({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,view:this.view,graphics:t,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setCursor(t){this.addHandles(this.view.acquireCursor(t,"high"),z)}_getStartInfo(t){const[e,i,s,o]=this._getBoxBounds(m()),r=Math.abs(s-e),a=Math.abs(o-i),h=(s+e)/2,c=(o+i)/2,{x:n,y:l}=t.geometry;return{width:r,height:a,centerX:h,centerY:c,startX:n,startY:l,graphicInfos:this._getGraphicInfos(),box:this._backgroundGraphic.geometry,rotate:this._rotateHandleGraphic.geometry}}_getGraphicInfos(){return this.graphics.map(t=>this._getGraphicInfo(t))}_getGraphicInfo(t){const e=t.geometry,[i,s,o,r]=this._getBounds(m(),[e]);return{width:Math.abs(o-i),height:Math.abs(r-s),centerX:(o+i)/2,centerY:(r+s)/2,geometry:e}}_onGraphicClickCallback(t){t.viewEvent.stopPropagation(),this.emit("graphic-click",t),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(t)}_onGraphicMoveStartCallback(t){const{_angleOfRotation:e,_xScale:i,_yScale:s,_backgroundGraphic:o,_vertexGraphics:r,_rotateHandleGraphic:a,symbols:h,graphics:c}=this,{graphic:n,dx:l,dy:p,viewEvent:_}=t;this._resetGraphicStateVars(),this._hideGraphicsBeforeUpdate(),o.symbol=h.fill.active,this._startInfo=this._getStartInfo(n),this._updateTooltip(n,_),n===a?(this._setCursor("grabbing"),this.emit("rotate-start",{type:"rotate-start",mover:n,graphics:c,angle:e})):r.includes(n)?(this._activeHandleGraphic=n,this.emit("scale-start",{type:"scale-start",mover:n,graphics:c,xScale:i,yScale:s})):this.emit("move-start",{type:"move-start",graphics:c,mover:n,dx:l,dy:p})}_onGraphicMoveCallback(t){const e=t.graphic;if(!this._startInfo)return;const{_xScale:i,_yScale:s,_angleOfRotation:o,graphics:r}=this;if(this._vertexGraphics.includes(e))this._scaleGraphic(e),this._updateTooltip(e,t.viewEvent),this.emit("scale",{type:"scale",graphics:r,mover:e,xScale:i,yScale:s});else if(e===this._rotateHandleGraphic)this._rotateGraphic(e),this._updateTooltip(e,t.viewEvent),this.emit("rotate",{type:"rotate",graphics:r,mover:e,angle:o});else{const{dx:i,dy:s}=t;this._totalDx+=i,this._totalDy+=s,this._moveGraphic(e,i,s),this._updateTooltip(e,t.viewEvent),this.emit("move",{type:"move",graphics:r,mover:e,dx:i,dy:s})}}_onGraphicMoveStopCallback(t){const e=t.graphic;if(!this._startInfo)return void this.refresh();const{_angleOfRotation:i,_totalDx:s,_totalDy:o,_xScale:r,_yScale:a,_vertexGraphics:h,_rotateHandleGraphic:c,graphics:n}=this;this.refresh(),e===c?(this._setCursor("pointer"),this.emit("rotate-stop",{type:"rotate-stop",graphics:n,mover:e,angle:i})):h.includes(e)?this.emit("scale-stop",{type:"scale-stop",mover:e,graphics:n,xScale:r,yScale:a}):this.emit("move-stop",{type:"move-stop",graphics:n,mover:e,dx:s,dy:o})}_onGraphicPointerOverCallback(t){const{_backgroundGraphic:e,_vertexGraphics:i,graphics:s,_rotateHandleGraphic:o,symbols:r,view:a}=this,h=t.graphic;if(this._hoveredGraphic=h,h===o)return o.symbol=r.rotator.hover,this._setCursor("pointer"),void this._updateTooltip(h);if(s.includes(h)||h===e)return void this._setCursor("move");if(!i.includes(h))return void this._setCursor("pointer");this._updateTooltip(h),t.graphic.symbol=r.handles.hover;const c=a.rotation;let n,l=t.index;switch(l<8&&(c>=0&&c<45?l%=8:l=c>=45&&c<90?(l+1)%8:c>=90&&c<135?(l+2)%8:c>=135&&c<180?(l+3)%8:c>=180&&c<225?(l+4)%8:c>=225&&c<270?(l+5)%8:c>=270&&c<315?(l+6)%8:(l+7)%8),l){case 0:case 4:n="nwse-resize";break;case 1:case 5:n="ns-resize";break;case 2:case 6:n="nesw-resize";break;case 3:case 7:n="ew-resize";break;default:n="pointer"}this._setCursor(n)}_onGraphicPointerOutCallback(t){const{_vertexGraphics:e,_rotateHandleGraphic:i,symbols:s}=this;this._hoveredGraphic=null,t.graphic===i?i.symbol=s.rotator.default:e.includes(t.graphic)&&(t.graphic.symbol=s.handles.default),this.removeHandles(z),this._updateTooltip()}_scaleGraphic(t){const{_startInfo:e,_vertexGraphics:i,preserveAspectRatio:s,view:o}=this,{centerX:r,centerY:a,graphicInfos:h,height:c,startX:n,startY:l,width:_}=e,{resolution:d,transform:m}=o.state,g=i.indexOf(t);1!==g&&5!==g||this._updateX(t,r),3!==g&&7!==g||this._updateY(t,a);const{x:u,y}=t.geometry,v=m[0]*u+m[2]*y+m[4],f=m[1]*u+m[3]*y+m[5],G=h?.map(t=>t.geometry)??[],S=G.every(t=>"point"===t.type);if((0===_||0===c)&&S){const t=U((u-n)/d),i=U((l-y)/d);for(let e=0;e<G.length;e++)this.graphics[e].geometry=b(G[e],t,i,o,!0);return this._centerGraphic.geometry=new p(u,y,o.spatialReference),void(this._backgroundGraphic.geometry=b(e.box,t,i,o,!0))}if(s){const t=U(m[0]*r+m[2]*a+m[4],2),e=U(m[1]*r+m[3]*a+m[5],2),i=U(m[0]*n+m[2]*l+m[4],2),s=U(m[1]*n+m[3]*l+m[5],2);let o=w(t,e,i,s,v,f);0!==o&&Math.abs(o)!==1/0||(o=1),this._xScale=this._yScale=o;for(const h of G){const t=G.indexOf(h);this.graphics[t].geometry=x(h,this._xScale,this._yScale,[r,a])}this._updateBackgroundGraphic()}else{let t=u-n,i=l-y;if(1===g||5===g?t=0:3!==g&&7!==g||(i=0),0===t&&0===i)return;const s=r+t/2,h=a+i/2;let m=(_+(n>r?t:-1*t))/_,v=(c+(l<a?i:-1*i))/c;1!==g&&5!==g&&0!==m&&Math.abs(m)!==1/0||(m=1),3!==g&&7!==g&&0!==v&&Math.abs(v)!==1/0||(v=1),this._xScale=m,this._yScale=v;const f=(s-r)/d,w=(h-a)/d,S=x(e.box,this._xScale,this._yScale);this._backgroundGraphic.geometry=b(S,f,w,o,!0);const{centerX:k,centerY:R}=this._getGraphicInfo(this._backgroundGraphic),C=(k-r)/d,M=-1*(R-a)/d;for(const e of G){const t=G.indexOf(e),i=x(e,this._xScale,this._yScale,[r,a]);this.graphics[t].geometry=b(i,C,M,o,!0)}this._centerGraphic.geometry=new p(k,R,o.spatialReference)}}_rotateGraphic(t){const{centerX:e,centerY:i,startX:s,startY:o,box:r,rotate:a}=this._startInfo,h=this.view.spatialReference,c=new p(s,o,h),n=new p(e,i,h),l=t.geometry;this._angleOfRotation=S(c,l,n);const _=this._startInfo.graphicInfos?.map(t=>t.geometry)??[];for(const p of _){const t=_.indexOf(p),e=y(p,this._angleOfRotation,n);this.graphics[t].geometry=e}this._backgroundGraphic.geometry=y(r,this._angleOfRotation,n),this._rotateHandleGraphic.geometry=y(a,this._angleOfRotation,n)}_moveGraphic(t,e,i){if(this.graphics.includes(t)){const s=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=b(s,e,i,this.view);for(const o of this.graphics)o!==t&&(o.geometry=b(o.geometry,e,i,this.view))}else if(t===this._centerGraphic){const t=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=b(t,e,i,this.view)}if(t===this._backgroundGraphic||t===this._centerGraphic)for(const s of this.graphics)s.geometry=b(s.geometry,e,i,this.view)}_setUpHighlights(){this.highlightsEnabled&&this.graphics.length&&this._highlightHelper?.add(this.graphics,this.highlightName)}_setupGraphics(){const{_graphicAttributes:t,symbols:i}=this;this._centerGraphic=new e({symbol:i.centerIndicator,attributes:t}),this.showCenterGraphic&&this.layer.add(this._centerGraphic),this._backgroundGraphic=new e({symbol:i.fill.default,attributes:t}),this.layer.add(this._backgroundGraphic),this._rotateLineGraphic=new e({symbol:i.rotatorLine,attributes:t}),this._rotateHandleGraphic=new e({symbol:i.rotator.default,attributes:t}),this.enableRotation&&!this._hasExtentGraphic()&&this.layer.addMany([this._rotateLineGraphic,this._rotateHandleGraphic]);for(let s=0;s<8;s++)this._vertexGraphics.push(new e({symbol:i.handles.default,attributes:t}));this.enableScaling&&this.layer.addMany(this._vertexGraphics)}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={...this.symbols,fill:{active:this.symbols.fill.active?.clone().set("outline.color",t),default:this.symbols.fill.default?.clone().set("outline.color",t)},handles:{...this.symbols.handles,default:this.symbols.handles.default.clone().set("outline.color",t)},rotator:{...this.symbols.rotator,default:this.symbols.rotator.default.clone().set("outline.color",t)},rotatorLine:this.symbols.rotatorLine.clone().set("color",t)};for(const e of this._vertexGraphics)e.symbol=e===this._hoveredGraphic?this.symbols.handles.hover:this.symbols.handles.default;this._backgroundGraphic.symbol=this.symbols.fill.default,this._rotateHandleGraphic.symbol=this._rotateHandleGraphic===this._hoveredGraphic?this.symbols.rotator.hover:this.symbols.rotator.default,this._rotateLineGraphic.symbol=this.symbols.rotatorLine}_updateGraphics(){this._updateBackgroundGraphic(),this._updateHandleGraphics(),this._updateCenterGraphic(),this._updateRotateGraphic(),this._updateRotateLineGraphic()}_hideGraphicsBeforeUpdate(){this._centerGraphic.visible=!1,this._rotateHandleGraphic.visible=!1,this._rotateLineGraphic.visible=!1,this._vertexGraphics.forEach(t=>t.visible=!1)}_updateHandleGraphics(){const t=this._getCoordinates(!0);this._vertexGraphics.forEach((e,i)=>{const[s,o]=t[i];this._updateXY(e,s,o)})}_updateBackgroundGraphic(){const t=this._getCoordinates().map(([t,e])=>[t,e]);this._backgroundGraphic.geometry=new _({rings:[t],spatialReference:this.view.spatialReference})}_updateCenterGraphic(){const[t,e,i,s]=this._getBoxBounds(m()),o=(i+t)/2,r=(s+e)/2;this._centerGraphic.geometry=new p(o,r,this.view.spatialReference)}_updateRotateGraphic(){if(!this._vertexGraphics.length)return;const{x:t,y:e}=this._vertexGraphics[1].geometry,i=e+this.view.state.resolution*this._rotateGraphicOffset;this._rotateHandleGraphic.geometry=new p(t,i,this.view.spatialReference)}_updateRotateLineGraphic(){if(!this._vertexGraphics.length||!this._rotateHandleGraphic?.geometry)return;const t=this._vertexGraphics[1].geometry,e=this._rotateHandleGraphic.geometry;this._rotateLineGraphic.geometry=new d({paths:[[[t.x,t.y],[e.x,e.y]]],spatialReference:this.view.spatialReference})}_updateXY(t,e,i){t.geometry=new p(e,i,this.view.spatialReference)}_updateX(t,e){const i=t.geometry.y;t.geometry=new p(e,i,this.view.spatialReference)}_updateY(t,e){const i=t.geometry.x;t.geometry=new p(i,e,this.view.spatialReference)}_hasExtentGraphic(){return this.graphics.some(t=>null!=t?.geometry&&"extent"===t.geometry.type)}_getBoxBounds(t){const e=this.graphics.map(t=>t.geometry);return this._getBounds(t,e)}_getCoordinates(t){const[e,i,s,o]=this._getBoxBounds(m());if(t){const t=(e+s)/2,r=(o+i)/2;return[[e,o],[t,o],[s,o],[s,r],[s,i],[t,i],[e,i],[e,r]]}return[[e,o],[s,o],[s,i],[e,i]]}_updateTooltip(t,e){if(null==this.tooltip)return;if(!t)return void this.tooltip.clear();const{_backgroundGraphic:i,graphics:s,_vertexGraphics:o,_rotateHandleGraphic:r}=this;t===r?this._updateRotateTooltip():o.includes(t)?this._updateScaleTooltip():(s.includes(t)||t===i)&&this._updateMoveTooltip(e)}_updateRotateTooltip(){null!=this.tooltip&&(this.tooltip.info=new O({sketchOptions:this.sketchOptions,angle:-this._angleOfRotation}))}_updateScaleTooltip(){const{tooltip:t,_xScale:e,_yScale:i,sketchOptions:s,view:o,automaticLengthMeasurementUtils:r}=this;if(null==t)return;const a=this._getCoordinates(),h=L({topLeft:a[0],topRight:a[1],bottomRight:a[2],bottomLeft:a[3],spatialReference:o.spatialReference,automaticLengthMeasurementUtils:r});if(null==h)return;const{xSize:c,ySize:n}=h,l=Math.abs(e),p=Math.abs(i);t.info=new T({sketchOptions:s,xScale:l,yScale:p,xSize:c,ySize:n})}_updateMoveTooltip(t){const{tooltip:e,sketchOptions:i,view:s,automaticLengthMeasurementUtils:r}=this;if(null==e)return;const a=new j({sketchOptions:i});if(t){const{x:e,y:i}=t.origin,h=s.toMap(t),c=s.toMap({x:e,y:i}),n=r.autoDistanceBetweenPoints2D(c,h);a.distance=null!=n?n:o}e.info=a}};function U(t,e=2){return Number.parseFloat(t.toFixed(e))}t([n()],N.prototype,"tooltip",void 0),t([n({readOnly:!0})],N.prototype,"type",void 0),t([n()],N.prototype,"callbacks",void 0),t([n()],N.prototype,"enableMovement",void 0),t([n()],N.prototype,"enableRotation",void 0),t([n()],N.prototype,"enableScaling",void 0),t([n()],N.prototype,"graphics",void 0),t([n()],N.prototype,"highlightName",void 0),t([n()],N.prototype,"highlightsEnabled",void 0),t([n()],N.prototype,"layer",void 0),t([n()],N.prototype,"preserveAspectRatio",void 0),t([n()],N.prototype,"showCenterGraphic",void 0),t([n({readOnly:!0})],N.prototype,"state",null),t([n()],N.prototype,"symbols",void 0),t([n({type:H})],N.prototype,"sketchOptions",void 0),t([n({constructOnly:!0})],N.prototype,"view",void 0),t([n({constructOnly:!0})],N.prototype,"automaticLengthMeasurementUtils",void 0),N=t([l("esri.views.draw.support.Box")],N);const Y=N;export{Y as default};
|