@arcgis/core 5.0.0-next.10 → 5.0.0-next.12
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/PopupTemplate.js +1 -1
- package/analysis/AreaMeasurementAnalysis.js +1 -1
- package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
- package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
- package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/geometry/nearestVertex.js +5 -0
- package/arcade/geometry/operators.js +1 -1
- package/arcade/geometry/operatorsWorker.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{af47272aaaef0ea57e71.js → 00ea3052170e831c6bc8.js} +1 -1
- package/assets/esri/core/workers/chunks/{91dfd29e2dba200eab09.js → 0105d814fb51c366d1da.js} +1 -1
- package/assets/esri/core/workers/chunks/{125e71b0e29d1d132777.js → 02a22dd6d208a925cc5a.js} +1 -1
- package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
- package/assets/esri/core/workers/chunks/{ead8d0cbcebd12dbfad7.js → 04211fba145d9f06b3ec.js} +1 -1
- package/assets/esri/core/workers/chunks/0441ea7c89266a68b6f0.js +1 -0
- package/assets/esri/core/workers/chunks/07f2a75431dd8fc502ef.js +1 -0
- package/assets/esri/core/workers/chunks/092d72caf3269e696d1c.js +1 -0
- package/assets/esri/core/workers/chunks/{d1e97cce5047f1791e22.js → 0ac13de43438f572f59c.js} +1 -1
- package/assets/esri/core/workers/chunks/{629127877042ad784ad2.js → 0c8aeb6262e9ec7c87d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{d07f911d40bf05fc0306.js → 1008e3d64f5880e3dbf2.js} +1 -1
- package/assets/esri/core/workers/chunks/{c29486c4eeb3e72effff.js → 110429583b28c28c36ee.js} +1 -1
- package/assets/esri/core/workers/chunks/{61d970ed75c2c358b1e9.js → 14d601e0fe7a0538c7c1.js} +1 -1
- package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +1 -0
- package/assets/esri/core/workers/chunks/{1257c37bf04d39c27b62.js → 1c3bee704bafb64bba70.js} +1 -1
- package/assets/esri/core/workers/chunks/1d07846bcaac47df0644.js +1 -0
- package/assets/esri/core/workers/chunks/{509392131ec473d6b988.js → 1dfca37f95f2b968aa54.js} +1 -1
- package/assets/esri/core/workers/chunks/2132ccc45da90f6208b2.js +1 -0
- package/assets/esri/core/workers/chunks/2166238a7ad63a2d43c7.js +1 -0
- package/assets/esri/core/workers/chunks/2214d3b1f11658a85d0f.js +1 -0
- package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +1 -0
- package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +1 -0
- package/assets/esri/core/workers/chunks/{f80f5dbf96c343ac4df6.js → 24d8922ac9cd48621357.js} +1 -1
- package/assets/esri/core/workers/chunks/257f17b3836a623a9dbe.js +1 -0
- package/assets/esri/core/workers/chunks/2b27499fa9de22970b7a.js +1 -0
- package/assets/esri/core/workers/chunks/2e76fbd3c874300fc4a7.js +1 -0
- package/assets/esri/core/workers/chunks/31b5900119dd7cd9e7d3.js +1 -0
- package/assets/esri/core/workers/chunks/34bb4852ebef0f529c96.js +1 -0
- package/assets/esri/core/workers/chunks/{9698f36c143953a975d4.js → 353d447f3745942c88a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{52282f767bd0e99ddca0.js → 3545dce74bb6b0354cb7.js} +1 -1
- package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
- package/assets/esri/core/workers/chunks/38810e3f298e8a0b64a6.js +1 -0
- package/assets/esri/core/workers/chunks/{7290e7a819eb291b1df2.js → 38fa50336983265c73a4.js} +3 -3
- package/assets/esri/core/workers/chunks/{fe49321dca22dc60d105.js → 3b1982bf7b44ff897a35.js} +1 -1
- package/assets/esri/core/workers/chunks/3bacd904cd93c8013f6a.js +1 -0
- package/assets/esri/core/workers/chunks/{588533c3abe876f20f62.js → 3d5b157bd9060b07670b.js} +1 -1
- package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
- package/assets/esri/core/workers/chunks/3fa15d4ee5fab8fff76e.js +1 -0
- package/assets/esri/core/workers/chunks/487e1c592f1b6fd03a7d.js +1 -0
- package/assets/esri/core/workers/chunks/{ee5aa11750c51b220f1e.js → 4bcb83119481453dbb90.js} +1 -1
- package/assets/esri/core/workers/chunks/4ca5d58117e7a5f73e1e.js +1 -0
- package/assets/esri/core/workers/chunks/{826fa0dfb63df77bfd95.js → 4f0016111fd84c612f41.js} +1 -1
- package/assets/esri/core/workers/chunks/{24cd7b84cd0f3de4bff2.js → 4f14fed0ec885c3c33d5.js} +1 -1
- package/assets/esri/core/workers/chunks/{4baf6f6e7ddedb25f806.js → 5299ec59c86022ca37e2.js} +1 -1
- package/assets/esri/core/workers/chunks/53a9c34cb3f6ac06cd50.js +1 -0
- package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +1 -0
- package/assets/esri/core/workers/chunks/54c49a768147720c3c56.js +1 -0
- package/assets/esri/core/workers/chunks/558822b700e8bd844052.js +1 -0
- package/assets/esri/core/workers/chunks/{da24ad57747714ac5eda.js → 55adbd7481f8dfb1067e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7803495f8862d9025bcd.js → 56e06c9c1120bea2c641.js} +1 -1
- package/assets/esri/core/workers/chunks/{dc66490520f97eef15bf.js → 57806a01f33074b601e7.js} +24 -24
- package/assets/esri/core/workers/chunks/{67f03d042455cd0f7009.js → 57b410198d83bf0ab708.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a5d74414dd02a2fb8e1.js → 5bc4140333d0db904949.js} +1 -1
- package/assets/esri/core/workers/chunks/5e08b19e6d7202ea38d7.js +1 -0
- package/assets/esri/core/workers/chunks/{0d5212f59e9b62c16164.js → 5f6df4a3376b52ead53f.js} +1 -1
- package/assets/esri/core/workers/chunks/{15c7c10ff9ac63f0e792.js → 5fb2edf942b1cd8d7336.js} +1 -1
- package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +1 -0
- package/assets/esri/core/workers/chunks/{dc51438b832551924a9e.js → 6238ca7541800eb2566b.js} +1 -1
- package/assets/esri/core/workers/chunks/{731f7b552dde0fb325cd.js → 62c2bd082a0c669bc857.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8a3f1e60e24a13749c1.js → 631fb2e62e48f8be4051.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8e686efe344a33a0258.js → 6490bc392a4b4f9e24f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{e767f83f9e2de6650f80.js → 6581b94e796781c0ad4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{53654edd766d9b4ef750.js → 658cd45b5fb304fd840a.js} +1 -1
- package/assets/esri/core/workers/chunks/67f305b0c72e77a6331a.js +1 -0
- package/assets/esri/core/workers/chunks/6922351c001fdb4cb757.js +1 -0
- package/assets/esri/core/workers/chunks/{6e22b02a9715c10578d0.js → 69cca5d3f715876c6b32.js} +1 -1
- package/assets/esri/core/workers/chunks/6c13c01c47abc1939f96.js +1 -0
- package/assets/esri/core/workers/chunks/{c37f7756d48ff9af2656.js → 736035c0069ccb03bee6.js} +1 -1
- package/assets/esri/core/workers/chunks/7c14f99e6cfff2a8ef4a.js +1 -0
- package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
- package/assets/esri/core/workers/chunks/82338cdd56aa1de28db3.js +1 -0
- package/assets/esri/core/workers/chunks/{51ab2acac4ecc1ca9c34.js → 86830fcb5475502dac65.js} +1 -1
- package/assets/esri/core/workers/chunks/{11e96a312f1294d34c50.js → 881df4fd1dc594576457.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1ca7c3a32ce00ed8b81.js → 8be16b03caa947ac7631.js} +1 -1
- package/assets/esri/core/workers/chunks/8cd03b54b2859b52fb81.js +1 -0
- package/assets/esri/core/workers/chunks/8d9ccc9a43a315cb6b04.js +1 -0
- package/assets/esri/core/workers/chunks/{042cd64e1f4eb326c30f.js → 8fc82fe1fcbcedf35400.js} +1 -1
- package/assets/esri/core/workers/chunks/91afee11072471e4eefe.js +1 -0
- package/assets/esri/core/workers/chunks/{fbd8d2f61f8a15bcf3db.js → 9595aabbaf411eceea1e.js} +1 -1
- package/assets/esri/core/workers/chunks/9978ec6c67e87dc08a1d.js +1 -0
- package/assets/esri/core/workers/chunks/9cdd087c43a601ec331d.js +1 -0
- package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
- package/assets/esri/core/workers/chunks/{5e2ce34def5e053913b2.js → a10e533f336c035d8d40.js} +1 -1
- package/assets/esri/core/workers/chunks/{311b564e44ae637c960d.js → a3ade7e8b9ddadb5f800.js} +1 -1
- package/assets/esri/core/workers/chunks/{18c5d79d5ee1136e0a57.js → a57751f3d78524c876cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{0030d68d9edf42b4af57.js → a6a87f92f453204e9bdb.js} +1 -1
- package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
- package/assets/esri/core/workers/chunks/a8ea050090c351e3b6d6.js +1 -0
- package/assets/esri/core/workers/chunks/adf7ccf4ef629211c7ee.js +1 -0
- package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +1 -0
- package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
- package/assets/esri/core/workers/chunks/b193de09e005b0976a6a.js +1 -0
- package/assets/esri/core/workers/chunks/b328635d191f5424c047.js +1 -0
- package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
- package/assets/esri/core/workers/chunks/{664ae441617afe4b17ec.js → b87bc987983b31c13f64.js} +1 -1
- package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
- package/assets/esri/core/workers/chunks/bbdfa8ffcf084cbd9938.js +1 -0
- package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
- package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +1 -0
- package/assets/esri/core/workers/chunks/{ddfd01bb9ba8577c3ffc.js → c3dcfe26c2c3c829762d.js} +1 -1
- package/assets/esri/core/workers/chunks/c3ddcf9148dd2640c402.js +1 -0
- package/assets/esri/core/workers/chunks/{6d9f2b113d6bde936a04.js → c4dfd897bcab20dee43b.js} +1 -1
- package/assets/esri/core/workers/chunks/{0f30a9514571c7be9978.js → c5c02ace54fe4ab9214b.js} +1 -1
- package/assets/esri/core/workers/chunks/{87921f3fa9001f5801ed.js → c68935ed44eb0702a6ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{4fb5f1c671892001a4fd.js → c9579d607e59bae214da.js} +1 -1
- package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
- package/assets/esri/core/workers/chunks/{773f2c6c9d38db76dfed.js → d42f7e48d694b2427c0d.js} +1 -1
- package/assets/esri/core/workers/chunks/d466f3f0d3824c77da7c.js +1 -0
- package/assets/esri/core/workers/chunks/d4a91f2256e48316a8f0.js +1 -0
- package/assets/esri/core/workers/chunks/d69265ceabfa92b40bb7.js +1 -0
- package/assets/esri/core/workers/chunks/d7755c4c8d1d3059efca.js +1 -0
- package/assets/esri/core/workers/chunks/{eb9c166db0db6fa60e95.js → d7b0fcce847f563ea255.js} +1 -1
- package/assets/esri/core/workers/chunks/d87f0116ee53ec5f98e9.js +1 -0
- package/assets/esri/core/workers/chunks/d888ae5ac1810a486919.js +1 -0
- package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +1 -0
- package/assets/esri/core/workers/chunks/dc4d29cfce12ac599888.js +1 -0
- package/assets/esri/core/workers/chunks/dda6ca9af35518652d0f.js +1 -0
- package/assets/esri/core/workers/chunks/{7005d956c990a04ee8b2.js → dec336700cfb83abbbeb.js} +1 -1
- package/assets/esri/core/workers/chunks/{b3613a38178cad2ebc82.js → dee9867b3379e024ae96.js} +1 -1
- package/assets/esri/core/workers/chunks/df130abb76713a85b4f9.js +1 -0
- package/assets/esri/core/workers/chunks/e0aa036c56ecdfe01503.js +1 -0
- package/assets/esri/core/workers/chunks/e2e4f6b58763fae51ae5.js +1 -0
- package/assets/esri/core/workers/chunks/e8a9c56fd0e7fd2558ef.js +1 -0
- package/assets/esri/core/workers/chunks/{1d06fcae4c2f02fb1c95.js → eb7eb3b3b8800fd73f3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{37c1f155da14de91565a.js → edf58513f789856cd1db.js} +1 -1
- package/assets/esri/core/workers/chunks/{f34e3fa0c5b28531e289.js → ef789e8487deab916fad.js} +1 -1
- package/assets/esri/core/workers/chunks/f28ffda9a95c6568503d.js +1 -0
- package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
- package/assets/esri/core/workers/chunks/{292daac70bb828e4923f.js → f9cd068d184cab66dc33.js} +1 -1
- package/assets/esri/core/workers/chunks/{dff2df259f140b7d97a9.js → fd88e07cba5964f80e9e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9b16fd41cd59d452522.js → fdbe16e3b23e01655c0c.js} +1 -1
- package/assets/esri/core/workers/chunks/{063905fbf9a0c6586949.js → ffdba51e7256ebf8ebd3.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +35 -2
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +2 -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/chunks/Envelope.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
- package/chunks/arcgis-knowledge-client-core.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/densifyOperator.js +1 -1
- package/chunks/differenceOperator.js +1 -1
- package/chunks/intersectsOperator.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/config.js +1 -1
- package/core/XHRAdapter.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/quantityFormatUtils.js +1 -1
- package/core/unitFormatUtils.js +1 -1
- package/core/unitUtils.js +1 -1
- package/editing/fieldUtils.js +5 -0
- package/geometry/Extent.js +1 -1
- package/geometry/Geometry.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/geometry/ellipsoidUtils.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/MeshTransform.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils/scale.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/polygonUtils.js +1 -1
- package/interfaces.d.ts +114 -11
- package/kernel.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapNotesLayer.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/save/groupLayerUtils.js +1 -1
- package/layers/save/imageryUtils.js +1 -1
- package/layers/save/streamLayerUtils.js +1 -1
- package/layers/support/DateTimeFieldFormat.js +1 -1
- package/layers/support/FieldFormat.js +1 -1
- package/layers/support/LayerLoadContext.js +1 -1
- package/layers/support/NumberFieldFormat.js +1 -1
- package/layers/support/arcgisLayerUrl.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/fetchService.js +1 -1
- package/layers/support/fieldFormatUtils.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/video/VideoCameraSensorModel.js +1 -1
- package/networks/support/UNTraceConfiguration.js +1 -1
- package/package.json +1 -1
- package/popup/ExpressionInfo.js +1 -1
- package/popup/FieldInfo.js +1 -1
- package/popup/content/AttachmentsContent.js +1 -1
- package/popup/content/BarChartMediaInfo.js +1 -1
- package/popup/content/ColumnChartMediaInfo.js +1 -1
- package/popup/content/Content.js +1 -1
- package/popup/content/CustomContent.js +1 -1
- package/popup/content/ExpressionContent.js +1 -1
- package/popup/content/FieldsContent.js +1 -1
- package/popup/content/ImageMediaInfo.js +1 -1
- package/popup/content/LineChartMediaInfo.js +1 -1
- package/popup/content/MediaContent.js +1 -1
- package/popup/content/PieChartMediaInfo.js +1 -1
- package/popup/content/RelationshipContent.js +1 -1
- package/popup/content/TextContent.js +1 -1
- package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
- package/popup/content/mixins/ChartMediaInfo.js +1 -1
- package/popup/content/mixins/MediaInfo.js +1 -1
- package/popup/content.js +1 -1
- package/popup/support/FieldInfoFormat.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/request/cors.js +5 -0
- package/request/loadImage.js +5 -0
- package/request/preferredHosts.js +5 -0
- package/request/process.js +5 -0
- package/request/queue.js +5 -0
- package/request/serviceJSON.js +5 -0
- package/request.js +1 -1
- package/rest/geometryService/utils.js +1 -1
- package/rest/knowledgeGraphService.d.ts +1 -0
- package/support/getDefaultUnitForView.js +1 -1
- package/support/popupUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/time/TimeExtent.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +5 -0
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +5 -0
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementLabelVisualization.js +5 -0
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementManipulatorVisualization.js +5 -0
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementSketchVisualization.js +5 -0
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +5 -0
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +5 -0
- package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/environment/CloudsRenderer.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/layers/ElevationLayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SDataRequester.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/support/StreamTextureCollection.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileErrors.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/tooltipUtils.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/fields/TooltipField.js +1 -1
- package/views/interactive/tooltip/infos/TooltipInfoWithCoordinates.js +1 -1
- package/views/magnifier/resources.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/MergeFeaturesList.js +5 -0
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/PanelContent.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/css.js +1 -1
- package/widgets/Editor/support/EditorItem.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/support/errors.js +1 -1
- package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
- package/widgets/Editor/support/splitFeatureUtils.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/assets/esri/core/workers/chunks/0200637e0503556a3b97.js +0 -1
- package/assets/esri/core/workers/chunks/022c854eff2c2c2aed6b.js +0 -1
- package/assets/esri/core/workers/chunks/066a0ea67688361e85a5.js +0 -1
- package/assets/esri/core/workers/chunks/06f75c5b6b50934d72a6.js +0 -1
- package/assets/esri/core/workers/chunks/15f969836d63c7fe2d9d.js +0 -1
- package/assets/esri/core/workers/chunks/2857bcb68df874e9aa62.js +0 -1
- package/assets/esri/core/workers/chunks/2a9fc0301268ff909246.js +0 -1
- package/assets/esri/core/workers/chunks/2ddcf3cea0efe4052618.js +0 -1
- package/assets/esri/core/workers/chunks/2e8a4df83c43f86d7361.js +0 -1
- package/assets/esri/core/workers/chunks/2f2e4f81f3daa3fb8527.js +0 -1
- package/assets/esri/core/workers/chunks/3109f0a6914e7be088ed.js +0 -1
- package/assets/esri/core/workers/chunks/31bb1ee9370c2753ce9d.js +0 -1
- package/assets/esri/core/workers/chunks/329fccd7f5cb8401e0c3.js +0 -1
- package/assets/esri/core/workers/chunks/38f6b9288c82dac9a800.js +0 -1
- package/assets/esri/core/workers/chunks/3b1848713ee25f750242.js +0 -1
- package/assets/esri/core/workers/chunks/42a1e71d09e8583a7327.js +0 -1
- package/assets/esri/core/workers/chunks/44f27eac92c5ccc57e12.js +0 -1
- package/assets/esri/core/workers/chunks/4941bfd3aae7f6bdac97.js +0 -1
- package/assets/esri/core/workers/chunks/4bd2cc65f7db0d261543.js +0 -1
- package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +0 -1
- package/assets/esri/core/workers/chunks/4fbe2a8d742065cbaea3.js +0 -1
- package/assets/esri/core/workers/chunks/4fe4feeb251f2916a339.js +0 -1
- package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +0 -1
- package/assets/esri/core/workers/chunks/57e04e2d8721bbdc029a.js +0 -1
- package/assets/esri/core/workers/chunks/591e459f9fce34f519ca.js +0 -1
- package/assets/esri/core/workers/chunks/59514624daf188a8030f.js +0 -1
- package/assets/esri/core/workers/chunks/5c09d98b41f71a036e2a.js +0 -1
- package/assets/esri/core/workers/chunks/605b9643b1baeff16149.js +0 -1
- package/assets/esri/core/workers/chunks/6293e33f304c4952f88c.js +0 -1
- package/assets/esri/core/workers/chunks/6e25ef5ad6d6b3f88343.js +0 -1
- package/assets/esri/core/workers/chunks/759321045c264bc6964e.js +0 -1
- package/assets/esri/core/workers/chunks/7e3f27ebf366d4266350.js +0 -1
- package/assets/esri/core/workers/chunks/826072cfc0ac8e36f03c.js +0 -1
- package/assets/esri/core/workers/chunks/8ce608013b353155ee5a.js +0 -1
- package/assets/esri/core/workers/chunks/8d9d3797c6d62fdfff9d.js +0 -1
- package/assets/esri/core/workers/chunks/9b0c2f4311fe9bca370a.js +0 -1
- package/assets/esri/core/workers/chunks/9c48d8d17831aa57f8a4.js +0 -1
- package/assets/esri/core/workers/chunks/9f21436016ff7a899e79.js +0 -1
- package/assets/esri/core/workers/chunks/9f28b2800945903bc165.js +0 -1
- package/assets/esri/core/workers/chunks/a27e74117c37f3efcbca.js +0 -1
- package/assets/esri/core/workers/chunks/a41ba05c09a59d1eb35f.js +0 -1
- package/assets/esri/core/workers/chunks/a5a67216e0d0cee95a55.js +0 -1
- package/assets/esri/core/workers/chunks/a93ebd076bc55aa6eab0.js +0 -1
- package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +0 -1
- package/assets/esri/core/workers/chunks/acd0564ad1544f452f3f.js +0 -1
- package/assets/esri/core/workers/chunks/b0f43191a431c9de16e5.js +0 -1
- package/assets/esri/core/workers/chunks/b320bb76c7e9998fe53b.js +0 -1
- package/assets/esri/core/workers/chunks/ba4571d2637a74a59552.js +0 -1
- package/assets/esri/core/workers/chunks/c4090a60d149a5962179.js +0 -1
- package/assets/esri/core/workers/chunks/c61c61dac1e8d6188749.js +0 -1
- package/assets/esri/core/workers/chunks/c84caf81bfaa4a8b5aa1.js +0 -1
- package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +0 -1
- package/assets/esri/core/workers/chunks/d28670cb11164e318e45.js +0 -1
- package/assets/esri/core/workers/chunks/d48af7bc06b4bb176534.js +0 -1
- package/assets/esri/core/workers/chunks/d56ac52a5288e06365e7.js +0 -1
- package/assets/esri/core/workers/chunks/ddca92e18e96ea1c9d89.js +0 -1
- package/assets/esri/core/workers/chunks/ded9747ae04ab889d52a.js +0 -1
- package/assets/esri/core/workers/chunks/df5afa06c6deb6b40109.js +0 -1
- package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +0 -1
- package/assets/esri/core/workers/chunks/e3434f91f47f551d9e02.js +0 -1
- package/assets/esri/core/workers/chunks/eb6c3dd440ede4adf603.js +0 -1
- package/assets/esri/core/workers/chunks/edc671b9b83c8e19cb42.js +0 -1
- package/assets/esri/core/workers/chunks/f141c9f7f0d9b2322bf6.js +0 -1
- package/assets/esri/core/workers/chunks/f7a1f48c53422c6e2028.js +0 -1
- package/assets/esri/core/workers/chunks/f7f002ea5ff5fe7f6249.js +0 -1
- package/assets/esri/core/workers/chunks/f8e889be4b45f6f0667e.js +0 -1
- package/assets/esri/core/workers/chunks/fbd796c88f07bb6755dc.js +0 -1
- package/assets/esri/core/workers/chunks/fec3897ed7e8691387ed.js +0 -1
- package/processRequest.js +0 -5
- package/requestQueue.js +0 -5
- package/support/requestPresets.js +0 -5
- package/support/requestUtils.js +0 -5
- /package/{rest/support → request}/ImageWithType.js +0 -0
- /package/{requestConfig.js → request/config.js} +0 -0
- /package/{support/requestImageUtils.js → request/image.js} +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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{f as P,b as y,d as w,h as g,g as f,t as M,n as D,j as V}from"../../../../chunks/vec32.js";import{create as b,clone as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as S,ZEROS as k}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{a as x,d as j,n as E,f as C}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as R,intersectRay as I,getNormal as z}from"../../../../geometry/support/plane.js";import{create as O}from"../../../../geometry/support/ray.js";import{sv3d as G,sm4d as U,sv2d as K}from"../../../../geometry/support/vectorStacks.js";import{getSliceableContainer as B}from"../../../../graphic/getSliceableContainer.js";import{getRotateHeadingTexture as A,getTiltRotateTexture as F}from"../images/Factory.js";import{ResizeManipulator as L}from"./ResizeManipulator.js";import{RotateManipulator as q}from"./RotateManipulator.js";import{getOutlineColor as N,planeColor as J}from"./settings.js";import{ShiftManipulator as Q}from"./ShiftManipulator.js";import{pointerMoveTimerMs as W,planePreviewOutlineWidth as X,forceVerticalModifier as Y,forceHorizontalModifier as Z,previewFadeDurationSeconds as $,previewFadeDotThreshold as tt,initialDepthOffsetFrac as et}from"./sliceToolConfig.js";import{createGridVisualElement as it,createOutlineVisualElement as at,planeToShape as st,createRotatePlane as nt,resizePlane as rt,calculatePlaneHalfSize as lt,createPlane as ot,DidPointerMoveRecentlyFlag as ht,calculateBoundedPlaneTranslateRotate as pt,updateShiftRestartHandle as ut,updateRotateHeadingHandle as ct,updateRotateTiltHandle as dt,updateResizeHandle as _t,createShiftPlane as vt}from"./sliceToolUtils.js";import{calculateInputRotationTransform as mt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as Pt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as yt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as wt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as gt}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as ft}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as Mt}from"../../../support/screenUtils.js";var Dt;let Vt=class extends wt{static{Dt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=W,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=ft(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&j(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new Q(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new q(this.view,(t,e)=>A(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new q(this.view,(t,e)=>F(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new L(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=it(this.view),this._previewPlaneOutlineVisualElement=at(this.view),this._previewPlaneOutlineVisualElement.width=X,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),n(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active?this._placingSlicePlane||"exclude"===this.mode?"crosshair":null!=this._creatingPointerId?"grabbing":null:null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}get _creatingPointerId(){return null!=this.inputState&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Tt(t))return;this._placingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Tt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&null!=e&&"shift"===e.type){const i=Mt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Mt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&null!=this.analysisViewData.plane){const e=Mt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),j(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=Mt(t),a=x();if(this._pickPlane(i,!1,this._activeKeyModifiers,a)){if("pointer-drag"===t.type){const e=yt(this.view.state.camera,i,kt);this.inputState=bt(e,t.pointerId,a.origin,a)}return j(a,this._startPlane),this.analysis.shape=st(a,this.view,this.view.spatialReference,new e),"pointer-drag"!==t.type&&this.stop(),!0}return!1}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(Mt(t)),i=e.results.at(0);if(i){const t="graphic"===i.type&&i.graphic;if(t){const e=B(t.origin)??t.sourceLayer??t.layer;e&&"subtype-sublayer"!==e.type&&this.analysis.excludedLayers.push(e)}}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===Y||t.key===Z)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==Y&&t.key!==Z||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=yt(this.view.state.camera,t.screenPoint,kt);j(this.analysisViewData.plane,this._startPlane),this.inputState=bt(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return gt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?j(this.analysisViewData.plane,x()):null;e.next(Pt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(P(E(this.analysisViewData.plane),e.ray.direction)/y(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(G.get(),this._startPlane.origin),i=w(G.get(),E(this._startPlane));g(i,i,-t.depth),f(i,i,e);const a=C(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,1,R()),i=yt(this.view.state.camera,t.screenPoint,kt),a=b();I(e,i,a)&&(j(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return gt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?j(this.analysisViewData.plane,x()):null;e.next(Pt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,2,R()),i=yt(this.view.state.camera,t.screenPoint,kt),a=b();I(e,i,a)&&(j(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return gt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?j(this.analysisViewData.plane,x()):null;e.next(Pt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=z(t.rotatePlane),a=mt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(U.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(G.get(),this._startPlane.basis1,e),a=M(G.get(),this._startPlane.basis2,e),s=C(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=yt(this.view.state.camera,t.screenPoint,kt),a=G.get();I(this.analysisViewData.plane.plane,i,a)&&(j(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:T(a)})}_createResizeDragPipeline(t){return gt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=j(this.analysisViewData.plane,x());e.next(Pt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,j(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:x();if(i=null!=i?j(i,St):null,this._pickPlane(t,!0,e,a)){const t=tt;let e=!1;null!=i&&(e=P(z(i.plane),z(a.plane))<t||P(D(G.get(),i.basis1),D(G.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*$),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,K.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=G.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(G.get()),l=this.view.state.camera;P(r,l.viewForward)>0&&g(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*et,p=g(G.get(),r,h);f(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[Y]?2:i[Z]?1:u;return ot(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ht,this.rotateHeadingManipulator.state|=ht,this.rotateTiltManipulator.state|=ht,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~ht,this.rotateHeadingManipulator.state&=~ht,this.rotateTiltManipulator.state&=~ht},this._pointerMoveTimerMs)}_updateManipulators(){if(Dt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=pt(t,U.get());ut(this.shiftManipulator,e,t,this.view.state.camera),ct(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),dt(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>_t(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(!this._creatingPointerId&&(i||"place"===this._mode)),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=pt(t,U.get()),i=V(G.get(),y(t.basis1),y(t.basis2),1),a=v(U.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=N(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=S(J);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=k}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function bt(t,e,i,a){const s=vt(i,E(a),t.direction,R()),n=b();return I(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Tt(t){return"mouse"!==t.pointerType||0===t.button}t([c()],Vt.prototype,"_clock",void 0),t([c({constructOnly:!0})],Vt.prototype,"view",void 0),t([c()],Vt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],Vt.prototype,"state",null),t([c({readOnly:!0})],Vt.prototype,"cursor",null),t([c()],Vt.prototype,"analysis",null),t([c()],Vt.prototype,"removeIncompleteOnCancel",void 0),t([c()],Vt.prototype,"_mode",void 0),t([c()],Vt.prototype,"mode",null),t([c({value:null})],Vt.prototype,"inputState",null),t([c()],Vt.prototype,"_placingSlicePlane",null),t([c()],Vt.prototype,"_creatingPointerId",null),Vt=Dt=t([d("esri.views.3d.analysis.Slice.SliceTool")],Vt);const St=x(),kt=O();export{Vt as default};
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{f as y,b as P,d as w,h as f,g,t as M,n as V,j as b}from"../../../../chunks/vec32.js";import{create as D,clone as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as k,ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{a as x,d as j,n as E,f as C}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as R,intersectRay as z,getNormal as O}from"../../../../geometry/support/plane.js";import{create as G}from"../../../../geometry/support/ray.js";import{sv3d as U,sm4d as I,sv2d as K}from"../../../../geometry/support/vectorStacks.js";import{getSliceableContainer as A}from"../../../../graphic/getSliceableContainer.js";import{getRotateHeadingTexture as F,getTiltRotateTexture as L}from"../images/Factory.js";import{ResizeManipulator as B}from"./ResizeManipulator.js";import{RotateManipulator as q}from"./RotateManipulator.js";import{getOutlineColor as N,planeColor as J}from"./settings.js";import{ShiftManipulator as Q}from"./ShiftManipulator.js";import{pointerMoveTimerMs as W,planePreviewOutlineWidth as X,forceVerticalModifier as Y,forceHorizontalModifier as Z,previewFadeDurationSeconds as $,previewFadeDotThreshold as tt,initialDepthOffsetFrac as et}from"./sliceToolConfig.js";import{createGridVisualElement as it,createOutlineVisualElement as at,planeToShape as st,createRotatePlane as nt,resizePlane as rt,calculatePlaneHalfSize as lt,createPlane as ot,DidPointerMoveRecentlyFlag as ht,calculateBoundedPlaneTranslateRotate as pt,updateShiftRestartHandle as ut,updateRotateHeadingHandle as ct,updateRotateTiltHandle as dt,updateResizeHandle as _t,createShiftPlane as vt}from"./sliceToolUtils.js";import{calculateInputRotationTransform as mt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as yt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as Pt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as wt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as ft}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as gt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as Mt}from"../../../support/screenUtils.js";var Vt;let bt=class extends wt{static{Vt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=W,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=gt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&j(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new Q(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new q(this.view,(t,e)=>F(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new q(this.view,(t,e)=>L(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new B(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=it(this.view),this._previewPlaneOutlineVisualElement=at(this.view),this._previewPlaneOutlineVisualElement.width=X,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),n(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active&&(this._placingSlicePlane||"exclude"===this.mode)?"crosshair":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-move":this._onPointerMove(t);break;case"immediate-click":if(!Tt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Mt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=Mt(t),a=x();return!!this._pickPlane(i,!1,this._activeKeyModifiers,a)&&(j(a,this._startPlane),this.analysis.shape=st(a,this.view,this.view.spatialReference,new e),this.stop(),!0)}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(Mt(t)),i=e.results.at(0);if(i){const t="graphic"===i.type&&i.graphic;if(t){const e=A(t.origin)??t.sourceLayer??t.layer;e&&"subtype-sublayer"!==e.type&&this.analysis.excludedLayers.push(e)}}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===Y||t.key===Z)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==Y&&t.key!==Z||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=Pt(this.view.state.camera,t.screenPoint,St);j(this.analysisViewData.plane,this._startPlane),this.inputState=Dt(e,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?j(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(y(E(this.analysisViewData.plane),e.ray.direction)/P(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(U.get(),this._startPlane.origin),i=w(U.get(),E(this._startPlane));f(i,i,-t.depth),g(i,i,e);const a=C(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,1,R()),i=Pt(this.view.state.camera,t.screenPoint,St),a=D();z(e,i,a)&&(j(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?j(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,2,R()),i=Pt(this.view.state.camera,t.screenPoint,St),a=D();z(e,i,a)&&(j(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?j(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=O(t.rotatePlane),a=mt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(I.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(U.get(),this._startPlane.basis1,e),a=M(U.get(),this._startPlane.basis2,e),s=C(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=Pt(this.view.state.camera,t.screenPoint,St),a=U.get();z(this.analysisViewData.plane.plane,i,a)&&(j(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:T(a)})}_createResizeDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=j(this.analysisViewData.plane,x());e.next(yt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,j(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:x();if(i=null!=i?j(i,kt):null,this._pickPlane(t,!0,e,a)){const t=tt;let e=!1;null!=i&&(e=y(O(i.plane),O(a.plane))<t||y(V(U.get(),i.basis1),V(U.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*$),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,K.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=U.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(U.get()),l=this.view.state.camera;y(r,l.viewForward)>0&&f(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*et,p=f(U.get(),r,h);g(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[Y]?2:i[Z]?1:u;return ot(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ht,this.rotateHeadingManipulator.state|=ht,this.rotateTiltManipulator.state|=ht,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~ht,this.rotateHeadingManipulator.state&=~ht,this.rotateTiltManipulator.state&=~ht},this._pointerMoveTimerMs)}_updateManipulators(){if(Vt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=pt(t,I.get());ut(this.shiftManipulator,e,t,this.view.state.camera),ct(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),dt(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>_t(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(i||"place"===this._mode),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=pt(t,I.get()),i=b(U.get(),P(t.basis1),P(t.basis2),1),a=v(I.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=N(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=k(J);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=S}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function Dt(t,e,i){const a=vt(e,E(i),t.direction,R()),s=D();return z(a,t,s)?{type:"shift",shiftPlane:a,depth:0,startPoint:s}:null}function Tt(t){return"mouse"!==t.pointerType||0===t.button}t([c()],bt.prototype,"_clock",void 0),t([c({constructOnly:!0})],bt.prototype,"view",void 0),t([c()],bt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],bt.prototype,"state",null),t([c({readOnly:!0})],bt.prototype,"cursor",null),t([c()],bt.prototype,"analysis",null),t([c()],bt.prototype,"removeIncompleteOnCancel",void 0),t([c()],bt.prototype,"_mode",void 0),t([c()],bt.prototype,"mode",null),t([c({value:null})],bt.prototype,"inputState",null),t([c()],bt.prototype,"_placingSlicePlane",null),bt=Vt=t([d("esri.views.3d.analysis.Slice.SliceTool")],bt);const kt=x(),St=G();export{bt 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as r}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import t from"../../../../core/Accessor.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 n}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as s}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,fromExtent as c,width as p,height as d,expand as l}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as m}from"../../../../geometry/support/coordinateSystem.js";let u=class extends t{constructor(e){super(e),this.rawResult=null}get localOriginRenderSpace(){const{extent:e,localOrigin:r,renderCoordsHelper:t}=this,o=i();return t.toRenderCoords(r,e.spatialReference,o),o}get cameraPositionRenderSpace(){const{localOriginRenderSpace:e,renderCoordsHelper:r}=this,t=i(),o=1/r.unitInMeters;return r.setAltitude(t,R*o,e),t}get boundingRect(){const{extent:e,renderCoordsHelper:r}=this,t=a();return 2===r.viewingMode?c(e,t):(this._expandBoundingRect(e.xmin,e.ymin,t),this._expandBoundingRect(e.xmax,e.ymin,t),this._expandBoundingRect(e.xmin,e.ymax,t),this._expandBoundingRect(e.xmax,e.ymax,t)),t}get cameraDimensions(){const{boundingRect:e}=this;return{width:p(e),height:d(e)}}get cameraNearFar(){const{renderCoordsHelper:{unitInMeters:e}}=this,r=1/e;return{near:x*r,far:y*r}}get upVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,2,i())}get northVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,1,i())}get eastVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,0,i())}_expandBoundingRect(e,r,t){const{extent:o,eastVector:n,northVector:i,upVector:a,renderCoordsHelper:c}=this,p=o.center.z??0;s(g,e,r,p),c.toRenderCoords(g,o.spatialReference,g),m(g,n,i,a,h),l(t,h,t)}};e([o()],u.prototype,"renderCoordsHelper",void 0),e([o()],u.prototype,"extent",void 0),e([o()],u.prototype,"localOrigin",void 0),e([o()],u.prototype,"localOriginRenderSpace",null),e([o()],u.prototype,"cameraPositionRenderSpace",null),e([o()],u.prototype,"boundingRect",null),e([o()],u.prototype,"cameraDimensions",null),e([o()],u.prototype,"upVector",null),e([o()],u.prototype,"northVector",null),e([o()],u.prototype,"eastVector",null),e([o()],u.prototype,"rawResult",void 0),u=e([n("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillComputation")],u);const g=i(),h=i(),R=r.maxTargetElevation,x=0,y=r.
|
|
5
|
+
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as r}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import t from"../../../../core/Accessor.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 n}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as s}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,fromExtent as c,width as p,height as d,expand as l}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as m}from"../../../../geometry/support/coordinateSystem.js";let u=class extends t{constructor(e){super(e),this.rawResult=null}get localOriginRenderSpace(){const{extent:e,localOrigin:r,renderCoordsHelper:t}=this,o=i();return t.toRenderCoords(r,e.spatialReference,o),o}get cameraPositionRenderSpace(){const{localOriginRenderSpace:e,renderCoordsHelper:r}=this,t=i(),o=1/r.unitInMeters;return r.setAltitude(t,R*o,e),t}get boundingRect(){const{extent:e,renderCoordsHelper:r}=this,t=a();return 2===r.viewingMode?c(e,t):(this._expandBoundingRect(e.xmin,e.ymin,t),this._expandBoundingRect(e.xmax,e.ymin,t),this._expandBoundingRect(e.xmin,e.ymax,t),this._expandBoundingRect(e.xmax,e.ymax,t)),t}get cameraDimensions(){const{boundingRect:e}=this;return{width:p(e),height:d(e)}}get cameraNearFar(){const{renderCoordsHelper:{unitInMeters:e}}=this,r=1/e;return{near:x*r,far:y*r}}get upVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,2,i())}get northVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,1,i())}get eastVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,0,i())}_expandBoundingRect(e,r,t){const{extent:o,eastVector:n,northVector:i,upVector:a,renderCoordsHelper:c}=this,p=o.center.z??0;s(g,e,r,p),c.toRenderCoords(g,o.spatialReference,g),m(g,n,i,a,h),l(t,h,t)}};e([o()],u.prototype,"renderCoordsHelper",void 0),e([o()],u.prototype,"extent",void 0),e([o()],u.prototype,"localOrigin",void 0),e([o()],u.prototype,"localOriginRenderSpace",null),e([o()],u.prototype,"cameraPositionRenderSpace",null),e([o()],u.prototype,"boundingRect",null),e([o()],u.prototype,"cameraDimensions",null),e([o()],u.prototype,"upVector",null),e([o()],u.prototype,"northVector",null),e([o()],u.prototype,"eastVector",null),e([o()],u.prototype,"rawResult",void 0),u=e([n("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillComputation")],u);const g=i(),h=i(),R=r.maxTargetElevation,x=0,y=r.targetElevationRange;export{u as VolumeMeasurementCutFillComputation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{initial as n,watch as s,when as a,syncAndInitial as l,sync as p}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as u}from"../../../../core/screenUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../../../chunks/earcut.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as
|
|
5
|
+
import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{initial as n,watch as s,when as a,syncAndInitial as l,sync as p}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as u}from"../../../../core/screenUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../../../chunks/earcut.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as g,x as y}from"../../../../chunks/vec32.js";import{fromValues as _,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as v}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as j}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as w}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as E}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as x,create as G,expand as R,width as b,height as L,fromExtent as V,intersects as T}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as M}from"../../../../geometry/support/DoubleArray.js";import{t as C}from"../../../../chunks/vec3.js";import H from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as O}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as P}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementDistanceTooCloseError as U,VolumeMeasurementDistanceTooFarError as I,VolumeMeasurementPerimeterTooLargeError as A,VolumeMeasurementUnsupportedCoordinateSystemError as D,VolumeMeasurementUnsupportedLayerTransparencyError as S}from"./volumeMeasurementErrors.js";import F from"./VolumeMeasurementResult.js";import{getRawResult as k}from"./volumeMeasurementUtils.js";import{ElevationContext as N}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as z}from"../../support/ElevationProvider.js";import{polygonToRenderInfo as W}from"../../support/renderInfoUtils/polygon.js";import{CutFillDepth as B,TargetGeometryRenderInfo as q}from"../../webgl-engine/lib/CutFillDepth.js";import{euclideanDirectDistance as J}from"../../../support/euclideanLengthMeasurementUtils.js";let K=class extends r{constructor(e){super(e),this._getElevationProvider=()=>this.view.elevationProvider,this._updatingHandles=new v,this._computationValue=null}initialize(){const e=this.view;this._renderer=new B({view:e}),this._updatingHandles.add(()=>({computation:this._computation,renderGeometry:this._targetGeometryRenderInfo}),({computation:e,renderGeometry:t})=>{e&&t&&(this._renderer.setup(e,t),this._renderer.start())},n),this.addHandles([this._createElevationUpdateHandle(),s(()=>this._targetGeometry,e=>this.analysisViewData.targetGeometry=e,l),s(()=>this._elevationAlignedGeometry,e=>this.analysisViewData.elevationAlignedGeometry=e,l),s(()=>({computation:this._computation,extent:this._projectedGeometry?.extent,localOrigin:this._localOrigin}),({computation:e,extent:t,localOrigin:r})=>{e&&t&&r&&(e.extent=t,e.localOrigin=r)},p),a(()=>this._renderer.done,()=>this._updateResult())])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy()}get _projectedGeometry(){if(!this.analysis.valid)return null;const e=this.analysis.geometry,t=j(e,this.view.spatialReference);return t.pending?(this._updatingHandles.addPromise(t.pending),null):(e&&!t.geometry&&O(this.analysis,e.spatialReference,o.getLogger(this)),t.geometry)}get _localOrigin(){const e=this._projectedGeometry?.extent;return e?_(e.center.x,e.center.y,0):null}get _elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return Q(this._getElevationProvider(),t),t}get _targetGeometry(){const e=this._elevationAlignedGeometry;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings[0].forEach(e=>e[2]=r),o}get _targetGeometryRenderInfo(){const e=this._targetGeometry,t=this._projectedGeometry?.extent,r=this._localOrigin;if(!e||!t||!r)return null;const{elevationProvider:o,renderCoordsHelper:i}=this.view,n=W(e,o,i,N.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:s}=n,a=s[0],l=d(a.position,a.holeIndices,3),p=M(3*a.count),u=h(),m=h();return w(t.spatialReference,r,u,i.spatialReference),m[12]=-u[12],m[13]=-u[13],m[14]=-u[14],C(p,a.position,m),new q(p,l)}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._computation?.rawResult;return e?new F({measureType:this.analysis.measureType,rawResult:e,unit:this.analysisViewData.effectiveDisplayUnits.volume}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._tooNearFarError}get _tooNearFarError(){const e=this._elevationAlignedGeometry;if(!e)return null;const{view:r}=this,{elevationProvider:o,renderCoordsHelper:i}=r,{camera:n}=r.state,s=W(e,o,i,N.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:a}=s,l=a[0].position;x(re);for(let t=0;t<l.length;t+=3)n.projectToScreen(g(te,l[t],l[t+1],l[t+2]),oe),R(re,oe,re);const p=b(re),u=L(re),{maxVolumeExtentSizeVw:m,minVolumeExtentSizePixels:c}=t;return p>n.width/n.pixelRatio*m||u>n.height/n.pixelRatio*m?new U:Math.max(p,u)<c?new I:null}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeter,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new A:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeter,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new A:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new D:null}get _unsupportedLayerTransparencyError(){return(this.view.map?.ground.opacity??1)<1?new S:null}get _perimeter(){const e=this._targetGeometryRenderInfo?.positions,t=e?Y(Z(e)):null;return null!=t?t/this.view.renderCoordsHelper.unitInMeters:null}get _enabled(){return!this.error}get _computation(){const e=this._projectedGeometry?.extent;if(!e||!this._enabled)return this._computationValue=i(this._computationValue),null;if(this._computationValue)return this._computationValue;const t=this._localOrigin;if(!t)return null;const{renderCoordsHelper:r}=this.view;return this._computationValue=new P({extent:e,localOrigin:t,renderCoordsHelper:r}),this._computationValue}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(E(e.extent,e.spatialReference,$,this.view.spatialReference),V(t,ee),T($,ee)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(){if(!this._computation)return;const{spatialReference:e,viewingMode:t}=this.view,{extent:r,boundingRect:o,cameraNearFar:{near:i,far:n}}=this._computation,{width:s,height:a}=this._renderer;let l,p;"local"===t&&e.isWebMercator?({width:l,height:p}=X(r)):(l=b(o),p=L(o));const u=l/s*(p/a),m=this._renderer.getDepth(),c=e=>e*(n-i)+i,d=c(m.cut)*u,h=c(m.fill)*u;this._computation.rawResult=k(Math.abs(d),h)}};function Q(e,t){t.rings[0].forEach(t=>{t[2]=z(e,t,"ground")??0})}function X(e){const t=J([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],e.spatialReference),r=J([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],e.spatialReference);return{width:t?.value??0,height:r?.value??0}}function Y(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1],i[2]??0]),r?o+=y(r,i):r=[0,0,0],r[0]=i[0],r[1]=i[1],r[2]=i[2];return t&&r&&(o+=y(r,t)),Math.sqrt(o)}function*Z(e){const t=f();for(let r=0;r<e.length;r+=3)t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2],yield t}e([m()],K.prototype,"_projectedGeometry",null),e([m()],K.prototype,"_localOrigin",null),e([m()],K.prototype,"_getElevationProvider",void 0),e([m()],K.prototype,"_elevationAlignedGeometry",null),e([m()],K.prototype,"_targetGeometry",null),e([m()],K.prototype,"_targetGeometryRenderInfo",null),e([m({constructOnly:!0})],K.prototype,"analysis",void 0),e([m({constructOnly:!0})],K.prototype,"analysisViewData",void 0),e([m({constructOnly:!0})],K.prototype,"view",void 0),e([m()],K.prototype,"updating",null),e([m()],K.prototype,"result",null),e([m()],K.prototype,"error",null),e([m()],K.prototype,"_tooNearFarError",null),e([m()],K.prototype,"_perimeterTooLargeError",null),e([m()],K.prototype,"_perimeterTooLargeLocalError",null),e([m()],K.prototype,"_perimeterTooLargeGlobalError",null),e([m()],K.prototype,"_unsupportedCoordinateSystemError",null),e([m()],K.prototype,"_unsupportedLayerTransparencyError",null),e([m()],K.prototype,"_perimeter",null),e([m()],K.prototype,"_enabled",null),e([m()],K.prototype,"_renderer",void 0),e([m({readOnly:!0})],K.prototype,"_updatingHandles",void 0),e([m()],K.prototype,"_computation",null),K=e([c("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],K);const $=x(),ee=x(),te=f(),re=G(),oe=u();export{K as VolumeMeasurementCutFillController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../Color.js";import"../../../../intl.js";import{volumeMeasurementConfiguration as i}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import s from"../../../../core/Accessor.js";import{equals as o}from"../../../../core/arrayUtils.js";import{cyclicalPI as r}from"../../../../core/Cyclical.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{formatDecimal as n}from"../../../../core/quantityFormatUtils.js";import{watch as a,initial as c}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as u}from"../../../../core/unitUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as h}from"../../../../chunks/earcut.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as g,n as y,e as _,i as f,f as v}from"../../../../chunks/vec32.js";import{create as j,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as L}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as w}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as G}from"../../../../geometry/support/vector.js";import{t as P}from"../../../../chunks/vec3.js";import V from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as R}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as F}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as A}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as O}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as x}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as D}from"../../layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{polygonToRenderInfo as M}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as S,VolumeGeometry as U}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as E}from"../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as B}from"../../../../intl/locale.js";import{fetchMessageBundle as N}from"../../../../intl/messages.js";import{substitute as H}from"../../../../intl/substitute.js";let T=class extends s{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=x.fromElevationInfo(new V({mode:"absolute-height"})),this._extrusionHeight=1e4,this._projectionLines=[]}initialize(){const{view:e}=this,s={view:e,isDecoration:!0},o=i,r={...s,width:o.geometryOutlineWidth};this._elevationAlignedGeometry=new A({...r,isDraped:!0,color:t.toUnitRGBA(o.geometryOutlineColor)}),this._targetGeometry=new A(r);const l={...s,attached:!0,width:o.projectionLineWidth,renderOccluded:4,polygonOffset:!0},n={...l,stipplePattern:E(o.projectionLineStippleSize)},u=t.toUnitRGBA(o.cutProjectionLineColor),m=t.toUnitRGBA(o.fillProjectionLineColor);this._cutProjectionLines=new F({...l,color:u}),this._occludedCutProjectionLines=new F({...n,color:u}),this._fillProjectionLines=new F({...l,color:m}),this._occludedFillProjectionLines=new F({...n,color:m});const d={...s,attached:!0};this._cutVolumeLabel=new R(d),this._fillVolumeLabel=new R(d),this._cutFillRenderNode=new S({view:e,cutColor:o.cutColor,fillColor:o.fillColor,borderColor:o.geometryOutlineColor}),this.addHandles([a(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},c),a(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i},c),a(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i)),a(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},c),a(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),c),a(()=>this.visible&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),c),a(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),a(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e)),B(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=l(this._elevationAlignedGeometry),this._targetGeometry=l(this._targetGeometry),this._cutProjectionLines=l(this._cutProjectionLines),this._occludedCutProjectionLines=l(this._occludedCutProjectionLines),this._fillProjectionLines=l(this._fillProjectionLines),this._occludedFillProjectionLines=l(this._occludedFillProjectionLines),this._cutVolumeLabel=l(this._cutVolumeLabel),this._fillVolumeLabel=l(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,r=[],l=e.spatialReference,n=e.rings[0],a=n.length>1&&o(n[0],n[n.length-1]),c=n.length-(a?1:0);for(let o=0;o<c;++o){const e=n[o],i=g(j(),e[0],e[1],e[2]);s.toRenderCoords(i,l,i);const a=t.rings[0][o],c=g(j(),a[0],a[1],a[2]);s.toRenderCoords(c,l,c);const u=new O(i,c);r.push(u)}e.isClockwise(n)||r.reverse();const u=[],m=[],d=[],h=[],p=[],y=this.view.state.camera;for(let o=0;o<r.length;++o){const i=r[o],s=r[0===o?r.length-1:o-1],l=r[o===r.length-1?0:o+1],n=e.rings[0][o],a=t.rings[0][o],c=n[2]>a[2],g=new k(i,s,l,c);u.push(g),g.updateOccluded(y);const _=g.isOccluded;c?(_?d:m).push(i):(_?p:h).push(i)}this._projectionLines=u,this._cutProjectionLines.setGeometryFromSegments(m),this._occludedCutProjectionLines.setGeometryFromSegments(d),this._fillProjectionLines.setGeometryFromSegments(h),this._occludedFillProjectionLines.setGeometryFromSegments(p)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,s,o){const{geometryOutlineColor:r,cutColor:l,fillColor:n,cutColorMuted:a,fillColorMuted:c,cutProjectionLineColor:u,fillProjectionLineColor:m}=i;if(this._cutFillRenderNode.cutColor=o?l:a,this._cutFillRenderNode.fillColor=o?n:c,e){const e=t.toUnitRGBA(s);this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=s}else{this._targetGeometry.color=t.toUnitRGBA(r);const e=t.toUnitRGBA(o?u:a);this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const i=t.toUnitRGBA(o?m:c);this._fillProjectionLines.color=i,this._occludedFillProjectionLines.color=i,this._cutFillRenderNode.borderColor=r}}_updateLabels(e){const{labelDistance:t}=i,{effectiveDisplayUnits:s,labelAnchors:o,messages:r,unitsMessages:l,result:n,visible:a}=e;if(this._cutVolumeLabel.visible=a,this._fillVolumeLabel.visible=a,this._cutVolumeLabel.geometry=o.cut?{type:"point",point:o.cut,callout:{distance:t,offset:0}}:null,this._fillVolumeLabel.geometry=o.fill?{type:"point",point:o.fill,callout:{distance:-t,offset:0}}:null,null==n||null==r||null==l)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const c=s.volume,u=H(r.labels.cut,{volume:I(l,n.cutVolume,c)}),m=H(r.labels.fill,{volume:I(l,n.fillVolume,c)});this._cutVolumeLabel.text=u,this._fillVolumeLabel.text=m}_updateCutFillVisibility(e){e?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=b(i.x,i.y,0),o=j();e.toRenderCoords(s,t.spatialReference,o);const r=this._getExtrudedVolumes(t,this._extrusionHeight,s),l=this._getExtrudedVolumes(t,-this._extrusionHeight,s);this._cutFillRenderNode.updateGeometries(r,l,o)}_getExtrudedVolumes(e,t,i){const{renderCoordsHelper:s,spatialReference:o,elevationProvider:r}=this.view,l=j(),n=1===s.viewingMode;n||s.worldUpAtPosition([0,0,0],l);const a=M(e,r,s,this._elevationContext),{polygons:c,mapPositions:u,position:m}=a,d=c[0],g=d.count,y=h(d.mapPositions,d.holeIndices,3),_=y.length,f=6*g,v=w(f+_),b=w(_),G=C(3*f),V=C(3*f);D(m,u,y,d,G,null,V,null,v,b,t,l,n);const R=p(),F=p();return L(o,i,R,s.spatialReference),F[12]=-R[12],F[13]=-R[13],F[14]=-R[14],P(G,G,F),new U(G,b,v,V)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await N("esri/core/t9n/Units"),this.messages=await N("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,s){if(!t||!e)return null;const o=u(t.value,t.unit,s),r=i.labelPrecisions[o];return n(e,t,o,r)}e([m({constructOnly:!0})],T.prototype,"view",void 0),e([m({constructOnly:!0})],T.prototype,"analysis",void 0),e([m({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([m()],T.prototype,"unitsMessages",void 0),e([m()],T.prototype,"messages",void 0),e([m()],T.prototype,"loadingMessages",void 0),e([m({readOnly:!0})],T.prototype,"visible",null),e([m()],T.prototype,"updating",null),e([m()],T.prototype,"hasUnsupportedError",null),T=e([d("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],T);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=j(),this._n2=j();const o=y(z,_(z,e.endRenderSpace,e.startRenderSpace));y(this._n1,f(this._n1,o,y(W,_(W,t.startRenderSpace,e.startRenderSpace)))),y(this._n2,f(this._n2,o,y(W,_(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=r.normalize(G(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){_(z,this.segment.startRenderSpace,e.eye);const t=v(this._n1,z)<0,i=v(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=j(),W=j();export{T as VolumeMeasurementCutFillVisualization};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../Color.js";import"../../../../intl.js";import{volumeMeasurementConfiguration as i}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import s from"../../../../core/Accessor.js";import{equals as o}from"../../../../core/arrayUtils.js";import{cyclicalPI as r}from"../../../../core/Cyclical.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{formatDecimal as n}from"../../../../core/quantityFormatUtils.js";import{watch as a,initial as c}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as u}from"../../../../core/unitUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as h}from"../../../../chunks/earcut.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as g,n as y,e as _,i as f,f as v}from"../../../../chunks/vec32.js";import{create as j,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as L}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as w}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as G}from"../../../../geometry/support/vector.js";import{t as P}from"../../../../chunks/vec3.js";import V from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as R}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as F}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as A}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as O}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as x}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as D}from"../../layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{polygonToRenderInfo as M}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as S,VolumeGeometry as U}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as E}from"../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as B}from"../../../../intl/locale.js";import{fetchMessageBundle as N}from"../../../../intl/messages.js";import{substitute as H}from"../../../../intl/substitute.js";let T=class extends s{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=x.fromElevationInfo(new V({mode:"absolute-height"})),this._extrusionHeight=i.targetElevationRange,this._projectionLines=[]}initialize(){const{view:e}=this,s={view:e,isDecoration:!0},o=i,r={...s,width:o.geometryOutlineWidth};this._elevationAlignedGeometry=new A({...r,isDraped:!0,color:t.toUnitRGBA(o.geometryOutlineColor)}),this._targetGeometry=new A(r);const l={...s,attached:!0,width:o.projectionLineWidth,renderOccluded:4,polygonOffset:!0},n={...l,stipplePattern:E(o.projectionLineStippleSize)},u=t.toUnitRGBA(o.cutProjectionLineColor),m=t.toUnitRGBA(o.fillProjectionLineColor);this._cutProjectionLines=new F({...l,color:u}),this._occludedCutProjectionLines=new F({...n,color:u}),this._fillProjectionLines=new F({...l,color:m}),this._occludedFillProjectionLines=new F({...n,color:m});const d={...s,attached:!0};this._cutVolumeLabel=new R(d),this._fillVolumeLabel=new R(d),this._cutFillRenderNode=new S({view:e,cutColor:o.cutColor,fillColor:o.fillColor,borderColor:o.geometryOutlineColor}),this.addHandles([a(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},c),a(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i},c),a(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i),c),a(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},c),a(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),c),a(()=>this.visible&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),c),a(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),a(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),c),B(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=l(this._elevationAlignedGeometry),this._targetGeometry=l(this._targetGeometry),this._cutProjectionLines=l(this._cutProjectionLines),this._occludedCutProjectionLines=l(this._occludedCutProjectionLines),this._fillProjectionLines=l(this._fillProjectionLines),this._occludedFillProjectionLines=l(this._occludedFillProjectionLines),this._cutVolumeLabel=l(this._cutVolumeLabel),this._fillVolumeLabel=l(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,r=[],l=e.spatialReference,n=e.rings[0],a=n.length>1&&o(n[0],n[n.length-1]),c=n.length-(a?1:0);for(let o=0;o<c;++o){const e=n[o],i=g(j(),e[0],e[1],e[2]);s.toRenderCoords(i,l,i);const a=t.rings[0][o],c=g(j(),a[0],a[1],a[2]);s.toRenderCoords(c,l,c);const u=new O(i,c);r.push(u)}e.isClockwise(n)||r.reverse();const u=[],m=[],d=[],h=[],p=[],y=this.view.state.camera;for(let o=0;o<r.length;++o){const i=r[o],s=r[0===o?r.length-1:o-1],l=r[o===r.length-1?0:o+1],n=e.rings[0][o],a=t.rings[0][o],c=n[2]>a[2],g=new k(i,s,l,c);u.push(g),g.updateOccluded(y);const _=g.isOccluded;c?(_?d:m).push(i):(_?p:h).push(i)}this._projectionLines=u,this._cutProjectionLines.setGeometryFromSegments(m),this._occludedCutProjectionLines.setGeometryFromSegments(d),this._fillProjectionLines.setGeometryFromSegments(h),this._occludedFillProjectionLines.setGeometryFromSegments(p)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,s,o){const{geometryOutlineColor:r,cutColor:l,fillColor:n,cutColorMuted:a,fillColorMuted:c,cutProjectionLineColor:u,fillProjectionLineColor:m}=i;if(this._cutFillRenderNode.cutColor=o?l:a,this._cutFillRenderNode.fillColor=o?n:c,e){const e=t.toUnitRGBA(s);this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=s}else{this._targetGeometry.color=t.toUnitRGBA(r);const e=t.toUnitRGBA(o?u:a);this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const i=t.toUnitRGBA(o?m:c);this._fillProjectionLines.color=i,this._occludedFillProjectionLines.color=i,this._cutFillRenderNode.borderColor=r}}_updateLabels(e){const{labelDistance:t}=i,{effectiveDisplayUnits:s,labelAnchors:o,messages:r,unitsMessages:l,result:n,visible:a}=e;if(this._cutVolumeLabel.visible=a,this._fillVolumeLabel.visible=a,this._cutVolumeLabel.geometry=o.cut?{type:"point",point:o.cut,callout:{distance:t,offset:0}}:null,this._fillVolumeLabel.geometry=o.fill?{type:"point",point:o.fill,callout:{distance:-t,offset:0}}:null,null==n||null==r||null==l)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const c=s.volume,u=H(r.labels.cut,{volume:I(l,n.cutVolume,c)}),m=H(r.labels.fill,{volume:I(l,n.fillVolume,c)});this._cutVolumeLabel.text=u,this._fillVolumeLabel.text=m}_updateCutFillVisibility(e){e?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=b(i.x,i.y,0),o=j();e.toRenderCoords(s,t.spatialReference,o);const r=this._getExtrudedVolumes(t,this._extrusionHeight,s),l=this._getExtrudedVolumes(t,-this._extrusionHeight,s);this._cutFillRenderNode.updateGeometries(r,l,o)}_getExtrudedVolumes(e,t,i){const{renderCoordsHelper:s,spatialReference:o,elevationProvider:r}=this.view,l=j(),n=1===s.viewingMode;n||s.worldUpAtPosition([0,0,0],l);const a=M(e,r,s,this._elevationContext),{polygons:c,mapPositions:u,position:m}=a,d=c[0],g=d.count,y=h(d.mapPositions,d.holeIndices,3),_=y.length,f=6*g,v=w(f+_),b=w(_),G=C(3*f),V=C(3*f);D(m,u,y,d,G,null,V,null,v,b,t,l,n);const R=p(),F=p();return L(o,i,R,s.spatialReference),F[12]=-R[12],F[13]=-R[13],F[14]=-R[14],P(G,G,F),new U(G,b,v,V)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await N("esri/core/t9n/Units"),this.messages=await N("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,s){if(!t||!e)return null;const o=u(t.value,t.unit,s),r=i.labelPrecisions[o];return n(e,t,o,r)}e([m({constructOnly:!0})],T.prototype,"view",void 0),e([m({constructOnly:!0})],T.prototype,"analysis",void 0),e([m({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([m()],T.prototype,"unitsMessages",void 0),e([m()],T.prototype,"messages",void 0),e([m()],T.prototype,"loadingMessages",void 0),e([m({readOnly:!0})],T.prototype,"visible",null),e([m()],T.prototype,"updating",null),e([m()],T.prototype,"hasUnsupportedError",null),T=e([d("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],T);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=j(),this._n2=j();const o=y(z,_(z,e.endRenderSpace,e.startRenderSpace));y(this._n1,f(this._n1,o,y(W,_(W,t.startRenderSpace,e.startRenderSpace)))),y(this._n2,f(this._n2,o,y(W,_(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=r.normalize(G(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){_(z,this.segment.startRenderSpace,e.eye);const t=v(this._n1,z)<0,i=v(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=j(),W=j();export{T as VolumeMeasurementCutFillVisualization};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{neverReached as s}from"../../../core/compilerUtils.js";import{lerp as i}from"../../../core/mathUtils.js";import{destroyMaybe as r,disposeMaybe as o}from"../../../core/maybe.js";import{watch as a,initial as h}from"../../../core/reactiveUtils.js";import{signal as n}from"../../../core/signal.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as u}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as d}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{neverReached as s}from"../../../core/compilerUtils.js";import{lerp as i}from"../../../core/mathUtils.js";import{destroyMaybe as r,disposeMaybe as o}from"../../../core/maybe.js";import{watch as a,initial as h}from"../../../core/reactiveUtils.js";import{signal as n}from"../../../core/signal.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as u}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{targetTo as d}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{equals as m,copy as f,set as _}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{clone as g,ZEROS as x,zeros as y}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as b}from"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{zeros as T}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as v}from"../../../geometry/ellipsoidUtils.js";import{C as S,c as C}from"../../../chunks/Clouds.glsl.js";import{cloudPresets as w}from"./CloudsPresets.js";import{CloudsTechnique as j}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as P}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as z}from"./NoiseTextureAtlas.js";import{TaskPriority as I}from"../../support/Scheduler.js";import{Yield as M}from"../../support/Yield.js";import{ColorAttachment0 as H}from"../../webgl/enums.js";import{FramebufferObject as q}from"../../webgl/FramebufferObject.js";import{TextureDescriptor as R}from"../../webgl/TextureDescriptor.js";let U=class extends e{constructor(t){super(t),this._state=n(0),this._passParameters=new S,this._weatherTileCount=128,this._sliceIndex=0,this._tileIndex=0,this._tilesPerSlice=1,this.coverage=i(w.default.coverage[0],w.default.coverage[1],.5),this.density=i(w.default.density[0],w.default.density[1],.5),this.absorption=i(w.default.absorption[0],w.default.absorption[1],.5),this.cloudSize=i(w.default.cloudSize[0],w.default.cloudSize[1],.5),this.detailSize=i(w.default.detailSize[0],w.default.detailSize[1],.5),this.smoothness=i(w.default.smoothness[0],w.default.smoothness[1],.5),this.cloudHeight=i(w.default.cloudHeight[0],w.default.cloudHeight[1],.5),this.raymarchingSteps=w.default.raymarchingSteps,this._viewMatrix=p(),this._dirty=!0,this.readyToRun=!0,this._configuration=new P}initialize(){const t=v(this.view.spatialReference);this._passParameters.cloudRadius=.5*t.radius;const e=()=>this.setDirty();this.addHandles([this.view.resourceController.scheduler.registerTask(I.CLOUDS_GENERATOR,this),a(()=>this.coverage,e,h),a(()=>this.density,e,h),a(()=>this.absorption,e,h),a(()=>this.cloudSize,e,h),a(()=>this.detailSize,e,h),a(()=>this.smoothness,e,h),a(()=>this.cloudHeight,e,h),a(()=>this.raymarchingSteps,e,h)]);const s=g(this._computeWeatherTile());let i=0;this.addHandles(a(()=>{const t=this._computeWeatherTile();return m(s,t)||(++i,f(s,t)),i},e))}destroy(){this.destroyCubeMap(),this._passParameters.noiseTexture=r(this._passParameters.noiseTexture)}_precompile(){this._configuration.steps=this.raymarchingSteps,this._configuration.writeTextureChannels=0,this.context.techniques.precompile(j,this._configuration),this._configuration.writeTextureChannels=1,this.context.techniques.precompile(j,this._configuration)}_acquireTechnique(){switch(this.raymarchingSteps){case 0:this._tilesPerSlice=1;break;case 1:this._tilesPerSlice=4;break;case 3:case 2:this._tilesPerSlice=8;break;default:s(this.raymarchingSteps)}return this._configuration.writeTextureChannels=1-this.parameters.readChannels,this._configuration.steps=this.raymarchingSteps,this.context.techniques.get(j,this._configuration)}_computeWeatherTile(){const{camera:t,environment:e}=this.view,{latitude:s,longitude:i}=t.position;if(null==s||null==i)return x;_(A,(s+90)/180,(i+180)/360);const r=Math.floor(this._weatherTileCount*Math.abs(2*A[0]-1));A[0]=Math.floor(2*this._weatherTileCount*A[0]),A[1]=Math.floor(4*(this._weatherTileCount-r)*A[1]);let o=0,a=0;if("virtual"!==e?.lighting?.type&&null!=e?.lighting?.date){const t=new Date(e.lighting.date);t.setUTCHours(e.lighting.date.getUTCHours()+(e.lighting.displayUTCOffset??0)),o=31*t.getUTCMonth()+t.getUTCDate(),a=t.getUTCFullYear()}return A[0]=(A[0]+o)%(2*this._weatherTileCount),A[1]=(A[1]+a%100)%(4*this._weatherTileCount),A}get state(){return this._state.value}set state(t){this._state.value=t}get usedMemory(){return(this._fbo?.usedMemory??0)+(this._passParameters.noiseTexture?.textureAtlas?.usedMemory??0)}_ensureNoiseTexture(){return this._passParameters.noiseTexture??=new z({context:this.context}),this._passParameters.noiseTexture}_ensureFrameBufferCube(t){const e=this.context.renderContext.rctx;if(null==this._fbo){const s=new R(t,t/2);s.target=35866,s.depth=6,s.wrapMode=33071,this._fbo=new q(e,s),this.parameters.data=this,this.parameters.absorption=this.absorption,this.parameters.coverage=this.coverage}return e.unbindTexture(this._fbo.colorTexture),this._fbo}get cubeMap(){return this._fbo}get parameters(){return this.context.renderContext.bind.clouds}destroyCubeMap(){this._fbo=o(this._fbo),this.parameters.data=null}applyPreset(t,e){const s=t.median,r=t=>{const r=i(t[0],t[1],s);return e<.5?i(t[0],r,2*e):i(r,t[1],2*(e-.5))};this.coverage=r(t.coverage),this.density=r(t.density),this.absorption=r(t.absorption),this.cloudSize=r(t.cloudSize),this.detailSize=r(t.detailSize),this.smoothness=r(t.smoothness),this.cloudHeight=r(t.cloudHeight),this.raymarchingSteps=t.raymarchingSteps,this._precompile()}setDirty(){this._dirty=this.readyToRun=!0}runTask(t){if(3===this.state)return M;this._dirty&&(this._sliceIndex=this._tileIndex=0,this.state=1,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._ensureNoiseTexture().updateWeatherMap(this._computeWeatherTile()),this._dirty=!1);const e=this._acquireTechnique();if(!this._ensureNoiseTexture().textureAtlas||!e.compiled)return M;const s=O[this._sliceIndex],i=k[this._sliceIndex];d(this._viewMatrix,D,s,i),u(this._passParameters.viewMatrix,this._viewMatrix);const r=this.context.renderContext.rctx,o=r.getViewport(),a=C/this._tilesPerSlice,h=this._tileIndex*a;r.setViewport(0,h,C,a);const n=this._ensureFrameBufferCube(C);r.bindFramebuffer(n),this._passParameters.lastSlice=5===this._sliceIndex,r.bindTechnique(e,this.context.renderContext.bind,this._passParameters);const l=35866;return n.setColorTextureTarget(l,H,this._sliceIndex),r.screen.draw(),r.gl.flush(),r.setViewport(o.x,o.y,o.width,o.height),this.requestRender(),++this._tileIndex,5===this._sliceIndex&&this._tileIndex===this._tilesPerSlice?(this._sliceIndex=this._tileIndex=0,this.state=2,this.readyToRun=!1):this._tileIndex===this._tilesPerSlice&&(++this._sliceIndex,this._tileIndex=0),t.madeProgress(),M}};t([l({constructOnly:!0})],U.prototype,"context",void 0),t([l({constructOnly:!0})],U.prototype,"view",void 0),t([l({constructOnly:!0})],U.prototype,"requestRender",void 0),t([l()],U.prototype,"coverage",void 0),t([l()],U.prototype,"density",void 0),t([l()],U.prototype,"absorption",void 0),t([l()],U.prototype,"cloudSize",void 0),t([l()],U.prototype,"detailSize",void 0),t([l()],U.prototype,"smoothness",void 0),t([l()],U.prototype,"cloudHeight",void 0),t([l()],U.prototype,"raymarchingSteps",void 0),t([l()],U.prototype,"readyToRun",void 0),U=t([c("esri.views.3d.environment.CloudsRenderer")],U);const O=[b(1,0,0),b(-1,0,0),b(0,1,0),b(0,-1,0),b(0,0,1),b(0,0,1)],k=[b(0,0,-1),b(0,0,-1),b(0,0,-1),b(0,0,-1),b(0,1,0),b(0,1,0)],D=T(),A=y();export{U as CloudsRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../../Color.js";import{multiplyOpacityToUnitRGBA as e,
|
|
5
|
+
import t from"../../../../../Color.js";import{multiplyOpacityToUnitRGBA as e,colorEquals as i,getContrast as s}from"../../../../../core/colorUtils.js";import a from"../../../../../core/Handles.js";import"../../../../../core/has.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as o,sync as n}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as l}from"../../../../../core/screenUtils.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../../../../../geometry/Point.js";import{Manipulator3D as u}from"../../Manipulator3D.js";import{createManipulatorMaterial as p}from"../../manipulatorUtils.js";import{RenderObject as c}from"../../RenderObject.js";import{PickResult as d}from"../support/PickRequest.js";import{LaserlineVisualElement as m}from"../../visualElements/LaserlineVisualElement.js";import{createSphereGeometry as w}from"../../../webgl-engine/lib/GeometryUtil.js";import{ManipulatorCollection as v}from"../../../../interactive/ManipulatorCollection.js";import{newToolIntersector as g}from"../../../../interactive/ToolIntersector.js";class y{constructor(t){this.vertexManipulators=[],this._destroyed=!1,this._isManipulatorsOwner=!0,this._visible=!0,this._listenerHandles=null,this._tempHandlePosition=h();const{analysisViewData:e,manipulators:i,toolState:s,view:a,visible:r}=t;this._analysisViewData=e,this._toolState=s,null!=i?(this._manipulators=i,this._isManipulatorsOwner=!1):this._manipulators=new v,this._view=a,this._intersector=g(a.state.viewingMode);const o=p(this._handleColor),n=[new c(w(o,1,32,32))],l=new u({view:a,renderObjects:n});l.available=!1,l.radius=D,l.interactive=!1,this._manipulators.add(l),this._cursorManipulator=l,this._cursorManipulatorMaterial=o,this._laserLine=new m({view:a,attached:!0,style:{glowWidth:V,glowFalloff:M,innerWidth:b},isDecoration:!0}),this._updateVisibility(r??!0)}destroy(){this._listenerHandles=r(this._listenerHandles),this._isManipulatorsOwner?this._manipulators=r(this._manipulators):this._manipulators=null,this._laserLine=r(this._laserLine),this._destroyed=!0}get destroyed(){return this._destroyed}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get testData(){}show(){this._setVisibility(!0)}hide(){this._setVisibility(!1)}_setVisibility(t){this._destroyed||this._visible===t||this._updateVisibility(t)}_updateVisibility(t){this._visible=t,this._laserLine.visible=t,t?(this._initializeListeners(),this._updateAll()):(this._destroyListeners(),this.vertexManipulators.forEach(({manipulator:t})=>this._removeVertexManipulator(t)),this.vertexManipulators=[])}vertexHandleAt(t,e){const i=this._manipulators.intersect(t,e);return i?.metadata}pick(t){const e=this._view.spatialReference,i=l(t.screenPoint);this._view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=h();if(!s.getIntersectionPoint(a))return null;const r=this._view.renderCoordsHelper.fromRenderCoords(a,new _({spatialReference:e}));return null==r?null:new d(a,r)}_updateAll(){this._visible&&(this._updateVertexManipulators(),this._updateLaserLine())}_createVertexManipulator(){const t=p(this._handleColor),e=[new c(w(t,1,32,32))],i=new u({view:this._view,renderObjects:e});return i.radius=D,this._manipulators.add(i),{manipulator:i,material:t}}_removeVertexManipulator(t){this._manipulators.remove(t)}_updateVertexManipulators(){const{viewData:t}=this._analysisViewData,e=this._analysisViewData.path?this._analysisViewData.path.vertices:[],i=this.vertexManipulators;f(i,e.length,()=>this._createVertexManipulator(),({manipulator:t})=>this._removeVertexManipulator(t)),i.forEach(({manipulator:i},s)=>{i.metadata=e[s],i.renderLocation=t.positionsRender[s],i.cursor=0===s&&"drawing"===this._toolState.polygonState?"crosshair":null}),"drawing"===this._toolState.polygonState&&null!=this._analysisViewData.stagedPoint?(this._cursorManipulator.available=!0,this._cursorManipulator.location=this._analysisViewData.stagedPoint):this._cursorManipulator.available=!1}get _handleColor(){return e(this._view.effectiveTheme.accentColor,.5)}_getFocusPoint(){const{lastDraggedVertex:t}=this._analysisViewData;switch(this._toolState.polygonState){case"drawing":return null!=this._analysisViewData.stagedPoint?this._analysisViewData.stagedPoint:null!=t?this._analysisViewData.path.getVertexPositionAsPoint(t):this._analysisViewData.path.lastPoint;case"editing":return null!=t?this._analysisViewData.path.getVertexPositionAsPoint(t):null;default:return this._analysisViewData.stagedPoint}}_updateLaserLine(){const t="measured"!==this._toolState.polygonState&&this._toolState.active,e=this._getFocusPoint();if(t&&null!=e){const t=this._tempHandlePosition;this._view.renderCoordsHelper.toRenderCoords(e,t),this._laserLine.heightManifoldTarget=t}else this._laserLine.heightManifoldTarget=null}_initializeListeners(){this._listenerHandles=new a,this._listenerHandles.add([o(()=>this._toolState.polygonState,()=>this._updateLaserLine()),o(()=>this._analysisViewData.viewData,()=>this._updateAll(),n),o(()=>({lastDraggedVertex:this._analysisViewData.lastDraggedVertex,cursorPoint:this._analysisViewData.stagedPoint}),()=>this._updateLaserLine()),o(()=>this._toolState.active,()=>this._updateAll()),o(()=>this._view.effectiveTheme.accentColor,i=>{const a=e(i,.5);for(const{material:t}of this.vertexManipulators)t.setParameters({color:a});this._cursorManipulatorMaterial.setParameters({color:a});const r=t.toUnitRGB(i),o=t.toUnitRGB(s(i)),n=.75*i.a,l=this._laserLine,h=l.style;l.style={...h,glowColor:r,innerColor:o,globalAlpha:n}},{initial:!0,equals:i})])}_destroyListeners(){this._listenerHandles=r(this._listenerHandles)}}function f(t,e,i,s){for(;t.length<e;)t.push(i());if(s)for(;t.length>e;){s(t.pop())}else t.length=e}const V=8,M=8,b=1,D=5;export{y as default};
|
package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../../Color.js";import i from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as s,getContrast as o,
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../../Color.js";import i from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as s,getContrast as o,colorVectorEquals as n,colorVectorToColorAndOpacity as a}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as l,initial as d}from"../../../../../core/reactiveUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPoints as u}from"../../../../../geometry/support/lineSegment.js";import{Manipulator3D as m}from"../../Manipulator3D.js";import{createManipulatorMaterial as g}from"../../manipulatorUtils.js";import{RenderObject as _}from"../../RenderObject.js";import{LaserlineVisualElement as y}from"../../visualElements/LaserlineVisualElement.js";import{createSphereGeometry as v}from"../../../webgl-engine/lib/GeometryUtil.js";let b=class extends i{constructor(t){super(t),this.cursorPoint=null,this._visible=!1,this._laserLine=null,this.laserLineEnabled=!0,this._lastDraggedHandle=null}initialize(){this._laserLine=new y({view:this.view,attached:!0,isDecoration:!0}),this._updateVisibility(this._visible),this._connectToAnalysisView(),this.addHandles(l(()=>this._params,({laserLineGlowColor:t,laserLineInnerColor:e,laserLineGlobalAlpha:i})=>{const s=this._laserLine,o=s.style;s.style={...o,innerColor:e,glowColor:t,globalAlpha:i}}))}destroy(){this._laserLine=r(this._laserLine)}get _params(){const{accentColor:t}=this.view.effectiveTheme;return{laserLineGlowColor:e.toUnitRGB(t),laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:e.toUnitRGB(o(t)),laserLineInnerWidth:.75,laserLineGlobalAlpha:.75*t.a,handleColor:s(t,.5),handleRadius:5}}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get testData(){}get _cursorPosition(){const t=p(),e=this.cursorPoint;return e&&this.view.renderCoordsHelper.toRenderCoords(e,t),t}get _startPosition(){const t=p(),e=this.analysis.startPoint;return e&&this.view.renderCoordsHelper.toRenderCoords(e,t),t}get _endPosition(){const t=p(),e=this.analysis.endPoint;return e&&this.view.renderCoordsHelper.toRenderCoords(e,t),t}get _laserLineParams(){const t=this._focusPosition,{active:e,lineState:i}=this.toolState,s=this.analysisViewData,o=this.laserLineEnabled&&!!t&&"measured"!==i&&e;if(!o||!this.visible||null==s||s.destroyed)return{heightManifoldTarget:null,pointDistanceLine:null,lineVerticalPlaneSegment:null};const n=s.actualVisualizedMeasurement,a="local"!==this.view.viewingMode&&o&&!!this.analysis.startPoint&&"geodesic"===n,r=o&&2===s.viewMode;return{heightManifoldTarget:"euclidean"===n?t:null,pointDistanceLine:a?this._pointDistanceLine:null,lineVerticalPlaneSegment:r?u(this._startPosition,this._endPosition):null}}get _focusPosition(){const{lineState:t}=this.toolState,e=this.analysisViewData,i=null!=e&&!e.destroyed&&1===e.measurementMode&&1===e.viewMode;switch(t){case"drawing":return i?this._startPosition:this.analysis.endPoint?this._endPosition:this._startPosition;case"editing":return i?"start"===this._lastDraggedHandle?this._endPosition:this._startPosition:"start"===this._lastDraggedHandle?this._startPosition:this._endPosition;default:return null!=this.cursorPoint?this._cursorPosition:null}}get _pointDistanceLine(){return{origin:"drawing"===this.toolState.lineState||"end"===this._lastDraggedHandle?this._startPosition:this._endPosition,target:this._focusPosition}}createManipulators(){const t=this._params,{view:e}=this,i=()=>{const i=g(t.handleColor),s=[new _(v(i,1,32,32))],o=new m({view:e,renderObjects:s});return o.available=!1,o.radius=t.handleRadius,[o,i]},[s,o]=i(),[r,d]=i(),h=new m({view:this.view,available:!1,interactive:!1});null!=this.analysis.startPoint&&(s.location=this.analysis.startPoint,s.available=!0),null!=this.analysis.endPoint&&(r.location=this.analysis.endPoint,r.available=!0);const c=()=>{let t=this._lastDraggedHandle;s.grabbing&&!r.grabbing&&(t="start"),r.grabbing&&!s.grabbing&&(t="end"),s.grabbing||r.grabbing||(t=null),this._lastDraggedHandle=t},p=s.events.on("grab-changed",c),u=r.events.on("grab-changed",c);return this.addHandles([p,u,l(()=>a(this._params.handleColor),t=>{o.setParameters({color:t}),d.setParameters({color:t})},{equals:n})],"manipulators"),{start:s,end:r,cursor:h}}show(){this.destroyed||this._visible||this._updateVisibility(!0)}hide(){!this.destroyed&&this._visible&&this._updateVisibility(!1)}_connectToAnalysisView(){this.removeHandles("analysis-view"),this.addHandles([l(()=>this.analysisViewData?.destroyed,t=>{t&&this.removeHandles("analysis-view")},d),l(()=>["measured"===this.toolState.lineState,this.analysisViewData],([t,e])=>{null==e||e.destroyed||(e.allowVisualElementsOrientationChange=!t)},d),l(()=>this._laserLineParams,t=>{const e=this._laserLine;e.heightManifoldTarget=t.heightManifoldTarget,e.pointDistanceLine=t.pointDistanceLine,e.lineVerticalPlaneSegment=t.lineVerticalPlaneSegment},d)],"analysis-view")}_updateVisibility(t){this.initialized&&(this._visible=t,t&&(this._laserLine.style={innerColor:this._params.laserLineInnerColor,innerWidth:this._params.laserLineInnerWidth,glowColor:this._params.laserLineGlowColor,glowWidth:this._params.laserLineGlowWidth,glowFalloff:this._params.laserLineGlowFalloff,globalAlpha:this._params.laserLineGlobalAlpha}),this._laserLine.visible=t)}};t([h({constructOnly:!0})],b.prototype,"view",void 0),t([h()],b.prototype,"_params",null),t([h({constructOnly:!0})],b.prototype,"analysis",void 0),t([h({constructOnly:!0})],b.prototype,"analysisViewData",void 0),t([h()],b.prototype,"cursorPoint",void 0),t([h()],b.prototype,"toolState",void 0),t([h()],b.prototype,"visible",null),t([h()],b.prototype,"testData",null),t([h()],b.prototype,"_visible",void 0),t([h()],b.prototype,"_laserLine",void 0),t([h({constructOnly:!0})],b.prototype,"laserLineEnabled",void 0),t([h()],b.prototype,"_cursorPosition",null),t([h()],b.prototype,"_startPosition",null),t([h()],b.prototype,"_endPosition",null),t([h()],b.prototype,"_lastDraggedHandle",void 0),t([h()],b.prototype,"_laserLineParams",null),t([h()],b.prototype,"_focusPosition",null),t([h()],b.prototype,"_pointDistanceLine",null),b=t([c("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DView")],b);export{b as DirectLineMeasurement3DView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import o from"../../../request.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import o from"../../../request.js";import r from"../../../core/Error.js";import t from"../../../core/Logger.js";import{releaseMaybe as i}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationTileData as l}from"../../../layers/support/ElevationTileData.js";import{acquireDecoder as c}from"../../../layers/support/LercDecoder.js";import{queueHighPriority as m}from"../../../request/queue.js";import{ElevationLayerView3DModifications as p,ElevationLayerView3DModification as d}from"./ElevationLayerView3DModifications.js";import{LayerView3D as f}from"./LayerView3D.js";import{TiledLayerView3D as y}from"./TiledLayerView3D.js";import{elevationNoDataValue as h}from"../terrain/TerrainConst.js";import{useFetchTileForLayer as g}from"../terrain/terrainUtils.js";import u from"../../layers/LayerView.js";let w=class extends(y(f(u))){constructor(){super(...arguments),this.type="elevation-3d",this.modifications=new p}get tileInfo(){return this.layer.tileInfo}initialize(){const e=this.view,o=e.map?.allLayers,t=o&&o.includes(this.layer),i=e.map?.ground?.layers,s=i&&i.includes(this.layer);if(t&&!s){const e=new r("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`);this.addResolvingPromise(Promise.reject(e))}this._lercDecoder=c(e.resourceController),this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=i(this._lercDecoder)}async fetchElevationTile(e,o){const r=await this._fetchTileData(e.lij,o);if(!s(o))return r&&await this.modifications.apply(r,e,o.signal),r}async _fetchTileData(e,r){const i=this.layer;if(g(i)){const o=await i.fetchTile(e[0],e[1],e[2],{noDataValue:h,signal:r.signal});return s(r)?void t.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."):o}r={...m,responseType:"array-buffer",...r};const a=this.getTileUrl(e),n=(await o(a,r)).data,c=await this._lercDecoder.decode(n,{noDataValue:h},r.signal);if(c)return new l(c);throw new Error("LERC decoding failed")}async setModifications(e){if(this.modifications.modifications.length=0,!e||0===e.length)return;this._simplifyOperatorPromise??=import("../../../geometry/operators/simplifyOperator.js");const o=await this._simplifyOperatorPromise;for(const r of e){const e=r.geometry;if("polygon"===e?.type){const i=o.execute(e);if("polygon"===i?.type){const e=new d(r.type,i);this.modifications.modifications.push(e)}else t.getLogger(this).warn("Failed to simplify modification polygon")}else t.getLogger(this).warn("Invalid modification added to elevation layer: "+(e?`non polygon geometry ${e.type}`:"no geometry"))}}};e([a()],w.prototype,"layer",void 0),e([a()],w.prototype,"tileInfo",null),e([a()],w.prototype,"modifications",void 0),w=e([n("esri.views.3d.layers.ElevationLayerView3D")],w);const j=w;export{j 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as o,throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as l,when as n,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../core/scheduling.js";import{Seconds as h,secondsFromMilliseconds as c}from"../../../core/time.js";import{getMetersPerVerticalUnitForSR as m}from"../../../core/unitUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import{projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{fromExtent as v,intersection as w,toExtent as T,intersects as S}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as b}from"../../../geometry/support/spatialReferenceUtils.js";import R from"../../../symbols/support/ElevationInfo.js";import{getPositions as j,getFlowSimulationSettings as A,simulationSettingsEqual as L}from"../../2d/engine/flow/utils.js";import U from"./SubView3D.js";import{makeScheduleFunction as x}from"./support/makeScheduleFunction.js";import{thresholdForLoadingAllTiles as P,fadeOutTime as E,fadeInTime as I,defaultTransitionDuration as M,transitionDurationFactor as q,seamlessTransitionEnabled as F,averageLoadingTimeSmoothingFactor as V}from"../support/flow/constants.js";import{isFullExtent as k,FlowQuery3D as B,wrappedWidth as C}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as W}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as z,createStreamlineGeometry as G}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as H}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as D}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as O}from"../support/flow/StreamlineResources3DShape.js";import{tilesAreRelated as N}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as Q}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as J}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as K,hasLayerBasedScaleVisibility as X}from"../../support/layerViewUtils.js";import{TaskPriority as Y}from"../../support/Scheduler.js";let Z=class extends U{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=h(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._overrideTransitionEnabled=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const o=e.at(s);t(o)&&i.add(o),r.madeProgress(),r.done&&(r=yield)}}await this.frameTask.scheduleGenerator(r),this.renderedTiles=i})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new W(x(i)),this.frameTask=i.scheduler.registerTask(Y.FLOW_GENERATOR),this._updateTask=p({update:e=>this._update(e)}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&L(e,t)}),l(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit]},()=>this.triggerLoad(),u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()}),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),n(()=>!t.featureTiles?.updating,()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()})]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=y(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _dataBounds(){const e=y(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _ellipsoidRadius(){return f(this.view.spatialReference).radius}get loadAllTiles(){const{position:e}=this.view.camera,t=e.z;if(null==t)return!1;return t*m(e.spatialReference)/this._ellipsoidRadius>=P}get loadByTileTreesAllowed(){return!this.loadAllTiles||!this.loadRequirementsMet}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=y(e,this.surface.spatialReference).geometry;return null==t?null:v(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...z(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:I,fadeOutTime:E,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&Q(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return h(0===e?M:this._averageLoadingTime*q)}get _seamlessTransitionEnabled(){return null!=this._overrideTransitionEnabled?this._overrideTransitionEnabled:F}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get elevationInfo(){return this.layer.elevationInfo??$}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:j(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return b(this.surface.spatialReference)}get layer(){return this.layerView.layer}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&this.renderedTiles.size>0}getUpdating(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this.getUpdating()}get visibleAtCurrentScale(){return!X()||K(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=A(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&k(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this._loadingState="ready-to-load"}_update(e){const t=c(e.time);this._lastResources?.hasFadedOut(t)&&this._lastResources.detach();const i=this._nextStateForTransition(t);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==i||!this.loadRequirementsMet)return void(this._loadingState=i);this._loadingState="loading";const r=async()=>{const e=performance.now(),i=this._seamlessTransitionEnabled&&null!=this._resources?h(t+this._seamlessTransitionWaitingTime):t;await this._load(this.renderedTiles,i);const r=h((performance.now()-e)/1e3);this._updateAverageLoadingTime(r)};this.updatingHandles.addPromise(o(r())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=V;this._averageLoadingTime=h(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e,t){if(!this._visible)return this.clear(),void(this._loadingState="ready-to-load");const i=this._computeExtent(e);if(0===e.size||null==i)return void(this._loadingState="ready-to-load");const r=new B(i,this.layerView.timeExtent,this._viewSizeWithEqualRatio(i),this.view.state.contentPixelRatio,t);null==this._abortController&&(this._abortController=new AbortController);const s=this._abortController,o=await this._loadStreamlines(r,s.signal);if(a(s.signal),this._visible&&null!=o){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=o;const e=performance.now()/1e3,i=e>t?e:t;null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,await o.attach(),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new D(e,i,s,r,this.layerView):new O(e,i,s,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new J(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:o,view:a}=this;function*l(l){for(let n=0;n<t.length;++n)r.push(G(a,e,t[n],s,i,o)),l.madeProgress(),l.done&&(l=yield)}return await this.frameTask.scheduleGenerator(l),{geometries:r,material:i}}_computeExtent(e){const{spatialReference:t}=this.surface;if(null==t)return null;const i=H(e,this.spatialReferenceInfo);return null==i?null:(w(i,this._clippingArea,i),T(i,t))}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(o(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r}=this;if(this.loadAllTiles)return t=>t.leaf&&ee(e,t.extent);const s=t=>t.rendered&&t.visible&&ee(e,t.extent),{featureTiles:o}=i;if(!o)return s;const a=o.tiles.filter(e=>e.measures.visible);return e=>s(e)&&ee(r,e.extent)&&a.some(({lij:i})=>t(i,e.lij)||N(i,e.lij))}_viewSizeWithEqualRatio(e){const t=C(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;return i<r?[i,Math.floor(i/t)]:[Math.floor(r*t),r]}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+E?"transitioning":"ready-to-load"}get test(){}};e([g()],Z.prototype,"type",void 0),e([g()],Z.prototype,"renderedTiles",void 0),e([g()],Z.prototype,"_resources",void 0),e([g()],Z.prototype,"_lastResources",void 0),e([g()],Z.prototype,"requireLoad",void 0),e([g()],Z.prototype,"_averageLoadingTime",void 0),e([g()],Z.prototype,"_loadingState",void 0),e([g()],Z.prototype,"emissiveStrength",void 0),e([g()],Z.prototype,"_clippingArea",null),e([g()],Z.prototype,"_dataBounds",null),e([g()],Z.prototype,"_draped",null),e([g()],Z.prototype,"_ellipsoidRadius",null),e([g()],Z.prototype,"loadAllTiles",null),e([g()],Z.prototype,"_featureTilesBounds",null),e([g()],Z.prototype,"_flowRenderer",null),e([g()],Z.prototype,"_materialParameters",null),e([g()],Z.prototype,"_opacity",null),e([g()],Z.prototype,"_seamlessTransitionWaitingTime",null),e([g()],Z.prototype,"_seamlessTransitionEnabled",null),e([g()],Z.prototype,"_visible",null),e([g()],Z.prototype,"elevationInfo",null),e([g()],Z.prototype,"needsMagnitude",null),e([g()],Z.prototype,"spatialReferenceInfo",null),e([g()],Z.prototype,"layer",null),e([g()],Z.prototype,"loadingState",null),e([g()],Z.prototype,"updating",null),e([g()],Z.prototype,"visibleAtCurrentScale",null),e([g()],Z.prototype,"_overrideMaterialParameters",void 0),e([g()],Z.prototype,"_overrideSimulationSettings",void 0),e([g()],Z.prototype,"_overrideTransitionEnabled",void 0),e([g()],Z.prototype,"_simulationSettings",null),e([g()],Z.prototype,"surface",null),Z=e([_("esri.views.3d.layers.FlowSubView3D")],Z);const $=new R({mode:"on-the-ground"});function ee(e,t){return null==e||null==t||S(e,t)}export{Z as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as o,throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as l,when as n,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../core/scheduling.js";import{Seconds as h,secondsFromMilliseconds as c}from"../../../core/time.js";import{getMetersPerVerticalUnitForSR as m}from"../../../core/unitUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import{projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{fromExtent as v,intersection as w,toExtent as T,intersects as S}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as b}from"../../../geometry/support/spatialReferenceUtils.js";import R from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as j,getPositions as A,getFlowSimulationSettings as L}from"../../2d/engine/flow/utils.js";import U from"./SubView3D.js";import{makeScheduleFunction as x}from"./support/makeScheduleFunction.js";import{thresholdForLoadingAllTiles as P,fadeOutTime as E,fadeInTime as I,defaultTransitionDuration as M,transitionDurationFactor as q,seamlessTransitionEnabled as F,averageLoadingTimeSmoothingFactor as V}from"../support/flow/constants.js";import{isFullExtent as k,FlowQuery3D as B,wrappedWidth as C}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as W}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as z,createStreamlineGeometry as G}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as H}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as D}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as O}from"../support/flow/StreamlineResources3DShape.js";import{tilesAreRelated as N}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as Q}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as J}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as K,hasLayerBasedScaleVisibility as X}from"../../support/layerViewUtils.js";import{TaskPriority as Y}from"../../support/Scheduler.js";let Z=class extends U{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=h(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._overrideTransitionEnabled=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const o=e.at(s);t(o)&&i.add(o),r.madeProgress(),r.done&&(r=yield)}}await this.frameTask.scheduleGenerator(r),this.renderedTiles=i})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new W(x(i)),this.frameTask=i.scheduler.registerTask(Y.FLOW_GENERATOR),this._updateTask=p({update:e=>this._update(e)}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&j(e,t)}),l(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit]},()=>this.triggerLoad(),u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()}),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),n(()=>!t.featureTiles?.updating,()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()})]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=y(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _dataBounds(){const e=y(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _ellipsoidRadius(){return f(this.view.spatialReference).radius}get loadAllTiles(){const{position:e}=this.view.camera,t=e.z;if(null==t)return!1;return t*m(e.spatialReference)/this._ellipsoidRadius>=P}get loadByTileTreesAllowed(){return!this.loadAllTiles||!this.loadRequirementsMet}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=y(e,this.surface.spatialReference).geometry;return null==t?null:v(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...z(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:I,fadeOutTime:E,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&Q(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return h(0===e?M:this._averageLoadingTime*q)}get _seamlessTransitionEnabled(){return null!=this._overrideTransitionEnabled?this._overrideTransitionEnabled:F}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get elevationInfo(){return this.layer.elevationInfo??$}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:A(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return b(this.surface.spatialReference)}get layer(){return this.layerView.layer}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&this.renderedTiles.size>0}getUpdating(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this.getUpdating()}get visibleAtCurrentScale(){return!X()||K(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=L(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&k(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this._loadingState="ready-to-load"}_update(e){const t=c(e.time);this._lastResources?.hasFadedOut(t)&&this._lastResources.detach();const i=this._nextStateForTransition(t);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==i||!this.loadRequirementsMet)return void(this._loadingState=i);this._loadingState="loading";const r=async()=>{const e=performance.now(),i=this._seamlessTransitionEnabled&&null!=this._resources?h(t+this._seamlessTransitionWaitingTime):t;await this._load(this.renderedTiles,i);const r=h((performance.now()-e)/1e3);this._updateAverageLoadingTime(r)};this.updatingHandles.addPromise(o(r())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=V;this._averageLoadingTime=h(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e,t){if(!this._visible)return this.clear(),void(this._loadingState="ready-to-load");const i=this._computeExtent(e);if(0===e.size||null==i)return void(this._loadingState="ready-to-load");const r=new B(i,this.layerView.timeExtent,this._viewSizeWithEqualRatio(i),this.view.state.contentPixelRatio,t);null==this._abortController&&(this._abortController=new AbortController);const s=this._abortController,o=await this._loadStreamlines(r,s.signal);if(a(s.signal),this._visible&&null!=o){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=o;const e=performance.now()/1e3,i=e>t?e:t;null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,await o.attach(),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new D(e,i,s,r,this.layerView):new O(e,i,s,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new J(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:o,view:a}=this;function*l(l){for(let n=0;n<t.length;++n)r.push(G(a,e,t[n],s,i,o)),l.madeProgress(),l.done&&(l=yield)}return await this.frameTask.scheduleGenerator(l),{geometries:r,material:i}}_computeExtent(e){const{spatialReference:t}=this.surface;if(null==t)return null;const i=H(e,this.spatialReferenceInfo);return null==i?null:(w(i,this._clippingArea,i),T(i,t))}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(o(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r}=this;if(this.loadAllTiles)return t=>t.leaf&&ee(e,t.extent);const s=t=>t.rendered&&t.visible&&ee(e,t.extent),{featureTiles:o}=i;if(!o)return s;const a=o.tiles.filter(e=>e.measures.visible);return e=>s(e)&&ee(r,e.extent)&&a.some(({lij:i})=>t(i,e.lij)||N(i,e.lij))}_viewSizeWithEqualRatio(e){const t=C(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;return i<r?[i,Math.floor(i/t)]:[Math.floor(r*t),r]}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+E?"transitioning":"ready-to-load"}get test(){}};e([g()],Z.prototype,"type",void 0),e([g()],Z.prototype,"renderedTiles",void 0),e([g()],Z.prototype,"_resources",void 0),e([g()],Z.prototype,"_lastResources",void 0),e([g()],Z.prototype,"requireLoad",void 0),e([g()],Z.prototype,"_averageLoadingTime",void 0),e([g()],Z.prototype,"_loadingState",void 0),e([g()],Z.prototype,"emissiveStrength",void 0),e([g()],Z.prototype,"_clippingArea",null),e([g()],Z.prototype,"_dataBounds",null),e([g()],Z.prototype,"_draped",null),e([g()],Z.prototype,"_ellipsoidRadius",null),e([g()],Z.prototype,"loadAllTiles",null),e([g()],Z.prototype,"_featureTilesBounds",null),e([g()],Z.prototype,"_flowRenderer",null),e([g()],Z.prototype,"_materialParameters",null),e([g()],Z.prototype,"_opacity",null),e([g()],Z.prototype,"_seamlessTransitionWaitingTime",null),e([g()],Z.prototype,"_seamlessTransitionEnabled",null),e([g()],Z.prototype,"_visible",null),e([g()],Z.prototype,"elevationInfo",null),e([g()],Z.prototype,"needsMagnitude",null),e([g()],Z.prototype,"spatialReferenceInfo",null),e([g()],Z.prototype,"layer",null),e([g()],Z.prototype,"loadingState",null),e([g()],Z.prototype,"updating",null),e([g()],Z.prototype,"visibleAtCurrentScale",null),e([g()],Z.prototype,"_overrideMaterialParameters",void 0),e([g()],Z.prototype,"_overrideSimulationSettings",void 0),e([g()],Z.prototype,"_overrideTransitionEnabled",void 0),e([g()],Z.prototype,"_simulationSettings",null),e([g()],Z.prototype,"surface",null),Z=e([_("esri.views.3d.layers.FlowSubView3D")],Z);const $=new R({mode:"on-the-ground"});function ee(e,t){return null==e||null==t||S(e,t)}export{Z as default};
|