@arcgis/core 5.1.0-next.73 → 5.1.0-next.75
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/Viewpoint.js +1 -1
- package/applications/Urban/editingSessionUtils.d.ts +95 -0
- package/applications/Urban/editingSessionUtils.js +2 -0
- package/arcade/ArcadePortal.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/functions/aiServices.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade/portalUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d17fcfc502f0e0fa6523.js → 003476e950bd27a2f884.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a664451845a47048859.js → 0539b5d015157c1d34a0.js} +1 -1
- package/assets/esri/core/workers/chunks/07aca5ecad659d55e795.js +2 -0
- package/assets/esri/core/workers/chunks/{5a4d7ba6dc1d4b41d80d.js → 07eff82916681fcff069.js} +1 -1
- package/assets/esri/core/workers/chunks/09630888267cde87654f.js +1 -0
- package/assets/esri/core/workers/chunks/{8a14e3db28c403b046cf.js → 0d2bc1be5802681666a4.js} +1 -1
- package/assets/esri/core/workers/chunks/0eed2b1b06355ab89013.js +1 -0
- package/assets/esri/core/workers/chunks/0fa207c68dfd7ddee160.js +1 -0
- package/assets/esri/core/workers/chunks/146424b5717d0a645ee1.js +1 -0
- package/assets/esri/core/workers/chunks/{cfe246adb5e6cb6f0cfc.js → 14eb2cc8e2ad6d8d03fd.js} +1 -1
- package/assets/esri/core/workers/chunks/1765dfeac20e34ce25b7.js +1 -0
- package/assets/esri/core/workers/chunks/176dd195f77b98cb0b0f.js +1 -0
- package/assets/esri/core/workers/chunks/18f77ee3552d92962f15.js +1 -0
- package/assets/esri/core/workers/chunks/1906416c84bab369bbd6.js +1 -0
- package/assets/esri/core/workers/chunks/1a87e9bbd85ba29b1514.js +1 -0
- package/assets/esri/core/workers/chunks/{b98c24229463029504e8.js → 1f6b7626f333809837ef.js} +1 -1
- package/assets/esri/core/workers/chunks/{b54b7cc6b23a70fed700.js → 1f8ccf96069ac3a40c3d.js} +1 -1
- package/assets/esri/core/workers/chunks/1ff3c15a51c4dc991806.js +1 -0
- package/assets/esri/core/workers/chunks/{cdf6ad970dc1893dac58.js → 24646a1176ce34039155.js} +1 -1
- package/assets/esri/core/workers/chunks/2a2e97918524e0f436d7.js +1 -0
- package/assets/esri/core/workers/chunks/2b0b398180ed98c2c84c.js +1 -0
- package/assets/esri/core/workers/chunks/{03894992558d063d0d5e.js → 312036c89a6a09bb06c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{80ace1c7203c5059525d.js → 330b47ac0759c3c35cc5.js} +1 -1
- package/assets/esri/core/workers/chunks/34b6b5dd415c68f0b0d1.js +1 -0
- package/assets/esri/core/workers/chunks/{422824e407b550170c8c.js → 34ea3ed78041437a8fc8.js} +1 -1
- package/assets/esri/core/workers/chunks/{93ceb74ac88ef460fe5f.js → 359d3acb3953e64e5a78.js} +1 -1
- package/assets/esri/core/workers/chunks/384c235d36f32769e32b.js +1 -0
- package/assets/esri/core/workers/chunks/3a183259805638c25363.js +1 -0
- package/assets/esri/core/workers/chunks/{0839da55707f7c4cf780.js → 3b9100c59a8050f4834e.js} +1 -1
- package/assets/esri/core/workers/chunks/{deaca3cd202851ecf9c2.js → 3cce9dad8ee0e4971d50.js} +1 -1
- package/assets/esri/core/workers/chunks/3efbb684c0409955186d.js +1 -0
- package/assets/esri/core/workers/chunks/40d251b6b42a41d68bd2.js +1 -0
- package/assets/esri/core/workers/chunks/42336e0d1ef88737b078.js +1 -0
- package/assets/esri/core/workers/chunks/452c01cecbbd1e370098.js +1 -0
- package/assets/esri/core/workers/chunks/47656ec12401e53f4bd3.js +1 -0
- package/assets/esri/core/workers/chunks/47b3a5213539548ff3a6.js +1 -0
- package/assets/esri/core/workers/chunks/{260d4571722cb1ff1366.js → 484d6c1b0fe1633515b7.js} +1 -1
- package/assets/esri/core/workers/chunks/4a23b27bfbcfa08fd9a7.js +1 -0
- package/assets/esri/core/workers/chunks/4c97cc922eece3a91b6b.js +1 -0
- package/assets/esri/core/workers/chunks/52b3a11c962810bc6dbe.js +1 -0
- package/assets/esri/core/workers/chunks/53750e85f3128993a43a.js +1 -0
- package/assets/esri/core/workers/chunks/{f207b3be0714cc50030a.js → 537fe2522dff1e6ce03b.js} +1 -1
- package/assets/esri/core/workers/chunks/{656d6963e8f837fbf28f.js → 54023458195549f66215.js} +1 -1
- package/assets/esri/core/workers/chunks/55fd201ca5e10c6e4761.js +1 -0
- package/assets/esri/core/workers/chunks/56941e8bbd2d49bf2656.js +1 -0
- package/assets/esri/core/workers/chunks/{faad127dc07e54e7f6d1.js → 5abe34bb0110694f7b42.js} +1 -1
- package/assets/esri/core/workers/chunks/5d8e944b192aad4cf986.js +1 -0
- package/assets/esri/core/workers/chunks/{a78bc340a794fd332667.js → 5e1b847b116d21908a54.js} +1 -1
- package/assets/esri/core/workers/chunks/5ed8d8b5336c81fbcda3.js +1 -0
- package/assets/esri/core/workers/chunks/60915a3708a34da1977e.js +1 -0
- package/assets/esri/core/workers/chunks/6124141ac642e4ce1454.js +1 -0
- package/assets/esri/core/workers/chunks/61c523dd9d8027922465.js +1 -0
- package/assets/esri/core/workers/chunks/65c61171e6c6be5c5c2f.js +1 -0
- package/assets/esri/core/workers/chunks/6a3d207308b29651f397.js +1 -0
- package/assets/esri/core/workers/chunks/{b6cadb8a579241adcb86.js → 6b66fc32451433129a88.js} +1 -1
- package/assets/esri/core/workers/chunks/6c35583707f5c339ee99.js +1 -0
- package/assets/esri/core/workers/chunks/6f7aaba26773fe416ac2.js +1 -0
- package/assets/esri/core/workers/chunks/702e8468836863abd81b.js +1 -0
- package/assets/esri/core/workers/chunks/7540f7df86620f067b5a.js +1 -0
- package/assets/esri/core/workers/chunks/{9f4b97204def91567e3c.js → 7595ceba529ed01c7590.js} +1 -1
- package/assets/esri/core/workers/chunks/75d5ea0da181f9e7425f.js +1312 -0
- package/assets/esri/core/workers/chunks/{af75e91b88e747aa76ac.js → 7601278ebced0c0c31cf.js} +1 -1
- package/assets/esri/core/workers/chunks/76e34f81bb4a7b0e694c.js +1 -0
- package/assets/esri/core/workers/chunks/{1661684357912726a72a.js → 77dd719516138afb1a2a.js} +1 -1
- package/assets/esri/core/workers/chunks/7b6c8be59ed87e386aa4.js +1 -0
- package/assets/esri/core/workers/chunks/7c820c5f6f05480d5050.js +1 -0
- package/assets/esri/core/workers/chunks/{ce2aa75e084ee56f5e29.js → 7f55eef696e9ed717bfc.js} +1 -1
- package/assets/esri/core/workers/chunks/80f4f686ce403cb2693f.js +1 -0
- package/assets/esri/core/workers/chunks/852f4cd514008fee5a55.js +1 -0
- package/assets/esri/core/workers/chunks/85aac8539996372f1ee8.js +1 -0
- package/assets/esri/core/workers/chunks/{50d5d6654ada9f28345d.js → 85e65ced3312bf9cf162.js} +1 -1
- package/assets/esri/core/workers/chunks/8a3bff0f58483c1665f9.js +1 -0
- package/assets/esri/core/workers/chunks/8b046e28f879079caada.js +1 -0
- package/assets/esri/core/workers/chunks/8d738e9acc2f222235ea.js +1 -0
- package/assets/esri/core/workers/chunks/{b9848bdbaf3d9ac93d54.js → 8f4cd30ce23e41c1a42c.js} +1 -1
- package/assets/esri/core/workers/chunks/9103eb0b9078019d3a26.js +1 -0
- package/assets/esri/core/workers/chunks/915e2711d3a2cfa402b2.js +1 -0
- package/assets/esri/core/workers/chunks/91f9e0e3662d4bf9f163.js +1 -0
- package/assets/esri/core/workers/chunks/983f6c8727fd9484718e.js +1 -0
- package/assets/esri/core/workers/chunks/99c161fecae710b53b40.js +1 -0
- package/assets/esri/core/workers/chunks/99d298d0039c536fcf3e.js +1 -0
- package/assets/esri/core/workers/chunks/9a5ef33d99a8f89956ff.js +1 -0
- package/assets/esri/core/workers/chunks/9d10db72e342fe63c981.js +1 -0
- package/assets/esri/core/workers/chunks/{bef27a25fbc4a6e19ec0.js → 9d6491f996eeb0c646ed.js} +1 -1
- package/assets/esri/core/workers/chunks/a015c2f54eb91e43a1f4.js +1 -0
- package/assets/esri/core/workers/chunks/a242ec19a7508de436da.js +1 -0
- package/assets/esri/core/workers/chunks/a320998f18922a35899f.js +1 -0
- package/assets/esri/core/workers/chunks/a7f9f478bd1493fc3c76.js +1 -0
- package/assets/esri/core/workers/chunks/aac6a57edd7494125204.js +1 -0
- package/assets/esri/core/workers/chunks/b73c146d3e550eaf07eb.js +1 -0
- package/assets/esri/core/workers/chunks/b7af0e6b9aadbcaf6a0b.js +1 -0
- package/assets/esri/core/workers/chunks/b803e7b0d489bb628d72.js +1 -0
- package/assets/esri/core/workers/chunks/b858adff7043683fe41c.js +1 -0
- package/assets/esri/core/workers/chunks/baeb96aef03d4c566af7.js +1 -0
- package/assets/esri/core/workers/chunks/bc75ab48f4c7609ef09d.js +1 -0
- package/assets/esri/core/workers/chunks/bc78937986854e500b8e.js +1 -0
- package/assets/esri/core/workers/chunks/{6ef3b8d67b498d655a99.js → bcb021a167580bb1619f.js} +1 -1
- package/assets/esri/core/workers/chunks/bd10d21545bca9a49de0.js +1 -0
- package/assets/esri/core/workers/chunks/bec3ee5ea945e1e07a35.js +1 -0
- package/assets/esri/core/workers/chunks/{5c663d5f98bdfa29151b.js → bf8f603848bad4a7deb4.js} +1 -1
- package/assets/esri/core/workers/chunks/bfe575da727ce7c8d331.js +2 -0
- package/assets/esri/core/workers/chunks/c31ee5617c61a933cb0e.js +1 -0
- package/assets/esri/core/workers/chunks/cb45e5d4a4ef82cda583.js +1 -0
- package/assets/esri/core/workers/chunks/ce7ef7c4ca14d66d96f6.js +1 -0
- package/assets/esri/core/workers/chunks/{f5c57ff48ca505ed701d.js → cf14b3a44705dacefac4.js} +1 -1
- package/assets/esri/core/workers/chunks/d1a7d13e1d48abcd7bf1.js +1 -0
- package/assets/esri/core/workers/chunks/{06df187a116709f69952.js → d35c475f004367e333eb.js} +1 -1
- package/assets/esri/core/workers/chunks/d3b086eb9aa8c7d09048.js +1 -0
- package/assets/esri/core/workers/chunks/d55cef8199b8246fea3f.js +1 -0
- package/assets/esri/core/workers/chunks/d82da31dc702b8fd6a07.js +1 -0
- package/assets/esri/core/workers/chunks/d8decaee2c780e1b5e35.js +1 -0
- package/assets/esri/core/workers/chunks/{41809c16544ec25120fa.js → d95ffd990b3a7df69e1e.js} +1 -1
- package/assets/esri/core/workers/chunks/dc54d4a9fe1691862356.js +1 -0
- package/assets/esri/core/workers/chunks/dd4f431511edd975a53b.js +1 -0
- package/assets/esri/core/workers/chunks/dda2cb5c073d1e65f14f.js +1 -0
- package/assets/esri/core/workers/chunks/e18badd11f360cc2912b.js +1 -0
- package/assets/esri/core/workers/chunks/{e25a684eb9f025bdcc01.js → e262c4864dc06c43b380.js} +1 -1
- package/assets/esri/core/workers/chunks/e610d24539a675fb054b.js +1 -0
- package/assets/esri/core/workers/chunks/{99101789035f1787c630.js → e785f76c1a75cb1d1e1f.js} +1 -1
- package/assets/esri/core/workers/chunks/e9c5c295b6bf10e942a4.js +1 -0
- package/assets/esri/core/workers/chunks/ea59b81299acaf0d85ee.js +1 -0
- package/assets/esri/core/workers/chunks/{873c1b705ac3d4e6c384.js → ea97619a4470f1540b99.js} +1 -1
- package/assets/esri/core/workers/chunks/eaab5ac049622986e3bc.js +1 -0
- package/assets/esri/core/workers/chunks/edee616b6f1b5be8fd39.js +1 -0
- package/assets/esri/core/workers/chunks/ef0085aa743b33cb549f.js +1 -0
- package/assets/esri/core/workers/chunks/f0250cecb243b32cdba7.js +1 -0
- package/assets/esri/core/workers/chunks/f518835b2dc89a48cfb1.js +1 -0
- package/assets/esri/core/workers/chunks/f590b60fca607d66001a.js +1 -0
- package/assets/esri/core/workers/chunks/{f6d047358d14328f3622.js → f60292d97bcdbf19165b.js} +1 -1
- package/assets/esri/core/workers/chunks/f6c8e93ca2987e83f925.js +1 -0
- package/assets/esri/core/workers/chunks/fb5a2205f05afc396119.js +1 -0
- package/assets/esri/themes/base/widgets/_Sketch.scss +32 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/SpatialReference.js +1 -1
- package/chunks/aiServices.js +1 -1
- package/chunks/geometryEngineBase.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/workers/registry.js +1 -1
- package/form/elements/AttachmentElement.d.ts +15 -16
- package/form/elements/FieldElement.js +1 -1
- package/form/elements/GroupElement.d.ts +3 -2
- package/form/elements/inputs/attachments/AttachmentInput.d.ts +7 -9
- package/form/elements/inputs/attachments/AudioInput.d.ts +6 -8
- package/form/elements/inputs/attachments/DocumentInput.d.ts +5 -7
- package/form/elements/inputs/attachments/ImageInput.d.ts +6 -8
- package/form/elements/inputs/attachments/Input.d.ts +2 -6
- package/form/elements/inputs/attachments/SignatureInput.d.ts +5 -7
- package/form/elements/inputs/attachments/VideoInput.d.ts +6 -8
- package/form/elements/inputs/attachments/types.d.ts +3 -3
- package/geometry/FlatGeometry.js +1 -1
- package/geometry/geometryEngine.js +1 -1
- package/geometry/geometryEngineJSON.js +1 -1
- package/geometry/operators/projectOperator.d.ts +5 -4
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/geometry/support/normalizeUtils.js +1 -1
- package/geometry/support/normalizeUtilsCommon.js +1 -1
- package/graphic/ImageryGraphicOrigin.js +1 -1
- package/graphic/ImageryTileGraphicOrigin.js +1 -1
- package/graphic/WCSGraphicOrigin.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/support/SymbolLayerDrawing.d.ts +18 -4
- package/package.json +4 -4
- package/popup/Features.d.ts +9 -9
- package/popup/Features.js +1 -1
- package/popup/actionUtils.js +1 -1
- package/popup/actions.js +1 -1
- package/portal/Portal.js +1 -1
- package/portal/PortalQueryParams.js +1 -1
- package/rest/print.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/DimensionController.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/PinchAndPanNavigation.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/state/GoToOperation.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/support/cameraScaleUtils.js +2 -0
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/renderInfoUtils/line.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +13 -12
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/SceneView.d.ts +1 -0
- package/views/VideoView.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/editingSessionUtils.js +2 -0
- package/views/draw/support/managers/MeasurementManager.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +9 -1
- package/views/interactive/snapping/SelfSnappingEngine.js +1 -1
- package/views/support/GeometryWorker.js +2 -0
- package/views/support/GeometryWorkerHandle.js +2 -0
- package/views/support/Scheduler.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.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/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -3
- package/widgets/FeatureTable/Grid/GridViewModel.d.ts +2 -11
- package/widgets/FeatureTable/support/types.d.ts +2 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +28 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
- package/widgets/OrientedImageryViewer.d.ts +27 -0
- package/widgets/Sketch/SketchViewModel.d.ts +10 -2
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/00bae4b7e179336e0362.js +0 -1
- package/assets/esri/core/workers/chunks/027c3ea756db68e51f0a.js +0 -1
- package/assets/esri/core/workers/chunks/041c372e98a6fba90b36.js +0 -1
- package/assets/esri/core/workers/chunks/0783890816bac45277b9.js +0 -1
- package/assets/esri/core/workers/chunks/07aac6245a0d1adbb2d4.js +0 -1
- package/assets/esri/core/workers/chunks/0c00e5e4bd18467bcecd.js +0 -1
- package/assets/esri/core/workers/chunks/0dad0bca8d58b2c63d22.js +0 -1
- package/assets/esri/core/workers/chunks/0ef93722524620023f69.js +0 -1
- package/assets/esri/core/workers/chunks/1286f41f245ef22b3a26.js +0 -1
- package/assets/esri/core/workers/chunks/12e575a6d2b008b8fc2b.js +0 -1
- package/assets/esri/core/workers/chunks/161d60fdac2013c15543.js +0 -1
- package/assets/esri/core/workers/chunks/168de44a789d1cecc1f8.js +0 -1
- package/assets/esri/core/workers/chunks/1d9d7915cf7449e5d468.js +0 -1
- package/assets/esri/core/workers/chunks/235cb82952a18ff8d206.js +0 -1
- package/assets/esri/core/workers/chunks/266ba61b72a278d93a26.js +0 -1
- package/assets/esri/core/workers/chunks/27b80c386cebadcaca3c.js +0 -1
- package/assets/esri/core/workers/chunks/29d3890a5a43d934067a.js +0 -1
- package/assets/esri/core/workers/chunks/29e76256e3e867e80520.js +0 -1
- package/assets/esri/core/workers/chunks/2abf124e2956e4f76688.js +0 -1
- package/assets/esri/core/workers/chunks/2f17438d215bea3ce70f.js +0 -1
- package/assets/esri/core/workers/chunks/30f04dc001eaf838d64c.js +0 -1
- package/assets/esri/core/workers/chunks/356cb86606b8c674f947.js +0 -1
- package/assets/esri/core/workers/chunks/398e0dd2bc7e1ab84831.js +0 -1
- package/assets/esri/core/workers/chunks/3b1052aa30af3f6186cc.js +0 -1
- package/assets/esri/core/workers/chunks/3e87e3ad857d72f6ecbb.js +0 -1
- package/assets/esri/core/workers/chunks/42e483fde18f12da32a6.js +0 -1
- package/assets/esri/core/workers/chunks/43678e08a3d9d51c2a6d.js +0 -1
- package/assets/esri/core/workers/chunks/43ab44d37bc0ea97ef98.js +0 -1
- package/assets/esri/core/workers/chunks/47f2113357b2aa4f4f37.js +0 -1
- package/assets/esri/core/workers/chunks/488ed9584b527ec47be3.js +0 -1
- package/assets/esri/core/workers/chunks/4ad32580e0c0699fde1f.js +0 -1
- package/assets/esri/core/workers/chunks/54ed37ec9682ea739deb.js +0 -1
- package/assets/esri/core/workers/chunks/55369c5bd65bcaf78da1.js +0 -1
- package/assets/esri/core/workers/chunks/56fd3da911c2c4511e5d.js +0 -1
- package/assets/esri/core/workers/chunks/59592bb25f226865e88a.js +0 -1
- package/assets/esri/core/workers/chunks/5a83ea967ecde01d5622.js +0 -1
- package/assets/esri/core/workers/chunks/5b278b9980752ef495a2.js +0 -1
- package/assets/esri/core/workers/chunks/5d55b4449bcb24cd72b6.js +0 -1
- package/assets/esri/core/workers/chunks/5d8fe41a3c06ddb4094b.js +0 -1
- package/assets/esri/core/workers/chunks/5e59ff96aecdf2adcb3b.js +0 -1
- package/assets/esri/core/workers/chunks/608d707fd9d9f9088473.js +0 -1
- package/assets/esri/core/workers/chunks/6a21c9a4aeebe806ea39.js +0 -1
- package/assets/esri/core/workers/chunks/6c7ff968bd4fc816442d.js +0 -1
- package/assets/esri/core/workers/chunks/6d11ec355e5474b2968b.js +0 -1
- package/assets/esri/core/workers/chunks/6ea8b0d68881d16a2432.js +0 -1
- package/assets/esri/core/workers/chunks/7027d93dc5a4595d70c6.js +0 -1
- package/assets/esri/core/workers/chunks/70b35b2446558d5280e3.js +0 -1
- package/assets/esri/core/workers/chunks/7349cb45a93e6916f115.js +0 -1
- package/assets/esri/core/workers/chunks/74be994d789c57031631.js +0 -1
- package/assets/esri/core/workers/chunks/76edaeaf8fe344bb77a8.js +0 -1
- package/assets/esri/core/workers/chunks/76fe5b821d6b54db5721.js +0 -1
- package/assets/esri/core/workers/chunks/770880ad43f252962017.js +0 -1
- package/assets/esri/core/workers/chunks/7951d93f5f15aa76f49c.js +0 -1
- package/assets/esri/core/workers/chunks/7a56c836c89a8b978800.js +0 -1
- package/assets/esri/core/workers/chunks/81750c5177d8d52a3e05.js +0 -1
- package/assets/esri/core/workers/chunks/81d30c9062ad0120a863.js +0 -1
- package/assets/esri/core/workers/chunks/84772b023d04e415f17f.js +0 -1
- package/assets/esri/core/workers/chunks/88c5f7c712c6b89b5109.js +0 -1
- package/assets/esri/core/workers/chunks/88e469b82d2594f23649.js +0 -1
- package/assets/esri/core/workers/chunks/8a8242e7cc7e6a9e7876.js +0 -1
- package/assets/esri/core/workers/chunks/9444ed8ea117861ae89b.js +0 -1
- package/assets/esri/core/workers/chunks/9a38fd68b02b617c45d3.js +0 -1
- package/assets/esri/core/workers/chunks/9eb4ae556950e1d0124d.js +0 -2
- package/assets/esri/core/workers/chunks/a11f05ddd8314b648f76.js +0 -1
- package/assets/esri/core/workers/chunks/a37c28e3c4a2be9fd1d5.js +0 -1
- package/assets/esri/core/workers/chunks/a8d7f59927bdad564141.js +0 -1
- package/assets/esri/core/workers/chunks/a94bd20551c1179c7ec5.js +0 -1
- package/assets/esri/core/workers/chunks/abe22ae8ee0dcc9efbb7.js +0 -1
- package/assets/esri/core/workers/chunks/af5db0372d526e592fcc.js +0 -1
- package/assets/esri/core/workers/chunks/b702279c48f3009f6dd8.js +0 -1
- package/assets/esri/core/workers/chunks/bc53ce9a643f82d516c2.js +0 -1
- package/assets/esri/core/workers/chunks/bc887bd62579dba81e2b.js +0 -1
- package/assets/esri/core/workers/chunks/be1d6a571f76933dfbb0.js +0 -1
- package/assets/esri/core/workers/chunks/bfcdc5c315131aae34d8.js +0 -1
- package/assets/esri/core/workers/chunks/c0f624a2ca0d07ef8f8c.js +0 -1
- package/assets/esri/core/workers/chunks/c327fe276238af60fda4.js +0 -1
- package/assets/esri/core/workers/chunks/c3381b9a36299210ee47.js +0 -1
- package/assets/esri/core/workers/chunks/cb5e4b9b4a59c2622eb5.js +0 -1
- package/assets/esri/core/workers/chunks/d201a5dff18a5bb467ab.js +0 -1
- package/assets/esri/core/workers/chunks/d21fdd67477800101f3b.js +0 -1
- package/assets/esri/core/workers/chunks/d65b1234867f7d773d50.js +0 -2
- package/assets/esri/core/workers/chunks/d8d7331600d93bbca2b4.js +0 -1
- package/assets/esri/core/workers/chunks/db588bf3256e95c977b7.js +0 -1
- package/assets/esri/core/workers/chunks/dfdd474fddcd1d6091ce.js +0 -1
- package/assets/esri/core/workers/chunks/e1bc9ad767e08dc18bbc.js +0 -1
- package/assets/esri/core/workers/chunks/e235ea4293d5d463acfb.js +0 -1
- package/assets/esri/core/workers/chunks/e272411e2c9378aa8496.js +0 -1312
- package/assets/esri/core/workers/chunks/e43486113aaf72ac4dc1.js +0 -1
- package/assets/esri/core/workers/chunks/ea4c3393c5757e309a71.js +0 -1
- package/assets/esri/core/workers/chunks/ed216ddeb7f59f510bd0.js +0 -1
- package/assets/esri/core/workers/chunks/ef8886dff54063928bcb.js +0 -1
- package/assets/esri/core/workers/chunks/f43a63094190d2074cd0.js +0 -1
- package/assets/esri/core/workers/chunks/f5223ffb3be548c9b0a1.js +0 -1
- package/assets/esri/core/workers/chunks/fa160a2a5dc9f5a7c34b.js +0 -1
- package/geometry/support/triangulationUtilsDeprecated.js +0 -2
- package/views/3d/layers/graphics/extrudeUtilsDeprecated.js +0 -2
- package/views/3d/support/renderInfoUtils/polygonDeprecated.js +0 -2
- package/views/support/MeasurementWorker.js +0 -2
- package/views/support/MeasurementWorkerHandle.js +0 -2
- /package/assets/esri/core/workers/chunks/{9eb4ae556950e1d0124d.js.LICENSE.txt → 07aca5ecad659d55e795.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d65b1234867f7d773d50.js.LICENSE.txt → bfe575da727ce7c8d331.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{result as e,createTask as t}from"../../../../core/asyncUtils.js";import r from"../../../../core/Error.js";import{clone as i}from"../../../../core/lang.js";import{abortMaybe as s,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as o,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{pt2px as l,px2pt as c}from"../../../../core/screenUtils.js";import{numericHash as h}from"../../../../core/string.js";import{dataComponents as u}from"../../../../core/urlUtils.js";import{fromValues as m,fromArray as d,create as p,ONES as _}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as f,fromValues as y,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x,ZEROS as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as b}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as S}from"../../../../geometry/support/aaBoundingBox.js";import P from"../../../../layers/support/FieldsIndex.js";import{createRendererExpression as z}from"../../../../support/ArcadeExpression.js";import{CIMSymbolHelper as w}from"../../../../symbols/cim/CIMSymbolHelper.js";import{evaluateValueOrFunction as C}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as O}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultIconPrimitive as M}from"../../../../symbols/support/primitives.js";import R from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as I}from"../../../../symbols/support/utils.js";import{transparentUnit as j}from"./constants.js";import{perObjectElevationAligner as E}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as U,needsElevationUpdates2D as F}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as T}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as V}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as D}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as G}from"./graphicUtils.js";import{namedAnchorToHUDMaterialAnchorPos as A}from"./placementUtils.js";import{placePointOnGeometry as L,updateStageObjectGeometry as H,getLocalOriginForPoint as k,extendPointGraphicElevationContext as B,createStageObject as N}from"./pointUtils.js";import{hasTransparencyModeSymbol as $}from"./transparencyUtils.js";import{initFastSymbolUpdatesState as q,updateFastSymbolUpdatesState as J,evaluateModelTransformScale as Z,ConvertOptions as W}from"../support/FastSymbolUpdates.js";import{createTexture as K,requiresHalfTexelOffset as Q,defaultBoundingBox as X,defaultSymbolSizeRatio as Y,defaultTexSize as ee}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as te}from"../../terrain/OverlayRenderer.js";import{VerticalOffsetParameters as re}from"../../webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{createPointGeometry as ie}from"../../webgl-engine/lib/GeometryUtil.js";import{ManagedTexture as se}from"../../webgl-engine/lib/ManagedTexture.js";import{RenderGeometry as ae}from"../../webgl-engine/lib/RenderGeometry.js";import{HUDMaterial as oe}from"../../webgl-engine/materials/HUDMaterial.js";var ne;const le=y(0,0,1),ce=16,he=1.5,ue=[ee*Y,ee*Y];class me extends D{static{ne=$}static{this.PRIMITIVE_SIZE=ue}getCachedSize(){return{size:this._getIconSize()}}static{this.elevationModeChangeTypes={definedChanged:1,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,xe(t)),this._cimData=null,this._overrideHelperClass=null,this._arcadeInfo=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimScaleFactorOrFunction=null,this._size=[1,1],this._symbolTextureRatio=1,this._outlineSize=0,this._textureHandle=null,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0},this[ne]=!0}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=I(this.symbolLayer),i=_e(r);null!=i?await this._prepareResourcesCIM(t,JSON.parse(i),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=G(this._getIconSize());if(e)throw new r("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?l(e.size):ce);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e,t){const r=this._overrideHelperClass;let s=this._cimData;if(r&&s&&s.symbol||this.logger.error("Can't create texture, CIM data is undefined"),s.primitiveOverrides){s=i(s);const a=s.primitiveOverrides;r.evaluateOverrides(a,e,this._arcadeInfo.geometryType,null,null,t.layer.fieldsIndex),r.applyOverrides(s.symbol,a)}const a=h(JSON.stringify(s));let o=this._cimSymbolTextures.get(a);if(o)return o;const n=this._context.sharedResources.cimSymbolRasterizer,l=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;l&&r.applyDictionaryTextOverrides(s.symbol,e,l,null);const c=null!=this._cimScaleFactorOrFunction?C(this._cimScaleFactorOrFunction,e):1;1!==c&&s.symbol&&O(s.symbol,c,!0);const u=w.getEnvelope(s,null,n.resourceManager);if(u?.width&&u.height){const e=u.x+u.width/2,t=u.y+u.height/2,r=n.rasterize({type:"cim",data:s},u.width,u.height,e,t,1,"esriGeometryPoint",0,null,this._context.graphicsCoreOwner.view.state.rasterPixelRatio),i=new R({x:-u.x/u.width-.5,y:(u.height+u.y)/u.height-.5});this._cimMaterialParametersInfo.anchorPosition=fe("relative",i),o=new se(r,{width:r?.width??1,height:r?.height??1,reloadable:!0})}else o=new se(new ImageData(1,1),{width:1,height:1,reloadable:!0});return this._cimSymbolTextures.set(a,o),this._context.stage.addTexture(o),o}_prepareMaterialParameters(){const{symbolLayer:e,symbol:t,_context:r,_drivenProperties:i,view:s}=this,a=this.symbolLayer.occludedVisibility?.mode??"hidden";return{anchorPosition:fe(e.anchor,e.anchorPosition),rotation:e.angle,hasRotation:0!==e.angle||i.rotation,hasVertexRotation:i.rotation,occludedFragmentOpacity:"hidden"!==a?s.state.ensureOccludedFragmentOpacity():void 0,hasSlicePlane:r.slicePlaneEnabled,verticalOffset:de(t)?new re(t.verticalOffset):void 0,screenSizePerspective:r.screenSizePerspectiveEnabled?s.screenSizePerspective.parameters:void 0}}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(pe(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,()=>K(t));this._textureHandle=r,e.textureId=r.managedTexture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=Q(t),e.distanceFieldBoundingBox=X;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/Y,e.size=m(i*this._symbolTextureRatio,i*this._symbolTextureRatio),this._createMaterial(e)}async _prepareResourcesHref(t,i,s){this._outlineSize=this._getOutlineSize(),t.color=this._getFillColor(),t.outlineColor=this._getOutlineColor(),t.outlineSize=this._outlineSize,t.textureIsSignedDistanceField=!1;const a=this._getIconSize(),n=a*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await e(this._context.sharedResources.textures.fromUrl(i,n,{signal:s}));if(!1===l.ok){o(l.error);throw new r("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${i})`)}this._textureHandle=l.value;const c=l.value.managedTexture;this._size=ye(c,a),t.size=d(this._size),t.textureId=c.id}this._createMaterial(t)}async _prepareResourcesCIM(e,t,r){const{OverrideHelper:i}=await import("../../../../symbols/cim/OverrideHelper.js");if(this._overrideHelperClass=i,this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;n(r),this._context.sharedResources.cimSymbolRasterizer??=new e(this._context.renderCoordsHelper.spatialReference)}const s=this._context.sharedResources.cimSymbolRasterizer,a=[],o=t,l=o?.symbol;w.fetchResources(l,s.resourceManager,a,r),w.fetchFonts(l,s.resourceManager,a);const c=this._context.layer.fields?this._context.layer.fields.map(e=>e.toJSON()):[],h=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:h,fields:c,geometryType:"esriGeometryPoint"},o?.primitiveOverrides&&a.push(i.createRenderExpressions(o.primitiveOverrides,this._arcadeInfo)),a.length>0&&(await Promise.all(a),n(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await z(t,this._context.layer.spatialReference),{default:i}=await import("../../../2d/arcade/callExpressionWithFeature.js"),s=new P(c);this._cimScaleFactorOrFunction=(e,t,a)=>{const o=i(r,e,{$view:a},"esriGeometryPoint",s,t);return null!==o?o:1}}}n(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return ge(this.symbolLayer)}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(l(t.outline.size),0);return e=pe(this._getPrimitive())?he:0,Math.max(e,0)}_getOutlineColor(){const e=this._getLayerOpacity(),t=this.symbolLayer,r=t?.outline?.color;if(null!=r){const t=r.toUnitRGB(),i=r.a*e;return[t[0],t[1],t[2],i]}return[0,0,0,0]}_getFillColor(){if(pe(this._getPrimitive()))return j;const e=null==this._getPrimitive(),t=this._materialColor;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}get _materialColor(){return this.symbolLayer.material?.color}get _fastVisualVariableFallbackColor(){const e=this._materialColor;if(null==e){return null==this._getPrimitive()?x:v}return e.toUnitRGBA()}_getFallbackSize(){const e=this._getIconSize(),{symbolLayer:{size:t}}=this;return(null!=t?Math.round(l(t)):ce)/e}_createMaterial(e){const t=this._context.spherical;if(this._cimData){this._fastUpdates=null;let r=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return r||(r=new oe(e,t),this._cimSymbolMaterials.set(e.textureId??0,r)),r}return this._fastUpdates=q(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),e.hasVertexColor=this._drivenProperties.color&&!this._fastUpdates?.visualVariables.color||this._drivenProperties.opacity&&!this._fastUpdates?.visualVariables.opacity,e.hasVertexSize=this._drivenProperties.size&&!this._fastUpdates?.visualVariables.size,e.focusAreaStyle=null,this._materials[0]=new oe(e,t),this._materials[1]=new oe(e,t,!0),e.focusAreaStyle=this._context.focusAreaStyle,this._materials[2]=new oe(e,t),this._materials[3]=new oe(e,t,!0),this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial(e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})}),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=s(this._patchTask),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach(e=>this._context.stage.removeTexture(e)),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor({size:e},t){if(!this._drivenProperties.size)return 1;if(null==e)return this._getFallbackSize();const[r,i,s]=e.output;return"symbol-value"===r?1:"number"==typeof r&&isFinite(r)?l(r)/t:"number"==typeof s&&isFinite(s)?l(s)/t:1}_getDrivenRotation(e){return this._drivenProperties.rotation?e.heading?.output??0:null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;const r=L(t.geometry);if(null==r)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;let i;const s=this.view.focusAreasView?.containsGeometry(r)??!0;if(this._cimData){if(!this._cimData.symbol)return null;const r=this._context.graphicsCoreOwner.view.state.rasterPixelRatio,a=this._generateTextureCIM(t,e),o={textureId:a.id,focusAreaStyle:s?null:this._context.focusAreaStyle,size:m(a.parameters.width/r,a.parameters.height/r),...this._cimMaterialParametersInfo};i=this._createMaterial(o)}else i=this._materials[s?0:2];if(null==r)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=null==this._getPrimitive(),o=e.renderingInfo,n=this._hasDrivenColorOrOpacity?this._getDrivenUInt8Color(o,this._materialColor,a):null,l=this._getDrivenRotation(o);let c=null;if(!this._fastUpdates?.visualVariables.size){const e=this._size,t=e[0]>e[1]?e[0]:e[1];c=this._getScaleFactor(o,t)}const h=null!=c?m(c,c):null,u=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus("on-the-ground"===u.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(o,r,i,n,l,h,t.uid):this._createAs3DShape(o,r,i,n,l,h,u,t.uid)}terrainTransparencyChanged(){return this.draped}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial(r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})})}layerScreenSizePerspectiveChanged(){const e=this._context.screenSizePerspectiveEnabled&&!this.draped?this.view.screenSizePerspective.parameters:null;this._forEachMaterial(t=>{t.setParameters({screenSizePerspective:e})})}updateTransparentMode(e,t){const r=e.stageObject.geometries[0]?.material,i=this._materials.indexOf(r)<2,s=t?i?1:3:i?0:2,a=this._materials[s];a&&a!==r&&e.updateMaterial(a)}updateGeometry(e,t){const r=e.geometry;if(this.draped||!r||!this._validateGeometry(r))return!1;const{elevationContext:i,stageObject:s}=t;if(i.mode!==this.getGeometryElevationMode(r))return!1;const a=L(r);if(!a)return!1;i.updateFeatureExpressionFeature(e,this._context.layer);const o=H(s,this._context,a,i);if(null==o)return!1;const n=k(this._context,a);return s.geometries[0].localOrigin===n&&(t.alignedSampledElevation=o,B(t,a,this._context.elevationProvider),!0)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=U(me.elevationModeChangeTypes,r,i);if(1!==s)return s;const a=F(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial(e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!J(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return 0;{const e=this._fastUpdates;this._materials.forEach(t=>t?.setParameters(e.materialParameters))}}return 2}get needsUpdateFocus(){return!0}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t),this._preparePatchRotation(e,t)}_preparePatchResource(i,l){if(!l.resource||"partial"!==l.resource.type)return;const c=l.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:u}=this._context.sharedResources;if(null==h||null==u||null!=_e(h))return;const m=this._getIconSize(),d=m*this._context.graphicsCoreOwner.view.state.pixelRatio;i.symbolLayerStatePatches.push(()=>{this._patchTask=s(this._patchTask),this._patchTask=t(t=>this._context.schedule(async(t,i)=>{const s=await e(u.fromUrl(h,d,{signal:i}));n(i);const l=!s.ok;if(l&&o(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,l){this._forEachMaterial(e=>{e.visible=!1,e.setParameters({textureId:null})});const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new r("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.managedTexture;this._size=ye(c,m),this._forEachMaterial(e=>{e.setParameters({textureId:c.id}),e.visible=!0})},t))}),delete c.href}_preparePatchRotation(e,t){if(!t.angle||"complete"!==t.angle.type)return;const r=t.angle.newValue??0,i=0!==r||this._drivenProperties.rotation;e.symbolLayerStatePatches.push(()=>{this._forEachMaterial(e=>e.setParameters({rotation:r,hasRotation:i}))}),delete t.angle}_defaultElevationInfoNoZ(){return ve}_createAs3DShape(e,t,r,i,s,a,o,n){const l=this.getFastUpdateAttrValues(e),c=this._context.layerViewUid,h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerViewUid:c}),u=ie(r,{normal:le,color:i,rotation:s,size:a,centerOffset:f,groundDistance:1,featureAttribute:l,olidColor:h}),m=N(this._context,t,u,o,n);if(null==m)return null;const d=new V(this,m.object,null,E,o);return d.setOccludedVisibilityMode(this.symbolLayer.occludedVisibility?.mode),d.hiddenIfDeconflicted=!0,d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=F(o.mode)||"absolute-height"===o.mode,d.getScreenSize=this._createScreenSizeGetter(a,l),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),B(d,t,this._context.elevationProvider),d}_createAsOverlay(e,t,r,i,s,a,o){r.renderPriority=this._renderPriority;const n=g();b(t,n,this._context.overlaySR),n[2]=te;const l=this._context.clippingExtent;if(null!=l&&!S(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=this._context.layerViewUid,u=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:h}),m=ie(r,{normal:le,position:n,color:i,rotation:s,size:a,featureAttribute:c,olidColor:u}),d=new ae(m,{layerViewUid:h,graphicUid:o}),p=new T(this,[d],null,this._context.drapeSourceRenderer);return p.getScreenSize=this._createScreenSizeGetter(a,c),p.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(p.getScreenSize(),1,e),p}_createScreenSizeGetter(e,t){e??=_;const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]*this._size[0],s=e[1]*this._size[1];return(e=p())=>{const[a,o]=Z(be,this._fastUpdates.materialParameters,t);return e[0]=a*i+r,e[1]=o*s+r,e}}const i=e[0]*this._size[0]+r,s=e[1]*this._size[1]+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=y(e,e,e),r=c(1),i=e*r,s=y(i,i,i),a=this._getFallbackSize();return new W({supports:{size:!0,color:!0,rotation:!0,opacity:!1},modelSize:t,symbolSize:s,unitInMeters:r,fallbackColor:this._fastVisualVariableFallbackColor,fallbackSize:y(a,a,a)})}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}}function de(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function pe(e){return null!=e&&("cross"===e||"x"===e)}function _e(e){const t=u(e);return"application/json"===t?.mediaType?t.data:void 0}function fe(e,t){return"relative"===e?m((t.x||0)+.5,.5-(t.y||0)):e in A?A[e]:A.center}function ye({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}function ge(e){return e.resource?.href?null:e.resource?.primitive??M}function xe(e){return 1===(e.material?.color?.a??0)&&null!=ge(e)}const ve={mode:"relative-to-ground",offset:0},be=g();export{me as Graphics3DIconSymbolLayer};
|
|
2
|
+
import{result as e,createTask as t}from"../../../../core/asyncUtils.js";import r from"../../../../core/Error.js";import{clone as i}from"../../../../core/lang.js";import{abortMaybe as s,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as o,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{pt2px as l,px2pt as c}from"../../../../core/screenUtils.js";import{numericHash as h}from"../../../../core/string.js";import{dataComponents as u}from"../../../../core/urlUtils.js";import{fromValues as m,fromArray as d,create as p,ONES as _}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as f,fromValues as y,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x,ZEROS as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as b}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as S}from"../../../../geometry/support/aaBoundingBox.js";import P from"../../../../layers/support/FieldsIndex.js";import{createRendererExpression as z}from"../../../../support/ArcadeExpression.js";import{CIMSymbolHelper as w}from"../../../../symbols/cim/CIMSymbolHelper.js";import{evaluateValueOrFunction as C}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as O}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultIconPrimitive as R}from"../../../../symbols/support/primitives.js";import M from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as I}from"../../../../symbols/support/utils.js";import{transparentUnit as j}from"./constants.js";import{perObjectElevationAligner as E}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as U,needsElevationUpdates2D as F}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as T}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as V}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as D}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as G}from"./graphicUtils.js";import{namedAnchorToHUDMaterialAnchorPos as A}from"./placementUtils.js";import{placePointOnGeometry as L,updateStageObjectGeometry as H,getLocalOriginForPoint as k,extendPointGraphicElevationContext as B,createStageObject as N}from"./pointUtils.js";import{hasTransparencyModeSymbol as $}from"./transparencyUtils.js";import{initFastSymbolUpdatesState as q,updateFastSymbolUpdatesState as J,evaluateModelTransformScale as Z,ConvertOptions as W}from"../support/FastSymbolUpdates.js";import{createTexture as K,requiresHalfTexelOffset as Q,defaultBoundingBox as X,defaultSymbolSizeRatio as Y,defaultTexSize as ee}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as te}from"../../terrain/OverlayRenderer.js";import{VerticalOffsetParameters as re}from"../../webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{createPointGeometry as ie}from"../../webgl-engine/lib/GeometryUtil.js";import{ManagedTexture as se}from"../../webgl-engine/lib/ManagedTexture.js";import{RenderGeometry as ae}from"../../webgl-engine/lib/RenderGeometry.js";import{HUDMaterial as oe}from"../../webgl-engine/materials/HUDMaterial.js";var ne;const le=y(0,0,1),ce=16,he=1.5,ue=[ee*Y,ee*Y];class me extends D{static{ne=$}static{this.PRIMITIVE_SIZE=ue}getCachedSize(){return{size:this._getIconSize()}}static{this.elevationModeChangeTypes={definedChanged:1,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,xe(t)),this._cimData=null,this._overrideHelperClass=null,this._arcadeInfo=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimScaleFactorOrFunction=null,this._size=[1,1],this._symbolTextureRatio=1,this._outlineSize=0,this._textureHandle=null,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0},this[ne]=!0}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=I(this.symbolLayer),i=_e(r);null!=i?await this._prepareResourcesCIM(t,JSON.parse(i),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=G(this._getIconSize());if(e)throw new r("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?l(e.size):ce);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e,t){const r=this._overrideHelperClass;let s=this._cimData;if(r&&s&&s.symbol||this.logger.error("Can't create texture, CIM data is undefined"),s.primitiveOverrides){s=i(s);const a=s.primitiveOverrides;r.evaluateOverrides(a,e,this._arcadeInfo.geometryType,null,null,t.layer.fieldsIndex),r.applyOverrides(s.symbol,a)}const a=h(JSON.stringify(s));let o=this._cimSymbolTextures.get(a);if(o)return o;const n=this._context.sharedResources.cimSymbolRasterizer,l=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;l&&r.applyDictionaryTextOverrides(s.symbol,e,l,null);const c=null!=this._cimScaleFactorOrFunction?C(this._cimScaleFactorOrFunction,e):1;1!==c&&s.symbol&&O(s.symbol,c,!0);const u=w.getEnvelope(s,null,n.resourceManager);if(u?.width&&u.height){const e=u.x+u.width/2,t=u.y+u.height/2,r=n.rasterize({type:"cim",data:s},u.width,u.height,e,t,1,"esriGeometryPoint",0,null,this._context.graphicsCoreOwner.view.state.rasterPixelRatio),i=new M({x:-u.x/u.width-.5,y:(u.height+u.y)/u.height-.5});this._cimMaterialParametersInfo.anchorPosition=fe("relative",i),o=new se(r,{width:r?.width??1,height:r?.height??1,reloadable:!0})}else o=new se(new ImageData(1,1),{width:1,height:1,reloadable:!0});return this._cimSymbolTextures.set(a,o),this._context.stage.addTexture(o),o}_prepareMaterialParameters(){const{symbolLayer:e,symbol:t,_context:r,_drivenProperties:i,view:s}=this,a=this.symbolLayer.occludedVisibility?.mode??"hidden";return{anchorPosition:fe(e.anchor,e.anchorPosition),rotation:e.angle,hasRotation:0!==e.angle||i.rotation,hasVertexRotation:i.rotation,occludedFragmentOpacity:"hidden"!==a?s.state.ensureOccludedFragmentOpacity():void 0,hasSlicePlane:r.slicePlaneEnabled,verticalOffset:de(t)?new re(t.verticalOffset):void 0,screenSizePerspective:r.screenSizePerspectiveEnabled?s.screenSizePerspective.parameters:void 0}}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(pe(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,()=>K(t));this._textureHandle=r,e.textureId=r.managedTexture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=Q(t),e.distanceFieldBoundingBox=X;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/Y,e.size=m(i*this._symbolTextureRatio,i*this._symbolTextureRatio),this._createMaterial(e)}async _prepareResourcesHref(t,i,s){this._outlineSize=this._getOutlineSize(),t.color=this._getFillColor(),t.outlineColor=this._getOutlineColor(),t.outlineSize=this._outlineSize,t.textureIsSignedDistanceField=!1;const a=this._getIconSize(),n=a*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await e(this._context.sharedResources.textures.fromUrl(i,n,{signal:s}));if(!1===l.ok){o(l.error);throw new r("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${i})`)}this._textureHandle=l.value;const c=l.value.managedTexture;this._size=ye(c,a),t.size=d(this._size),t.textureId=c.id}this._createMaterial(t)}async _prepareResourcesCIM(e,t,r){const{OverrideHelper:i}=await import("../../../../symbols/cim/OverrideHelper.js");if(this._overrideHelperClass=i,this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;n(r),this._context.sharedResources.cimSymbolRasterizer??=new e(this._context.renderCoordsHelper.spatialReference)}const s=this._context.sharedResources.cimSymbolRasterizer,a=t,o=a?.symbol,l=[w.normalizeSymbolAndFetchResources(o,s.resourceManager,r)],c=this._context.layer.fields?this._context.layer.fields.map(e=>e.toJSON()):[],h=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:h,fields:c,geometryType:"esriGeometryPoint"},a?.primitiveOverrides&&l.push(i.createRenderExpressions(a.primitiveOverrides,this._arcadeInfo)),l.length>0&&(await Promise.all(l),n(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await z(t,this._context.layer.spatialReference),{default:i}=await import("../../../2d/arcade/callExpressionWithFeature.js"),s=new P(c);this._cimScaleFactorOrFunction=(e,t,a)=>{const o=i(r,e,{$view:a},"esriGeometryPoint",s,t);return null!==o?o:1}}}n(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return ge(this.symbolLayer)}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(l(t.outline.size),0);return e=pe(this._getPrimitive())?he:0,Math.max(e,0)}_getOutlineColor(){const e=this._getLayerOpacity(),t=this.symbolLayer,r=t?.outline?.color;if(null!=r){const t=r.toUnitRGB(),i=r.a*e;return[t[0],t[1],t[2],i]}return[0,0,0,0]}_getFillColor(){if(pe(this._getPrimitive()))return j;const e=null==this._getPrimitive(),t=this._materialColor;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}get _materialColor(){return this.symbolLayer.material?.color}get _fastVisualVariableFallbackColor(){const e=this._materialColor;if(null==e){return null==this._getPrimitive()?x:v}return e.toUnitRGBA()}_getFallbackSize(){const e=this._getIconSize(),{symbolLayer:{size:t}}=this;return(null!=t?Math.round(l(t)):ce)/e}_createMaterial(e){const t=this._context.spherical;if(this._cimData){this._fastUpdates=null;let r=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return r||(r=new oe(e,t),this._cimSymbolMaterials.set(e.textureId??0,r)),r}return this._fastUpdates=q(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),e.hasVertexColor=this._drivenProperties.color&&!this._fastUpdates?.visualVariables.color||this._drivenProperties.opacity&&!this._fastUpdates?.visualVariables.opacity,e.hasVertexSize=this._drivenProperties.size&&!this._fastUpdates?.visualVariables.size,e.focusAreaStyle=null,this._materials[0]=new oe(e,t),this._materials[1]=new oe(e,t,!0),e.focusAreaStyle=this._context.focusAreaStyle,this._materials[2]=new oe(e,t),this._materials[3]=new oe(e,t,!0),this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial(e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})}),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=s(this._patchTask),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach(e=>this._context.stage.removeTexture(e)),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor({size:e},t){if(!this._drivenProperties.size)return 1;if(null==e)return this._getFallbackSize();const[r,i,s]=e.output;return"symbol-value"===r?1:"number"==typeof r&&isFinite(r)?l(r)/t:"number"==typeof s&&isFinite(s)?l(s)/t:1}_getDrivenRotation(e){return this._drivenProperties.rotation?e.heading?.output??0:null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;const r=L(t.geometry);if(null==r)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;let i;const s=this.view.focusAreasView?.containsGeometry(r)??!0;if(this._cimData){if(!this._cimData.symbol)return null;const r=this._context.graphicsCoreOwner.view.state.rasterPixelRatio,a=this._generateTextureCIM(t,e),o={textureId:a.id,focusAreaStyle:s?null:this._context.focusAreaStyle,size:m(a.parameters.width/r,a.parameters.height/r),...this._cimMaterialParametersInfo};i=this._createMaterial(o)}else i=this._materials[s?0:2];if(null==r)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=null==this._getPrimitive(),o=e.renderingInfo,n=this._hasDrivenColorOrOpacity?this._getDrivenUInt8Color(o,this._materialColor,a):null,l=this._getDrivenRotation(o);let c=null;if(!this._fastUpdates?.visualVariables.size){const e=this._size,t=e[0]>e[1]?e[0]:e[1];c=this._getScaleFactor(o,t)}const h=null!=c?m(c,c):null,u=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus("on-the-ground"===u.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(o,r,i,n,l,h,t.uid):this._createAs3DShape(o,r,i,n,l,h,u,t.uid)}terrainTransparencyChanged(){return this.draped}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial(r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})})}layerScreenSizePerspectiveChanged(){const e=this._context.screenSizePerspectiveEnabled&&!this.draped?this.view.screenSizePerspective.parameters:null;this._forEachMaterial(t=>{t.setParameters({screenSizePerspective:e})})}updateTransparentMode(e,t){const r=e.stageObject.geometries[0]?.material,i=this._materials.indexOf(r)<2,s=t?i?1:3:i?0:2,a=this._materials[s];a&&a!==r&&e.updateMaterial(a)}updateGeometry(e,t){const r=e.geometry;if(this.draped||!r||!this._validateGeometry(r))return!1;const{elevationContext:i,stageObject:s}=t;if(i.mode!==this.getGeometryElevationMode(r))return!1;const a=L(r);if(!a)return!1;i.updateFeatureExpressionFeature(e,this._context.layer);const o=H(s,this._context,a,i);if(null==o)return!1;const n=k(this._context,a);return s.geometries[0].localOrigin===n&&(t.alignedSampledElevation=o,B(t,a,this._context.elevationProvider),!0)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=U(me.elevationModeChangeTypes,r,i);if(1!==s)return s;const a=F(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial(e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!J(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return 0;{const e=this._fastUpdates;this._materials.forEach(t=>t?.setParameters(e.materialParameters))}}return 2}get needsUpdateFocus(){return!0}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t),this._preparePatchRotation(e,t)}_preparePatchResource(i,l){if(!l.resource||"partial"!==l.resource.type)return;const c=l.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:u}=this._context.sharedResources;if(null==h||null==u||null!=_e(h))return;const m=this._getIconSize(),d=m*this._context.graphicsCoreOwner.view.state.pixelRatio;i.symbolLayerStatePatches.push(()=>{this._patchTask=s(this._patchTask),this._patchTask=t(t=>this._context.schedule(async(t,i)=>{const s=await e(u.fromUrl(h,d,{signal:i}));n(i);const l=!s.ok;if(l&&o(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,l){this._forEachMaterial(e=>{e.visible=!1,e.setParameters({textureId:null})});const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new r("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.managedTexture;this._size=ye(c,m),this._forEachMaterial(e=>{e.setParameters({textureId:c.id}),e.visible=!0})},t))}),delete c.href}_preparePatchRotation(e,t){if(!t.angle||"complete"!==t.angle.type)return;const r=t.angle.newValue??0,i=0!==r||this._drivenProperties.rotation;e.symbolLayerStatePatches.push(()=>{this._forEachMaterial(e=>e.setParameters({rotation:r,hasRotation:i}))}),delete t.angle}_defaultElevationInfoNoZ(){return ve}_createAs3DShape(e,t,r,i,s,a,o,n){const l=this.getFastUpdateAttrValues(e),c=this._context.layerViewUid,h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerViewUid:c}),u=ie(r,{normal:le,color:i,rotation:s,size:a,centerOffset:f,groundDistance:1,featureAttribute:l,olidColor:h}),m=N(this._context,t,u,o,n);if(null==m)return null;const d=new V(this,m.object,null,E,o);return d.setOccludedVisibilityMode(this.symbolLayer.occludedVisibility?.mode),d.hiddenIfDeconflicted=!0,d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=F(o.mode)||"absolute-height"===o.mode,d.getScreenSize=this._createScreenSizeGetter(a,l),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),B(d,t,this._context.elevationProvider),d}_createAsOverlay(e,t,r,i,s,a,o){r.renderPriority=this._renderPriority;const n=g();b(t,n,this._context.overlaySR),n[2]=te;const l=this._context.clippingExtent;if(null!=l&&!S(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=this._context.layerViewUid,u=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:h}),m=ie(r,{normal:le,position:n,color:i,rotation:s,size:a,featureAttribute:c,olidColor:u}),d=new ae(m,{layerViewUid:h,graphicUid:o}),p=new T(this,[d],null,this._context.drapeSourceRenderer);return p.getScreenSize=this._createScreenSizeGetter(a,c),p.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(p.getScreenSize(),1,e),p}_createScreenSizeGetter(e,t){e??=_;const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]*this._size[0],s=e[1]*this._size[1];return(e=p())=>{const[a,o]=Z(be,this._fastUpdates.materialParameters,t);return e[0]=a*i+r,e[1]=o*s+r,e}}const i=e[0]*this._size[0]+r,s=e[1]*this._size[1]+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=y(e,e,e),r=c(1),i=e*r,s=y(i,i,i),a=this._getFallbackSize();return new W({supports:{size:!0,color:!0,rotation:!0,opacity:!1},modelSize:t,symbolSize:s,unitInMeters:r,fallbackColor:this._fastVisualVariableFallbackColor,fallbackSize:y(a,a,a)})}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}}function de(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function pe(e){return null!=e&&("cross"===e||"x"===e)}function _e(e){const t=u(e);return"application/json"===t?.mediaType?t.data:void 0}function fe(e,t){return"relative"===e?m((t.x||0)+.5,.5-(t.y||0)):e in A?A[e]:A.center}function ye({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}function ge(e){return e.resource?.href?null:e.resource?.primitive??R}function xe(e){return 1===(e.material?.color?.a??0)&&null!=ge(e)}const ve={mode:"relative-to-ground",offset:0},be=g();export{me as Graphics3DIconSymbolLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{ONES as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as r,scale as
|
|
2
|
+
import e from"../../../../core/Logger.js";import{ONES as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as r,scale as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ONES as o,ZEROS as n,fromArray as s,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{closeRings as l}from"../../../../geometry/support/coordsUtils.js";import{defaultSymbolLayerComplexity as p}from"./defaultSymbolComplexity.js";import{ElevationContext as c}from"./ElevationContext.js";import{zeroContext as u}from"./featureExpressionInfoUtils.js";import{mixinColorAndOpacity as d}from"./graphicUtils.js";import{Loadable as h}from"./Loadable.js";import{getSizeAttributeValue as y,getAttributeValue as f}from"../support/FastSymbolUpdates.js";import{encodeNaNUInt8 as g}from"../support/symbolColorUtils.js";const v=()=>e.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer");class m extends h{constructor(e,t,r,i,o=!0){super(r.schedule),this.symbol=e,this.symbolLayer=t,this._context=r,this._drivenOpacityFallbackAlwaysOpaque=o,this.ignoreDrivers=!1,this._drivenProperties={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1,rotation:!1},this._materials=[],this.logger=v(),this._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0},this.skipHighSymbolLodsChanged=!0,this._renderPriority=i.renderPriority,this._renderPriorityStep=i.renderPriorityStep,this._elevationContext=new c,this.updateComplexity(),this.ignoreDrivers=i.ignoreDrivers,this.ignoreDrivers||(this._drivenProperties=_(this._context.renderer,o)),this._updateElevationContext()}destroy(){this.complexity=null,this._materials.length=0,super.destroy()}get view(){return this._context.stage.view}getCachedSize(){return null}get extentPadding(){return 0}get materials(){return this._materials}get estimatedMemory(){const{complexity:e}=this;if(null==e)return 0;return(this.draped?e.memory.draped:e.memory).bytesPerFeature}get usedMemory(){return this.estimatedMemory}_drivenPropertiesChanged(e){if(this.ignoreDrivers)return!1;const t=this._drivenProperties,r=_(e,this._drivenOpacityFallbackAlwaysOpaque);return r.color!==t.color||r.opacity!==t.opacity||r.opacityAlwaysOpaque!==t.opacityAlwaysOpaque||r.size!==t.size||r.rotation!==t.rotation}get needsDrivenTransparentPass(){return this._hasDrivenColorOrOpacity&&!this._drivenProperties.opacityAlwaysOpaque}get _hasDrivenColorOrOpacity(){return this._drivenProperties.color||this._drivenProperties.opacity}_logGeometryCreationWarnings(e,t,r,i){const o=e.projectionSuccess,n="polygonIndices"in e?e.polygonIndices:null,s=`${i} geometry failed to be created`;o?!this._logGeometryValidationWarnings(t,r,i)&&0===n?.length&&"rings"===r&&t.length>0&&t[0].length>2&&v().warnOncePerTick(`${s} (filled rings should use clockwise winding - try reversing the order of vertices)`):v().warnOncePerTick(`${s} (failed to project geometry to view spatial reference)`)}get needsUpdateFocus(){return!1}_logGeometryValidationWarnings(e,t,r){const i=`${r} geometry failed to be created`;return!e.length||1===e.length&&!e[0].length?(v().warnOncePerTick(`${i} (no ${t} were defined)`),!0):(!Array.isArray(e)||!Array.isArray(e[0]))&&(v().warnOncePerTick(`${i} (${t} should be defined as a 2D array)`),!0)}_validateGeometry(e,t=null,r=null){if(null!=t&&!t.includes(e.type))return this.logger.warn("unsupported geometry type for "+r+` symbol: ${e.type}`),!1;switch(e.type){case"point":{const t=e;if(!isFinite(t.x)||!isFinite(t.y))return v().warn("point coordinate is not a valid number, graphic skipped"),!1;break}case"polygon":l(e)}return!0}_defaultElevationInfoNoZ(){return x}_defaultElevationInfoZ(){return C}_updateElevationContext(){null!=this._elevationInfoOverride?(this._elevationContext.setFromElevationInfo(this._elevationInfoOverride),this._elevationContext.setFeatureExpressionInfoContext(null)):this._context.layer.elevationInfo?(this._elevationContext.setFromElevationInfo(this._context.layer.elevationInfo),this._elevationContext.setFeatureExpressionInfoContext(this._context.featureExpressionInfoContext)):this._elevationContext.reset()}getDefaultElevationInfo(e){return e.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ()}getGeometryElevationMode(e,t=this.getDefaultElevationInfo(e)){return this._elevationContext.mode||t.mode}setElevationInfoOverride(e){this._elevationInfoOverride=e,this._updateElevationContext()}createElevationContextForGraphic(e){const t=new c;return this.updateElevationContextForGraphic(t,e),t}updateElevationContextForGraphic(e,t){const r=t.geometry,i=this.getDefaultElevationInfo(r);e.unit=null!=this._elevationContext.unit?this._elevationContext.unit:i.unit,e.mode=this.getGeometryElevationMode(r,i),e.offsetMeters=this._elevationContext.meterUnitOffset??i.offset??0;const o=!this._elevationOptions.supportsOnTheGround&&"on-the-ground"===e.mode;o&&(e.mode="relative-to-ground",e.offsetMeters=0);const n=o?u:this._elevationContext.featureExpressionInfoContext;n?e.updateFeatureExpressionInfoContextForGraphic(n,t,this._context.layer):e.setFeatureExpressionInfoContext(null)}prepareSymbolLayerPatch(e){}onRemoveGraphic(e){}_getLayerOpacity(){if(this._context.graphicsCoreOwner&&"fullOpacity"in this._context.graphicsCoreOwner)return this._context.graphicsCoreOwner.fullOpacity??0;const e=this._context.layer.opacity;return e??1}_getCombinedOpacity(e,t=b){const r=this.draped?1:this._getLayerOpacity();return this._drivenProperties.color?r:e?r*(this._drivenProperties.opacity?1:e.a):t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(e,r=b){const i=this._getCombinedOpacity(e,r);if(this._drivenProperties.color)return d(null,i);const o=e?.toUnitRGB()??t;return d(o,i)}_getDrivenUInt8Color({color:e,opacity:t},r,i){const{color:s,opacity:a}=this._drivenProperties,l=r?.toUnitRGBA()??(i?o:n),p=s?e?.output??l:null,c=e||r||i,u=s?null:l[3];return d(p,a&&c?t?.output??u:null,255)}_getDrivenUInt8ColorWithNaNSupport({color:e,opacity:t},o,n){const l=o?s(o.toUnitRGBA()):a(NaN,NaN,NaN,n?NaN:0);return this._drivenProperties.color&&null!=e&&r(l,e.output),this._drivenProperties.opacity&&null!=t&&(l[3]=t.output),i(l,l,255),g(l,l)}isFastUpdatesEnabled(){return null!=this._fastUpdates}updateComplexity(){this.complexity=this.computeComplexity()}computeComplexity(){return p(this.symbol,this.symbolLayer)}globalPropertyChanged(e,t,r){switch(e){case"opacity":return this.layerOpacityChanged(t,r),!0;case"screenSizePerspectiveEnabled":return this.layerScreenSizePerspectiveChanged(t,r),!0;case"elevationInfo":{const e=this._elevationContext.mode;this._updateElevationContext();return 2!==this.layerElevationInfoChanged(t,r,e)}case"slicePlaneEnabled":return this.slicePlaneEnabledChanged(t,r);case"physicalBasedRenderingEnabled":return this.physicalBasedRenderingChanged();case"pixelRatio":return this.pixelRatioChanged;case"skipHighSymbolLods":return this.skipHighSymbolLodsChanged;case"terrainTransparency":return this.terrainTransparencyChanged();default:return!1}}terrainTransparencyChanged(){return!0}get pixelRatioChanged(){return!0}updateGraphics3DGraphicElevationInfo(e,t,r){let i=1;return e?.forEach(e=>{const o=t(e);if(null!=o){const t=e.graphic;this.updateElevationContextForGraphic(o.elevationContext,t),o.needsElevationUpdates=r(o.elevationContext.mode)}else i=2}),i}applyRendererDiff(e,t){return 0}getFastUpdateAttrValues(e){if(!this._fastUpdates)return null;const t=this._fastUpdates.visualVariables,r=y(t.size,e.size),i=f(t.color,e.color),o=f(t.opacity,e.opacity);return a(r,i,o,0)}get draped(){return this._draped}ensureDrapedStatus(e){return null==this._draped?(this._draped=e,!0):(e!==this.draped&&v().warnOnce("A symbol can only produce either draped or non-draped visualizations. Use two separate symbol instances for draped and non-draped graphics if necessary."),!1)}test(){const e=()=>({size:this._fastUpdates?.visualVariables.size?.source??null,color:this._fastUpdates?.visualVariables.color?.source??null,opacity:this._fastUpdates?.visualVariables.opacity?.source??null,rotation:this._fastUpdates?.visualVariables.rotation?.source??null});return{drivenProperties:this._drivenProperties,getVisVarFields:e}}}function _(e,t){const r={color:!1,opacity:!1,opacityAlwaysOpaque:t,size:!1,rotation:!1};return e&&"visualVariables"in e&&e.visualVariables&&e.visualVariables.forEach(e=>{switch(e.type){case"color":if(r.color=!0,e.stops)for(let t=0;t<e.stops.length;t++){const i=e.stops[t].color;i&&i.a<1&&(r.opacityAlwaysOpaque=!1)}break;case"opacity":r.opacity=!0,r.opacityAlwaysOpaque=!1;break;case"size":r.size=!0;break;case"rotation":r.rotation=!0}}),r}const x={mode:"on-the-ground",offset:0,unit:"meters"},C={mode:"absolute-height",offset:0,unit:"meters"},b={hasIntrinsicColor:!1},O=a(NaN,NaN,NaN,NaN);export{m as Graphics3DSymbolLayer,_ as getDrivenProperties,O as nanFallbackColor};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import e from"../../../core/Error.js";import{onAbort as n,createAbortError as a}from"../../../core/promiseUtils.js";import{whenOnce as r}from"../../../core/reactiveUtils.js";import{
|
|
2
|
+
import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import e from"../../../core/Error.js";import{onAbort as n,createAbortError as a}from"../../../core/promiseUtils.js";import{whenOnce as r}from"../../../core/reactiveUtils.js";import{toRenderCameraWithScale as o}from"../webgl.js";import{applyAll as s}from"../camera/constraintUtils.js";import{isPointToPointAnimationController as l,PointToPointAnimationController as h}from"./controllers/PointToPointAnimationController.js";import{SurfaceCollisionCorrectionController as c}from"./controllers/SurfaceCollisionCorrectionController.js";import{create as m}from"../support/viewpointUtils.js";class w{constructor(t,i,e){this._target=t,this._options=i,this.view=e,this.state="pending",this._animationController=null,this.promise=new Promise((t,i)=>{this._resolveCallback=t,this._rejectCallback=i;const e=new AbortController;null!=this._options.signal&&n(this._options.signal,()=>this.abort()),this._abortController=e,this._waitForReady()})}_resolve(t){if("finished"!==this.state)return this.state="finished",this._resolveCallback(t)}_reject(t){if("finished"!==this.state)return this.state="finished",this._rejectCallback(t)}abort(t=!1){if(this._abortController.abort(),"wait-for-animation-finish"===this.state)!t&&null!=this._animationController&&this.view.state.cameraController===this._animationController&&this._animationController.running&&this._animationController.stopController();this._reject(a())}async _waitForReady(){if(this.state="wait-for-ready",!this.view.ready)try{await r(()=>this.view.ready,this._abortController.signal)}catch(t){return this._reject(t)}this._createViewPoint()}async _createViewPoint(){if("finished"!==this.state){this.state="wait-for-viewpoint",this._animationController=this._options.animate?this._getAnimationController():null;try{const t=await m(this.view,this._target,this._abortController.signal);if("finished"===this.state)return;const i=t?this._getCameraFromViewpoint(t):null;if(null==i)return;if(this._options.animate){if(null==this._animationController)return;this._startAnimation(i,this._animationController)}else this.view.stateManager.setStateCamera(i.camera,{applyConstraints:!i.isFullySpecified,positionAndOrientationOnly:!0,doNotCancelGoToOperation:!0}),this._resolve()}catch(t){this._reject(t)}}}_getCameraFromViewpoint(n){const a=this._target instanceof i,r=this._target instanceof t,s=!!(a&&this._target.camera||r||"position"in this._target&&void 0!==this._target.position?.z||Array.isArray(this._target)&&void 0!==this._target[2]),l=n.camera;if(null==l)return null;if(!this.view.stateManager.isCompatible(l)){const t=l.position,i=t&&t.spatialReference,n=i?i.wkid:"none",a=this.view.spatialReference?.wkid;return this._reject(new e("GotoAnimation:incompatible-spatialreference",`Resulting camera has an incompatible spatial reference (camera: ${n}, view: ${a})`,{camera:l})),null}const h=o(this.view,l,n.scale);return null==h?(this._reject(new e("GotoAnimation:invalid-camera","Resulting camera is invalid")),null):{viewpoint:n,camera:h,isFullySpecified:s}}_startAnimation(t,i){this.state="wait-for-animation-finish";const n=i.viewAnimation;if(null==n)return void this._reject(new e("GotoAnimation:missing-animation","Unreachable code in view.stateManager"));if(n.update(t.viewpoint,"running"),!i.running||null==i.viewAnimation||i.viewAnimation.target!==t.viewpoint||this.view.state.cameraController!==i)return this.abort();let a;t.isFullySpecified?a=new c({view:this.view,desiredCamera:t.camera}):s(this.view,t.camera),i.begin(t.camera,this._options);const r=()=>{const e=this.view.state.cameraController;a&&(e&&e.running?l(e)&&null!=e.viewAnimation&&e.viewAnimation.target===t.viewpoint&&(this.view.state.cameraController=a):null!=i.viewAnimation&&i.viewAnimation.target===t.viewpoint&&4===i.state&&(this.view.state.cameraController=a))},o=t=>{if(null!=this.view.state)switch(i.state){case 4:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this._resolve()}break;case 0:case 1:case 2:case 3:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this._reject(t)}}};n.when(r,t=>o(t)),i.asyncResult={resolve:()=>o(),reject:t=>o(t)}}_getAnimationController(){let t=null,i=null;const n=this.view.state.cameraController;return l(n)&&(n.updateStateFromViewAnimation(),n.running&&(t=n,i=t.viewAnimation)),null==t&&(t=new h({view:this.view,mode:"animation"}),i=t.viewAnimation,this.view.state.switchCameraController(t),1===t.state)?(i?.stop(),this._reject(new e("GotoAnimation:goto-cannot-interrupt","Cannot start an animation while interacting")),null):t}}export{w as GoToOperation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s}from"../../../../core/screenUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as m,negate as h,length as c,subtract as _,normalize as p,add as u,scale as l,dot as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as P}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../geometry/support/axisAngle.js";import{create as C,fromPositionAndNormal as w,getNormal as b}from"../../../../geometry/support/plane.js";import{Sphere as M}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as S,applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as E}from"../../input/util.js";import{InteractiveController as y}from"./InteractiveController.js";import{PanPlanarMomentumController as x}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as A}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as O}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as R}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as z}from"./momentum/ZoomSphericalMomentumController.js";import{pickPointAndInitSphere as k,excludeTerrain as F,inferNavigationMode as H,sphereOrPlanePointFromScreenPoint as D,maxPanDistanceModifier as T,minPinchAndPanCameraHeight as U,pivotSearchAreaSize as G,intersectPlaneFromScreenPointAtEye as I,applyZoomOnSphere as Z,shouldPreserveHeading as V,applyPanSphericalPreserveHeading as q,applyPanSphericalDirectRotation as B,normalizeRotationDelta as J,applyRotation as K,applyPanPlanar as L,applyZoomToPoint as N}from"../utils/navigationUtils.js";import Q from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as W}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as X}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as Y}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as $}from"../../../navigation/ZoomMomentumEstimator.js";let tt=class extends y{constructor(){super(...arguments),this._smoothRotation=new E(.05),this._rotationAxis=g(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=C(),this._beginRadius=0,this._smoothScaling=new E(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new $,this._rotationMomentumEstimator=new Y,this._panSphericalMomentumEstimator=new X,this._panPlanarMomentumEstimator=new W,this._adjustedSphere=new M,this._tmp3d=g(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=g(),this._screenPickPoint=n(),this._scenePickPoint=g(),this._navigationMode=1,this._sphere=new M,this._pointerCount=0,this._tmpInteractionDirection=g(),this._beginCamera=new Q,this._constraintOptions=new j(15,0,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._beginAngle=t.angle,this._pointerCount=t.pointers.size,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),a(this._beginScreenPoint,this._screenPickPoint);const n=k(this._intersectionHelper,this.startCamera,this._screenPickPoint,P(this.view.spatialReference).radius,1,this.view.basemapTerrain.invisible?F:{});null!=n.scenePickPoint&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,m(this._beginScenePoint,this._scenePickPoint),this._navigationMode=H(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),0===this._navigationMode&&this._preparePlanarPanMode(t,n.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;1===this._navigationMode?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(i)return 1===this._navigationMode?new z({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere.radius}):new R({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(e)return new O({view:this.view,momentum:e,center:this._sphere.center,axis:this._rotationAxis});if(1===this._navigationMode){const t=this.view.animationsEnabled&&this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new A({view:this.view,momentum:t})}else{const t=this.view.animationsEnabled&&this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=h(this._tmp3d,this.startCamera.viewForward);w(this._scenePickPoint,e,this._panningPlane);const o=n(this._screenPickPoint[0],0),a=g(),r=c(this.startCamera.eye);this._adjustedSphere.radius=r<this._sphere.radius?r-100:this._sphere.radius,D(this._adjustedSphere,this.startCamera,o,a);const P=g(),v=g(),C=g();_(P,this._scenePickPoint,this.currentCamera.eye);const M=c(P);p(P,P);const S=T*Math.max(Math.abs(this.view.camera.position.z),U),f=this.view.stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,G);let j=null!=f?f:S;i&&(j=Math.min(j,M)),m(C,u(v,this.currentCamera.eye,l(v,P,j))),this._panningPlane[3]=-d(b(this._panningPlane),C),this.startCamera.center=u(v,this.startCamera.eye,l(v,this.startCamera.viewForward,j));const E=s(t.center,this._tmpScreenPointArray);I(this._panningPlane,this.startCamera,E,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),Z(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=S(t.radius-this._beginRadius),f(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);D(this._sphere,this.currentCamera,i,this._tmp3d),V(this._beginScenePoint,d(this.currentCamera.up,this._beginScenePoint),this._sphere.radius,this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(q(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(B(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere.radius,this.view.camera.tilt)),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=S(r(this._screenPickPoint,i)),f(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){p(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+J(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),K(this.currentCamera,this._sphere.center,v(this._rotationAxis,s)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=S(t.radius*e),f(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);I(this._panningPlane,this.currentCamera,i,this._tmp3d)&&(L(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=S(r(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),f(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),N(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=S(t.radius-this._beginRadius),f(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){m(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||h(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=J(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),K(this.currentCamera,this._sphere.center,v(this._rotationAxis,o)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=S(t.radius*o),f(this.view,this.currentCamera,this._constraintOptions)}};tt=t([o("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],tt);export{tt as PinchAndPanControllerGlobal};
|
|
2
|
+
import{__decorate as t}from"tslib";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s}from"../../../../core/screenUtils.js";import{property as o,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{copy as r,distance as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as h,negate as c,length as _,subtract as p,normalize as l,add as u,scale as d,dot as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as C}from"../../../../geometry/support/axisAngle.js";import{create as w,fromPositionAndNormal as M,getNormal as b}from"../../../../geometry/support/plane.js";import{Sphere as S}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as f,applyAll as j}from"../../camera/constraintUtils.js";import{ConstraintOptions as E}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as y}from"../../input/util.js";import{InteractiveController as O}from"./InteractiveController.js";import{PanPlanarMomentumController as x}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as A}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as z}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as R}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as k}from"./momentum/ZoomSphericalMomentumController.js";import{pickPointAndInitSphere as H,excludeTerrain as F,inferNavigationMode as D,sphereOrPlanePointFromScreenPoint as T,maxPanDistanceModifier as U,minPinchAndPanCameraHeight as G,pivotSearchAreaSize as I,intersectPlaneFromScreenPointAtEye as Z,applyZoomOnSphere as V,shouldPreserveHeading as q,applyPanSphericalPreserveHeading as B,applyPanSphericalDirectRotation as J,normalizeRotationDelta as K,applyRotation as L,applyPanPlanar as N,applyZoomToPoint as Q}from"../utils/navigationUtils.js";import W from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as X}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as Y}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as $}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as tt}from"../../../navigation/ZoomMomentumEstimator.js";let it=class extends O{constructor(t){super(t),this.forceHorizontalPan=!1,this._smoothRotation=new y(.05),this._rotationAxis=P(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=w(),this._beginRadius=0,this._smoothScaling=new y(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new tt,this._rotationMomentumEstimator=new $,this._panSphericalMomentumEstimator=new Y,this._panPlanarMomentumEstimator=new X,this._adjustedSphere=new S,this._tmp3d=P(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=P(),this._screenPickPoint=n(),this._scenePickPoint=P(),this._navigationMode=1,this._sphere=new S,this._pointerCount=0,this._tmpInteractionDirection=P(),this._beginCamera=new W,this._constraintOptions=new E(15,0,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._beginAngle=t.angle,this._pointerCount=t.pointers.size,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),r(this._beginScreenPoint,this._screenPickPoint);const n=H(this._intersectionHelper,this.startCamera,this._screenPickPoint,v(this.view.spatialReference).radius,1,this.view.basemapTerrain.invisible?F:{});null!=n.scenePickPoint&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,h(this._beginScenePoint,this._scenePickPoint),this.forceHorizontalPan?this._navigationMode=1:this._navigationMode=D(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),0===this._navigationMode&&this._preparePlanarPanMode(t,n.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;1===this._navigationMode?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(i)return 1===this._navigationMode?new k({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere.radius}):new R({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(e)return new z({view:this.view,momentum:e,center:this._sphere.center,axis:this._rotationAxis});if(1===this._navigationMode){const t=this.view.animationsEnabled&&this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new A({view:this.view,momentum:t})}else{const t=this.view.animationsEnabled&&this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=c(this._tmp3d,this.startCamera.viewForward);M(this._scenePickPoint,e,this._panningPlane);const o=n(this._screenPickPoint[0],0),a=P(),r=_(this.startCamera.eye);this._adjustedSphere.radius=r<this._sphere.radius?r-100:this._sphere.radius,T(this._adjustedSphere,this.startCamera,o,a);const m=P(),v=P(),C=P();p(m,this._scenePickPoint,this.currentCamera.eye);const w=_(m);l(m,m);const S=U*Math.max(Math.abs(this.view.camera.position.z),G),f=this.view.stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,I);let j=null!=f?f:S;i&&(j=Math.min(j,w)),h(C,u(v,this.currentCamera.eye,d(v,m,j))),this._panningPlane[3]=-g(b(this._panningPlane),C),this.startCamera.center=u(v,this.startCamera.eye,d(v,this.startCamera.viewForward,j));const E=s(t.center,this._tmpScreenPointArray);Z(this._panningPlane,this.startCamera,E,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),V(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=f(t.radius-this._beginRadius),j(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);T(this._sphere,this.currentCamera,i,this._tmp3d),q(this._beginScenePoint,g(this.currentCamera.up,this._beginScenePoint),this._sphere.radius,this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(B(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(J(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere.radius,this.view.camera.tilt)),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=f(m(this._screenPickPoint,i)),j(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){l(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+K(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),L(this.currentCamera,this._sphere.center,C(this._rotationAxis,s)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=f(t.radius*e),j(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);Z(this._panningPlane,this.currentCamera,i,this._tmp3d)&&(N(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=f(m(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),j(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),Q(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=f(t.radius-this._beginRadius),j(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){h(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=K(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),L(this.currentCamera,this._sphere.center,C(this._rotationAxis,o)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=f(t.radius*o),j(this.view,this.currentCamera,this._constraintOptions)}};t([o({constructOnly:!0})],it.prototype,"forceHorizontalPan",void 0),it=t([a("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],it);export{it as PinchAndPanControllerGlobal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import{subclass as
|
|
2
|
+
import{__decorate as t}from"tslib";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import{property as n,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{negate as a,copy as r,dot as m,subtract as h,length as l,normalize as c,scale as p,add as _}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,fromValues as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as g}from"../../../../geometry/support/axisAngle.js";import{create as C,fromNormalAndOffset as v,setOffsetFromPoint as b,negate as w,getNormal as M}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as f,applyAll as P}from"../../camera/constraintUtils.js";import{ConstraintOptions as z}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as V}from"../../input/util.js";import{getVoxelWasm as S}from"../../layers/VoxelWasm.js";import{InteractiveController as j}from"./InteractiveController.js";import{PanPlanarMomentumController as E}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as H}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as y}from"./momentum/ZoomPlanarMomentumController.js";import{excludeTerrain as x,inferNavigationMode as O,getTiltScaleFactor as F,maxPanDistanceModifier as R,minPinchAndPanCameraHeight as A,pivotSearchAreaSize as T,centroid as U,applyZoomToPoint as D,applyPanPlanar as I,normalizeRotationDelta as Z,applyRotation as k,intersectPlaneFromScreenPointAtEye as G}from"../utils/navigationUtils.js";import L from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as W}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as q}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as B}from"../../../navigation/ZoomMomentumEstimator.js";const J=d(0,0,1);let K=class extends j{constructor(t){super(t),this.forceHorizontalPan=!1,this._rotationValueSmooth=new V(.05),this._scalingValueSmooth=new V(.05),this._planeHorizontal=C(),this._planeVertical=C(),this._rotationMomentumEstimator=new q,this._panMomentumEstimator=new W(300,12,.9),this._zoomMomentumEstimator=new B,this._beginRadius=0,this._beginCenter=u(),this._beginAngle=0,this._tmpPoints=[],this._navigationMode=1,this._beginCenterScreen=i(),this._tmpCentroid3d=u(),this._tmpCentroid2d=i(),this._tmp2d=i(),this._pointerCount=0,this._beginCamera=new L,this._constraintOptions=new z(15,0,0,this._beginCamera)}begin(t){if(!this.running)return;const i=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=i,this._rotationMomentumEstimator.enabled=i,this._panMomentumEstimator.enabled=i,this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),e(t.center,this._beginCenterScreen),v(J,0,this._planeHorizontal);const n=u(),o=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,n,this.view.basemapTerrain.invisible?x:{}),s=u();a(s,this.startCamera.viewForward);const d=u();r(d,J);const g=m(s,d);this.forceHorizontalPan?this._navigationMode=1:this._navigationMode=O(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);const C=F(d,this.startCamera.viewForward,R)*Math.max(Math.abs(this.view.camera.position.z),A);b(this._planeHorizontal,this._planeHorizontal,n),this.startCamera.aboveGround||w(this._planeHorizontal,this._planeHorizontal);const f=u(),P=u(),z=u();h(f,n,this.currentCamera.eye);const V=l(f);if(c(f,f),0===this._navigationMode){p(d,d,g),h(M(this._planeVertical),s,d),c(M(this._planeVertical),M(this._planeVertical)),b(this._planeVertical,this._planeVertical,n);const i=this.view.stage.renderView.getMinimalDepthForArea(S(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,T);let e=null!=i?i:C;o&&(e=Math.min(e,V)),r(z,_(P,this.currentCamera.eye,p(P,f,e))),this._planeVertical[3]=-m(M(this._planeVertical),z),this._computePlanePoints(t.pointers,this._planeVertical,this.startCamera,this._tmpPoints),U(this._tmpPoints,this._beginCenter)}else{const i=o?V:C;r(z,_(P,this.currentCamera.eye,p(P,f,i))),this._planeHorizontal[3]=-m(M(this._planeHorizontal),z),this._computePlanePoints(t.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),U(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,n=1===this._navigationMode?this._planeHorizontal:this._planeVertical,o=this._beginCenter;if(i){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._scalingValueSmooth.gain=e,this._scalingValueSmooth.update(i),D(this.currentCamera,o,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*t.timestamp),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=f(Math.abs(t.radius-this._beginRadius)),P(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(t.pointers,n,this.currentCamera,this._tmpPoints),U(this._tmpPoints,this._tmpCentroid3d),e(t.center,this._tmpCentroid2d),I(this.currentCamera,o,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*t.timestamp),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=f(s(this._beginCenterScreen,this._tmpCentroid2d)),P(this.view,this.currentCamera,this._constraintOptions),i){const i=o,e=this._rotationValueSmooth.value,n=e+Z(t.angle-e),s=.00125*Math.min(Math.max(t.radius,40),120);this._rotationValueSmooth.gain=s,this._rotationValueSmooth.update(n);const a=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(a,.001*t.timestamp);const r=M(this._planeHorizontal);k(this.currentCamera,i,g(r,a)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=f(Math.abs(t.radius*a)),P(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(i)return new y({view:this.view,momentum:i,zoomCenter:this._beginCenter});const e=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(e)return new H({view:this.view,momentum:e,center:this._beginCenter,axis:M(this._planeHorizontal)});const n=this.view.animationsEnabled&&this._panMomentumEstimator.evaluateMomentum();return n?new E({view:this.view,momentum:n}):null}_computePlanePoints(t,i,e,n){n.length=t.size;const o=this._tmp2d;let s=0;return t.forEach(t=>{o[0]=t.x,o[1]=t.y,void 0===n[s]&&(n[s]=u()),G(i,e,o,n[s]),s+=1}),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};t([n({constructOnly:!0})],K.prototype,"forceHorizontalPan",void 0),K=t([o("esri.views.3d.state.controllers.PinchAndPanControllerLocal")],K);export{K as PinchAndPanControllerLocal};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
const t=96*39.37;function e(e,n,r){const{unitInMeters:o}=e.renderCoordsHelper;r/=o;return n.width/2/n.pixelRatio/(t/r)/Math.tan(n.fovX/2)}function n(t,n){return e(t,t.state.camera,n)}function r(e,n){const{camera:r}=e.state,{unitInMeters:o}=e.renderCoordsHelper,a=n*Math.tan(r.fovX/2),i=r.width/2/r.pixelRatio;return t/(i/a)*o}export{r as distanceToScale,n as scaleToDistance,e as scaleToDistanceAt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../Camera.js";import t from"../../../core/Logger.js";import{deg2rad as n,rad2deg as r,asinClamped as i}from"../../../core/mathUtils.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{copy as o,distance as c,dist as s,length as l}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,clone as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectAsync as d,project as h}from"../../../geometry/projectionUtils.js";import g from"../../../geometry/SpatialReference.js";import{projectPointToVectorAsync as y,projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as R,projectVectorToPoint as w}from"../../../geometry/projection/projectVectorToPoint.js";import{gcsCyclical as x,webMercatorCyclical as M}from"../../../geometry/support/normalizeUtils.js";import{toRenderCamera as j}from"../webgl.js";import{
|
|
2
|
+
import e from"../../../Camera.js";import t from"../../../core/Logger.js";import{deg2rad as n,rad2deg as r,asinClamped as i}from"../../../core/mathUtils.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{copy as o,distance as c,dist as s,length as l}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,clone as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectAsync as d,project as h}from"../../../geometry/projectionUtils.js";import g from"../../../geometry/SpatialReference.js";import{projectPointToVectorAsync as y,projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as R,projectVectorToPoint as w}from"../../../geometry/projection/projectVectorToPoint.js";import{gcsCyclical as x,webMercatorCyclical as M}from"../../../geometry/support/normalizeUtils.js";import{toRenderCamera as j}from"../webgl.js";import{scaleToDistance as T,distanceToScale as S}from"./cameraScaleUtils.js";import{getGreatCircleSpanAt as z}from"./earthUtils.js";import{getElevationAtPoint as b}from"./ElevationProvider.js";import{viewModeDependentUtil as C,directionToHeadingTilt as P}from"./viewingModeUtils.js";import{isSpatialReferenceSupported as A}from"../../support/spatialReferenceSupport.js";const L=()=>t.getLogger("esri.views.3d.support.cameraUtils"),U=1,q=8,E=5,F=1,G=u();function H(e){return e.spatialReference??g.WGS84}function I(e,t,n,r,i){return C(e).headingTiltToDirectionUp(t,n,r,i)}function O(e,t,n,r){const i=r.levelAtScale(t),a=k(P(e,n.eye,n.viewForward,n.up).tilt),o=Math.max(i-a,0);return r.scaleAtLevel(o)}function D(e,t,n){const r=n.levelAtScale(e),i=k(t);return n.scaleAtLevel(r+i)}function k(e){return 2*((e>90?180-e:e)/90)**2}function V(e,t,n=0){const r=e.basemapTerrain?.tilingScheme;if(!r)return 0;const i=m(e.spatialReference).radius,a=2===e.state.viewingMode?t.eye[2]:l(t.eye)-i,o=Math.abs(a-n);return O(e,S(e,o),t,r)}function W(e,t,n=0){const r=j(e,t);return r?V(e,r,n):0}const X=1,Y=100;function N(e,t,a,o){if(0===t)return 0;const s=e.state.contentCamera,u=c(s.eye,a),f=e.basemapTerrain?.tilingScheme;if(!f)return L().error("#scaleToTargetDistance()","Cannot compute distance from scale without a tiling scheme"),u;let p=u;const d=P(e,s.eye,s.viewForward,s.up),h=d.tilt>90;if(e.state.isLocal){const r=D(t,d.tilt,f),i=(T(e,r)-Math.abs(s.eye[2]-o[2]))/Math.cos(n(d.tilt));return p=h?p-i:p+i,p}let g=1/0,y=0,v=ee(e,d.heading,d.tilt,a,u,1);if(!v)return p;const R=l(o);for(;g>X&&y<Y;){const o=l(v.eye),u=h?180-v.tilt:v.tilt,w=n(u),x=Math.sin(w)*o,M=Math.cos(w)*o,j=D(t,v.tilt,f),S=T(e,j),z=h?R-S:R+S,b=i(x/z),C=Math.cos(b)*z-M,P=c(v.eye,a);p=h?P-C:P+C,v=ee(e,d.heading,d.tilt,a,p,1);const A=xe(e,v,r(s.fov));if(!v||!A)return p;const L=W(e,A,R-m(e.spatialReference).radius);g=Math.abs(t-L),++y}return p}async function Z(e,t,n,r,i,a){return J(e,t,T(e,n),r,i,a)}function B(e,t,n,r,i,a){return xe(e,ee(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function J(e,t,n,r,i,o){const c=await te(e,r.heading,r.tilt,t,n,i,o);return a(o),Me(e,c,r.fov,o)}function K(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,G,e.spatialReference)&&e.elevationProvider&&(b(e.elevationProvider,G)??0)>G[2]-F)}async function Q(e,t,n){if(K(e,t))return!0;const{elevationProvider:r,spatialReference:i,renderCoordsHelper:o}=e;if(null==r||!o.fromRenderCoords(t,G,i))return!1;const[c,s,l]=G,u=await r.queryElevation(c,s,l,i,"ground",n)??0;return a(n),u>l-F}async function $(e,t,n){const r=u();if(null==t)return o(r,e.state.camera.center);if(t instanceof p){const{renderSpatialReference:i,basemapTerrain:o,elevationProvider:c}=e,s=t.spatialReference;if(await y(t,r,i,{signal:n}),a(n),null==t.z&&null!=o&&null!=c){const i=await c.queryElevation(t.x,t.y,t.z??0,s,"ground",n);a(n),null!=i&&e.renderCoordsHelper.setAltitude(r,i)}return r}return o(r,t)}function _(e,t){const n=u();if(null==t)return o(n,e.state.camera.center);if(t instanceof p){if(!v(t,n,e.renderSpatialReference))return null;const{basemapTerrain:r,elevationProvider:i}=e;if(null==t.z&&null!=r&&null!=i){const r=b(i,t);null!=r&&e.renderCoordsHelper.setAltitude(n,r)}return n}return o(n,t)}function ee(e,t,n,r,i,a){return ne(e,t,n,r instanceof p?r:null,_(e,r),i,a)}async function te(e,t,n,r,i,o,c){const s=r instanceof p?r:null,l=await $(e,r,c);return a(c),re(e,t,n,s,l,i,o,c)}function ne(e,t,n,r,i,a,o){if(null==i)return null;if(!r&&(r=new p({spatialReference:H(e)}),!w(i,e.renderSpatialReference,r)))return null;const c=ie(e,t,n,i,a,o);if(ae(e,n,o)&&K(e,c.eye)){const{tilt:o,mode:c}=oe(e,n,i,a);return ne(e,t,o,r,i,a,c)}return ce(c,i)}async function re(e,t,n,r,i,o,c,s){r||(r=new p({spatialReference:H(e)}),await R(i,e.renderSpatialReference,r,{signal:s})||(r=null)),a(s);const l=ie(e,t,n,i,o,c);if(ae(e,n,c)&&await Q(e,l.eye,s)){a(s);const{tilt:c,mode:l}=oe(e,n,i,o);return re(e,t,c,r,i,o,l,s)}return ce(l,i)}function ie(e,t,n,r,i,a){const o=he(e,t,n,r,i=Math.max(i,e.state.constraints.minimumPoiDistance),a);return(0,C(e).eyeForCenterWithHeadingTilt)(r,i,o.heading,o.tilt)}function ae(e,t,n){const r=e.map.ground.navigationConstraint;return 1===n&&e.state.isGlobal&&t>0&&(null==r||"stay-above"===r.type)}function oe(e,t,n,r){const i=Re(e,n,r,ve(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function ce(e,t){return{...e,center:f(t)}}function se(e,t){const{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&A(i,1)||n.isLocal&&r.equals(i)}function le(e,t){let n,r,i;if(e.state.isGlobal){const e=new p(t.xmin,t.ymin,t.spatialReference),a=new p(t.xmax,t.ymax,t.spatialReference),o=t.spatialReference.isGeographic?x:M;n=new p({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:null!=t.zmax&&null!=t.zmin?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});const c=m(t.spatialReference),s=z(n,e,a);r=s.lon,i=s.lat,o.diff(e.x,a.x)>o.range/2&&(r+=c.halfCircumference),r=Math.min(r,c.halfCircumference),i=Math.min(i,c.halfCircumference)}else{const a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=h(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;const o=null!=t.zmax&&null!=t.zmin?(t.zmax+t.zmin)/2:void 0;n=new p({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}const a=null!=t.zmax&&null!=t.zmin?t.zmax-t.zmin:0,o=e.state.camera,c=1/Math.tan(o.fovX/2),s=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2);return{center:n,distance:Math.max(.5*r*c,.5*i*s,.5*a*l)/U}}async function ue(e,t,n,r,i,o){const c=se(e,t)?t:await d(t,e.spatialReference,{signal:o});a(o);const{center:s,distance:l}=le(e,c),u=await te(e,n,r,s,l,i,o);return a(o),Me(e,u,e.camera.fov,o)}function fe(e,t,n,r,i,a){let o;try{o=se(e,t)?t:h(t,e.spatialReference)}catch(u){return null}const{center:c,distance:s}=le(e,o),l=ee(e,n,r,c,s,i);return null==l?null:xe(e,l,e.camera.fov,a)}function me(e,t,n){const r=e.renderSpatialReference,i=new p({spatialReference:H(e)});if(!w(n,r,i))return null;const a=Math.tan(t.fovX/2),o=Math.tan(t.fovY/2),c=s(t.eye,n),l=2*c*a*U,u=2*c*o*U;return C(e).toExtent(e,i,l,u)}function pe(e,t){return C(e).toArea(e,t)}function de(e,t,n){const r=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(n/r)/Math.LN2>q)return!0;const i=t,a=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return c(i,a)/(Math.tan(.5*e.state.camera.fov)*r)>E}function he(e,t,n,r,i,a){let o=0;return 1===a&&de(e,r,i)?(t=0,o=ye(e,i,n,r)):o=we(e,r,i,n),o=e.state.constraints.clampTilt(i,o),{heading:t,tilt:n=Re(e,r,i,o)}}const ge=.7;function ye(e,t,n,r){const i=we(e,r,t,n);if(!e.state.constraints.tilt)return i;const a=e.state.constraints.tilt(t);a.max=Math.min(a.max,.5*Math.PI);const o=a.min*(1-ge)+a.max*ge;return Math.min(i,o)}function ve(e,t,n,r){let i=we(e,r,t,n);if(!e.state.constraints.tilt)return i;const a=e.state.constraints.tilt(t);return i=Math.min(i,.5*Math.PI),a.min*(1-ge)+i*ge}function Re(e,t,n,r){return C(e).lookAtTiltToEyeTilt(r,t,n)}function we(e,t,n,r){return C(e).eyeTiltToLookAtTilt(r,t,n)}function xe(t,n,r,i){if(null==n)return null;const a=t.renderSpatialReference,o=new p({spatialReference:H(t)});return w(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function Me(t,n,r,i){const o=t.renderSpatialReference,c=new p({spatialReference:H(t)});return await R(n.eye,o,c,{signal:i}),a(i),new e(c,n.heading,n.tilt,r)}function je(e,t){const n=e.basemapTerrain?.tilingScheme;if(n)return n.levelAtScale(t);L().error("#scaleToZoom()","Cannot compute zoom from scale without a tiling scheme")}function Te(e,t){const n=e.basemapTerrain?.tilingScheme;if(n)return n.scaleAtLevel(t);L().error("#zoomToScale()","Cannot compute scale from zoom without a tiling scheme")}export{O as applyTiltAdjustToScale,J as fromCenterDistanceAsync,B as fromCenterDistanceSync,Z as fromCenterScale,ue as fromExtentAsync,fe as fromExtentSync,te as getObserverForPointAtDistanceAsync,ee as getObserverForPointAtDistanceSync,H as getViewSR,I as headingTiltToDirectionUp,D as removeTiltAdjustFromScale,X as scaleErrorThreshold,je as scaleToZoom,pe as toArea,me as toExtent,N as viewScaleToCameraDistance,Te as zoomToScale};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as i}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{distance as n,exactEquals as a,copy as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../../geometry/Point.js";import{distanceToScale as h}from"../
|
|
2
|
+
import{__decorate as t}from"tslib";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as i}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{distance as n,exactEquals as a,copy as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../../geometry/Point.js";import{distanceToScale as h}from"../cameraScaleUtils.js";import{PointOfInterest as p}from"./PointOfInterest.js";import{PropertiesPool as u}from"../../../support/PropertiesPool.js";import{Yield as m}from"../../../support/Yield.js";let _=class extends p{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new u({location:()=>new c,renderLocation:()=>d()},this),this._estimatedSurfaceAltitude=0,this._elevationQueryController=null,this.renderLocation=d(),this._tmpPoint=new c}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(i(()=>this.map?.ground?.layers,"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return h(r,e)}get updating(){return this._dirty||null!=this._elevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._elevationQueryController;t&&(this._elevationQueryController=null,t.abort(),this.notifyChange("updating"))}get readyToRun(){return!this._elevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),m;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>f&&1===this.renderCoordsHelper.viewingMode&&(t.isWGS84||t.isWebMercator);let i=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:i.signal,cache:this.cache,minDemResolution:e?g:0}).then(t=>this._updateSurfaceAltitude(t.geometry.z??0)).catch(t=>{r(t)||this._updateSurfaceAltitude(0)}).finally(()=>{this._elevationQueryController===i&&(this._elevationQueryController=null,this.notifyChange("updating")),i=null}),this._elevationQueryController=i,this.notifyChange("updating"),m}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(y,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),y)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),y)),this.notifyChange("renderLocation"))}};t([o({constructOnly:!0})],_.prototype,"scheduler",void 0),t([o({constructOnly:!0})],_.prototype,"cache",void 0),t([o({constructOnly:!0})],_.prototype,"map",void 0),t([o({constructOnly:!0})],_.prototype,"task",void 0),t([o()],_.prototype,"location",null),t([o()],_.prototype,"renderLocation",void 0),t([o()],_.prototype,"scale",null),t([o()],_.prototype,"updating",null),_=t([s("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],_);const y=d(),f=1e5,g=1e6;export{_ as CameraOnSurface};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{projectBuffer as e}from"../../../../geometry/projection/projectBuffer.js";import{newDoubleArray as o,doubleSubArray as
|
|
2
|
+
import{projectBuffer as e}from"../../../../geometry/projection/projectBuffer.js";import{newDoubleArray as o,doubleSubArray as n}from"../../../../geometry/support/DoubleArray.js";import{applyPerVertexElevationAlignment as t}from"../../layers/graphics/elevationAlignmentUtils.js";import{ringsToOutlinedTessellationInfo as s}from"../../layers/graphics/tessellationUtils.js";import{drapedZ as r}from"../../terrain/OverlayRenderer.js";function i(e,n,r,i){const l="polygon"===e.type,a="polygon"===e.type?e.rings:e.paths,{positions:c,outlines:f}=s(a,{hasZ:!!e.hasZ,ccwRingsAsHoles:l,spatialReference:e.spatialReference}),u=o(c.length),g=t(c,e.spatialReference,0,u,0,c,0,c.length/3,n,r,i),m=null!=g;return{lines:m?p(f,c,u):[],projectionSuccess:m,sampledElevation:g}}function l(o,n){const t="polygon"===o.type,i="polygon"===o.type?o.rings:o.paths,{positions:l,outlines:a}=s(i,{hasZ:!1,ccwRingsAsHoles:t,spatialReference:o.spatialReference}),c=e(l,o.spatialReference,0,l,n,0);for(let e=2;e<l.length;e+=3)l[e]=r;return{lines:c?p(a,l):[],projectionSuccess:c}}function p(e,o,t=null){const s=new Array;for(const{index:r,count:i}of e){if(i<=1)continue;const e=3*r,l=3*i;s.push({position:n(o,3*r,3*i),mapPositions:null!=t?n(t,e,l):void 0})}return s}export{i as geometryToRenderInfo,l as geometryToRenderInfoDraped};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as r}from"../../../core/asyncUtils.js";import{cyclicalDegrees as o}from"../../../core/Cyclical.js";import a from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as u,add as f,distance as p,copy as g,subtract as y,set as h,transformMat3 as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectAsync as R,tryProject as z}from"../../../geometry/projectionUtils.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as B}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as M}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as S}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as Z}from"../../../geometry/projection/projectVectorToVector.js";import{create as F,center as T,toRect as P,isPoint as A,empty as E,expandWithVec3 as V,expandWithAABB as O,width as U,height as k,depth as N}from"../../../geometry/support/aaBoundingBox.js";import{create as I,isPoint as C}from"../../../geometry/support/aaBoundingRect.js";import{polygonCentroidPoint as W}from"../../../geometry/support/centroid.js";import{intersectsPoint as Y}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as q}from"../../../geometry/support/scaleUtils.js";import{fromRenderCamera as D,toRenderCamera as J}from"../webgl.js";import{cameraOnContentAlongViewDirection as X}from"../camera/intersectionUtils.js";import{getViewSR as _,fromExtentAsync as H,scaleToDistance as K,fromCenterDistanceAsync as L,fromExtentSync as Q,distanceToScale as $,fromCenterDistanceSync as tt,fromCenterScale as et,zoomToScale as nt}from"./cameraUtils.js";import{getElevationAtPoint as rt}from"./ElevationProvider.js";import{directionToHeadingTilt as ot}from"./viewingModeUtils.js";const at=.66;function it(t){return 360-o.normalize(t)}function st(t){return o.normalize(360-t)}function ct(t,e,n){const r=e.camera;if(null!=r)return mt(r,_(t));const{targetGeometry:o}=e;if(null==o)return null;const{camera:a,mode:i}=ft(t,e.rotation,n);if("point"===o.type)return pt(t,e,o,a,i);const s=o.extent;return null==s?null:Q(t,s,a.heading,a.tilt,i)}async function lt(t,e,n,r){const o=e.camera;if(null!=o)return ut(o,_(t),r);const{targetGeometry:a}=e;if(null==a)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ft(t,e.rotation,n);if("point"===a.type)return gt(t,e,a,i,s,r);const c=a.extent;if(null==c)throw new Error("Target geometry has no extent!");return H(t,c,i.heading,i.tilt,s,r)}function mt(t,e){const n=t.position,r=z(n,e);if(!r)return null;const o=t.clone();return o.position=r.clone(),o}async function ut(t,e,n){const r=t.position,o=await R(r,e,{signal:n});i(n);const a=t.clone();return a.position=o.clone(),a}function ft(t,e,n){const r=D(t,t.state.camera);let o=1;return null!=e&&(r.heading=it(e),o=0),null!=n&&(r.tilt=n),{camera:r,mode:o}}function pt(t,e,n,r,o){const a=t.spatialReference,i=z(n.clone(),a);if(!i)return null;const s=null!=e.scale?K(t,e.scale):t.state.camera.distance;return tt(t,i,s,r,o)}async function gt(t,e,n,r,o,a){const s=t.spatialReference,c=await R(n.clone(),s,{signal:a});i(a);const l=null!=e.scale?K(t,e.scale):t.state.camera.distance;return L(t,c,l,r,o,a)}function yt(t,e,r=null){return null==r&&(r=new n),jt(t,null,e.clone(),r)}async function ht(e,r,o){const i=At(e,r);if(!i)throw new a("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return Et(await zt(e,i.target,i,o,c))}if(i.target instanceof t)return Et(await Gt(e,i.target,o,c));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return Et(l||t?await Mt(e,i,i.target.center,s,o,c):await Ft(e,i,i.target,s,o,c))}const m=new Ot,u=l?wt(e,i):void 0;if(await Rt(e,i.target,u,m,o),isFinite(m.boundingBox[0])){let t;if(T(m.boundingBox,Ut),Jt.x=Ut[0],Jt.y=Ut[1],Jt.z=Ut[2],Jt.spatialReference=e.spatialReference,isFinite(Jt.z)&&m.hasZ?t=A(m.boundingBox):(Jt.z=void 0,t=C(P(m.boundingBox,Ct))),l||t)return Et(await Mt(e,i,Jt,s,o,c));const n=Vt(e,m.screenSpaceObjects);return Et(await Pt(e,i,Jt,m.boundingBox,n,s,o,c))}return i.position?Et(await St(e,i,s,c,o)):Et(await Zt(e,i,s,o,c))}function dt(t,e){return null==e.scale&&null!=e.zoom?nt(t,e.zoom):e.scale}function wt(t,e){const n=dt(t,e);return n?q(n):void 0}function xt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=it(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function jt(t,e,n,r){const o=t.spatialReference||G.WGS84;if(e??=J(t,n),null==e)return r;const a=new b({spatialReference:o});return S(e.center,t.renderSpatialReference,a)?(r.targetGeometry=a,r.scale=$(t,e.distance),r.rotation=st(n.heading),r.camera=n,r):r}async function vt(t,e,n,r){const o=()=>new a("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw o();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":{const t=W(e);n=t?b.fromJSON(t):null;break}}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:r}),Ut[2]=rt(t.elevationProvider,n)??0):Ut[2]=0}const s=Xt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ut),0===c.length)throw o();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:r});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[a,f,p]of u.points)Ut[0]=a,Ut[1]=f,Ut[2]=p,V(n.boundingBox,Ut);else for(const[a,f]of u.points)Ut[0]=a,Ut[1]=f,V(n.boundingBox,Ut)}async function bt(t,e,n,o,a){const i=await r(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await vt(t,e.geometry,o,a);const s=i.value,c=await r(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await vt(t,e.geometry,o,a);const{screenSpaceObjects:l,boundingBox:m}=c.value;O(o.boundingBox,m),l&&l.forEach(t=>{o.screenSpaceObjects.push(t)}),isFinite(m[2])&&(o.hasZ=!0)}async function Rt(t,n,r,o,a){if(Array.isArray(n)&&2===n.length){const e=n[0],r=n[1];if("number"==typeof e&&"number"==typeof r)return Jt.x=e,Jt.y=r,Jt.z=void 0,Jt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await vt(t,Jt,o,a)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map(e=>Rt(t,e,r,o,a))):n instanceof j?await vt(t,n,o,a):n instanceof e&&await bt(t,n,r,o,a)}async function zt(t,e,n,r,o){if(e.camera)return Gt(t,e.camera,r,o);o.scale=e.scale,o.rotation=e.rotation,o.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,o.camera=null,null!=n.heading?o.rotation=st(n.heading):null!=n.rotation&&(o.rotation=n.rotation);const a=dt(t,n);return null!=a&&(o.scale=a),o.camera=await lt(t,o,n.tilt,r),o}async function Gt(t,e,n,r){const o=t.spatialReference,a=await R(e.position,o,{signal:n}),i=e.clone();return i.position=a,jt(t,null,i,r)}async function Bt(t,e,n,r,o,a,i){const s=t.renderSpatialReference;return await M(e,qt,s,{signal:i}),await M(n,Yt,s,{signal:i}),a.targetGeometry=new b(e),o.position=new b(n),y(Wt,qt,Yt),ot(t,Yt,Wt,r.up,o),a.scale=$(t,p(Yt,qt)),a.rotation=st(o.heading),a.camera=o,a}async function Mt(t,e,n,r,o,a){a.targetGeometry=n.clone();const i=X(t);if(e.position)return Bt(t,a.targetGeometry,e.position,i,r,a,o);if(e.zoomFactor){const n=i.distance/e.zoomFactor,r=u(Ut,i.viewForward,-n);i.eye=f(Ut,i.center,r),a.scale=$(t,n)}D(t,i,r);const s=xt(r,e)?0:1;if(!e.zoomFactor){const n=dt(t,e);if(null==n){await M(a.targetGeometry,Ut,t.renderSpatialReference,{signal:o});const e=Y(i.frustum,Ut)?p(i.eye,Ut):i.distance;a.camera=await L(t,a.targetGeometry,e,r,s),a.scale=$(t,e)}else a.scale=n,a.camera=await et(t,a.targetGeometry,a.scale,r,s,o)}return a}async function St(t,e,n,r,o){const a=X(t);g(Wt,a.viewForward),ot(t,a.eye,Wt,a.up,Dt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:o});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:Dt.heading,n.tilt=null!=e.tilt?e.tilt:Dt.tilt,jt(t,null,n,r)}async function Zt(t,e,n,r,o){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const a=X(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return S(a.center,s,c)?Mt(t,e,c,n,r,o):o}return o.scale=t.scale,o.camera=t.camera.clone(),xt(o.camera,e),o}async function Ft(t,e,n,r,o,a){a.targetGeometry=n.clone();const i=X(t);D(t,i,r);const s=xt(r,e)?0:1;return a.camera=await H(t,n,r.heading,r.tilt,s,o),a}function Tt(t,e,n,r,o){let a=0;null!=n.z?a=n.z:t.basemapTerrain&&t.elevationProvider&&(a=rt(t.elevationProvider,n)),h(Ut,n.x,n.y,a),B(t.spatialReference,Ut,kt,t.renderSpatialReference),s(Nt,kt),c(Nt,Nt),E(It);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=r[e[2]];isFinite(n)||(n=a),h(Ut,r[e[0]],r[e[1]],n),Z(Ut,t.spatialReference,Ut,t.renderSpatialReference),V(It,d(Ut,Ut,Nt))}const l=U(It),m=k(It),u=N(It),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/o}async function Pt(t,e,n,r,o,a,i,s){s.targetGeometry=n.clone();const c=X(t),l=Tt(t,c,n,r,o);D(t,c,a);const m=xt(a,e)?0:1;return s.camera=await L(t,s.targetGeometry,l,a,m,i),s.scale=$(t,l),s}function At(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function Et(t){return null!=t?.camera&&(t.rotation=st(t.camera.heading)),t}function Vt(t,e){const n=at;if(!e.length)return n;let r=Number.NEGATIVE_INFINITY;for(let o=0;o<e.length;o++){const t=e[o].screenSpaceBoundingRect;r=Math.max(r,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-r/Math.min(t.width,t.height)*2}class Ot{constructor(){this.hasZ=!1,this.boundingBox=E(),this.screenSpaceObjects=new Array}}const Ut=w(),kt=m(),Nt=l(),It=F(),Ct=I(),Wt=w(),Yt=w(),qt=w(),Dt={heading:0,tilt:0},Jt=new b,Xt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const r=t.hasZ;for(let o=0;o<t.rings.length;o++){const a=t.rings[o];for(let t=0;t<a.length;t++)n[0]=a[t][0],n[1]=a[t][1],r&&(n[2]=a[t][2]),e(n)}},polyline(t,e,n){const r=t.hasZ;for(let o=0;o<t.paths.length;o++){const a=t.paths[o];for(let t=0;t<a.length;t++)n[0]=a[t][0],n[1]=a[t][1],r&&(n[2]=a[t][2]),e(n)}},multipoint(t,e,n){const r=t.points,o=t.hasZ;for(let a=0;a<r.length;a++)n[0]=r[a][0],n[1]=r[a][1],o&&(n[2]=r[a][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{ht as create,yt as fromCamera,lt as toCameraAsync,ct as toCameraSync};
|
|
2
|
+
import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as r}from"../../../core/asyncUtils.js";import{cyclicalDegrees as a}from"../../../core/Cyclical.js";import o from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as u,add as f,distance as p,copy as g,subtract as y,set as h,transformMat3 as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectAsync as R,tryProject as z}from"../../../geometry/projectionUtils.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as S}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as B}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as M}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as Z}from"../../../geometry/projection/projectVectorToVector.js";import{create as F,center as T,toRect as P,isPoint as A,empty as E,expandWithVec3 as U,expandWithAABB as V,width as O,height as k,depth as N}from"../../../geometry/support/aaBoundingBox.js";import{create as I,isPoint as C}from"../../../geometry/support/aaBoundingRect.js";import{polygonCentroidPoint as W}from"../../../geometry/support/centroid.js";import{intersectsPoint as Y}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as q}from"../../../geometry/support/scaleUtils.js";import{fromRenderCamera as D,toRenderCameraWithScale as J}from"../webgl.js";import{cameraOnContentAlongViewDirection as X}from"../camera/intersectionUtils.js";import{scaleToDistance as _,distanceToScale as H}from"./cameraScaleUtils.js";import{getViewSR as K,fromExtentAsync as L,fromCenterDistanceAsync as Q,fromExtentSync as $,fromCenterDistanceSync as tt,zoomToScale as et,fromCenterScale as nt}from"./cameraUtils.js";import{getElevationAtPoint as rt}from"./ElevationProvider.js";import{directionToHeadingTilt as at}from"./viewingModeUtils.js";const ot=.66;function it(t){return 360-a.normalize(t)}function st(t){return a.normalize(360-t)}function ct(t,e,n){const r=e.camera;if(null!=r)return mt(r,K(t));const{targetGeometry:a}=e;if(null==a)return null;const{camera:o,mode:i}=ft(t,e.rotation,n);if("point"===a.type)return pt(t,e,a,o,i);const s=a.extent;return null==s?null:$(t,s,o.heading,o.tilt,i)}async function lt(t,e,n,r){const a=e.camera;if(null!=a)return ut(a,K(t),r);const{targetGeometry:o}=e;if(null==o)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ft(t,e.rotation,n);if("point"===o.type)return gt(t,e,o,i,s,r);const c=o.extent;if(null==c)throw new Error("Target geometry has no extent!");return L(t,c,i.heading,i.tilt,s,r)}function mt(t,e){const n=t.position,r=z(n,e);if(!r)return null;const a=t.clone();return a.position=r.clone(),a}async function ut(t,e,n){const r=t.position,a=await R(r,e,{signal:n});i(n);const o=t.clone();return o.position=a.clone(),o}function ft(t,e,n){const r=D(t,t.state.camera);let a=1;return null!=e&&(r.heading=it(e),a=0),null!=n&&(r.tilt=n),{camera:r,mode:a}}function pt(t,e,n,r,a){const o=t.spatialReference,i=z(n.clone(),o);if(!i)return null;const s=null!=e.scale?_(t,e.scale):t.state.camera.distance;return tt(t,i,s,r,a)}async function gt(t,e,n,r,a,o){const s=t.spatialReference,c=await R(n.clone(),s,{signal:o});i(o);const l=null!=e.scale?_(t,e.scale):t.state.camera.distance;return Q(t,c,l,r,a,o)}function yt(t,e,r=null){return null==r&&(r=new n),jt(t,null,e.clone(),r)}async function ht(e,r,a){const i=At(e,r);if(!i)throw new o("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return Et(await zt(e,i.target,i,a,c))}if(i.target instanceof t)return Et(await Gt(e,i.target,a,c,dt(e,i)));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return Et(l||t?await Bt(e,i,i.target.center,s,a,c):await Ft(e,i,i.target,s,a,c))}const m=new Vt,u=l?wt(e,i):void 0;if(await Rt(e,i.target,u,m,a),isFinite(m.boundingBox[0])){let t;if(T(m.boundingBox,Ot),Jt.x=Ot[0],Jt.y=Ot[1],Jt.z=Ot[2],Jt.spatialReference=e.spatialReference,isFinite(Jt.z)&&m.hasZ?t=A(m.boundingBox):(Jt.z=void 0,t=C(P(m.boundingBox,Ct))),l||t)return Et(await Bt(e,i,Jt,s,a,c));const n=Ut(e,m.screenSpaceObjects);return Et(await Pt(e,i,Jt,m.boundingBox,n,s,a,c))}return i.position?Et(await Mt(e,i,s,c,a)):Et(await Zt(e,i,s,a,c))}function dt(t,e){return null==e.scale&&null!=e.zoom?et(t,e.zoom):e.scale}function wt(t,e){const n=dt(t,e);return n?q(n):void 0}function xt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=it(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function jt(t,e,n,r,a){const o=t.spatialReference||G.WGS84;if(e??=J(t,n,a),null==e)return r;const i=new b({spatialReference:o});return M(e.center,t.renderSpatialReference,i)?(r.targetGeometry=i,r.scale=a??H(t,e.distance),r.rotation=st(n.heading),r.camera=n,r):r}async function vt(t,e,n,r){const a=()=>new o("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw a();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":{const t=W(e);n=t?b.fromJSON(t):null;break}}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:r}),Ot[2]=rt(t.elevationProvider,n)??0):Ot[2]=0}const s=Xt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ot),0===c.length)throw a();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:r});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[o,f,p]of u.points)Ot[0]=o,Ot[1]=f,Ot[2]=p,U(n.boundingBox,Ot);else for(const[o,f]of u.points)Ot[0]=o,Ot[1]=f,U(n.boundingBox,Ot)}async function bt(t,e,n,a,o){const i=await r(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await vt(t,e.geometry,a,o);const s=i.value,c=await r(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await vt(t,e.geometry,a,o);const{screenSpaceObjects:l,boundingBox:m}=c.value;V(a.boundingBox,m),l&&l.forEach(t=>{a.screenSpaceObjects.push(t)}),isFinite(m[2])&&(a.hasZ=!0)}async function Rt(t,n,r,a,o){if(Array.isArray(n)&&2===n.length){const e=n[0],r=n[1];if("number"==typeof e&&"number"==typeof r)return Jt.x=e,Jt.y=r,Jt.z=void 0,Jt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await vt(t,Jt,a,o)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map(e=>Rt(t,e,r,a,o))):n instanceof j?await vt(t,n,a,o):n instanceof e&&await bt(t,n,r,a,o)}async function zt(t,e,n,r,a){if(e.camera)return Gt(t,e.camera,r,a,dt(t,n)??e.scale);a.scale=e.scale,a.rotation=e.rotation,a.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,a.camera=null,null!=n.heading?a.rotation=st(n.heading):null!=n.rotation&&(a.rotation=n.rotation);const o=dt(t,n);return null!=o&&(a.scale=o),a.camera=await lt(t,a,n.tilt,r),a}async function Gt(t,e,n,r,a){const o=t.spatialReference,i=await R(e.position,o,{signal:n}),s=e.clone();return s.position=i,jt(t,null,s,r,a)}async function St(t,e,n,r,a,o,i){const s=t.renderSpatialReference;return await B(e,qt,s,{signal:i}),await B(n,Yt,s,{signal:i}),o.targetGeometry=new b(e),a.position=new b(n),y(Wt,qt,Yt),at(t,Yt,Wt,r.up,a),o.scale=H(t,p(Yt,qt)),o.rotation=st(a.heading),o.camera=a,o}async function Bt(t,e,n,r,a,o){o.targetGeometry=n.clone();const i=X(t);if(e.position)return St(t,o.targetGeometry,e.position,i,r,o,a);if(e.zoomFactor){const n=i.distance/e.zoomFactor,r=u(Ot,i.viewForward,-n);i.eye=f(Ot,i.center,r),o.scale=H(t,n)}D(t,i,r);const s=xt(r,e)?0:1;if(!e.zoomFactor){const n=dt(t,e);if(null==n){await B(o.targetGeometry,Ot,t.renderSpatialReference,{signal:a});const e=Y(i.frustum,Ot)?p(i.eye,Ot):i.distance;o.camera=await Q(t,o.targetGeometry,e,r,s),o.scale=H(t,e)}else o.scale=n,o.camera=await nt(t,o.targetGeometry,o.scale,r,s,a)}return o}async function Mt(t,e,n,r,a){const o=X(t);g(Wt,o.viewForward),at(t,o.eye,Wt,o.up,Dt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:a});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:Dt.heading,n.tilt=null!=e.tilt?e.tilt:Dt.tilt,jt(t,null,n,r,dt(t,e))}async function Zt(t,e,n,r,a){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const o=X(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return M(o.center,s,c)?Bt(t,e,c,n,r,a):a}return a.scale=t.scale,a.camera=t.camera.clone(),xt(a.camera,e),a}async function Ft(t,e,n,r,a,o){o.targetGeometry=n.clone();const i=X(t);D(t,i,r);const s=xt(r,e)?0:1;return o.camera=await L(t,n,r.heading,r.tilt,s,a),o}function Tt(t,e,n,r,a){let o=0;null!=n.z?o=n.z:t.basemapTerrain&&t.elevationProvider&&(o=rt(t.elevationProvider,n)),h(Ot,n.x,n.y,o),S(t.spatialReference,Ot,kt,t.renderSpatialReference),s(Nt,kt),c(Nt,Nt),E(It);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=r[e[2]];isFinite(n)||(n=o),h(Ot,r[e[0]],r[e[1]],n),Z(Ot,t.spatialReference,Ot,t.renderSpatialReference),U(It,d(Ot,Ot,Nt))}const l=O(It),m=k(It),u=N(It),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/a}async function Pt(t,e,n,r,a,o,i,s){s.targetGeometry=n.clone();const c=X(t),l=Tt(t,c,n,r,a);D(t,c,o);const m=xt(o,e)?0:1;return s.camera=await Q(t,s.targetGeometry,l,o,m,i),s.scale=H(t,l),s}function At(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function Et(t){return null!=t?.camera&&(t.rotation=st(t.camera.heading)),t}function Ut(t,e){const n=ot;if(!e.length)return n;let r=Number.NEGATIVE_INFINITY;for(let a=0;a<e.length;a++){const t=e[a].screenSpaceBoundingRect;r=Math.max(r,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-r/Math.min(t.width,t.height)*2}class Vt{constructor(){this.hasZ=!1,this.boundingBox=E(),this.screenSpaceObjects=new Array}}const Ot=w(),kt=m(),Nt=l(),It=F(),Ct=I(),Wt=w(),Yt=w(),qt=w(),Dt={heading:0,tilt:0},Jt=new b,Xt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const r=t.hasZ;for(let a=0;a<t.rings.length;a++){const o=t.rings[a];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],r&&(n[2]=o[t][2]),e(n)}},polyline(t,e,n){const r=t.hasZ;for(let a=0;a<t.paths.length;a++){const o=t.paths[a];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],r&&(n[2]=o[t][2]),e(n)}},multipoint(t,e,n){const r=t.points,a=t.hasZ;for(let o=0;o<r.length;o++)n[0]=r[o][0],n[1]=r[o][1],a&&(n[2]=r[o][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{ht as create,yt as fromCamera,lt as toCameraAsync,ct as toCameraSync};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{destroyMaybe as e}from"../../../../../core/maybe.js";import{set as t,transformMat3 as a,add as r}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i}from"../../../../../geometry/support/aaBoundingBox.js";import{encodeSymbolColor as s}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as n}from"../../../support/orientedBoundingBox.js";import{ComponentParametersUniform as l,ComponentParametersVarying as m}from"./ComponentDrawParameters.js";import{UniformComponentParameters as h}from"./UniformComponentParameters.js";import{olidEnabled as c}from"../../effects/geometry/olidUtils.js";import{defaultHighlightName as d}from"../../../../support/HighlightDefaults.js";class p{constructor(e,t,a,r,o,i){this._collection=e,this.transform=t,this.obb=a,this._componentData=r,this._renderable=o,this._intersectionGeometry=i,this.visible=!1,this.offsetObb=null,this._aabbInWorldCoordinates=null}destroy(){this._collection.materials.release(this._renderable.material),this._intersectionGeometry=e(this._intersectionGeometry),this._renderable=e(this._renderable),this._componentData=e(this._componentData)}get componentData(){return this._componentData}get renderable(){return this._renderable}get intersectionGeometry(){return this._intersectionGeometry}updateMaterial(e,t){const{_renderable:a}=this,r=a.material,o=this._collection.materials.acquire({...r.parameters,opacity:a.opacity,...e},a.geometry.parameters,t??a.drawParameters.componentParameters);this._collection.materials.release(r),o!==r&&a.updateMaterial(o)}get opacity(){return this.renderable.opacity}updateOpacity(e){this.opacity!==e&&(this._renderable.updateOpacity(e),this.updateMaterial({opacity:e}))}updateCameraDerivedParameters(e){const{eye:t}=e,{centerX:a,centerY:r,centerZ:o}=this.obb;this._renderable.meta.cameraDepthSquared=(t[0]-a)**2+(t[1]-r)**2+(t[2]-o)**2}setComponentData(e,t){const a=this._componentData,{materialDataBuffer:r,materialDataIndices:o}=a,i=new h,d=r.textureBuffer,p=d.getVec4Field("colorAndCastShadows"),f=d.getScalarField("elevationOffset"),b=d.getScalarField("emissiveStrength"),g=d.getScalarField("emissiveSourceMode"),y=d.getVec4Field("olidColor"),_=new Uint8Array(4),v=new Uint32Array(_.buffer);let M,w=0,C=0,S=0,x=0,D=0,O=a.verticalOffsets,P=1/0,j=-1/0,A=!1,I=!1,k=!1,G=0;for(let n=0;n<a.count;n++){e(n,i),w+=+(i.externalColor[3]<1),C+=+(3===i.externalColorMixMode&&1===i.externalColor[3]),x+=+(i.emissiveStrength>0),D+=+(1===i.emissiveSource),I||=1!==i.emissiveStrength,S+=+i.castShadows,s(i.externalColor,i.externalColorMixMode,_),_[2]=254&_[2]|+i.castShadows,p.setArray(o[n],_),A||=n>0&&G!==v[0],G=v[0],k||=0!==i.elevationOffset,k&&null==O&&(O=new Array(n).fill(0)),null!=O&&(O[n]=i.elevationOffset),P=Math.min(P,i.elevationOffset),j=Math.max(j,i.elevationOffset),f.set(o[n],i.elevationOffset),b.set(o[n],i.emissiveStrength),g.set(o[n],0===i.emissiveSource?0:255);const t=i.olidColor;null!=t&&y.setArray(o[n],t),i.pickable!==a.isPickable(n)&&a.updatePickabilityWithCount(n,i.pickable)}if(a.verticalOffsets=k?O:null,this.offsetObb=k?n(this.obb,P,j,t,this.offsetObb??this.obb.clone()):null,A||k||c()||(I||D>0)&&x>0){const{count:e}=a;M=new m(u(w,e),u(C,e),u(x,e),u(D,e),u(S,e)),d.updateTexture(),this._renderable.updateComponentParametersVarying(M,d)}else M=new l(i.externalColor,i.externalColorMixMode,i.emissiveStrength,i.emissiveSource,i.castShadows?0:2),this._renderable.updateComponentParametersUniform(M);this.updateMaterial({},M)}addHighlight(e,t){return this._componentData.addComponentHighlight(e,t)}removeHighlight(e,t){return this._componentData.removeComponentHighlight(e,t)}clearHighlights(){this._componentData.clearHighlights()}get aabbInWorldCoordinates(){let e=this._aabbInWorldCoordinates;return e||(e=this._computeAabbInWorldCoordinates(),this._aabbInWorldCoordinates=e),e}_computeAabbInWorldCoordinates(){const e=i(),{positions:
|
|
2
|
+
import{destroyMaybe as e}from"../../../../../core/maybe.js";import{set as t,transformMat3 as a,add as r}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i}from"../../../../../geometry/support/aaBoundingBox.js";import{encodeSymbolColor as s}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as n}from"../../../support/orientedBoundingBox.js";import{ComponentParametersUniform as l,ComponentParametersVarying as m}from"./ComponentDrawParameters.js";import{UniformComponentParameters as h}from"./UniformComponentParameters.js";import{olidEnabled as c}from"../../effects/geometry/olidUtils.js";import{defaultHighlightName as d}from"../../../../support/HighlightDefaults.js";class p{constructor(e,t,a,r,o,i){this._collection=e,this.transform=t,this.obb=a,this._componentData=r,this._renderable=o,this._intersectionGeometry=i,this.visible=!1,this.offsetObb=null,this._aabbInWorldCoordinates=null}destroy(){this._collection.materials.release(this._renderable.material),this._intersectionGeometry=e(this._intersectionGeometry),this._renderable=e(this._renderable),this._componentData=e(this._componentData)}get componentData(){return this._componentData}get renderable(){return this._renderable}get intersectionGeometry(){return this._intersectionGeometry}updateMaterial(e,t){const{_renderable:a}=this,r=a.material,o=this._collection.materials.acquire({...r.parameters,opacity:a.opacity,...e},a.geometry.parameters,t??a.drawParameters.componentParameters);this._collection.materials.release(r),o!==r&&a.updateMaterial(o)}get opacity(){return this.renderable.opacity}updateOpacity(e){this.opacity!==e&&(this._renderable.updateOpacity(e),this.updateMaterial({opacity:e}))}updateCameraDerivedParameters(e){const{eye:t}=e,{centerX:a,centerY:r,centerZ:o}=this.obb;this._renderable.meta.cameraDepthSquared=(t[0]-a)**2+(t[1]-r)**2+(t[2]-o)**2}setComponentData(e,t){const a=this._componentData,{materialDataBuffer:r,materialDataIndices:o}=a,i=new h,d=r.textureBuffer,p=d.getVec4Field("colorAndCastShadows"),f=d.getScalarField("elevationOffset"),b=d.getScalarField("emissiveStrength"),g=d.getScalarField("emissiveSourceMode"),y=d.getVec4Field("olidColor"),_=new Uint8Array(4),v=new Uint32Array(_.buffer);let M,w=0,C=0,S=0,x=0,D=0,O=a.verticalOffsets,P=1/0,j=-1/0,A=!1,I=!1,k=!1,G=0;for(let n=0;n<a.count;n++){e(n,i),w+=+(i.externalColor[3]<1),C+=+(3===i.externalColorMixMode&&1===i.externalColor[3]),x+=+(i.emissiveStrength>0),D+=+(1===i.emissiveSource),I||=1!==i.emissiveStrength,S+=+i.castShadows,s(i.externalColor,i.externalColorMixMode,_),_[2]=254&_[2]|+i.castShadows,p.setArray(o[n],_),A||=n>0&&G!==v[0],G=v[0],k||=0!==i.elevationOffset,k&&null==O&&(O=new Array(n).fill(0)),null!=O&&(O[n]=i.elevationOffset),P=Math.min(P,i.elevationOffset),j=Math.max(j,i.elevationOffset),f.set(o[n],i.elevationOffset),b.set(o[n],i.emissiveStrength),g.set(o[n],0===i.emissiveSource?0:255);const t=i.olidColor;null!=t&&y.setArray(o[n],t),i.pickable!==a.isPickable(n)&&a.updatePickabilityWithCount(n,i.pickable)}if(a.verticalOffsets=k?O:null,this.offsetObb=k?n(this.obb,P,j,t,this.offsetObb??this.obb.clone()):null,A||k||c()||(I||D>0)&&x>0){const{count:e}=a;M=new m(u(w,e),u(C,e),u(x,e),u(D,e),u(S,e)),d.updateTexture(),this._renderable.updateComponentParametersVarying(M,d)}else M=new l(i.externalColor,i.externalColorMixMode,i.emissiveStrength,i.emissiveSource,i.castShadows?0:2),this._renderable.updateComponentParametersUniform(M);this.updateMaterial({},M)}addHighlight(e,t){return this._componentData.addComponentHighlight(e,t)}removeHighlight(e,t){return this._componentData.removeComponentHighlight(e,t)}clearHighlights(){this._componentData.clearHighlights()}get aabbInWorldCoordinates(){let e=this._aabbInWorldCoordinates;return e||(e=this._computeAabbInWorldCoordinates(),this._aabbInWorldCoordinates=e),e}_computeAabbInWorldCoordinates(){const e=i(),{positions:o}=this._intersectionGeometry;if(Math.floor(o.length/3)>0){const{rotationScale:i,position:s}=this.transform;let n=1/0,l=1/0,m=1/0,h=-1/0,c=-1/0,d=-1/0;const p=g;for(let e=0;e<o.length;e+=3)t(p,o[e+0],o[e+1],o[e+2]),a(p,p,i),r(p,p,s),n=Math.min(n,p[0]),l=Math.min(l,p[1]),m=Math.min(m,p[2]),h=Math.max(h,p[0]),c=Math.max(c,p[1]),d=Math.max(d,p[2]);e[0]=n,e[1]=l,e[2]=m,e[3]=h,e[4]=c,e[5]=d}return e}submit(e,t){const{componentData:a,renderable:r}=this;if(r.drawParameters.opacity<=0)return;const{geometry:o,drawParameters:i,material:s}=r,n=r.meta.cameraDepthSquared,{geometryRanges:l,highlightRangesMap:m,shadowmapRanges:h}=a,c=e=>e.submitDraw(s,i,o,l,n);switch(s.materialPass){case 0:c(e.opaque);break;case 1:c(e.transparent);break;case 2:c(e.opaque),c(e.transparent);break;case 3:c(e.integratedMesh),f(t)&&c(e.occludedGround),b(t)&&c(e.highlightIntegratedMesh);break;case 4:c(e.transparentIntegratedMesh)}if(i.castAnyShadows){if(null!=m)for(const t of m)t[0]===d&&e.highlightShadowMap.submitDraw(s,i,o,t[1],n,t[0]);null!=h&&e.defaultShadowMap.submitDraw(s,i,o,h,n),c(e.shadowMap)}if(null!=m)for(const d of m)e.highlight.submitDraw(s,i,o,d[1],n,d[0]);t.viewshedEnabled&&c(e.viewshedShadowMap)}}function u(e,t){return e===t?0:0===e?2:1}function f(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}function b(e){return null!=e.overlay?.getTexture(2)}const g=o();export{p as ComponentObject};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as e}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as r}from"../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as t}from"../../../core/shaderModules/FloatDrawUniform.js";import{glsl as
|
|
2
|
+
import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as e}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as r}from"../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as t}from"../../../core/shaderModules/FloatDrawUniform.js";import{glsl as n,If as d}from"../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as a}from"../../../core/shaderModules/IntegerDrawUniform.js";import{Texture2DUintDrawUniform as l}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{olidEnabled as i}from"../../../effects/geometry/olidUtils.js";import{componentDataLayout as s,componentDataOlidLayout as c}from"../../../materials/DefaultLayouts.js";import{oitResolution as u}from"../../../shaders/oitResolution.glsl.js";function m(o,e){switch(e.componentDataType){case 1:return M(o,e);case 0:return h(o,e);case 2:return;default:e.componentDataType}}const f=(o,e)=>"emissiveSourceMode"===o||"emissiveStrength"===o?e.hasEmission:"olidColor"!==o||11===e.output,v=new l("componentTextureBuffer",o=>o.textureBackedBuffer?.texture),C=new e({layout:s,itemIndexAttribute:"componentIndex",bufferUniform:v,fieldFilter:f}),x=new e({layout:c,itemIndexAttribute:"componentIndex",bufferUniform:v,fieldFilter:f});function p(){return i()?x:C}function M(e,r){const{vertex:t,fragment:a}=e,{output:l,hasEmission:i,useFloatBlend:s}=r,c=11===l,{getTextureAttribute:m,TextureBackedBufferModule:f}=p();e.include(f,r),e.attributes.add("componentIndex","uint"),e.varyings.add("vExternalColorMixMode","mediump float"),e.varyings.add("vExternalColor","vec4"),c&&e.varyings.add("vObjectAndLayerIdColor","vec4"),i&&(e.varyings.add("emissiveStrength","float"),e.varyings.add("emissiveSource","int")),e.include(o),t.include(u,r),t.code.add(n`
|
|
3
3
|
float readElevationOffset() {
|
|
4
|
-
return ${
|
|
4
|
+
return ${m("elevationOffset")};
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
void forwardEmissiveStrength() {
|
|
8
|
-
${
|
|
9
|
-
|
|
8
|
+
${d(i,n`emissiveStrength = ${m("emissiveStrength")};
|
|
9
|
+
${d(!s,"emissiveStrength = clamp(emissiveStrength, 0.0, floatBlendInputScale);")}
|
|
10
|
+
emissiveSource = ${m("emissiveSourceMode")} == 0u ? 0 : 1;`)}
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
void forwardObjectAndLayerIdColor() {
|
|
13
|
-
${
|
|
14
|
+
${d(c,n`vObjectAndLayerIdColor = vec4(${m("olidColor")})/255.0;`)}
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
void decodeColorAndCastShadow(uvec4 colorAndCastShadowEncoded, out vec4 color, out bool castShadow) {
|
|
@@ -22,7 +23,7 @@ import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBa
|
|
|
22
23
|
|
|
23
24
|
vec4 forwardExternalColor(out bool castShadows) {
|
|
24
25
|
vec4 componentColor;
|
|
25
|
-
decodeColorAndCastShadow(${
|
|
26
|
+
decodeColorAndCastShadow(${m("colorAndCastShadows")}, componentColor, castShadows);
|
|
26
27
|
|
|
27
28
|
int decodedColorMixMode;
|
|
28
29
|
vExternalColor = decodeSymbolColor(componentColor, decodedColorMixMode) * 0.003921568627451; // = 1/255;
|
|
@@ -30,16 +31,16 @@ import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBa
|
|
|
30
31
|
|
|
31
32
|
return vExternalColor;
|
|
32
33
|
}
|
|
33
|
-
`),a.code.add(
|
|
34
|
+
`),a.code.add(n`
|
|
34
35
|
void readExternalColor(out vec4 externalColor, out int externalColorMixMode) {
|
|
35
36
|
externalColor = vExternalColor;
|
|
36
37
|
externalColorMixMode = int(vExternalColorMixMode);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
void outputObjectAndLayerIdColor() {
|
|
40
|
-
${
|
|
41
|
+
${c?n`fragColor = vObjectAndLayerIdColor;`:""}
|
|
41
42
|
}
|
|
42
|
-
`)}function
|
|
43
|
+
`)}function h(o,e){const{vertex:l,fragment:i}=o;o.varyings.add("vExternalColor","vec4"),i.uniforms.add(new t("emissiveStrength",o=>o.componentParameters.emissiveStrength)),l.uniforms.add(new r("externalColor",o=>o.componentParameters.externalColor)).code.add(n`float readElevationOffset() {
|
|
43
44
|
return 0.0;
|
|
44
45
|
}
|
|
45
46
|
void forwardObjectAndLayerIdColor() {}
|
|
@@ -48,13 +49,13 @@ vec4 forwardExternalColor(out bool castShadows) {
|
|
|
48
49
|
vExternalColor = externalColor;
|
|
49
50
|
castShadows = true;
|
|
50
51
|
return externalColor;
|
|
51
|
-
}`);const s=11===e.output;i.uniforms.add(new a("externalColorMixMode",o=>o.componentParameters.externalColorMixMode)).code.add(
|
|
52
|
+
}`);const s=11===e.output;i.uniforms.add(new a("externalColorMixMode",o=>o.componentParameters.externalColorMixMode)).code.add(n`
|
|
52
53
|
void readExternalColor(out vec4 color, out int colorMixMode) {
|
|
53
54
|
color = vExternalColor;
|
|
54
55
|
colorMixMode = externalColorMixMode;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
void outputObjectAndLayerIdColor() {
|
|
58
|
-
${
|
|
59
|
+
${d(s,"fragColor = vec4(0, 0, 0, 0);")}
|
|
59
60
|
}
|
|
60
|
-
`)}export{
|
|
61
|
+
`)}export{m as ComponentData};
|