@arcgis/core 5.2.0-next.155 → 5.2.0-next.157
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/LineOfSightAnalysis.d.ts +49 -32
- package/analysis/LineOfSightAnalysisObserver.d.ts +19 -3
- package/analysis/LineOfSightAnalysisTarget.d.ts +19 -3
- package/analysis/Viewshed.d.ts +23 -3
- package/analysis/ViewshedAnalysis.d.ts +33 -13
- package/arcade/geometry/operatorsWorkerConnection.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d994bcf0a65d1c07160f.js → 0320cbd825f9a4222042.js} +1 -1
- package/assets/esri/core/workers/chunks/0590857215c547e63b51.js +1 -0
- package/assets/esri/core/workers/chunks/08fe248e412bb170210d.js +1 -0
- package/assets/esri/core/workers/chunks/0cb50bc2b2125c5fedf2.js +1 -0
- package/assets/esri/core/workers/chunks/1201b8c5852830836eac.js +1 -0
- package/assets/esri/core/workers/chunks/129e04d24ced77c9bb6d.js +1 -0
- package/assets/esri/core/workers/chunks/15e1117a706a98b17ad5.js +1 -0
- package/assets/esri/core/workers/chunks/164e74d586297946a717.js +1 -0
- package/assets/esri/core/workers/chunks/168a523bdc3653081f8a.js +1 -0
- package/assets/esri/core/workers/chunks/{6f4e6022a52de0c54aab.js → 172cfeb5f415e4662432.js} +1 -1
- package/assets/esri/core/workers/chunks/22b01fe31bbf0bdc48db.js +1 -0
- package/assets/esri/core/workers/chunks/27c2da2e779def2ee08b.js +1 -0
- package/assets/esri/core/workers/chunks/{925271bb763607a326ae.js → 2f04b8679c9f15390517.js} +1 -1
- package/assets/esri/core/workers/chunks/35e5762642d1a3a2e375.js +1 -0
- package/assets/esri/core/workers/chunks/{481589c3eddad6e026ad.js → 369780276b2755361f7d.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a226b69d38c72a47a08.js → 3914d96147642a9d4b01.js} +1 -1
- package/assets/esri/core/workers/chunks/{731018c0deffc41ffc97.js → 3e3e076fa5e8d5d5f33f.js} +1 -1
- package/assets/esri/core/workers/chunks/{96b6ea199ad949fef17c.js → 43cf862577bf37344ff4.js} +1 -1
- package/assets/esri/core/workers/chunks/{eb815148ae65388dd733.js → 44918ff37818a7d36d76.js} +1 -1
- package/assets/esri/core/workers/chunks/4932773663469919d10a.js +1 -0
- package/assets/esri/core/workers/chunks/4996869b9cbd8c8ddcfa.js +1 -0
- package/assets/esri/core/workers/chunks/{be5f92e98d09d6e6e38e.js → 4bb1bb3ffb1b71bc43c8.js} +1 -1
- package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +1 -0
- package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +1 -0
- package/assets/esri/core/workers/chunks/4eae066673484986d4c1.js +1 -0
- package/assets/esri/core/workers/chunks/5736feefa261589b6273.js +1 -0
- package/assets/esri/core/workers/chunks/{aeaaff7a4b1a99540f52.js → 5cb26bbaa08114aec5ce.js} +1 -1
- package/assets/esri/core/workers/chunks/{5f4feca26102088ea565.js → 60737732ce495bbdd0fc.js} +1 -1
- package/assets/esri/core/workers/chunks/6f73e41e14817acfaead.js +1 -0
- package/assets/esri/core/workers/chunks/{320e5942a098dd104366.js → 74137ffec5265628c33b.js} +1 -1
- package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +1 -0
- package/assets/esri/core/workers/chunks/{688f2dbf784e66082308.js → 74c866e0b66e61751861.js} +1 -1
- package/assets/esri/core/workers/chunks/7711ae5612f685078fc8.js +1 -0
- package/assets/esri/core/workers/chunks/{5116b569a8dbda4910c8.js → 784a2fba3e18286958d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{916b363c342b61ba5461.js → 787c1a8bda7d745633f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{f6e62d2d279a328cbed7.js → 7bcedf479b07a4b4a234.js} +1 -1
- package/assets/esri/core/workers/chunks/842893e75696428d536f.js +1 -0
- package/assets/esri/core/workers/chunks/{acfa03c65ba3ca6c5685.js → 8715661a838361d4211a.js} +1 -1
- package/assets/esri/core/workers/chunks/8e19629899a5becf8e19.js +1 -0
- package/assets/esri/core/workers/chunks/9215b59c5ccecf9add58.js +1 -0
- package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +1 -0
- package/assets/esri/core/workers/chunks/{68be3fb88ca61f82fb90.js → 95dbbddac6581b9d671f.js} +1 -1
- package/assets/esri/core/workers/chunks/{fafb92ca2c5e4b0b2c23.js → a09d2e1e2540921e4717.js} +1 -1
- package/assets/esri/core/workers/chunks/{900181f68449d8f82eeb.js → aa1ac7954e4f0fefe15b.js} +1 -1
- package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +1 -0
- package/assets/esri/core/workers/chunks/ace2e0a9d9013edd8624.js +1 -0
- package/assets/esri/core/workers/chunks/b1d5d236d5268fcbc74b.js +1 -0
- package/assets/esri/core/workers/chunks/{49ff0985fb307ac193ab.js → b573df59391ca41ee5a7.js} +1 -1
- package/assets/esri/core/workers/chunks/{f3da30d7300b92bd8bb0.js → befa32b9e7b3fbdd431e.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c469b43089767176ced.js → c5ed67fdf261cbb1624b.js} +1 -1
- package/assets/esri/core/workers/chunks/cb4be68cc5085d421615.js +1 -0
- package/assets/esri/core/workers/chunks/{de6081df29183bf80787.js → d65383f4058dc813f40d.js} +1 -1
- package/assets/esri/core/workers/chunks/d6cd0039d6e9c40961e3.js +1 -0
- package/assets/esri/core/workers/chunks/{c598b22f78ccc57f9d6d.js → dfd2dc5cdc97ffba8926.js} +1 -1
- package/assets/esri/core/workers/chunks/e1b7806ab3e1967b15f0.js +1 -0
- package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +1 -0
- package/assets/esri/core/workers/chunks/eb2652ec48faa78de3c5.js +1 -0
- package/assets/esri/core/workers/chunks/{c62738f84c914671b143.js → f4a7aa3cdbc0c429c359.js} +1 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ar.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.bg.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.bs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ca.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.cs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.da.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.de.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.el.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.es.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.et.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.fi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.fr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.he.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.hr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.hu.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.id.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.it.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ja.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ko.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.lt.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.lv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.nl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.no.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.pl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ro.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.ru.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.sv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.th.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.tr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.uk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.vi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/messages.zh-TW.json +1 -1
- 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.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/Editor/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/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/assets/esri/widgets/Sketch/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.zh-TW.json +1 -1
- package/config.d.ts +2 -0
- package/config.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/PooledArray.js +1 -1
- package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
- package/core/workers/WorkerOwner.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/core/workers/workers.js +2 -2
- package/core/workers.d.ts +9 -0
- package/geometry/Mesh.js +1 -1
- package/geometry/support/buffer/BufferPool.js +1 -1
- package/geometry/support/coordsUtils.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -2
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/CatalogLayer.d.ts +2 -2
- package/layers/CatalogLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -2
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +2 -2
- package/layers/FeatureLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/LineOfSightLayer.d.ts +10 -8
- package/layers/SubtypeGroupLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/ViewshedLayer.d.ts +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +9 -9
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
- package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/{FeatureLayerReload.d.ts → ReloadableLayer.d.ts} +5 -3
- package/layers/mixins/ReloadableLayer.js +2 -0
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +2 -2
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/datasets/InMemoryRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/WCSRaster.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/formats/Zlib.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/package.json +2 -2
- package/popup/FeatureModel.js +1 -1
- package/popup/FeaturesModel.js +1 -1
- package/request/process.js +1 -1
- package/request/types.d.ts +7 -0
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/symbols/support/ElevationInfo.d.ts +4 -3
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js} +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/types.d.ts +14 -3
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +39 -13
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/types.d.ts +7 -0
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +43 -15
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccluded.js +1 -1
- package/views/interactive/options/TooltipOptions.d.ts +2 -0
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +2 -0
- package/views/layers/LineOfSightLayerView.d.ts +35 -13
- package/views/layers/SketchLayerView.d.ts +1 -0
- package/views/layers/ViewshedLayerView.d.ts +36 -12
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +2 -2
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +5 -2
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerCollection.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerCombobox.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerLabel.d.ts +7 -1
- package/widgets/ValuePicker/ValuePickerSlider.d.ts +2 -0
- package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +5 -1
- package/widgets/ValuePicker/types.d.ts +2 -0
- package/assets/esri/core/workers/chunks/03261b9451e293a0fac8.js +0 -1
- package/assets/esri/core/workers/chunks/0ad0484ffcbe4ad21bd3.js +0 -1
- package/assets/esri/core/workers/chunks/19743dedaa40446259ec.js +0 -1
- package/assets/esri/core/workers/chunks/1c65ab9ed611c322ce27.js +0 -1
- package/assets/esri/core/workers/chunks/1f339247b68b061ab0a4.js +0 -1
- package/assets/esri/core/workers/chunks/251921cd10ecfbc89451.js +0 -1
- package/assets/esri/core/workers/chunks/3252b1fae363bb0129a0.js +0 -1
- package/assets/esri/core/workers/chunks/408e81c8f1eff8a7b379.js +0 -1
- package/assets/esri/core/workers/chunks/50036a323c2e7f155311.js +0 -1
- package/assets/esri/core/workers/chunks/55dcbf296d8d0092e473.js +0 -1
- package/assets/esri/core/workers/chunks/59b216b60464611742d4.js +0 -1
- package/assets/esri/core/workers/chunks/5bfea0c55aca826de536.js +0 -1
- package/assets/esri/core/workers/chunks/60d3056a31d982c9cad0.js +0 -1
- package/assets/esri/core/workers/chunks/6558488ea96620439f34.js +0 -1
- package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +0 -1
- package/assets/esri/core/workers/chunks/6b43bb78f9839ed43135.js +0 -1
- package/assets/esri/core/workers/chunks/6c83398cf586ecea0eb1.js +0 -1
- package/assets/esri/core/workers/chunks/7267b17de212207142c9.js +0 -1
- package/assets/esri/core/workers/chunks/88c74f3316f1fc253207.js +0 -1
- package/assets/esri/core/workers/chunks/912080c90b5cc2e817cf.js +0 -1
- package/assets/esri/core/workers/chunks/a97d85774f9a417202df.js +0 -1
- package/assets/esri/core/workers/chunks/aff32980d91dab07dfb7.js +0 -1
- package/assets/esri/core/workers/chunks/b1b4066e8d1c0c9656e5.js +0 -1
- package/assets/esri/core/workers/chunks/b6ba66a05030d3815dfd.js +0 -1
- package/assets/esri/core/workers/chunks/bbec9d2e3b75a5c59681.js +0 -1
- package/assets/esri/core/workers/chunks/bf69024804ac51c8f733.js +0 -1
- package/assets/esri/core/workers/chunks/c1254cd131a62750ff6f.js +0 -1
- package/assets/esri/core/workers/chunks/d938987344bce83cc660.js +0 -1
- package/assets/esri/core/workers/chunks/db1ab9b9c8bf5c7635d3.js +0 -1
- package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +0 -1
- package/assets/esri/core/workers/chunks/f4f9d08b2df856e3b694.js +0 -1
- package/assets/esri/core/workers/chunks/fd9663952d5a94f3a83f.js +0 -1
- package/layers/mixins/FeatureLayerReload.js +0 -2
- /package/views/3d/analysis/LineOfSight/{lineOfSightPlacementUtils.js → placementUtils.js} +0 -0
|
@@ -32,11 +32,12 @@ export interface ElevationInfoProperties<Modes extends ElevationInfoMode = Eleva
|
|
|
32
32
|
*
|
|
33
33
|
* > [!WARNING]
|
|
34
34
|
* >
|
|
35
|
-
* > If `elevationInfo` is not set, the elevation mode is picked on the fly for each
|
|
36
|
-
* > -
|
|
37
|
-
* > -
|
|
35
|
+
* > If `elevationInfo` is not set, the elevation mode is picked on the fly for each element:
|
|
36
|
+
* > - Elements with z-values default to `absolute-height`.
|
|
37
|
+
* > - Elements without z-values:
|
|
38
38
|
* > - Polylines, polygons, and points drawn with `ObjectSymbol3DLayer` default to `on-the-ground`.
|
|
39
39
|
* > - Points drawn with `IconSymbol3DLayer` default to `relative-to-ground`.
|
|
40
|
+
* > - Visibility analyses' observers and targets default to `on-the-ground`.
|
|
40
41
|
* >
|
|
41
42
|
* > Feature services do not persist `elevationInfo`, so elevation settings from publishing tools such as ArcGIS Pro are lost unless saved in a web scene.
|
|
42
43
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{pt2px as e}from"../../../../../../core/screenUtils.js";import{fromRotation as t,multiply as n,translate as r,rotate as i}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as s}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as l,getYAnchorDirection as u}from"../../alignmentUtils.js";import{magicLabelLineHeight as d}from"../../definitions.js";import f from"../../Rect.js";import p from"../../collisions/BoundingBox.js";const m=Math.PI/180;class h{static fromGlyph(e,t,n,r,i){let{mosaicItem:a,rect:o,shaping:s,code:c}=n,l=a.rect;return new h({width:c===0?o.width:l.width*r,height:c===0?o.height:l.height*r,x:r*(e+s.xOffset+o.left),y:r*(t+s.yOffset-o.top),textureBinding:a.textureBinding,texcoords:{topLeft:[l.x,l.y],topRight:[l.x+l.width,l.y],bottomLeft:[l.x,l.y+l.height],bottomRight:[l.x+l.width,l.y+l.height]},fontSize:i?.fontSize,color:i?.color})}constructor(e){this._rotationT=a(),this._transform=a(),this._angle=0,this._bounds=null,this.width=e.width,this.height=e.height,this.x=e.x,this.y=e.y,this.textureBinding=e.textureBinding,this.texcoords=e.texcoords,this.fontSize=e.fontSize,this.color=e.color}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){let{x:e,y:r,width:i,height:s}=this,c=t(a(),-this.angle),l=n(a(),c,this._transform);this._offsets={topLeft:o([0,0],[e,r],l),topRight:o([0,0],[e+i,r],l),bottomLeft:o([0,0],[e,r+s],l),bottomRight:o([0,0],[e+i,r+s],l)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){let e=this.offsets,t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,o]of[e.topLeft,e.topRight,e.bottomLeft,e.bottomRight])t=Math.min(t,a),n=Math.min(n,o),r=Math.max(r,a),i=Math.max(i,o);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;this._bounds=new p(s,c,a,o)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}}const g=(e,t)=>({code:0,mosaicItem:{rect:new f(0,0,11,8),sdf:!0,page:0,textureBinding:t},rect:{height:4,width:e,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function _(t){return t===`underline`?e(2):0}function v(e,t,n,r,i){switch(e){case`underline`:return(n??i?.baseline??22)+4+_(e)/t;case`line-through`:return r??i?.midline??16;default:return 0}}function y(e,t){return e.forEach(e=>o(e,e,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}class b{constructor(e,t,n,r){this._rotation=0,this._decorate(e,t,n,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=n.angle!==0,this._transform=this._createGlyphTransform(this.bounds,n),this._borderLineSizePx=n.borderLineSizePx,(n.borderLineSizePx||n.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(let t of e)t.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;let r=this._transform,i=t(a(),e);n(r,i,r);for(let e of this.glyphs)e.setTransform(this._transform)}_decorate(e,t,n,r){if(!n.decoration||n.decoration===`none`||!e.length)return;let i=n.scale,a=e[0].textureBinding;for(let o of t){let t=o.scale??i,s=v(n.decoration,t,o.baseline,o.midline,r),c=o.startX*t,l=o.startY*t,u=(o.width+o.glyphWidthEnd)*t;e.push(h.fromGlyph(c,l+s*t,g(u,a),1))}}shapeBackground(e){let t=(1.5+(this._borderLineSizePx||0))/2,n=this._borderLineSizePx?t:0,{xmin:r,ymin:i,xmax:a,ymax:o,x:s,y:c,width:l,height:u}=this.bounds,d=[r-8,i-8],f=[a+8,i-8],m=[r-8,o+8],h=[a+8,o+8],g=y([[d[0]-t,d[1]-t],[f[0]+t,f[1]-t],[d[0]+n,d[1]+n],[f[0]-n,f[1]+n]],e),_=y([[m[0]+n,m[1]-n],[h[0]-n,h[1]-n],[m[0]-t,m[1]+t],[h[0]+t,h[1]+t]],e),v=y([[d[0]-t,d[1]-t],[d[0]+n,d[1]+n],[m[0]-t,m[1]+t],[m[0]+n,m[1]-n]],e),b=y([[f[0]-n,f[1]+n],[f[0]+t,f[1]-t],[h[0]-n,h[1]-n],[h[0]+t,h[1]+t]],e),x={main:y([d,f,m,h],e),top:g,bot:_,left:v,right:b};return[new p(s,c,l+t*2,u+t*2),x]}get boundsT(){let e=this.bounds,t=s(c(),e.x,e.y);if(o(t,t,this._transform),this._hasRotation){let n=Math.max(e.width,e.height);return new p(t[0],t[1],n,n)}return new p(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,n=1/0,r=0,i=0;for(let a of e)t=Math.min(t,a.offsets.topLeft[0]),n=Math.min(n,a.offsets.topLeft[1]),r=Math.max(r,a.offsets.bottomRight[0]),i=Math.max(i,a.offsets.bottomRight[1]);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;return new p(s,c,a,o)}_createGlyphTransform(e,t){let n=m*t.angle,o=a(),l=c();return r(o,o,s(l,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?i(o,o,n):(r(o,o,s(l,e.x,e.y)),i(o,o,n),r(o,o,s(l,-e.x,-e.y))),o}}class x{constructor(e,t,n,r,i,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,n)),this.end=Math.max(0,Math.max(t,n)),this.end<e.length&&(this.glyphWidthEnd=e[this.end].rect.width),this.width=r,this.yMin=i,this.yMax=a}}const S=e=>e===10,C=e=>e===32;function w(e,t,n){let r=[],i=1/n.scale,a=n.maxLineWidth*i,o=t?e.length-1:0,s=t?-1:e.length,c=t?-1:1,l=o,u=0,d=0,f=l,p=f,m=0,h=1/0,g=0;for(;l!==s;){let{code:t,rect:n,shaping:i}=e[l],s=Math.abs(n.top);if(!S(t)&&!C(t)&&(h=Math.min(h,s),g=Math.max(g,s+n.height)),S(t))l!==o&&(r.push(new x(e,f,l-c,u,h===1/0?0:h,g)),h=1/0,g=0),u=0,f=l+c,p=l+c,d=0;else if(C(t))p=l+c,d=0,m=i.xAdvance,u+=i.xAdvance;else if(u>a){if(p!==f){let t=p-2*c;u-=m,r.push(new x(e,f,t,u-d,h,g)),h=1/0,g=0,f=p,u=d}else r.push(new x(e,f,l-c,u,h,g)),h=1/0,g=0,f=l,p=l,u=0;u+=i.xAdvance,d+=i.xAdvance}else u+=i.xAdvance,d+=i.xAdvance;l+=c}let _=new x(e,f,l-c,u,h,g);return _.start>=0&&_.end<e.length&&r.push(_),r}function T(e,t){let n=0;for(let t=0;t<e.length;t++){let{width:r}=e[t];n=Math.max(r,n)}let r=t.decoration===`underline`?4:0,i=e[0].yMin;return{x:0,y:i,height:e[e.length-1].yMax+t.lineHeight*(e.length-1)+r-i,width:n}}function E(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].code)&&!S(e[i+1].code)&&r++;return r}function D(e,t){let n=t.scale,r=[],i=e.sdfPadding,{faceInfo:a,glyphs:o,isRightToLeft:s}=e,c=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,d=w(o,s,t),f=d.length?T(d,t):{y:0,height:0,width:0},p=c?s?1:-1:l(t.horizontalAlignment),m=u(t.verticalAlignment),g=+(m===2),_=g?0:m-1,v=a?.baseline??22,y=d.length>1,x=g?y?-f.y-f.height:-v:-f.y+_*(f.height/2);for(let a=0;a<d.length;a++){let{start:s,end:l,width:u}=d[a],m=c&&a<d.length-1?E(o,s,l):0,g=m>0?(f.width-u)/m:0,_=g>0?f.width:u,v=(p+1)*-1*(_/2)-i,y=(e.isRightToLeft?d.length-1-a:a)*t.lineHeight+x-i;d[a].startX=v,d[a].startY=y;for(let e=s;e<=l;e++){let t=o[e];if(S(t.code))continue;let i=h.fromGlyph(v,y,t,n);v+=t.shaping.xAdvance,g>0&&C(t.code)&&(v+=g),r.push(i)}}return new b(r,d,t,a)}function O(e,t){let n=t.scale,{faceInfo:r,glyphs:i}=e,a=i.reduce((e,t)=>Math.max(e,t.rect.height),0),o=i.filter(e=>!S(e.code)&&e.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.rect.width/2,-a,e,n));return new b(o,[],t,r)}function k(e,t){return e.type===`glyphs`?D(e,t):j(e,t)}function A(e,t){return e.type===`glyphs`?O(e,t):M(e,t)}function j(e,t){let n=N(e,t),r=P(n,t),i=r.length?I(r):{width:0},a=[],o=t.decoration===`underline`?`none`:t.decoration,s=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,c=s?-1:l(t.horizontalAlignment),d=u(t.verticalAlignment),f=d===2,p=r.length?r[0].yMin:0,m=r.length?L(r[r.length-1]):0,g=m-p,_=f?r.length>1?-m:-(r[0]?.baseline??0):d===1?-p:d===-1?-m:-(p+g/2);for(let e=0;e<r.length;e++){let t=r[e],o=s&&e<r.length-1?R(n,t.start,t.end):0,l=o>0?(i.width-t.width)/o:0,u=l>0?i.width:t.width,d=(c+1)*-1*(u/2),f=t.startY+_,p=null;t.startX=d,t.startY=f;for(let e=t.start;e<=t.end;e++){let r=n[e],{glyph:i,scale:o,fontSize:s}=r,c=d;if(S(i.code)){p=z(a,p,f,t.baseline);continue}r.decoration===`underline`?(p&&p.underlineOffset!==r.underlineOffset||p&&!B(p.color,r.color))&&(p=z(a,p,f,t.baseline)):p=z(a,p,f,t.baseline);let u=f+t.baseline-r.baseline;a.push(h.fromGlyph(d/o,u/o,i,o,{fontSize:s,color:r.color})),d+=r.xAdvance,r.decoration===`underline`&&(p??={startX:c,endX:d,glyphWidthEnd:i.rect.width*o,textureBinding:i.mosaicItem.textureBinding,underlineOffset:r.underlineOffset,color:r.color},p.endX=d,p.glyphWidthEnd=i.rect.width*o,p.textureBinding=p.textureBinding??i.mosaicItem.textureBinding),l>0&&C(i.code)&&(d+=l,p&&(p.endX=d))}z(a,p,f,t.baseline)}return new b(a,r,{...t,decoration:o})}function M(e,t){let n=N(e,t),r=n.reduce((e,t)=>Math.max(e,t.glyph.rect.height*t.scale),0),i=n.filter(e=>!S(e.glyph.code)&&e.glyph.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.glyph.rect.width/2,-r/e.scale,e.glyph,e.scale,{fontSize:e.fontSize,color:e.color}));return new b(i,[],t)}function N(t,n){let r=n.lineHeightRatio??1,i=[];for(let n of t.runs){let t=e(n.fontSize),a=t/n.glyphs.sdfSize,o=d/24*t*r,s=(n.glyphs.faceInfo?.baseline??22)*a,c=(n.glyphs.faceInfo?.midline??16)*a,l=4*a+_(n.decoration),u=1+(n.characterSpacing??0);for(let e of n.glyphs.glyphs){let r=e.shaping.xAdvance*a,d=Math.abs(e.rect.top)*a,f=d+e.rect.height*a;i.push({glyph:e,scale:a,fontSize:t,decoration:n.decoration,underlineOffset:l,color:n.color,xAdvance:!S(e.code)&&!C(e.code)?r*u:r,top:d,bottom:f,lineHeight:o,baseline:s,midline:c})}}return i}function P(e,t){let n=[],r=t.maxLineWidth,i=0,a=0,o=0,s=0,c=0,l=0;for(;i<e.length;){let t=e[i],{glyph:u}=t;if(S(u.code))i!==0&&n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),a=0,s=i+1,c=s,o=0,l=0;else if(C(u.code))c=i+1,o=0,l=t.xAdvance,a+=t.xAdvance;else if(a>r){if(c!==s){let t=c-2;a-=l,n.push({width:a-o,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=c,a=o}else n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=i,c=i,a=0;a+=t.xAdvance,o+=t.xAdvance}else a+=t.xAdvance,o+=t.xAdvance;i++}if(s<e.length){let t=e.length-1;n.push({width:a,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1})}return F(e,n)}function F(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=0,a=1/0,o=0,s=0;for(let t=r.start;t<=r.end;t++){let n=e[t];n.decoration===`underline`&&(s=Math.max(s,n.underlineOffset)),!(S(n.glyph.code)||C(n.glyph.code))&&(i=Math.max(i,n.baseline),o=Math.max(o,n.lineHeight))}let c=1/0,l=-1/0;for(let t=r.start;t<=r.end;t++){let n=e[t];S(n.glyph.code)||C(n.glyph.code)||(c=Math.min(c,i-n.baseline+n.top),l=Math.max(l,i-n.baseline+n.bottom),a=Math.min(a,i-n.baseline+n.midline))}s>0&&(l=Math.max(l,i+s)),r.baseline=i,r.midline=a===1/0?i:a,r.lineHeight=Math.max(o,l),r.yMin=c===1/0?0:c,r.yMax=l===-1/0?0:l,r.startY=n>0?t[n-1].startY+t[n-1].lineHeight:0}return t}function I(e){let t=0;for(let n of e)t=Math.max(n.width+n.glyphWidthEnd,t);let n=e[0].yMin,r=e[e.length-1];return{x:0,y:n,height:L(r)-n,width:t}}function L(e){return e.startY+e.lineHeight}function R(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].glyph.code)&&!S(e[i+1].glyph.code)&&r++;return r}function z(e,t,n,r){return t&&e.push(h.fromGlyph(t.startX,n+r+t.underlineOffset,g(t.endX-t.startX+t.glyphWidthEnd,t.textureBinding),1,{color:t.color})),null}function B(e,t){return e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}export{h as ShapedGlyph,b as ShapingInfo,D as shapeGlyphs,O as shapeGlyphsForMultipoint,j as shapeRichText,M as shapeRichTextForMultipoint,k as shapeTextResource,A as shapeTextResourceForMultipoint};
|
|
2
|
+
import{pt2px as e}from"../../../../../../core/screenUtils.js";import{fromRotation as t,multiply as n,translate as r,rotate as i}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as s}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as l,getYAnchorDirection as u}from"../../alignmentUtils.js";import{magicLabelLineHeight as d}from"../../definitions.js";import f from"../../Rect.js";import p from"../../collisions/BoundingBox.js";const m=Math.PI/180;class h{static fromGlyph(e,t,n,r,i){let{mosaicItem:a,rect:o,shaping:s,code:c}=n,l=a.rect;return new h({width:c===0?o.width:l.width*r,height:c===0?o.height:l.height*r,x:r*(e+s.xOffset+o.left),y:r*(t+s.yOffset-o.top),textureBinding:a.textureBinding,texcoords:{topLeft:[l.x,l.y],topRight:[l.x+l.width,l.y],bottomLeft:[l.x,l.y+l.height],bottomRight:[l.x+l.width,l.y+l.height]},fontSize:i?.fontSize,color:i?.color})}constructor(e){this._rotationT=a(),this._transform=a(),this._angle=0,this._bounds=null,this.width=e.width,this.height=e.height,this.x=e.x,this.y=e.y,this.textureBinding=e.textureBinding,this.texcoords=e.texcoords,this.fontSize=e.fontSize,this.color=e.color}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){let{x:e,y:r,width:i,height:s}=this,c=t(a(),-this.angle),l=n(a(),c,this._transform);this._offsets={topLeft:o([0,0],[e,r],l),topRight:o([0,0],[e+i,r],l),bottomLeft:o([0,0],[e,r+s],l),bottomRight:o([0,0],[e+i,r+s],l)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){let e=this.offsets,t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,o]of[e.topLeft,e.topRight,e.bottomLeft,e.bottomRight])t=Math.min(t,a),n=Math.min(n,o),r=Math.max(r,a),i=Math.max(i,o);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;this._bounds=new p(s,c,a,o)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}}const g=(e,t)=>({code:0,mosaicItem:{rect:new f(0,0,11,8),sdf:!0,page:0,textureBinding:t},rect:{height:4,width:e,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function _(t){return t===`underline`?e(2):0}function v(e,t,n,r,i){switch(e){case`underline`:return(n??i?.baseline??22)+4+_(e)/t;case`line-through`:return r??i?.midline??16;default:return 0}}function y(e,t){return e.forEach(e=>o(e,e,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}class b{constructor(e,t,n,r){this._rotation=0,this._decorate(e,t,n,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=n.angle!==0,this._transform=this._createGlyphTransform(this.bounds,n),this._borderLineSizePx=n.borderLineSizePx,(n.borderLineSizePx||n.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(let t of e)t.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;let r=this._transform,i=t(a(),e);n(r,i,r);for(let e of this.glyphs)e.setTransform(this._transform)}_decorate(e,t,n,r){if(!n.decoration||n.decoration===`none`||!e.length)return;let i=n.scale,a=e[0].textureBinding;for(let o of t){let t=o.scale??i,s=v(n.decoration,t,o.baseline,o.midline,r),c=o.startX*t,l=o.startY*t,u=(o.width+o.glyphWidthEnd)*t;e.push(h.fromGlyph(c,l+s*t,g(u,a),1))}}shapeBackground(e){let t=(1.5+(this._borderLineSizePx||0))/2,n=this._borderLineSizePx?t:0,{xmin:r,ymin:i,xmax:a,ymax:o,x:s,y:c,width:l,height:u}=this.bounds,d=[r-8,i-8],f=[a+8,i-8],m=[r-8,o+8],h=[a+8,o+8],g=y([[d[0]-t,d[1]-t],[f[0]+t,f[1]-t],[d[0]+n,d[1]+n],[f[0]-n,f[1]+n]],e),_=y([[m[0]+n,m[1]-n],[h[0]-n,h[1]-n],[m[0]-t,m[1]+t],[h[0]+t,h[1]+t]],e),v=y([[d[0]-t,d[1]-t],[d[0]+n,d[1]+n],[m[0]-t,m[1]+t],[m[0]+n,m[1]-n]],e),b=y([[f[0]-n,f[1]+n],[f[0]+t,f[1]-t],[h[0]-n,h[1]-n],[h[0]+t,h[1]+t]],e),x={main:y([d,f,m,h],e),top:g,bot:_,left:v,right:b};return[new p(s,c,l+t*2,u+t*2),x]}get boundsT(){let e=this.bounds,t=s(c(),e.x,e.y);if(o(t,t,this._transform),this._hasRotation){let n=Math.max(e.width,e.height);return new p(t[0],t[1],n,n)}return new p(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,n=1/0,r=0,i=0;for(let a of e)t=Math.min(t,a.offsets.topLeft[0]),n=Math.min(n,a.offsets.topLeft[1]),r=Math.max(r,a.offsets.bottomRight[0]),i=Math.max(i,a.offsets.bottomRight[1]);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;return new p(s,c,a,o)}_createGlyphTransform(e,t){let n=m*t.angle,o=a(),l=c();return r(o,o,s(l,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?i(o,o,n):(r(o,o,s(l,e.x,e.y)),i(o,o,n),r(o,o,s(l,-e.x,-e.y))),o}}class x{constructor(e,t,n,r,i,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,n)),this.end=Math.max(0,Math.max(t,n)),this.end<e.length&&(this.glyphWidthEnd=e[this.end].rect.width),this.width=r,this.yMin=i,this.yMax=a}}const S=e=>e===10,C=e=>e===32;function w(e,t,n){let r=[],i=1/n.scale,a=n.maxLineWidth*i,o=e.length,s=0,c=0,l=0,u=s,d=u,f=0,p=1/0,m=0;for(;s!==o;){let{code:t,rect:n,shaping:i}=e[s],o=Math.abs(n.top);if(!S(t)&&!C(t)&&(p=Math.min(p,o),m=Math.max(m,o+n.height)),S(t))s!==0&&(r.push(new x(e,u,s-1,c,p===1/0?0:p,m)),p=1/0,m=0),c=0,u=s+1,d=s+1,l=0;else if(C(t))d=s+1,l=0,f=i.xAdvance,c+=i.xAdvance;else if(c>a){if(d!==u){let t=d-2;c-=f,r.push(new x(e,u,t,c-l,p,m)),p=1/0,m=0,u=d,c=l}else r.push(new x(e,u,s-1,c,p,m)),p=1/0,m=0,u=s,d=s,c=0;c+=i.xAdvance,l+=i.xAdvance}else c+=i.xAdvance,l+=i.xAdvance;s+=1}let h=new x(e,u,s-1,c,p,m);return h.start>=0&&h.end<e.length&&r.push(h),r}function T(e,t){let n=0;for(let t=0;t<e.length;t++){let{width:r}=e[t];n=Math.max(r,n)}let r=t.decoration===`underline`?4:0,i=e[0].yMin;return{x:0,y:i,height:e[e.length-1].yMax+t.lineHeight*(e.length-1)+r-i,width:n}}function E(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].code)&&!S(e[i+1].code)&&r++;return r}function D(e,t){let n=t.scale,r=[],i=e.sdfPadding,{faceInfo:a,glyphs:o,isRightToLeft:s}=e,c=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,d=w(o,!1,t),f=d.length?T(d,t):{y:0,height:0,width:0},p=c?s?1:-1:l(t.horizontalAlignment),m=u(t.verticalAlignment),g=+(m===2),_=g?0:m-1,v=a?.baseline??22,y=d.length>1,x=g?y?-f.y-f.height:-v:-f.y+_*(f.height/2);for(let a=0;a<d.length;a++){let{start:s,end:l,width:u}=d[a],m=c&&a<d.length-1?E(o,s,l):0,g=m>0?(f.width-u)/m:0,_=g>0?f.width:u,v=(p+1)*-1*(_/2)-i,y=(e.isRightToLeft?d.length-1-a:a)*t.lineHeight+x-i;d[a].startX=v,d[a].startY=y;for(let e=s;e<=l;e++){let t=o[e];if(S(t.code))continue;let i=h.fromGlyph(v,y,t,n);v+=t.shaping.xAdvance,g>0&&C(t.code)&&(v+=g),r.push(i)}}return new b(r,d,t,a)}function O(e,t){let n=t.scale,{faceInfo:r,glyphs:i}=e,a=i.reduce((e,t)=>Math.max(e,t.rect.height),0),o=i.filter(e=>!S(e.code)&&e.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.rect.width/2,-a,e,n));return new b(o,[],t,r)}function k(e,t){return e.type===`glyphs`?D(e,t):j(e,t)}function A(e,t){return e.type===`glyphs`?O(e,t):M(e,t)}function j(e,t){let n=N(e,t),r=P(n,t),i=r.length?I(r):{width:0},a=[],o=t.decoration===`underline`?`none`:t.decoration,s=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,c=s?-1:l(t.horizontalAlignment),d=u(t.verticalAlignment),f=d===2,p=r.length?r[0].yMin:0,m=r.length?L(r[r.length-1]):0,g=m-p,_=f?r.length>1?-m:-(r[0]?.baseline??0):d===1?-p:d===-1?-m:-(p+g/2);for(let e=0;e<r.length;e++){let t=r[e],o=s&&e<r.length-1?R(n,t.start,t.end):0,l=o>0?(i.width-t.width)/o:0,u=l>0?i.width:t.width,d=(c+1)*-1*(u/2),f=t.startY+_,p=null;t.startX=d,t.startY=f;for(let e=t.start;e<=t.end;e++){let r=n[e],{glyph:i,scale:o,fontSize:s}=r,c=d;if(S(i.code)){p=z(a,p,f,t.baseline);continue}r.decoration===`underline`?(p&&p.underlineOffset!==r.underlineOffset||p&&!B(p.color,r.color))&&(p=z(a,p,f,t.baseline)):p=z(a,p,f,t.baseline);let u=f+t.baseline-r.baseline;a.push(h.fromGlyph(d/o,u/o,i,o,{fontSize:s,color:r.color})),d+=r.xAdvance,r.decoration===`underline`&&(p??={startX:c,endX:d,glyphWidthEnd:i.rect.width*o,textureBinding:i.mosaicItem.textureBinding,underlineOffset:r.underlineOffset,color:r.color},p.endX=d,p.glyphWidthEnd=i.rect.width*o,p.textureBinding=p.textureBinding??i.mosaicItem.textureBinding),l>0&&C(i.code)&&(d+=l,p&&(p.endX=d))}z(a,p,f,t.baseline)}return new b(a,r,{...t,decoration:o})}function M(e,t){let n=N(e,t),r=n.reduce((e,t)=>Math.max(e,t.glyph.rect.height*t.scale),0),i=n.filter(e=>!S(e.glyph.code)&&e.glyph.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.glyph.rect.width/2,-r/e.scale,e.glyph,e.scale,{fontSize:e.fontSize,color:e.color}));return new b(i,[],t)}function N(t,n){let r=n.lineHeightRatio??1,i=[];for(let n of t.runs){let t=e(n.fontSize),a=t/n.glyphs.sdfSize,o=d/24*t*r,s=(n.glyphs.faceInfo?.baseline??22)*a,c=(n.glyphs.faceInfo?.midline??16)*a,l=4*a+_(n.decoration),u=1+(n.characterSpacing??0);for(let e of n.glyphs.glyphs){let r=e.shaping.xAdvance*a,d=Math.abs(e.rect.top)*a,f=d+e.rect.height*a;i.push({glyph:e,scale:a,fontSize:t,decoration:n.decoration,underlineOffset:l,color:n.color,xAdvance:!S(e.code)&&!C(e.code)?r*u:r,top:d,bottom:f,lineHeight:o,baseline:s,midline:c})}}return i}function P(e,t){let n=[],r=t.maxLineWidth,i=0,a=0,o=0,s=0,c=0,l=0;for(;i<e.length;){let t=e[i],{glyph:u}=t;if(S(u.code))i!==0&&n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),a=0,s=i+1,c=s,o=0,l=0;else if(C(u.code))c=i+1,o=0,l=t.xAdvance,a+=t.xAdvance;else if(a>r){if(c!==s){let t=c-2;a-=l,n.push({width:a-o,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=c,a=o}else n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=i,c=i,a=0;a+=t.xAdvance,o+=t.xAdvance}else a+=t.xAdvance,o+=t.xAdvance;i++}if(s<e.length){let t=e.length-1;n.push({width:a,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1})}return F(e,n)}function F(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=0,a=1/0,o=0,s=0;for(let t=r.start;t<=r.end;t++){let n=e[t];n.decoration===`underline`&&(s=Math.max(s,n.underlineOffset)),!(S(n.glyph.code)||C(n.glyph.code))&&(i=Math.max(i,n.baseline),o=Math.max(o,n.lineHeight))}let c=1/0,l=-1/0;for(let t=r.start;t<=r.end;t++){let n=e[t];S(n.glyph.code)||C(n.glyph.code)||(c=Math.min(c,i-n.baseline+n.top),l=Math.max(l,i-n.baseline+n.bottom),a=Math.min(a,i-n.baseline+n.midline))}s>0&&(l=Math.max(l,i+s)),r.baseline=i,r.midline=a===1/0?i:a,r.lineHeight=Math.max(o,l),r.yMin=c===1/0?0:c,r.yMax=l===-1/0?0:l,r.startY=n>0?t[n-1].startY+t[n-1].lineHeight:0}return t}function I(e){let t=0;for(let n of e)t=Math.max(n.width+n.glyphWidthEnd,t);let n=e[0].yMin,r=e[e.length-1];return{x:0,y:n,height:L(r)-n,width:t}}function L(e){return e.startY+e.lineHeight}function R(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].glyph.code)&&!S(e[i+1].glyph.code)&&r++;return r}function z(e,t,n,r){return t&&e.push(h.fromGlyph(t.startX,n+r+t.underlineOffset,g(t.endX-t.startX+t.glyphWidthEnd,t.textureBinding),1,{color:t.color})),null}function B(e,t){return e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}export{h as ShapedGlyph,b as ShapingInfo,D as shapeGlyphs,O as shapeGlyphsForMultipoint,j as shapeRichText,M as shapeRichTextForMultipoint,k as shapeTextResource,A as shapeTextResourceForMultipoint};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{nextPowerOfTwo as e}from"../../../../../../../core/mathUtils.js";import{create as t}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getDefinesKey as r}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as i,vtlHighResCutoff as a}from"../../../definitions.js";import{Mesh as o}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as c}from"../Technique.js";import{VTLShaderBackground as l}from"../shaders/vector-tiles/VTLShaderBackground.js";import{PrimitiveType as u}from"../../../../../../webgl/enums.js";function d(e,t){return{color:e.getPaintValue(`background-color`,t),opacity:e.getPaintValue(`background-opacity`,t),pattern:e.getPaintValue(`background-pattern`,Math.floor(t))}}class f extends c{constructor(){super(...arguments),this.type=38,this._color=n(1,0,0,1),this._patternMatrix=t(),this._mesh=null,this.shaders={background:new l}}render(n,o){if(o.tiles.length===0)return;this._loadResources(n);let{context:c,displayLevel:l,painter:u,spriteMosaic:f,styleLayer:p}=n,m=p,h=m.backgroundMaterial,{color:g,opacity:_,pattern:v}=d(m,l),y=v!==void 0,b=window.devicePixelRatio|1,x,S,C=h.key+r({hasPattern:y}),w=b>a?2:1,T={layerInfo:{depth:m.z,coordRange:o.tiles[0].rangeX},solidColor:null,pattern:null,patternMat:{mat:t()}},E=null;if(y){let e=f.getMosaicItemPosition(v,!0);if(e!=null){let{tl:t,br:n,page:r}=e;x=n[0]-t[0],S=n[1]-t[1];let a=f.getPageSize(r);a!=null&&(f.bind(c,9729,r,i),T.pattern={tlbr:[t[0],t[1],n[0],n[1]],mosaicSize:a,opacity:_},E={patternTexture:{texture:f.getTexture(r),unit:i}})}else return}else{let e=g[3]*_;this._color[0]=e*g[0],this._color[1]=e*g[1],this._color[2]=e*g[2],this._color[3]=e,T.solidColor={color:this._color}}u.setPipelineState(s);for(let t of o.tiles){if(T.layerInfo.coordRange=t.rangeX,y){let n=Math.max(2**(Math.round(
|
|
2
|
+
import{nextPowerOfTwo as e}from"../../../../../../../core/mathUtils.js";import{create as t}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getDefinesKey as r}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as i,vtlHighResCutoff as a}from"../../../definitions.js";import{Mesh as o}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as c}from"../Technique.js";import{VTLShaderBackground as l}from"../shaders/vector-tiles/VTLShaderBackground.js";import{PrimitiveType as u}from"../../../../../../webgl/enums.js";function d(e,t){return{color:e.getPaintValue(`background-color`,t),opacity:e.getPaintValue(`background-opacity`,t),pattern:e.getPaintValue(`background-pattern`,Math.floor(t))}}class f extends c{constructor(){super(...arguments),this.type=38,this._color=n(1,0,0,1),this._patternMatrix=t(),this._mesh=null,this.shaders={background:new l}}render(n,o){if(o.tiles.length===0)return;this._loadResources(n);let{context:c,displayLevel:l,painter:u,spriteMosaic:f,styleLayer:p}=n,m=p,h=m.backgroundMaterial,{color:g,opacity:_,pattern:v}=d(m,l),y=v!==void 0,b=window.devicePixelRatio|1,x,S,C=h.key+r({hasPattern:y}),w=b>a?2:1,T={layerInfo:{depth:m.z,coordRange:o.tiles[0].rangeX},solidColor:null,pattern:null,patternMat:{mat:t()}},E=null;if(y){let e=f.getMosaicItemPosition(v,!0);if(e!=null){let{tl:t,br:n,page:r}=e;x=n[0]-t[0],S=n[1]-t[1];let a=f.getPageSize(r);a!=null&&(f.bind(c,9729,r,i),T.pattern={tlbr:[t[0],t[1],n[0],n[1]],mosaicSize:a,opacity:_},E={patternTexture:{texture:f.getTexture(r),unit:i}})}else return}else{let e=g[3]*_;this._color[0]=e*g[0],this._color[1]=e*g[1],this._color[2]=e*g[2],this._color[3]=e,T.solidColor={color:this._color}}u.setPipelineState(s);for(let t of o.tiles){if(T.layerInfo.coordRange=t.rangeX,y){let r=Math.min(l,n.tilingScheme.tileInfo.lods.length-1),i=Math.max(2**(Math.round(r)-t.key.level),1),a=w*t.width*i,o=a/e(x),s=a/e(S);this._patternMatrix[0]=o,this._patternMatrix[4]=s,T.patternMat={mat:this._patternMatrix}}t.bind(c);let r={shader:this.shaders.background,uniforms:T,textures:E,defines:{renderMode:+!!y},optionalAttributes:h.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:h.getPrecisionFactors(),materialKey:C};u.submitDrawMeshUntyped(c,r,this._mesh,{stencilRef:t.stencilRef})}}shutdown(){this._mesh&&=(this._mesh.destroy(),null)}_loadResources(e){if(this._mesh)return;let{context:t,styleLayer:n}=e,r=n,i=new Int16Array([0,0,1,0,0,1,1,1]),a=r.backgroundMaterial.geometryLayout;if(!a)return;let s={vertex:{geometryVB:{data:i,layout:a}},groups:[{primitive:u.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:4}]};this._mesh=new o(t,s)}}export{f as VTLTechniqueBackground,d as getBackgroundPaintValues};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{getDefinesKey as e}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as t,vtlHighResCutoff as n}from"../../../definitions.js";import{Technique as r}from"../Technique.js";import{VTLShaderFill as i}from"../shaders/vector-tiles/VTLShaderFill.js";import{VTLShaderOutline as a}from"../shaders/vector-tiles/VTLShaderOutline.js";const o=1/65536;class s extends r{constructor(){super(...arguments),this.type=40,this._fillMesh=null,this._outlineMesh=null,this.shaders={fill:new i,outline:new a}}shutdown(){this._fillMesh=null,this._outlineMesh=null}render(e,t){let{displayLevel:n,is3D:r,renderPass:i,spriteMosaic:a,styleLayer:o,styleLayerUID:s}=e,{tiles:c}=t,l=!1;for(let e of c)if(e.layerData.has(s)){let t=e.layerData.get(s);if(t.fillIndexCount>0||t.outlineIndexCount>0){l=!0;break}}if(!l)return;let u=o,d=u.getPaintProperty(`fill-pattern`),f=d!==void 0,p=f&&d.isDataDriven,m;if(f&&!p){let e=d.getValue(n);m=a.getMosaicItemPosition(e,!0)}let h=!f&&u.getPaintValue(`fill-antialias`,n),g=!r||f,_=1;if(!f){let e=u.getPaintProperty(`fill-color`),t=u.getPaintProperty(`fill-opacity`);if(!e?.isDataDriven&&!t?.isDataDriven){let e=u.getPaintValue(`fill-color`,n);_=u.getPaintValue(`fill-opacity`,n)*e[3],_<1&&(g=!0)}}if((u.hasDataDrivenColor||u.hasDataDrivenOpacity)&&(g=!0),g&&i===`opaque`)return;let v=u.getPaintValue(`fill-translate`,n),y=u.getPaintValue(`fill-translate-anchor`,n);(i===`opaque`&&!g||i===`translucent`&&g)&&this._drawFill(e,s,u,c,v,y,f,m,p);let b=!u.hasDataDrivenOutlineColor&&u.outlineUsesFillColor&&_<1;h&&i===`translucent`&&!b&&this._drawOutline(e,s,u,c,v,y)}_drawFill(r,i,a,s,c,l,u,d,f){if(u&&!f&&d==null)return;let{context:p,displayLevel:m,drawPhase:h,painter:g,pixelRatio:_,spriteMosaic:v}=r,y=_>n?2:1,b=a.fillMaterial,x=l===1,S={config:{depth:a.z+o,fillTranslation:c,tileOpacity:1},patternOptions:f||u&&d!=null?{mosaicSize:[0,0],patternFactor:1,tlbr:[0,0,0,0]}:null,color:null,opacity:null,colorMix:null,opacityMix:null},C={patternTexture:null},w={fillType:+!!u,translateAnchorViewport:x},T=b.key+e(w);if(d!=null){let{page:e,tl:n,br:r}=d,i=n[0],a=r[1],o=r[0],s=n[1],c=v.getPageSize(e);c!=null&&(v.bind(p,9729,e,t),S.patternOptions={mosaicSize:[c[0],c[1]],patternFactor:1,tlbr:[i,a,o,s]},C.patternTexture={texture:v.getTexture(e),unit:t})}let E=-1;for(let e of s){if(!e.layerData.has(i))continue;if(e.key.level!==E){E=e.key.level;let t=b.getUniforms();for(let e of t){let t=e.getValue(a,m,E,v);S[e.name]={value:t}}if(u&&S.patternOptions!=null){let t=Math.max(2**(Math.round(
|
|
2
|
+
import{getDefinesKey as e}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as t,vtlHighResCutoff as n}from"../../../definitions.js";import{Technique as r}from"../Technique.js";import{VTLShaderFill as i}from"../shaders/vector-tiles/VTLShaderFill.js";import{VTLShaderOutline as a}from"../shaders/vector-tiles/VTLShaderOutline.js";const o=1/65536;class s extends r{constructor(){super(...arguments),this.type=40,this._fillMesh=null,this._outlineMesh=null,this.shaders={fill:new i,outline:new a}}shutdown(){this._fillMesh=null,this._outlineMesh=null}render(e,t){let{displayLevel:n,is3D:r,renderPass:i,spriteMosaic:a,styleLayer:o,styleLayerUID:s}=e,{tiles:c}=t,l=!1;for(let e of c)if(e.layerData.has(s)){let t=e.layerData.get(s);if(t.fillIndexCount>0||t.outlineIndexCount>0){l=!0;break}}if(!l)return;let u=o,d=u.getPaintProperty(`fill-pattern`),f=d!==void 0,p=f&&d.isDataDriven,m;if(f&&!p){let e=d.getValue(n);m=a.getMosaicItemPosition(e,!0)}let h=!f&&u.getPaintValue(`fill-antialias`,n),g=!r||f,_=1;if(!f){let e=u.getPaintProperty(`fill-color`),t=u.getPaintProperty(`fill-opacity`);if(!e?.isDataDriven&&!t?.isDataDriven){let e=u.getPaintValue(`fill-color`,n);_=u.getPaintValue(`fill-opacity`,n)*e[3],_<1&&(g=!0)}}if((u.hasDataDrivenColor||u.hasDataDrivenOpacity)&&(g=!0),g&&i===`opaque`)return;let v=u.getPaintValue(`fill-translate`,n),y=u.getPaintValue(`fill-translate-anchor`,n);(i===`opaque`&&!g||i===`translucent`&&g)&&this._drawFill(e,s,u,c,v,y,f,m,p);let b=!u.hasDataDrivenOutlineColor&&u.outlineUsesFillColor&&_<1;h&&i===`translucent`&&!b&&this._drawOutline(e,s,u,c,v,y)}_drawFill(r,i,a,s,c,l,u,d,f){if(u&&!f&&d==null)return;let{context:p,displayLevel:m,drawPhase:h,painter:g,pixelRatio:_,spriteMosaic:v}=r,y=_>n?2:1,b=a.fillMaterial,x=l===1,S={config:{depth:a.z+o,fillTranslation:c,tileOpacity:1},patternOptions:f||u&&d!=null?{mosaicSize:[0,0],patternFactor:1,tlbr:[0,0,0,0]}:null,color:null,opacity:null,colorMix:null,opacityMix:null},C={patternTexture:null},w={fillType:+!!u,translateAnchorViewport:x},T=b.key+e(w);if(d!=null){let{page:e,tl:n,br:r}=d,i=n[0],a=r[1],o=r[0],s=n[1],c=v.getPageSize(e);c!=null&&(v.bind(p,9729,e,t),S.patternOptions={mosaicSize:[c[0],c[1]],patternFactor:1,tlbr:[i,a,o,s]},C.patternTexture={texture:v.getTexture(e),unit:t})}let E=-1;for(let e of s){if(!e.layerData.has(i))continue;if(e.key.level!==E){E=e.key.level;let t=b.getUniforms();for(let e of t){let t=e.getValue(a,m,E,v);S[e.name]={value:t}}if(u&&S.patternOptions!=null){let t=Math.min(m,r.tilingScheme.tileInfo.lods.length-1),n=Math.max(2**(Math.round(t)-e.key.level),1),i=e.rangeX/(y*e.width*n);S.patternOptions.patternFactor=i}}let n=e.layerData.get(i);if(n.isDestroyed||n.fillIndexCount===0||(this._fillMesh=n.getMesh(p,{value:0}),!this._fillMesh))continue;let{config:o}=S;o.tileOpacity=h===1?e.fader.value():1,e.bind(p);let s={shader:this.shaders.fill,uniforms:S,textures:C,defines:w,optionalAttributes:b.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:b.getPrecisionFactors(),materialKey:T};if(f){let r=S.patternOptions,i=n.patternMap;if(!i||r==null)continue;let a=0;for(let[n,o]of i){let i=v.getPageSize(n);i!=null&&(v.bind(p,9729,n,t),r.mosaicSize=i,C.patternTexture={texture:v.getTexture(n),unit:t},g.submitDrawMeshUntyped(p,s,this._fillMesh,{stencilRef:e.stencilRef,parts:[a++]}))}}else g.submitDrawMeshUntyped(p,s,this._fillMesh,{stencilRef:e.stencilRef});e.triangleCount+=n.fillIndexCount/3}}_drawOutline(t,n,r,i,a,s){let{context:c,displayLevel:l,spriteMosaic:u,painter:d,pixelRatio:f}=t,p=r.outlineMaterial,m={translateAnchorViewport:s===1},h=p.key+e(m),g=.75/f,_={config:{depth:r.z+o,fillTranslation:a,outlineWidth:g},color:null,opacity:null,colorMix:null,opacityMix:null},v=-1;for(let e of i){if(!e.layerData.has(n))continue;if(e.key.level!==v){v=e.key.level;let t=p.getUniforms();for(let e of t){let t=e.getValue(r,l,v,u);e.name in _&&(_[e.name]={value:t})}}let t=e.layerData.get(n);if(t.isDestroyed||t.outlineIndexCount===0||(this._outlineMesh=t.getMesh(c,{value:1}),this._outlineMesh==null))continue;e.bind(c);let i={shader:this.shaders.outline,uniforms:_,textures:{},defines:m,optionalAttributes:p.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:p.getPrecisionFactors(),materialKey:h};d.submitDrawMeshUntyped(c,i,this._outlineMesh,{stencilRef:e.stencilRef}),e.triangleCount+=t.outlineIndexCount/3}}}export{s as VTLTechniqueFill};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../core/has.js";import{abortMaybe as t,destroyMaybe as n}from"../../../core/maybe.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import o from"./AnalysisView3D.js";import{DirectLineMeasurementController as s}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as c}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";import l from"../interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js";import{connectAnalysisViewToTool as u,removeAnalysisViewTool as d,startPlaceOperation as f}from"../../analysis/analysisViewUtils.js";let p=class extends o{constructor(e){super(e),this.type=`direct-line-measurement-view-3d`,this.analysis=null,this.tool=null,this.result=null,this.measurementMode=0,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null,this.userOperation=null}initialize(){let{analysis:e,view:t}=this;this._analysisVisualization=new c({view:t,analysis:e,analysisView:this}),this._analysisController=new s({view:t,analysis:e,viewData:this}),this.addHandles(u(this,l))}destroy(){d(this),this.userOperation=t(this.userOperation),this._analysisController=n(this._analysisController),this._analysisVisualization=n(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages||!!this._analysisController?.updating}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(e){this._analysisVisualization.visualElementOrientation=e}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(e){this._analysisVisualization.allowVisualElementsOrientationChange=e}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(e){this._analysisVisualization.triangleCollapseRatioThreshold=e}get directLabelText(){return this._analysisVisualization.labels.direct?.text??``}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal?.text??``}get verticalLabelText(){return this._analysisVisualization.labels.vertical?.text??``}get unit(){return this.analysis.unit??this.view.options.displayUnits.length??a(this.view)}get testData(){}place(e){return f(this,{placementOptions:e})}};e([r()],p.prototype,`_analysisVisualization`,void 0),e([r()],p.prototype,`_analysisController`,void 0),e([r()],p.prototype,`updating`,null),e([r({readOnly:!0})],p.prototype,`type`,void 0),e([r({constructOnly:!0,nonNullable:!0})],p.prototype,`analysis`,void 0),e([r()],p.prototype,`tool`,void 0),e([r()],p.prototype,`result`,void 0),e([r()],p.prototype,`measurementMode`,void 0),e([r()],p.prototype,`elevationAlignedStartPoint`,void 0),e([r()],p.prototype,`elevationAlignedEndPoint`,void 0),e([r({readOnly:!0})],p.prototype,`viewMode`,null),e([r({readOnly:!0})],p.prototype,`actualVisualizedMeasurement`,null),e([r()],p.prototype,`visualElementOrientation`,null),e([r()],p.prototype,`allowVisualElementsOrientationChange`,null),e([r()],p.prototype,`triangleCollapseRatioThreshold`,null),e([r({readOnly:!0})],p.prototype,`directLabelText`,null),e([r({readOnly:!0})],p.prototype,`horizontalLabelText`,null),e([r({readOnly:!0})],p.prototype,`verticalLabelText`,null),e([r()],p.prototype,`unit`,null),e([r()],p.prototype,`userOperation`,void 0),p=e([i(`esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D`)],p);const m=p;export{m as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import{abortMaybe as t,destroyMaybe as n}from"../../../core/maybe.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import o from"./AnalysisView3D.js";import{DirectLineMeasurementController as s}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as c}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";import l from"../interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js";import{connectAnalysisViewToTool as u,removeAnalysisViewTool as d,startPlaceOperation as f}from"../../analysis/analysisViewUtils.js";let p=class extends o{constructor(e){super(e),this.type=`direct-line-measurement-view-3d`,this.analysis=null,this.tool=null,this.result=null,this.measurementMode=0,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null,this.userOperation=null}initialize(){let{analysis:e,view:t}=this;this._analysisVisualization=new c({view:t,analysis:e,analysisView:this}),this._analysisController=new s({view:t,analysis:e,viewData:this}),this.addHandles(u(this,l))}destroy(){d(this),this.userOperation=t(this.userOperation),this._analysisController=n(this._analysisController),this._analysisVisualization=n(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages||!!this._analysisController?.updating||!!this.tool?.updating}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(e){this._analysisVisualization.visualElementOrientation=e}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(e){this._analysisVisualization.allowVisualElementsOrientationChange=e}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(e){this._analysisVisualization.triangleCollapseRatioThreshold=e}get directLabelText(){return this._analysisVisualization.labels.direct?.text??``}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal?.text??``}get verticalLabelText(){return this._analysisVisualization.labels.vertical?.text??``}get unit(){return this.analysis.unit??this.view.options.displayUnits.length??a(this.view)}get testData(){}place(e){return f(this,{placementOptions:e})}};e([r()],p.prototype,`_analysisVisualization`,void 0),e([r()],p.prototype,`_analysisController`,void 0),e([r()],p.prototype,`updating`,null),e([r({readOnly:!0})],p.prototype,`type`,void 0),e([r({constructOnly:!0,nonNullable:!0})],p.prototype,`analysis`,void 0),e([r()],p.prototype,`tool`,void 0),e([r()],p.prototype,`result`,void 0),e([r()],p.prototype,`measurementMode`,void 0),e([r()],p.prototype,`elevationAlignedStartPoint`,void 0),e([r()],p.prototype,`elevationAlignedEndPoint`,void 0),e([r({readOnly:!0})],p.prototype,`viewMode`,null),e([r({readOnly:!0})],p.prototype,`actualVisualizedMeasurement`,null),e([r()],p.prototype,`visualElementOrientation`,null),e([r()],p.prototype,`allowVisualElementsOrientationChange`,null),e([r()],p.prototype,`triangleCollapseRatioThreshold`,null),e([r({readOnly:!0})],p.prototype,`directLabelText`,null),e([r({readOnly:!0})],p.prototype,`horizontalLabelText`,null),e([r({readOnly:!0})],p.prototype,`verticalLabelText`,null),e([r()],p.prototype,`unit`,null),e([r()],p.prototype,`userOperation`,void 0),p=e([i(`esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D`)],p);const m=p;export{m as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import i from"../../../../core/ReactiveMap.js";import{initial as a,watch as o,syncAndInitial 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{create as d,fromPoints as f}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as p}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as v}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{SnappingContext as E}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";const k=d(),A=Symbol(`inactiveManipulatorDisplay`);let j=class extends T{get _manipulatorsToHide(){let e=this._manipulatorByObject.values();return this.view.tools.some(e=>e.hasGrabbedManipulators)||e.some(e=>e.grabbing)?e.filter(e=>!e.grabbing).toArray():[]}constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new i,this._updatingHandles=new u,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null}initialize(){let{view:e}=this;this._interactionVisuals=new p({view:e}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),o(()=>this._manipulatorsToHide,e=>{let t=e.map(e=>e.disableDisplay());this.removeHandles(A),this.addHandles(t,A)},s)]),this.finishToolCreation()}destroy(){this.removeHandles(A),this._interactionVisuals=r(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.item.type===`observer`?new m(this.view,{deleting:!1,intersection:null,type:`observer`}):new h(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this.
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import i from"../../../../core/ReactiveMap.js";import{initial as a,watch as o,syncAndInitial 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{create as d,fromPoints as f}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as p}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as v}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{SnappingContext as E}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";const k=d(),A=Symbol(`inactiveManipulatorDisplay`);let j=class extends T{get _manipulatorsToHide(){let e=this._manipulatorByObject.values();return this.view.tools.some(e=>e.hasGrabbedManipulators)||e.some(e=>e.grabbing)?e.filter(e=>!e.grabbing).toArray():[]}constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new i,this._updatingHandles=new u,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null}initialize(){let{view:e}=this;this._interactionVisuals=new p({view:e}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),o(()=>this._manipulatorsToHide,e=>{let t=e.map(e=>e.disableDisplay());this.removeHandles(A),this.addHandles(t,A)},s)]),this.finishToolCreation()}destroy(){this.removeHandles(A),this._interactionVisuals=r(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.item.type===`observer`?new m(this.view,{deleting:!1,intersection:null,type:`observer`}):new h(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this._objectByItem.delete(e.item),this._manipulatorByObject.delete(e),this.manipulators.remove(t),t.destroy())}getManipulator(e){let t=this._objectByItem.get(e);return t==null?null:this._manipulatorByObject.get(t)}hasManipulatorAt(e,t){for(let n of this._manipulatorByObject.values())if(n.consumesClicks&&n.intersectionDistance(e,t)!=null)return!0;return!1}selectObject(e){let t=!1;for(let[n,r]of this._manipulatorByObject){let i=n===e;r.selected=i,t||=i}return this._syncManipulators(),t}onInputEvent(e){e.type===`hold`&&this._grabbedManipulator!=null&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),O(e,this.tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(e=>e.selected)||this.events.emit(`selection-cleared`)}_connectManipulator(e,t){let r=()=>this._syncManipulator(e,t);return n([e.on(`committed`,r),e.on(`modified-externally`,r),t.events.on(`immediate-click`,n=>{this.events.emit(`select-item`,{item:e.item}),n.button===b.Right&&t.metadata.type===`target`&&this.events.emit(`delete-item`,{target:t.metadata.target}),n.stopPropagation()}),t.events.on(`grab-changed`,({action:n})=>{n===`start`?(this.events.emit(`select-item`,{item:e.item}),this._grabbedManipulator=t):this._grabbedManipulator===t&&(this._grabbedManipulator=null,this.hideInteractionVisuals()),this._manipulatorByObject.set(e,t)}),t.events.on(`drag`,t=>{e.updateDragIntersection(t),t.action===`start`&&this.showInteractionVisuals(e)}),t.events.on(`location-update`,()=>this._syncInteractionVisuals()),this._createDragHandle(e,t)])}_createDragHandle(e,t){return x(t,(n,r,i,a)=>{let o=e.operations;if(o==null)return;let s=null,{cancelSnapping:c,snappingStep:l}=D({snappingContext:new E({editGeometryOperations:o,elevationInfo:e.elevationInfo,pointer:a,visualizer:new v}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});i.next(e=>(s?.undo(null),s=null,e)).next(c);let u=o.data.allVerticesUnordered.at(0);r.next(t=>(t.action===`start`&&(s=e.createUndoRecord()),{...t,snapOrigin:u?.pos})).next(S(this.view,t.elevationAlignedLocation)).next(y(this.view,o.data.geometry,e.elevationInfo,o.data.spatialReference)).next(C(this.view,e.elevationInfo)).next(...l).next(w(e)).next(e=>(e.action===`end`&&s!=null&&(this.events.emit(`record-undo`,{record:s}),s=null),e))})}_syncManipulators(){for(let[e,t]of this._manipulatorByObject)this._syncManipulator(e,t);this._syncInteractionVisuals()}_syncManipulator(e,t){let n=e.origin;if(t.available=this.visible&&e.visible&&n!=null,t.interactive=this.manipulatorsInteractive&&(this._grabbedManipulator==null||this._grabbedManipulator===t),n!=null&&(t.elevationAlignedLocation=n),e.item.type!==`target`)return;let r=this.analysisViewData.computations.find(t=>t.target===e.item),i=r==null||!r.computationResult.isValid?g.undefined:r.computationResult.isTargetVisible?g.visible:g.occluded;t.state=this.interacting&&t.selected?_(i):i}_syncInteractionVisuals(){let e=this._interactionVisuals,t=this._visualsManipulator,n=this.visible&&this.analysisViewData.visible;if(e==null||t==null||!n){e?.hide();return}let r=[...this._manipulatorByObject.entries()].find(([e])=>e.item.type===`observer`)?.[1];if(r==null){e.hide();return}let i=t===r?null:f(r.renderLocation,t.renderLocation,k);e.update({target:t.renderLocation,lineVerticalPlaneSegment:i,visible:!0})}};e([c({constructOnly:!0})],j.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],j.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],j.prototype,`view`,void 0),e([c({constructOnly:!0})],j.prototype,`tooltip`,void 0),e([c()],j.prototype,`automaticManipulatorSelection`,void 0),e([c()],j.prototype,`removeIncompleteOnCancel`,void 0),e([c()],j.prototype,`interacting`,void 0),e([c()],j.prototype,`manipulatorsInteractive`,void 0),e([c()],j.prototype,`_grabbedManipulator`,void 0),e([c()],j.prototype,`_manipulatorsToHide`,null),e([c()],j.prototype,`updating`,null),j=e([l(`esri.views.3d.analysis.LineOfSight.LineOfSightItemTool`)],j);export{j as LineOfSightItemTool};
|
|
@@ -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"../../../../core/has.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{createLineOfSightPlacementRootPluginConfiguration as u}from"./LineOfSightPlacementRootPlugin.js";import{isLineOfSightTargetPlugin as d}from"./LineOfSightTargetPlugin.js";import{createDrawTool as f}from"./placementUtils.js";import{Manipulator3D as p}from"../../interactive/Manipulator3D.js";const m=Symbol(`hiddenManipulatorHandle`);let h=class extends t{get active(){return!!this._drawTool?.active}get canRedo(){return this._drawTool?.canRedo??!1}get canUndo(){return this._drawTool?.canUndo??!1}get updating(){return this._drawTool?.updating??!1}get activeTooltipInfo(){return this._drawTool?.activeTooltipInfo??null}get tooltip(){return this._drawTool?.tooltip??null}constructor(e){super(e),this.visible=!0,this.observerPlacementElevationInfo=null,this.targetPlacementElevationInfo=null,this._drawTool=null,this._renderer=null,this._observerSessionElevationInfo=null,this._targetSessionElevationInfo=null,this._sessionStartedWithValidAnalysis=!1}initialize(){this.addHandles([r(()=>!this.active,()=>{this.analysisViewData.cursorTarget=null},i),a(()=>this.activeTooltipInfo,e=>{e&&(e.elevationModeContext=this._elevationModeContext)},i)])}destroy(){this._destroyDrawTool()}get _placementElevationInfo(){return this.analysis.observer==null?this._observerSessionElevationInfo:this._targetSessionElevationInfo}get _effectiveElevationInfo(){return this._placementElevationInfo??c}get _elevationModeContext(){let e=this;return{get mode(){return e._effectiveElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(!t||!n||!r||e===this._effectiveElevationInfo.mode)return;let i=t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked===!0,{position:a,elevationInfo:o}=l({view:this.view,point:r,sourceElevationInfo:this._placementElevationInfo,mode:e,preserveZ:i}),s=()=>{t.defaultZ=a.z,this.analysis.observer==null?this._observerSessionElevationInfo=o:this._targetSessionElevationInfo=o,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a},c=t.mostDownstreamPlugin;d(c)?c.changeElevationMode(e,i,s):s(),this._renderer?.refresh()}continue(){if(this._drawTool?.active)return;this._sessionStartedWithValidAnalysis=this.analysis.valid,this._observerSessionElevationInfo=this.observerPlacementElevationInfo?.clone()??null,this._targetSessionElevationInfo=this.targetPlacementElevationInfo?.clone()??null;let{drawTool:e,renderer:t}=this._createDrawTool();this._drawTool=e,this._renderer=t,this.view.addAndActivateTool(e),e.begin([u({analysis:this.analysis,analysisViewData:this.analysisViewData,getObserverElevationInfo:()=>this._observerSessionElevationInfo,getTargetElevationInfo:()=>this._targetSessionElevationInfo,view:this.view})])}stop(){this._destroyDrawTool()}redo(){this._drawTool?.redo()}undo(){this._drawTool?.undo()}get testInfo(){}_createDrawTool(){return f({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,getSourceElevationInfo:()=>this._effectiveElevationInfo,getVisible:()=>this.visible,onCancel:e=>{e===this._drawTool&&!this._sessionStartedWithValidAnalysis&&this.analysis.observer==null&&(this.analysis.clear(),this.analysisViewData.cursorTarget=null),this._destroyDrawTool(e)},onComplete:e=>this._destroyDrawTool(e),onManipulatorCountChange:e=>this._hideManipulatorOnAppearance(e),shouldPreventVertexAdd:this.shouldPreventVertexAdd})}_destroyDrawTool(e=this._drawTool){if(e==null)return;let t=e===this._drawTool;this.view.activeTool===e&&(this.view.activeTool=null),this.view.tools.includes(e)&&this.view.tools.remove(e),e.destroy(),t&&(this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1)}_hideManipulatorOnAppearance(e){e.removeHandles(m),e.addHandles(e.manipulators.toArray().map(e=>e instanceof p?e.disableDisplay():null).filter(n),m)}};e([o({constructOnly:!0})],h.prototype,`view`,void 0),e([o({constructOnly:!0})],h.prototype,`analysis`,void 0),e([o({constructOnly:!0})],h.prototype,`analysisViewData`,void 0),e([o({constructOnly:!0})],h.prototype,`shouldPreventVertexAdd`,void 0),e([o({constructOnly:!0})],h.prototype,`snappingManager`,void 0),e([o()],h.prototype,`visible`,void 0),e([o()],h.prototype,`observerPlacementElevationInfo`,void 0),e([o()],h.prototype,`targetPlacementElevationInfo`,void 0),e([o()],h.prototype,`active`,null),e([o()],h.prototype,`canRedo`,null),e([o()],h.prototype,`canUndo`,null),e([o()],h.prototype,`updating`,null),e([o()],h.prototype,`activeTooltipInfo`,null),e([o()],h.prototype,`tooltip`,null),e([o()],h.prototype,`_drawTool`,void 0),e([o()],h.prototype,`_renderer`,void 0),e([o()],h.prototype,`_observerSessionElevationInfo`,void 0),e([o()],h.prototype,`_targetSessionElevationInfo`,void 0),e([o()],h.prototype,`_elevationModeContext`,null),h=e([s(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementController`)],h);export{h as LineOfSightPlacementController};
|
package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js}
RENAMED
|
@@ -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"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import r from"../../../../core/Collection.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as s,isMultipoint as c}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as l}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as u,createLineOfSightObserverPluginConfiguration as d}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as f}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as h}from"./LineOfSightTargetPlugin.js";import{PluginBase as g}from"../../../draw/plugins/PluginBase.js";let _=class extends g{constructor(){super(...arguments),this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new r,this._operationTargets=new r}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=i(this._intersector)}start(e){super.start(e),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,y(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),e.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(e){return{geometryType:`point`,useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:`cancel`}}attachPlugin(e){this._downstreamPlugin=e}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(e,r){if(this._downstreamPlugin===e&&(this._downstreamPlugin=null),m(e)&&this._clearCursorTarget(),r!==`complete`){this._syncAnalysisFromSession();return}let i=this._context?.getSession(e)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`point`});if(!i||!s(i)){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._truncateItemsToSession();let a=f(e)?e.preservedIntersection:null;if(u(e)){let n=e.observer??this._operationObserver??new t;if(!this._intersector||!l(this.view,n,this._intersector,i,{elevationInfo:this.getObserverElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationObserver=n}else if(m(e)){let t=e.target??new n;if(!this._intersector||!l(this.view,t,this._intersector,i,{elevationInfo:this.getTargetElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationTargets.add(t)}this._appendCommittedPoint(i),this._syncAnalysisFromSession(),this._restartDownstreamPlugin(),this._clearCursorTarget()}_appendCommittedPoint(e){let t=this._session;t&&(t.appendOrReplacePoint(null,e),t.appendOrReplacePart(null,[]),t.automaticRestart=!1,t.groupGeometryChanges())}_clearCursorTarget(){this.analysisViewData.cursorTarget=i(this.analysisViewData.cursorTarget)}_truncateItemsToSession(){let e=this._getCommittedPointCount();this._initialObserver==null&&e===0&&(this._operationObserver=null),this._operationTargets.splice(this._getCommittedOperationTargetCount(e))}_restartDownstreamPlugin(){let e=this.analysis.observer==null,t=e?this._createObserverPluginConfiguration():this._createTargetPluginConfiguration();e&&u(this._downstreamPlugin)||!e&&m(this._downstreamPlugin)||this._context?.requestBeginDownstreamPlugin(t,{cancelExisting:!0})}_createObserverPluginConfiguration(e=null){return d({observer:e,defaultCaptureMode:e?`grabbable-object`:`capture-always`,inputMapPosition:e?.position??null})}_createTargetPluginConfiguration(e=null){return h({analysis:this.analysis,analysisViewData:this.analysisViewData,defaultCaptureMode:e?`grabbable-object`:`capture-always`,getElevationInfo:this.getTargetElevationInfo,inputMapPosition:e?.position??null,target:e,view:this.view})}_syncAnalysisFromSession(){let e=this._getCommittedPointCount(),t=this._getCommittedOperationTargetCount(e);this.analysis.observer=this._getActiveObserver(e),y(this.analysis.targets,this._initialTargets.toArray().concat(this._operationTargets.toArray().slice(0,t)))}_getActiveObserver(e){return this._initialObserver==null?e>0?this._operationObserver:null:this._operationObserver??null}_getCommittedOperationTargetCount(e){return Math.max(0,e-(this._initialObserver==null?Math.min(e,1):0))}_getCommittedPointCount(){let e=this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`multipoint`});return e&&c(e)?e.points.length:0}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`getObserverElevationInfo`,void 0),e([a({constructOnly:!0})],_.prototype,`getTargetElevationInfo`,void 0),e([a()],_.prototype,`_intersector`,void 0),e([a()],_.prototype,`_downstreamPlugin`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import r from"../../../../core/Collection.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as s,isMultipoint as c}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as l}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as u,createLineOfSightObserverPluginConfiguration as d}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as f}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as h}from"./LineOfSightTargetPlugin.js";import{PluginBase as g}from"../../../draw/plugins/PluginBase.js";let _=class extends g{constructor(){super(...arguments),this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new r,this._operationTargets=new r}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=i(this._intersector)}start(e){super.start(e),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,y(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),e.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(e){return{geometryType:`point`,useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:`cancel`}}attachPlugin(e){this._downstreamPlugin=e}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(e,r){if(this._downstreamPlugin===e&&(this._downstreamPlugin=null),m(e)&&this._clearCursorTarget(),r!==`complete`){this._syncAnalysisFromSession();return}let i=this._context?.getSession(e)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`point`});if(!i||!s(i)){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._truncateItemsToSession();let a=f(e)?e.preservedIntersection:null;if(u(e)){let n=e.observer??this._operationObserver??new t;if(!this._intersector||!l(this.view,n,this._intersector,i,{elevationInfo:this.getObserverElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationObserver=n}else if(m(e)){let t=e.target??new n;if(!this._intersector||!l(this.view,t,this._intersector,i,{elevationInfo:this.getTargetElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationTargets.add(t)}this._appendCommittedPoint(i),this._syncAnalysisFromSession(),this._restartDownstreamPlugin(),this._clearCursorTarget()}_appendCommittedPoint(e){let t=this._session;t&&(t.appendOrReplacePoint(null,e),t.appendOrReplacePart(null,[]),t.automaticRestart=!1,t.groupGeometryChanges())}_clearCursorTarget(){this.analysisViewData.cursorTarget=i(this.analysisViewData.cursorTarget)}_truncateItemsToSession(){let e=this._getCommittedPointCount();this._initialObserver==null&&e===0&&(this._operationObserver=null),this._operationTargets.splice(this._getCommittedOperationTargetCount(e))}_restartDownstreamPlugin(){let e=this.analysis.observer==null,t=e?this._createObserverPluginConfiguration():this._createTargetPluginConfiguration();e&&u(this._downstreamPlugin)||!e&&m(this._downstreamPlugin)||this._context?.requestBeginDownstreamPlugin(t,{cancelExisting:!0})}_createObserverPluginConfiguration(e=null){return d({observer:e,defaultCaptureMode:e?`grabbable-object`:`capture-always`,inputMapPosition:e?.position??null})}_createTargetPluginConfiguration(e=null){return h({analysis:this.analysis,analysisViewData:this.analysisViewData,defaultCaptureMode:e?`grabbable-object`:`capture-always`,getElevationInfo:this.getTargetElevationInfo,inputMapPosition:e?.position??null,target:e,view:this.view})}_syncAnalysisFromSession(){let e=this._getCommittedPointCount(),t=this._getCommittedOperationTargetCount(e);this.analysis.observer=this._getActiveObserver(e),y(this.analysis.targets,this._initialTargets.toArray().concat(this._operationTargets.toArray().slice(0,t)))}_getActiveObserver(e){return this._initialObserver==null?e>0?this._operationObserver:null:this._operationObserver??null}_getCommittedOperationTargetCount(e){return Math.max(0,e-(this._initialObserver==null?Math.min(e,1):0))}_getCommittedPointCount(){let e=this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`multipoint`});return e&&c(e)?e.points.length:0}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`getObserverElevationInfo`,void 0),e([a({constructOnly:!0})],_.prototype,`getTargetElevationInfo`,void 0),e([a()],_.prototype,`_intersector`,void 0),e([a()],_.prototype,`_downstreamPlugin`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementRootPlugin`)],_);function v(e){return{uniqueId:Symbol(`line-of-sight-root-plugin`),kind:[`multipart`],geometryType:`multipoint`,hidden:!0,localizationKey:`line-of-sight-root`,icon:`point`,create:()=>new _(e)}}function y(e,t){let n=-1;for(let r=0;r<Math.min(e.length,t.length);r++)if(e.getItemAt(r)!==t[r]){n=r;break}if(n===-1){if(e.length===t.length)return;n=Math.min(e.length,t.length)}e.splice(n,e.length-n,...t.slice(n))}export{_ as LineOfSightPlacementRootPlugin,v as createLineOfSightPlacementRootPluginConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as s}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as c}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as l}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as u}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as d}from"../../../input/InputManager.js";import{AnalysisToolBase as f}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as p}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as m}from"../../../interactive/keybindings.js";import{acquire as h}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";const _={ready:`ready`,creating:`creating`,created:`created`};let v=class extends f{constructor(e){super(e),this._operationManager=new u,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;let{snappingManager:t}=this._snappingManagerResult=h(e.view);this._editIntersector=new l({view:e.view}),this._editTool=new s({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:this._editIntersector,snappingManager:t,view:e.view}),this._placementController=new c({...e,
|
|
2
|
+
import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as s}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as c}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as l}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as u}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as d}from"../../../input/InputManager.js";import{AnalysisToolBase as f}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as p}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as m}from"../../../interactive/keybindings.js";import{acquire as h}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";const _={ready:`ready`,creating:`creating`,created:`created`};let v=class extends f{constructor(e){super(e),this._operationManager=new u,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;let{snappingManager:t}=this._snappingManagerResult=h(e.view);this._editIntersector=new l({view:e.view}),this._editTool=new s({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:this._editIntersector,snappingManager:t,view:e.view}),this._placementController=new c({...e,snappingManager:t,shouldPreventVertexAdd:(e,t)=>this._editTool.hasManipulatorAt(e,t)})}get active(){return this._editTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get selectedItem(){return this._editTool.selectedItem}get state(){return this._placementController.active?_.creating:this.analysis.observer?.position==null?_.ready:_.created}get cursor(){return this._placementController.active?`crosshair`:null}get updating(){return this._editTool.updating||this._placementController.updating}initialize(){g(this),this.addHandles([this._snappingManagerResult,this.view.on(`key-down`,e=>this._onKeyDown(e),d.WIDGET),n(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),r),n(()=>this.state===_.created,e=>{e?this.finishToolCreation():this._set(`created`,!1)},r),n(()=>this.analysisViewData.visible,e=>{this.visible=e},r),n(()=>this.editable,e=>{this.analysisViewData.editable=e},r)])}destroy(){this._operationManager.destroy(),this._editTool.stop(),this._placementController.stop(),this._editTool.destroy(),this._placementController.destroy(),this._editIntersector.destroy()}place(e){return this.analysisViewData.interactive=!0,this._operationManager.start(`place`,async(i,a)=>{let{elevationInfo:o}=e??{},s=o&&`observer`in o?o.observer:o,c=o&&`targets`in o?o.targets:o;this._placementController.observerPlacementElevationInfo=y(s),this._placementController.targetPlacementElevationInfo=y(c);let l=this.analysis.clone(),u=!1,d=!1,f=()=>{if(d)return;if(d=!0,this.stop(),!this.analysis.valid){this.analysis.clear(),i.reject();return}if(a.aborted||this.analysis.equals(l)){i.reject();return}let e=this.analysis.targets.at(-1);e!=null&&this._editTool.selectItem(e),i.resolve({})};i.handles.push(t(()=>this.stop()),n(()=>this._placementController.active,e=>{if(e){u=!0;return}u&&f()},r)),this.continue()},e)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),!this.analysis.valid&&!this._placementController.active&&this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._editTool.setEditableFlag(1,!0),this._editTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideEditTool(){this._editTool.stop(),this._editTool.visible=!1}_onKeyDown(e){let t=e.key;t===m.undo&&this.canUndo?(e.stopPropagation(),this.undo()):t===m.redo&&this.canRedo?(e.stopPropagation(),this.redo()):m.delete.includes(t)&&!this.active?this._editTool.deleteSelectedItem()&&e.stopPropagation():t===m.cancel&&!this.active&&this._editTool.clearSelection()&&e.stopPropagation()}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active?this._placementController:this._canActivateEditTool?this._editTool:null:null}get _canActivateEditTool(){return this.visible&&this.editable&&this.analysis.valid&&this.analysis.observer?.position!=null}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{let e=this.analysisViewData.interactive,t=this._canActivateEditTool;if(this._placementController.visible=this.visible&&e,this._editTool.manipulatorsInteractive=e&&!this._placementController.active,!e){this._placementController.stop(),this._hideEditTool(),this.analysisViewData.cursorTarget=null,p(this.view,this);return}if(!this.visible){this._editTool.stop(),this._editTool.visible=!0,p(this.view,this);return}if(this._placementController.active){this._editTool.stop(),this._editTool.visible=this.visible,p(this.view,this);return}if(!t){this._hideEditTool(),p(this.view,this);return}this._editTool.visible=!0,this.analysisViewData.cursorTarget=null,p(this.view,this)}finally{this._syncingActiveTool=!1}}}};e([i({constructOnly:!0})],v.prototype,`view`,void 0),e([i({constructOnly:!0})],v.prototype,`analysis`,void 0),e([i({constructOnly:!0})],v.prototype,`analysisViewData`,void 0),e([i()],v.prototype,`active`,null),e([i()],v.prototype,`canRedo`,null),e([i()],v.prototype,`canUndo`,null),e([i()],v.prototype,`selectedItem`,null),e([i()],v.prototype,`state`,null),e([i()],v.prototype,`cursor`,null),e([i()],v.prototype,`updating`,null),e([i()],v.prototype,`removeIncompleteOnCancel`,void 0),e([i()],v.prototype,`snappingOptions`,null),e([i()],v.prototype,`_canActivateEditTool`,null),v=e([a(`esri.views.3d.analysis.LineOfSight.LineOfSightTool`)],v);function y(e){if(e==null)return null;let{featureExpressionInfo:t,mode:n,offset:r,unit:i}=e;return new o({featureExpressionInfo:t,mode:n,offset:r,unit:i})}export{v as LineOfSightTool};
|
|
@@ -8,7 +8,11 @@ import type { AbortOptions } from "../../../../core/promiseUtils.js";
|
|
|
8
8
|
import type { ElevationInfoProperties } from "../../../../symbols/support/ElevationInfo.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Elevation information used when placing a line
|
|
11
|
+
* Elevation information used when placing a line of sight analysis interactively.
|
|
12
|
+
*
|
|
13
|
+
* > [!WARNING]
|
|
14
|
+
* >
|
|
15
|
+
* > [ElevationInfo.featureExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/#featureExpressionInfo) is not supported when the elevation info is specified for observers and targets.
|
|
12
16
|
*
|
|
13
17
|
* @since 5.2
|
|
14
18
|
*/
|
|
@@ -25,8 +29,15 @@ export type LineOfSightPlacementElevationInfo = ElevationInfo | ElevationInfoPro
|
|
|
25
29
|
export interface LineOfSightPlacementOptions extends AbortOptions {
|
|
26
30
|
/**
|
|
27
31
|
* Specifies how placed items are positioned on the vertical axis (z). A single elevation information object applies
|
|
28
|
-
* to both the observer and targets. Alternatively, separate elevation information can be provided for each.
|
|
29
|
-
*
|
|
32
|
+
* to both the observer and targets. Alternatively, separate elevation information can be provided for each type.
|
|
33
|
+
*
|
|
34
|
+
* If no elevation info is provided and the [LineOfSightAnalysisObserver.position](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisObserver/#position) or the
|
|
35
|
+
* [LineOfSightAnalysisTarget.position](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/#position) has a [z-value](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/#hasZ),
|
|
36
|
+
* it is treated as an absolute value.
|
|
37
|
+
*
|
|
38
|
+
* > [!WARNING]
|
|
39
|
+
* >
|
|
40
|
+
* > [ElevationInfo.featureExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/#featureExpressionInfo) is not supported when the elevation info is specified for observers and targets.
|
|
30
41
|
*
|
|
31
42
|
* @since 5.2
|
|
32
43
|
*/
|
|
@@ -13,9 +13,10 @@ import type { LineOfSightPlacementOptions, LineOfSightPlacementResult } from "./
|
|
|
13
13
|
* The LineOfSightAnalysisView3D is responsible for rendering a [LineOfSightAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/)
|
|
14
14
|
* using custom visualizations.
|
|
15
15
|
*
|
|
16
|
-
* It allows to create an observer and
|
|
16
|
+
* It allows to create an observer and targets interactively using the [place()](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#place) method, query analysis [results](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#results),
|
|
17
17
|
* or make an existing analysis editable by enabling the [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#interactive) property.
|
|
18
18
|
*
|
|
19
|
+
*
|
|
19
20
|
* The view for an analysis can be retrieved using [SceneView.whenAnalysisView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenAnalysisView)
|
|
20
21
|
* similar to how layer views are retrieved for layers using [SceneView.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenLayerView).
|
|
21
22
|
*
|
|
@@ -26,11 +27,22 @@ import type { LineOfSightPlacementOptions, LineOfSightPlacementResult } from "./
|
|
|
26
27
|
* const analysisView = await view.whenAnalysisView(analysis);
|
|
27
28
|
* ```
|
|
28
29
|
*
|
|
30
|
+
* > [!WARNING]
|
|
31
|
+
* >
|
|
32
|
+
* > **Things to consider:**
|
|
33
|
+
* > * Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
|
|
34
|
+
* [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
|
|
35
|
+
* > * Snapping is enabled by default. This can be temporarily disabled by holding the `CTRL` key.
|
|
36
|
+
* > * Layer types currently supported for snapping are: [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [GraphicsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GraphicsLayer/) (except Mesh geometries),
|
|
37
|
+
* > [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/), [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/),
|
|
38
|
+
* > [3D Object SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/), and [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/).
|
|
39
|
+
*
|
|
29
40
|
* @see [LineOfSightAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/)
|
|
30
41
|
* @see [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/)
|
|
31
42
|
* @see [LineOfSightLayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/)
|
|
32
|
-
* @see [LineOfSightAnalysisTarget](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/)
|
|
33
43
|
* @see [LineOfSightAnalysisObserver](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisObserver/)
|
|
44
|
+
* @see [LineOfSightAnalysisTarget](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/)
|
|
45
|
+
* @see [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/)
|
|
34
46
|
* @see [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/)
|
|
35
47
|
* @see [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/)
|
|
36
48
|
* @see [Sample - Line of sight component](https://developers.arcgis.com/javascript/latest/sample-code/line-of-sight/)
|
|
@@ -44,10 +56,12 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
44
56
|
*/
|
|
45
57
|
get analysis(): LineOfSightAnalysis;
|
|
46
58
|
/**
|
|
47
|
-
* Enables interactivity for the
|
|
48
|
-
*
|
|
49
|
-
* [LineOfSightAnalysis.
|
|
50
|
-
*
|
|
59
|
+
* Enables interactivity for the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#analysis).
|
|
60
|
+
* When set to `true`, and the analysis includes a valid [LineOfSightAnalysis.observer](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/#observer) and any
|
|
61
|
+
* [LineOfSightAnalysis.targets](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysis/#targets), they become selectable and editable.
|
|
62
|
+
*
|
|
63
|
+
* Targets can be removed by right-clicking on them or with the `Delete` key.
|
|
64
|
+
* The observer and the last target cannot be deleted interactively.
|
|
51
65
|
*
|
|
52
66
|
* This property is automatically set to `true` when the analysis is assigned to a
|
|
53
67
|
* [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/).
|
|
@@ -76,8 +90,13 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
76
90
|
*/
|
|
77
91
|
get results(): Collection<LineOfSightAnalysisResult | null | undefined>;
|
|
78
92
|
/**
|
|
79
|
-
* The observer or target currently selected for interactive editing.
|
|
80
|
-
*
|
|
93
|
+
* The observer or target currently selected for interactive editing.
|
|
94
|
+
*
|
|
95
|
+
* When [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#interactive) is `true`, any observer or target in the
|
|
96
|
+
* [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#analysis) can be selected
|
|
97
|
+
* and its properties can be edited by interacting with the manipulators in the view.
|
|
98
|
+
*
|
|
99
|
+
* Use the item's `type` property to determine whether it is an observer or a target.
|
|
81
100
|
*
|
|
82
101
|
* @since 5.2
|
|
83
102
|
* @example
|
|
@@ -111,7 +130,7 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
111
130
|
get visible(): boolean;
|
|
112
131
|
set visible(value: boolean | null | undefined);
|
|
113
132
|
/**
|
|
114
|
-
* Starts the interactive placement of an observer and
|
|
133
|
+
* Starts the interactive placement of an observer and targets on the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#analysis).
|
|
115
134
|
*
|
|
116
135
|
* If the analysis does not have a valid observer yet, this method will allow placing an observer, which can be followed
|
|
117
136
|
* by zero or more targets. Otherwise, if it already has a valid observer, it will allow placing targets. An observer
|
|
@@ -123,9 +142,13 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
123
142
|
* The promise resolves when the operation is productive, i.e. an observer or any targets were added.
|
|
124
143
|
* Otherwise, if nothing was added or signal was aborted, the promise is rejected.
|
|
125
144
|
*
|
|
145
|
+
* By default, the observer and targets are created at absolute height.
|
|
146
|
+
* Optionally, by specifying the options of the method,
|
|
147
|
+
* you can change the [elevation info](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/).
|
|
148
|
+
*
|
|
126
149
|
* Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/#interactive) to `true`.
|
|
127
150
|
*
|
|
128
|
-
* @param options - An object specifying additional options.
|
|
151
|
+
* @param options - An object specifying additional placement options, including elevation information and an abort signal.
|
|
129
152
|
* @returns A promise
|
|
130
153
|
* which resolves when the operation is completed successfully - i.e. the user places an observer and/or target(s),
|
|
131
154
|
* leaving the analysis in a valid state. Otherwise, the promise is rejected.
|
|
@@ -135,11 +158,14 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
|
|
|
135
158
|
*
|
|
136
159
|
* try {
|
|
137
160
|
* await analysisView.place({
|
|
138
|
-
*
|
|
139
|
-
*
|
|
161
|
+
* signal: abortController.signal,
|
|
162
|
+
* // optional elevation info
|
|
163
|
+
* elevationInfo: { mode: "relative-to-ground", offset: 1.5 },
|
|
140
164
|
* });
|
|
141
165
|
* } catch (error) {
|
|
142
|
-
*
|
|
166
|
+
* if (error.name === "AbortError") {
|
|
167
|
+
* console.log("Placement operation was cancelled.");
|
|
168
|
+
* }
|
|
143
169
|
* }
|
|
144
170
|
*
|
|
145
171
|
* // cancel the placement operation at some later point
|
|
@@ -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)})}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};
|
|
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:n}=s;a=a.next(n),i=i.next(N(this.view,t)).next(...e)}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)=>{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)=>{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 t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as c}from"./toolLifecycleUtils.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";import{ViewshedPlacementController as u}from"./ViewshedPlacementController.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{acquire as f}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as p}from"../../../interactive/snapping/snappingUtils.js";let m=class extends t{constructor(e){super(e),this._editTool=null,this._updatingHandles=new s}initialize(){let{view:e}=this,t=d(e.state.viewingMode);this._snappingManagerResult=f(e),this.addHandles(this._snappingManagerResult),this._placementController=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e,callbacks:{cancelTool:()=>{e.activeTool!=null&&(e.activeTool=null)},findViewshedComputedData:e=>this._findViewshedComputedData(e),
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as c}from"./toolLifecycleUtils.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";import{ViewshedPlacementController as u}from"./ViewshedPlacementController.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{acquire as f}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as p}from"../../../interactive/snapping/snappingUtils.js";let m=class extends t{constructor(e){super(e),this._editTool=null,this._updatingHandles=new s}initialize(){let{view:e}=this,t=d(e.state.viewingMode);this._snappingManagerResult=f(e),this.addHandles(this._snappingManagerResult),this._placementController=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e,callbacks:{cancelTool:()=>{e.activeTool!=null&&(e.activeTool=null)},findViewshedComputedData:e=>this._findViewshedComputedData(e),setSelectedViewshed:e=>{this.analysisViewData.selectedViewshed=e}}}),p(this),this.addHandles([r(()=>({creationState:this._placementController.creationState,interactive:this.analysisViewData.interactive}),({creationState:n,interactive:r})=>{if(!r){this._placementController.cancelPlaceOperation(),this._destroyEditTool();return}if(n!=null){this._destroyEditTool();return}this._editTool||(this._editTool=new l({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e}),e.tools.add(this._editTool))},i),this._updatingHandles.add(()=>e.activeTool,e=>{e!=null&&e!==this._editTool&&this._placementController.creationState==null&&(this.analysisViewData.selectedViewshed=null)})])}destroy(){this._destroyEditTool(),n(this._placementController),this._updatingHandles.destroy()}get selectedViewshedComputedData(){return this._editTool?.selectedViewshedComputedData}get stagedViewshed(){return this._placementController.stagedViewshed}get active(){return this._placementController.active||(this._editTool?.active??!1)}get updating(){return this._updatingHandles.updating||this._placementController.updating||!!this._editTool?.updating}get creating(){return this._placementController.creationState!=null}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}async place(e,t){if(this.analysisViewData.interactive=!0,this._destroyEditTool(),await this._placementController.startPlaceOperation(e,t),e===`single`)return{}}_findViewshedComputedData(e){return this.analysisViewData.viewshedComputedDataHandles?.find(t=>t.viewshedComputedData.viewshed===e)?.viewshedComputedData}_destroyEditTool(){let e=this._editTool;this._editTool=null,e!=null&&(c(this.view,e),n(e))}get test(){}};e([a({constructOnly:!0})],m.prototype,`view`,void 0),e([a({constructOnly:!0})],m.prototype,`analysis`,void 0),e([a({constructOnly:!0})],m.prototype,`analysisViewData`,void 0),e([a()],m.prototype,`_placementController`,void 0),e([a()],m.prototype,`_editTool`,void 0),e([a()],m.prototype,`_snappingManagerResult`,void 0),e([a()],m.prototype,`selectedViewshedComputedData`,null),e([a()],m.prototype,`stagedViewshed`,null),e([a()],m.prototype,`active`,null),e([a()],m.prototype,`updating`,null),e([a()],m.prototype,`creating`,null),e([a()],m.prototype,`snappingOptions`,null),m=e([o(`esri.views.3d.analysis.Viewshed.ViewshedTool`)],m);const h=m;export{h as default};
|
|
@@ -12,6 +12,13 @@ export interface ViewshedPlacementOptions extends AbortOptions {
|
|
|
12
12
|
* Specifies how the placed viewshed observer is positioned on the vertical axis (z).
|
|
13
13
|
* Accepts an [ElevationInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/) instance or a plain object with elevation information properties.
|
|
14
14
|
*
|
|
15
|
+
* If no elevation info is provided and the [Viewshed.observer](https://developers.arcgis.com/javascript/latest/references/core/analysis/Viewshed/#observer) has a [z-value](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/#hasZ),
|
|
16
|
+
* it is treated as an absolute value.
|
|
17
|
+
*
|
|
18
|
+
* > [!WARNING]
|
|
19
|
+
* >
|
|
20
|
+
* > [ElevationInfo.featureExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/#featureExpressionInfo) is not supported when the elevation info is specified for viewsheds.
|
|
21
|
+
*
|
|
15
22
|
* @since 5.2
|
|
16
23
|
*/
|
|
17
24
|
elevationInfo?: ElevationInfo | ElevationInfoProperties | null;
|