@arcgis/core 5.2.0-next.137 → 5.2.0-next.139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/LineOfSightAnalysisObserver.d.ts +12 -0
- package/analysis/LineOfSightAnalysisObserver.js +1 -1
- package/analysis/LineOfSightAnalysisTarget.d.ts +12 -0
- package/analysis/LineOfSightAnalysisTarget.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/sources/FeatureLayerParquet.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/featureset/support/stats.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/fieldStats.js +1 -1
- package/arcgisGlobal.d.ts +5 -1
- package/assets/components/assets/icon/blockHeightMedium16.json +1 -0
- package/assets/components/assets/icon/blockHeightMedium24.json +1 -0
- package/assets/components/assets/icon/blockHeightMedium32.json +1 -0
- package/assets/components/assets/icon/blockHeightShort16.json +1 -0
- package/assets/components/assets/icon/blockHeightShort24.json +1 -0
- package/assets/components/assets/icon/blockHeightShort32.json +1 -0
- package/assets/components/assets/icon/blockHeightTall16.json +1 -0
- package/assets/components/assets/icon/blockHeightTall24.json +1 -0
- package/assets/components/assets/icon/blockHeightTall32.json +1 -0
- package/assets/components/assets/icon/cursorCircle16.json +1 -0
- package/assets/components/assets/icon/cursorCircle24.json +1 -0
- package/assets/components/assets/icon/cursorCircle32.json +1 -0
- package/assets/components/assets/icon/dictionary16.json +1 -0
- package/assets/components/assets/icon/dictionary24.json +1 -0
- package/assets/components/assets/icon/dictionary32.json +1 -0
- package/assets/components/assets/icon/jobDependency16.json +1 -0
- package/assets/components/assets/icon/jobDependency24.json +1 -0
- package/assets/components/assets/icon/jobDependency32.json +1 -0
- package/assets/components/assets/icon/referenceChip16.json +1 -0
- package/assets/components/assets/icon/referenceChip24.json +1 -0
- package/assets/components/assets/icon/referenceChip32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{4e6f95d8c624d513849a.js → 05963f57cbe5a5249496.js} +1 -1
- package/assets/esri/core/workers/chunks/{0b8681ca4a83e97f1f71.js → 067de1910190da228291.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c0fd1c6cda44e9f40ab.js → 070684943698fa43c2b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc1cb4b9a02e6c78deb7.js → 076e8d2e08ff2a013736.js} +1 -1
- package/assets/esri/core/workers/chunks/{c10e040368065411506a.js → 10445313d0d57b34511b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d537c59b46cdaaf66034.js → 1188d0a136fffc009643.js} +1 -1
- package/assets/esri/core/workers/chunks/1380cec385426673f294.js +1 -0
- package/assets/esri/core/workers/chunks/{20af3f085f60c32c6c53.js → 178083d8ed7707b45ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5efe3e800c6e23efcf3.js → 1819c45655c836b9a8d7.js} +1 -1
- package/assets/esri/core/workers/chunks/1b946714ca4a1a7359d4.js +2 -0
- package/assets/esri/core/workers/chunks/{d8d8b38ac8a91d9e45fc.js → 1cc744ab5eee5ee3bed8.js} +1 -1
- package/assets/esri/core/workers/chunks/{05e39b4de7f62c5b22cc.js → 20f75cc777af13fa249b.js} +1 -1
- package/assets/esri/core/workers/chunks/2671035cc08027185737.js +1 -0
- package/assets/esri/core/workers/chunks/2a1ec30f9ad305763f81.js +2 -0
- package/assets/esri/core/workers/chunks/34570e6bbf559f18c1a5.js +1 -0
- package/assets/esri/core/workers/chunks/{60f6d5da9480dd36e877.js → 3dddae78286d05eb10fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{9efd30bbd02ec0d1031b.js → 3ec3589f6e74d7cb87cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{0bec054fca104f3bf141.js → 3f776d9fd2ab68b21fca.js} +1 -1
- package/assets/esri/core/workers/chunks/3f946c13ad97fbed867b.js +1 -0
- package/assets/esri/core/workers/chunks/402a82c77420254831bc.js +1 -0
- package/assets/esri/core/workers/chunks/{e2ebf0ea3af2e6907987.js → 406f24ec13eb30d43405.js} +1 -1
- package/assets/esri/core/workers/chunks/43fc42405167a5537039.js +1 -0
- package/assets/esri/core/workers/chunks/{ddedc414bb478b376221.js → 46b2d4addfc73f9183a4.js} +1 -1
- package/assets/esri/core/workers/chunks/498d6dfd3bb0d3490548.js +1 -0
- package/assets/esri/core/workers/chunks/{36ef86701883a20dd6f6.js → 4a640548032355e57acd.js} +1 -1
- package/assets/esri/core/workers/chunks/5566f14afb63065e438f.js +1 -0
- package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js → 590e6c70206122e4cc3c.js} +2 -2
- package/assets/esri/core/workers/chunks/{54860dd53a46cf4c47f3.js → 59295b99bdff4045a0e7.js} +1 -1
- package/assets/esri/core/workers/chunks/5aeb5e18514644fe2cf9.js +1 -0
- package/assets/esri/core/workers/chunks/{5da86409d70098fc6a10.js → 5b3cfe95314a75a735c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{a54678bfa0f1807b61cd.js → 5c855af73ee3c3e764fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8b7e6198c2d0c37c9a0.js → 5e90c1b49f2b7e21d05a.js} +4 -4
- package/assets/esri/core/workers/chunks/{30f808cac8a34f95ea6e.js → 6079d27f4ab319fb8f0c.js} +1 -1
- package/assets/esri/core/workers/chunks/66c2a28a851130b87c04.js +1 -0
- package/assets/esri/core/workers/chunks/{dac90b3631f7f7158f68.js → 67f15538c51838201fc7.js} +1 -1
- package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js → 68d8ae42ab71d01a70a5.js} +2 -2
- package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +1 -0
- package/assets/esri/core/workers/chunks/{864e7030c4ddbfcf0114.js → 6ccf9535013fe672c93b.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba7f0cf7e495d3ec2d55.js → 6e62581d933e7298d1f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{83b5dd4029e00abd80bf.js → 700b1d5bc67b7e1b3ff3.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9fea72cc222a30ef2f9.js → 72399062767abdfb0bee.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a7fbfd77002a24bf737.js → 747461bb6a1bc2f0a64d.js} +1 -1
- package/assets/esri/core/workers/chunks/{c333f6ed42985bb2b11f.js → 7851aef196eea5d6c94e.js} +1 -1
- package/assets/esri/core/workers/chunks/{f0b6bd6fab5320c3082f.js → 7a05b18f655c1167ce0a.js} +1 -1
- package/assets/esri/core/workers/chunks/{04296b75d0f81fbd1bb5.js → 864194927d05ebc4cc31.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c4a13a9f0b305394a26.js → 876f7633c15f1e31078d.js} +1 -1
- package/assets/esri/core/workers/chunks/{b547b3bce729c9dac90d.js → 898359be6996fd9763b8.js} +1 -1
- package/assets/esri/core/workers/chunks/8b1c17cc52d989924313.js +1 -0
- package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +1 -0
- package/assets/esri/core/workers/chunks/8dc1c3042267618fd710.js +2 -0
- package/assets/esri/core/workers/chunks/{625f02db93d7fbf175ca.js → 9001e9a1e81bce175ddd.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ffa6c8d93d3443834c6.js → 912080c90b5cc2e817cf.js} +1 -1
- package/assets/esri/core/workers/chunks/96c50a0dda0f1503ef92.js +2 -0
- package/assets/esri/core/workers/chunks/{13e4379441499599c3b5.js → 9cbde13e536676767900.js} +1 -1
- package/assets/esri/core/workers/chunks/{408db4f32850b77264ae.js → 9cd3fcb5fca6f9dbbcd8.js} +1 -1
- package/assets/esri/core/workers/chunks/a054da6cbd8ee4774a57.js +1 -0
- package/assets/esri/core/workers/chunks/{468fa166608ffc9108d9.js → a05790444115e4cf1bcc.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1f2685782b423ef87a6.js → a556dd4e9e6d35e33a2c.js} +1 -1
- package/assets/esri/core/workers/chunks/acfa03c65ba3ca6c5685.js +1 -0
- package/assets/esri/core/workers/chunks/{00d576d355599c88931e.js → bc38def1983089514e4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{0725e515f3004bdd5c56.js → ca2adcbcf44454484fd5.js} +1 -1
- package/assets/esri/core/workers/chunks/{f3507b9e831ffd7a6bf8.js → cca8bd07bcd1d267a2e8.js} +1 -1
- package/assets/esri/core/workers/chunks/cfae60b9d2f2939e9c16.js +1 -0
- package/assets/esri/core/workers/chunks/{1d6b2a64f4e40e5cc13d.js → d201fbf3ceff946d2bd6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4439078780d9ba49fd26.js → d51bb11baadc741c46bc.js} +1 -1
- package/assets/esri/core/workers/chunks/db1ab9b9c8bf5c7635d3.js +1 -0
- package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +1 -0
- package/assets/esri/core/workers/chunks/e630f3c56c077cb2bd8e.js +1 -0
- package/assets/esri/core/workers/chunks/e81173724e8de8c1e65b.js +1 -0
- package/assets/esri/core/workers/chunks/{2025288bed125594ceda.js → f6e62d2d279a328cbed7.js} +1 -1
- package/assets/esri/core/workers/chunks/{47c19778fcee7154ca38.js → f8bc474434fd365ab174.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a20dc26cb9c7b2087cf.js → f95a1f878c9c1146180e.js} +1 -1
- package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-TW.json +1 -1
- package/chunks/Bufferer-CclWhXVb.js +1 -1
- package/chunks/Component.glsl.js +3 -3
- package/chunks/DefaultMaterial.glsl.js +2 -2
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Envelope2D.js +1 -1
- package/chunks/FocusArea.glsl.js +8 -10
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/GeometryCleaner-CIE8Wfmb.js +1 -1
- package/chunks/LineMarker.glsl.js +35 -42
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorAffineTransform.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorDensify.js +1 -1
- package/chunks/OperatorDistance.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorGraphicBuffer.js +1 -1
- package/chunks/OperatorIntegrate.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/Path.glsl.js +2 -2
- package/chunks/Point2D.js +1 -1
- package/chunks/RealisticTree.glsl.js +2 -2
- package/chunks/RibbonLine.glsl.js +50 -56
- package/chunks/SideCalculator2D-DX0718xq.js +1 -1
- package/chunks/Terrain.glsl.js +2 -2
- package/chunks/Transformation2D.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/config.js +1 -1
- package/core/sql/AggregateFunctions.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/editing/fieldUtils.d.ts +12 -0
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/interfaces.d.ts +15 -18
- package/kernel.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/list/LayerItemCollection.d.ts +1 -0
- package/layers/list/types.d.ts +5 -1
- package/layers/support/TimeSeriesCalculation.d.ts +1 -1
- package/layers/support/TimeSeriesCalculation.js +1 -1
- package/layers/support/dataSeriesUtils.d.ts +10 -0
- package/layers/support/timeSeriesUtils.js +17 -6
- package/legend/ActiveLayerInfo.d.ts +2 -2
- package/legend/{LegendContent.d.ts → LegendModel.d.ts} +10 -10
- package/legend/{LegendContent.js → LegendModel.js} +1 -1
- package/legend/types.d.ts +4 -4
- package/libs/lyr3d/Lyr3DModule.js +1 -1
- package/networks/UtilityNetwork.d.ts +15 -0
- package/networks/UtilityNetwork.js +1 -1
- package/package.json +4 -4
- package/popup/FeatureContent.d.ts +24 -2
- package/popup/FeatureContent.js +1 -1
- package/popup/FeatureContentCollection.d.ts +3 -10
- package/popup/FeatureContentCollection.js +1 -1
- package/popup/actions.js +1 -1
- package/popup/support/featureUtils.js +1 -1
- package/renderers/support/RenderingInfo.js +1 -1
- package/renderers/support/renderingInfoUtils.js +1 -1
- package/renderers/visualVariables/SizeVariable.d.ts +16 -20
- package/renderers/visualVariables/support/SizeStop.d.ts +6 -2
- package/rest/networks/support/TraceLocation.js +1 -1
- package/rest/networks/support/TraceResult.d.ts +7 -0
- package/rest/networks/support/TraceResult.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/opacity.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/timeSeriesUtils.js +1 -1
- package/smartMapping/statistics/histogramForTimeSeries.d.ts +11 -0
- package/smartMapping/statistics/histogramForTimeSeries.js +2 -0
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.d.ts +11 -0
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +2 -0
- package/smartMapping/statistics/support/timeSeriesUtils.js +24 -0
- package/smartMapping/statistics/types.d.ts +50 -0
- package/symbols/cim/CIMPlacements.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/types.d.ts +493 -8
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextParams.js +1 -1
- package/views/2d/layers/SketchLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/ExceedsLimitCache.js +1 -1
- package/views/2d/layers/features/schema/TimeSchema.js +2 -0
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/2d/types.d.ts +2 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +24 -0
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
- package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +12 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/focusArea/FocusArea.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/SelectionManager.d.ts +3 -3
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/options/bindViewToolOptions.js +1 -1
- package/views/interactive/sketch/SketchLabelOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchLabelOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
- package/views/interactive/sketch/SketchValueOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchValueOptions.js +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +3 -0
- package/views/interactive/snapping/SnappingOptions.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
- package/views/layers/SketchLayerView.d.ts +34 -0
- package/views/layers/SketchLayerView.js +2 -0
- package/views/layers/types.d.ts +3 -2
- package/views/selection/types.d.ts +15 -4
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.d.ts +4 -0
- package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +5 -1
- package/widgets/Bookmarks/types.d.ts +2 -0
- package/widgets/Editor/EditorViewModel.d.ts +31 -30
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/types.d.ts +44 -0
- package/widgets/Editor.d.ts +30 -27
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.d.ts +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.d.ts +6 -0
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Histogram/types.d.ts +10 -2
- package/widgets/HistogramRangeSlider/types.d.ts +4 -1
- package/widgets/LayerList/LayerListViewModel.d.ts +2 -1
- package/widgets/Legend/LegendViewModel.d.ts +3 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/card/CardView.d.ts +2 -0
- package/widgets/Legend/styles/classic/ClassicView.d.ts +4 -1
- package/widgets/Legend.d.ts +3 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +7 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/types.d.ts +9 -0
- package/widgets/OrientedImageryViewer.d.ts +7 -0
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/types.d.ts +9 -2
- package/widgets/Sketch/SketchViewModel.d.ts +32 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.d.ts +27 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/types.d.ts +58 -13
- package/widgets/Slider.d.ts +6 -0
- package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ClassedColorSlider/ClassedColorSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ClassedSizeSlider/ClassedSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ColorSizeSlider/ColorSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.d.ts +3 -0
- package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/types.d.ts +30 -7
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +21 -11
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
- package/widgets/support/FilterBuilder/types.d.ts +28 -0
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +24 -0
- package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
- package/widgets/support/FilterCondition/types.d.ts +16 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/SnappingControls/snappingLayerListUtils.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0606ab6fdfc1dfea3856.js +0 -1
- package/assets/esri/core/workers/chunks/1289204f8ca96032c17a.js +0 -1
- package/assets/esri/core/workers/chunks/12b5a645c0987a0efe54.js +0 -2
- package/assets/esri/core/workers/chunks/17b938ba49fb1e7ab8c4.js +0 -1
- package/assets/esri/core/workers/chunks/1dbb3e25e005a8220779.js +0 -2
- package/assets/esri/core/workers/chunks/37fc47373c1c8fcdfd1a.js +0 -1
- package/assets/esri/core/workers/chunks/3d6fef25af7e1a51e1bd.js +0 -1
- package/assets/esri/core/workers/chunks/537dbd3b870bbef7433e.js +0 -1
- package/assets/esri/core/workers/chunks/55ae00f33f5240a73a50.js +0 -1
- package/assets/esri/core/workers/chunks/62298dba3f6cbdc3f4ae.js +0 -1
- package/assets/esri/core/workers/chunks/703411e4a18a6a36048a.js +0 -1
- package/assets/esri/core/workers/chunks/74211d096cc3296e0968.js +0 -1
- package/assets/esri/core/workers/chunks/7926faab76a721a2e1c4.js +0 -1
- package/assets/esri/core/workers/chunks/96c3900685cfb2a8ca12.js +0 -1
- package/assets/esri/core/workers/chunks/ad28486bc6afaa346de5.js +0 -1
- package/assets/esri/core/workers/chunks/ad29c729e90b5866713c.js +0 -1
- package/assets/esri/core/workers/chunks/b72a2514aa4cc4ae7d1b.js +0 -1
- package/assets/esri/core/workers/chunks/b748faaa5ebdeba73103.js +0 -1
- package/assets/esri/core/workers/chunks/be761749f8d77fbd9df5.js +0 -1
- package/assets/esri/core/workers/chunks/d4f55e2b1ace7867a3b8.js +0 -1
- package/assets/esri/core/workers/chunks/dbfd25aa0d19aed5890c.js +0 -1
- package/assets/esri/core/workers/chunks/de28a86775235bd5d3c4.js +0 -2
- package/assets/esri/core/workers/chunks/f6cfc901267a229de7a1.js +0 -2
- package/assets/esri/core/workers/chunks/fb147097149a89e671ff.js +0 -1
- package/support/revision.js +0 -2
- /package/assets/esri/core/workers/chunks/{1dbb3e25e005a8220779.js.LICENSE.txt → 1b946714ca4a1a7359d4.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f6cfc901267a229de7a1.js.LICENSE.txt → 2a1ec30f9ad305763f81.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js.LICENSE.txt → 590e6c70206122e4cc3c.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js.LICENSE.txt → 68d8ae42ab71d01a70a5.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{de28a86775235bd5d3c4.js.LICENSE.txt → 8dc1c3042267618fd710.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{12b5a645c0987a0efe54.js.LICENSE.txt → 96c50a0dda0f1503ef92.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type LineOfSightAnalysis from "../../../analysis/LineOfSightAnalysis.js";
|
|
2
|
+
import type LineOfSightAnalysisObserver from "../../../analysis/LineOfSightAnalysisObserver.js";
|
|
3
|
+
import type LineOfSightAnalysisTarget from "../../../analysis/LineOfSightAnalysisTarget.js";
|
|
2
4
|
import type Collection from "../../../core/Collection.js";
|
|
3
5
|
import type AnalysisView3D from "./AnalysisView3D.js";
|
|
4
6
|
import type LineOfSightAnalysisResult from "./LineOfSightAnalysisResult.js";
|
|
@@ -73,6 +75,28 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
73
75
|
* ```
|
|
74
76
|
*/
|
|
75
77
|
get results(): Collection<LineOfSightAnalysisResult | null | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
* The observer or target currently selected for interactive editing. Use the item's `type` property to determine
|
|
80
|
+
* whether it is an observer or a target.
|
|
81
|
+
*
|
|
82
|
+
* @since 5.2
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const analysisView = await view.whenAnalysisView(analysis);
|
|
86
|
+
* analysisView.interactive = true;
|
|
87
|
+
*
|
|
88
|
+
* reactiveUtils.watch(() => analysisView.selectedItem, (item) => {
|
|
89
|
+
* if (item?.type === "observer") {
|
|
90
|
+
* const observer = item; // LineOfSightAnalysisObserver
|
|
91
|
+
* console.log("Selected observer:", observer.position);
|
|
92
|
+
* } else if (item?.type === "target") {
|
|
93
|
+
* const target = item; // LineOfSightAnalysisTarget
|
|
94
|
+
* console.log("Selected target:", target.position);
|
|
95
|
+
* }
|
|
96
|
+
* });
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
get selectedItem(): LineOfSightAnalysisObserver | LineOfSightAnalysisTarget | null | undefined;
|
|
76
100
|
/**
|
|
77
101
|
* The analysis view type.
|
|
78
102
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as n}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import{watch as a,sync as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{ViewshedInteractionVisuals as d}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as f}from"./ViewshedSnappingController.js";import{ViewshedSubTool as p}from"./ViewshedSubTool.js";import{findSubTool as m}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as h}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{bindViewToolOptions as v}from"../../../interactive/options/bindViewToolOptions.js";import y from"../../../interactive/options/InteractiveToolOptions.js";import{enterInputModeIfAvailable as b,makeTooltip as x}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as S}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as n}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import{watch as a,sync as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{ViewshedInteractionVisuals as d}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as f}from"./ViewshedSnappingController.js";import{ViewshedSubTool as p}from"./ViewshedSubTool.js";import{findSubTool as m}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as h}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{bindViewToolOptions as v}from"../../../interactive/options/bindViewToolOptions.js";import y from"../../../interactive/options/InteractiveToolOptions.js";import{enterInputModeIfAvailable as b,makeTooltip as x}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as S}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const C=Symbol(`inactiveManipulatorDisplay`);let w=class extends g{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._selectedManipulator=null,this._observerToolOptions=new y,this._observerTooltipConnectionHandle=null,this._updatingHandles=new u}initialize(){let{snappingManager:e,view:t}=this;this._interactionVisuals=new d({view:t}),this._snappingController=new f({snappingManager:e,view:t}),this._initializeObserverTooltip(t);let r=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=n(()=>r,({viewshedComputedData:e})=>{let t=new p({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}}),this.addHandles([v(this._observerToolOptions,()=>t.options),a(()=>this.firstGrabbedManipulator,e=>{if(e!=null){let t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},o),a(()=>({grabbedManipulator:this.firstGrabbedManipulator,subTools:this.subToolHandles.map(({subTool:e})=>e).toArray()}),({grabbedManipulator:e,subTools:t})=>{let n=e==null?[]:t.map(t=>t.hideInactiveManipulators(e));this.removeHandles(C),this.addHandles(n,C),t.forEach(t=>t.setInteractive(t=>e==null||t===e))},o),this._updatingHandles.add(()=>{let e=this.selectedViewshedComputedData;return e==null?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(e==null)return;let{subTool:t,observer:n,target:r}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(n,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(r,!1)},s),this._updatingHandles.add(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),s),this._updatingHandles.add(()=>this.selectedViewshed,e=>{let t=this._selectedManipulator,n=this._selectedSubTool;this._connectObserverTooltip(n),e==null?this._selectManipulator(null):(t==null||!n.hasManipulator(t))&&this._selectManipulator(n.observerManipulator)},s)])}destroy(){this.removeHandles(C),this._selectManipulator(null),this._disconnectObserverTooltip(),r(this.subToolHandles),r(this._interactionVisuals),r(this._snappingController),r(this._observerTooltip),this._updatingHandles.destroy()}get updating(){return!!this._snappingController?.updating||this._updatingHandles.updating||this.subToolHandles.some(({subTool:e})=>e.updating)}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get cursor(){return null}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){let t=this._selectedSubTool,n=this.selectedViewshedComputedData;if(t==null||n==null){this._interactionVisuals?.setVisibility(!1);return}let r=t.moveInteractionState,i=e?r.grabbing:r.dragging,a=t.scaleOrientInteractionState,o=e?a.grabbing:a.dragging;if(!(this.analysisViewData.visible&&(i||o))){this._interactionVisuals?.setVisibility(!1);return}let s=i?n.elevationAlignedObserverRenderSpace:n.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:s,laserlineVisible:!0,verticalLineVisible:i,intersectsWorldUp:i})}createObserverMoveSnappingPipeline(e,t,n,r=!1){return this._snappingController.createObserverMoveSnappingPipeline(e,t,n,r)}onActivate(){this.updateInteractionVisualsVisibility()}onDeactivate(){this.updateInteractionVisualsVisibility()}onInputEvent(e){if(!this.destroyed&&!b(e,this._observerTooltip))switch(e.type){case`key-down`:_.cancel===e.key?this._cancelKeyHandler(e):_.delete.includes(e.key)&&this._deleteKeyHandler(e);break;case`hold`:this.updateInteractionVisualsVisibility(!0)}}_updateInteractionVisualsLocation(e,t){this._interactionVisuals?.updateLocation(e,t)}_initializeObserverTooltip(e){let t=this._observerToolOptions;this._observerTooltip=x(()=>({view:e,options:t.tooltips})),this._observerTooltipInfo=new S({toolOptions:t,viewType:e.type})}_connectObserverTooltip(e){if(this._disconnectObserverTooltip(),e==null){this._observerTooltip.clear();return}let t=e.observerManipulatedObject;this._observerTooltipConnectionHandle=h(this._observerTooltip,t,()=>({toolOptions:this._observerToolOptions,activeTooltipInfo:this._observerTooltipInfo,callbacks:{onBeforeUpdate:()=>this.updateInteractionVisualsVisibility(),onMoveStart:()=>{},onMove:()=>{},onMoveStop:()=>{},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}}}))}_disconnectObserverTooltip(){this._observerTooltipConnectionHandle=i(this._observerTooltipConnectionHandle)}_cancelKeyHandler(e){this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_deleteKeyHandler(e){let t=this.selectedViewshed;t!=null&&(this.analysis.viewsheds.remove(t),e.stopPropagation())}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return m(this.subToolHandles,e)}_selectManipulator(e){let t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,t!=null&&(t.selected=!1),e!=null&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get test(){}};e([c({constructOnly:!0})],w.prototype,`analysis`,void 0),e([c({constructOnly:!0})],w.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],w.prototype,`intersector`,void 0),e([c({constructOnly:!0})],w.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],w.prototype,`view`,void 0),e([c()],w.prototype,`subToolHandles`,void 0),e([c()],w.prototype,`removeIncompleteOnCancel`,void 0),e([c()],w.prototype,`automaticManipulatorSelection`,void 0),e([c()],w.prototype,`multiTouchEnabled`,void 0),e([c()],w.prototype,`_selectedManipulator`,void 0),e([c()],w.prototype,`_interactionVisuals`,void 0),e([c()],w.prototype,`_snappingController`,void 0),e([c()],w.prototype,`_observerTooltip`,void 0),e([c()],w.prototype,`_observerTooltipInfo`,void 0),e([c()],w.prototype,`updating`,null),e([c()],w.prototype,`grabbing`,null),e([c()],w.prototype,`cursor`,null),e([c()],w.prototype,`selectedViewshed`,null),e([c()],w.prototype,`selectedViewshedComputedData`,null),e([c()],w.prototype,`_selectedSubTool`,null),w=e([l(`esri.views.3d.analysis.Viewshed.ViewshedEditTool`)],w);export{w as ViewshedEditTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as r,Cyclical as i}from"../../../../core/Cyclical.js";import{handlesGroup as a}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{sub as p,len as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as v}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as y}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as b,isSideHorizontal as x,flipSide as S}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as C}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as w}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as T}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as D}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as O}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as k,resetManipulatedObject as A,sceneSnappingAtLocation as j,dragManipulatedObject as M,sceneSnappingAtProjectedLocation as N,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const F=Symbol(`dragHandles`);let I=class extends t{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new _,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new b({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new w({view:this.view,tool:this.parentTool}),this._observerManipulator=new T(this.view,this.parentTool),this._observerManipulatedObject=new C({view:this.view,subTool:this}),this.addHandles([c(()=>this.elevationAlignedObserverRenderSpace,e=>{e!=null&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},l),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:t,operations:r},i)=>{this._grabbing&&t!==i?.observer||(this.removeHandles(F),e?.valid&&r!=null&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(n),F))},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e,analysisViewData:t}=this,n=t.visible&&(e?.valid??!1),r=t.selectedViewshed===e?.viewshed,i=n&&r,a=e?.effectiveElevationInfo.mode;return{controlsAvailable:i,selected:r,visibleAndValid:n,zManipulationAvailable:i&&a!==`on-the-ground`}},({controlsAvailable:e,selected:t,visibleAndValid:n,zManipulationAvailable:r})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=r,this._scaleOrientManipulation.available=e,this._observerManipulator.available=n,this._observerManipulator.collisionPriority=t?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;if(!e?.valid)return null;let{observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}=e;return{viewshedCompData:e,observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}},e=>{e!=null&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(`grab-changed`,t=>{this._grabbing=t.action===`start`,t.action===`end`&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(t=>t===e||!this._grabbing)}),e.events.on(`drag`,e=>{e.action===`start`&&this.parentTool.updateInteractionVisualsVisibility()})])})}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){let t=this.viewshed;t!=null&&(t.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){let{dragging:e,grabbing:t}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:t||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){let{dragging:e,grabbing:t}=this._scaleOrientManipulation;return{dragging:e,grabbing:t}}_setInteractive(e){let t=typeof e==`boolean`;this._observerManipulator.interactive=t?e:e(this._observerManipulator),this._forEachManipulation(n=>{n.interactive=t?e:n.someManipulator(e)})}onManipulatorSelectionChanged(){this._someManipulatorSelected()||this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}hasManipulator(e){let t=!1;return this._forEachManipulator(n=>{t||=n===e}),t}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new O({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:D})}_buildObserverManipulatorDragPipeline(e){let{effectiveElevationInfo:t,viewshed:n}=e,r=this._observerManipulatedObject,i=r.operations;if(i==null)return null;let a=i.data.spatialReference;return k(this._observerManipulator,(e,o,s,c)=>{let{parentTool:l,view:u}=this,{intersector:d,snappingManager:f}=l,{geometry:p}=i.data;if(p.type!==`point`)return;let m=n.feature,h=A(r);s=s.next(e=>(n.feature=m,h(e)));let g=l.createObserverMoveSnappingPipeline(0,c,t,!0),_=o.next(E(u,p,t,a)).next(j(u,t));if(g!=null){let{snappingStep:e,cancelSnapping:t}=g;s.next(t),_=_.next(...e)}_.next(e=>(n.feature=v({intersector:d,snappingManager:f,screenPoint:e.screenEnd,view:u}),e)).next(M(r))})}_buildMoveManipulationDragPipeline(e){let{effectiveElevationInfo:t}=e,n=this._observerManipulatedObject,r=n.operations;return r==null?null:this._moveManipulation.createDragPipeline((e,r,i,a,o)=>{a=a.next(A(n));let s=this.parentTool.createObserverMoveSnappingPipeline(e,o,t);if(s!=null){let{snappingStep:e,cancelSnapping:r}=s;return a=a.next(r),i=i.next(N(this.view,t)).next(...e).next(M(n)),{steps:i,cancel:a}}return i=i.next(M(n)),{steps:i,cancel:a}},t,r.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let t=0,n=0;return this._fieldOfViewManipulation.createDragPipeline((i,a,o)=>{if(e==null)return{steps:a,cancel:o};let s=e.viewshed,c=null;return o=o.next(P(s,[`horizontalFieldOfView`,`verticalFieldOfView`])),{steps:a.next(i=>{i.action===`start`&&(c=null,t=e.horizontalFieldOfView,n=e.verticalFieldOfView);let a=i.deltaAngle;if(c==null&&a!==0){let e=i.side===`bottom`||i.side===`left`?a>0:a<0;c=x(i.side)?t===0&&e||t===360&&!e:n===0&&e}let o=c?S(i.side):i.side,l=0;switch(o){case`left`:l=t/2-a;break;case`right`:l=t/2+a;break;case`top`:l=n+a*2;break;case`bottom`:l=n-a*2}return x(o)?(l=r.normalize(l),l=l>270?0:l>180?180:l,s.horizontalFieldOfView=l*2):s.verticalFieldOfView=l,i}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let t=0,n=0,i=(t,n)=>(r,i,a)=>{if(e==null)return{steps:i,cancel:a};let o=e.viewshed;return a=a.next(P(o,[t])),i=i.next(n(o,e)),{steps:i,cancel:a}};return a([this._scaleOrientManipulation.createHeadingDragPipeline(i(`heading`,(t,i)=>i=>(i.action===`start`&&(n=e.heading),t.heading=r.normalize(n+i.deltaAngle),i)),e),this._scaleOrientManipulation.createTiltDragPipeline(i(`tilt`,(n,r)=>r=>{r.action===`start`&&(t=e.tilt);let i=t+r.deltaAngle;return i<-90?i=180:i>270&&(i=0),n.tilt=R.clamp(i),r}),e),this._scaleOrientManipulation.createDistanceDragPipeline(i(`farDistance`,(e,t)=>n=>{let r=p(L,n.renderEnd,t.elevationAlignedObserverRenderSpace),i=m(r)*t.metersPerUnit;return e.farDistance=h(r,t.targetDirection)<0?y.scaleOrientMinDistance:i,n}),e)])}_forEachManipulator(e){this._forEachManipulation(t=>{t.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],I.prototype,`analysis`,void 0),e([d({constructOnly:!0})],I.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0})],I.prototype,`parentTool`,void 0),e([d({constructOnly:!0,nonNullable:!0})],I.prototype,`view`,void 0),e([d()],I.prototype,`updating`,null),e([d()],I.prototype,`viewshed`,null),e([d()],I.prototype,`_grabbing`,void 0),e([d()],I.prototype,`grabbing`,null),e([d()],I.prototype,`viewshedComputedData`,void 0),e([d()],I.prototype,`observer`,null),e([d()],I.prototype,`elevationAlignedObserverRenderSpace`,null),I=e([f(`esri.views.3d.analysis.Viewshed.ViewshedSubTool`)],I);const L=g(),R=new i(0,180);export{I as ViewshedSubTool};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as r,Cyclical as i}from"../../../../core/Cyclical.js";import{handlesGroup as a}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{sub as p,len as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as v}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as y}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as b,isSideHorizontal as x,flipSide as S}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as C}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as w}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as T}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as D}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as O}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as k,resetManipulatedObject as A,sceneSnappingAtLocation as j,dragManipulatedObject as M,sceneSnappingAtProjectedLocation as N,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const F=Symbol(`dragHandles`);let I=class extends t{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new _,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new b({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new w({view:this.view,tool:this.parentTool}),this._observerManipulator=new T(this.view,this.parentTool),this._observerManipulatedObject=new C({view:this.view,subTool:this}),this.addHandles([c(()=>this.elevationAlignedObserverRenderSpace,e=>{e!=null&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},l),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:t,operations:r},i)=>{this._grabbing&&t!==i?.observer||(this.removeHandles(F),e?.valid&&r!=null&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(n),F))},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e,analysisViewData:t}=this,n=t.visible&&(e?.valid??!1),r=t.selectedViewshed===e?.viewshed,i=n&&r,a=e?.effectiveElevationInfo.mode;return{controlsAvailable:i,selected:r,visibleAndValid:n,zManipulationAvailable:i&&a!==`on-the-ground`}},({controlsAvailable:e,selected:t,visibleAndValid:n,zManipulationAvailable:r})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=r,this._scaleOrientManipulation.available=e,this._observerManipulator.available=n,this._observerManipulator.collisionPriority=t?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;if(!e?.valid)return null;let{observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}=e;return{viewshedCompData:e,observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}},e=>{e!=null&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(`grab-changed`,t=>{this._grabbing=t.action===`start`,t.action===`end`&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e.setInteractive(!this._grabbing)}),this.setInteractive(t=>t===e||!this._grabbing)}),e.events.on(`drag`,e=>{e.action===`start`&&this.parentTool.updateInteractionVisualsVisibility()})])})}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){let t=this.viewshed;t!=null&&(t.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){let{dragging:e,grabbing:t}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:t||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){let{dragging:e,grabbing:t}=this._scaleOrientManipulation;return{dragging:e,grabbing:t}}setInteractive(e){let t=typeof e==`boolean`;this._observerManipulator.interactive=t?e:e(this._observerManipulator),this._forEachManipulation(n=>{n.interactive=t?e:n.someManipulator(e)})}hideInactiveManipulators(e){let t=[];return this._forEachManipulation(n=>{n.hasManipulator(e)?n!==this._moveManipulation&&t.push(a(n.mapManipulators(t=>t===e||n===this._fieldOfViewManipulation&&t.grabbing?null:t.disableDisplay?.()))):t.push(n.hideManipulators())}),this._observerManipulator!==e&&t.push(this._observerManipulator.disableDisplay()),a(t)}onManipulatorSelectionChanged(){this._someManipulatorSelected()||this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}hasManipulator(e){let t=!1;return this._forEachManipulator(n=>{t||=n===e}),t}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new O({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:D})}_buildObserverManipulatorDragPipeline(e){let{effectiveElevationInfo:t,viewshed:n}=e,r=this._observerManipulatedObject,i=r.operations;if(i==null)return null;let a=i.data.spatialReference;return k(this._observerManipulator,(e,o,s,c)=>{let{parentTool:l,view:u}=this,{intersector:d,snappingManager:f}=l,{geometry:p}=i.data;if(p.type!==`point`)return;let m=n.feature,h=A(r);s=s.next(e=>(n.feature=m,h(e)));let g=l.createObserverMoveSnappingPipeline(0,c,t,!0),_=o.next(E(u,p,t,a)).next(j(u,t));if(g!=null){let{snappingStep:e,cancelSnapping:t}=g;s.next(t),_=_.next(...e)}_.next(e=>(n.feature=v({intersector:d,snappingManager:f,screenPoint:e.screenEnd,view:u}),e)).next(M(r))})}_buildMoveManipulationDragPipeline(e){let{effectiveElevationInfo:t}=e,n=this._observerManipulatedObject,r=n.operations;return r==null?null:this._moveManipulation.createDragPipeline((e,r,i,a,o)=>{a=a.next(A(n));let s=this.parentTool.createObserverMoveSnappingPipeline(e,o,t);if(s!=null){let{snappingStep:e,cancelSnapping:r}=s;return a=a.next(r),i=i.next(N(this.view,t)).next(...e).next(M(n)),{steps:i,cancel:a}}return i=i.next(M(n)),{steps:i,cancel:a}},t,r.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let t=0,n=0;return this._fieldOfViewManipulation.createDragPipeline((i,a,o)=>{if(e==null)return{steps:a,cancel:o};let s=e.viewshed,c=null;return o=o.next(P(s,[`horizontalFieldOfView`,`verticalFieldOfView`])),{steps:a.next(i=>{i.action===`start`&&(c=null,t=e.horizontalFieldOfView,n=e.verticalFieldOfView);let a=i.deltaAngle;if(c==null&&a!==0){let e=i.side===`bottom`||i.side===`left`?a>0:a<0;c=x(i.side)?t===0&&e||t===360&&!e:n===0&&e}let o=c?S(i.side):i.side,l=0;switch(o){case`left`:l=t/2-a;break;case`right`:l=t/2+a;break;case`top`:l=n+a*2;break;case`bottom`:l=n-a*2}return x(o)?(l=r.normalize(l),l=l>270?0:l>180?180:l,s.horizontalFieldOfView=l*2):s.verticalFieldOfView=l,i}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let t=0,n=0,i=(t,n)=>(r,i,a)=>{if(e==null)return{steps:i,cancel:a};let o=e.viewshed;return a=a.next(P(o,[t])),i=i.next(n(o,e)),{steps:i,cancel:a}};return a([this._scaleOrientManipulation.createHeadingDragPipeline(i(`heading`,(t,i)=>i=>(i.action===`start`&&(n=e.heading),t.heading=r.normalize(n+i.deltaAngle),i)),e),this._scaleOrientManipulation.createTiltDragPipeline(i(`tilt`,(n,r)=>r=>{r.action===`start`&&(t=e.tilt);let i=t+r.deltaAngle;return i<-90?i=180:i>270&&(i=0),n.tilt=R.clamp(i),r}),e),this._scaleOrientManipulation.createDistanceDragPipeline(i(`farDistance`,(e,t)=>n=>{let r=p(L,n.renderEnd,t.elevationAlignedObserverRenderSpace),i=m(r)*t.metersPerUnit;return e.farDistance=h(r,t.targetDirection)<0?y.scaleOrientMinDistance:i,n}),e)])}_forEachManipulator(e){this._forEachManipulation(t=>{t.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],I.prototype,`analysis`,void 0),e([d({constructOnly:!0})],I.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0})],I.prototype,`parentTool`,void 0),e([d({constructOnly:!0,nonNullable:!0})],I.prototype,`view`,void 0),e([d()],I.prototype,`updating`,null),e([d()],I.prototype,`viewshed`,null),e([d()],I.prototype,`_grabbing`,void 0),e([d()],I.prototype,`grabbing`,null),e([d()],I.prototype,`viewshedComputedData`,void 0),e([d()],I.prototype,`observer`,null),e([d()],I.prototype,`elevationAlignedObserverRenderSpace`,null),I=e([f(`esri.views.3d.analysis.Viewshed.ViewshedSubTool`)],I);const L=g(),R=new i(0,180);export{I as ViewshedSubTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{deg2rad as t}from"../../../../core/mathUtils.js";import{valueInUnit as n}from"../../../../core/quantity.js";import{watch as r,sync as i,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as o,convertUnit as s}from"../../../../core/units.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{rotateZ as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{subtract as d,lerp as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as p,fromArray as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{sv3d as g,sm4d as _}from"../../../../geometry/support/vectorStacks.js";import{IsShiftEdgeOnScreenFlag as v}from"../Slice/sliceToolUtils.js";import{calculateTranslateRotateFromBases as y}from"../../interactive/manipulatorUtils.js";import{screenToZConstrained as b}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ShiftManipulator as x}from"../../interactive/manipulators/ShiftManipulator.js";import{createManipulatorDragEventPipeline as S,addMapTranslation as C}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as w}from"../../../interactive/InteractiveToolBase.js";import T
|
|
2
|
+
import{__decorate as e}from"tslib";import{deg2rad as t}from"../../../../core/mathUtils.js";import{valueInUnit as n}from"../../../../core/quantity.js";import{watch as r,sync as i,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as o,convertUnit as s}from"../../../../core/units.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{rotateZ as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{subtract as d,lerp as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as p,fromArray as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{sv3d as g,sm4d as _}from"../../../../geometry/support/vectorStacks.js";import{IsShiftEdgeOnScreenFlag as v}from"../Slice/sliceToolUtils.js";import{calculateTranslateRotateFromBases as y}from"../../interactive/manipulatorUtils.js";import{screenToZConstrained as b}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ShiftManipulator as x}from"../../interactive/manipulators/ShiftManipulator.js";import{createManipulatorDragEventPipeline as S,addMapTranslation as C}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as w}from"../../../interactive/InteractiveToolBase.js";import{bindToolUnits as T}from"../../../interactive/options/bindViewToolOptions.js";import E from"../../../interactive/options/InteractiveToolOptions.js";import{makeTooltip as D,enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{ElevationTooltipInfo as k}from"../../../interactive/tooltip/infos/ElevationTooltipInfo.js";import{elevationFromZ as A}from"../../../support/euclideanLengthMeasurementUtils.js";let j=class extends w{constructor(e){super(e),this.multiTouchEnabled=!1,this._updatingHandles=new h,this.toolOptions=new E}initialize(){let{view:e}=this;this._shiftManipulator=new x(e,0,8),this._shiftManipulator.state|=v,this.manipulators.add(this._shiftManipulator),this.addHandles([this._createDragPipeline(),r(()=>this.analysisViewData.targetGeometry,()=>this._updateManipulatorPosition(),i),r(()=>this._showManipulator,e=>this._updateManipulatorVisibility(e),a)]),this._initializeTooltip(),this.finishToolCreation()}_initializeTooltip(){let{view:e}=this;this.tooltip=D(()=>({view:e,options:this.toolOptions.tooltips})),this._tooltipInfo=new k({toolOptions:this.toolOptions}),this.toolOptions.tooltips.enabled=!0,this.toolOptions.tooltips.placement=`trailing`,this.addHandles([T(this.toolOptions.values,()=>this.view.options,()=>({displayUnits:{verticalLength:this.analysis.displayUnits.elevation},inputUnits:{verticalLength:this.analysis.inputUnits.elevation}})),this._updatingHandles.add(()=>this.analysisViewData.effectiveTargetElevation,()=>this._updateTooltip()),this._updatingHandles.add(()=>this._shouldShowTooltip,e=>{e?this._showTooltip():this._hideTooltip()}),this.tooltip.on(`commit`,()=>{let e=this._tooltipInfo.elevation.actual,t=o(this.view.spatialReference);if(e==null||t==null)return;let r=n(e,t);this._updateValue(r,{recordUndo:this.analysis.cutFillOptions.targetElevation})})])}destroy(){this._shiftManipulator.destroy(),this.tooltip.destroy(),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}onInputEvent(e){if(!this.destroyed&&!O(e,this.tooltip))return super.onInputEvent(e)}onHide(){this._hideTooltip()}onEditableChange(){this.internallyEditable||this._hideTooltip()}get _shouldShowTooltip(){return this._showManipulator&&(this.hasFocusedManipulators||this.tooltip.mode===`input`)}get _showManipulator(){let{interactive:e,targetGeometry:t,visible:n}=this.analysisViewData,{measureType:r}=this.analysis;return n&&e&&t!=null&&r===`cut-fill`}_createDragPipeline(){return S(this._shiftManipulator,(e,t,n)=>{let r=p(e.renderLocation),i=this.analysis.inputUnits.elevation??`meters`,a=o(this.view.spatialReference),c;t.next(b(this.view,r,this.view.spatialReference)).next(C()).next(e=>{if(e.action===`start`){let{targetElevation:e}=this.analysis.cutFillOptions;c=e&&a?s(e,i,a):void 0}return this._updateValue(c==null?e.mapEnd.z:c+e.translationZ,e.action===`end`?{recordUndo:c}:void 0),e}),n.next(()=>{this._updateValue(c)})})}_updateManipulatorPosition(){let{targetGeometry:e}=this.analysisViewData,{renderCoordsHelper:n}=this.view;if(!e)return;let r=e.rings[0],i=m(r[0]),a=m(r[1]);n.toRenderCoords(i,e.spatialReference,i),n.toRenderCoords(a,e.spatialReference,a);let o=g.get();d(o,a,i);let s=g.get();f(s,i,a,.5);let c=n.worldBasisAtPosition(s,1,g.get()),l=n.worldBasisAtPosition(s,0,g.get()),h=y(c,l,s,_.get()),v=n.headingAtPosition(s,o),b=e.isClockwise(e.rings[0])?-Math.PI/2:Math.PI/2;u(h,h,t(v)+b),h[12]=0,h[13]=0,h[14]=0,this._shiftManipulator.renderLocation=p(s),this._shiftManipulator.modelTransform=h}_updateManipulatorVisibility(e){this._shiftManipulator.available=e}_updateValue(e,t){let n=A(e,this.view.spatialReference);if(n==null)return;let r=this.analysis.inputUnits.elevation??`meters`,i=s(n.value,n.unit,r),a=e=>void(this.analysis.cutFillOptions.targetElevation=e);if(a(i),t&&`recordUndo`in t){let e=t.recordUndo;this.emit(`record-undo`,{apply:()=>a(i),undo:()=>a(e)})}}_getUpdatedTooltipInfo(){let{effectiveTargetElevation:e}=this.analysisViewData;return e&&(this._tooltipInfo.elevation.actual=A(e,this.view.spatialReference)),this._tooltipInfo}_updateTooltip(){this._shouldShowTooltip&&(this.tooltip.info=this._getUpdatedTooltipInfo())}_showTooltip(){this._updateTooltip()}_hideTooltip(){this.tooltip?.clear(),this.tooltip?.exitInputMode({focusOnView:!1})}};e([c()],j.prototype,`multiTouchEnabled`,void 0),e([c()],j.prototype,`updating`,null),e([c({constructOnly:!0})],j.prototype,`analysis`,void 0),e([c({constructOnly:!0})],j.prototype,`view`,void 0),e([c({constructOnly:!0})],j.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0,type:E})],j.prototype,`toolOptions`,void 0),e([c()],j.prototype,`_shouldShowTooltip`,null),e([c()],j.prototype,`_showManipulator`,null),j=e([l(`esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementShiftTool`)],j);export{j as VolumeMeasurementShiftTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{add as e,subtract as t}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as n,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAltitudeConstraint as i,getAltitudeConstraintError as a}from"./constraintUtils/altitude.js";import{hasConstraintType as o}from"./constraintUtils/common.js";import{ConstraintOptions as s}from"./constraintUtils/ConstraintOptions.js";import{applyDistanceConstraint as c,getDistanceConstraintError as l}from"./constraintUtils/distance.js";import{applySurfaceCollisionConstraint as u}from"./constraintUtils/surfaceCollision.js";import{applyTiltConstraint as d,getTiltConstraintError as f}from"./constraintUtils/tilt.js";import{inOutCubic as p}from"../../animation/easing.js";function m(e,t,n=
|
|
2
|
+
import{add as e,subtract as t}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as n,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAltitudeConstraint as i,getAltitudeConstraintError as a}from"./constraintUtils/altitude.js";import{hasConstraintType as o}from"./constraintUtils/common.js";import{ConstraintOptions as s}from"./constraintUtils/ConstraintOptions.js";import{applyDistanceConstraint as c,getDistanceConstraintError as l}from"./constraintUtils/distance.js";import{applySurfaceCollisionConstraint as u}from"./constraintUtils/surfaceCollision.js";import{applyTiltConstraint as d,getTiltConstraintError as f}from"./constraintUtils/tilt.js";import{inOutCubic as p}from"../../animation/easing.js";function m(e,t,n=x,r=t,i=null){r!==t&&r.copyFrom(t),r.computeUp(e.state.viewingMode);let a=!1;for(let t=0;t<S;t++){let t=0;for(let i of b)if(o(n.selection,i.type)){let o=Math.abs(i.error(e,r,n));i.apply(e,r,n)&&(a=!0,t+=o)}if(t===0)break}i?.copyFrom(r);let s=o(n.selection,8),c=h(n.interactionType,e);return s&&u(e,null,r,c)&&(a=!0),a&&r.computeUp(e.state.viewingMode),a}function h(e,t){switch(e){case 4:case 6:return 1;case 5:return t.state.isGlobal?2:1;default:return 0}}function g(e){let t=Math.min(1,e/150);return p(t)}function _(e,t,n){return f(e,t,n)*t.distance}const v=r();function y(r,i,a){let o=n(i.eye);m(r,i,a),i.center=e(v,i.center,t(v,i.eye,o))}const b=[{type:1,error:_,apply:d},{type:2,error:a,apply:i},{type:4,error:l,apply:c}],x=new s,S=5;export{m as applyAll,y as applyConstraintsAndUpdateCenterRenderCamera,g as pixelDistanceToInteractionFactor};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ignoreAbortErrors as e}from"../../../../../core/promiseUtils.js";import{createScreenPointArray as t}from"../../../../../core/screenUtils.js";import{copy as n,subtract as r,add as i}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as
|
|
2
|
+
import{ignoreAbortErrors as e}from"../../../../../core/promiseUtils.js";import{createScreenPointArray as t}from"../../../../../core/screenUtils.js";import{copy as n,subtract as r,add as i,distance as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as s}from"../../../../../geometry/ellipsoidUtils.js";import{fromRenderCamera as c}from"../../../webgl.js";import{shortenTranslation as l}from"../../../state/utils/groundNavigationUtils.js";import{pickPointAndInitSphere as u}from"../../../state/utils/navigationUtils.js";import{OffsetCorrectionController as d}from"../../../state/utils/OffsetCorrectionController.js";import f from"../../../webgl/RenderCamera.js";import{InputHandler as p}from"../../../../input/InputHandler.js";import{eventMatchesPointerAction as m}from"../../../../input/handlers/support.js";class h extends p{constructor(e,t){super(!0),this._view=e,this._tmpTranslation=o(),this._tmpTargetLocation=o(),this._tmpCenterOffset=o(),this.registerIncoming(`double-click`,t,e=>this._handleDoubleClick(e)),this._offsetCorrectionController=new d(this._view)}_handleDoubleClick(e){if(this._view.navigation.mode.type!==`ground`)return;let{data:t}=e;m(t,`primary`)&&(this._move(e),e.stopPropagation())}_move(o){let d=this._view.state.camera,p=new f().copyFrom(d),m=t(o.data.x,o.data.y);if(this._view.state.isGlobal){let e=u(this._view,this._view.state.camera,m,s(this._view.spatialReference).radius,1,{});if(e.scenePickPoint==null||!e.hasGeometryIntersection)return;n(this._tmpTargetLocation,e.scenePickPoint)}else if(!this._view.sceneIntersectionHelper.intersectScreenFreePointFallback(m,this._tmpTargetLocation,{}))return;r(this._tmpTranslation,this._tmpTargetLocation,d.eye),l(this._tmpTranslation,this._tmpTranslation,.99,2),i(this._tmpTargetLocation,d.eye,this._tmpTranslation),r(this._tmpCenterOffset,p.center,p.eye),p.eye=this._tmpTargetLocation,p.center=i(this._tmpCenterOffset,this._tmpTargetLocation,this._tmpCenterOffset),this._offsetCorrectionController.immediatelyCorrectGroundElevation({camera:p,correctionLimit:1e3}),e(this._view.goTo(c(this._view,p),{liftOffDisabled:!0,duration:500*Math.max(1,Math.sqrt(a(p.eye,this._view.state.camera.eye)/100))}))}}export{h as GroundDoubleClickMove};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../Camera.js";import{clock as n}from"../../../../core/clock.js";import r from"../../../../core/Logger.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{onAbort as a}from"../../../../core/promiseUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{property as s,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{subtract as l,add as u,copy as d,cross as f,normalize as p,scale as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../../../../geometry/Point.js";import{shortenTranslation as v}from"../../state/utils/groundNavigationUtils.js";import{OffsetCorrectionController as y}from"../../state/utils/OffsetCorrectionController.js";import b from"../../webgl/RenderCamera.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";let S=class extends x{constructor(e){super(e),this.isGroundNavigationPlacementTool=!0,this._internalAbortController=new AbortController,this._tmpMouseDirection=g(),this._tmpWorldUp=g(),this._tmpHorizontalForward=g(),this._tmpTranslation=g(),this._tmpScratchVector=g(),this._hasErrorCursor=!1}initialize(){this.signal&&this.addHandles([a(this.signal,()=>{this.cancel(),this.active&&(this.view.activeTool=null)})]),this.finishToolCreation()}cancel(){super.cancel(),this._internalAbortController?.abort()}onDeactivate(){this.emit(`cancel`)}get cursor(){return this.active?this._hasErrorCursor?`not-allowed`:`crosshair`:null}async onInputEvent(e){if(!this.active||e.type!==`immediate-click`)return;e.stopPropagation();let n=this.view.state.camera,i=this.view.sceneIntersectionHelper,a=g();if(!i.intersectScreen(o(e.x,e.y),a)){r.getLogger(this).warn(`The clicked location did not produce a valid target. Try again by clicking in a different location.`),this._showErrorCursor();return}if(l(this._tmpTranslation,a,n.eye),v(this._tmpTranslation,this._tmpTranslation,.999,.5),u(a,n.eye,this._tmpTranslation),this.groundMode?.offset){let e=new b().copyFrom(n);e.eye=a,new y(this.view).immediatelyCorrectGroundElevation(e,
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../Camera.js";import{clock as n}from"../../../../core/clock.js";import r from"../../../../core/Logger.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{onAbort as a}from"../../../../core/promiseUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{property as s,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{subtract as l,add as u,copy as d,cross as f,normalize as p,scale as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../../../../geometry/Point.js";import{shortenTranslation as v}from"../../state/utils/groundNavigationUtils.js";import{OffsetCorrectionController as y}from"../../state/utils/OffsetCorrectionController.js";import b from"../../webgl/RenderCamera.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";let S=class extends x{constructor(e){super(e),this.isGroundNavigationPlacementTool=!0,this._internalAbortController=new AbortController,this._tmpMouseDirection=g(),this._tmpWorldUp=g(),this._tmpHorizontalForward=g(),this._tmpTranslation=g(),this._tmpScratchVector=g(),this._hasErrorCursor=!1}initialize(){this.signal&&this.addHandles([a(this.signal,()=>{this.cancel(),this.active&&(this.view.activeTool=null)})]),this.finishToolCreation()}cancel(){super.cancel(),this._internalAbortController?.abort()}onDeactivate(){this.emit(`cancel`)}get cursor(){return this.active?this._hasErrorCursor?`not-allowed`:`crosshair`:null}async onInputEvent(e){if(!this.active||e.type!==`immediate-click`)return;e.stopPropagation();let n=this.view.state.camera,i=this.view.sceneIntersectionHelper,a=g();if(!i.intersectScreen(o(e.x,e.y),a)){r.getLogger(this).warn(`The clicked location did not produce a valid target. Try again by clicking in a different location.`),this._showErrorCursor();return}if(l(this._tmpTranslation,a,n.eye),v(this._tmpTranslation,this._tmpTranslation,.999,.5),u(a,n.eye,this._tmpTranslation),this.groundMode?.offset){let e=new b().copyFrom(n);e.eye=a,new y(this.view).immediatelyCorrectGroundElevation({camera:e,navigationModeOverride:this.groundMode}),d(a,e.eye)}let s=this.cameraTurningEnabled?this._computeHeadingOffset(n,a):0,c=this.view.renderCoordsHelper.fromRenderCoords(a,new _({spatialReference:this.view.spatialReference})),f=new t({position:c,heading:this.view.camera.heading+s,tilt:85});this.emit(`success`,f),this.view.activeTool=null}_computeHeadingOffset(e,t){let n=this.view.renderCoordsHelper.worldUpAtPosition(t,this._tmpWorldUp),r=f(this._tmpHorizontalForward,n,e.viewRight);l(this._tmpMouseDirection,t,e.eye),p(this._tmpMouseDirection,this._tmpMouseDirection),l(this._tmpMouseDirection,this._tmpMouseDirection,m(this._tmpScratchVector,n,h(n,this._tmpMouseDirection))),p(this._tmpMouseDirection,this._tmpMouseDirection);let a=f(g(),this._tmpMouseDirection,r),o=Math.sign(h(a,n)),s=Math.acos(h(this._tmpMouseDirection,r));return o*i(s)}_showErrorCursor(){this._hasErrorCursor=!0,this._errorTimeout?.remove(),this._errorTimeout=n.setTimeout(()=>{this._hasErrorCursor=!1,this._errorTimeout=void 0},500)}};e([s({constructOnly:!0})],S.prototype,`view`,void 0),e([s({constructOnly:!0})],S.prototype,`signal`,void 0),e([s({constructOnly:!0})],S.prototype,`cameraTurningEnabled`,void 0),e([s({constructOnly:!0})],S.prototype,`groundMode`,void 0),e([s()],S.prototype,`_hasErrorCursor`,void 0),e([s({readOnly:!0})],S.prototype,`cursor`,null),S=e([c(`esri.views.3d.interactive.placementTools.GroundNavigationPlacementTool3D`)],S);export{S as GroundNavigationPlacementTool3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{px2pt as t,pt2px as n}from"../../../../core/screenUtils.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as a,clone as o,ones as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as c,fromBuffer as l,intersectsClippingArea as u,empty as d,expandWithAABB as f,expandWithBuffer as p}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as m}from"../../../../renderers/support/renderingInfoUtils.js";import{sharedGeometryElevationAligner as h}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as g,needsElevationUpdates2D as _}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as v}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as y}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as b,nanFallbackColor as x}from"./Graphics3DSymbolLayer.js";import{parseCapType as S,computeSymbolLayerIndex as C,parseLineMarkerStyle as w}from"./lineUtils.js";import{initFastSymbolUpdatesState as T,updateFastSymbolUpdatesState as E,getAttributeValue as D,getSizeAttributeValue as O,ConvertOptions as k}from"../support/FastSymbolUpdates.js";import{debugFlags as A}from"../../support/debugFlags.js";import{createGeometry as j}from"../../support/engineContent/line.js";import{geometryToRenderInfo as M,geometryToRenderInfoDraped as N}from"../../support/renderInfoUtils/line.js";import{Object3D as P}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as F}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as I}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as L,patternHidesLine as R}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as z}from"../../webgl-engine/materials/RibbonLineMaterial.js";const B=[`polyline`];class V extends b{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,W(t))}async doLoad(){if(this._fastUpdates=T(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastMarkerUpdates=T(this._context.renderer,this._fastVisualVariableConvertOptions(!0)),!this._drivenProperties.size&&(this.symbolLayer.size==null?t(1):this.symbolLayer.size)<0)throw new e(`graphics3dlinesymbollayer:invalid-size`,`Symbol sizes may not be negative values`)}_getMaterialParameters(e,t){let n=this._screenSizePerspective,r=!!has(`enable-feature:emissive-on-non-volumetric`)&&!this.draped,{symbolLayer:i}=this,a=this._worldSizedEnabled,o={...this._getMaterialColorParameters(t),shadingEnabled:r,width:this._computeMaterialWidth(i?.size,a),worldSized:a,polygonOffset:3,polygonOffsetIndex:C(this._renderPriority,this._renderPriorityStep),join:i.join||`miter`,cap:S(i.cap||`butt`),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:L(i.pattern??i.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:n};if(t===2){if(this._fastMarkerUpdates?.visualVariables)return{...o,...this._fastMarkerUpdates.materialParameters}}else if(this._fastUpdates?.visualVariables)return{...o,...this._fastUpdates.materialParameters};return o}_getMaterialColorParameters(e){let t=e===2,n=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(n[3]=0),{color:n}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return this._materials[0]??=new z(this._getMaterialParameters(!1,0),this.view.state.isGlobal),this._materials[0]}get _wireframeLineMaterial(){return this._materials[1]??=new z({...this._getMaterialParameters(!1,1),wireframe:!0},this.view.state.isGlobal),this._materials[1]}get _markerMaterial(){return this._materials[2]==null&&this.symbolLayer.marker!=null&&(this._materials[2]=new I({...this._getMaterialParameters(!1,2),placement:this.symbolLayer.marker.placement,markerPrimitive:w(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[2]}_getDrivenSize(e){if(this._drivenProperties.size){let t=e.size;if(t==null)return this._getFallbackSize();let n=m(t.output);return this._getWorldOrScreenSize(n)}return 1}_getDrivenColor({color:e,opacity:t}){let n=s();return this._drivenProperties.color&&(i(n,e?.output??this._getFallbackOpacityAndColor(a)),t==null)||this._drivenProperties.opacity&&(e||this._materialColor)&&(n[3]=t?.output??this._getFallbackOpacity()),n}_getDrivenMarkerColor({color:e,opacity:t}){let n=s();return this._drivenProperties.color&&(i(n,e?.output??this._getFallbackMarkerOpacityAndColor(a)),t==null)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(n[3]=t?.output??this._getFallbackMarkerOpacity()),n}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validatePolylineContext(e))return null;let n=this.createElevationContextForGraphic(t),r=n.mode===`on-the-ground`;return this.ensureDrapedStatus(r),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,n,t.uid)}_validatePolylineContext(e){let t=e.graphic.geometry;return this._validateGeometry(t,B,this.symbolLayer.type)&&t.type===`polyline`}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:{let e=this._fastUpdates;if(E(e,t,this._fastVisualVariableConvertOptions()))for(let t of this._materials)t instanceof z&&t.setParameters(e.materialParameters);else return 0;let n=this._fastMarkerUpdates;if(E(n,t,this._fastVisualVariableConvertOptions(!0)))for(let e of this._materials)e instanceof I&&e.setParameters(n.materialParameters);else return 0}break;default:return 0}return 2}prepareSymbolLayerPatch(e){if(e.diff.type!==`partial`)return;let t=e.diff.diff,n={};t.size?.type===`complete`&&(n.width=this._computeMaterialWidth(t.size.newValue,this._worldSizedEnabled),delete t.size),t.cap?.type===`complete`&&(n.cap=S(t.cap.newValue??`butt`),delete t.cap);let r=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,r),e.symbolLayerStatePatches.push(()=>{for(let e of this._materials)e?.setParameters(n)})}layerOpacityChanged(){for(let e=0;e<3;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){let e=this._screenSizePerspective;for(let t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=g(V.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=_(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){let e={hasSlicePlane:this._context.slicePlaneEnabled};for(let t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,n){let r=e.graphic,i=H(r.geometry);if(i==null)return null;let a=[],o=c(),s=M(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(s,i.paths,`paths`,`LineSymbol3DLayer`);for(let t=0;t<s.lines.length;t++){let r=s.lines[t],c=r.position,d=r.mapPositions;if(this._context.clippingExtent!=null&&(l(d,o),!u(o,this._context.clippingExtent)))continue;let f=this._createGeometry(this._lineMaterial,e,c,d,i.type,1,n);if(a.push(f),A.LINE_WIREFRAMES&&a.push(f.instantiate({material:this._wireframeLineMaterial})),this._markerMaterial!=null){let t=f.instantiate({material:this._markerMaterial});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),a.push(t)}}if(a.length===0)return null;let d=this._context.layerViewUid,f=new P({geometries:a,castShadow:!1,layerViewUid:d,graphicUid:n}),p=new y(this,f,null,h,t);return p.alignedSampledElevation=s.sampledElevation,p.needsElevationUpdates=_(t.mode),p}_createGeometry(e,t,n,r,i,a,o){let s=a===0?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,c=i===`polygon`,l=this._fastUpdates?.visualVariables.color,u=this._fastUpdates?.visualVariables.size,d=this._fastUpdates?.visualVariables.opacity,f=this._context.layerViewUid,p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:f}),{renderingInfo:m}=t,h={position:n,size:u?null:this._getDrivenSize(m),color:l?null:this._getDrivenColor(m),sizeFeature:u?O(u,m.size):null,colorFeature:l?D(l,m.color):null,opacityFeature:d?D(d,m.opacity):null};return j(e,{overlayInfo:s,removeDuplicateStartEnd:c,mapPositions:r,attributeData:h},p)}_createAsOverlay(e){let t=e.graphic,{geometry:n}=t;this._lineMaterial.renderPriority=this._renderPriority;let r=A.LINE_WIREFRAMES?this._wireframeLineMaterial:null,i=this._markerMaterial;r!=null&&(r.renderPriority=this._renderPriority-.001),i!=null&&(i.renderPriority=this._renderPriority-.002);let a=[],o=c(),s=d(),m=N(n,this._context.overlaySR);this._logGeometryCreationWarnings(m,n.paths,`paths`,`LineSymbol3DLayer`);for(let c of m.lines){if(l(c.position,o),!u(o,this._context.clippingExtent))continue;f(s,o);let d=this._createGeometry(this._lineMaterial,e,c.position,void 0,n.type,0,t.uid),m=e=>{let n=this._context.layerViewUid,r=new F(e,{layerViewUid:n,graphicUid:t.uid});a.push(r)};if(i!=null){let t=d.instantiate({material:i});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),m(t);let n=this.symbolLayer.marker.placement;(n===`begin`||n===`begin-end`)&&p(o,c.position,0,1),(n===`end`||n===`begin-end`)&&p(o,c.position,c.position.length-3,1)}m(d),A.LINE_WIREFRAMES&&m(d.instantiate({material:r}))}return new v(this,a,s,this._context.drapeSourceRenderer)}get _patternHidesLine(){return R(this.symbolLayer.pattern)}_computeMaterialWidth(e,r){return r?e??1:(e??=t(1),this._drivenProperties.size?this._fastUpdates?.visualVariables.size?n(1):1:n(e))}_prepareMaterialPatch(e,t,n){let r=t.material;if(r==null){n.changed&&n.useMaterialColor&&U(this._getCombinedOpacityAndColor(this._materialColor),this._materials[2],e);return}if(r.type===`collection`)return;let i=r.type===`complete`?r.newValue?.color:r.diff.color?.type===`complete`?r.diff.color.newValue:null,a=this._getCombinedOpacityAndColor(i);n.useMaterialColor&&U(o(a),this._materials[2],e),this._patternHidesLine&&(a[3]=0),U(a,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){let n=t.marker,r=this._markerMaterial;if(n==null||n.type!==`partial`||n.diff==null||n.diff.placement!=null||n.diff.style!=null&&n.diff.style.type!==`complete`||n.diff.color!=null&&n.diff.color.type!==`complete`||r==null)return{changed:!1,useMaterialColor:this._markerColor==null};let i=n.diff.color,a=i!=null,o=a?i.newValue:null,s=o==null&&this._markerColor==null;o&&U(this._getCombinedOpacityAndColor(o),r,e);let c=n.diff.style?.newValue;return c&&e.symbolLayerStatePatches.push(()=>r.setParameters({markerPrimitive:w(c)})),delete t.marker,{changed:a,useMaterialColor:s}}_fastVisualVariableConvertOptions(e=!1){let t=this._getFallbackSize();return new k({supports:{size:!0,color:!0,rotation:!1,opacity:!0},fallbackColor:e?this._getFallbackMarkerOpacityAndColor(x):this._getFallbackOpacityAndColor(x),fallbackSize:r(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer?.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer?.marker?.color?.a??this._getFallbackOpacity()}get _worldSizedEnabled(){return this.symbol.type===`line-3d`&&this.symbol.worldSized}_getWorldOrScreenSize(e){return this._worldSizedEnabled?e:n(e)}_getFallbackSize(){let e=this.symbolLayer?.size;return e==null?1:this._getWorldOrScreenSize(e)}}function H(e){return e.type===`polyline`?e:null}function U(e,t,n){t!=null&&n.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function W(e){return(e.material?.color?.a??1)===1&&(e.marker?.color?.a??1)===1}export{V as Graphics3DLineSymbolLayer};
|
|
2
|
+
import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{pt2px as t,px2pt as n}from"../../../../core/screenUtils.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as a,clone as o,ones as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as c,fromBuffer as l,intersectsClippingArea as u,empty as d,expandWithAABB as f,expandWithBuffer as p}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as m}from"../../../../renderers/support/renderingInfoUtils.js";import{getTransformationType as h}from"../../../../renderers/visualVariables/support/sizeVariableUtils.js";import{sharedGeometryElevationAligner as g}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as _,needsElevationUpdates2D as v}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as y}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as b}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as x,nanFallbackColor as S}from"./Graphics3DSymbolLayer.js";import{parseCapType as C,computeSymbolLayerIndex as w,parseLineMarkerStyle as T}from"./lineUtils.js";import{initFastSymbolUpdatesState as E,updateFastSymbolUpdatesState as D,getAttributeValue as O,getSizeAttributeValue as k,ConvertOptions as A}from"../support/FastSymbolUpdates.js";import{debugFlags as j}from"../../support/debugFlags.js";import{createGeometry as M}from"../../support/engineContent/line.js";import{geometryToRenderInfo as N,geometryToRenderInfoDraped as P}from"../../support/renderInfoUtils/line.js";import{Object3D as F}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as I}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as L}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as R,patternHidesLine as z}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as B}from"../../webgl-engine/materials/RibbonLineMaterial.js";const V=[`polyline`],H=n(1);class U extends x{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,K(t))}async doLoad(){if(this._fastUpdates=E(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastMarkerUpdates=E(this._context.renderer,this._fastVisualVariableConvertOptions(!0)),!this._drivenProperties.size&&(this.symbolLayer.size==null?H:this.symbolLayer.size)<0)throw new e(`graphics3dlinesymbollayer:invalid-size`,`Symbol sizes may not be negative values`)}_getMaterialParameters(e,t){let n=this._screenSizePerspective,r=!!has(`enable-feature:emissive-on-non-volumetric`)&&!this.draped,{symbolLayer:i}=this,{worldSized:a}=this.symbol,o={...this._getMaterialColorParameters(t),shadingEnabled:r,width:this._computeMaterialWidth(i.size,a),worldSized:a,polygonOffset:3,polygonOffsetIndex:w(this._renderPriority,this._renderPriorityStep),join:i.join||`miter`,cap:C(i.cap||`butt`),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:R(i.pattern??i.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:n};if(t===2){if(this._fastMarkerUpdates?.visualVariables)return{...o,...this._fastMarkerUpdates.materialParameters}}else if(this._fastUpdates?.visualVariables)return{...o,...this._fastUpdates.materialParameters};return o}_getMaterialColorParameters(e){let t=e===2,n=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(n[3]=0),{color:n}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return this._materials[0]??=new B(this._getMaterialParameters(!1,0),this.view.state.isGlobal),this._materials[0]}get _wireframeLineMaterial(){return this._materials[1]??=new B({...this._getMaterialParameters(!1,1),wireframe:!0},this.view.state.isGlobal),this._materials[1]}get _markerMaterial(){return this._materials[2]==null&&this.symbolLayer.marker!=null&&(this._materials[2]=new L({...this._getMaterialParameters(!1,2),placement:this.symbolLayer.marker.placement,markerPrimitive:T(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[2]}_getDrivenSize(e){if(this._drivenProperties.size){let t=e.size;if(t==null)return this._getFallbackSize();let n=m(t.output);return this._getWorldOrScreenSize(n)}return 1}_getDrivenColor({color:e,opacity:t}){let n=s();return this._drivenProperties.color&&(i(n,e?.output??this._getFallbackOpacityAndColor(a)),t==null)||this._drivenProperties.opacity&&(e||this._materialColor)&&(n[3]=t?.output??this._getFallbackOpacity()),n}_getDrivenMarkerColor({color:e,opacity:t}){let n=s();return this._drivenProperties.color&&(i(n,e?.output??this._getFallbackMarkerOpacityAndColor(a)),t==null)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(n[3]=t?.output??this._getFallbackMarkerOpacity()),n}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validatePolylineContext(e))return null;this._warnIfVVRequiresWorldSized(e.renderingInfo);let n=this.createElevationContextForGraphic(t),r=n.mode===`on-the-ground`;return this.ensureDrapedStatus(r),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,n,t.uid)}_validatePolylineContext(e){let t=e.graphic.geometry;return this._validateGeometry(t,V,this.symbolLayer.type)&&t.type===`polyline`}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:{let e=this._fastUpdates;if(D(e,t,this._fastVisualVariableConvertOptions()))for(let t of this._materials)t instanceof B&&t.setParameters(e.materialParameters);else return 0;let n=this._fastMarkerUpdates;if(D(n,t,this._fastVisualVariableConvertOptions(!0)))for(let e of this._materials)e instanceof L&&e.setParameters(n.materialParameters);else return 0}break;default:return 0}return`visualVariables`in e.diff&&this._warnIfVVRequiresWorldSized(),2}_warnIfVVRequiresWorldSized(e){if(this.symbol.worldSized||this.ignoreDrivers)return;let t=this._getSizeVariable(e);t==null||t.useSymbolValue||t.target===`outline`||h(t)===`real-world-size`&&this.logger.warnOnce(`SizeVariable uses real-world units, but LineSymbol3D.worldSized is false. Set LineSymbol3D.worldSized to true to render real-world line widths.`)}_getSizeVariable(e){let t=this._fastUpdates?.visualVariables.size;if(t)return t.variables[0];let n=e?.size,r=n?.output.findIndex(e=>typeof e==`number`);return r==null?null:n?.variables[r]}prepareSymbolLayerPatch(e){if(e.diff.type!==`partial`)return;let t=e.diff.diff,n={};t.size?.type===`complete`&&(n.width=this._computeMaterialWidth(t.size.newValue,this.symbol.worldSized),delete t.size),t.cap?.type===`complete`&&(n.cap=C(t.cap.newValue??`butt`),delete t.cap);let r=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,r),e.symbolLayerStatePatches.push(()=>{for(let e of this._materials)e?.setParameters(n)})}layerOpacityChanged(){for(let e=0;e<3;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){let e=this._screenSizePerspective;for(let t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=_(U.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=v(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){let e={hasSlicePlane:this._context.slicePlaneEnabled};for(let t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,n){let r=e.graphic,i=W(r.geometry);if(i==null)return null;let a=[],o=c(),s=N(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(s,i.paths,`paths`,`LineSymbol3DLayer`);for(let t=0;t<s.lines.length;t++){let r=s.lines[t],c=r.position,d=r.mapPositions;if(this._context.clippingExtent!=null&&(l(d,o),!u(o,this._context.clippingExtent)))continue;let f=this._createGeometry(this._lineMaterial,e,c,d,i.type,1,n);if(a.push(f),j.LINE_WIREFRAMES&&a.push(f.instantiate({material:this._wireframeLineMaterial})),this._markerMaterial!=null){let t=f.instantiate({material:this._markerMaterial});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),a.push(t)}}if(a.length===0)return null;let d=this._context.layerViewUid,f=new F({geometries:a,castShadow:!1,layerViewUid:d,graphicUid:n}),p=new b(this,f,null,g,t);return p.alignedSampledElevation=s.sampledElevation,p.needsElevationUpdates=v(t.mode),p}_createGeometry(e,t,n,r,i,a,o){let s=a===0?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,c=i===`polygon`,l=this._fastUpdates?.visualVariables.color,u=this._fastUpdates?.visualVariables.size,d=this._fastUpdates?.visualVariables.opacity,f=this._context.layerViewUid,p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:f}),{renderingInfo:m}=t,h={position:n,size:u?null:this._getDrivenSize(m),color:l?null:this._getDrivenColor(m),sizeFeature:u?k(u,m.size):null,colorFeature:l?O(l,m.color):null,opacityFeature:d?O(d,m.opacity):null};return M(e,{overlayInfo:s,removeDuplicateStartEnd:c,mapPositions:r,attributeData:h},p)}_createAsOverlay(e){let t=e.graphic,{geometry:n}=t;this._lineMaterial.renderPriority=this._renderPriority;let r=j.LINE_WIREFRAMES?this._wireframeLineMaterial:null,i=this._markerMaterial;r!=null&&(r.renderPriority=this._renderPriority-.001),i!=null&&(i.renderPriority=this._renderPriority-.002);let a=[],o=c(),s=d(),m=P(n,this._context.overlaySR);this._logGeometryCreationWarnings(m,n.paths,`paths`,`LineSymbol3DLayer`);for(let c of m.lines){if(l(c.position,o),!u(o,this._context.clippingExtent))continue;f(s,o);let d=this._createGeometry(this._lineMaterial,e,c.position,void 0,n.type,0,t.uid),m=e=>{let n=this._context.layerViewUid,r=new I(e,{layerViewUid:n,graphicUid:t.uid});a.push(r)};if(i!=null){let t=d.instantiate({material:i});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),m(t);let n=this.symbolLayer.marker.placement;(n===`begin`||n===`begin-end`)&&p(o,c.position,0,1),(n===`end`||n===`begin-end`)&&p(o,c.position,c.position.length-3,1)}m(d),j.LINE_WIREFRAMES&&m(d.instantiate({material:r}))}return new y(this,a,s,this._context.drapeSourceRenderer)}get _patternHidesLine(){return z(this.symbolLayer.pattern)}_computeMaterialWidth(e,n){return n?this._drivenProperties.size?1:e??1:(e??=H,this._drivenProperties.size?this._fastUpdates?.visualVariables.size?t(1):1:t(e))}_prepareMaterialPatch(e,t,n){let r=t.material;if(r==null){n.changed&&n.useMaterialColor&&G(this._getCombinedOpacityAndColor(this._materialColor),this._materials[2],e);return}if(r.type===`collection`)return;let i=r.type===`complete`?r.newValue?.color:r.diff.color?.type===`complete`?r.diff.color.newValue:null,a=this._getCombinedOpacityAndColor(i);n.useMaterialColor&&G(o(a),this._materials[2],e),this._patternHidesLine&&(a[3]=0),G(a,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){let n=t.marker,r=this._markerMaterial;if(n==null||n.type!==`partial`||n.diff==null||n.diff.placement!=null||n.diff.style!=null&&n.diff.style.type!==`complete`||n.diff.color!=null&&n.diff.color.type!==`complete`||r==null)return{changed:!1,useMaterialColor:this._markerColor==null};let i=n.diff.color,a=i!=null,o=a?i.newValue:null,s=o==null&&this._markerColor==null;o&&G(this._getCombinedOpacityAndColor(o),r,e);let c=n.diff.style?.newValue;return c&&e.symbolLayerStatePatches.push(()=>r.setParameters({markerPrimitive:T(c)})),delete t.marker,{changed:a,useMaterialColor:s}}_fastVisualVariableConvertOptions(e=!1){let t=this._getFallbackSize(),{size:n}=this.symbolLayer;return new A({supports:{size:!0,color:!0,rotation:!1,opacity:!0},symbolSize:r(n,n,n),fallbackColor:e?this._getFallbackMarkerOpacityAndColor(S):this._getFallbackOpacityAndColor(S),fallbackSize:r(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer.marker?.color?.a??this._getFallbackOpacity()}_getWorldOrScreenSize(e){return this.symbol.worldSized?e:t(e)}_getFallbackSize(){return this._getWorldOrScreenSize(this.symbolLayer.size)}}function W(e){return e.type===`polyline`?e:null}function G(e,t,n){t!=null&&n.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function K(e){return(e.material?.color?.a??1)===1&&(e.marker?.color?.a??1)===1}export{U as Graphics3DLineSymbolLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{splitIntoChunks as n}from"../../../../core/arrayUtils.js";import{createTask as r,resultOrAbort as i}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import s from"../../../../core/Logger.js";import{abortMaybe as c,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateNumberMemory as u,estimateStringMemory as d}from"../../../../core/memoryEstimations.js";import{whenOrAbort as f,throwIfAborted as p}from"../../../../core/promiseUtils.js";import m from"../../../../core/ReactiveSet.js";import{watch as h,sync as g}from"../../../../core/reactiveUtils.js";import{property as _,subclass as v}from"../../../../core/accessorSupport/decorators.js";import{equals as y}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as b}from"../../../../intl/number.js";import{getMaximumQuerySize as x,queryAllJSON as S}from"../../../../layers/support/featureQueryAll.js";let C=class extends t{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=D,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new m,this._geometryChangedObjectIds=new m,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new T(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(h(()=>this.layer.definitionExpression,async()=>{this._definitionExpressionDirty=!0,!this._pendingFetchChangedObjectIds&&(this._applyGeometryOverridesTask=c(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=r(e=>this._queryAndAddGeometryOverrides(e)),await this._applyGeometryOverridesTask.promise.catch(()=>{}))},g)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null}).catch(()=>{})}destroy(){this._set(`layer`,null),this._memCache=l(this._memCache),this._pendingFetchAbortController=c(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return this._associatedLayer?.infoFor3D!=null}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((e,t)=>e-t):[]}get _associatedLayer(){return this.layer==null?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return this.is3DOFL?!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished):!1}get isEmpty(){return this._pendingFetchChangedObjectIds==null&&this._attributeChangedObjectIds.size===0&&this._geometryChangedObjectIds.size===0}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);let t=this._interactiveEditingSessions,n=new w(e,()=>{t.remove(n)});return t.unshift(n),n}async applyAttributeOverrides(e,t,n,r=[]){if(this._pendingFetchChangedObjectIds&&await f(this._pendingFetchChangedObjectIds,n),t==null)return;let{attributeData:i,loadedAttributes:a}=t;if(a==null||i==null||this._attributeChangedObjectIds.size===0)return;let o=new Set;for(let e of a)o.add(e.index);for(let t of r)o.has(t.index)||(a.push(t),i[t.name]=Array(e.length));let s=await this._lockFeatureIds(e);try{let t={attributeData:i,loadedAttributes:a},{objectIds:r,fieldNames:o}=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds);if(r.length===0||o.length===0)return;let s=await this._queryAttributeOverridesFromAssociatedLayer(r,o,n);if(s==null)return;this._processOverridesFromAssociatedLayer(e,s,o,t)}finally{s.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);let n=this._clientGeometryCache.get(e);if(n!=null&&(this.geometryOverrides.remove(n),this._clientGeometryCache.delete(e)),t!=null){let n={oid:e,mesh:t};this.geometryOverrides.add(n),this._clientGeometryCache.set(e,n)}}updateAttributeValue(e,t,n){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,n)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,n){this._memCache.put(e,t,n)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:n},r){let i=[];for(let e of t)i[e.index]=n[e.name];let a=new Set,o=new Set;for(let n=0;n<e.length;n++){let s=e[n];if(r.has(s))for(let e of t){let t=this._attributeFromCache(s,e.index);if(t!==void 0){i[e.index][n]=t;continue}a.add(s),o.add(e.name)}}return{objectIds:Array.from(a),fieldNames:Array.from(o)}}_attributeFromCache(e,t){let n=this._fromInteractiveEditingSession(e,t);return n===void 0?this._memCache.get(e,t):n}_fromInteractiveEditingSession(e,t){if(this._interactiveEditingSessions!=null)for(let n of this._interactiveEditingSessions){if(n.objectId!==e)continue;let r=n.getAttribute(t);if(r!==void 0)return r}}async _queryAttributeOverridesFromAssociatedLayer(e,t,n){if(e.length===0)return null;this._logWarningIfMaximumObjectsExceeded();let{associatedLayer:r}=this.layer;if(r==null)return null;let i=r.createQuery(),{objectIdField:a}=r,o=[a,...t];i.where=this.layer.definitionExpression||`1=1`,i.returnGeometry=!1,i.outFields=o,i.cacheHint=!0;let s=await this._executeBatchQuery(r,e,i,n),c=[];for(let e of s)if(e.ok)for(let t of e.value.features)c.push(t);return c}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(e.length===0||!this.is3DOFL)return null;let n=this.layer.associatedLayer,r=n.infoFor3D,{spatialReference:i}=n;if(this.view){let{state:{viewingMode:e},spatialReference:t}=this.view,n=e===1,r=i.isGeographic;if(n&&!r)return s.getLogger(this).warn(`unsupported-pcs-edits-in-global-view`,this.layer.title,O(i,t,this.view.viewingMode,0)),null;if(!n&&r)return s.getLogger(this).warn(`unsupported-gcs-edits-in-local-view`,this.layer.title,O(i,t,this.view.viewingMode,0)),null;if(!(y(i,t)||n&&t.isWebMercator&&i.isWGS84))return s.getLogger(this).warn(`unsupported-mismatched-spatial-reference-edits`,this.layer.title,O(i,t,this.view.viewingMode,1)),null}this._logWarningIfMaximumObjectsExceeded();let{objectIdField:a,globalIdField:o}=n,c=[a,...o==null?[]:[o]],l=n.createQuery();l.where=this.layer.definitionExpression||`1=1`,l.returnGeometry=!0,l.outFields=c,l.cacheHint=!0,l.returnZ=n.hasZ,l.returnM=n.hasM;let{assetMapFromAssetMapsJSON:u,extractMesh:d}=await import(`../../../../rest/support/meshFeatureSet.js`),f=await this._executeBatchQuery(n,e,l,t),p=[];for(let e of f){if(!e.ok)continue;let{assetMaps:t,features:n,globalIdFieldName:a}=e.value;if(t==null)continue;let o=u(r,t);for(let e of n){let t=d(e,a,i,r,o),n=e;if(t==null){n.geometry=null;continue}n.geometry=t,p.push(n)}}return p}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${b(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`,t=this.layer.portalItem;t?.loaded?e+=` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:e+=` (${this.layer.parsedUrl.path})`,s.getLogger(this).warn(`#queryOverrides()`,this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,a){if(t.length===0)return[];let o=x(e);t=[...t].sort((e,t)=>e-t);let s=n(t,o).map(t=>{let n=r.clone();return n.objectIds=t,i(S(e,n,{signal:a}))});return Promise.all(s)}_processOverridesFromAssociatedLayer(e,t,n,{loadedAttributes:r,attributeData:i}){let a=this._associatedLayer;if(a==null)return;let o=a.objectIdField,s=n.map(t=>(t in i||(i[t]=Array(e.length)),i[t])),c=new Map(r.map(e=>[e.name,e.index])),l=n.map(e=>c.get(e)),u=new Map(Array.from(e,(e,t)=>[e,t]));for(let e of t){let t=e.attributes[o];for(let r=0;r<n.length;r++){let i=l[r],a=u.get(t),o=e.attributes[n[r]];s[r][a]=o,this._cacheAttributeValue(t,i,o)}}}async _fetchChangedObjectIds(e){let t=this.layer;await t.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();let{associatedLayer:n}=t;if(n==null||(await n.load({signal:e}),!n.capabilities?.operations?.supportsChangeTracking))return;let r=this._getFetchChangedObjectIdsServerGen();if(r==null)return;let i=await this.extractChanges.fetch(n,{serverGen:r,returnGeometryChanges:this.is3DOFL,signal:e});if(p(e),i!=null)for(this._setChangedObjectIds(i);this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}_setChangedObjectIds(e){let{attributeChangedObjectIds:t,geometryChangedObjectIds:n}=e,r=Math.min(this._maximumNumberOfEditOVerrides,t.length);r<t.length&&(this._warnMaximumChangedObjectsExceeded=!0);let i=t.sort((e,t)=>e-t);for(let e=0;e<r;++e){let t=i[e];this._attributeChangedObjectIds.add(t)}for(let e of n)this._geometryChangedObjectIds.add(e)}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;let{associatedLayer:t}=this.layer;if(t!=null&&t.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){let n=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(n!=null)for(let e of n)e.geometry!=null&&this.updateGeometry(e.attributes[t.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){let e=this.layer;if(e.serviceUpdateTimeStamp?.lastUpdate!=null)return e.serviceUpdateTimeStamp.lastUpdate;let t=e.associatedLayer;return t?.serverGens?.minServerGen==null?null:t.serverGens.minServerGen}async _lockFeatureIds(e){let t=this._featureIdLocks,n=!0;for(;n;){let r=[];for(let n of e){let e=t.get(n);e&&r.push(e)}r.length===0?n=!1:await Promise.all(r)}let r=Promise.withResolvers(),i=r.promise;for(let n of e)t.set(n,i);return o(()=>{for(let n of e)t.delete(n);r.resolve()})}get test(){}};e([_({constructOnly:!0})],C.prototype,`view`,void 0),e([_({constructOnly:!0})],C.prototype,`layer`,void 0),e([_({constructOnly:!0})],C.prototype,`extractChanges`,void 0),e([_({readOnly:!0})],C.prototype,`is3DOFL`,null),e([_()],C.prototype,`_interactiveEditingSessions`,void 0),e([_({readOnly:!0})],C.prototype,`sortedGeometryChangedObjectIds`,null),e([_({readOnly:!0})],C.prototype,`geometryOverrides`,void 0),e([_()],C.prototype,`_clientGeometryCache`,void 0),e([_()],C.prototype,`_associatedLayer`,null),e([_({constructOnly:!0})],C.prototype,`memoryController`,void 0),e([_()],C.prototype,`_attributeChangedObjectIds`,void 0),e([_()],C.prototype,`_geometryChangedObjectIds`,void 0),e([_()],C.prototype,`hasGeometryChanges`,null),e([_()],C.prototype,`_pendingFetchChangedObjectIds`,void 0),e([_()],C.prototype,`_pendingFetchAbortController`,void 0),e([_()],C.prototype,`_applyGeometryOverridesTask`,void 0),e([_()],C.prototype,`updating`,null),e([_()],C.prototype,`isEmpty`,null),C=e([v(`esri.views.3d.layers.i3s.I3SOverrides`)],C);class w{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class T{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,n){this._cache.put(this._getKey(e,t),new E(n))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class E{constructor(e){this.value=e,this.usedMemory=typeof e==`string`?d(e):u}}const D=5e4;function O(e,t,n,r){return`Displaying the edits of a SceneLayer with a${r===0?e.isGeographic?` geographic `:` projected `:` `}spatial reference (wkid:${e.wkid}) in ${n} viewing mode${r===1?` with spatial reference (wkid:${t.wkid}) `:` `}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${r===0?`viewing mode`:`view spatial reference`} to display edits.`}export{C as I3SOverrides};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{splitIntoChunks as n}from"../../../../core/arrayUtils.js";import{createTask as r,resultOrAbort as i}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import s from"../../../../core/Logger.js";import{abortMaybe as c,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateNumberMemory as u,estimateStringMemory as d}from"../../../../core/memoryEstimations.js";import{whenOrAbort as f,throwIfAborted as p}from"../../../../core/promiseUtils.js";import m from"../../../../core/ReactiveSet.js";import{watch as h,sync as g}from"../../../../core/reactiveUtils.js";import{property as _,subclass as v}from"../../../../core/accessorSupport/decorators.js";import{equals as y}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as b}from"../../../../intl/number.js";import{getMaximumQuerySize as x,queryAllJSON as S}from"../../../../layers/support/featureQueryAll.js";let C=class extends t{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=D,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new m,this._geometryChangedObjectIds=new m,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new T(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(h(()=>this.layer.definitionExpression,async()=>{this._definitionExpressionDirty=!0,!this._pendingFetchChangedObjectIds&&(this._applyGeometryOverridesTask=c(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=r(e=>this._queryAndAddGeometryOverrides(e)),await this._applyGeometryOverridesTask.promise.catch(()=>{}))},g)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null}).catch(()=>{})}destroy(){this._set(`layer`,null),this._memCache=l(this._memCache),this._pendingFetchAbortController=c(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return this._associatedLayer?.infoFor3D!=null}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((e,t)=>e-t):[]}get _associatedLayer(){return this.layer==null?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return this.is3DOFL?!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished):!1}get isEmpty(){return this._pendingFetchChangedObjectIds==null&&this._attributeChangedObjectIds.size===0&&this._geometryChangedObjectIds.size===0}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);let t=this._interactiveEditingSessions,n=new w(e,()=>{t.remove(n)});return t.unshift(n),n}async applyAttributeOverrides(e,t,n,r=[]){if(this._pendingFetchChangedObjectIds&&await f(this._pendingFetchChangedObjectIds,n),t==null)return;let{attributeData:i,loadedAttributes:a}=t;if(a==null||i==null||this._attributeChangedObjectIds.size===0)return;let o=new Set;for(let e of a)o.add(e.index);for(let t of r)o.has(t.index)||(a.push(t),i[t.name]=Array(e.length));let s=await this._lockFeatureIds(e);try{let t={attributeData:i,loadedAttributes:a},{objectIds:r,fieldNames:o}=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds);if(r.length===0||o.length===0)return;let s=await this._queryAttributeOverridesFromAssociatedLayer(r,o,n);if(s==null)return;this._processOverridesFromAssociatedLayer(e,s,o,t)}finally{s.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);let n=this._clientGeometryCache.get(e);if(n!=null&&(this.geometryOverrides.remove(n),this._clientGeometryCache.delete(e)),t!=null){let n={oid:e,mesh:t};this.geometryOverrides.add(n),this._clientGeometryCache.set(e,n)}}updateAttributeValue(e,t,n){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,n)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,n){this._memCache.put(e,t,n)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:n},r){let i=[];for(let e of t)i[e.index]=n[e.name];let a=new Set,o=new Set;for(let n=0;n<e.length;n++){let s=e[n];if(r.has(s))for(let e of t){let t=this._attributeFromCache(s,e.index);if(t!==void 0){i[e.index][n]=t;continue}a.add(s),o.add(e.name)}}return{objectIds:Array.from(a),fieldNames:Array.from(o)}}_attributeFromCache(e,t){let n=this._fromInteractiveEditingSession(e,t);return n===void 0?this._memCache.get(e,t):n}_fromInteractiveEditingSession(e,t){if(this._interactiveEditingSessions!=null)for(let n of this._interactiveEditingSessions){if(n.objectId!==e)continue;let r=n.getAttribute(t);if(r!==void 0)return r}}async _queryAttributeOverridesFromAssociatedLayer(e,t,n){if(e.length===0)return null;this._logWarningIfMaximumObjectsExceeded();let{associatedLayer:r}=this.layer;if(r==null)return null;let i=r.createQuery(),{objectIdField:a}=r,o=[a,...t];i.where=this.layer.definitionExpression||`1=1`,i.returnGeometry=!1,i.outFields=o,r.capabilities.query.supportsCacheHint&&(i.cacheHint=!0);let s=await this._executeBatchQuery(r,e,i,n),c=[];for(let e of s)if(e.ok)for(let t of e.value.features)c.push(t);return c}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(e.length===0||!this.is3DOFL)return null;let n=this.layer.associatedLayer,r=n.infoFor3D,{spatialReference:i}=n;if(this.view){let{state:{viewingMode:e},spatialReference:t}=this.view,n=e===1,r=i.isGeographic;if(n&&!r)return s.getLogger(this).warn(`unsupported-pcs-edits-in-global-view`,this.layer.title,O(i,t,this.view.viewingMode,0)),null;if(!n&&r)return s.getLogger(this).warn(`unsupported-gcs-edits-in-local-view`,this.layer.title,O(i,t,this.view.viewingMode,0)),null;if(!(y(i,t)||n&&t.isWebMercator&&i.isWGS84))return s.getLogger(this).warn(`unsupported-mismatched-spatial-reference-edits`,this.layer.title,O(i,t,this.view.viewingMode,1)),null}this._logWarningIfMaximumObjectsExceeded();let{objectIdField:a,globalIdField:o}=n,c=[a,...o==null?[]:[o]],l=n.createQuery();l.where=this.layer.definitionExpression||`1=1`,l.returnGeometry=!0,l.outFields=c,l.returnZ=n.hasZ,l.returnM=n.hasM,n.capabilities.query.supportsCacheHint&&(l.cacheHint=!0);let{assetMapFromAssetMapsJSON:u,extractMesh:d}=await import(`../../../../rest/support/meshFeatureSet.js`),f=await this._executeBatchQuery(n,e,l,t),p=[];for(let e of f){if(!e.ok)continue;let{assetMaps:t,features:n,globalIdFieldName:a}=e.value;if(t==null)continue;let o=u(r,t);for(let e of n){let t=d(e,a,i,r,o),n=e;if(t==null){n.geometry=null;continue}n.geometry=t,p.push(n)}}return p}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${b(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`,t=this.layer.portalItem;t?.loaded?e+=` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:e+=` (${this.layer.parsedUrl.path})`,s.getLogger(this).warn(`#queryOverrides()`,this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,a){if(t.length===0)return[];let o=x(e);t=[...t].sort((e,t)=>e-t);let s=n(t,o).map(t=>{let n=r.clone();return n.objectIds=t,i(S(e,n,{signal:a}))});return Promise.all(s)}_processOverridesFromAssociatedLayer(e,t,n,{loadedAttributes:r,attributeData:i}){let a=this._associatedLayer;if(a==null)return;let o=a.objectIdField,s=n.map(t=>(t in i||(i[t]=Array(e.length)),i[t])),c=new Map(r.map(e=>[e.name,e.index])),l=n.map(e=>c.get(e)),u=new Map(Array.from(e,(e,t)=>[e,t]));for(let e of t){let t=e.attributes[o];for(let r=0;r<n.length;r++){let i=l[r],a=u.get(t),o=e.attributes[n[r]];s[r][a]=o,this._cacheAttributeValue(t,i,o)}}}async _fetchChangedObjectIds(e){let t=this.layer;await t.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();let{associatedLayer:n}=t;if(n==null||(await n.load({signal:e}),!n.capabilities?.operations?.supportsChangeTracking))return;let r=this._getFetchChangedObjectIdsServerGen();if(r==null)return;let i=await this.extractChanges.fetch(n,{serverGen:r,returnGeometryChanges:this.is3DOFL,signal:e});if(p(e),i!=null)for(this._setChangedObjectIds(i);this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}_setChangedObjectIds(e){let{attributeChangedObjectIds:t,geometryChangedObjectIds:n}=e,r=Math.min(this._maximumNumberOfEditOVerrides,t.length);r<t.length&&(this._warnMaximumChangedObjectsExceeded=!0);let i=t.sort((e,t)=>e-t);for(let e=0;e<r;++e){let t=i[e];this._attributeChangedObjectIds.add(t)}for(let e of n)this._geometryChangedObjectIds.add(e)}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;let{associatedLayer:t}=this.layer;if(t!=null&&t.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){let n=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(n!=null)for(let e of n)e.geometry!=null&&this.updateGeometry(e.attributes[t.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){let e=this.layer;if(e.serviceUpdateTimeStamp?.lastUpdate!=null)return e.serviceUpdateTimeStamp.lastUpdate;let t=e.associatedLayer;return t?.serverGens?.minServerGen==null?null:t.serverGens.minServerGen}async _lockFeatureIds(e){let t=this._featureIdLocks,n=!0;for(;n;){let r=[];for(let n of e){let e=t.get(n);e&&r.push(e)}r.length===0?n=!1:await Promise.all(r)}let r=Promise.withResolvers(),i=r.promise;for(let n of e)t.set(n,i);return o(()=>{for(let n of e)t.delete(n);r.resolve()})}get test(){}};e([_({constructOnly:!0})],C.prototype,`view`,void 0),e([_({constructOnly:!0})],C.prototype,`layer`,void 0),e([_({constructOnly:!0})],C.prototype,`extractChanges`,void 0),e([_({readOnly:!0})],C.prototype,`is3DOFL`,null),e([_()],C.prototype,`_interactiveEditingSessions`,void 0),e([_({readOnly:!0})],C.prototype,`sortedGeometryChangedObjectIds`,null),e([_({readOnly:!0})],C.prototype,`geometryOverrides`,void 0),e([_()],C.prototype,`_clientGeometryCache`,void 0),e([_()],C.prototype,`_associatedLayer`,null),e([_({constructOnly:!0})],C.prototype,`memoryController`,void 0),e([_()],C.prototype,`_attributeChangedObjectIds`,void 0),e([_()],C.prototype,`_geometryChangedObjectIds`,void 0),e([_()],C.prototype,`hasGeometryChanges`,null),e([_()],C.prototype,`_pendingFetchChangedObjectIds`,void 0),e([_()],C.prototype,`_pendingFetchAbortController`,void 0),e([_()],C.prototype,`_applyGeometryOverridesTask`,void 0),e([_()],C.prototype,`updating`,null),e([_()],C.prototype,`isEmpty`,null),C=e([v(`esri.views.3d.layers.i3s.I3SOverrides`)],C);class w{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class T{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,n){this._cache.put(this._getKey(e,t),new E(n))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class E{constructor(e){this.value=e,this.usedMemory=typeof e==`string`?d(e):u}}const D=5e4;function O(e,t,n,r){return`Displaying the edits of a SceneLayer with a${r===0?e.isGeographic?` geographic `:` projected `:` `}spatial reference (wkid:${e.wkid}) in ${n} viewing mode${r===1?` with spatial reference (wkid:${t.wkid}) `:` `}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${r===0?`viewing mode`:`view spatial reference`} to display edits.`}export{C as I3SOverrides};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clamp as e}from"../../../../core/mathUtils.js";import{fromMat4 as t}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{identity as r,copy as i,set as a,multiply as o,scale as s,translate as c,rotateZ as l,rotateX as ee,rotateY as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,copy as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as m,zeros as h,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as _}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ones as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{meterIn as y}from"../../../../renderers/support/lengthUtils.js";import{isStringOrNull as b,isNumber as x}from"../../../../support/guards.js";import{debugFlags as S}from"../../support/debugFlags.js";import{olidEnabled as C}from"../../webgl-engine/effects/geometry/olidUtils.js";import{NoParameters as w}from"../../../webgl/NoParameters.js";class T{constructor(e){this.source=e}}class E extends T{constructor(e){super(e),this.minSize=[0,0,0],this.maxSize=[0,0,0],this.offset=[0,0,0],this.factor=[0,0,0],this.type=[0,0,0],this.fallback=[0,0,0],this.symbolRotationMatrix=n(),this.symbolAnchor=g()}}class D extends T{constructor(e){super(e),this.colors=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.values=[0,0,0,0,0,0,0,0],this.fallback=[0,0,0,0]}}class O extends T{constructor(e,t=0){super(e),this.fallback=t,this.values=[0,0,0,0,0,0,0,0],this.opacityValues=[0,0,0,0,0,0,0,0]}}class k extends T{constructor(e){super(e),this.offset=[0,0,0],this.factor=[1,1,1],this.type=[0,0,0]}}class A{}function j(e){return e!=null}function M(e,t){e&&e.push(t)}function N(e,t,n,r=d()){let i=e||0,a=t||0,o=n||0;return i!==0&&l(r,r,-i/180*Math.PI),a!==0&&ee(r,r,a/180*Math.PI),o!==0&&u(r,r,o/180*Math.PI),r}function P(e,t,n,r,i){let a=e.minSize,o=e.maxSize;if(e.useSymbolValue){let e=r.symbolSize[n];return t.minSize[n]=e,t.maxSize[n]=e,t.offset[n]=t.minSize[n],t.factor[n]=0,t.type[n]=1,!0}return j(e.field)||j(e.valueExpression)?j(e.stops)?e.stops.length===2&&x(e.stops[0].size)&&x(e.stops[1].size)?(F(e.stops[0].size,e.stops[1].size,e.stops[0].value,e.stops[1].value,t,n),t.type[n]=1,!0):(M(i,`Could not convert size info: stops only supported with 2 elements`),!1):x(a)&&x(o)&&j(e.minDataValue)&&j(e.maxDataValue)?(F(a,o,e.minDataValue,e.maxDataValue,t,n),t.type[n]=1,!0):e.valueUnit===`unknown`?(M(i,`Could not convert size info: proportional size not supported`),!1):y[e.valueUnit]==null?(M(i,`Could not convert size info: scale-dependent size not supported`),!1):(t.minSize[n]=-1/0,t.maxSize[n]=1/0,t.offset[n]=0,t.factor[n]=1/y[e.valueUnit],t.type[n]=1,!0):e.stops?.[0]&&x(e.stops[0].size)?(t.minSize[n]=e.stops[0].size,t.maxSize[n]=e.stops[0].size,t.offset[n]=t.minSize[n],t.factor[n]=0,t.type[n]=1,!0):x(a)?(t.minSize[n]=a,t.maxSize[n]=a,t.offset[n]=a,t.factor[n]=0,t.type[n]=1,!0):(M(i,`Could not convert size info: unsupported variant of sizeInfo`),!1)}function F(e,t,n,r,i,a){let o=Math.abs(r-n)>0?(t-e)/(r-n):0;i.minSize[a]=o>0?e:t,i.maxSize[a]=o>0?t:e,i.offset[a]=e-n*o,i.factor[a]=o}function te(e,t,n,r){if(e.normalizationField||e.valueRepresentation)return M(r,`Could not convert size info: unsupported property`),null;if(!b(e.field)&&!b(e.valueExpression))return M(r,`Could not convert size info: field is not a string`),null;let i=R(e);if(!t.size)t.size=new E(i),p(t.size.fallback,n.fallbackSize);else if(i){if(!t.size.source)t.size.source=i;else if(i!==t.size.source)return M(r,`Could not convert size info: multiple fields in use`),null}let a;switch(e.axis){case`width`:return a=P(e,t.size,0,n,r),a?t:null;case`height`:return a=P(e,t.size,2,n,r),a?t:null;case`depth`:return a=P(e,t.size,1,n,r),a?t:null;case`width-and-depth`:return a=P(e,t.size,0,n,r),a&&P(e,t.size,1,n,r),a?t:null;case null:case void 0:case`all`:return a=P(e,t.size,0,n,r),a&&=P(e,t.size,1,n,r),a&&=P(e,t.size,2,n,r),a?t:null;default:return M(r,`Could not convert size info: unknown axis "${e.axis}""`),null}}function ne(e,t,n){for(let n=0;n<3;++n){let r=t.unitInMeters;e.type[n]===1&&(r*=t.modelSize[n],e.type[n]=2),e.minSize[n]=e.minSize[n]/r,e.maxSize[n]=e.maxSize[n]/r,e.offset[n]=e.offset[n]/r,e.factor[n]=e.factor[n]/r}let r;if(e.type[0]!==0)r=0;else if(e.type[1]!==0)r=1;else if(e.type[2]!==0)r=2;else return M(n,`No size axis contains a valid size or scale`),!1;for(let t=0;t<3;++t)e.type[t]===0&&(e.minSize[t]=e.minSize[r],e.maxSize[t]=e.maxSize[r],e.offset[t]=e.offset[r],e.factor[t]=e.factor[r],e.type[t]=e.type[r]);return!0}function I(e,t,n){e[4*t]=n.r/255,e[4*t+1]=n.g/255,e[4*t+2]=n.b/255,e[4*t+3]=n.a}function re(e,t,n,r){if(e.normalizationField)return M(r,`Could not convert color info: unsupported property`),null;let i=R(e);if(i){if(e.stops){if(e.stops.length>8)return M(r,`Could not convert color info: too many color stops`),null;t.color=new D(i);let a=e.stops;for(let e=0;e<8;++e){let n=a[Math.min(e,a.length-1)];t.color.values[e]=n.value,I(t.color.colors,e,n.color)}_(t.color.fallback,n.fallbackColor)}else return M(r,`Could not convert color info: missing stops or colors`),null}else if(e.stops&&e.stops.length>=0){let r=e.stops&&e.stops.length>=0&&e.stops[0].color;t.color=new D(null);for(let e=0;e<8;e++)t.color.values[e]=1/0,I(t.color.colors,e,r);_(t.color.fallback,n.fallbackColor)}else return M(r,`Could not convert color info: no field and no colors/stops`),null;return t}function ie(e,t,n,r){if(e.normalizationField)return M(r,`Could not convert opacity info: unsupported property`),null;let i=R(e);if(i){if(e.stops){if(e.stops.length>8)return M(r,`Could not convert opacity info: too many opacity stops`),null;t.opacity=new O(i,n.fallbackColor[3]);let a=e.stops;for(let e=0;e<8;++e){let n=a[Math.min(e,a.length-1)];t.opacity.values[e]=n.value,t.opacity.opacityValues[e]=n.opacity}}else return M(r,`Could not convert opacity info: missing stops or opacities`),null}else if(e.stops&&e.stops.length>=0){let r=e.stops&&e.stops.length>=0?e.stops[0].opacity:0;t.opacity={source:``,values:[0,0,0,0,0,0,0,0],opacityValues:[0,0,0,0,0,0,0,0],fallback:n.fallbackColor[3]};for(let e=0;e<8;e++)t.opacity.values[e]=1/0,t.opacity.opacityValues[e]=r}else return M(r,`Could not convert opacity info: no field and no opacities/stops`),null;return t}function L(e,t,n){let r=n===2&&e.rotationType===`arithmetic`;t.offset[n]=r?90:0,t.factor[n]=r?-1:1,t.type[n]=1}function R(e){return(e.cache.hasExpression?e.valueExpression:e.field)||``}function z(e,t,n){let r=R(e);if(!t.rotation)t.rotation={source:r,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};else if(r){if(!t.rotation.source)t.rotation.source=r;else if(r!==t.rotation.source)return M(n,`Could not convert rotation info: multiple fields in use`),null}switch(e.axis){case`tilt`:return L(e,t.rotation,0),t;case`roll`:return L(e,t.rotation,1),t;case null:case void 0:case`heading`:return L(e,t.rotation,2),t;default:return M(n,`Could not convert rotation info: unknown axis "${e.axis}""`),null}}class B{constructor({supports:e,modelSize:t,symbolSize:n,unitInMeters:r,anchor:i,scale:a,rotation:o,fallbackColor:s,fallbackSize:c}){this.supports=e,this.modelSize=t??m(),this.symbolSize=n??m(),this.unitInMeters=r??1,this.anchor=i??h(),this.scale=a??m(),this.rotation=o??h(),this.fallbackColor=s??v(),this.fallbackSize=c??m()}}function V(e,t,n){if(!e)return null;let r=e.reduce((e,r)=>{if(!e)return e;switch(r.type){case`size`:return t.supports.size?te(r,e,t,n):e;case`color`:return t.supports.color?re(r,e,t,n):e;case`opacity`:return t.supports.opacity?ie(r,e,t,n):null;case`rotation`:return t.supports.rotation?z(r,e,n):e;default:return null}},new A);return e.length>0&&r&&!r.size&&!r.color&&!r.opacity&&!r.rotation||r?.size&&!ne(r.size,t,n)?null:r}class H{constructor(e,t,n){this.visualVariables=e,this.materialParameters=t,this.requiresShaderTransformation=n}}function U(e,t){if(!e||C()||S.TESTS_DISABLE_FAST_UPDATES)return null;let n=V(e.visualVariables,t);return n?new H(n,q(n,t),!!n.size):null}function W(e,t,n){if(!t||!e)return!1;let r=e.visualVariables,i=V(t.visualVariables,n);return!i||!G(r.size,i.size,`size`)||!G(r.color,i.color,`color`)||!G(r.rotation,i.rotation,`rotation`)||!G(r.opacity,i.opacity,`opacity`)?!1:(e.visualVariables=i,e.materialParameters=q(i,n),e.requiresShaderTransformation=!!i.size,!0)}function G(e,t,n){if(!!e!=!!t||e&&e.source!==t?.source)return!1;if(e&&n===`rotation`){let n=e,r=t;for(let e=0;e<3;e++)if(n.type[e]!==r.type[e]||n.offset[e]!==r.offset[e]||n.factor[e]!==r.factor[e])return!1}return!0}class K extends w{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}function q(e,n){let i=new K(e);return i.vvSize&&(p(i.vvSize.symbolAnchor,n.anchor),r($),N(n.rotation[2],n.rotation[0],n.rotation[1],$),t(i.vvSize.symbolRotationMatrix,$)),i}function J(e,t,n){if(!e.vvSize)return n;i(Z,n);let r=e.vvSize.symbolRotationMatrix;return a($,r[0],r[1],r[2],0,r[3],r[4],r[5],0,r[6],r[7],r[8],0,0,0,0,1),o(Z,Z,$),Y(Q,e,t),s(Z,Z,Q),c(Z,Z,e.vvSize.symbolAnchor),Z}function Y(t,n,r){if(!n.vvSize)return f(t,1,1,1),t;if(Number.isNaN(r[0]))return p(t,n.vvSize.fallback);for(let i=0;i<3;++i){let a=n.vvSize.offset[i]+r[0]*n.vvSize.factor[i];t[i]=e(a,n.vvSize.minSize[i],n.vvSize.maxSize[i])}return t}function ae(e,t){return e?.source?X(t?.input):0}function oe(e,t){if(!e?.source)return 0;for(let e=0;e<3;e++)if(t?.input[e]!=null)return X(t.input[e]);return X(void 0)}function X(e){return typeof e!=`number`||!isFinite(e)?NaN:e}const Z=d(),Q=g(),$=d();export{B as ConvertOptions,D as FastColorInfo,O as FastOpacityInfo,k as FastRotationInfo,E as FastSizeInfo,H as FastSymbolUpdatesState,A as FastVisualVariables,K as VisualVariablesParameters,V as convertVisualVariables,J as evaluateModelTransform,Y as evaluateModelTransformScale,ae as getAttributeValue,q as getMaterialParameters,oe as getSizeAttributeValue,U as initFastSymbolUpdatesState,W as updateFastSymbolUpdatesState};
|
|
2
|
+
import{clamp as e}from"../../../../core/mathUtils.js";import{fromMat4 as t}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{identity as r,copy as i,set as a,multiply as o,scale as s,translate as c,rotateZ as l,rotateX as ee,rotateY as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,copy as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as m,zeros as h,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as _}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ones as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{meterIn as y}from"../../../../renderers/support/lengthUtils.js";import{isStringOrNull as b,isNumber as x}from"../../../../support/guards.js";import{debugFlags as S}from"../../support/debugFlags.js";import{olidEnabled as C}from"../../webgl-engine/effects/geometry/olidUtils.js";import{NoParameters as w}from"../../../webgl/NoParameters.js";class T{constructor(e){this.source=e}}class E extends T{constructor(e){super(e),this.minSize=[0,0,0],this.maxSize=[0,0,0],this.offset=[0,0,0],this.factor=[0,0,0],this.variables=[null,null,null],this.type=[0,0,0],this.fallback=[0,0,0],this.symbolRotationMatrix=n(),this.symbolAnchor=g()}}class D extends T{constructor(e){super(e),this.colors=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.values=[0,0,0,0,0,0,0,0],this.fallback=[0,0,0,0]}}class O extends T{constructor(e,t=0){super(e),this.fallback=t,this.values=[0,0,0,0,0,0,0,0],this.opacityValues=[0,0,0,0,0,0,0,0]}}class k extends T{constructor(e){super(e),this.offset=[0,0,0],this.factor=[1,1,1],this.type=[0,0,0]}}class A{}function j(e){return e!=null}function M(e,t){e&&e.push(t)}function N(e,t,n,r=d()){let i=e||0,a=t||0,o=n||0;return i!==0&&l(r,r,-i/180*Math.PI),a!==0&&ee(r,r,a/180*Math.PI),o!==0&&u(r,r,o/180*Math.PI),r}function P(e,t,n,r,i){let a=e.minSize,o=e.maxSize;if(t.variables[n]=e,e.useSymbolValue){let e=r.symbolSize[n];return t.minSize[n]=e,t.maxSize[n]=e,t.offset[n]=t.minSize[n],t.factor[n]=0,t.type[n]=1,!0}return j(e.field)||j(e.valueExpression)?j(e.stops)?e.stops.length===2&&x(e.stops[0].size)&&x(e.stops[1].size)?(F(e.stops[0].size,e.stops[1].size,e.stops[0].value,e.stops[1].value,t,n),t.type[n]=1,!0):(M(i,`Could not convert size info: stops only supported with 2 elements`),!1):x(a)&&x(o)&&j(e.minDataValue)&&j(e.maxDataValue)?(F(a,o,e.minDataValue,e.maxDataValue,t,n),t.type[n]=1,!0):e.valueUnit===`unknown`?(M(i,`Could not convert size info: proportional size not supported`),!1):y[e.valueUnit]==null?(M(i,`Could not convert size info: scale-dependent size not supported`),!1):(t.minSize[n]=-1/0,t.maxSize[n]=1/0,t.offset[n]=0,t.factor[n]=1/y[e.valueUnit],t.type[n]=1,!0):e.stops?.[0]&&x(e.stops[0].size)?(t.minSize[n]=e.stops[0].size,t.maxSize[n]=e.stops[0].size,t.offset[n]=t.minSize[n],t.factor[n]=0,t.type[n]=1,!0):x(a)?(t.minSize[n]=a,t.maxSize[n]=a,t.offset[n]=a,t.factor[n]=0,t.type[n]=1,!0):(M(i,`Could not convert size info: unsupported variant of sizeInfo`),!1)}function F(e,t,n,r,i,a){let o=Math.abs(r-n)>0?(t-e)/(r-n):0;i.minSize[a]=o>0?e:t,i.maxSize[a]=o>0?t:e,i.offset[a]=e-n*o,i.factor[a]=o}function te(e,t,n,r){if(e.normalizationField||e.valueRepresentation)return M(r,`Could not convert size info: unsupported property`),null;if(!b(e.field)&&!b(e.valueExpression))return M(r,`Could not convert size info: field is not a string`),null;let i=R(e);if(!t.size)t.size=new E(i),p(t.size.fallback,n.fallbackSize);else if(i){if(!t.size.source)t.size.source=i;else if(i!==t.size.source)return M(r,`Could not convert size info: multiple fields in use`),null}let a;switch(e.axis){case`width`:return a=P(e,t.size,0,n,r),a?t:null;case`height`:return a=P(e,t.size,2,n,r),a?t:null;case`depth`:return a=P(e,t.size,1,n,r),a?t:null;case`width-and-depth`:return a=P(e,t.size,0,n,r),a&&P(e,t.size,1,n,r),a?t:null;case null:case void 0:case`all`:return a=P(e,t.size,0,n,r),a&&=P(e,t.size,1,n,r),a&&=P(e,t.size,2,n,r),a?t:null;default:return M(r,`Could not convert size info: unknown axis "${e.axis}""`),null}}function ne(e,t,n){for(let n=0;n<3;++n){let r=t.unitInMeters;e.type[n]===1&&(r*=t.modelSize[n],e.type[n]=2),e.minSize[n]=e.minSize[n]/r,e.maxSize[n]=e.maxSize[n]/r,e.offset[n]=e.offset[n]/r,e.factor[n]=e.factor[n]/r}let r;if(e.type[0]!==0)r=0;else if(e.type[1]!==0)r=1;else if(e.type[2]!==0)r=2;else return M(n,`No size axis contains a valid size or scale`),!1;for(let t=0;t<3;++t)e.type[t]===0&&(e.minSize[t]=e.minSize[r],e.maxSize[t]=e.maxSize[r],e.offset[t]=e.offset[r],e.factor[t]=e.factor[r],e.type[t]=e.type[r],e.variables[t]=e.variables[r]);return!0}function I(e,t,n){e[4*t]=n.r/255,e[4*t+1]=n.g/255,e[4*t+2]=n.b/255,e[4*t+3]=n.a}function re(e,t,n,r){if(e.normalizationField)return M(r,`Could not convert color info: unsupported property`),null;let i=R(e);if(i){if(e.stops){if(e.stops.length>8)return M(r,`Could not convert color info: too many color stops`),null;t.color=new D(i);let a=e.stops;for(let e=0;e<8;++e){let n=a[Math.min(e,a.length-1)];t.color.values[e]=n.value,I(t.color.colors,e,n.color)}_(t.color.fallback,n.fallbackColor)}else return M(r,`Could not convert color info: missing stops or colors`),null}else if(e.stops&&e.stops.length>=0){let r=e.stops&&e.stops.length>=0&&e.stops[0].color;t.color=new D(null);for(let e=0;e<8;e++)t.color.values[e]=1/0,I(t.color.colors,e,r);_(t.color.fallback,n.fallbackColor)}else return M(r,`Could not convert color info: no field and no colors/stops`),null;return t}function ie(e,t,n,r){if(e.normalizationField)return M(r,`Could not convert opacity info: unsupported property`),null;let i=R(e);if(i){if(e.stops){if(e.stops.length>8)return M(r,`Could not convert opacity info: too many opacity stops`),null;t.opacity=new O(i,n.fallbackColor[3]);let a=e.stops;for(let e=0;e<8;++e){let n=a[Math.min(e,a.length-1)];t.opacity.values[e]=n.value,t.opacity.opacityValues[e]=n.opacity}}else return M(r,`Could not convert opacity info: missing stops or opacities`),null}else if(e.stops&&e.stops.length>=0){let r=e.stops&&e.stops.length>=0?e.stops[0].opacity:0;t.opacity={source:``,values:[0,0,0,0,0,0,0,0],opacityValues:[0,0,0,0,0,0,0,0],fallback:n.fallbackColor[3]};for(let e=0;e<8;e++)t.opacity.values[e]=1/0,t.opacity.opacityValues[e]=r}else return M(r,`Could not convert opacity info: no field and no opacities/stops`),null;return t}function L(e,t,n){let r=n===2&&e.rotationType===`arithmetic`;t.offset[n]=r?90:0,t.factor[n]=r?-1:1,t.type[n]=1}function R(e){return(e.cache.hasExpression?e.valueExpression:e.field)||``}function z(e,t,n){let r=R(e);if(!t.rotation)t.rotation={source:r,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};else if(r){if(!t.rotation.source)t.rotation.source=r;else if(r!==t.rotation.source)return M(n,`Could not convert rotation info: multiple fields in use`),null}switch(e.axis){case`tilt`:return L(e,t.rotation,0),t;case`roll`:return L(e,t.rotation,1),t;case null:case void 0:case`heading`:return L(e,t.rotation,2),t;default:return M(n,`Could not convert rotation info: unknown axis "${e.axis}""`),null}}class B{constructor({supports:e,modelSize:t,symbolSize:n,unitInMeters:r,anchor:i,scale:a,rotation:o,fallbackColor:s,fallbackSize:c}){this.supports=e,this.modelSize=t??m(),this.symbolSize=n??m(),this.unitInMeters=r??1,this.anchor=i??h(),this.scale=a??m(),this.rotation=o??h(),this.fallbackColor=s??v(),this.fallbackSize=c??m()}}function V(e,t,n){if(!e)return null;let r=e.reduce((e,r)=>{if(!e)return e;switch(r.type){case`size`:return t.supports.size?te(r,e,t,n):e;case`color`:return t.supports.color?re(r,e,t,n):e;case`opacity`:return t.supports.opacity?ie(r,e,t,n):null;case`rotation`:return t.supports.rotation?z(r,e,n):e;default:return null}},new A);return e.length>0&&r&&!r.size&&!r.color&&!r.opacity&&!r.rotation||r?.size&&!ne(r.size,t,n)?null:r}class H{constructor(e,t,n){this.visualVariables=e,this.materialParameters=t,this.requiresShaderTransformation=n}}function U(e,t){if(!e||C()||S.TESTS_DISABLE_FAST_UPDATES)return null;let n=V(e.visualVariables,t);return n?new H(n,q(n,t),!!n.size):null}function W(e,t,n){if(!t||!e)return!1;let r=e.visualVariables,i=V(t.visualVariables,n);return!i||!G(r.size,i.size,`size`)||!G(r.color,i.color,`color`)||!G(r.rotation,i.rotation,`rotation`)||!G(r.opacity,i.opacity,`opacity`)?!1:(e.visualVariables=i,e.materialParameters=q(i,n),e.requiresShaderTransformation=!!i.size,!0)}function G(e,t,n){if(!!e!=!!t||e&&e.source!==t?.source)return!1;if(e&&n===`rotation`){let n=e,r=t;for(let e=0;e<3;e++)if(n.type[e]!==r.type[e]||n.offset[e]!==r.offset[e]||n.factor[e]!==r.factor[e])return!1}return!0}class K extends w{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}function q(e,n){let i=new K(e);return i.vvSize&&(p(i.vvSize.symbolAnchor,n.anchor),r($),N(n.rotation[2],n.rotation[0],n.rotation[1],$),t(i.vvSize.symbolRotationMatrix,$)),i}function J(e,t,n){if(!e.vvSize)return n;i(Z,n);let r=e.vvSize.symbolRotationMatrix;return a($,r[0],r[1],r[2],0,r[3],r[4],r[5],0,r[6],r[7],r[8],0,0,0,0,1),o(Z,Z,$),Y(Q,e,t),s(Z,Z,Q),c(Z,Z,e.vvSize.symbolAnchor),Z}function Y(t,n,r){if(!n.vvSize)return f(t,1,1,1),t;if(Number.isNaN(r[0]))return p(t,n.vvSize.fallback);for(let i=0;i<3;++i){let a=n.vvSize.offset[i]+r[0]*n.vvSize.factor[i];t[i]=e(a,n.vvSize.minSize[i],n.vvSize.maxSize[i])}return t}function ae(e,t){return e?.source?X(t?.input):0}function oe(e,t){if(!e?.source)return 0;for(let e=0;e<3;e++)if(t?.input[e]!=null)return X(t.input[e]);return X(void 0)}function X(e){return typeof e!=`number`||!isFinite(e)?NaN:e}const Z=d(),Q=g(),$=d();export{B as ConvertOptions,D as FastColorInfo,O as FastOpacityInfo,k as FastRotationInfo,E as FastSizeInfo,H as FastSymbolUpdatesState,A as FastVisualVariables,K as VisualVariablesParameters,V as convertVisualVariables,J as evaluateModelTransform,Y as evaluateModelTransformScale,ae as getAttributeValue,q as getMaterialParameters,oe as getSizeAttributeValue,U as initFastSymbolUpdatesState,W as updateFastSymbolUpdatesState};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{prefersReducedMotion as t}from"../../../../core/a11yUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{subclass as i}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{scaleAndAdd as s,dot as c,crossAndNormalize as l,scale as u,add as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{create as m,fromPositionAndNormal as h}from"../../../../geometry/support/plane.js";import{Sphere as g}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as _}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{InteractiveController as y}from"./InteractiveController.js";import{GroundNavigationMomentumController as b}from"./momentum/GroundNavigationMomentumController.js";import{findSphereHorizonY as x,computeHorizonPaddingLimits as S,findPlaneHorizonY as C,findGroundNavigationGrabLocation as w,groundNavigationConstants as T}from"../utils/groundNavigationUtils.js";import{OffsetCorrectionController as E}from"../utils/OffsetCorrectionController.js";import D from"../../webgl/RenderCamera.js";import{GroundNavigationMomentumEstimator as O}from"../../../navigation/GroundNavigationMomentumEstimator.js";let k=class extends y{constructor(e){super(e),this._drag=null,this._validState=!0,this._adjustedScenePoint=f(),this._momentumEstimator=new O,this._referenceSphere=new g,this._referencePlane=m(),this._tmp3d=f(),this._screenPointArray=n(),this._forwardRopeComponent=f(),this._sidewaysRopeComponent=f(),this._ropeTranslation=f(),this._beginScreenPoint=n(),this._screenPickPoint=n(),this._horizonY=null,this._horizonPadding=null,this._ropeScreenHeight=1,this._ropePlane=m(),this._pointerOverHorizonVelocityAdjustment=1,this._beginCamera=new D,this._constraintOptions=new v(15,6,0,this._beginCamera)}initialize(){this._offsetCorrectionController=new E(this.view)}stepController(e,t){this._drag&&=(this.currentCamera.copyFrom(this.startCamera),this._panningRopePull(this._drag,e),t.copyFrom(this.currentCamera),null)}get isGlobalMode(){return this.view.state.viewingMode===1}get momentumEnabled(){return this.view.navigation.momentumEnabled&&this.view.animationsEnabled&&!t()}begin(e){this.running&&(r(e.center,this._screenPickPoint),Math.abs(this._screenPickPoint[0]-this.view.width/2)<.1&&(this._screenPickPoint[0]+=1),a(this._beginScreenPoint,this._screenPickPoint),this._prepareGroundNavigation(),this._beginCamera.copyFrom(this.startCamera))}update(e){this.running&&this._validState&&(this._drag=e,this.updateInteractive())}end(e){return this.finishController(),this.createMomentum()}_initHorizonValues(){this.isGlobalMode?this._globalInitHorizonValues():this._localInitHorizonValues()}_globalInitHorizonValues(){this._referenceSphere.radius=p(this.view.spatialReference).radius,this._horizonY=x(this.startCamera,this._referenceSphere,this._screenPickPoint),this._horizonPadding=this._horizonY==null?null:S(this.startCamera,this._horizonY)}_localInitHorizonValues(){let e=f();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,e);let t=f();s(t,this.startCamera.eye,e,-this.startCamera.relativeElevation),h(t,e,this._referencePlane),this._horizonY=C(this.startCamera,this._referencePlane),this._horizonPadding=S(this.startCamera,this._horizonY)}_prepareGroundNavigation(){if(this._initHorizonValues(),!this._horizonY||!this._horizonPadding)return;if(this._momentumEstimator.reset(),this._ropeScreenHeight=this.startCamera.fullHeight/this.startCamera.pixelRatio,!w({view:this.view,originalScreenPoint:this._beginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint})){this._validState=!1;return}let e=f();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,e);let t=this.startCamera.viewRight,n=c(this._ropeTranslation,t),r=l(f(),e,t),i=c(this._ropeTranslation,r);u(this._forwardRopeComponent,r,i),u(this._sidewaysRopeComponent,t,n),h(this._adjustedScenePoint,e,this._ropePlane);let a=this._ropeScreenHeight-this._beginScreenPoint[1],o=this._ropeScreenHeight-this._horizonPadding[0];this._pointerOverHorizonVelocityAdjustment=o===0?1:Math.max(a/o,1)}_panningRopePull(e,t){if(!this._horizonY||!this._horizonPadding)return;let n=r(e.center,this._screenPointArray),i=this.startCamera.fullWidth/this.startCamera.pixelRatio*.5,a=(this._ropeScreenHeight-n[1])/(this._ropeScreenHeight-this._beginScreenPoint[1]),c=1-a,l=(n[0]-i)/(this._beginScreenPoint[0]-i),f=c*T.ySpeedMultiplier*this._pointerOverHorizonVelocityAdjustment,p=(c*T.xSpeedMultiplier+a*((1-l)*T.xSpeedMultiplier))*this._pointerOverHorizonVelocityAdjustment;u(this._ropeTranslation,this._forwardRopeComponent,f),s(this._ropeTranslation,this._ropeTranslation,this._sidewaysRopeComponent,p),this.currentCamera.eye=d(this._tmp3d,this.startCamera.eye,this._ropeTranslation),this.currentCamera.center=d(this._tmp3d,this.startCamera.center,this._ropeTranslation),this.momentumEnabled&&this._momentumEstimator.update(n,this._ropeTranslation,e.timestamp*.001),this._constraintOptions.interactionFactor=_(o(this._beginScreenPoint,n)),this._constraintOptions.interactionDirection=this._ropeTranslation,this._offsetCorrectionController.smoothlyCorrectGroundElevation(this.currentCamera,t,this._constraintOptions),this._constraintOptions.interactionDirection=null}createMomentum(){let e=this.momentumEnabled&&this._momentumEstimator.createMomentum();return e?new b({view:this.view,momentum:e}):null}};k=e([i(`esri.views.3d.state.controllers.GroundNavigationController`)],k);export{k as GroundNavigationController};
|
|
2
|
+
import{__decorate as e}from"tslib";import{prefersReducedMotion as t}from"../../../../core/a11yUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{subclass as i}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{scaleAndAdd as s,dot as c,crossAndNormalize as l,scale as u,add as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{create as m,fromPositionAndNormal as h}from"../../../../geometry/support/plane.js";import{Sphere as g}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as _}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{InteractiveController as y}from"./InteractiveController.js";import{GroundNavigationMomentumController as b}from"./momentum/GroundNavigationMomentumController.js";import{findSphereHorizonY as x,computeHorizonPaddingLimits as S,findPlaneHorizonY as C,findGroundNavigationGrabLocation as w,groundNavigationConstants as T}from"../utils/groundNavigationUtils.js";import{OffsetCorrectionController as E}from"../utils/OffsetCorrectionController.js";import D from"../../webgl/RenderCamera.js";import{GroundNavigationMomentumEstimator as O}from"../../../navigation/GroundNavigationMomentumEstimator.js";let k=class extends y{constructor(e){super(e),this._drag=null,this._validState=!0,this._adjustedScenePoint=f(),this._momentumEstimator=new O,this._referenceSphere=new g,this._referencePlane=m(),this._tmp3d=f(),this._screenPointArray=n(),this._forwardRopeComponent=f(),this._sidewaysRopeComponent=f(),this._ropeTranslation=f(),this._beginScreenPoint=n(),this._screenPickPoint=n(),this._horizonY=null,this._horizonPadding=null,this._ropeScreenHeight=1,this._ropePlane=m(),this._pointerOverHorizonVelocityAdjustment=1,this._forceStayAboveGround=!1,this._beginCamera=new D,this._constraintOptions=new v(15,6,0,this._beginCamera)}initialize(){this._offsetCorrectionController=new E(this.view)}stepController(e,t){this._drag&&=(this.currentCamera.copyFrom(this.startCamera),this._panningRopePull(this._drag,e),t.copyFrom(this.currentCamera),null)}get isGlobalMode(){return this.view.state.viewingMode===1}get momentumEnabled(){return this.view.navigation.momentumEnabled&&this.view.animationsEnabled&&!t()}begin(e){this.running&&(r(e.center,this._screenPickPoint),Math.abs(this._screenPickPoint[0]-this.view.width/2)<.1&&(this._screenPickPoint[0]+=1),a(this._beginScreenPoint,this._screenPickPoint),this._prepareGroundNavigation(),this._beginCamera.copyFrom(this.startCamera))}update(e){this.running&&this._validState&&(this._drag=e,this.updateInteractive())}end(e){return this.finishController(),this.createMomentum()}_initHorizonValues(){this.isGlobalMode?this._globalInitHorizonValues():this._localInitHorizonValues()}_globalInitHorizonValues(){this._referenceSphere.radius=p(this.view.spatialReference).radius,this._horizonY=x(this.startCamera,this._referenceSphere,this._screenPickPoint),this._horizonPadding=this._horizonY==null?null:S(this.startCamera,this._horizonY)}_localInitHorizonValues(){let e=f();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,e);let t=f();s(t,this.startCamera.eye,e,-this.startCamera.relativeElevation),h(t,e,this._referencePlane),this._horizonY=C(this.startCamera,this._referencePlane),this._horizonPadding=S(this.startCamera,this._horizonY)}_prepareGroundNavigation(){if(this._initHorizonValues(),!this._horizonY||!this._horizonPadding)return;if(this._momentumEstimator.reset(),this._ropeScreenHeight=this.startCamera.fullHeight/this.startCamera.pixelRatio,!w({view:this.view,originalScreenPoint:this._beginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint})){this._validState=!1;return}let e=f();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,e);let t=this.startCamera.viewRight,n=c(this._ropeTranslation,t),r=l(f(),e,t),i=c(this._ropeTranslation,r);u(this._forwardRopeComponent,r,i),u(this._sidewaysRopeComponent,t,n),h(this._adjustedScenePoint,e,this._ropePlane);let a=this._ropeScreenHeight-this._beginScreenPoint[1],o=this._ropeScreenHeight-this._horizonPadding[0];this._pointerOverHorizonVelocityAdjustment=o===0?1:Math.max(a/o,1),this._forceStayAboveGround=this.view.groundView.baseOpacity>0&&this.view.state.camera.relativeElevation>=0&&this.view.navigation.mode.offset!=null}_panningRopePull(e,t){if(!this._horizonY||!this._horizonPadding)return;let n=r(e.center,this._screenPointArray),i=this.startCamera.fullWidth/this.startCamera.pixelRatio*.5,a=(this._ropeScreenHeight-n[1])/(this._ropeScreenHeight-this._beginScreenPoint[1]),c=1-a,l=(n[0]-i)/(this._beginScreenPoint[0]-i),f=c*T.ySpeedMultiplier*this._pointerOverHorizonVelocityAdjustment,p=(c*T.xSpeedMultiplier+a*((1-l)*T.xSpeedMultiplier))*this._pointerOverHorizonVelocityAdjustment;u(this._ropeTranslation,this._forwardRopeComponent,f),s(this._ropeTranslation,this._ropeTranslation,this._sidewaysRopeComponent,p),this.currentCamera.eye=d(this._tmp3d,this.startCamera.eye,this._ropeTranslation),this.currentCamera.center=d(this._tmp3d,this.startCamera.center,this._ropeTranslation),this.momentumEnabled&&this._momentumEstimator.update(n,this._ropeTranslation,e.timestamp*.001),this._constraintOptions.interactionFactor=_(o(this._beginScreenPoint,n)),this._constraintOptions.interactionDirection=this._ropeTranslation,this._offsetCorrectionController.smoothlyCorrectGroundElevation({camera:this.currentCamera,deltaTime:t,constraintOptions:this._constraintOptions,forceStayAboveGround:this._forceStayAboveGround}),this._constraintOptions.interactionDirection=null}createMomentum(){let e=this.momentumEnabled&&this._momentumEstimator.createMomentum();return e?new b({view:this.view,momentum:e,forceStayAboveGround:this._forceStayAboveGround}):null}};k=e([i(`esri.views.3d.state.controllers.GroundNavigationController`)],k);export{k as GroundNavigationController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{Seconds as t}from"../../../../../core/time.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{scale as i,add as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MomentumController as s}from"./MomentumController.js";import{OffsetCorrectionController as c}from"../../utils/OffsetCorrectionController.js";let l=class extends s{constructor(e){super(e),this.interactionType=6,this._tmpPan=o(),this._lastUpdateTime=0,this._remainingGroundCorrection=0}initialize(){this._offsetCorrectionController=new c(this.view)}momentumStep(e,n){let r=this.momentum.value(e);i(this._tmpPan,this.momentum.direction,r),n.eye=a(u,n.eye,this._tmpPan),n.center=a(u,n.center,this._tmpPan);let o=t(e-this._lastUpdateTime);this.constraintOptions.interactionDirection=this._tmpPan,this._remainingGroundCorrection=this._offsetCorrectionController.smoothlyCorrectGroundElevation(n,o),this._lastUpdateTime=e}get finished(){return super.finished&&this._remainingGroundCorrection<=.01}};e([n({constructOnly:!0})],l.prototype,`momentum`,void 0),l=e([r(`esri.views.3d.state.controllers.momentum.GroundNavigationMomentumController`)],l);const u=o();export{l as GroundNavigationMomentumController};
|
|
2
|
+
import{__decorate as e}from"tslib";import{Seconds as t}from"../../../../../core/time.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{scale as i,add as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MomentumController as s}from"./MomentumController.js";import{OffsetCorrectionController as c}from"../../utils/OffsetCorrectionController.js";let l=class extends s{constructor(e){super(e),this.forceStayAboveGround=!1,this.interactionType=6,this._tmpPan=o(),this._lastUpdateTime=0,this._remainingGroundCorrection=0}initialize(){this._offsetCorrectionController=new c(this.view)}momentumStep(e,n){let r=this.momentum.value(e);i(this._tmpPan,this.momentum.direction,r),n.eye=a(u,n.eye,this._tmpPan),n.center=a(u,n.center,this._tmpPan);let o=t(e-this._lastUpdateTime);this.constraintOptions.interactionDirection=this._tmpPan,this._remainingGroundCorrection=this._offsetCorrectionController.smoothlyCorrectGroundElevation({camera:n,deltaTime:o,forceStayAboveGround:this.forceStayAboveGround}),this._lastUpdateTime=e}get finished(){return super.finished&&this._remainingGroundCorrection<=.01}};e([n({constructOnly:!0})],l.prototype,`momentum`,void 0),e([n()],l.prototype,`forceStayAboveGround`,void 0),l=e([r(`esri.views.3d.state.controllers.momentum.GroundNavigationMomentumController`)],l);const u=o();export{l as GroundNavigationMomentumController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clamp as e}from"../../../../core/mathUtils.js";import{dot as t,distance as n,subtract as r,scale as i,add as a,copy as o,normalize as s,cross as c,scaleAndAdd as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,clone as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as f}from"../../../../geometry/support/ray.js";import{applyConstraintsAndUpdateCenterRenderCamera as
|
|
2
|
+
import{clamp as e}from"../../../../core/mathUtils.js";import{dot as t,distance as n,subtract as r,scale as i,add as a,copy as o,normalize as s,cross as c,scaleAndAdd as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,clone as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as f}from"../../../../geometry/support/ray.js";import p from"../../../../ground/NavigationConstraint.js";import{applyConstraintsAndUpdateCenterRenderCamera as m}from"../../camera/constraintUtils.js";import{Intersector as h}from"../../webgl-engine/lib/Intersector.js";const g=.5,_=new Set([0,2,8]),v=new Set(_).add(7);class y{constructor(e){this._view=e,this._tmpRay=f(),this._tmpWorldUp=u(),this._tmpScaledUp=u(),this._tmpCorrectionOffset=u(),this._tmpUpdatedCameraPos=u(),this._tmpCenterDiff=u(),this._tmpMovementDelta=u(),this._tmpPerpendicularMovementDelta=u(),this._tmpGroundIntersections=[u(),u(),u()],this._tmpGroundIntersectionHits=[!1,!1,!1],this._tmpRayOrigins=[u(),u(),u()],this._tmpRayDirection=u(),this._previousCameraPosition=null,this._intersector=new h(this._view.state.viewingMode),this._intersector.options.invisibleTerrain=!0}smoothlyCorrectGroundElevation(e){let{camera:n,deltaTime:r,constraintOptions:i,navigationModeOverride:a,forceStayAboveGround:o}=e,s=this._prepareMode(a);if(!s||!r)return 0;let c=this._view.renderCoordsHelper.worldUpAtPosition(n.eye,this._tmpWorldUp),l=this._prepareCameraAndPreviousIterationPosition(n,c,this._previousCameraPosition),u=this._prepareRays(n,c,l),f=this._intersectRays(s,c,u);if(!f.hasIntersection){let e=this._adjustCameraElevation(n,c,0,o,i);return this._previousCameraPosition=d(e),0}let p=this._filterRayResults(c,l,f),m=this._getSmoothedElevationCorrection(s,p,n,c,l,r),h=this._adjustCameraElevation(n,c,m,o,i);return this._previousCameraPosition=d(h),Math.abs(p-t(h,c))}immediatelyCorrectGroundElevation(e){let{camera:i,constraintOptions:a,navigationModeOverride:o,correctionLimit:s}=e,c=this._prepareMode(o);if(!c)return;let l=this._view.renderCoordsHelper.worldUpAtPosition(i.eye,this._tmpWorldUp),u=this._prepareRays(i,l),d=this._intersectRays(c,l,u),f=d.intersections[0];if(!d.hasIntersection||n(i.eye,f)>(s??1/0)){this._adjustCameraElevation(i,l,0,!1,a);return}this._adjustCameraElevation(i,l,t(l,r(this._tmpCorrectionOffset,f,i.eye)),!1,a)}_prepareMode(e){let t=e??this._view.navigation.mode;return t.type!==`ground`||!t.offset?null:t}_prepareCameraAndPreviousIterationPosition(e,n,r){if(r){let o=t(n,e.eye),s=t(n,r);return i(this._tmpCorrectionOffset,n,s-o),e.eye=a(this._tmpUpdatedCameraPos,e.eye,this._tmpCorrectionOffset),e.center=a(this._tmpUpdatedCameraPos,e.center,this._tmpCorrectionOffset),r}return e.eye}_prepareRays(e,t,n){let r=i(this._tmpRayDirection,t,-1e5);if(o(this._tmpRayOrigins[0],e.eye),!n)return{origins:this._tmpRayOrigins,direction:r,count:1};let{forwardMovementDirection:a,rightMovementDirection:s}=this._getMovementDirections(e.eye,n,t);return this._getLeftRayOrigin(e.eye,a,s,this._tmpRayOrigins[1]),this._getRightRayOrigin(e.eye,a,s,this._tmpRayOrigins[2]),{origins:this._tmpRayOrigins,direction:r,count:this._tmpRayOrigins.length}}_getMovementDirections(e,n,a){let o=r(this._tmpMovementDelta,e,n);return r(o,o,i(this._tmpScaledUp,a,t(a,o))),s(o,o),{forwardMovementDirection:o,rightMovementDirection:c(this._tmpPerpendicularMovementDelta,o,a)}}_getLeftRayOrigin(e,t,n,r){return l(r,e,t,g),l(r,r,n,-.5),r}_getRightRayOrigin(e,t,n,r){return l(r,e,t,g),l(r,r,n,g),r}_intersectRays(e,t,r){let i=e.offset,a=this._view.sceneIntersectionHelper,s=b(e,this._view.groundView.baseOpacity===0);o(this._tmpRay.direction,r.direction);for(let e=0;e<r.count;e++)o(this._tmpRay.origin,r.origins[e]),this._tmpGroundIntersectionHits[e]=a.intersectRay(this._tmpRay,this._intersector,this._tmpGroundIntersections[e],s),this._tmpGroundIntersectionHits[e]&&n(this._tmpGroundIntersections[e],this._tmpRay.origin)>1e5&&(this._tmpGroundIntersectionHits[e]=!1),this._tmpGroundIntersectionHits[e]&&l(this._tmpGroundIntersections[e],this._tmpGroundIntersections[e],t,i);let c=this._tmpGroundIntersectionHits.some((e,t)=>t<r.count&&e);return{intersections:this._tmpGroundIntersections,hits:this._tmpGroundIntersectionHits,count:r.count,hasIntersection:c}}_filterRayResults(e,n,r){let i=t(n,e),a=null;for(let n=0;n<r.count;n++){if(!r.hits[n])continue;let o=r.intersections[n],s=t(o,e);(a==null||Math.abs(s-i)<Math.abs(a-i))&&(a=s)}return a}_getSmoothedElevationCorrection(r,i,a,o,s,c){let l=n(a.eye,s)/c,u=1+Math.max(0,(l-5)*.03),d=(u*1e-5)**c,f=t(s,o)*d+i*(1-d),p=t(a.eye,o),m=u*5*c*(r.offset??0),h=f-p;return e(h,-m,m)}_adjustCameraElevation(e,t,n,i,o){n!==0&&(l(this._tmpUpdatedCameraPos,e.eye,t,n),r(this._tmpCenterDiff,e.center,e.eye),e.eye=this._tmpUpdatedCameraPos,e.center=a(this._tmpUpdatedCameraPos,this._tmpUpdatedCameraPos,this._tmpCenterDiff));let s=this._view.map.ground.navigationConstraint;return i&&s?.type!==`stay-above`?(this._view.map.ground.navigationConstraint=new p({type:`stay-above`}),m(this._view,e,o),this._view.map.ground.navigationConstraint=s):m(this._view,e,o),e.eye}}function b(e,t){return x(e.include)?{include:e.include,exclude:e.exclude}:{exclude:e.exclude,objectFilter:e=>!!e.lastValidElevationBB,allowedIntersectorTypes:t?_:v}}function x(e){return e!=null&&e.size>0}export{y as OffsetCorrectionController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{distance as n,normalize as r,cross as i,add as a,crossAndNormalize as o,subtract as s,dot as c,scaleAndAdd as l,scale as u,copy as d,length as f}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 m}from"../../../../geometry/ellipsoidUtils.js";import{fromValues as h}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPositionAndNormal as _,distance as v,projectPoint as y,projectVector as b,intersectLineSegment as x}from"../../../../geometry/support/plane.js";import{create as S}from"../../../../geometry/support/ray.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{fromRenderCamera as w}from"../../webgl.js";import{getVoxelWasm as T}from"../../layers/VoxelWasm.js";import{pickPointAndInitSphere as E,sphereOrPlanePointFromScreenPoint as D,intersectPlaneFromScreenPoint as O,searchAreaSize as k}from"./navigationUtils.js";import{OffsetCorrectionController as ee}from"./OffsetCorrectionController.js";import{fromScreenAtEye as te}from"../../support/geometryUtils/ray.js";import ne from"../../webgl/RenderCamera.js";import{Intersector as A}from"../../webgl-engine/lib/Intersector.js";const j=1.5,M={xSpeedMultiplier:j,ySpeedMultiplier:j,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12},N=p(),P=p(),re=t(),F=p(),I=g(),L=p(),R=p(),z=p(),B=p(),V=p(),ie=p(),H=p(),U=p(),W=p(),G=p(),K=t(),q=S(),J=new C,Y=p(),ae=g(),X=p(),oe=p();function se(e,t){return b(t,e.viewForward,N),a(P,e.eye,N),e.projectToScreen(P,re),re[1]}function ce(e,t,d){let f=e.eye;if(n(t.center,f)<t.radius)return r(V,f),i(ie,V,e.viewRight),a(P,f,ie),e.projectToScreen(P,K),K[1];let p=e.up;te(e,d,q);let m=t.radius;if(o(F,p,q.direction),_(f,F,I),v(I,t.center)>m)return null;y(I,t.center,L);let h=n(t.center,L),g=Math.sqrt(m**2-h**2);s(R,f,L),r(z,R),o(B,F,z);let b=c(R,z),x=c(R,B),S=Math.sqrt(b**2+x**2),C=Math.sqrt(S**2-g**2),w=g**2/S**2,T=g/S**2*C,E=w*b,D=T*-x,O=w*x,k=T*b,ee=E+D,ne=E-D,A=O+k,j=O-k;return a(H,L,l(H,u(H,z,ee),B,A)),a(U,L,l(U,u(U,z,ne),B,j)),s(W,H,f),r(W,W),s(G,U,f),r(G,G),c(e.viewForward,W)>=c(e.viewForward,G)?e.projectToScreen(H,K):e.projectToScreen(U,K),K[1]}function le(e,t,n=!0){return n?e<t:e<=t}function Z(e,t,n=!0){return n?e>t:e>=t}function ue(e,t,n){return t?e>n:e<n}function Q(e,t){let n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(M.minimumHorizonPadding,M.relativeHorizonPadding*r)}function de(e,t){return[fe(e,t),pe(e,t)]}function fe(e,t){let n=e.fullHeight/e.pixelRatio;return Math.min(n,t+Q(e,t))}function pe(e,t){return Math.max(0,t-Q(e,t))}function me(e,t,n){let r={translation:e,location:t};return n&&(r.normal=n),r}function he(e){let{view:t}=e;return t.viewingMode===`global`?ge(e):_e(e)}function ge(e){let{view:t,originalScreenPoint:i,horizonY:a,horizonPadding:o,outTranslation:s,outGrabLocation:c,outGrabNormal:l,intersectionOptions:u,depthSearchSize:f}=e,p=t.state.camera,h=me(s,c,l);J.radius=m(t.spatialReference).radius;let g=E(t,p,i,J.radius,1,u);if(g.scenePickPoint==null)return!1;let _=g.hasGeometryIntersection;d(Y,g.scenePickPoint),d(h.location,Y);let v=g.sphere;h.normal&&g.normal&&d(h.normal,g.normal);let y=ye(i,a,o,_),b=_?n(Y,p.eye):1/0;return y.wasAdjusted&&be({view:t,screenAdjustment:y,intersector:$(t),fallbackCheck:(e,t,n)=>{let i=D(v,p,e,t);return i&&n&&r(n,t),i},output:h,intersectionOptions:u}),Se({view:t,screenPoint:y.adjustedScreenPoint,camera:p,initialDistance:b,depthSearchSize:f??k,output:h}),!0}function _e(e){let{view:t,originalScreenPoint:i,horizonY:a,horizonPadding:o,outTranslation:s,outGrabLocation:c,outGrabNormal:u,intersectionOptions:f,depthSearchSize:p}=e,m=t.sceneIntersectionHelper,h=t.state.camera,g=$(t),v=me(s,c,u);m.intersectIntersectorScreen(i,g,f);let y=g.results.min.getIntersectionPoint(Y),b=y?n(Y,h.eye):1/0;y&&(d(v.location,Y),v.normal&&d(v.normal,g.results.min.normal)),t.renderCoordsHelper.worldUpAtPosition(h.eye,V),l(X,h.eye,V,-h.relativeElevation),_(X,V,ae);let x=ye(i,a,o,y);return x.wasAdjusted&&be({view:t,screenAdjustment:x,intersector:g,fallbackCheck:(e,t,n)=>{let i=O(ae,h,e,t);return i&&n&&r(n,V),i},output:v,intersectionOptions:f}),Se({view:t,screenPoint:x.adjustedScreenPoint,camera:h,initialDistance:b,depthSearchSize:p??k,output:v}),!0}function ve(e,t,n,r){return!r&&le(e,t)||r&&ue(e,!1,n[0])?n[0]:!r&&Z(e,t,!1)?n[1]:null}function ye(e,n,r,i){let a=ve(e[1],n,r,i);return{originalScreenPoint:e,adjustedScreenPoint:t(e[0],a??e[1]),horizonY:n,horizonPadding:r,wasAdjusted:a!==null}}function $(e){let t=new A(e.state.viewingMode);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function be(e){let{view:t,screenAdjustment:n,fallbackCheck:r,intersector:i,output:a,intersectionOptions:o}=e,s=t.sceneIntersectionHelper;s.intersectIntersectorScreen(n.adjustedScreenPoint,i,{...o,requiresGroundFeedback:!0});let c=i.results.min.getIntersectionPoint(a.location);if(c){a.normal&&d(a.normal,i.results.min.normal);return}let l=xe(n);if(s.intersectIntersectorScreen(l,i,{...o,requiresGroundFeedback:!0}),c=i.results.min.getIntersectionPoint(a.location),c){a.normal&&d(a.normal,i.results.min.normal);return}c=r(n.adjustedScreenPoint,a.location,a.normal),!c&&r(l,a.location,a.normal)}function xe(e){let{originalScreenPoint:n,adjustedScreenPoint:r,horizonY:i,horizonPadding:a}=e,o=Z(r[1],i)?Math.min(a[1],n[1]):Math.max(a[0],n[1]);return t(r[0],o)}function Se(e){Ce(e),we(e)}function Ce(e){let{view:t,camera:n,output:r}=e,{offset:i}=t.navigation.mode;if(!i)return;let{translation:a,location:o}=r;t.renderCoordsHelper.worldUpAtPosition(n.eye,V),l(X,n.eye,V,-i),_(X,V,I),x(I,h(n.eye,s(N,o,n.eye)),X)&&(d(o,X),s(a,o,n.eye))}function we(e){let{view:t,screenPoint:n,camera:i,initialDistance:o,depthSearchSize:c,output:l}=e,d=c>0?t.stage.renderView.getMinimalDepthForArea(T(t),n[0],n[1],i,c):null;s(l.translation,l.location,i.eye);let p=Math.min(f(l.translation),o);d&&d<=p&&(p=d),r(l.translation,l.translation),u(l.translation,l.translation,p),a(l.location,l.translation,i.eye)}async function Te(t,r){if(t.navigation.mode.type!==`ground`){e.getLogger(`esri`).warn(`Can only advance while in ground navigation mode!`);return}let{camera:i}=t.state;t.renderCoordsHelper.worldUpAtPosition(i.eye,V);let c=t.sceneIntersectionHelper,l=$(t),p=o(N,V,i.viewRight);d(q.origin,i.eye),u(q.direction,p,r);let m=c.intersectRay(q,l,Y),h=new ne().copyFrom(i),g=s(oe,i.center,i.eye);return!m||n(Y,i.eye)>r?h.eye=a(N,q.origin,q.direction):(s(N,Y,i.eye),f(N)>2&&(Ee(N,N,.25,2),h.eye=a(N,i.eye,N))),h.center=a(N,h.eye,g),new ee(t).immediatelyCorrectGroundElevation(h,100),t.goTo(w(t,h),{duration:500,liftOffDisabled:!0})}function Ee(e,t,n,r){let i=f(e),a=Math.min(n,Math.max(i-r,0)/i);u(t,e,a)}export{Q as computeHorizonPadding,de as computeHorizonPaddingLimits,he as findGroundNavigationGrabLocation,se as findPlaneHorizonY,ce as findSphereHorizonY,Te as groundNavigationAdvance,M as groundNavigationConstants,le as isAboveHorizon,Z as isBelowHorizon,Ee as shortenTranslation,ue as shouldClampScreenY};
|
|
2
|
+
import e from"../../../../core/Logger.js";import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{distance as n,normalize as r,cross as i,add as a,crossAndNormalize as o,subtract as s,dot as c,scaleAndAdd as l,scale as u,copy as d,length as f}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 m}from"../../../../geometry/ellipsoidUtils.js";import{fromValues as h}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPositionAndNormal as _,distance as v,projectPoint as y,projectVector as b,intersectLineSegment as x}from"../../../../geometry/support/plane.js";import{create as S}from"../../../../geometry/support/ray.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{fromRenderCamera as w}from"../../webgl.js";import{getVoxelWasm as T}from"../../layers/VoxelWasm.js";import{pickPointAndInitSphere as E,sphereOrPlanePointFromScreenPoint as D,intersectPlaneFromScreenPoint as O,searchAreaSize as k}from"./navigationUtils.js";import{OffsetCorrectionController as ee}from"./OffsetCorrectionController.js";import{fromScreenAtEye as te}from"../../support/geometryUtils/ray.js";import ne from"../../webgl/RenderCamera.js";import{Intersector as A}from"../../webgl-engine/lib/Intersector.js";const j=1.5,M={xSpeedMultiplier:j,ySpeedMultiplier:j,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12},N=p(),P=p(),re=t(),F=p(),I=g(),L=p(),R=p(),z=p(),B=p(),V=p(),ie=p(),H=p(),U=p(),W=p(),G=p(),K=t(),q=S(),J=new C,Y=p(),ae=g(),X=p(),oe=p();function se(e,t){return b(t,e.viewForward,N),a(P,e.eye,N),e.projectToScreen(P,re),re[1]}function ce(e,t,d){let f=e.eye;if(n(t.center,f)<t.radius)return r(V,f),i(ie,V,e.viewRight),a(P,f,ie),e.projectToScreen(P,K),K[1];let p=e.up;te(e,d,q);let m=t.radius;if(o(F,p,q.direction),_(f,F,I),v(I,t.center)>m)return null;y(I,t.center,L);let h=n(t.center,L),g=Math.sqrt(m**2-h**2);s(R,f,L),r(z,R),o(B,F,z);let b=c(R,z),x=c(R,B),S=Math.sqrt(b**2+x**2),C=Math.sqrt(S**2-g**2),w=g**2/S**2,T=g/S**2*C,E=w*b,D=T*-x,O=w*x,k=T*b,ee=E+D,ne=E-D,A=O+k,j=O-k;return a(H,L,l(H,u(H,z,ee),B,A)),a(U,L,l(U,u(U,z,ne),B,j)),s(W,H,f),r(W,W),s(G,U,f),r(G,G),c(e.viewForward,W)>=c(e.viewForward,G)?e.projectToScreen(H,K):e.projectToScreen(U,K),K[1]}function le(e,t,n=!0){return n?e<t:e<=t}function Z(e,t,n=!0){return n?e>t:e>=t}function ue(e,t,n){return t?e>n:e<n}function Q(e,t){let n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(M.minimumHorizonPadding,M.relativeHorizonPadding*r)}function de(e,t){return[fe(e,t),pe(e,t)]}function fe(e,t){let n=e.fullHeight/e.pixelRatio;return Math.min(n,t+Q(e,t))}function pe(e,t){return Math.max(0,t-Q(e,t))}function me(e,t,n){let r={translation:e,location:t};return n&&(r.normal=n),r}function he(e){let{view:t}=e;return t.viewingMode===`global`?ge(e):_e(e)}function ge(e){let{view:t,originalScreenPoint:i,horizonY:a,horizonPadding:o,outTranslation:s,outGrabLocation:c,outGrabNormal:l,intersectionOptions:u,depthSearchSize:f}=e,p=t.state.camera,h=me(s,c,l);J.radius=m(t.spatialReference).radius;let g=E(t,p,i,J.radius,1,u);if(g.scenePickPoint==null)return!1;let _=g.hasGeometryIntersection;d(Y,g.scenePickPoint),d(h.location,Y);let v=g.sphere;h.normal&&g.normal&&d(h.normal,g.normal);let y=ye(i,a,o,_),b=_?n(Y,p.eye):1/0;return y.wasAdjusted&&be({view:t,screenAdjustment:y,intersector:$(t),fallbackCheck:(e,t,n)=>{let i=D(v,p,e,t);return i&&n&&r(n,t),i},output:h,intersectionOptions:u}),Se({view:t,screenPoint:y.adjustedScreenPoint,camera:p,initialDistance:b,depthSearchSize:f??k,output:h}),!0}function _e(e){let{view:t,originalScreenPoint:i,horizonY:a,horizonPadding:o,outTranslation:s,outGrabLocation:c,outGrabNormal:u,intersectionOptions:f,depthSearchSize:p}=e,m=t.sceneIntersectionHelper,h=t.state.camera,g=$(t),v=me(s,c,u);m.intersectIntersectorScreen(i,g,f);let y=g.results.min.getIntersectionPoint(Y),b=y?n(Y,h.eye):1/0;y&&(d(v.location,Y),v.normal&&d(v.normal,g.results.min.normal)),t.renderCoordsHelper.worldUpAtPosition(h.eye,V),l(X,h.eye,V,-h.relativeElevation),_(X,V,ae);let x=ye(i,a,o,y);return x.wasAdjusted&&be({view:t,screenAdjustment:x,intersector:g,fallbackCheck:(e,t,n)=>{let i=O(ae,h,e,t);return i&&n&&r(n,V),i},output:v,intersectionOptions:f}),Se({view:t,screenPoint:x.adjustedScreenPoint,camera:h,initialDistance:b,depthSearchSize:p??k,output:v}),!0}function ve(e,t,n,r){return!r&&le(e,t)||r&&ue(e,!1,n[0])?n[0]:!r&&Z(e,t,!1)?n[1]:null}function ye(e,n,r,i){let a=ve(e[1],n,r,i);return{originalScreenPoint:e,adjustedScreenPoint:t(e[0],a??e[1]),horizonY:n,horizonPadding:r,wasAdjusted:a!==null}}function $(e){let t=new A(e.state.viewingMode);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function be(e){let{view:t,screenAdjustment:n,fallbackCheck:r,intersector:i,output:a,intersectionOptions:o}=e,s=t.sceneIntersectionHelper;s.intersectIntersectorScreen(n.adjustedScreenPoint,i,{...o,requiresGroundFeedback:!0});let c=i.results.min.getIntersectionPoint(a.location);if(c){a.normal&&d(a.normal,i.results.min.normal);return}let l=xe(n);if(s.intersectIntersectorScreen(l,i,{...o,requiresGroundFeedback:!0}),c=i.results.min.getIntersectionPoint(a.location),c){a.normal&&d(a.normal,i.results.min.normal);return}c=r(n.adjustedScreenPoint,a.location,a.normal),!c&&r(l,a.location,a.normal)}function xe(e){let{originalScreenPoint:n,adjustedScreenPoint:r,horizonY:i,horizonPadding:a}=e,o=Z(r[1],i)?Math.min(a[1],n[1]):Math.max(a[0],n[1]);return t(r[0],o)}function Se(e){Ce(e),we(e)}function Ce(e){let{view:t,camera:n,output:r}=e,{offset:i}=t.navigation.mode;if(!i)return;let{translation:a,location:o}=r;t.renderCoordsHelper.worldUpAtPosition(n.eye,V),l(X,n.eye,V,-i),_(X,V,I),x(I,h(n.eye,s(N,o,n.eye)),X)&&(d(o,X),s(a,o,n.eye))}function we(e){let{view:t,screenPoint:n,camera:i,initialDistance:o,depthSearchSize:c,output:l}=e,d=c>0?t.stage.renderView.getMinimalDepthForArea(T(t),n[0],n[1],i,c):null;s(l.translation,l.location,i.eye);let p=Math.min(f(l.translation),o);d&&d<=p&&(p=d),r(l.translation,l.translation),u(l.translation,l.translation,p),a(l.location,l.translation,i.eye)}async function Te(t,r){if(t.navigation.mode.type!==`ground`){e.getLogger(`esri`).warn(`Can only advance while in ground navigation mode!`);return}let{camera:i}=t.state;t.renderCoordsHelper.worldUpAtPosition(i.eye,V);let c=t.sceneIntersectionHelper,l=$(t),p=o(N,V,i.viewRight);d(q.origin,i.eye),u(q.direction,p,r);let m=c.intersectRay(q,l,Y),h=new ne().copyFrom(i),g=s(oe,i.center,i.eye);return!m||n(Y,i.eye)>r?h.eye=a(N,q.origin,q.direction):(s(N,Y,i.eye),f(N)>2&&(Ee(N,N,.25,2),h.eye=a(N,i.eye,N))),h.center=a(N,h.eye,g),new ee(t).immediatelyCorrectGroundElevation({camera:h,correctionLimit:100}),t.goTo(w(t,h),{duration:500,liftOffDisabled:!0})}function Ee(e,t,n,r){let i=f(e),a=Math.min(n,Math.max(i-r,0)/i);u(t,e,a)}export{Q as computeHorizonPadding,de as computeHorizonPaddingLimits,he as findGroundNavigationGrabLocation,se as findPlaneHorizonY,ce as findSphereHorizonY,Te as groundNavigationAdvance,M as groundNavigationConstants,le as isAboveHorizon,Z as isBelowHorizon,Ee as shortenTranslation,ue as shouldClampScreenY};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../../../core/has.js";import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as n}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as i}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as a}from"../../../shaders/SphereDepthInterpolate.glsl.js";class o extends n{constructor(e,n,r,i,a){super(),this.parameters=e,this.key=a;let o=l(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this._emissions=o!==0,this.materialPass=s(e,r),this._configuration=new t(i),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,n,r)}destroy(){}get emissions(){if(!this._emissions)return 0;switch(this.materialPass){case 0:case 3:return 1;case 1:case 4:return 2;case 2:return 3}}acquireTechnique(t,n,r,i){let o=this._updateConfiguration(n,r);if(this._supportsSphereDepthInterpolate&&t.precompiling>0){o.sphereDepthInterpolate=!1;let n=t.get(e,o,i.layout);o.sphereDepthInterpolate=!0;let s=t.get(e,o,i.layout);return a(r.camera,o)?s:n}return t.get(e,o,i.layout)}_initializeMaterialConfiguration(e,t,n){let r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=!1,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=+!!e.doubleSided,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.componentDataType=n.componentDataType,r.emissionSource=l(e,n),r.groundTransparencyMode=e.groundTransparencyMode}_updateConfiguration(e,t){let n=this._configuration,{identifier:o}=e,s=o===0;n.output=t.output,n.enableOITOffset=t.enableOITOffset,n.sphereDepthInterpolate=this._supportsSphereDepthInterpolate&&a(t.camera,n),n.hasEmission=t.hasEmission,n.renderOccluded=t.slot===9;let c=this.isIntegratedMesh&&(!has(`enable-feature:im-as-ground`)||this.isGround)?d(t)?u(t)?3:2:1:0;n.integratedMeshMode=c,n.pbrMode=c===3?4:this.usePBR?this.hasParametersFromSource?n.shadeNormals!==0&&this.isIntegratedMesh?0:2:1:0,n.hasSlicePlane=t.slicePlane!=null&&this.slicePlaneEnabled,n.isGroundSlice=n.hasSlicePlane&&this.isGround;let{materialPass:l}=this;n.transparent=s&&(l===1||l===2&&e.transparent||l===4)||n.isGroundSlice,n.hasHighlightMixTexture=o===2&&t.highlightMixTexture!=null,n.snowCover=s&&t.snowCover>0,n.vertexDiscardMode=s&&l===2?e.transparent?2:1:0;let f=r(t.output);return n.receiveAmbientOcclusion=f&&this.applySSAO&&!n.renderOccluded&&t.ssao?.getTexture()!=null,n.receiveGlobalIllumination=f&&this.applySSAO&&!n.renderOccluded&&t.globalIlluminationEnabled,n.hasOccludees=f&&t.hasOccludees,n.receiveShadows=f&&t.shadowMap.ready,n.hasShadowHighlights=i(n,t),n.screenSpaceReflections=t.hasScreenSpaceReflections,n.cloudReflections=f&&t.clouds.data?.cubeMap?.colorTexture!=null,n}}function s(e,t){let{alphaDiscardMode:n,isIntegratedMesh:r,slicePlaneEnabled:i}=e,{transparent:a,opaqueOverride:o}=t,s=e.isObjectTransparent,c=e.hasBaseColorTransparency;if(r)return s||i&&(!has(`enable-feature:im-as-ground`)||e.isGround)?4:3;if(s)return 1;if(o===0)return 0;if(c||n===0||n===3)return 1;switch(a){case 2:return 0;case 0:return 1;case 1:return 2}}function c(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function l(e,{emissiveSourceOverride:t,emissiveOverride:n}){let r=e.hasEmissionTexture,i=n!==2&&(c(e)||t!==2),a=t===1,o=t===2;return i?c(e)?o?r?4:2:a?r?5:7:6:a?7:6:0}function u(e){return e.overlay?.getTexture(3)!=null}function d(e){return e.overlay?.getTexture(1)!=null}export{o as ComponentMaterial,s as computeMaterialPass,l as getEmissionSource};
|
|
2
|
+
import has from"../../../../../../core/has.js";import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as n}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as i}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as a}from"../../../shaders/SphereDepthInterpolate.glsl.js";class o extends n{constructor(e,n,r,i,a){super(),this.parameters=e,this.key=a;let o=l(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this._emissions=o!==0,this.materialPass=s(e,r),this._configuration=new t(i),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,n,r)}destroy(){}get emissions(){if(!this._emissions)return 0;switch(this.materialPass){case 0:case 3:return 1;case 1:case 4:return 2;case 2:return 3}}acquireTechnique(t,n,r,i){let o=this._updateConfiguration(n,r);if(this._supportsSphereDepthInterpolate&&t.precompiling>0){o.sphereDepthInterpolate=!1;let n=t.get(e,o,i.layout);o.sphereDepthInterpolate=!0;let s=t.get(e,o,i.layout);return a(r.camera,o)?s:n}return t.get(e,o,i.layout)}_initializeMaterialConfiguration(e,t,n){let r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=!1,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=+!!e.doubleSided,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.componentDataType=n.componentDataType,r.emissionSource=l(e,n),r.groundTransparencyMode=e.groundTransparencyMode}_updateConfiguration(e,t){let n=this._configuration,{identifier:o}=e,s=o===0;n.output=t.output,n.enableOITOffset=t.enableOITOffset,n.isGround=this.isGround,n.sphereDepthInterpolate=this._supportsSphereDepthInterpolate&&a(t.camera,n),n.hasEmission=t.hasEmission,n.renderOccluded=t.slot===9;let c=this.isIntegratedMesh&&(!has(`enable-feature:im-as-ground`)||this.isGround)?d(t)?u(t)?3:2:1:0;n.integratedMeshMode=c,n.pbrMode=c===3?4:this.usePBR?this.hasParametersFromSource?n.shadeNormals!==0&&this.isIntegratedMesh?0:2:1:0,n.hasSlicePlane=t.slicePlane!=null&&this.slicePlaneEnabled,n.isGroundSlice=n.hasSlicePlane&&this.isGround;let{materialPass:l}=this;n.transparent=s&&(l===1||l===2&&e.transparent||l===4)||n.isGroundSlice,n.hasHighlightMixTexture=o===2&&t.highlightMixTexture!=null,n.snowCover=s&&t.snowCover>0,n.vertexDiscardMode=s&&l===2?e.transparent?2:1:0;let f=r(t.output);return n.receiveAmbientOcclusion=f&&this.applySSAO&&!n.renderOccluded&&t.ssao?.getTexture()!=null,n.receiveGlobalIllumination=f&&this.applySSAO&&!n.renderOccluded&&t.globalIlluminationEnabled,n.hasOccludees=f&&t.hasOccludees,n.receiveShadows=f&&t.shadowMap.ready,n.hasShadowHighlights=i(n,t),n.screenSpaceReflections=t.hasScreenSpaceReflections,n.cloudReflections=f&&t.clouds.data?.cubeMap?.colorTexture!=null,n}}function s(e,t){let{alphaDiscardMode:n,isIntegratedMesh:r,slicePlaneEnabled:i}=e,{transparent:a,opaqueOverride:o}=t,s=e.isObjectTransparent,c=e.hasBaseColorTransparency;if(r)return s||i&&(!has(`enable-feature:im-as-ground`)||e.isGround)?4:3;if(s)return 1;if(o===0)return 0;if(c||n===0||n===3)return 1;switch(a){case 2:return 0;case 0:return 1;case 1:return 2}}function c(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function l(e,{emissiveSourceOverride:t,emissiveOverride:n}){let r=e.hasEmissionTexture,i=n!==2&&(c(e)||t!==2),a=t===1,o=t===2;return i?c(e)?o?r?4:2:a?r?5:7:6:a?7:6:0}function u(e){return e.overlay?.getTexture(3)!=null}function d(e){return e.overlay?.getTexture(1)!=null}export{o as ComponentMaterial,s as computeMaterialPass,l as getEmissionSource};
|