@arcgis/core 6.0.0-next.43 → 6.0.0-next.44
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/WebMap.d.ts +9 -1
- package/WebMap.js +1 -1
- package/WebScene.js +1 -1
- package/applications/Components/OrientedImageryViewer/ImageViewer/utils.d.ts +3 -1
- package/applications/Components/OrientedImageryViewer/ImageViewer/utils.js +1 -1
- package/applications/Components/OrientedImageryViewer/VideoFeatureCache.js +2 -0
- package/applications/Components/OrientedImageryViewer/galleryUtils.d.ts +2 -1
- package/applications/Components/OrientedImageryViewer/galleryUtils.js +1 -1
- package/applications/Components/OrientedImageryViewer/imageMeasurementUtils.js +2 -0
- package/applications/Components/OrientedImageryViewer/imageUtils.d.ts +756 -0
- package/applications/Components/OrientedImageryViewer/imageUtils.js +2 -0
- package/applications/Components/OrientedImageryViewer/measurementUtils.d.ts +15 -0
- package/applications/Components/OrientedImageryViewer/measurementUtils.js +2 -0
- package/applications/Components/OrientedImageryViewer/queryFeatures.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/ImageMeasurementWorker.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/constants.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/featureCoverage.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/galleryUtils.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/imageMeasurementWorkerUtils.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/navigation/queries.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/navigation/utils.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/panoramicImageProperties.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/services/ImageMeasurementService.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/services/SuperimposeService.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/services/TransformationService.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/support/NonPanoramicMedia.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/support/dataCaptureUtils.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/support/geometryUtils.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/support/panConstraint.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/support/resolveMediaProps.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/support/superimposeUtils.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/support/typeUtils.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/support/urlUtils.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/symbols.js +2 -0
- package/applications/Components/OrientedImageryViewer/shared/utils.js +2 -0
- package/applications/Components/OrientedImageryViewer/videoUtils.d.ts +15 -0
- package/applications/Components/OrientedImageryViewer/videoUtils.js +2 -0
- package/applications/Components/testUtils.d.ts +9 -0
- package/applications/Components/testUtils.js +1 -1
- package/applications/SceneViewer/sceneViewerUtils.d.ts +117 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +4 -4
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/compilerUtils.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/functions/convertdirection.js +1 -1
- package/arcade/functions/hash.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/geometry/isSelfIntersecting.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/arcgisGlobal.d.ts +6 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00620a90b32352bcdc71.js +1 -0
- package/assets/esri/core/workers/chunks/{fdffefd7de540272a8a6.js → 02feb2550b6878e62e2d.js} +1 -1
- package/assets/esri/core/workers/chunks/06326c8cbe0d644eca16.js +1 -0
- package/assets/esri/core/workers/chunks/{3ec3589f6e74d7cb87cf.js → 090a7d0b0128d20879be.js} +1 -1
- package/assets/esri/core/workers/chunks/{a33ba23aee3f8f40200f.js → 0ac4a3029ba17a9e2492.js} +1 -1
- package/assets/esri/core/workers/chunks/0ae2933ab9b4a6ca56f2.js +1 -0
- package/assets/esri/core/workers/chunks/{18dbee576b7b9dbe69fb.js → 0b480583373b69773333.js} +1 -1
- package/assets/esri/core/workers/chunks/0bfc4e7640058811e10c.js +1 -0
- package/assets/esri/core/workers/chunks/0caaa03659f4f4e8df03.js +1 -0
- package/assets/esri/core/workers/chunks/{3de07326da4c47cd2aab.js → 0dc1ac5531f7c8854686.js} +1 -1
- package/assets/esri/core/workers/chunks/0e57bac610d41c7c9ad4.js +1 -0
- package/assets/esri/core/workers/chunks/{2294254af2c6afb560ee.js → 11e313dfca2579e68419.js} +1 -1
- package/assets/esri/core/workers/chunks/{cadd60fa4370284c7ae3.js → 13b40a611224ff5f4697.js} +1 -1
- package/assets/esri/core/workers/chunks/15a18c803a3aafa9a65b.js +1 -0
- package/assets/esri/core/workers/chunks/15a7a3264915fc8d3188.js +1 -0
- package/assets/esri/core/workers/chunks/162de06e54c0f9cba012.js +1 -0
- package/assets/esri/core/workers/chunks/1c61ced6079443fc0ce8.js +1 -0
- package/assets/esri/core/workers/chunks/1c94d4d79952dc4067be.js +1 -0
- package/assets/esri/core/workers/chunks/{804606b194dc9e71d088.js → 1ca9f823caff691e964d.js} +1 -1
- package/assets/esri/core/workers/chunks/{8f4fba4d2339c91c8b3f.js → 1d9b0db37d5f3819ffca.js} +1 -1
- package/assets/esri/core/workers/chunks/200da109115eab8b2480.js +1 -0
- package/assets/esri/core/workers/chunks/{edd36a1fc80b1d29907e.js → 21939ef53bc71b42370f.js} +1 -1
- package/assets/esri/core/workers/chunks/230189a28552ab00546d.js +1 -0
- package/assets/esri/core/workers/chunks/{81b9894e81cce3490984.js → 2515ce2ef279cdd4d5fa.js} +1 -1
- package/assets/esri/core/workers/chunks/27a5c6be4f847900d6ed.js +1 -0
- package/assets/esri/core/workers/chunks/{45b5a61c4e9fbd9ca0b3.js → 27f0bbde1e9fa3f06d46.js} +1 -1
- package/assets/esri/core/workers/chunks/{d51bb11baadc741c46bc.js → 29a437a2b7b3a9b3e104.js} +1 -1
- package/assets/esri/core/workers/chunks/{070684943698fa43c2b4.js → 2a224bc845c9bf682c54.js} +1 -1
- package/assets/esri/core/workers/chunks/2c619c50cdcc37652c0b.js +1 -0
- package/assets/esri/core/workers/chunks/2c7f3fb74a076acf9b30.js +1 -0
- package/assets/esri/core/workers/chunks/{bc38def1983089514e4b.js → 2e9d2f0a4e3c84d2ac2e.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fe1812aad6e566aea31.js → 30c5b584e8658b2b3607.js} +1 -1
- package/assets/esri/core/workers/chunks/{ae6dc159be974ca0e8da.js → 32ba94e59b411d3ff063.js} +1 -1
- package/assets/esri/core/workers/chunks/{67efdd296007a809586c.js → 3463b52d633a9336af28.js} +1 -1
- package/assets/esri/core/workers/chunks/{864194927d05ebc4cc31.js → 35426786de409d42a87f.js} +1 -1
- package/assets/esri/core/workers/chunks/{898359be6996fd9763b8.js → 377158a19c9d6ef11387.js} +1 -1
- package/assets/esri/core/workers/chunks/394b329e64d880cdb500.js +1 -0
- package/assets/esri/core/workers/chunks/{ca2adcbcf44454484fd5.js → 3a295fab549ae3caf9df.js} +1 -1
- package/assets/esri/core/workers/chunks/3a3b57abfb92494cac84.js +1 -0
- package/assets/esri/core/workers/chunks/{fd031150d3a7f896e6b3.js → 3cbb3c4e0e60a874ac6d.js} +1 -1
- package/assets/esri/core/workers/chunks/{50763ea061d5fb3f2e49.js → 4136c4de42b8818e2710.js} +1 -1
- package/assets/esri/core/workers/chunks/41d674e73b57c8abe838.js +1 -0
- package/assets/esri/core/workers/chunks/{0cfdeb53fb7d5532cf01.js → 425347186c279bcc595c.js} +1 -1
- package/assets/esri/core/workers/chunks/{6ccf9535013fe672c93b.js → 434a7ef5b25d83593b50.js} +1 -1
- package/assets/esri/core/workers/chunks/{4fe10650ba3cd30aa9a2.js → 46d0db736c6e7decbcf6.js} +1 -1
- package/assets/esri/core/workers/chunks/{cca8bd07bcd1d267a2e8.js → 489b37c459e1af116aeb.js} +1 -1
- package/assets/esri/core/workers/chunks/49c21c11621ff077e401.js +1 -0
- package/assets/esri/core/workers/chunks/{bfb8fc6b940bd5510e29.js → 4eab4e74c6a479c5f930.js} +1 -1
- package/assets/esri/core/workers/chunks/{5fd4d3cb3c9350131a59.js → 4f8a915795f107b772c5.js} +1 -1
- package/assets/esri/core/workers/chunks/5565b4e7c31d31a7e546.js +1 -0
- package/assets/esri/core/workers/chunks/{344f5334ad95c7974349.js → 5744c7350e4e2eb73aa9.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d3e92a3367a3ddc02bd.js → 57e0bf4be8a166d5b1eb.js} +1 -1
- package/assets/esri/core/workers/chunks/{3dd49f910834a2fb2142.js → 5b3db2c40feaefb7cbc0.js} +1 -1
- package/assets/esri/core/workers/chunks/5ba40e98e9300d1ebc85.js +1 -0
- package/assets/esri/core/workers/chunks/60137300db0e0c3caf13.js +1 -0
- package/assets/esri/core/workers/chunks/63d2645a744dce469bbb.js +1 -0
- package/assets/esri/core/workers/chunks/649e4ecb1d9e6da3fcd7.js +1 -0
- package/assets/esri/core/workers/chunks/6637fb99033bfa7646d4.js +1 -0
- package/assets/esri/core/workers/chunks/68b4ce0b2e754ac2e552.js +1 -0
- package/assets/esri/core/workers/chunks/69c338d1d359075371bc.js +1 -0
- package/assets/esri/core/workers/chunks/{6b4c3411f63a9ad9354c.js → 72020d86e3fc7ecc139f.js} +1 -1
- package/assets/esri/core/workers/chunks/{9630234267098115de4d.js → 73ab4f0275a85b9671ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{449a2dee17b54946f245.js → 7b7208237123e948f170.js} +1 -1
- package/assets/esri/core/workers/chunks/{5529831dd891382c79df.js → 7d866911d1171d25ca78.js} +1 -1
- package/assets/esri/core/workers/chunks/7eddde6c4249f46c67f3.js +1 -0
- package/assets/esri/core/workers/chunks/82160bd873cdb5a23557.js +1 -0
- package/assets/esri/core/workers/chunks/82e238375582f90dc94c.js +1 -0
- package/assets/esri/core/workers/chunks/831d896587d10fb689dc.js +1 -0
- package/assets/esri/core/workers/chunks/{ca204c110438f7315790.js → 834bbda7719b04301f74.js} +1 -1
- package/assets/esri/core/workers/chunks/835ccd95f2d312ecda5a.js +1 -0
- package/assets/esri/core/workers/chunks/8385bede56cc95d1a388.js +1 -0
- package/assets/esri/core/workers/chunks/8a8c9a3969b7016c20d9.js +1 -0
- package/assets/esri/core/workers/chunks/8c1ae93dae934aedc6dc.js +1 -0
- package/assets/esri/core/workers/chunks/{ef274db3fa260eadf371.js → 8cddfdbab3ad3809462f.js} +1 -1
- package/assets/esri/core/workers/chunks/8cec3f48e995aab3d62e.js +1 -0
- package/assets/esri/core/workers/chunks/{076e8d2e08ff2a013736.js → 8f1dd383502432d8a039.js} +1 -1
- package/assets/esri/core/workers/chunks/{78a69594c82d37aecbfb.js → 90a7cd7564f2a92199cc.js} +1 -1
- package/assets/esri/core/workers/chunks/98e3f7ab4bfbabf0b952.js +1 -0
- package/assets/esri/core/workers/chunks/99a72b65afdcd3ee091a.js +1 -0
- package/assets/esri/core/workers/chunks/{be04f40f8b403befd0ef.js → 9bb90097368b200fa730.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7398cfd8bbd041bd635.js → 9bf77f92760aacbd636f.js} +1 -1
- package/assets/esri/core/workers/chunks/{237a1f68a0efbfe5b77c.js → 9e7622379d777ea88018.js} +1 -1
- package/assets/esri/core/workers/chunks/9fb4c10d5b3e32bc86e9.js +1 -0
- package/assets/esri/core/workers/chunks/{564d7f2e58fbc16853c0.js → a8bedc53d4a316953108.js} +1 -1
- package/assets/esri/core/workers/chunks/{f2dab9fcd90ce38ae3d1.js → a8fbef765a6fb68e1115.js} +1 -1
- package/assets/esri/core/workers/chunks/aaac620f93a20fbd3f08.js +1 -0
- package/assets/esri/core/workers/chunks/ab684cce869973ea71cf.js +1 -0
- package/assets/esri/core/workers/chunks/ad787100602e18dde650.js +1 -0
- package/assets/esri/core/workers/chunks/{cb1642ea8b66231cbfb5.js → af70a81620203c030f5b.js} +1 -1
- package/assets/esri/core/workers/chunks/{efff269424d76f1dbb15.js → b10850c48f4eee60b8a9.js} +1 -1
- package/assets/esri/core/workers/chunks/{f11eaab5354cc6aa9569.js → b25104337f2495a4296a.js} +1 -1
- package/assets/esri/core/workers/chunks/{784d6c6949284ed6e10b.js → b3707d2cd2f4b2f70889.js} +1 -1
- package/assets/esri/core/workers/chunks/b89b634e9d38b5a51d33.js +1 -0
- package/assets/esri/core/workers/chunks/bb6573d794bbe670216a.js +1 -0
- package/assets/esri/core/workers/chunks/{8ebaf5754e86a45b0497.js → be11cec9979ed5e9738e.js} +1 -1
- package/assets/esri/core/workers/chunks/c063de8f57a393280c39.js +1 -0
- package/assets/esri/core/workers/chunks/c420ab79d85e5dbddb0b.js +29 -0
- package/assets/esri/core/workers/chunks/{14ed0c34b910eba3434e.js → c473c8b480de9802711b.js} +1 -1
- package/assets/esri/core/workers/chunks/{b3dbcf43f136ba2dadc5.js → c67ce7896789ac7275b2.js} +1 -1
- package/assets/esri/core/workers/chunks/c75cc72a306a617d9cd8.js +1 -0
- package/assets/esri/core/workers/chunks/{394ae3199c78a94c6a2a.js → c85336a50a4994a2a7eb.js} +1 -1
- package/assets/esri/core/workers/chunks/ccb0046b883286e65429.js +1 -0
- package/assets/esri/core/workers/chunks/cf684026e7f1ab7df4f7.js +1 -0
- package/assets/esri/core/workers/chunks/d19ac8368bb769fa5fba.js +1 -0
- package/assets/esri/core/workers/chunks/d26c9db8c0a772d0923c.js +1 -0
- package/assets/esri/core/workers/chunks/{58d10e0b35968680fd9f.js → d31f6598b76380e8688a.js} +1 -1
- package/assets/esri/core/workers/chunks/d3cd09b2d78ce9f2ea42.js +1 -0
- package/assets/esri/core/workers/chunks/{ad94f54b4c88b3a047bc.js → d4028536542db8b623cc.js} +1 -1
- package/assets/esri/core/workers/chunks/{cb6fb04fe5c8d90d4196.js → d4fe26716c4eca13d493.js} +1 -1
- package/assets/esri/core/workers/chunks/{c86d3af148b28ded5875.js → d64054cd6865d3a1af78.js} +38 -44
- package/assets/esri/core/workers/chunks/d7270a2db6f3bfcf0565.js +1 -0
- package/assets/esri/core/workers/chunks/d85d1064ba87ea1b1410.js +1 -0
- package/assets/esri/core/workers/chunks/{7a8ca15271e42b6131ac.js → d8b9d14f8d3e82ad26dc.js} +1 -1
- package/assets/esri/core/workers/chunks/{63c4412c16d8a44a5668.js → d99d5aa04e2d74ef57a7.js} +1 -1
- package/assets/esri/core/workers/chunks/{dfd4782b11d6fdca0492.js → d9e75266ac28f934eb61.js} +1 -1
- package/assets/esri/core/workers/chunks/dbf37b1c4e0567d9fb32.js +1 -0
- package/assets/esri/core/workers/chunks/{0c948ad4572000218afc.js → dc9792b2aa55975b8a95.js} +1 -1
- package/assets/esri/core/workers/chunks/dca0e2505a6cbef6f7f5.js +1 -0
- package/assets/esri/core/workers/chunks/ddaa8f8098e4a663e4e5.js +1 -0
- package/assets/esri/core/workers/chunks/df88bb9117967fe72eb4.js +1 -0
- package/assets/esri/core/workers/chunks/{1c378d489c5402888f76.js → e1f5da51115472347b55.js} +1 -1
- package/assets/esri/core/workers/chunks/e2535c83b97725e89256.js +1 -0
- package/assets/esri/core/workers/chunks/{406f24ec13eb30d43405.js → e2ebf0ea3af2e6907987.js} +1 -1
- package/assets/esri/core/workers/chunks/{ffe2077a9df7c838ea27.js → e7719bfbc5875a515a2b.js} +1 -1
- package/assets/esri/core/workers/chunks/{26ceb0ff8d93dbb9b84f.js → ec88631b5033c19f569e.js} +1 -1
- package/assets/esri/core/workers/chunks/{a2cc53ad1a514167e4b8.js → ef8f9b61b829c3bdf999.js} +1 -1
- package/assets/esri/core/workers/chunks/ef9740c4d1bd808af38a.js +1 -0
- package/assets/esri/core/workers/chunks/{f08a2a262a3b55149396.js → f0b897319ca8578df63f.js} +1 -1
- package/assets/esri/core/workers/chunks/{acea0946049136578354.js → f1e87e3ff65d8594e6b3.js} +1 -1
- package/assets/esri/core/workers/chunks/f36376b126c80d0983fb.js +1 -0
- package/assets/esri/core/workers/chunks/f3ca7fa35eb8d55f5907.js +1 -0
- package/assets/esri/core/workers/chunks/{1f9d6180a96d557838e9.js → f4d714d0a1a513861704.js} +1 -1
- package/assets/esri/core/workers/chunks/{14ded73842154d91ef4e.js → f7f73de8c63924e347ab.js} +1 -1
- package/assets/esri/core/workers/chunks/f91e36a104e84d985517.js +1 -0
- package/assets/esri/core/workers/chunks/{69f6d5997b8ff1326e39.js → fa5d4b9a098441ebf505.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c3db7a7c05fa0e81f0a.js → fc9d66fe2cc9e2d31964.js} +1 -1
- package/chunks/Bufferer-CclWhXVb.js +1 -1
- package/chunks/ColorMaterial.glsl.js +26 -16
- package/chunks/Component.glsl.js +0 -1
- package/chunks/CypherParser.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/EdgeShader.glsl.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Envelope2D.js +1 -1
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/Jpg.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorAffineTransform.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorDensify.js +1 -1
- package/chunks/OperatorDistance.js +1 -1
- package/chunks/OperatorEquals.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorGraphicBuffer.js +1 -1
- package/chunks/OperatorIntegrate.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorRelate.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/SideCalculator2D-DX0718xq.js +1 -1
- package/chunks/Transformation2D.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/antlr4.web.js +3 -3
- package/chunks/arcgis-knowledge-client-core-simd.js +3 -3
- package/chunks/arcgis-knowledge-client-core.js +3 -3
- package/chunks/basis_encoder.js +2 -2
- package/chunks/basis_transcoder.js +2 -2
- package/chunks/draco_mesh_decoder.js +2 -2
- package/chunks/dxt_encoder.js +3 -3
- package/chunks/earcut.js +1 -1
- package/chunks/i3s.js +2 -2
- package/chunks/index.js +2 -2
- package/chunks/lclayout.js +2 -2
- package/chunks/lerc-wasm.js +1 -1
- package/chunks/libtess-f32.js +1 -1
- package/chunks/libtess-f64.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/parquet.js +1 -1
- package/chunks/pe-wasm.js +1 -1
- package/chunks/projector.js +1 -1
- package/chunks/qb3-wasm.js +1 -1
- package/chunks/text.js +1 -1
- package/chunks/urlUtils.js +2 -0
- package/chunks/vxlLayer.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.js +1 -1
- package/core/Clonable.js +1 -1
- package/core/Collection.js +1 -1
- package/core/MD5.js +1 -1
- package/core/MemCache.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/RandomLCG.js +1 -1
- package/core/accessorSupport/decorators/subclass.js +1 -1
- package/core/accessorSupport/diffUtils.js +1 -1
- package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/colorUtils.js +1 -1
- package/core/has.js +1 -1
- package/core/image/apng.js +1 -1
- package/core/lang.js +1 -1
- package/core/object.js +1 -1
- package/core/pbf.js +1 -1
- package/core/sql/StandardizedFunctions.js +1 -1
- package/core/string.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/core/urlUtils.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
- package/geometry/Circle.js +1 -1
- package/geometry/SpatialReference.d.ts +12 -3
- package/geometry/geodesicUtils.js +1 -1
- package/geometry/geometryEngine.js +1 -1
- package/geometry/libtess.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/geodeticDensifyOperator.js +1 -1
- package/geometry/operators/geodeticLengthOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/intersectionOperator.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/simplifyOperator.js +1 -1
- package/geometry/operators/support/jsonConverter.js +2 -2
- package/geometry/projectionUtils.js +1 -1
- package/geometry/support/buffer/types.js +1 -1
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/geometry/support/frustumPlanes.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/intersectsBase.js +1 -1
- package/geometry/support/meshUtils/External.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/glb.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +16 -41
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.d.ts +1 -9
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/ILyr3DWasmPerSceneView.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.d.ts +1 -5
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.d.ts +25 -2
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/MapNotesLayer.js +1 -1
- package/layers/ParquetLayer.d.ts +0 -32
- package/layers/ParquetLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +2 -2
- package/layers/graphics/OptimizedGeometry.js +1 -1
- package/layers/graphics/applyEditsUtils.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/data/FeatureIdInfo.js +1 -1
- package/layers/graphics/data/StreamFeatureManager.js +1 -1
- package/layers/graphics/dehydratedFeatures.js +1 -1
- package/layers/graphics/sources/csv/csv.js +2 -2
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/mixins/SceneService.js +1 -1
- package/layers/orientedImagery/core/NavigationNode.js +2 -0
- package/layers/orientedImagery/core/imageNavigationUtils.d.ts +2 -0
- package/layers/orientedImagery/core/imageNavigationUtils.js +2 -0
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/orientedImagery/queries.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/orientedImagery/types.d.ts +3 -0
- package/layers/raster/datasets/RasterFactory.js +1 -1
- package/layers/raster/datasets/xmlUtilities.js +1 -1
- package/layers/raster/formats/Lerc.js +1 -1
- package/layers/raster/formats/pixelRangeUtils.js +1 -1
- package/layers/raster/functions/convolutionUtils.js +1 -1
- package/layers/raster/functions/customBandIndexUtils.js +1 -1
- package/layers/support/I3SIntegratedMeshElevationQuery.js +1 -1
- package/layers/support/MosaicRule.js +1 -1
- package/layers/support/PixelBlock.js +1 -1
- package/layers/support/SpriteSource.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/csvUtils.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/floorFilterUtils.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/layers/video/VideoController.js +21 -21
- package/libs/ajv/ajv.bundle-wrapper.js +1 -1
- package/libs/linkchartlayout/LinkChartLayout.js +1 -1
- package/networks/Network.js +1 -1
- package/networks/support/UtilityNetworkLookupHelper.js +1 -1
- package/package.json +2 -2
- package/parcelFabric/ParcelFabric.d.ts +760 -0
- package/parcelFabric/ParcelFabric.js +2 -0
- package/parcelFabric/support/ParcelJobInfo.d.ts +97 -0
- package/parcelFabric/support/ParcelJobInfo.js +2 -0
- package/parcelFabric/support/ParcelParameters.d.ts +48 -0
- package/parcelFabric/support/ParcelParameters.js +2 -0
- package/popup/FeatureModel.d.ts +2 -2
- package/popup/FeaturesModel.d.ts +2 -2
- package/popup/support/featureUtils.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/rendererConversion.js +1 -1
- package/request/queue.js +1 -1
- package/rest/geoprocessor/utils.js +1 -1
- package/rest/parcelFabric/analyzeByLeastSquaresAdjustment.js +2 -0
- package/rest/parcelFabric/applyLeastSquaresAdjustment.js +2 -0
- package/rest/parcelFabric/assignFeaturesToRecord.js +2 -0
- package/rest/parcelFabric/build.js +2 -0
- package/rest/parcelFabric/changeParcelType.js +2 -0
- package/rest/parcelFabric/clip.js +2 -0
- package/rest/parcelFabric/copyLinesToParcelType.js +2 -0
- package/rest/parcelFabric/createSeeds.js +2 -0
- package/rest/parcelFabric/deleteParcels.js +2 -0
- package/rest/parcelFabric/divide.js +2 -0
- package/rest/parcelFabric/duplicateParcels.js +2 -0
- package/rest/parcelFabric/merge.js +2 -0
- package/rest/parcelFabric/mergeParcelPoints.js +2 -0
- package/rest/parcelFabric/reassignFeaturesToRecord.js +2 -0
- package/rest/parcelFabric/reconstructFromSeeds.js +2 -0
- package/rest/parcelFabric/setParcelLineLabelPosition.js +2 -0
- package/rest/parcelFabric/shrinkToSeed.js +2 -0
- package/rest/parcelFabric/transferParcel.js +2 -0
- package/rest/parcelFabric/updateParcelHistory.js +2 -0
- package/rest/parcelFabric/utils.js +2 -0
- package/rest/support/JobInfo.js +1 -1
- package/rest/support/printTaskUtils.js +1 -1
- package/smartMapping/heuristics/scaleRange.js +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/location.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/support/basemapUtils.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/cimSymbolUtils.js +1 -1
- package/undoredo/support/ServiceVersionInfo.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleProperty.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/CpuBuffer.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/number.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
- package/views/2d/engine/webgl/util/createMatcher.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/ComputedAttributeStorage.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
- package/views/2d/layers/features/support/StaticBitSet.js +1 -1
- package/views/2d/layers/features/support/rendererUtils.js +1 -1
- package/views/2d/layers/support/annodime/annotationSchema.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedArrowManipulator.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/move/isSupportedObject.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
- package/views/3d/interactive/manipulatorUtils.js +1 -1
- package/views/3d/interactive/manipulators/ShiftManipulator.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerWorker.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerWorkerHandle.js +1 -1
- package/views/3d/layers/IntegratedMeshNormals.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/LabelInfo.js +1 -1
- package/views/3d/layers/graphics/extrudePolygon.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/primitiveObjectSymbolUtils.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/IDBCache.js +1 -1
- package/views/3d/layers/support/IntegratedMesh3DTilesVertexProcessing.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/support/PBFDecoder.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
- package/views/3d/support/meshProcessing.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ObjectParameters.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +1 -6
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -4
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +19 -19
- package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +16 -15
- package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
- package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +5 -5
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeUtil.glsl.js +1 -2
- package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/draw/DrawManipulator3D.js +1 -1
- package/views/draw/support/managers/TooltipManager.js +1 -1
- package/views/draw/support/reshapeUtils.js +1 -1
- package/views/interactive/options/SnappingOptions.d.ts +3 -2
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/FeatureSnappingLayerSource.d.ts +6 -3
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
- package/views/interactive/snapping/featureSources/symbologySnappingCandidates.js +1 -1
- package/views/selection/SelectionOperation.js +1 -1
- package/views/support/GeometryWorker.js +1 -1
- package/views/support/flow/dataUtils.js +1 -1
- package/views/support/screenUtils.js +1 -1
- package/views/support/screenshotUtils.js +1 -1
- package/views/support/waitForResources.js +1 -1
- package/views/webgl/InstanceCounter.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/webdoc/support/webdocLoadUtils.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +2 -2
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListVisibleElements.d.ts +2 -2
- package/widgets/BasemapLayerList/types.d.ts +3 -3
- package/widgets/BasemapLayerList.d.ts +2 -2
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +2 -2
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListVisibleElements.d.ts +2 -2
- package/widgets/CatalogLayerList/types.d.ts +3 -3
- package/widgets/CatalogLayerList.d.ts +3 -3
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/LayerList/LayerListVisibleElements.d.ts +2 -2
- package/widgets/LayerList/ListItem.d.ts +1 -1
- package/widgets/LayerList/ListItemPanel.d.ts +1 -1
- package/widgets/LayerList/types.d.ts +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/OrientedImageryViewer/ImageMeasurementWorker.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/draw/HeightMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationNode.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUIViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OverlayLayersListViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/imageNavigationUtils.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/featureCoverage.js +1 -1
- package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementWorkerUtils.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
- package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
- package/widgets/OrientedImageryViewer/panoramicImageProperties.js +1 -1
- package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
- package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
- package/widgets/OrientedImageryViewer/support/MediaPrefetcher.js +1 -1
- package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
- package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/navigationViewStateUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
- package/widgets/OrientedImageryViewer/support/resolveMediaProps.js +1 -1
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/typeUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/urlUtils.js +1 -1
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer/types.d.ts +10 -0
- package/widgets/OrientedImageryViewer/utils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/TableList/ListItem.d.ts +2 -2
- package/widgets/TableList/ListItemPanel.d.ts +4 -4
- package/widgets/TableList/TableListViewModel.d.ts +4 -4
- package/widgets/TableList/TableListViewModel.js +1 -1
- package/widgets/TableList/TableListVisibleElements.d.ts +2 -2
- package/widgets/TableList/types.d.ts +5 -5
- package/widgets/TableList.d.ts +3 -3
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/assets/esri/core/workers/chunks/105865a4d8cb4ddf8a8a.js +0 -1
- package/assets/esri/core/workers/chunks/1aebb8fe0692058bf2fb.js +0 -1
- package/assets/esri/core/workers/chunks/1cdb55d9a5ab1a5e3f08.js +0 -1
- package/assets/esri/core/workers/chunks/1e5c5029b0653047a769.js +0 -1
- package/assets/esri/core/workers/chunks/20db6e844708d3e71437.js +0 -1
- package/assets/esri/core/workers/chunks/29ef9d357e30082d267a.js +0 -1
- package/assets/esri/core/workers/chunks/29feef121b0916fb90bf.js +0 -1
- package/assets/esri/core/workers/chunks/2e760d04641755d1820d.js +0 -1
- package/assets/esri/core/workers/chunks/2ef91e8da260454f46d8.js +0 -1
- package/assets/esri/core/workers/chunks/361d620b3f91868b1490.js +0 -1
- package/assets/esri/core/workers/chunks/37c16e20f022ca27cdae.js +0 -1
- package/assets/esri/core/workers/chunks/380aefa522dfeccb8c65.js +0 -1
- package/assets/esri/core/workers/chunks/3a90b6eafa92f1a68ac5.js +0 -1
- package/assets/esri/core/workers/chunks/3b552afffaa78bf4fe18.js +0 -1
- package/assets/esri/core/workers/chunks/44782e8318dc47cb08a0.js +0 -1
- package/assets/esri/core/workers/chunks/46969f379623810b2eca.js +0 -1
- package/assets/esri/core/workers/chunks/47f0c717acc2c33ea670.js +0 -1
- package/assets/esri/core/workers/chunks/487500443a6037d3599f.js +0 -1
- package/assets/esri/core/workers/chunks/4a4fab74442c3d914505.js +0 -1
- package/assets/esri/core/workers/chunks/4e03aa5518d46a36661c.js +0 -1
- package/assets/esri/core/workers/chunks/5470a29a69010c8361c4.js +0 -1
- package/assets/esri/core/workers/chunks/59295b99bdff4045a0e7.js +0 -1
- package/assets/esri/core/workers/chunks/5c2fe67527c9d7b4dba3.js +0 -1
- package/assets/esri/core/workers/chunks/5d908a823b324bafda1e.js +0 -1
- package/assets/esri/core/workers/chunks/5dea74fe52583e77f3ce.js +0 -1
- package/assets/esri/core/workers/chunks/5f1cb79aec9c4a9b7ddc.js +0 -29
- package/assets/esri/core/workers/chunks/60637f38159e9bf68d4e.js +0 -1
- package/assets/esri/core/workers/chunks/67c2e5953087dadfd245.js +0 -1
- package/assets/esri/core/workers/chunks/6f3732e7ba2d031ba789.js +0 -1
- package/assets/esri/core/workers/chunks/7191ab31fa040a7c561e.js +0 -1
- package/assets/esri/core/workers/chunks/71ba848c3352ea3ff96f.js +0 -1
- package/assets/esri/core/workers/chunks/863f04cacdc843d3f208.js +0 -1
- package/assets/esri/core/workers/chunks/87992070008812f8ae6f.js +0 -1
- package/assets/esri/core/workers/chunks/89b9d716d96135d4f057.js +0 -1
- package/assets/esri/core/workers/chunks/8b38798ac6d774185238.js +0 -1
- package/assets/esri/core/workers/chunks/8b53369cace136ed1329.js +0 -1
- package/assets/esri/core/workers/chunks/8ba4f5e1912edf397947.js +0 -1
- package/assets/esri/core/workers/chunks/919a6aedf38e9631ee09.js +0 -1
- package/assets/esri/core/workers/chunks/9869c696e6321c8db0a9.js +0 -1
- package/assets/esri/core/workers/chunks/9d0976f5979c4f9154dc.js +0 -1
- package/assets/esri/core/workers/chunks/a332e31165b65a6fb92e.js +0 -1
- package/assets/esri/core/workers/chunks/a4d3944700f1cc240176.js +0 -1
- package/assets/esri/core/workers/chunks/a7937b06f4b0860c7671.js +0 -1
- package/assets/esri/core/workers/chunks/b03f32f02858244c6cd0.js +0 -1
- package/assets/esri/core/workers/chunks/b42e50ec6b819f669400.js +0 -1
- package/assets/esri/core/workers/chunks/b5e7475cc5fbf31289d3.js +0 -1
- package/assets/esri/core/workers/chunks/bd02d927b0b4991b61c5.js +0 -1
- package/assets/esri/core/workers/chunks/bdf1c4c038d556527483.js +0 -1
- package/assets/esri/core/workers/chunks/c1273f14a5ef3d81de0d.js +0 -1
- package/assets/esri/core/workers/chunks/c7f49493bd548d5dc1e0.js +0 -1
- package/assets/esri/core/workers/chunks/cb62326b6526cde429c1.js +0 -1
- package/assets/esri/core/workers/chunks/cd8304b1db83d48c57db.js +0 -1
- package/assets/esri/core/workers/chunks/ce0274847ccce6a1ac53.js +0 -1
- package/assets/esri/core/workers/chunks/d00dd961a5b79f563123.js +0 -1
- package/assets/esri/core/workers/chunks/d893c3bb093104d3db95.js +0 -1
- package/assets/esri/core/workers/chunks/d8fb1d9da16492574a11.js +0 -1
- package/assets/esri/core/workers/chunks/df32a3fe81d60f0d7462.js +0 -1
- package/assets/esri/core/workers/chunks/e8cdec961e9cff1cb73b.js +0 -1
- package/assets/esri/core/workers/chunks/eaf720dfdf6ceca31249.js +0 -1
- package/assets/esri/core/workers/chunks/efca82a4dc494f57380b.js +0 -1
- package/assets/esri/core/workers/chunks/f05990e6fb378e2e1a3b.js +0 -1
- package/assets/esri/core/workers/chunks/f0fc89cdf50a40913c02.js +0 -1
- package/assets/esri/core/workers/chunks/f86ff791a10c802879ec.js +0 -1
- package/assets/esri/core/workers/chunks/fd17c4a9e13bf77aa86a.js +0 -1
- package/widgets/OrientedImageryViewer/support/VideoFeatureCache.js +0 -2
- package/widgets/OrientedImageryViewer/videoViewerUtils.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t,equals as n}from"../../../core/arrayUtils.js";import{createTask as r}from"../../../core/asyncUtils.js";import i from"../../../core/Error.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{abortMaybe as o,destroyMaybe as s}from"../../../core/maybe.js";import{after as c,throwIfAborted as l,isPromiseLike as u}from"../../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../../core/reactiveUtils.js";import{createScreenPointArray as p,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{convertTime as h}from"../../../core/timeUtils.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as y}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as b}from"../../../core/support/UpdatingHandles.js";import{projectAsync as x}from"../../../geometry/projectionUtils.js";import{containsExecute as S}from"../../../geometry/operators/containsOperator.js";import{equals as C}from"../../../geometry/support/boundedPlane.js";import{polygonToVolume as w}from"../focusAreaUtils.js";import T from"./AnalysisView3D.js";import{registerAnalysisView as E,hideOtherAnalysisViews as D}from"./ShadowCast/analysisViewRegister.js";import O from"./ShadowCast/ShadowCastError.js";import{ShadowCastTooltip as k}from"./ShadowCast/ShadowCastTooltip.js";import{getSunlightIntervals as A,getDateTimeUTC as j}from"./ShadowCast/sunlightUtils.js";import{ElevationContext as M}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as N}from"../support/earthUtils.js";import{computeDirectionsOverTime as P}from"../support/sunUtils.js";import{maxColorRampSize as F}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as I}from"../../../widgets/support/traversalUtils.js";let L=class extends T{constructor(e){super(e),this.type=`shadow-cast-view-3d`,this.analysis=null,this._updatingHandles=new b,this._visibleOverride=null,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([E(this.view,this),d(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{o(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=r(async e=>{await c(W,e),l(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),d(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t},n)=>{t&&D(this.view,this),(t||n?.visible)&&e?.setParameters({shadowCast:{enabled:t}})},f),d(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:n})=>{z(e,n,t)},f),d(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:n,visible:r})=>{z(e,r,{lightDirections:t,lightDirectionsContext:n})},f),d(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:n})=>{z(e,n,{previewing:t})},{sync:!0,initial:!0,equals:()=>!1}),d(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:n})=>{z(e,t,{analysisVolume:n})},f)]),this.interactive=!0,this._tooltip=new k({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getMode:()=>this.analysis.mode,getShowsSeparateZeroBucketInHourlyMode:()=>this._showsSeparateZeroBucketInHourlyMode,getTotalDuration:()=>this._totalDuration,getTotalDurationMode:()=>this.analysis.totalDurationOptions.mode,getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&z(this._renderer,!0,{enabled:!1}),this._tooltip=s(this._tooltip),this._stopPreviewingTask=o(this._stopPreviewingTask),this._updatingHandles=s(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||this._stopPreviewingTask!=null&&!this._stopPreviewingTask.finished||this._tooltip?.updating===!0||this._updatingHandles.updating}get visible(){let e=(this.parent?.visible&&!this.parent.suspended)??!0;return(this._visibleOverride??e)&&this.error==null}set visible(e){this._visibleOverride=e}get error(){let e=this._sunlightIntervals;switch(e.state){case`ready`:break;case`unavailable`:return new O(e.state,`The camera's geographic reference position is not available.`);default:return new O(e.state,`The selected date, time zone, or daylight calculation could not be resolved.`)}let{startTimeOfDay:t,endTimeOfDay:n}=this.analysis;if(!Number.isFinite(t)||!Number.isFinite(n)||t<0||n>h(1,`days`,`milliseconds`)||n<t)return new O(`invalid`,`The selected time range must be ordered and within the calendar day.`);let r=this._startDateTimeUTC.getTime(),i=this._endDateTimeUTC.getTime();if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return new O(`invalid`,`The selected time range could not be resolved to ordered UTC instants.`);let{intervals:a}=e;return a.length?a.some(e=>r>=e.start&&i<=e.end)?null:a.length>1?new O(`split-daylight`,`Daylight crosses midnight in the selected time zone and the selected time range includes nighttime.`):new O(`outside-daylight`,`The selected time range includes nighttime at the current camera location.`):new O(`no-daylight`,`No daylight is expected at the current camera location on the selected date.`)}get _sunlightIntervals(){let{date:e}=this.analysis,t=this._timeZone;return A({date:e,timeZone:t,utcOffset:t==null?this._effectiveUtcOffset:0,position:this._referencePosition})}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews.some(e=>e.updating),s=!i?.suspended&&!!i?.updating;return a||o||s}get _timeZone(){return this.analysis.timeZoneMode===`region`?this.view.timeZone:null}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:N(e[0],!1)}get _startDateTimeUTC(){return this._getDateTimeUTC(this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return this._getDateTimeUTC(this.analysis.endTimeOfDay)}_getDateTimeUTC(e){let{date:t}=this.analysis,n=this._timeZone,r=j(t,e,n,n==null?this._effectiveUtcOffset:0);if(r==null)throw RangeError(`Invalid shadow cast date or time zone`);return r}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(G-1)):G}get _interval(){let e=this._totalDurationInterval;switch(this.analysis.mode){case`min-duration`:return this._totalDuration>0?e:0;case`total-duration`:return e;case`discrete`:return this.analysis.discreteOptions.interval||e}}get _intervalContext(){let{mode:e,minDurationOptions:t}=this.analysis;return e===`min-duration`&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){return this._endDateTimeUTC.getTime()-this._startDateTimeUTC.getTime()}get _lightDirections(){return this.error==null?this._calculateLightDirections(this._interval):[]}get _lightDirectionsContext(){return this.error==null?this._calculateLightDirections(this._intervalContext):[]}_calculateLightDirections(e){let{view:t}=this;if(e<=0)return[];let n=t.viewingMode===`global`?K:this._referencePosition;if(n==null)return[];let r=P(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.viewingMode,G),i=r.length;q.length=0;let a=I(0,i,q),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _analysisVolume(){let{geometry:e}=this.analysis;if(e==null)return this._previousVolume=null,null;try{let t=w(e,this.view,J);return t==null?(this._previousVolume=null,null):u(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return a.getLogger(this).error(new i(`shadowcastanalysisview3d:projection-failed`,`Failed to project analysis area geometry to view spatial reference`,{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case`min-duration`:return this._minDurationVisualizationParameters;case`total-duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){let{color:e,minDuration:t}=this.analysis.minDurationOptions,n=this._totalDuration;return{rendersSunlight:this.analysis.visualizeSunlight,visualization:2,thresholdColor:e.toUnitRGBA(),threshold:n>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){let{minDurationOptions:e,visualizeSunlight:t}=this.analysis;if(!e.contextEnabled||t)return{};let{color:n,colorStops:r}=e.contextOptions,i=1/this._lightDirectionsContext.length;return{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(n,r,i)}}get _durationVisualizationParameters(){let{color:e,colorStops:t,mode:n}=this.analysis.totalDurationOptions,r=this._totalDuration,i=r>0&&n===`hourly`?U/r:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/r);return i===0?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{rendersSunlight:this.analysis.visualizeSunlight,bandedGradientColorRamp:a,visualization:1,bandSize:i}}get _showsSeparateZeroBucketInHourlyMode(){let{colorStops:e}=this.analysis.totalDurationOptions;return e==null||e.length===0||e.reduce((e,t)=>Math.min(e,t.value),1/0)<=0}get _discreteVisualizationParameters(){let{color:e,colorStops:t}=this.analysis.discreteOptions,n=1/this._lightDirections.length;return{rendersSunlight:this.analysis.visualizeSunlight,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,n),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(V)}get _previewDependencies(){if(this.error!=null)return null;let{view:e}=this,n=e.slice.plane,r=this._shadowLayerViews,i=r.map(e=>e.layer).filter(t),a=r.map(e=>e.suspended),o=i.map(e=>e.visible),s=i.map(e=>e.opacity),c=!!e.graphicsView?.suspended,l=i.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),u=r.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:n,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:c,layerVisibilities:o,layerOpacities:s,filters:u,definitionExpressions:l}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;let{_renderer:n,_totalDurationSampleCount:r}=this;if(n==null||r===0)return 0;let i=this.view.state.camera.screenToRender(p(e.x,e.y),m()),a=n.readAccumulatedShadow(i);return(this.analysis.visualizeSunlight?1-a:a)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){let{geometry:n}=this.analysis;if(!n)return!0;let r=await this.view.hitTest(e);l(t);let i=r.results.find(e=>e.mapPoint)?.mapPoint??r?.ground?.mapPoint;if(!i)return!1;let a=await x(i,n.spatialReference,{signal:t});return l(t),a!=null&&S(n,a)}_getEffectiveShadowCastColorRamp(e,t,n){if(t!=null){t.length>F&&a.getLogger(this).warnOnce(`ShadowCastAnalysis supports at most 8 color stops`);let e=t.map(e=>[e.value*n,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return B(e)}};e([g({readOnly:!0,type:[`shadow-cast-view-3d`]})],L.prototype,`type`,void 0),e([g({constructOnly:!0,nonNullable:!0})],L.prototype,`analysis`,void 0),e([g({readOnly:!0})],L.prototype,`updating`,null),e([g()],L.prototype,`visible`,null),e([g()],L.prototype,`error`,null),e([g()],L.prototype,`_visibleOverride`,void 0),e([g()],L.prototype,`_sunlightIntervals`,null),e([g()],L.prototype,`_stopPreviewingTask`,void 0),e([g()],L.prototype,`_updatedRecently`,void 0),e([g()],L.prototype,`_tooltip`,void 0),e([g()],L.prototype,`_sceneUpdating`,null),e([g()],L.prototype,`_timeZone`,null),e([g()],L.prototype,`_effectiveUtcOffset`,null),e([g()],L.prototype,`_utcOffsetAuto`,null),e([g()],L.prototype,`_startDateTimeUTC`,null),e([g()],L.prototype,`_endDateTimeUTC`,null),e([g()],L.prototype,`_referencePosition`,null),e([g()],L.prototype,`_interval`,null),e([g()],L.prototype,`_intervalContext`,null),e([g()],L.prototype,`_totalDurationSampleCount`,null),e([g()],L.prototype,`_totalDuration`,null),e([g()],L.prototype,`_lightDirections`,null),e([g()],L.prototype,`_lightDirectionsContext`,null),e([g()],L.prototype,`_analysisVolume`,null),e([g()],L.prototype,`_visualizationParameters`,null),e([g()],L.prototype,`_minDurationVisualizationParameters`,null),e([g()],L.prototype,`_minDurationContextVisualizationParameters`,null),e([g()],L.prototype,`_durationVisualizationParameters`,null),e([g()],L.prototype,`_showsSeparateZeroBucketInHourlyMode`,null),e([g()],L.prototype,`_discreteVisualizationParameters`,null),e([g()],L.prototype,`_shadowLayerViews`,null),e([g()],L.prototype,`_previewDependencies`,null),e([g()],L.prototype,`_renderer`,null),L=e([_(`esri.views.3d.analysis.ShadowCastAnalysisView3D`)],L);const R=L;function z(e,t,n){t&&n!=null&&e?.setParameters({shadowCast:n})}function B(e){let t=e.toUnitRGBA();return[[0,y(t[0],t[1],t[2],0)],[1,t]]}function V(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`gaussian-splat-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:return!1;case`group`:return!1;case`graphics-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function H(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let r=C(e.slicePlane,t.slicePlane),i=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=n(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=n(e.layerVisibilities,t.layerVisibilities),s=n(e.layerOpacities,t.layerOpacities),c=n(e.filters,t.filters),l=n(e.definitionExpressions,t.definitionExpressions);return r&&i&&a&&o&&s&&c&&l}const U=h(1,`hours`,`milliseconds`),W=500,G=255,K=v(),q=[],J=new M;export{R as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t,equals as n}from"../../../core/arrayUtils.js";import{createTask as r}from"../../../core/asyncUtils.js";import i from"../../../core/Error.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{abortMaybe as o,destroyMaybe as s}from"../../../core/maybe.js";import{after as c,throwIfAborted as l,isPromiseLike as u}from"../../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../../core/reactiveUtils.js";import{createScreenPointArray as p,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{convertTime as h}from"../../../core/timeUtils.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as y}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as b}from"../../../core/support/UpdatingHandles.js";import{projectAsync as x}from"../../../geometry/projectionUtils.js";import{containsExecute as S}from"../../../geometry/operators/containsOperator.js";import{equals as C}from"../../../geometry/support/boundedPlane.js";import{polygonToVolume as w}from"../focusAreaUtils.js";import T from"./AnalysisView3D.js";import{registerAnalysisView as E,hideOtherAnalysisViews as D}from"./ShadowCast/analysisViewRegister.js";import O from"./ShadowCast/ShadowCastError.js";import{ShadowCastTooltip as k}from"./ShadowCast/ShadowCastTooltip.js";import{getSunlightIntervals as A,getDateTimeUTC as j}from"./ShadowCast/sunlightUtils.js";import{ElevationContext as M}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as N}from"../support/earthUtils.js";import{computeDirectionsOverTime as P}from"../support/sunUtils.js";import{maxColorRampSize as F}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as I}from"../../../widgets/support/traversalUtils.js";let L=class extends T{constructor(e){super(e),this.type=`shadow-cast-view-3d`,this.analysis=null,this._updatingHandles=new b,this._visibleOverride=null,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([E(this.view,this),d(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{o(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=r(async e=>{await c(W,e),l(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),d(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t},n)=>{t&&D(this.view,this),(t||n?.visible)&&e?.setParameters({shadowCast:{enabled:t}})},f),d(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:n})=>{z(e,n,t)},f),d(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:n,visible:r})=>{z(e,r,{lightDirections:t,lightDirectionsContext:n})},f),d(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:n})=>{z(e,n,{previewing:t})},{sync:!0,initial:!0,equals:()=>!1}),d(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:n})=>{z(e,t,{analysisVolume:n})},f)]),this.interactive=!0,this._tooltip=new k({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getMode:()=>this.analysis.mode,getShowsSeparateZeroBucketInHourlyMode:()=>this._showsSeparateZeroBucketInHourlyMode,getTotalDuration:()=>this._totalDuration,getTotalDurationMode:()=>this.analysis.totalDurationOptions.mode,getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&z(this._renderer,!0,{enabled:!1}),this._tooltip=s(this._tooltip),this._stopPreviewingTask=o(this._stopPreviewingTask),this._updatingHandles=s(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||this._stopPreviewingTask!=null&&!this._stopPreviewingTask.finished||this._tooltip?.updating===!0||this._updatingHandles.updating}get visible(){let e=(this.parent?.visible&&!this.parent.suspended)??!0;return(this._visibleOverride??e)&&this.error==null}set visible(e){this._visibleOverride=e}get error(){let e=this._sunlightIntervals;switch(e.state){case`ready`:break;case`unavailable`:return new O(e.state,`The camera's geographic reference position is not available.`);default:return new O(e.state,`The selected date, time zone, or daylight calculation could not be resolved.`)}let{startTimeOfDay:t,endTimeOfDay:n}=this.analysis;if(!Number.isFinite(t)||!Number.isFinite(n)||t<0||n>h(1,`days`,`milliseconds`)||n<t)return new O(`invalid`,`The selected time range must be ordered and within the calendar day.`);let r=this._startDateTimeUTC.getTime(),i=this._endDateTimeUTC.getTime();if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return new O(`invalid`,`The selected time range could not be resolved to ordered UTC instants.`);let{intervals:a}=e;return a.length?a.some(e=>r>=e.start&&i<=e.end)?null:a.length>1?new O(`split-daylight`,`Daylight crosses midnight in the selected time zone and the selected time range includes nighttime.`):new O(`outside-daylight`,`The selected time range includes nighttime at the current camera location.`):new O(`no-daylight`,`No daylight is expected at the current camera location on the selected date.`)}get _sunlightIntervals(){let{date:e}=this.analysis,t=this._timeZone;return A({date:e,timeZone:t,utcOffset:t==null?this._effectiveUtcOffset:0,position:this._referencePosition})}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews.some(e=>e.updating),s=!i?.suspended&&!!i?.updating;return a||o||s}get _timeZone(){return this.analysis.timeZoneMode===`region`?this.view.timeZone:null}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:N(e[0],!1)}get _startDateTimeUTC(){return this._getDateTimeUTC(this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return this._getDateTimeUTC(this.analysis.endTimeOfDay)}_getDateTimeUTC(e){let{date:t}=this.analysis,n=this._timeZone,r=j(t,e,n,n==null?this._effectiveUtcOffset:0);if(r==null)throw RangeError(`Invalid shadow cast date or time zone`);return r}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(G-1)):G}get _interval(){let e=this._totalDurationInterval;switch(this.analysis.mode){case`min-duration`:return this._totalDuration>0?e:0;case`total-duration`:return e;case`discrete`:return this.analysis.discreteOptions.interval||e}}get _intervalContext(){let{mode:e,minDurationOptions:t}=this.analysis;return e===`min-duration`&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){return this._endDateTimeUTC.getTime()-this._startDateTimeUTC.getTime()}get _lightDirections(){return this.error==null?this._calculateLightDirections(this._interval):[]}get _lightDirectionsContext(){return this.error==null?this._calculateLightDirections(this._intervalContext):[]}_calculateLightDirections(e){let{view:t}=this;if(e<=0)return[];let n=t.viewingMode===`global`?K:this._referencePosition;if(n==null)return[];let r=P(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.viewingMode,G),i=r.length;q.length=0;let a=I(0,i,q),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _analysisVolume(){let{geometry:e}=this.analysis;if(e==null)return this._previousVolume=null,null;try{let t=w(e,this.view,J);return t==null?(this._previousVolume=null,null):u(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return a.getLogger(this).error(new i(`shadowcastanalysisview3d:projection-failed`,`Failed to project analysis area geometry to view spatial reference`,{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case`min-duration`:return this._minDurationVisualizationParameters;case`total-duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){let{color:e,minDuration:t}=this.analysis.minDurationOptions,n=this._totalDuration;return{rendersSunlight:this.analysis.visualizeSunlight,visualization:2,thresholdColor:e.toUnitRGBA(),threshold:n>0?t/this._totalDuration:0,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){let{minDurationOptions:e,visualizeSunlight:t}=this.analysis;if(!e.contextEnabled||t)return{};let{color:n,colorStops:r}=e.contextOptions,i=1/this._lightDirectionsContext.length;return{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(n,r,i)}}get _durationVisualizationParameters(){let{color:e,colorStops:t,mode:n}=this.analysis.totalDurationOptions,r=this._totalDuration,i=r>0&&n===`hourly`?U/r:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/r);return i===0?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{rendersSunlight:this.analysis.visualizeSunlight,bandedGradientColorRamp:a,visualization:1,bandSize:i}}get _showsSeparateZeroBucketInHourlyMode(){let{colorStops:e}=this.analysis.totalDurationOptions;return e==null||e.length===0||e.reduce((e,t)=>Math.min(e,t.value),1/0)<=0}get _discreteVisualizationParameters(){let{color:e,colorStops:t}=this.analysis.discreteOptions,n=1/this._lightDirections.length;return{rendersSunlight:this.analysis.visualizeSunlight,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,n),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(V)}get _previewDependencies(){if(this.error!=null)return null;let{view:e}=this,n=e.slice.plane,r=this._shadowLayerViews,i=r.map(e=>e.layer).filter(t),a=r.map(e=>e.suspended),o=i.map(e=>e.visible),s=i.map(e=>e.opacity),c=!!e.graphicsView?.suspended,l=i.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),u=r.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:n,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:c,layerVisibilities:o,layerOpacities:s,filters:u,definitionExpressions:l}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;let{_renderer:n,_totalDurationSampleCount:r}=this;if(n==null||r===0)return 0;let i=this.view.state.camera.screenToRender(p(e.x,e.y),m()),a=n.readAccumulatedShadow(i);return(this.analysis.visualizeSunlight?1-a:a)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){let{geometry:n}=this.analysis;if(!n)return!0;let r=await this.view.hitTest(e);l(t);let i=r.results.find(e=>e.mapPoint)?.mapPoint??r?.ground?.mapPoint;if(!i)return!1;let a=await x(i,n.spatialReference,{signal:t});return l(t),a!=null&&S(n,a)}_getEffectiveShadowCastColorRamp(e,t,n){if(t!=null){t.length>F&&a.getLogger(this).warnOnce(`ShadowCastAnalysis supports at most 8 color stops`);let e=t.map(e=>[e.value*n,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return B(e)}};e([g({readOnly:!0,type:[`shadow-cast-view-3d`]})],L.prototype,`type`,void 0),e([g({constructOnly:!0,nonNullable:!0})],L.prototype,`analysis`,void 0),e([g({readOnly:!0})],L.prototype,`updating`,null),e([g()],L.prototype,`visible`,null),e([g()],L.prototype,`error`,null),e([g()],L.prototype,`_visibleOverride`,void 0),e([g()],L.prototype,`_sunlightIntervals`,null),e([g()],L.prototype,`_stopPreviewingTask`,void 0),e([g()],L.prototype,`_updatedRecently`,void 0),e([g()],L.prototype,`_tooltip`,void 0),e([g()],L.prototype,`_sceneUpdating`,null),e([g()],L.prototype,`_timeZone`,null),e([g()],L.prototype,`_effectiveUtcOffset`,null),e([g()],L.prototype,`_utcOffsetAuto`,null),e([g()],L.prototype,`_startDateTimeUTC`,null),e([g()],L.prototype,`_endDateTimeUTC`,null),e([g()],L.prototype,`_referencePosition`,null),e([g()],L.prototype,`_interval`,null),e([g()],L.prototype,`_intervalContext`,null),e([g()],L.prototype,`_totalDurationSampleCount`,null),e([g()],L.prototype,`_totalDuration`,null),e([g()],L.prototype,`_lightDirections`,null),e([g()],L.prototype,`_lightDirectionsContext`,null),e([g()],L.prototype,`_analysisVolume`,null),e([g()],L.prototype,`_visualizationParameters`,null),e([g()],L.prototype,`_minDurationVisualizationParameters`,null),e([g()],L.prototype,`_minDurationContextVisualizationParameters`,null),e([g()],L.prototype,`_durationVisualizationParameters`,null),e([g()],L.prototype,`_showsSeparateZeroBucketInHourlyMode`,null),e([g()],L.prototype,`_discreteVisualizationParameters`,null),e([g()],L.prototype,`_shadowLayerViews`,null),e([g()],L.prototype,`_previewDependencies`,null),e([g()],L.prototype,`_renderer`,null),L=e([_(`esri.views.3d.analysis.ShadowCastAnalysisView3D`)],L);const R=L;function z(e,t,n){t&&n!=null&&e?.setParameters({shadowCast:n})}function B(e){let t=e.toUnitRGBA();return[[0,y(t[0],t[1],t[2],0)],[1,t]]}function V(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`gaussian-splat-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:case`group`:return!1;case`graphics-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function H(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let r=C(e.slicePlane,t.slicePlane),i=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=n(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=n(e.layerVisibilities,t.layerVisibilities),s=n(e.layerOpacities,t.layerOpacities),c=n(e.filters,t.filters),l=n(e.definitionExpressions,t.definitionExpressions);return r&&i&&a&&o&&s&&c&&l}const U=h(1,`hours`,`milliseconds`),W=500,G=255,K=v(),q=[],J=new M;export{R as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Handles.js";import{watch as t,initial as n}from"../../../../core/reactiveUtils.js";import{fromTranslation as r,mul as i,fromXRotation as a,fromYRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{displayFocusMultiplier as u}from"../Slice/sliceToolConfig.js";import{viewshedToolManipulatorConfiguration as d}from"./ViewshedConfiguration.js";import{Manipulator3D as f}from"../../interactive/Manipulator3D.js";import{RenderObject as p}from"../../interactive/RenderObject.js";import{createTubeGeometry as m,createExtrudedTriangle as h}from"../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as g}from"../../webgl-engine/materials/ColorMaterial.js";class _ extends f{constructor(t,n){super({view:t,autoScaleRenderObjects:!1,worldSized:!1,radius:d.collisionRadius}),this._handles=new e,this._setupManipulatorVisual(n)}destroy(){this._handles.remove(),super.destroy()}_setupManipulatorVisual(e){let t=this._createMaterial(),n=[l(0,0,0),l(0,0,1)],f=m(t,n,e,16,!1),h=m(t,n,e*u,16,!1),g=v(!1,t,e),_=v(!0,t,e),b=s();r(b,n[n.length-1]),i(b,b,a(y,Math.PI/2)),i(b,b,o(y,Math.PI/2)),g.transformation=b,_.transformation=b,this.renderObjects=[new p(f,1),new p(h,2),new p(g,1),new p(_,2)];let x=l(0,d.getScaleOrientArrowTipLength(!0),0),S=c(x,x,b),C=[...n,S];this.collisionType={type:`line`,paths:[C]}}_createMaterial(){let e=new g({cullFace:2,renderOccluded:4,isDecoration:!0});return this._handles.add(t(()=>this.view.effectiveTheme.accentColor.toUnitRGBA(),t=>e.setParameters({color:t}),n)),e}}function v(e,t,n){let r=d.getScaleOrientArrowTipLength(e),i=n*2;e&&(i*=u);let a=r/2;return h(t,r,a,a,i,0)}const y=s();export{_ as ViewshedArrowManipulator};
|
|
2
|
+
import e from"../../../../core/Handles.js";import{watch as t,initial as n}from"../../../../core/reactiveUtils.js";import{fromTranslation as r,mul as i,fromXRotation as a,fromYRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{displayFocusMultiplier as u}from"../Slice/sliceToolConfig.js";import{viewshedToolManipulatorConfiguration as d}from"./ViewshedConfiguration.js";import{Manipulator3D as f}from"../../interactive/Manipulator3D.js";import{RenderObject as p}from"../../interactive/RenderObject.js";import{createTubeGeometry as m,createExtrudedTriangle as h}from"../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as g}from"../../webgl-engine/materials/ColorMaterial.js";class _ extends f{constructor(t,n){super({view:t,autoScaleRenderObjects:!1,worldSized:!1,radius:d.collisionRadius}),this._handles=new e,this._setupManipulatorVisual(n)}destroy(){this._handles.remove(),super.destroy()}_setupManipulatorVisual(e){let t=this._createMaterial(),n=[l(0,0,0),l(0,0,1)],f=m(t,n,e,16,!1),h=m(t,n,e*u,16,!1),g=v(!1,t,e),_=v(!0,t,e),b=s();r(b,n[n.length-1]),i(b,b,a(y,Math.PI/2)),i(b,b,o(y,Math.PI/2)),g.transformation=b,_.transformation=b,this.renderObjects=[new p(f,1),new p(h,2),new p(g,1),new p(_,2)];let x=l(0,d.getScaleOrientArrowTipLength(!0),0),S=c(x,x,b),C=[...n,S];this.collisionType={type:`line`,paths:[C]}}_createMaterial(){let e=new g({cullFace:2,renderOccluded:4,isDecoration:!0},this.view.state.isGlobal);return this._handles.add(t(()=>this.view.effectiveTheme.accentColor.toUnitRGBA(),t=>e.setParameters({color:t}),n)),e}}function v(e,t,n){let r=d.getScaleOrientArrowTipLength(e),i=n*2;e&&(i*=u);let a=r/2;return h(t,r,a,a,i,0)}const y=s();export{_ as ViewshedArrowManipulator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{deg2rad as e}from"../../../../core/mathUtils.js";import{fromScaling as t,mul as n,fromTranslation as r,fromRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as o,copy as s,transformMat4 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as l,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as d,arcAnglePerSegment as f}from"./ViewshedConfiguration.js";import{getViewshedRotationMatrix as p,rotateBy as m}from"./viewshedToolUtils.js";import{Object3DVisualElement as h}from"../../interactive/visualElements/Object3DVisualElement.js";import{Attribute as g}from"../../webgl-engine/lib/Attribute.js";import{Geometry as _}from"../../webgl-engine/lib/Geometry.js";import{ColorMaterial as v}from"../../webgl-engine/materials/ColorMaterial.js";class y extends h{constructor(e){super(e),this._material=null,this._viewshedComputedData=null,this._material=new v({...d.shapeMaterialParameters,isDecoration:this.isDecoration,writeDepth:!1}),this.applyProperties(e)}get viewshedComputedData(){return this._viewshedComputedData}set viewshedComputedData(e){this._viewshedComputedData=e,this.updateTransform()}updateTransform(){let e=this._viewshedComputedData;if(e==null)return;let i=a(),o=e.farDistanceRenderSpace;t(i,l(o,o,o)),p(e,E),n(i,E,i),r(E,this._viewshedComputedData.elevationAlignedObserverRenderSpace),n(i,E,i),this.transform=i}createExternalResources(){}destroyExternalResources(){}forEachMaterial(e){e(this._material)}createGeometries(e){let{_material:t,viewshedComputedData:n}=this;n!=null&&t!=null&&n.valid&&b(t,n).forEach(t=>e.addGeometry(t))}}function b(t,n){let{horizontalFieldOfView:r,verticalFieldOfView:a}=n,l=o(S,0,0,1),u=o(C,0,1,0),d=o(w,1,0,0);m(l,l,e(a/2),u),m(l,l,e(r/2),d);let p=e=>Math.ceil(Math.abs(e)/f)+1,h=e(r),v=s(T,d),y=p(h),b=x(-h/(y-1)),O=i(E,b,v),k=e(-a),A=p(k),j=x(k/(A-1)),M=s(C,u),N=i(D,e(r)/2,d);c(M,M,N);let P=D,F=[],I=s(w,l);for(let e=0;e<y;e++){i(P,j,M);for(let t=0;t<A;t++){let n=(t*y+e)*3;F[n]=I[0],F[n+1]=I[1],F[n+2]=I[2],c(I,I,P)}c(M,M,O),c(l,l,O),s(I,l)}let L=y*A;F[L*3]=0,F[L*3+1]=0,F[L*3+2]=0;let R=[];for(let e=0;e<y-1;e++)for(let t=0;t<A-1;t++){let n=(t*(y-1)+e)*6;R[n]=t*y+e,R[n+1]=(t+1)*y+e,R[n+2]=t*y+e+1,R[n+3]=t*y+e+1,R[n+4]=(t+1)*y+e,R[n+5]=(t+1)*y+e+1}let z=[R];if(r!==360&&a!==0){let e=[],t=[];for(let n=0;n<A-1;n++){let r=n*3;e[r]=L,e[r+1]=(n+1)*y,e[r+2]=n*y,t[r]=L,t[r+1]=n*y+y-1,t[r+2]=(n+1)*y+y-1}z.push(e,t)}if(a!==180&&r!==0){let e=[],t=[];for(let n=0;n<y-1;n++){let r=n*3;e[r]=L,e[r+1]=n,e[r+2]=n+1,t[r]=L,t[r+1]=n+(A-1)*y+1,t[r+2]=n+(A-1)*y}z.push(e,t)}return z.map(e=>{let n=[[`position`,new g(F,e,3,!0)]];return new _(t,n)})}function x(e){return isNaN(e)?1:e}const S=u(),C=u(),w=u(),T=u(),E=a(),D=a();export{y as ViewshedShapeVisualElement};
|
|
2
|
+
import{deg2rad as e}from"../../../../core/mathUtils.js";import{fromScaling as t,mul as n,fromTranslation as r,fromRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as o,copy as s,transformMat4 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as l,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as d,arcAnglePerSegment as f}from"./ViewshedConfiguration.js";import{getViewshedRotationMatrix as p,rotateBy as m}from"./viewshedToolUtils.js";import{Object3DVisualElement as h}from"../../interactive/visualElements/Object3DVisualElement.js";import{Attribute as g}from"../../webgl-engine/lib/Attribute.js";import{Geometry as _}from"../../webgl-engine/lib/Geometry.js";import{ColorMaterial as v}from"../../webgl-engine/materials/ColorMaterial.js";class y extends h{constructor(e){super(e),this._material=null,this._viewshedComputedData=null,this._material=new v({...d.shapeMaterialParameters,isDecoration:this.isDecoration,writeDepth:!1},e.view.state.isGlobal),this.applyProperties(e)}get viewshedComputedData(){return this._viewshedComputedData}set viewshedComputedData(e){this._viewshedComputedData=e,this.updateTransform()}updateTransform(){let e=this._viewshedComputedData;if(e==null)return;let i=a(),o=e.farDistanceRenderSpace;t(i,l(o,o,o)),p(e,E),n(i,E,i),r(E,this._viewshedComputedData.elevationAlignedObserverRenderSpace),n(i,E,i),this.transform=i}createExternalResources(){}destroyExternalResources(){}forEachMaterial(e){e(this._material)}createGeometries(e){let{_material:t,viewshedComputedData:n}=this;n!=null&&t!=null&&n.valid&&b(t,n).forEach(t=>e.addGeometry(t))}}function b(t,n){let{horizontalFieldOfView:r,verticalFieldOfView:a}=n,l=o(S,0,0,1),u=o(C,0,1,0),d=o(w,1,0,0);m(l,l,e(a/2),u),m(l,l,e(r/2),d);let p=e=>Math.ceil(Math.abs(e)/f)+1,h=e(r),v=s(T,d),y=p(h),b=x(-h/(y-1)),O=i(E,b,v),k=e(-a),A=p(k),j=x(k/(A-1)),M=s(C,u),N=i(D,e(r)/2,d);c(M,M,N);let P=D,F=[],I=s(w,l);for(let e=0;e<y;e++){i(P,j,M);for(let t=0;t<A;t++){let n=(t*y+e)*3;F[n]=I[0],F[n+1]=I[1],F[n+2]=I[2],c(I,I,P)}c(M,M,O),c(l,l,O),s(I,l)}let L=y*A;F[L*3]=0,F[L*3+1]=0,F[L*3+2]=0;let R=[];for(let e=0;e<y-1;e++)for(let t=0;t<A-1;t++){let n=(t*(y-1)+e)*6;R[n]=t*y+e,R[n+1]=(t+1)*y+e,R[n+2]=t*y+e+1,R[n+3]=t*y+e+1,R[n+4]=(t+1)*y+e,R[n+5]=(t+1)*y+e+1}let z=[R];if(r!==360&&a!==0){let e=[],t=[];for(let n=0;n<A-1;n++){let r=n*3;e[r]=L,e[r+1]=(n+1)*y,e[r+2]=n*y,t[r]=L,t[r+1]=n*y+y-1,t[r+2]=(n+1)*y+y-1}z.push(e,t)}if(a!==180&&r!==0){let e=[],t=[];for(let n=0;n<y-1;n++){let r=n*3;e[r]=L,e[r+1]=n,e[r+2]=n+1,t[r]=L,t[r+1]=n+(A-1)*y+1,t[r+2]=n+(A-1)*y}z.push(e,t)}return z.map(e=>{let n=[[`position`,new g(F,e,3,!0)]];return new _(t,n)})}function x(e){return isNaN(e)?1:e}const S=u(),C=u(),w=u(),T=u(),E=a(),D=a();export{y as ViewshedShapeVisualElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Handles.js";import{watch as n,initial as r}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators.js";import{viewshedToolManipulatorConfiguration as a}from"./ViewshedConfiguration.js";import{Manipulator3D as o}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as s}from"../../interactive/manipulatorUtils.js";import{RenderObject as c}from"../../interactive/RenderObject.js";import{createSphereGeometry as l}from"../../webgl-engine/lib/GeometryUtil.js";class u extends o{constructor(e,i){super({view:e,worldSized:!1,radius:a.observerSize,cursor:`move`}),this._handles=new t;let o=s(this._color);this.renderObjects=[new c(l(o,1,32,32))],i.manipulators.add(this),this._handles.add([n(()=>this._color,e=>{o.setParameters({color:e})},r)])}destroy(){this._handles.remove(),super.destroy()}get _color(){return this.view.effectiveTheme.accentColor.toUnitRGBA()}}e([i()],u.prototype,`_color`,null);export{u as ViewshedObserverManipulator};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Handles.js";import{watch as n,initial as r}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators.js";import{viewshedToolManipulatorConfiguration as a}from"./ViewshedConfiguration.js";import{Manipulator3D as o}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as s}from"../../interactive/manipulatorUtils.js";import{RenderObject as c}from"../../interactive/RenderObject.js";import{createSphereGeometry as l}from"../../webgl-engine/lib/GeometryUtil.js";class u extends o{constructor(e,i){super({view:e,worldSized:!1,radius:a.observerSize,cursor:`move`}),this._handles=new t;let o=s(e.state.isGlobal,this._color);this.renderObjects=[new c(l(o,1,32,32))],i.manipulators.add(this),this._handles.add([n(()=>this._color,e=>{o.setParameters({color:e})},r)])}destroy(){this._handles.remove(),super.destroy()}get _color(){return this.view.effectiveTheme.accentColor.toUnitRGBA()}}e([i()],u.prototype,`_color`,null);export{u as ViewshedObserverManipulator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import t from"../../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../../core/MapUtils.js";import{getKey as r}from"../../../../core/object.js";import{allSettledValues as i}from"../../../../core/promiseUtils.js";import{isDataProtocol as a,dataComponents as o,dataToArrayBuffer as s,makeAbsolute as c}from"../../../../core/urlUtils.js";import l from"../../../../core/Version.js";import{multiply as u,translate as d,rotate as f,scale as p,fromXRotation as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h,clone as g}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{getAxisAngle as _}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{BufferViewVec2f as y,BufferViewVec2u32 as b,BufferViewVec2u16 as x,BufferViewVec2i16 as S,BufferViewVec2u8 as C,BufferViewVec2i8 as w,BufferViewUint32 as T,BufferViewUint16 as E,BufferViewUint8 as D,BufferViewVec3f as O,BufferViewVec4f as k,BufferViewVec4u8 as A,BufferViewVec4u16 as j,BufferViewVec3u8 as M,BufferViewVec3u16 as ee}from"../../../../geometry/support/buffer/BufferView.js";import{m as N}from"../../../../chunks/scalar.js";import{getDracoMeshDecoder as P}from"../../../../libs/dracoMeshDecoder/dracoMeshDecoder.js";import{BinaryStreamReader as F}from"./BinaryStreamReader.js";import{material as I,textureSampler as L}from"./fillDefaults.js";import{splitURI as R}from"./pathUtils.js";import{jsonFromBinaryData as z,EncodedMeshTexture as B,imageFromBinaryData as V,isEncodedMeshTexture as H}from"./resourceUtils.js";import{DataType as U}from"../../../webgl/enums.js";const W={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562};class G{constructor(t,n,r,i){if(this._context=t,this.uri=n,this.json=r,this._glbBuffer=i,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._dracoBuffersSize=0,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=[`KHR_texture_basisu`,`KHR_texture_transform`,`KHR_draco_mesh_compression`,`KHR_materials_emissive_strength`,`KHR_materials_unlit`],this._baseUri=R(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),r.scenes==null)throw new e(`gltf-loader-unsupported-feature`,`Scenes must be defined.`);if(r.meshes==null)throw new e(`gltf-loader-unsupported-feature`,`Meshes must be defined`);if(r.nodes==null)throw new e(`gltf-loader-unsupported-feature`,`Nodes must be defined.`);this._computeNodeParents()}static async load(t,n,r){if(a(n)){let e=o(n);if(e&&e.mediaType!==`model/gltf-binary`)try{let r=JSON.parse(e.isBase64?atob(e.data):e.data);return new G(t,n,r)}catch{}let r=s(n);if(G._isGLBData(r))return this._fromGLBData(t,n,r)}if(te.test(n)||r?.expectedType===`gltf`){let e=await t.loadJSON(n,r);return new G(t,n,e)}let i=await t.loadBinary(n,r);if(G._isGLBData(i))return this._fromGLBData(t,n,i);if(ne.test(n)||r?.expectedType===`glb`)throw new e(`gltf-loader-invalid-glb`,`This is not a valid glb file.`);let c=await t.loadJSON(n,r);return new G(t,n,c)}static _isGLBData(e){if(e==null)return!1;let t=new F(e);return t.remainingBytes()>=4&&t.readUint32()===W.MAGIC}static async _fromGLBData(e,t,n){let r=await G._parseGLBData(n);return new G(e,t,r.json,r.binaryData)}static async _parseGLBData(n){let r=new F(n);if(r.remainingBytes()<12)throw new e(`gltf-loader-error`,`glb binary data is insufficiently large.`);let i=r.readUint32(),a=r.readUint32(),o=r.readUint32();if(i!==W.MAGIC)throw new e(`gltf-loader-error`,`Magic first 4 bytes do not fit to expected glb value.`);if(n.byteLength<o)throw new e(`gltf-loader-error`,`glb binary data is smaller than header specifies.`);if(a!==2)throw new e(`gltf-loader-unsupported-feature`,`An unsupported glb container version was detected. Only version 2 is supported.`);let s=0,c,l;for(;r.remainingBytes()>=8;){let n=r.readUint32(),i=r.readUint32();if(s===0){if(i!==W.CHUNK_TYPE_JSON)throw new e(`gltf-loader-error`,`First glb chunk must be JSON.`);if(n<0)throw new e(`gltf-loader-error`,`No JSON data found.`);c=await z(r.readUint8Array(n))}else if(s===1){if(i!==W.CHUNK_TYPE_BIN)throw new e(`gltf-loader-unsupported-feature`,`Second glb chunk expected to be BIN.`);l=r.readUint8Array(n)}else t.getLogger(`esri.views.3d.glTF`).warn(`[Unsupported Feature] More than 2 glb chunks detected. Skipping.`);s+=1}if(!c)throw new e(`gltf-loader-error`,`No glb JSON chunk detected.`);return{json:c,binaryData:l}}async getBuffer(t,n){let r=this.json.buffers[t];if(r.uri==null){if(this._glbBuffer==null)throw new e(`gltf-loader-error`,`glb buffer not present`);return this._glbBuffer}let i=await this._getBufferLoader(t,n);if(i.byteLength!==r.byteLength)throw new e(`gltf-loader-error`,`Buffer byte lengths should match.`);return i}async _getBufferLoader(e,t){let n=this._bufferLoaders.get(e);if(n)return n;let r=this.json.buffers[e].uri,i=this._context.loadBinary(this._resolveUri(r),t).then(e=>new Uint8Array(e));return this._bufferLoaders.set(e,i),i}_validateAccessor(t){if(!this.json.accessors)throw new e(`gltf-loader-unsupported-feature`,`Accessors missing.`);let n=this.json.accessors[t];if(n.type in[`MAT2`,`MAT3`,`MAT4`])throw new e(`gltf-loader-unsupported-feature`,`AttributeType ${n.type} is not supported`);return n}_getComponentInfo(e,t){let n=Y[e.type],r=t?.componentType||e.componentType,i=X[r];return{componentType:r,componentCount:n,componentByteSize:i,denseByteStride:n*i}}getDracoAccessor(e,t){let n=this._validateAccessor(e),r=t.accessorInfos.get(e),{componentType:i,componentCount:a,componentByteSize:o,denseByteStride:s}=this._getComponentInfo(n,r);return{raw:t.data.buffer,byteStride:s,byteOffset:t.data.byteOffset+(r?.byteOffset||0),entryCount:r?.count??n.count,isDenselyPacked:!0,componentCount:a,componentByteSize:o,componentType:i,min:n.min,max:n.max,normalized:!!n.normalized}}async getAccessor(t,n){let r=this._validateAccessor(t);if(r?.bufferView==null)throw new e(`gltf-loader-unsupported-feature`,`Some accessor does not specify a bufferView.`);let{componentCount:i,componentByteSize:a,denseByteStride:o}=this._getComponentInfo(r),s=this.json.bufferViews[r.bufferView],c=await this.getBuffer(s.buffer,n),l=s.byteStride||o;return{raw:c.buffer,byteStride:l,byteOffset:c.byteOffset+(s.byteOffset||0)+(r.byteOffset||0),entryCount:r.count,isDenselyPacked:l===o,componentCount:i,componentByteSize:a,componentType:r.componentType,min:r.min,max:r.max,normalized:!!r.normalized}}async getIndexData(e,t,n){if(e.indices==null)return;let r=e.indices,i=n?this.getDracoAccessor(r,n):await this.getAccessor(r,t);if(i.isDenselyPacked)switch(i.componentType){case U.UNSIGNED_BYTE:return new Uint8Array(i.raw,i.byteOffset,i.entryCount);case U.UNSIGNED_SHORT:return new Uint16Array(i.raw,i.byteOffset,i.entryCount);case U.UNSIGNED_INT:return new Uint32Array(i.raw,i.byteOffset,i.entryCount)}else switch(i.componentType){case U.UNSIGNED_BYTE:return N(Q(D,i));case U.UNSIGNED_SHORT:return N(Q(E,i));case U.UNSIGNED_INT:return N(Q(T,i))}}async getPositionData(t,n,i){if(t.attributes.POSITION==null)throw new e(`gltf-loader-unsupported-feature`,`No POSITION vertex data found.`);let a=t.attributes.POSITION,o=i?this.getDracoAccessor(a,i):await this.getAccessor(a,n);if(o.componentType!==U.FLOAT)throw new e(`gltf-loader-unsupported-feature`,`Expected type FLOAT for POSITION vertex attribute, but found `+r(U,o.componentType));if(o.componentCount!==3)throw new e(`gltf-loader-unsupported-feature`,`POSITION vertex attribute must have 3 components, but found `+o.componentCount.toFixed());return Q(O,o)}async getNormalData(t,n,i){if(t.attributes.NORMAL==null)throw new e(`gltf-loader-error`,`No NORMAL vertex data found.`);let a=t.attributes.NORMAL,o=i?this.getDracoAccessor(a,i):await this.getAccessor(a,n);if(o.componentType!==U.FLOAT)throw new e(`gltf-loader-unsupported-feature`,`Expected type FLOAT for NORMAL vertex attribute, but found `+r(U,o.componentType));if(o.componentCount!==3)throw new e(`gltf-loader-unsupported-feature`,`NORMAL vertex attribute must have 3 components, but found `+o.componentCount.toFixed());return Q(O,o)}async getTangentData(t,n,i){if(t.attributes.TANGENT==null)throw new e(`gltf-loader-error`,`No TANGENT vertex data found.`);let a=t.attributes.TANGENT,o=i?this.getDracoAccessor(a,i):await this.getAccessor(a,n);if(o.componentType!==U.FLOAT)throw new e(`gltf-loader-unsupported-feature`,`Expected type FLOAT for TANGENT vertex attribute, but found `+r(U,o.componentType));if(o.componentCount!==4)throw new e(`gltf-loader-unsupported-feature`,`TANGENT vertex attribute must have 4 components, but found `+o.componentCount.toFixed());return Q(k,o)}async getTextureCoordinates(t,n,r){if(t.attributes.TEXCOORD_0==null)throw new e(`gltf-loader-error`,`No TEXCOORD_0 vertex data found.`);let i=t.attributes.TEXCOORD_0,a=r?this.getDracoAccessor(i,r):await this.getAccessor(i,n);if(a.componentCount!==2)throw new e(`gltf-loader-unsupported-feature`,`TEXCOORD_0 vertex attribute must have 2 components, but found `+a.componentCount.toFixed());if(a.componentType===U.FLOAT)return Q(y,a);if(!a.normalized)throw new e(`gltf-loader-unsupported-feature`,`Integer component types are only supported for a normalized accessor for TEXCOORD_0.`);return Z(a)}async getVertexColors(t,n,i){if(t.attributes.COLOR_0==null)throw new e(`gltf-loader-error`,`No COLOR_0 vertex data found.`);let a=t.attributes.COLOR_0,o=i?this.getDracoAccessor(a,i):await this.getAccessor(a,n);if(o.componentCount!==4&&o.componentCount!==3)throw new e(`gltf-loader-unsupported-feature`,`COLOR_0 attribute must have 3 or 4 components, but found `+o.componentCount.toFixed());if(o.componentCount===4){if(o.componentType===U.FLOAT)return Q(k,o);if(o.componentType===U.UNSIGNED_BYTE)return Q(A,o);if(o.componentType===U.UNSIGNED_SHORT)return Q(j,o)}else if(o.componentCount===3){if(o.componentType===U.FLOAT)return Q(O,o);if(o.componentType===U.UNSIGNED_BYTE)return Q(M,o);if(o.componentType===U.UNSIGNED_SHORT)return Q(ee,o)}throw new e(`gltf-loader-unsupported-feature`,`Unsupported component type for COLOR_0 attribute: `+r(U,o.componentType))}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,t,n,r){let i=e.material?this._materialCache.get(e.material):void 0;if(!i){let a=e.material==null?I():I(this.json.materials[e.material]),o=a.pbrMetallicRoughness,s=this.hasVertexColors(e),c=this.getTexture(o.baseColorTexture,t),l=this.getTexture(a.normalTexture,t),u=n?this.getTexture(a.occlusionTexture,t):void 0,d=r?this.getTexture(a.emissiveTexture,t):void 0,f=n?this.getTexture(o.metallicRoughnessTexture,t):void 0,[p,m,h,g,_]=await Promise.all([c,l,u,d,f]),v=e.material==null?-1:e.material;i={alphaMode:a.alphaMode,alphaCutoff:a.alphaCutoff,color:o.baseColorFactor,doubleSided:!!a.doubleSided,colorTexture:p,normalTexture:m,name:a.name,id:v,occlusionTexture:h,emissiveTexture:g,emissiveFactor:a.emissiveFactor,emissiveStrengthKHR:a.extensions?.KHR_materials_emissive_strength?.emissiveStrength,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,metallicRoughnessTexture:_,hasVertexColors:s,ESRI_externalColorMixMode:a.extras.ESRI_externalColorMixMode,colorTextureTransform:o?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:a.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:a.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:a.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:o?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:a.extras.ESRI_receiveAmbientOcclusion,receiveShadows:a.extras.ESRI_receiveShadows,unlit:!!a.extensions?.KHR_materials_unlit}}return i}async decode(t,n){let r=t.extensions?.KHR_draco_mesh_compression;if(!r)return;if(t.indices==null)throw new e(`gltf-loader-error`,`Found Draco compressed primitive without indices.`);let i=this.json.bufferViews[r.bufferView],a=await this.getBuffer(i.buffer,n),o=(await P()).decode(new Uint8Array(a.buffer,a.byteOffset+(i.byteOffset||0),i.byteLength));this._bufferLoaders.delete(i.buffer);let s=new Map([[t.indices,o.indices],[t.attributes.POSITION,o.positions]]);return t.attributes.TEXCOORD_0&&s.set(t.attributes.TEXCOORD_0,o.uvs),t.attributes.NORMAL&&s.set(t.attributes.NORMAL,o.normals),t.attributes.COLOR_0&&s.set(t.attributes.COLOR_0,o.colors),t.attributes.TANGENT&&s.set(t.attributes.TANGENT,o.tangents),this._dracoBuffersSize+=o.buffer.byteLength,{data:o.buffer,accessorInfos:s}}async getTexture(t,r){if(!t)return;if((t.texCoord||0)!==0)throw new e(`gltf-loader-unsupported-feature`,`Only TEXCOORD with index 0 is supported.`);let i=t.index,a=this.json.textures[i],o=L(a.sampler==null?{}:this.json.samplers[a.sampler]),s=$(a),c=this.json.images[s],l=await this._loadTextureImageData(i,a,r);return n(this._textureCache,i,()=>{let t=e=>e===33071||e===33648||e===10497,n=t=>{throw new e(`gltf-loader-error`,`Unexpected TextureSampler WrapMode: ${t}`)};return{data:l,wrapS:t(o.wrapS)?o.wrapS:n(o.wrapS),wrapT:t(o.wrapT)?o.wrapT:n(o.wrapT),minFilter:o.minFilter,name:c.name,id:i}})}getNodeTransform(e){if(e===void 0)return K;let t=this._nodeTransformCache.get(e);if(!t){let n=this.getNodeTransform(this._getNodeParent(e)),r=this.json.nodes[e];r.matrix?t=u(h(),n,r.matrix):r.translation||r.rotation||r.scale?(t=g(n),r.translation&&d(t,t,r.translation),r.rotation&&(J[3]=_(J,r.rotation),f(t,t,J[3],J)),r.scale&&p(t,t,r.scale)):t=g(n),this._nodeTransformCache.set(e,t)}return t}_resolveUri(e){return c(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){let e=l.parse(this.json.asset.version,`glTF`);q.validate(e)}_checkRequiredExtensionsSupported(){let t=this.json;if(t.extensionsRequired&&!t.extensionsRequired.every(e=>this._supportedExtensions.includes(e)))throw new e(`gltf-loader-unsupported-feature`,`gltf loader was not able to load unsupported feature. Required extensions: `+t.extensionsRequired.join(`, `))}_computeNodeParents(){this.json.nodes.forEach((e,t)=>{e.children&&e.children.forEach(e=>{this._nodeParentMap.set(e,t)})})}async _loadTextureImageData(e,t,n){let r=this._textureLoaders.get(e);if(r)return r;let i=this._createTextureLoader(t,n);return this._textureLoaders.set(e,i),i}async _createTextureLoader(t,n){let r=$(t),i=this.json.images[r];if(i.uri){if(i.uri.endsWith(`.ktx2`)){let e=await this._context.loadBinary(this._resolveUri(i.uri),n);return new B(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(i.uri),n)}if(i.bufferView==null)throw new e(`gltf-loader-unsupported-feature`,`Image bufferView must be defined.`);if(i.mimeType==null)throw new e(`gltf-loader-unsupported-feature`,`Image mimeType must be defined.`);let a=this.json.bufferViews[i.bufferView],o=await this.getBuffer(a.buffer,n);if(a.byteStride!=null)throw new e(`gltf-loader-unsupported-feature`,`byteStride not supported for image buffer`);let s=o.byteOffset+(a.byteOffset||0);return V(new Uint8Array(o.buffer,s,a.byteLength),i.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;let e=await i(Array.from(this._bufferLoaders.values())),t=await i(Array.from(this._textureLoaders.values()));return e.reduce((e,t)=>e+(t?.byteLength??0),0)+this._dracoBuffersSize+t.reduce((e,t)=>e+(t?H(t)?t.data.byteLength:t.width*t.height*4:0),0)}}const K=m(h(),Math.PI/2),q=new l(2,0,`glTF`),J=v(),Y={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},X={[U.BYTE]:1,[U.UNSIGNED_BYTE]:1,[U.SHORT]:2,[U.UNSIGNED_SHORT]:2,[U.HALF_FLOAT]:2,[U.FLOAT]:4,[U.INT]:4,[U.UNSIGNED_INT]:4};function Z(e){switch(e.componentType){case U.BYTE:return new w(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case U.UNSIGNED_BYTE:return new C(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case U.SHORT:return new S(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case U.UNSIGNED_SHORT:return new x(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case U.UNSIGNED_INT:return new b(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case U.FLOAT:return new y(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}function Q(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}function $(t){if(t.extensions?.KHR_texture_basisu!=null)return t.extensions.KHR_texture_basisu.source;if(t.source!==null)return t.source;throw new e(`gltf-loader-unsupported-feature`,`Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.`)}const te=/\.gltf$/i,ne=/\.glb$/i;export{G as GLTFResource,K as transformGltfToEngine};
|
|
2
|
+
import e from"../../../../core/Error.js";import t from"../../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../../core/MapUtils.js";import{getKey as r}from"../../../../core/object.js";import{allSettledValues as i}from"../../../../core/promiseUtils.js";import{isDataProtocol as a,dataComponents as o,dataToArrayBuffer as s,makeAbsolute as c}from"../../../../core/urlUtils.js";import l from"../../../../core/Version.js";import{multiply as u,translate as d,rotate as f,scale as p,fromXRotation as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h,clone as g}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{getAxisAngle as _}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{BufferViewVec2f as y,BufferViewVec2u32 as b,BufferViewVec2u16 as x,BufferViewVec2i16 as S,BufferViewVec2u8 as C,BufferViewVec2i8 as w,BufferViewUint32 as T,BufferViewUint16 as E,BufferViewUint8 as D,BufferViewVec3f as O,BufferViewVec4f as k,BufferViewVec4u8 as A,BufferViewVec4u16 as j,BufferViewVec3u8 as M,BufferViewVec3u16 as ee}from"../../../../geometry/support/buffer/BufferView.js";import{m as N}from"../../../../chunks/scalar.js";import{getDracoMeshDecoder as P}from"../../../../libs/dracoMeshDecoder/dracoMeshDecoder.js";import{BinaryStreamReader as F}from"./BinaryStreamReader.js";import{material as I,textureSampler as L}from"./fillDefaults.js";import{splitURI as R}from"./pathUtils.js";import{jsonFromBinaryData as z,EncodedMeshTexture as B,imageFromBinaryData as V,isEncodedMeshTexture as H}from"./resourceUtils.js";import{DataType as U}from"../../../webgl/enums.js";const W={MAGIC:0x46546c67,CHUNK_TYPE_JSON:0x4e4f534a,CHUNK_TYPE_BIN:5130562};class G{constructor(t,n,r,i){if(this._context=t,this.uri=n,this.json=r,this._glbBuffer=i,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._dracoBuffersSize=0,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=[`KHR_texture_basisu`,`KHR_texture_transform`,`KHR_draco_mesh_compression`,`KHR_materials_emissive_strength`,`KHR_materials_unlit`],this._baseUri=R(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),r.scenes==null)throw new e(`gltf-loader-unsupported-feature`,`Scenes must be defined.`);if(r.meshes==null)throw new e(`gltf-loader-unsupported-feature`,`Meshes must be defined`);if(r.nodes==null)throw new e(`gltf-loader-unsupported-feature`,`Nodes must be defined.`);this._computeNodeParents()}static async load(t,n,r){if(a(n)){let e=o(n);if(e&&e.mediaType!==`model/gltf-binary`)try{let r=JSON.parse(e.isBase64?atob(e.data):e.data);return new G(t,n,r)}catch{}let r=s(n);if(G._isGLBData(r))return this._fromGLBData(t,n,r)}if(te.test(n)||r?.expectedType===`gltf`){let e=await t.loadJSON(n,r);return new G(t,n,e)}let i=await t.loadBinary(n,r);if(G._isGLBData(i))return this._fromGLBData(t,n,i);if(ne.test(n)||r?.expectedType===`glb`)throw new e(`gltf-loader-invalid-glb`,`This is not a valid glb file.`);let c=await t.loadJSON(n,r);return new G(t,n,c)}static _isGLBData(e){if(e==null)return!1;let t=new F(e);return t.remainingBytes()>=4&&t.readUint32()===W.MAGIC}static async _fromGLBData(e,t,n){let r=await G._parseGLBData(n);return new G(e,t,r.json,r.binaryData)}static async _parseGLBData(n){let r=new F(n);if(r.remainingBytes()<12)throw new e(`gltf-loader-error`,`glb binary data is insufficiently large.`);let i=r.readUint32(),a=r.readUint32(),o=r.readUint32();if(i!==W.MAGIC)throw new e(`gltf-loader-error`,`Magic first 4 bytes do not fit to expected glb value.`);if(n.byteLength<o)throw new e(`gltf-loader-error`,`glb binary data is smaller than header specifies.`);if(a!==2)throw new e(`gltf-loader-unsupported-feature`,`An unsupported glb container version was detected. Only version 2 is supported.`);let s=0,c,l;for(;r.remainingBytes()>=8;){let n=r.readUint32(),i=r.readUint32();if(s===0){if(i!==W.CHUNK_TYPE_JSON)throw new e(`gltf-loader-error`,`First glb chunk must be JSON.`);if(n<0)throw new e(`gltf-loader-error`,`No JSON data found.`);c=await z(r.readUint8Array(n))}else if(s===1){if(i!==W.CHUNK_TYPE_BIN)throw new e(`gltf-loader-unsupported-feature`,`Second glb chunk expected to be BIN.`);l=r.readUint8Array(n)}else t.getLogger(`esri.views.3d.glTF`).warn(`[Unsupported Feature] More than 2 glb chunks detected. Skipping.`);s+=1}if(!c)throw new e(`gltf-loader-error`,`No glb JSON chunk detected.`);return{json:c,binaryData:l}}async getBuffer(t,n){let r=this.json.buffers[t];if(r.uri==null){if(this._glbBuffer==null)throw new e(`gltf-loader-error`,`glb buffer not present`);return this._glbBuffer}let i=await this._getBufferLoader(t,n);if(i.byteLength!==r.byteLength)throw new e(`gltf-loader-error`,`Buffer byte lengths should match.`);return i}async _getBufferLoader(e,t){let n=this._bufferLoaders.get(e);if(n)return n;let r=this.json.buffers[e].uri,i=this._context.loadBinary(this._resolveUri(r),t).then(e=>new Uint8Array(e));return this._bufferLoaders.set(e,i),i}_validateAccessor(t){if(!this.json.accessors)throw new e(`gltf-loader-unsupported-feature`,`Accessors missing.`);let n=this.json.accessors[t];if(n.type in[`MAT2`,`MAT3`,`MAT4`])throw new e(`gltf-loader-unsupported-feature`,`AttributeType ${n.type} is not supported`);return n}_getComponentInfo(e,t){let n=Y[e.type],r=t?.componentType||e.componentType,i=X[r];return{componentType:r,componentCount:n,componentByteSize:i,denseByteStride:n*i}}getDracoAccessor(e,t){let n=this._validateAccessor(e),r=t.accessorInfos.get(e),{componentType:i,componentCount:a,componentByteSize:o,denseByteStride:s}=this._getComponentInfo(n,r);return{raw:t.data.buffer,byteStride:s,byteOffset:t.data.byteOffset+(r?.byteOffset||0),entryCount:r?.count??n.count,isDenselyPacked:!0,componentCount:a,componentByteSize:o,componentType:i,min:n.min,max:n.max,normalized:!!n.normalized}}async getAccessor(t,n){let r=this._validateAccessor(t);if(r?.bufferView==null)throw new e(`gltf-loader-unsupported-feature`,`Some accessor does not specify a bufferView.`);let{componentCount:i,componentByteSize:a,denseByteStride:o}=this._getComponentInfo(r),s=this.json.bufferViews[r.bufferView],c=await this.getBuffer(s.buffer,n),l=s.byteStride||o;return{raw:c.buffer,byteStride:l,byteOffset:c.byteOffset+(s.byteOffset||0)+(r.byteOffset||0),entryCount:r.count,isDenselyPacked:l===o,componentCount:i,componentByteSize:a,componentType:r.componentType,min:r.min,max:r.max,normalized:!!r.normalized}}async getIndexData(e,t,n){if(e.indices==null)return;let r=e.indices,i=n?this.getDracoAccessor(r,n):await this.getAccessor(r,t);if(i.isDenselyPacked)switch(i.componentType){case U.UNSIGNED_BYTE:return new Uint8Array(i.raw,i.byteOffset,i.entryCount);case U.UNSIGNED_SHORT:return new Uint16Array(i.raw,i.byteOffset,i.entryCount);case U.UNSIGNED_INT:return new Uint32Array(i.raw,i.byteOffset,i.entryCount)}else switch(i.componentType){case U.UNSIGNED_BYTE:return N(Q(D,i));case U.UNSIGNED_SHORT:return N(Q(E,i));case U.UNSIGNED_INT:return N(Q(T,i))}}async getPositionData(t,n,i){if(t.attributes.POSITION==null)throw new e(`gltf-loader-unsupported-feature`,`No POSITION vertex data found.`);let a=t.attributes.POSITION,o=i?this.getDracoAccessor(a,i):await this.getAccessor(a,n);if(o.componentType!==U.FLOAT)throw new e(`gltf-loader-unsupported-feature`,`Expected type FLOAT for POSITION vertex attribute, but found `+r(U,o.componentType));if(o.componentCount!==3)throw new e(`gltf-loader-unsupported-feature`,`POSITION vertex attribute must have 3 components, but found `+o.componentCount.toFixed());return Q(O,o)}async getNormalData(t,n,i){if(t.attributes.NORMAL==null)throw new e(`gltf-loader-error`,`No NORMAL vertex data found.`);let a=t.attributes.NORMAL,o=i?this.getDracoAccessor(a,i):await this.getAccessor(a,n);if(o.componentType!==U.FLOAT)throw new e(`gltf-loader-unsupported-feature`,`Expected type FLOAT for NORMAL vertex attribute, but found `+r(U,o.componentType));if(o.componentCount!==3)throw new e(`gltf-loader-unsupported-feature`,`NORMAL vertex attribute must have 3 components, but found `+o.componentCount.toFixed());return Q(O,o)}async getTangentData(t,n,i){if(t.attributes.TANGENT==null)throw new e(`gltf-loader-error`,`No TANGENT vertex data found.`);let a=t.attributes.TANGENT,o=i?this.getDracoAccessor(a,i):await this.getAccessor(a,n);if(o.componentType!==U.FLOAT)throw new e(`gltf-loader-unsupported-feature`,`Expected type FLOAT for TANGENT vertex attribute, but found `+r(U,o.componentType));if(o.componentCount!==4)throw new e(`gltf-loader-unsupported-feature`,`TANGENT vertex attribute must have 4 components, but found `+o.componentCount.toFixed());return Q(k,o)}async getTextureCoordinates(t,n,r){if(t.attributes.TEXCOORD_0==null)throw new e(`gltf-loader-error`,`No TEXCOORD_0 vertex data found.`);let i=t.attributes.TEXCOORD_0,a=r?this.getDracoAccessor(i,r):await this.getAccessor(i,n);if(a.componentCount!==2)throw new e(`gltf-loader-unsupported-feature`,`TEXCOORD_0 vertex attribute must have 2 components, but found `+a.componentCount.toFixed());if(a.componentType===U.FLOAT)return Q(y,a);if(!a.normalized)throw new e(`gltf-loader-unsupported-feature`,`Integer component types are only supported for a normalized accessor for TEXCOORD_0.`);return Z(a)}async getVertexColors(t,n,i){if(t.attributes.COLOR_0==null)throw new e(`gltf-loader-error`,`No COLOR_0 vertex data found.`);let a=t.attributes.COLOR_0,o=i?this.getDracoAccessor(a,i):await this.getAccessor(a,n);if(o.componentCount!==4&&o.componentCount!==3)throw new e(`gltf-loader-unsupported-feature`,`COLOR_0 attribute must have 3 or 4 components, but found `+o.componentCount.toFixed());if(o.componentCount===4){if(o.componentType===U.FLOAT)return Q(k,o);if(o.componentType===U.UNSIGNED_BYTE)return Q(A,o);if(o.componentType===U.UNSIGNED_SHORT)return Q(j,o)}else if(o.componentCount===3){if(o.componentType===U.FLOAT)return Q(O,o);if(o.componentType===U.UNSIGNED_BYTE)return Q(M,o);if(o.componentType===U.UNSIGNED_SHORT)return Q(ee,o)}throw new e(`gltf-loader-unsupported-feature`,`Unsupported component type for COLOR_0 attribute: `+r(U,o.componentType))}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,t,n,r){let i=e.material?this._materialCache.get(e.material):void 0;if(!i){let a=e.material==null?I():I(this.json.materials[e.material]),o=a.pbrMetallicRoughness,s=this.hasVertexColors(e),c=this.getTexture(o.baseColorTexture,t),l=this.getTexture(a.normalTexture,t),u=n?this.getTexture(a.occlusionTexture,t):void 0,d=r?this.getTexture(a.emissiveTexture,t):void 0,f=n?this.getTexture(o.metallicRoughnessTexture,t):void 0,[p,m,h,g,_]=await Promise.all([c,l,u,d,f]),v=e.material==null?-1:e.material;i={alphaMode:a.alphaMode,alphaCutoff:a.alphaCutoff,color:o.baseColorFactor,doubleSided:!!a.doubleSided,colorTexture:p,normalTexture:m,name:a.name,id:v,occlusionTexture:h,emissiveTexture:g,emissiveFactor:a.emissiveFactor,emissiveStrengthKHR:a.extensions?.KHR_materials_emissive_strength?.emissiveStrength,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,metallicRoughnessTexture:_,hasVertexColors:s,ESRI_externalColorMixMode:a.extras.ESRI_externalColorMixMode,colorTextureTransform:o?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:a.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:a.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:a.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:o?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:a.extras.ESRI_receiveAmbientOcclusion,receiveShadows:a.extras.ESRI_receiveShadows,unlit:!!a.extensions?.KHR_materials_unlit}}return i}async decode(t,n){let r=t.extensions?.KHR_draco_mesh_compression;if(!r)return;if(t.indices==null)throw new e(`gltf-loader-error`,`Found Draco compressed primitive without indices.`);let i=this.json.bufferViews[r.bufferView],a=await this.getBuffer(i.buffer,n),o=(await P()).decode(new Uint8Array(a.buffer,a.byteOffset+(i.byteOffset||0),i.byteLength));this._bufferLoaders.delete(i.buffer);let s=new Map([[t.indices,o.indices],[t.attributes.POSITION,o.positions]]);return t.attributes.TEXCOORD_0&&s.set(t.attributes.TEXCOORD_0,o.uvs),t.attributes.NORMAL&&s.set(t.attributes.NORMAL,o.normals),t.attributes.COLOR_0&&s.set(t.attributes.COLOR_0,o.colors),t.attributes.TANGENT&&s.set(t.attributes.TANGENT,o.tangents),this._dracoBuffersSize+=o.buffer.byteLength,{data:o.buffer,accessorInfos:s}}async getTexture(t,r){if(!t)return;if((t.texCoord||0)!==0)throw new e(`gltf-loader-unsupported-feature`,`Only TEXCOORD with index 0 is supported.`);let i=t.index,a=this.json.textures[i],o=L(a.sampler==null?{}:this.json.samplers[a.sampler]),s=$(a),c=this.json.images[s],l=await this._loadTextureImageData(i,a,r);return n(this._textureCache,i,()=>{let t=e=>e===33071||e===33648||e===10497,n=t=>{throw new e(`gltf-loader-error`,`Unexpected TextureSampler WrapMode: ${t}`)};return{data:l,wrapS:t(o.wrapS)?o.wrapS:n(o.wrapS),wrapT:t(o.wrapT)?o.wrapT:n(o.wrapT),minFilter:o.minFilter,name:c.name,id:i}})}getNodeTransform(e){if(e===void 0)return K;let t=this._nodeTransformCache.get(e);if(!t){let n=this.getNodeTransform(this._getNodeParent(e)),r=this.json.nodes[e];r.matrix?t=u(h(),n,r.matrix):r.translation||r.rotation||r.scale?(t=g(n),r.translation&&d(t,t,r.translation),r.rotation&&(J[3]=_(J,r.rotation),f(t,t,J[3],J)),r.scale&&p(t,t,r.scale)):t=g(n),this._nodeTransformCache.set(e,t)}return t}_resolveUri(e){return c(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){let e=l.parse(this.json.asset.version,`glTF`);q.validate(e)}_checkRequiredExtensionsSupported(){let t=this.json;if(t.extensionsRequired&&!t.extensionsRequired.every(e=>this._supportedExtensions.includes(e)))throw new e(`gltf-loader-unsupported-feature`,`gltf loader was not able to load unsupported feature. Required extensions: `+t.extensionsRequired.join(`, `))}_computeNodeParents(){this.json.nodes.forEach((e,t)=>{e.children&&e.children.forEach(e=>{this._nodeParentMap.set(e,t)})})}async _loadTextureImageData(e,t,n){let r=this._textureLoaders.get(e);if(r)return r;let i=this._createTextureLoader(t,n);return this._textureLoaders.set(e,i),i}async _createTextureLoader(t,n){let r=$(t),i=this.json.images[r];if(i.uri){if(i.uri.endsWith(`.ktx2`)){let e=await this._context.loadBinary(this._resolveUri(i.uri),n);return new B(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(i.uri),n)}if(i.bufferView==null)throw new e(`gltf-loader-unsupported-feature`,`Image bufferView must be defined.`);if(i.mimeType==null)throw new e(`gltf-loader-unsupported-feature`,`Image mimeType must be defined.`);let a=this.json.bufferViews[i.bufferView],o=await this.getBuffer(a.buffer,n);if(a.byteStride!=null)throw new e(`gltf-loader-unsupported-feature`,`byteStride not supported for image buffer`);let s=o.byteOffset+(a.byteOffset||0);return V(new Uint8Array(o.buffer,s,a.byteLength),i.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;let e=await i(Array.from(this._bufferLoaders.values())),t=await i(Array.from(this._textureLoaders.values()));return e.reduce((e,t)=>e+(t?.byteLength??0),0)+this._dracoBuffersSize+t.reduce((e,t)=>e+(t?H(t)?t.data.byteLength:t.width*t.height*4:0),0)}}const K=m(h(),Math.PI/2),q=new l(2,0,`glTF`),J=v(),Y={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},X={[U.BYTE]:1,[U.UNSIGNED_BYTE]:1,[U.SHORT]:2,[U.UNSIGNED_SHORT]:2,[U.HALF_FLOAT]:2,[U.FLOAT]:4,[U.INT]:4,[U.UNSIGNED_INT]:4};function Z(e){switch(e.componentType){case U.BYTE:return new w(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case U.UNSIGNED_BYTE:return new C(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case U.SHORT:return new S(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case U.UNSIGNED_SHORT:return new x(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case U.UNSIGNED_INT:return new b(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case U.FLOAT:return new y(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}function Q(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}function $(t){if(t.extensions?.KHR_texture_basisu!=null)return t.extensions.KHR_texture_basisu.source;if(t.source!==null)return t.source;throw new e(`gltf-loader-unsupported-feature`,`Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.`)}const te=/\.gltf$/i,ne=/\.glb$/i;export{G as GLTFResource,K as transformGltfToEngine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{EventEmitter as e}from"../../../../../core/Evented.js";import t from"../../../../../core/Handles.js";import{makeHandle as n,handlesGroup as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as i}from"../../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../../core/reactiveUtils.js";import{fromTranslation as s,fromZRotation as c,multiply as l,fromRotation as u,fromScaling as d}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as p}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as h,sm4d as g}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as _}from"../../Manipulator3D.js";import{RenderObject as v}from"../../RenderObject.js";import{screenToMapXYAtLocation as y}from"../dragEventPipeline3D.js";import{discRadius as b,discTranslateArrowOffset as x,discTranslateArrowSize as S,discHeight as C}from"./config.js";import{Manipulation as w}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as T}from"./moveUtils.js";import{createExtrudedTriangle as E,transformInPlace as D}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as O}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as k,dragAtLocation as A,constrainToMapAxis as j,addScreenDelta as M}from"../../../../interactive/dragEventPipeline.js";class N extends w{constructor(n){super(),this._handles=new t,this._arrowManipulatorInfos=[],this._angle=0,this._scale=1,this._radius=b,this._updateAfterDrag=!1,this.events=new e,this._tool=n.tool,this._view=n.view,this._opaqueMaterial=this._createMaterial(),this._transparentMaterial=this._createMaterial(.5),n.radius!=null&&(this._radius=n.radius),this._createManipulators(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}set orthogonalAvailable(e){this._arrowManipulatorInfos.length>=3&&(this._arrowManipulatorInfos[1].manipulator.available=e,this._arrowManipulatorInfos[3].manipulator.available=e)}destroy(){this._handles=i(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._arrowManipulatorInfos.length=0}forEachManipulator(e){for(let{manipulator:t}of this._arrowManipulatorInfos)e(t,1)}createManipulatedObjectDragPipeline(e,t,r){if(!t.operations)return n();let i=t.operations.data.spatialReference,a=t.graphic;return T(t,r,n=>this.createDragPipeline((t,r,i,a,o)=>({steps:r,cancel:i}=e(t,r,i,a,o),n(t,r,i)),t.elevationInfo,i,a))}createDragPipeline(e,t,n,i){return r(this._arrowManipulatorInfos.map(({manipulator:r},a)=>k(r,(r,o,s,c,l)=>{e(r,o.next(e=>({...e,manipulatorType:1})).next(A(this._view,r.elevationAlignedLocation)).next(y(this._view,r.elevationAlignedLocation,t,n,i)).next(j(r.location,this.angle+(a+1)*Math.PI*.5)).next(M()),s,c,l)})))}get angle(){return this._angle}set angle(e){this._angle=e,this.dragging?this._updateAfterDrag=!0:this._updateManipulatorTransform()}get displayScale(){return this._scale}set displayScale(e){this._scale=e,this._updateManipulatorTransform()}get radius(){return this._radius}set radius(e){this._radius!==e&&(this._radius=e,this._updateManipulators())}_updateManipulators(){for(let e=0;e<this._arrowManipulatorInfos.length;e++)this._updateArrowManipulator(this._arrowManipulatorInfos[e],e);this._updateManipulatorTransform()}_updateArrowManipulator({manipulator:e,transform:t},n){let r=this._radius/b,i=S*r,a=i*Math.sqrt(3)/2,o=E(this._opaqueMaterial,a,i/2,i/2,C);D(o,s(g.get(),p(h.get(),0,-a/3,0))),e.renderObjects=[new v(o,2),new v(o.instantiate({material:this._transparentMaterial}),1)],e.radius=a/3*2*1.2;let u=c(g.get(),n*Math.PI/2),d=s(g.get(),p(h.get(),0,x*r,0));l(t,u,d)}_createManipulators(){for(let e=0;e<4;e++){let t=this._createArrowManipulator(e);this._arrowManipulatorInfos.push(t)}this._updateManipulatorTransform()}_updateManipulatorTransform(){let e=this.angle,t=u(g.get(),e,m(0,0,1));if(t==null)return;let n=d(g.get(),p(h.get(),this.displayScale,this.displayScale,this.displayScale)),r=l(g.get(),n,t);for(let e of this._arrowManipulatorInfos){let t=l(g.get(),r,e.transform);e.manipulator.modelTransform=t}}_createArrowManipulator(e){let t=new _({view:this._view,autoScaleRenderObjects:!1,worldOriented:!0,focusMultiplier:1,touchMultiplier:1,collisionType:{type:`disc`,direction:m(0,0,1)}}),n={manipulator:t,transform:f()};return this._updateArrowManipulator(n,e),this._handles.add(t.events.on(`drag`,e=>{this._updateAfterDrag&&e.action===`end`&&!this.dragging&&(this._updateManipulatorTransform(),this._updateAfterDrag=!1)})),n}_createMaterial(e=1){let t=new O({cullFace:2,renderOccluded:2,isDecoration:!0});return this._handles.add(a(()=>this._view.effectiveTheme.accentColor.toUnitRGBA(),n=>{n[3]*=e,t.setParameters({color:n})},o)),t}get test(){}}export{N as MoveXYAxisManipulation};
|
|
2
|
+
import{EventEmitter as e}from"../../../../../core/Evented.js";import t from"../../../../../core/Handles.js";import{makeHandle as n,handlesGroup as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as i}from"../../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../../core/reactiveUtils.js";import{fromTranslation as s,fromZRotation as c,multiply as l,fromRotation as u,fromScaling as d}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as p}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as h,sm4d as g}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as _}from"../../Manipulator3D.js";import{RenderObject as v}from"../../RenderObject.js";import{screenToMapXYAtLocation as y}from"../dragEventPipeline3D.js";import{discRadius as b,discTranslateArrowOffset as x,discTranslateArrowSize as S,discHeight as C}from"./config.js";import{Manipulation as w}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as T}from"./moveUtils.js";import{createExtrudedTriangle as E,transformInPlace as D}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as O}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as k,dragAtLocation as A,constrainToMapAxis as j,addScreenDelta as M}from"../../../../interactive/dragEventPipeline.js";class N extends w{constructor(n){super(),this._handles=new t,this._arrowManipulatorInfos=[],this._angle=0,this._scale=1,this._radius=b,this._updateAfterDrag=!1,this.events=new e,this._tool=n.tool,this._view=n.view,this._opaqueMaterial=this._createMaterial(),this._transparentMaterial=this._createMaterial(.5),n.radius!=null&&(this._radius=n.radius),this._createManipulators(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}set orthogonalAvailable(e){this._arrowManipulatorInfos.length>=3&&(this._arrowManipulatorInfos[1].manipulator.available=e,this._arrowManipulatorInfos[3].manipulator.available=e)}destroy(){this._handles=i(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._arrowManipulatorInfos.length=0}forEachManipulator(e){for(let{manipulator:t}of this._arrowManipulatorInfos)e(t,1)}createManipulatedObjectDragPipeline(e,t,r){if(!t.operations)return n();let i=t.operations.data.spatialReference,a=t.graphic;return T(t,r,n=>this.createDragPipeline((t,r,i,a,o)=>({steps:r,cancel:i}=e(t,r,i,a,o),n(t,r,i)),t.elevationInfo,i,a))}createDragPipeline(e,t,n,i){return r(this._arrowManipulatorInfos.map(({manipulator:r},a)=>k(r,(r,o,s,c,l)=>{e(r,o.next(e=>({...e,manipulatorType:1})).next(A(this._view,r.elevationAlignedLocation)).next(y(this._view,r.elevationAlignedLocation,t,n,i)).next(j(r.location,this.angle+(a+1)*Math.PI*.5)).next(M()),s,c,l)})))}get angle(){return this._angle}set angle(e){this._angle=e,this.dragging?this._updateAfterDrag=!0:this._updateManipulatorTransform()}get displayScale(){return this._scale}set displayScale(e){this._scale=e,this._updateManipulatorTransform()}get radius(){return this._radius}set radius(e){this._radius!==e&&(this._radius=e,this._updateManipulators())}_updateManipulators(){for(let e=0;e<this._arrowManipulatorInfos.length;e++)this._updateArrowManipulator(this._arrowManipulatorInfos[e],e);this._updateManipulatorTransform()}_updateArrowManipulator({manipulator:e,transform:t},n){let r=this._radius/b,i=S*r,a=i*Math.sqrt(3)/2,o=E(this._opaqueMaterial,a,i/2,i/2,C);D(o,s(g.get(),p(h.get(),0,-a/3,0))),e.renderObjects=[new v(o,2),new v(o.instantiate({material:this._transparentMaterial}),1)],e.radius=a/3*2*1.2;let u=c(g.get(),n*Math.PI/2),d=s(g.get(),p(h.get(),0,x*r,0));l(t,u,d)}_createManipulators(){for(let e=0;e<4;e++){let t=this._createArrowManipulator(e);this._arrowManipulatorInfos.push(t)}this._updateManipulatorTransform()}_updateManipulatorTransform(){let e=this.angle,t=u(g.get(),e,m(0,0,1));if(t==null)return;let n=d(g.get(),p(h.get(),this.displayScale,this.displayScale,this.displayScale)),r=l(g.get(),n,t);for(let e of this._arrowManipulatorInfos){let t=l(g.get(),r,e.transform);e.manipulator.modelTransform=t}}_createArrowManipulator(e){let t=new _({view:this._view,autoScaleRenderObjects:!1,worldOriented:!0,focusMultiplier:1,touchMultiplier:1,collisionType:{type:`disc`,direction:m(0,0,1)}}),n={manipulator:t,transform:f()};return this._updateArrowManipulator(n,e),this._handles.add(t.events.on(`drag`,e=>{this._updateAfterDrag&&e.action===`end`&&!this.dragging&&(this._updateManipulatorTransform(),this._updateAfterDrag=!1)})),n}_createMaterial(e=1){let t=new O({cullFace:2,renderOccluded:2,isDecoration:!0},this._view.state.isGlobal);return this._handles.add(a(()=>this._view.effectiveTheme.accentColor.toUnitRGBA(),n=>{n[3]*=e,t.setParameters({color:n})},o)),t}get test(){}}export{N as MoveXYAxisManipulation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../../core/Handles.js";import{makeHandle as t}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{watch as r,initial as i}from"../../../../../core/reactiveUtils.js";import{fromScaling as a}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as l,sm4d as u}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as d}from"../../Manipulator3D.js";import{RenderObject as f}from"../../RenderObject.js";import{screenToMapXYAtLocation as p}from"../dragEventPipeline3D.js";import{discRadius as m,discCollisionRadius as h,geometrySegments as g,discHeight as _}from"./config.js";import{Manipulation as v}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as y}from"./moveUtils.js";import{SnapToScene as b}from"../snapping/SnapToScene.js";import{createCylinderGeometry as x}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as S}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as C,dragAtLocation as w,addScreenDelta as T}from"../../../../interactive/dragEventPipeline.js";class E extends v{constructor(t){super(),this._handles=new e,this._snapToScene=new b,this._scale=1,this._radius=m,this._view=t.view,this._tool=t.tool,this._discMaterial=this._createMaterial(),this._discMaterialTransparent=this._createMaterial(.5),t.snapToScene!=null&&(this.snapToScene=t.snapToScene),t.radius!=null&&(this._radius=t.radius),this._createManipulator(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._handles=n(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulator=null}forEachManipulator(e){e(this._manipulator,1)}get displayScale(){return this._scale}set displayScale(e){this._scale=e,this._updateManipulatorTransform()}get snapToScene(){return this._snapToScene.enabled}set snapToScene(e){this._snapToScene.enabled=e}get radius(){return this._radius}set radius(e){e!==this._radius&&(this._radius=e,this._updateManipulator())}get discManipulator(){return this._manipulator}createManipulatedObjectDragPipeline(e,n,r){if(!n.operations)return t();let i=n.graphic,a=n.elevationInfo,o=n.operations.data.spatialReference;return y(n,r,t=>this.createDragPipeline((n,r,i,a,o)=>({steps:r,cancel:i}=e(n,r,i,a,o),t(n,r,i)),a,o,i))}createDragPipeline(e,t,n,r){let i=this._view;return C(this._manipulator,(a,o,s,c,l)=>{e(a,o.next(w(i,a.elevationAlignedLocation)).next(p(i,a.elevationAlignedLocation,t,n,r)).next(...this._snapToScene.createDragEventPipelineStep(i,t)).next(e=>({...e,manipulatorType:1})).next(T()),s,c,l)})}_updateManipulatorTransform(){let e=a(u.get(),s(l.get(),this.displayScale,this.displayScale,this.displayScale));this._manipulator.modelTransform=e}_createManipulator(){let e=this._view;this._manipulator=new d({view:e,worldSized:!1,autoScaleRenderObjects:!1,focusMultiplier:1,touchMultiplier:1,collisionType:{type:`disc`,direction:c(0,0,1)},worldOriented:!0}),this._updateManipulator()}_updateManipulator(){let e=x(this._discMaterial,_,1,g,c(0,0,1),c(0,0,0));e.transformation=a(o(),c(this._radius,this._radius,this._radius)),this._manipulator.renderObjects=[new f(e,2),new f(e.instantiate({material:this._discMaterialTransparent}),1)],this._manipulator.radius=h*(this._radius/m)}_createMaterial(e=1){let t=new S({cullFace:2,renderOccluded:2,isDecoration:!0});return this._handles.add(r(()=>this._view.effectiveTheme.accentColor.toUnitRGBA(),n=>{n[3]*=e,t.setParameters({color:n})},i)),t}get test(){}}export{E as MoveXYDiscManipulation};
|
|
2
|
+
import e from"../../../../../core/Handles.js";import{makeHandle as t}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{watch as r,initial as i}from"../../../../../core/reactiveUtils.js";import{fromScaling as a}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as l,sm4d as u}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as d}from"../../Manipulator3D.js";import{RenderObject as f}from"../../RenderObject.js";import{screenToMapXYAtLocation as p}from"../dragEventPipeline3D.js";import{discRadius as m,discCollisionRadius as h,geometrySegments as g,discHeight as _}from"./config.js";import{Manipulation as v}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as y}from"./moveUtils.js";import{SnapToScene as b}from"../snapping/SnapToScene.js";import{createCylinderGeometry as x}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as S}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as C,dragAtLocation as w,addScreenDelta as T}from"../../../../interactive/dragEventPipeline.js";class E extends v{constructor(t){super(),this._handles=new e,this._snapToScene=new b,this._scale=1,this._radius=m,this._view=t.view,this._tool=t.tool,this._discMaterial=this._createMaterial(),this._discMaterialTransparent=this._createMaterial(.5),t.snapToScene!=null&&(this.snapToScene=t.snapToScene),t.radius!=null&&(this._radius=t.radius),this._createManipulator(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._handles=n(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulator=null}forEachManipulator(e){e(this._manipulator,1)}get displayScale(){return this._scale}set displayScale(e){this._scale=e,this._updateManipulatorTransform()}get snapToScene(){return this._snapToScene.enabled}set snapToScene(e){this._snapToScene.enabled=e}get radius(){return this._radius}set radius(e){e!==this._radius&&(this._radius=e,this._updateManipulator())}get discManipulator(){return this._manipulator}createManipulatedObjectDragPipeline(e,n,r){if(!n.operations)return t();let i=n.graphic,a=n.elevationInfo,o=n.operations.data.spatialReference;return y(n,r,t=>this.createDragPipeline((n,r,i,a,o)=>({steps:r,cancel:i}=e(n,r,i,a,o),t(n,r,i)),a,o,i))}createDragPipeline(e,t,n,r){let i=this._view;return C(this._manipulator,(a,o,s,c,l)=>{e(a,o.next(w(i,a.elevationAlignedLocation)).next(p(i,a.elevationAlignedLocation,t,n,r)).next(...this._snapToScene.createDragEventPipelineStep(i,t)).next(e=>({...e,manipulatorType:1})).next(T()),s,c,l)})}_updateManipulatorTransform(){let e=a(u.get(),s(l.get(),this.displayScale,this.displayScale,this.displayScale));this._manipulator.modelTransform=e}_createManipulator(){let e=this._view;this._manipulator=new d({view:e,worldSized:!1,autoScaleRenderObjects:!1,focusMultiplier:1,touchMultiplier:1,collisionType:{type:`disc`,direction:c(0,0,1)},worldOriented:!0}),this._updateManipulator()}_updateManipulator(){let e=x(this._discMaterial,_,1,g,c(0,0,1),c(0,0,0));e.transformation=a(o(),c(this._radius,this._radius,this._radius)),this._manipulator.renderObjects=[new f(e,2),new f(e.instantiate({material:this._discMaterialTransparent}),1)],this._manipulator.radius=h*(this._radius/m)}_createMaterial(e=1){let t=new S({cullFace:2,renderOccluded:2,isDecoration:!0},this._view.state.isGlobal);return this._handles.add(r(()=>this._view.effectiveTheme.accentColor.toUnitRGBA(),n=>{n[3]*=e,t.setParameters({color:n})},i)),t}get test(){}}export{E as MoveXYDiscManipulation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{darken as e}from"../../../../../core/colorUtils.js";import{EventEmitter as t}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{removeMaybe as i}from"../../../../../core/maybe.js";import{watch as a}from"../../../../../core/reactiveUtils.js";import{translate as o,rotateX as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{dist as l,subtract as u,normalize as d,dot as f,cross as p,scale as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as h,create as g}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as _}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as y}from"../../RenderObject.js";import{screenToZConstrained as b}from"../dragEventPipeline3D.js";import{Settings as x}from"../settings.js";import{discRadius as S}from"./config.js";import{Manipulation as C}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as w}from"./moveUtils.js";import{createTubeGeometry as T,createConeGeometry as E}from"../../../webgl-engine/lib/GeometryUtil.js";import{createManipulatorDragEventPipeline as D,addScreenDelta as O}from"../../../../interactive/dragEventPipeline.js";class k extends C{constructor(e){super(),this._radius=S,this.events=new t,this._tool=e.tool,this._view=e.view;let n=new x({getTheme:()=>this._view.effectiveTheme});this._settings=n,e.radius!=null&&(this._radius=e.radius);let r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(A(r,1,.25),1),materialFocused:v(A(r,1,0),1),materialOccludedUnfocused:v(A(r,.7,0),n.zManipulator.renderOccluded),materialOccludedFocused:v(A(r,.85,0),n.zManipulator.renderOccluded)},this._themeHandle=a(()=>this._view.effectiveTheme.accentColor,e=>{let t=A(e,1,.25),n=A(e,1,0),r=A(e,.7,0),i=A(e,.85,0),{materialUnfocused:a,materialFocused:o,materialOccludedUnfocused:s,materialOccludedFocused:c}=this._materials;a.setParameters({color:t}),o.setParameters({color:n}),s.setParameters({color:r}),c.setParameters({color:i})}),this._createManipulator(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._themeHandle=i(this._themeHandle),this._manipulator.applyObjectTransform=P,this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()})}forEachManipulator(e){e(this._manipulator,0)}createManipulatedObjectDragPipeline(e,t,r){if(!t.operations)return n();let i=t.operations.data.spatialReference;return w(t,r,t=>this.createDragPipeline((n,r,i,a,o)=>({steps:r,cancel:i}=e(n,r,i,a,o),t(n,r,i)),i))}createDragPipeline(e,t){let n=this._view;return D(this._manipulator,(r,i,a,o,s)=>{e(r,i.next(e=>({...e,manipulatorType:0})).next(b(n,r.renderLocation,t)).next(O()),a,o,s)})}get radius(){return this._radius}set radius(e){e!==this._radius&&(this._radius=e,this._updateManipulator())}_updateManipulator(){let e=this._settings,t=this._radius/S,n=e.zManipulator.height*t,r=e.zManipulator.coneHeight*t,i=e.zManipulator.coneWidth*t,a=e.zManipulator.width*t,l=[h(0,0,0),h(0,0,n)],u=[h(0,0,0),h(0,0,n+r)],d=c();o(d,d,[0,0,n]),s(d,d,Math.PI/2);let{materialUnfocused:f,materialFocused:p,materialOccludedUnfocused:m,materialOccludedFocused:g}=this._materials,_=T(f,l,a/2,16,!1),v=E(f,r,i/2,16,!1);v.transformation=d,this._manipulator.renderObjects=[new y(v,1),new y(_,1),new y(v.instantiate({material:p}),2),new y(_.instantiate({material:p}),2),new y(v.instantiate({material:m}),1),new y(_.instantiate({material:m}),1),new y(v.instantiate({material:g}),2),new y(_.instantiate({material:g}),2)],this._manipulator.radius=a/2+2,this._manipulator.collisionType={type:`line`,paths:[u]}}_createManipulator(){let e=this._view,t=new _({view:e,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:`ns-resize`,elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});t.applyObjectTransform=t=>{let n=e.state.camera,i=j;e.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,i);let a=l(n.eye,i),o=n.computeRenderPixelSizeAtDistance(a),s=u(M,i,n.eye);d(s,s);let c=N;e.renderCoordsHelper.worldUpAtPosition(j,c);let h=Math.abs(f(s,c)),g=p(M,s,c),_=p(M,g,c),v=r(h,.01,1),y=1-Math.sqrt(1-v*v)/v/n.fullWidth,b=this._settings,x=this._radius/S,C=b.zManipulator.width*x;m(_,d(_,_),(1/y-1)*a+o*C),t[12]-=M[0],t[13]-=M[1],t[14]-=M[2]},this._manipulator=t,this._updateManipulator()}get test(){}}function A(t,n,r){let i=e(t,r);return i.a*=n,i.toUnitRGBA()}const j=g(),M=g(),N=g(),P=()=>{};export{k as MoveZManipulation};
|
|
2
|
+
import{darken as e}from"../../../../../core/colorUtils.js";import{EventEmitter as t}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{removeMaybe as i}from"../../../../../core/maybe.js";import{watch as a}from"../../../../../core/reactiveUtils.js";import{translate as o,rotateX as s}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{dist as l,subtract as u,normalize as d,dot as f,cross as p,scale as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as h,create as g}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as _}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as y}from"../../RenderObject.js";import{screenToZConstrained as b}from"../dragEventPipeline3D.js";import{Settings as x}from"../settings.js";import{discRadius as S}from"./config.js";import{Manipulation as C}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as w}from"./moveUtils.js";import{createTubeGeometry as T,createConeGeometry as E}from"../../../webgl-engine/lib/GeometryUtil.js";import{createManipulatorDragEventPipeline as D,addScreenDelta as O}from"../../../../interactive/dragEventPipeline.js";class k extends C{constructor(e){super(),this._radius=S,this.events=new t,this._tool=e.tool,this._view=e.view;let n=new x({getTheme:()=>this._view.effectiveTheme});this._settings=n,e.radius!=null&&(this._radius=e.radius);let r=this._view.effectiveTheme.accentColor,i=e.view.state.isGlobal;this._materials={materialUnfocused:v(i,A(r,1,.25),1),materialFocused:v(i,A(r,1,0),1),materialOccludedUnfocused:v(i,A(r,.7,0),n.zManipulator.renderOccluded),materialOccludedFocused:v(i,A(r,.85,0),n.zManipulator.renderOccluded)},this._themeHandle=a(()=>this._view.effectiveTheme.accentColor,e=>{let t=A(e,1,.25),n=A(e,1,0),r=A(e,.7,0),i=A(e,.85,0),{materialUnfocused:a,materialFocused:o,materialOccludedUnfocused:s,materialOccludedFocused:c}=this._materials;a.setParameters({color:t}),o.setParameters({color:n}),s.setParameters({color:r}),c.setParameters({color:i})}),this._createManipulator(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._themeHandle=i(this._themeHandle),this._manipulator.applyObjectTransform=P,this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()})}forEachManipulator(e){e(this._manipulator,0)}createManipulatedObjectDragPipeline(e,t,r){if(!t.operations)return n();let i=t.operations.data.spatialReference;return w(t,r,t=>this.createDragPipeline((n,r,i,a,o)=>({steps:r,cancel:i}=e(n,r,i,a,o),t(n,r,i)),i))}createDragPipeline(e,t){let n=this._view;return D(this._manipulator,(r,i,a,o,s)=>{e(r,i.next(e=>({...e,manipulatorType:0})).next(b(n,r.renderLocation,t)).next(O()),a,o,s)})}get radius(){return this._radius}set radius(e){e!==this._radius&&(this._radius=e,this._updateManipulator())}_updateManipulator(){let e=this._settings,t=this._radius/S,n=e.zManipulator.height*t,r=e.zManipulator.coneHeight*t,i=e.zManipulator.coneWidth*t,a=e.zManipulator.width*t,l=[h(0,0,0),h(0,0,n)],u=[h(0,0,0),h(0,0,n+r)],d=c();o(d,d,[0,0,n]),s(d,d,Math.PI/2);let{materialUnfocused:f,materialFocused:p,materialOccludedUnfocused:m,materialOccludedFocused:g}=this._materials,_=T(f,l,a/2,16,!1),v=E(f,r,i/2,16,!1);v.transformation=d,this._manipulator.renderObjects=[new y(v,1),new y(_,1),new y(v.instantiate({material:p}),2),new y(_.instantiate({material:p}),2),new y(v.instantiate({material:m}),1),new y(_.instantiate({material:m}),1),new y(v.instantiate({material:g}),2),new y(_.instantiate({material:g}),2)],this._manipulator.radius=a/2+2,this._manipulator.collisionType={type:`line`,paths:[u]}}_createManipulator(){let e=this._view,t=new _({view:e,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:`ns-resize`,elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});t.applyObjectTransform=t=>{let n=e.state.camera,i=j;e.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,i);let a=l(n.eye,i),o=n.computeRenderPixelSizeAtDistance(a),s=u(M,i,n.eye);d(s,s);let c=N;e.renderCoordsHelper.worldUpAtPosition(j,c);let h=Math.abs(f(s,c)),g=p(M,s,c),_=p(M,g,c),v=r(h,.01,1),y=1-Math.sqrt(1-v*v)/v/n.fullWidth,b=this._settings,x=this._radius/S,C=b.zManipulator.width*x;m(_,d(_,_),(1/y-1)*a+o*C),t[12]-=M[0],t[13]-=M[1],t[14]-=M[2]},this._manipulator=t,this._updateManipulator()}get test(){}}function A(t,n,r){let i=e(t,r);return i.a*=n,i.toUnitRGBA()}const j=g(),M=g(),N=g(),P=()=>{};export{k as MoveZManipulation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
function e(e){if(e.graphic&&e.graphic.layer?.type!==`graphics`)return 1;let t=e.operations?.data.type;if(!t)return 3;switch(t){case`polygon`:case`point`:case`polyline`:case`mesh`:break;
|
|
2
|
+
function e(e){if(e.graphic&&e.graphic.layer?.type!==`graphics`)return 1;let t=e.operations?.data.type;if(!t)return 3;switch(t){case`polygon`:case`point`:case`polyline`:case`mesh`:break;default:return 3}return 0}export{e as isSupportedObject};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as n}from"../../../../../core/arrayUtils.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a,handlesGroup as o,destroyHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c,removeMaybe as l}from"../../../../../core/maybe.js";import{initial as u,on as d,watch as f,syncAndInitial as p,when as m,sync as h}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as y,subtract as b,lerp as x,set as ee,add as te,scale as ne}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as re,create as ie}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../../core/support/UpdatingHandles.js";import oe from"../../../../../geometry/Point.js";import se from"../../../../../geometry/Polyline.js";import{projectPoint as ce}from"../../../../../geometry/projectionUtils.js";import le from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as S}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as ue}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as de}from"../../../../../symbols/support/utils.js";import{Manipulator3D as C}from"../../Manipulator3D.js";import{createManipulatorMaterials as w,createSphereGeometryAsOffsets as T,placeAtObject as fe,screenSizeManipulatorSettings as pe}from"../../manipulatorUtils.js";import{RenderObject as E}from"../../RenderObject.js";import{SegmentLabels3D as me}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as he}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as D,screenToRenderPlaneFromEvent as ge,convertToMapCoordinates as _e}from"../dragEventPipeline3D.js";import{orientation as ve}from"../geometryUtils.js";import{canMoveZOperations as O}from"../manipulatorUtils.js";import{Settings as ye}from"../settings.js";import{createVisualElements as be}from"../visualElementUtils.js";import{discRadiusSmall as xe}from"../manipulations/config.js";import{MoveManipulation as k}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Se}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as A,createEdgeOffsetIntersectionPlane as j,createEdgeOffsetOperation as M,edgeOffsetRotationMatrix as Ce,screenEdgeLengthSquared as we,getDistanceInGeometrySR as Te}from"./edgeOffsetUtils.js";import{createTooltipInfos as Ee,connectTooltipToManipulatedObject as De,getUpdatedTranslateObjectTooltipInfo as Oe,getUpdatedEdgeOffsetTooltipInfo as N}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as P}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as ke}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as F}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as I}from"../../../../input/mouseButtons.js";import{sceneSnappingAtProjectedLocation as Ae,addMapDelta as L,createManipulatorDragEventPipeline as R,dragAtLocation as z,addScreenDelta as je,sceneSnappingAtLocation as Me}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as Ne}from"../../../../interactive/keybindings.js";import{SnappingContext as B}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as V}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Pe,enterInputModeIfAvailable as H}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Fe}from"../../../../support/GeometryWorkerHandle.js";const U=Symbol(),W=Symbol(),G=Symbol(),Ie=Symbol(),K=Symbol();let q=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(K)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new i,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new ae,this._recreatingManipulators=!1,this._settings=new ye({getTheme:()=>this.view.effectiveTheme}),this.events=new r,this.activeTooltipInfo=null,this._measurementWorker=new Fe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit(`reshape`,{type:`reshape`,object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit(`move`,{type:`move`,object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,n=t.vertex;this.tooltipInfos=Ee(this._toolOptions,e),this._vertexManipulatorMaterials=w({color:n.color.toUnitRGBA(),outlineColor:n.outlineColor.toUnitRGBA(),focusedOutlineColor:n.focusedOutlineColor.toUnitRGBA(),screenSize:n,renderOccluded:n.renderOccluded});let r=t.edge;this._edgeManipulatorMaterials=w({color:r.color.toUnitRGBA(),outlineColor:r.outlineColor.toUnitRGBA(),screenSize:r,renderOccluded:r.renderOccluded});let i=t.edgeOffset;this._edgeOffsetManipulatorMaterials=w({color:i.color.toUnitRGBA(),focusedColor:i.focusedColor.toUnitRGBA(),renderOccluded:i.renderOccluded,shaded:!1});let a=t.selected;this._selectedManipulatorMaterials=w({color:a.color.toUnitRGBA(),outlineColor:a.outlineColor.toUnitRGBA(),focusedOutlineColor:a.focusedOutlineColor.toUnitRGBA(),screenSize:a,renderOccluded:a.renderOccluded}),this.tooltip=Pe(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:n,selectedSettings:r})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),n.applyColor(this._edgeOffsetManipulatorMaterials.material),n.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),r.applyColor(this._selectedManipulatorMaterials.material),r.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),r.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,Y(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:n})=>{e!=null&&(e.visible=t,e.edgeDistance=n?`far`:`default`)},u),De(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{t===`input`&&e!==`input`&&this._resetTooltip()}),d(()=>this._operations,`vertex-update`,e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),d(()=>this._operations?.data,`change`,e=>{(e.operation===`undo`||e.operation===`redo`)&&this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=c(this._segmentLabels),this.tooltip=c(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return e.type!==`key-down`||e.key!==Ne.enterInputMode?!1:this.activeTooltipInfo?.type===`reshape-edge-offset`?this._enterInputModeDuringEdgeOffset(e):H(e,this.tooltip)?(this.tool.endDrag(),!0):!1}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type===`vertex`);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit(`manipulators-changed`)}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(G),this.removeHandles(W),this.removeHandles(K),this._moveManipulation=c(this._moveManipulation),this._objectMoveManipulation=c(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._pendingEdgeOffsetInfo&&this._exitEdgeOffsetInputMode()}_createManipulators(e){if(this._operations==null)return;let t=this.object.elevationInfo;for(let{vertices:n,segments:r,index:i}of this._operations.data.parts){let a=e?.byPartIndex.get(i);for(let e of n){let n=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,n)}for(let e of r)e.type===`line`&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit(`undo`),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=c(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._toolOptions.labels;this._segmentLabels=new me({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if(t.action===`end`)return t;let n=0,r=[],i=e===1&&this._someVerticesSelected;for(let e of this._manipulatorInfos)e.type===`vertex`&&(e.manipulator.grabbing||i&&!e.manipulator.selected||r.push(e),n++);if(r.length===n){if(i||this._hideReshapeControls(),this._moveVertices(r,t),this._updateEventState(1),this.destroyed)return t;this.events.emit(`move`,{type:`move`,dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(r,t),this._updateEventState(2),this.destroyed)return t;this.events.emit(`reshape`,{type:`reshape`,object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),a(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],K)}_showReshapeControls(){this.removeHandles(K)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){let t=this._manipulatorInfos.filter(Y).find(t=>t.manipulator===e||t.edgeManipulator===e);t!=null&&(this.removeHandles(W),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],W))}_hideReshapeManipulators(e){return o(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Y(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(U):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,U)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>t.type===`vertex`&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:n,mapDeltaZ:r}=e;if(!t&&!n&&!r)return;let i=[];this._forEachVertex(t=>{let{selected:n,grabbing:r}=t.manipulator;(n&&!r||t===e.info)&&i.push(t)}),this._moveVertices(i,e,1),this.events.emit(`reshape`,{type:`reshape`,object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(this._numGrabbing!==0||this._numDragging!==0))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object}),this.destroyed||this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit(`reshape`,{type:`reshape-start`,object:this.object});break;case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit(`reshape`,{type:`reshape-start`,object:this.object})}}if(this.destroyed)return!1;let n=this._reshapeEventState!==e;return this._reshapeEventState=e,n}_createObjectMoveManipulation(){let{tool:e,view:t,object:n,_operations:r}=this;if(r){if(this._objectMoveManipulation=new Se({tool:e,view:t,object:n}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,n,i)=>{n.next(e=>this._trackNumDragging(e)).next(t=>(t.action===`start`&&(e=r.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{t.action===`end`&&(this._showReshapeControls(),this._resetTooltip(),e=l(e))}),i.next(()=>this._onDragCancel(!0,()=>e=l(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on(`immediate-click`,e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:n,view:r,_operations:i}=this;if(!i)return;this._moveManipulation=new k({tool:n,view:r,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&O(t.operations,t.elevationInfo),snapToScene:!1,radius:k.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on(`immediate-click`,t=>{!this._moveManipulation.zManipulation.hasManipulator(e)&&!this._manipulatorInfos.some(e=>e.manipulator.selected)&&this.events.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let a=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(a(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(a(1)),this._moveManipulation.zManipulation.forEachManipulator(a(2)),this._moveManipulation.elevationInfo={mode:`absolute-height`,offset:0};let o=i.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((r,a,o,s,c)=>{let{snappingStep:l,cancelSnapping:u}=V({predicate:e=>!!e.info,snappingManager:n.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:e,pointer:c,excludeFeature:t.graphic,visualizer:new he}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next(e=>(this._onDragCancel(),e)).next(u),o=o.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.manipulatorType===1&&t.length===1?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(Ae(this.view,e)).next(...l).next(L()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(e.action===`end`&&this._showReshapeControls(),this._updateTranslateTooltip(r,e),e)),{steps:o,cancel:s}},e,o,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),u),t.on(`committed`,()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(Ie),e&&this.addHandles(ke({view:this.view,geometry:()=>t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),Ie)},u)])}_createVisualElements(){let{object:e,view:t}=this,n=be({view:t,object:e,forEachManipulator:e=>{if(!(this.destroyed||this._recreatingManipulators)){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(let t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on(`manipulators-changed`,e)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof P?n.visualElement:null);let r=this._outlineVisualElement;if(r!=null){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(d(()=>r.events,`attachment-origin-changed`,t,{onListenerAdd:t}))}this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let n=this.view,r=this._operations;if(e.part.vertices.length<=2||!r)return null;let i=r.data.spatialReference,a=this._settings.manipulators.edgeOffset,s=a.size/2,c=s+a.collisionPadding,l=s/c,u=l/2,d=l*Math.sqrt(3)/2,{height:f,offset:p}=a,{material:m,focusedMaterial:h}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){let e=F(m,d,u,u,f,p);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=F(m,-d,u,u,f,-p);this._edgeOffsetManipulatorGeometryOutside=e}let g=[new E(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new E(this._edgeOffsetManipulatorGeometryInside.instantiate({material:h}),2),new E(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new E(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:h}),2)],_=new C({view:n,renderObjects:g,elevationInfo:t.mode===`on-the-ground`&&!de(this.object.graphic?.symbol)?t:{mode:`absolute-height`,offset:0},worldOriented:!1,focusMultiplier:1,radius:c,available:this.object.visible,collisionType:{type:`disc`,direction:re(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:J(i)}),v=new C({view:n,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?`move`:`default`,metadata:{deleting:!1},location:J(i)}),y={manipulator:_,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(y,a.minSquaredEdgeLength);let b=()=>this._updateEdgeOffsetManipulator(y);b(),y.locationUpdateHandle=o([e.leftVertex,e.rightVertex].map(e=>this._getManipulatorInfoFromHandle(e)?.manipulator.events.on(`location-update`,b)));let x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([y.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),R(_,this._createEdgeOffsetPipeline(y,t,r)),R(v,this._createEdgePipeline(y,t,r)),v.events.on(`immediate-click`,x),_.events.on(`immediate-click`,x),_.events.on(`focus-changed`,()=>this._resetTooltip()),_.events.on(`grab-changed`,({screenPoint:e,action:t})=>{y.grabMapPoint=t===`start`?A(e,this.view,this.object,y):null})],_),this._manipulatorInfos.push(y),this.manipulators.addMany([_,v]),this.events.emit(`manipulators-changed`),y}_autoHideEdgeOffsetManipulator(e,t){let n=e.manipulator,r=e.edgeManipulator,i=()=>{e.visibilityHandle=l(e.visibilityHandle);let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),s=this._getManipulatorInfoFromHandle(e.handle.rightVertex),c=i!=null&&s!=null&&we(i.manipulator.renderLocation,s.manipulator.renderLocation,this.view.state.camera)<t;(!n.focused&&!r.focused||c)&&(n.grabbable=!c,r.grabbable=!c,e.visibilityHandle=o([n.disableDisplay(),a(()=>{n.grabbable=!0,r.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([n.events.on(`focus-changed`,i),r.events.on(`focus-changed`,i),a(()=>{l(e.visibilityHandle),r.metadata.deleting=!0,this.manipulators.remove(r)})],n),i()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,n=j(this.view,e.manipulator.elevationAlignedLocation,M(t,e.handle,e.manipulator.elevationInfo)),r=this._getManipulatorInfoFromHandle(e.handle.leftVertex),i=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(r==null||i==null)return;let a=r.manipulator.renderLocation,o=i.manipulator.renderLocation,s=n==null?v:Ce(n,a,o);e.manipulator.modelTransform=s,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=s;let c=y(b(Z,a,o))/2;e.edgeManipulator.collisionType={type:`line`,paths:[[[-c,0,0],[c,0,0]]]}}_createEdgePipeline(e,t,n){return(r,i,a,o)=>{if(o===`touch`)this._createEdgeOffsetPipeline(e,t,n)(r,i,a);else if(this.enableMoveObject){let e=this.object.graphic,o=n.data.spatialReference,{elevationAlignedLocation:s}=r;i.next(e=>this._trackNumDragging(e)).next(z(this.view,s)).next(D(this.view,s,t,o,e)).next(je()).next(L()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{e.action===`end`&&(this._showReshapeControls(),this._resetTooltip())}),a.next(()=>this._onDragCancel(!r.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,n){return(r,i,a)=>{let o=this._pendingEdgeOffsetInfo;if(o?.manipulatorInfo===e&&o.mode!==`drag`){a.execute({action:`cancel`});return}this._clearSelection();let{initializeStep:s,cleanup:c}=this._initializeEdgeOffset(e,t,n,a),l=this._applyEdgeOffsetStep(e);i.next(e=>this._trackNumDragging(e)).next(z(this.view,r.elevationAlignedLocation)).next(s).next(ge(this.view)).next(_e(this.view,n.data.spatialReference)).next(L()).next(Le()).next(e=>this._pendingEdgeOffsetInfo?e:l(e)).next(e=>{e.action===`end`&&!this._pendingEdgeOffsetInfo&&c()}),a.next(()=>{this._exitEdgeOffsetInputMode(),r.metadata.deleting||(c(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,n,r){let{view:i,object:a}=this,o=M(n.data.coordinateHelper,e.handle,t),s=n.createUndoGroup(),c=j(i,e.manipulator.elevationAlignedLocation,o);this._splitEdgesBeforeEdgeOffset(e,o),this._selectEdgeOffsetArrow(e,o);let l=()=>{this._cleanEdgeOffsetCollapsedEdges(e,n),this.removeHandles(G)},u=this.events.on(`undo`,l);return this.addHandles([this._initializeEdgeOffsetVisualElement(e,a,t,n),s,u,this._connectEdgeOffsetTooltip(e,o,n,()=>{r.execute({action:`cancel`})})],G),{initializeStep:e=>o==null||c==null?(l(),null):{...e,operation:o,plane:c},cleanup:l}}_initializeEdgeOffsetVisualElement(e,t,n,r){let i=()=>new se({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:r.data.spatialReference}),a=new P({view:this.view,isDraped:t.isDraped,geometry:i(),elevationInfo:n,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),c=o([f(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{a.color=e.toUnitRGBA(),a.isDraped=t},p),t.on(`committed`,()=>{a.geometry=i()}),s(a)]);return a.attached=!0,c}_applyEdgeOffsetStep(e){return t=>(this.destroyed||t.operation==null||!this._operations||(this._updateEventState(2),t.signedDistance==null?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit(`reshape`,{type:`reshape`,object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let n=e.handle.leftVertex.leftSegment?.leftVertex,r=e.handle.leftVertex,i=e.handle.rightVertex.rightSegment?.rightVertex,a=e.handle.rightVertex,o=t.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(r.pos),o.spatialReference),c=[];if(n&&o.distance(n.pos,r.pos)<ze){let e=this._getManipulatorInfoFromHandle(r);e!=null&&c.push(e)}if(o.distance(r.pos,a.pos)<s||i&&o.distance(i.pos,a.pos)<ze){let e=this._getManipulatorInfoFromHandle(a);e!=null&&c.push(e)}c.length&&this._removeVertices(c)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return t&&H(e,this.tooltip)?t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`drag`},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`hover`},this._connectEdgeOffsetTooltipOnHover(t),!0):!1}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Y).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:n}=this;if(!t)return;let{elevationInfo:r}=n,i=M(t.data.coordinateHelper,e.handle,r);this._selectEdgeOffsetArrow(e,i),this.addHandles([this._initializeEdgeOffsetVisualElement(e,n,r,t),this._connectEdgeOffsetTooltip(e,i,t,()=>{this.removeHandles(G),this._exitEdgeOffsetInputMode()})],G)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);t!=null&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);t!=null&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let n=e.grabMapPoint??A(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);n&&t.selectArrowFromStartPoint(n)}_connectEdgeOffsetTooltip(e,t,n,r){let i=()=>this.tooltipInfos.edgeOffset.distance.actual,a=i=>{r(),queueMicrotask(()=>{this.view.focus();let r=n.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,Te(i,e.manipulator.location,t,n)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,n),r.remove()})},s=()=>{let e=i();e==null?r():a(e)};return o([m(()=>this.tooltip&&!this.tooltip.focused,()=>s(),h),this.tooltip.on(`discard`,r),this.tooltip.on(`commit`,e=>{e.type===`commit-and-exit`&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,n=!1){let r=this.view,i=this._operations;if(!i)return null;let a=i.data.type,s=i.data.spatialReference;if(e.type===`line`){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(this._vertexManipulatorGeometry==null||this._vertexManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=T(e),this._vertexManipulatorOutlineGeometry=T(t)}if(this._edgeManipulatorGeometry==null||this._edgeManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=T(e),this._edgeManipulatorOutlineGeometry=T(t)}let c=this._vertexManipulatorGeometry,u=this._vertexManipulatorOutlineGeometry,d=[];if(a!==`point`&&a!==`mesh`){d.push(new E(c.instantiate(),Q|4),new E(u.instantiate(),Q|5),new E(u.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),Q|6));{let{material:e,outlineMaterial:t,focusedMaterial:n}=this._selectedManipulatorMaterials;d.push(new E(c.instantiate({material:e}),8),new E(u.instantiate({material:t}),9),new E(u.instantiate({material:n}),10))}}if(this.enableMidpoints){let{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,n=this._edgeManipulatorGeometry,r=this._edgeManipulatorOutlineGeometry,i=$|6,a=$|5;d.push(new E(n.instantiate({material:e}),i),new E(r.instantiate({material:t}),i),new E(n.instantiate(),a),new E(r.instantiate(),a))}let f=e.type===`vertex`,p=new C({view:r,renderObjects:d,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:a===`point`||a===`mesh`,available:this.object.visible,metadata:{deleting:!1},location:J(s),...pe});p.selected=n,this._setTypeSpecificManipulatorSettings(p,e,t);let m=f?{manipulator:p,handle:e,type:`vertex`,selectedIndex:0}:{manipulator:p,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(p),this._updateManipulatorPosition(m),m.type===`edge`){let e=[];for(let t of[m.handle.leftVertex,m.handle.rightVertex]){let n=this._getManipulatorInfoFromHandle(t);n!=null&&e.push(n.manipulator.events.on(`location-update`,()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=o(e),this._manipulatorHandles.add(m.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);let h=R(p,(e,n,a,o)=>{let c=null,{snappingStep:u,cancelSnapping:d}=V({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:t,pointer:o,excludeFeature:this.object.graphic,visualizer:new he}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});a.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>c=l(c)),t)).next(d);let{elevationAlignedLocation:f}=e,p=this.object.graphic??void 0,h=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,i,p):D(r,f,t,s,p);n.next(e=>this._trackNumDragging(e)).next(e=>{if(e.action===`start`&&i&&(c=i.createUndoGroup()),m.type===`edge`){let t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(z(r,f)).next(h).next(Me(r,t,p)).next(...u).next(L()).next(e=>{this._perVertexManipulatorDragAction(e),e.action===`end`&&(c=l(c)),this._resetTooltip()})});return this._manipulatorHandles.add([h,p.events.on(`immediate-click`,e=>this._manipulatorClickCallback(e,m)),p.events.on(`select-changed`,()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),p.events.on(`focus-changed`,()=>{this._resetTooltip()})],p),this.events.emit(`manipulators-changed`),m}_screenToSceneMapForVertexDrag(e,t,n){let{view:r}=this,{coordinateHelper:i,spatialReference:a}=t.data,o=null;return t=>{if(t.action===`start`&&(o=i.vectorToPoint(t.snapOrigin)),o==null)return null;let s=r.toMap(t.screenEnd,{exclude:n,excludeLabels:!0});return s==null||(s.z=ue(s,r,e),!ce(s,s,a))?null:{...t,mapStart:o,mapEnd:s}}}_trackNumDragging(e){switch(e.action){case`start`:this._numDragging++;break;case`end`:this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit(`move`,{type:`move`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape`,object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,n){let r=this._settings;switch(t.type){case`vertex`:{e.selectable=!0,e.cursor=`move`,e.collisionPriority=2,e.elevationInfo=n;let t=this._operations?.data.type;e.interactive=t!=null&&t!==`point`&&t!==`mesh`;let{size:i,collisionPadding:a}=r.manipulators.vertex;e.radius=i/2+a,e.state=Q;break}case`line`:{e.state=$,e.selectable=!1,e.cursor=`copy`,e.collisionPriority=2;let{size:t,collisionPadding:i}=r.manipulators.edge;e.radius=t/2+i,e.elevationInfo=n.mode===`on-the-ground`&&!de(this.object.graphic?.symbol)?n:{mode:`absolute-height`,offset:0};break}}}_watchAndUpdateGrabState(e,t){return e.events.on(`grab-changed`,n=>{this._onGrabStateChanged(e,t,n.action,n.pointerType)})}_onGrabStateChanged(e,t,n,r=`mouse`){if(!this._recreatingManipulators){if(n===`start`)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(W),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(r!==`touch`||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,n=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&n!=null&&n!==`point`&&n!==`mesh`,Y(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit(`manipulators-changed`))}_removeManipulator(e){e!=null&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),n(this._manipulatorInfos,e),this.events.emit(`manipulators-changed`),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(e!=null&&t){if(e.type===`vertex`)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,X),e.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if(e.type===`edge`){let n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(n==null||r==null)return;let i=n.manipulator,a=r.manipulator;if(e.manipulator.elevationInfo?.mode===`on-the-ground`){let n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),c=n.y+o*(r.y-n.y),l=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=S(s,c,l,t.data.spatialReference)}else x(Z,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Z}}}_splitEdgeManipulator(e,t=.5){let n=this._operations,r=n.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=l(e.locationUpdateHandle);let i=this.object.elevationInfo,a;this.enableEdgeOffset?(this._removeManipulator(e),a=this._createVertexOrEdgeManipulator(r)):(a=e,a.handle=r,a.type=`vertex`,this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,i)),r.leftSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.leftSegment),r.rightSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.rightSegment),this._updateManipulatorPosition(a),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let o=this._updateEventState(2),s=n.data.coordinateHelper.vectorToArray(a.handle.pos),c=n.data.parts.indexOf(r.part);return this.events.emit(`vertex-add`,{type:`vertex-add`,object:this.object,vertices:[{coordinates:s,componentIndex:c,vertexIndex:r.index}],added:s}),o&&this._updateEventState(0),a}_updateMoveManipulationPosition(){let e=ee(Z,0,0,0),t=0,n=!1,r=null,i=null;for(let a of this._manipulatorInfos)a.type===`vertex`&&(a.manipulator.selected?(t++,te(e,e,a.manipulator.renderLocation),r==null||a.selectedIndex>r.selectedIndex?(i=r,r=a):(i==null||a.selectedIndex>i.selectedIndex)&&(i=a)):n=!0);let a=this.object,o=this._operations?.data.geometry;if(t===0){let e=a.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&O(this._operations,a.elevationInfo),this._moveManipulation.angle=ve(o),this._moveManipulation.radius=k.radiusForSymbol(a.graphic?.symbol)}else{let e=a.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&O(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&t!==1;let n=0;if(r!=null){let e=r.handle.pos,t=i==null?r.handle.leftSegment?.leftVertex?r.handle.leftSegment.leftVertex.pos:null:i.handle.pos,a=i==null&&r.handle.rightSegment?.rightVertex?r.handle.rightSegment.rightVertex.pos:null;t&&a?this._moveManipulation.xyAxisManipulation.available=!1:t?n=Re(t,e):a&&(n=Re(e,a))}this._moveManipulation.angle=n,this._moveManipulation.radius=xe}t!==0&&n?(ne(e,e,1/t),X.spatialReference=this._operations.data.spatialReference,X.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,X),this._moveManipulation.elevationAlignedLocation=X):this._outlineVisualElement!=null&&!this.object.isDraped&&this._outlineVisualElement.attachmentOrigin!=null?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:fe(this._moveManipulation,this.object)}_removeVertices(e){let t=[],n=this._operations;if(!n)return;let r=e.filter(e=>e.type===`vertex`&&n.canRemoveVertex(e.handle.part));if(r.length>0){let e=this._createBeforeVertexRemoveEvent(r);if(this.events.emit(`before-vertex-remove`,e),e.defaultPrevented)return}for(let e of r){let r=e.handle.part;if(n.canRemoveVertex(r)){t.push(e.handle),this._removeManipulator(e),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightSegment));let i=n.removeVertices([e.handle]).removedVertices?.[0].createdSegment;i&&i.type===`line`?this._createVertexOrEdgeManipulator(i):this.enableEdgeOffset&&r.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(r.segments[0]))}}if(t.length>0){let e=t.map(e=>{let t=n.data.parts.indexOf(e.part);return{coordinates:n.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),r=this._updateEventState(2);if(this.destroyed||(this.events.emit(`vertex-remove`,{type:`vertex-remove`,object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||r&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){let t=this._operations,n=e.map(e=>{let n=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:n,vertexIndex:e.handle.index}}),r=!1;return{type:`before-vertex-remove`,object:this.object,removed:n.map(e=>e.coordinates),vertices:n,get defaultPrevented(){return r},preventDefault(){r=!0}}}_moveVertices(e,t,n=t.action===`start`?0:1){let r=this._operations;if(r&&(e.length>0&&r.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,n),!this._movingManipulatorsHidden))for(let t of e)this._updateManipulatorPosition(t)}_offsetEdge(e,t,n){if(!this._operations)return;let r=t.clone();r.distance=n,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],r),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),t.type===`vertex`&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===I.Right&&this._removeVertices([t])),t.type===`edge`&&e.button===I.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){this._defaultTooltipInfo==null?this._updateTranslateObjectTooltip(e,t):this._resetTooltip()}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=Oe(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=N(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&e?.type===`reshape-edge-offset`)return;let t=null;t=this._pendingEdgeOffsetInfo||this._findActiveEdgeOffsetManipulatorInfo()!=null?N(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(e==null||t==null||this.tooltip.mode!==`input`)&&(this.activeTooltipInfo=t)}get _defaultTooltipInfo(){switch(this._operations?.data.type){case`polyline`:case`polygon`:return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case`point`:case`mesh`:return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.length===1?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>e.type===`vertex`&&e.manipulator.selected)}_forEachVertex(e){for(let t of this._manipulatorInfos)t.type===`vertex`&&e(t)}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};e([g()],q.prototype,`_numGrabbing`,void 0),e([g()],q.prototype,`_numDragging`,void 0),e([g()],q.prototype,`_pendingEdgeOffsetInfo`,void 0),e([g()],q.prototype,`_operations`,null),e([g()],q.prototype,`_segmentLabels`,void 0),e([g({constructOnly:!0})],q.prototype,`tool`,void 0),e([g()],q.prototype,`tooltip`,void 0),e([g()],q.prototype,`activeTooltipInfo`,void 0),e([g({readOnly:!0})],q.prototype,`updating`,null),e([g()],q.prototype,`manipulators`,null),e([g()],q.prototype,`view`,null),e([g()],q.prototype,`object`,null),e([g()],q.prototype,`enableZShape`,null),e([g()],q.prototype,`enableDeleteVertices`,null),e([g()],q.prototype,`enableZVertex`,null),e([g()],q.prototype,`autoHideManipulators`,null),e([g()],q.prototype,`enableMoveObject`,null),e([g()],q.prototype,`enableMidpoints`,null),e([g()],q.prototype,`enableEdgeOffset`,null),e([g()],q.prototype,`_toolOptions`,null),e([g()],q.prototype,`_accentColor`,null),e([g()],q.prototype,`_tooltipsContext`,null),q=e([_(`esri.views.3d.interactive.editingTools.reshape.ReshapeOperation`)],q);function Le(){return e=>{let{operation:t,mapEnd:n}=e;return t==null||n==null?e:{...e,signedDistance:t.signedDistanceToPoint(n)}}}function Re(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function J(e){return new oe({x:0,y:0,z:0,spatialReference:e})}function Y(e){return e.type===`edge`&&`edgeManipulator`in e}const X=S(0,0,void 0,le.WGS84),Z=ie(),ze=1e-6,Q=16,$=32;export{q as ReshapeOperation};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as n}from"../../../../../core/arrayUtils.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a,handlesGroup as o,destroyHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c,removeMaybe as l}from"../../../../../core/maybe.js";import{initial as u,on as d,watch as f,syncAndInitial as p,when as m,sync as h}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as y,subtract as b,lerp as x,set as ee,add as te,scale as ne}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as re,create as ie}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../../core/support/UpdatingHandles.js";import oe from"../../../../../geometry/Point.js";import se from"../../../../../geometry/Polyline.js";import{projectPoint as ce}from"../../../../../geometry/projectionUtils.js";import le from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as S}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as ue}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as de}from"../../../../../symbols/support/utils.js";import{Manipulator3D as C}from"../../Manipulator3D.js";import{createManipulatorMaterials as w,createSphereGeometryAsOffsets as T,placeAtObject as fe,screenSizeManipulatorSettings as pe}from"../../manipulatorUtils.js";import{RenderObject as E}from"../../RenderObject.js";import{SegmentLabels3D as me}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as he}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as D,screenToRenderPlaneFromEvent as ge,convertToMapCoordinates as _e}from"../dragEventPipeline3D.js";import{orientation as ve}from"../geometryUtils.js";import{canMoveZOperations as O}from"../manipulatorUtils.js";import{Settings as ye}from"../settings.js";import{createVisualElements as be}from"../visualElementUtils.js";import{discRadiusSmall as xe}from"../manipulations/config.js";import{MoveManipulation as k}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Se}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as A,createEdgeOffsetIntersectionPlane as j,createEdgeOffsetOperation as M,edgeOffsetRotationMatrix as Ce,screenEdgeLengthSquared as we,getDistanceInGeometrySR as Te}from"./edgeOffsetUtils.js";import{createTooltipInfos as Ee,connectTooltipToManipulatedObject as De,getUpdatedTranslateObjectTooltipInfo as Oe,getUpdatedEdgeOffsetTooltipInfo as N}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as P}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as ke}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as F}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as I}from"../../../../input/mouseButtons.js";import{sceneSnappingAtProjectedLocation as Ae,addMapDelta as L,createManipulatorDragEventPipeline as R,dragAtLocation as z,addScreenDelta as je,sceneSnappingAtLocation as Me}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as Ne}from"../../../../interactive/keybindings.js";import{SnappingContext as B}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as V}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Pe,enterInputModeIfAvailable as H}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Fe}from"../../../../support/GeometryWorkerHandle.js";const U=Symbol(),W=Symbol(),G=Symbol(),Ie=Symbol(),K=Symbol();let q=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(K)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new i,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new ae,this._recreatingManipulators=!1,this._settings=new ye({getTheme:()=>this.view.effectiveTheme}),this.events=new r,this.activeTooltipInfo=null,this._measurementWorker=new Fe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit(`reshape`,{type:`reshape`,object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit(`move`,{type:`move`,object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,n=t.vertex;this.tooltipInfos=Ee(this._toolOptions,e);let r=e.state.isGlobal;this._vertexManipulatorMaterials=w({spherical:r,color:n.color.toUnitRGBA(),outlineColor:n.outlineColor.toUnitRGBA(),focusedOutlineColor:n.focusedOutlineColor.toUnitRGBA(),screenSize:n,renderOccluded:n.renderOccluded});let i=t.edge;this._edgeManipulatorMaterials=w({spherical:r,color:i.color.toUnitRGBA(),outlineColor:i.outlineColor.toUnitRGBA(),screenSize:i,renderOccluded:i.renderOccluded});let a=t.edgeOffset;this._edgeOffsetManipulatorMaterials=w({spherical:r,color:a.color.toUnitRGBA(),focusedColor:a.focusedColor.toUnitRGBA(),renderOccluded:a.renderOccluded,shaded:!1});let o=t.selected;this._selectedManipulatorMaterials=w({spherical:r,color:o.color.toUnitRGBA(),outlineColor:o.outlineColor.toUnitRGBA(),focusedOutlineColor:o.focusedOutlineColor.toUnitRGBA(),screenSize:o,renderOccluded:o.renderOccluded}),this.tooltip=Pe(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:n,selectedSettings:r})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),n.applyColor(this._edgeOffsetManipulatorMaterials.material),n.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),r.applyColor(this._selectedManipulatorMaterials.material),r.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),r.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,Y(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:n})=>{e!=null&&(e.visible=t,e.edgeDistance=n?`far`:`default`)},u),De(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{t===`input`&&e!==`input`&&this._resetTooltip()}),d(()=>this._operations,`vertex-update`,e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),d(()=>this._operations?.data,`change`,e=>{(e.operation===`undo`||e.operation===`redo`)&&this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=c(this._segmentLabels),this.tooltip=c(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return e.type!==`key-down`||e.key!==Ne.enterInputMode?!1:this.activeTooltipInfo?.type===`reshape-edge-offset`?this._enterInputModeDuringEdgeOffset(e):H(e,this.tooltip)?(this.tool.endDrag(),!0):!1}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type===`vertex`);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit(`manipulators-changed`)}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(G),this.removeHandles(W),this.removeHandles(K),this._moveManipulation=c(this._moveManipulation),this._objectMoveManipulation=c(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._pendingEdgeOffsetInfo&&this._exitEdgeOffsetInputMode()}_createManipulators(e){if(this._operations==null)return;let t=this.object.elevationInfo;for(let{vertices:n,segments:r,index:i}of this._operations.data.parts){let a=e?.byPartIndex.get(i);for(let e of n){let n=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,n)}for(let e of r)e.type===`line`&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit(`undo`),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=c(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._toolOptions.labels;this._segmentLabels=new me({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if(t.action===`end`)return t;let n=0,r=[],i=e===1&&this._someVerticesSelected;for(let e of this._manipulatorInfos)e.type===`vertex`&&(e.manipulator.grabbing||i&&!e.manipulator.selected||r.push(e),n++);if(r.length===n){if(i||this._hideReshapeControls(),this._moveVertices(r,t),this._updateEventState(1),this.destroyed)return t;this.events.emit(`move`,{type:`move`,dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(r,t),this._updateEventState(2),this.destroyed)return t;this.events.emit(`reshape`,{type:`reshape`,object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),a(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],K)}_showReshapeControls(){this.removeHandles(K)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){let t=this._manipulatorInfos.filter(Y).find(t=>t.manipulator===e||t.edgeManipulator===e);t!=null&&(this.removeHandles(W),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],W))}_hideReshapeManipulators(e){return o(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Y(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(U):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,U)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>t.type===`vertex`&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:n,mapDeltaZ:r}=e;if(!t&&!n&&!r)return;let i=[];this._forEachVertex(t=>{let{selected:n,grabbing:r}=t.manipulator;(n&&!r||t===e.info)&&i.push(t)}),this._moveVertices(i,e,1),this.events.emit(`reshape`,{type:`reshape`,object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(this._numGrabbing!==0||this._numDragging!==0))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object}),this.destroyed||this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit(`reshape`,{type:`reshape-start`,object:this.object});break;case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit(`reshape`,{type:`reshape-start`,object:this.object})}}if(this.destroyed)return!1;let n=this._reshapeEventState!==e;return this._reshapeEventState=e,n}_createObjectMoveManipulation(){let{tool:e,view:t,object:n,_operations:r}=this;if(r){if(this._objectMoveManipulation=new Se({tool:e,view:t,object:n}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,n,i)=>{n.next(e=>this._trackNumDragging(e)).next(t=>(t.action===`start`&&(e=r.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{t.action===`end`&&(this._showReshapeControls(),this._resetTooltip(),e=l(e))}),i.next(()=>this._onDragCancel(!0,()=>e=l(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on(`immediate-click`,e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:n,view:r,_operations:i}=this;if(!i)return;this._moveManipulation=new k({tool:n,view:r,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&O(t.operations,t.elevationInfo),snapToScene:!1,radius:k.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on(`immediate-click`,t=>{!this._moveManipulation.zManipulation.hasManipulator(e)&&!this._manipulatorInfos.some(e=>e.manipulator.selected)&&this.events.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let a=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(a(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(a(1)),this._moveManipulation.zManipulation.forEachManipulator(a(2)),this._moveManipulation.elevationInfo={mode:`absolute-height`,offset:0};let o=i.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((r,a,o,s,c)=>{let{snappingStep:l,cancelSnapping:u}=V({predicate:e=>!!e.info,snappingManager:n.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:e,pointer:c,excludeFeature:t.graphic,visualizer:new he}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next(e=>(this._onDragCancel(),e)).next(u),o=o.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.manipulatorType===1&&t.length===1?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(Ae(this.view,e)).next(...l).next(L()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(e.action===`end`&&this._showReshapeControls(),this._updateTranslateTooltip(r,e),e)),{steps:o,cancel:s}},e,o,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),u),t.on(`committed`,()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(Ie),e&&this.addHandles(ke({view:this.view,geometry:()=>t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),Ie)},u)])}_createVisualElements(){let{object:e,view:t}=this,n=be({view:t,object:e,forEachManipulator:e=>{if(!(this.destroyed||this._recreatingManipulators)){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(let t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on(`manipulators-changed`,e)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof P?n.visualElement:null);let r=this._outlineVisualElement;if(r!=null){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(d(()=>r.events,`attachment-origin-changed`,t,{onListenerAdd:t}))}this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let n=this.view,r=this._operations;if(e.part.vertices.length<=2||!r)return null;let i=r.data.spatialReference,a=this._settings.manipulators.edgeOffset,s=a.size/2,c=s+a.collisionPadding,l=s/c,u=l/2,d=l*Math.sqrt(3)/2,{height:f,offset:p}=a,{material:m,focusedMaterial:h}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){let e=F(m,d,u,u,f,p);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=F(m,-d,u,u,f,-p);this._edgeOffsetManipulatorGeometryOutside=e}let g=[new E(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new E(this._edgeOffsetManipulatorGeometryInside.instantiate({material:h}),2),new E(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new E(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:h}),2)],_=new C({view:n,renderObjects:g,elevationInfo:t.mode===`on-the-ground`&&!de(this.object.graphic?.symbol)?t:{mode:`absolute-height`,offset:0},worldOriented:!1,focusMultiplier:1,radius:c,available:this.object.visible,collisionType:{type:`disc`,direction:re(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:J(i)}),v=new C({view:n,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?`move`:`default`,metadata:{deleting:!1},location:J(i)}),y={manipulator:_,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(y,a.minSquaredEdgeLength);let b=()=>this._updateEdgeOffsetManipulator(y);b(),y.locationUpdateHandle=o([e.leftVertex,e.rightVertex].map(e=>this._getManipulatorInfoFromHandle(e)?.manipulator.events.on(`location-update`,b)));let x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([y.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),R(_,this._createEdgeOffsetPipeline(y,t,r)),R(v,this._createEdgePipeline(y,t,r)),v.events.on(`immediate-click`,x),_.events.on(`immediate-click`,x),_.events.on(`focus-changed`,()=>this._resetTooltip()),_.events.on(`grab-changed`,({screenPoint:e,action:t})=>{y.grabMapPoint=t===`start`?A(e,this.view,this.object,y):null})],_),this._manipulatorInfos.push(y),this.manipulators.addMany([_,v]),this.events.emit(`manipulators-changed`),y}_autoHideEdgeOffsetManipulator(e,t){let n=e.manipulator,r=e.edgeManipulator,i=()=>{e.visibilityHandle=l(e.visibilityHandle);let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),s=this._getManipulatorInfoFromHandle(e.handle.rightVertex),c=i!=null&&s!=null&&we(i.manipulator.renderLocation,s.manipulator.renderLocation,this.view.state.camera)<t;(!n.focused&&!r.focused||c)&&(n.grabbable=!c,r.grabbable=!c,e.visibilityHandle=o([n.disableDisplay(),a(()=>{n.grabbable=!0,r.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([n.events.on(`focus-changed`,i),r.events.on(`focus-changed`,i),a(()=>{l(e.visibilityHandle),r.metadata.deleting=!0,this.manipulators.remove(r)})],n),i()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,n=j(this.view,e.manipulator.elevationAlignedLocation,M(t,e.handle,e.manipulator.elevationInfo)),r=this._getManipulatorInfoFromHandle(e.handle.leftVertex),i=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(r==null||i==null)return;let a=r.manipulator.renderLocation,o=i.manipulator.renderLocation,s=n==null?v:Ce(n,a,o);e.manipulator.modelTransform=s,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=s;let c=y(b(Z,a,o))/2;e.edgeManipulator.collisionType={type:`line`,paths:[[[-c,0,0],[c,0,0]]]}}_createEdgePipeline(e,t,n){return(r,i,a,o)=>{if(o===`touch`)this._createEdgeOffsetPipeline(e,t,n)(r,i,a);else if(this.enableMoveObject){let e=this.object.graphic,o=n.data.spatialReference,{elevationAlignedLocation:s}=r;i.next(e=>this._trackNumDragging(e)).next(z(this.view,s)).next(D(this.view,s,t,o,e)).next(je()).next(L()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{e.action===`end`&&(this._showReshapeControls(),this._resetTooltip())}),a.next(()=>this._onDragCancel(!r.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,n){return(r,i,a)=>{let o=this._pendingEdgeOffsetInfo;if(o?.manipulatorInfo===e&&o.mode!==`drag`){a.execute({action:`cancel`});return}this._clearSelection();let{initializeStep:s,cleanup:c}=this._initializeEdgeOffset(e,t,n,a),l=this._applyEdgeOffsetStep(e);i.next(e=>this._trackNumDragging(e)).next(z(this.view,r.elevationAlignedLocation)).next(s).next(ge(this.view)).next(_e(this.view,n.data.spatialReference)).next(L()).next(Le()).next(e=>this._pendingEdgeOffsetInfo?e:l(e)).next(e=>{e.action===`end`&&!this._pendingEdgeOffsetInfo&&c()}),a.next(()=>{this._exitEdgeOffsetInputMode(),r.metadata.deleting||(c(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,n,r){let{view:i,object:a}=this,o=M(n.data.coordinateHelper,e.handle,t),s=n.createUndoGroup(),c=j(i,e.manipulator.elevationAlignedLocation,o);this._splitEdgesBeforeEdgeOffset(e,o),this._selectEdgeOffsetArrow(e,o);let l=()=>{this._cleanEdgeOffsetCollapsedEdges(e,n),this.removeHandles(G)},u=this.events.on(`undo`,l);return this.addHandles([this._initializeEdgeOffsetVisualElement(e,a,t,n),s,u,this._connectEdgeOffsetTooltip(e,o,n,()=>{r.execute({action:`cancel`})})],G),{initializeStep:e=>o==null||c==null?(l(),null):{...e,operation:o,plane:c},cleanup:l}}_initializeEdgeOffsetVisualElement(e,t,n,r){let i=()=>new se({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:r.data.spatialReference}),a=new P({view:this.view,isDraped:t.isDraped,geometry:i(),elevationInfo:n,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),c=o([f(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{a.color=e.toUnitRGBA(),a.isDraped=t},p),t.on(`committed`,()=>{a.geometry=i()}),s(a)]);return a.attached=!0,c}_applyEdgeOffsetStep(e){return t=>(this.destroyed||t.operation==null||!this._operations||(this._updateEventState(2),t.signedDistance==null?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit(`reshape`,{type:`reshape`,object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let n=e.handle.leftVertex.leftSegment?.leftVertex,r=e.handle.leftVertex,i=e.handle.rightVertex.rightSegment?.rightVertex,a=e.handle.rightVertex,o=t.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(r.pos),o.spatialReference),c=[];if(n&&o.distance(n.pos,r.pos)<ze){let e=this._getManipulatorInfoFromHandle(r);e!=null&&c.push(e)}if(o.distance(r.pos,a.pos)<s||i&&o.distance(i.pos,a.pos)<ze){let e=this._getManipulatorInfoFromHandle(a);e!=null&&c.push(e)}c.length&&this._removeVertices(c)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return t&&H(e,this.tooltip)?t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`drag`},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`hover`},this._connectEdgeOffsetTooltipOnHover(t),!0):!1}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Y).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:n}=this;if(!t)return;let{elevationInfo:r}=n,i=M(t.data.coordinateHelper,e.handle,r);this._selectEdgeOffsetArrow(e,i),this.addHandles([this._initializeEdgeOffsetVisualElement(e,n,r,t),this._connectEdgeOffsetTooltip(e,i,t,()=>{this.removeHandles(G),this._exitEdgeOffsetInputMode()})],G)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);t!=null&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);t!=null&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let n=e.grabMapPoint??A(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);n&&t.selectArrowFromStartPoint(n)}_connectEdgeOffsetTooltip(e,t,n,r){let i=()=>this.tooltipInfos.edgeOffset.distance.actual,a=i=>{r(),queueMicrotask(()=>{this.view.focus();let r=n.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,Te(i,e.manipulator.location,t,n)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,n),r.remove()})},s=()=>{let e=i();e==null?r():a(e)};return o([m(()=>this.tooltip&&!this.tooltip.focused,()=>s(),h),this.tooltip.on(`discard`,r),this.tooltip.on(`commit`,e=>{e.type===`commit-and-exit`&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,n=!1){let r=this.view,i=this._operations;if(!i)return null;let a=i.data.type,s=i.data.spatialReference;if(e.type===`line`){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(this._vertexManipulatorGeometry==null||this._vertexManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=T(e),this._vertexManipulatorOutlineGeometry=T(t)}if(this._edgeManipulatorGeometry==null||this._edgeManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=T(e),this._edgeManipulatorOutlineGeometry=T(t)}let c=this._vertexManipulatorGeometry,u=this._vertexManipulatorOutlineGeometry,d=[];if(a!==`point`&&a!==`mesh`){d.push(new E(c.instantiate(),Q|4),new E(u.instantiate(),Q|5),new E(u.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),Q|6));{let{material:e,outlineMaterial:t,focusedMaterial:n}=this._selectedManipulatorMaterials;d.push(new E(c.instantiate({material:e}),8),new E(u.instantiate({material:t}),9),new E(u.instantiate({material:n}),10))}}if(this.enableMidpoints){let{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,n=this._edgeManipulatorGeometry,r=this._edgeManipulatorOutlineGeometry,i=$|6,a=$|5;d.push(new E(n.instantiate({material:e}),i),new E(r.instantiate({material:t}),i),new E(n.instantiate(),a),new E(r.instantiate(),a))}let f=e.type===`vertex`,p=new C({view:r,renderObjects:d,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:a===`point`||a===`mesh`,available:this.object.visible,metadata:{deleting:!1},location:J(s),...pe});p.selected=n,this._setTypeSpecificManipulatorSettings(p,e,t);let m=f?{manipulator:p,handle:e,type:`vertex`,selectedIndex:0}:{manipulator:p,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(p),this._updateManipulatorPosition(m),m.type===`edge`){let e=[];for(let t of[m.handle.leftVertex,m.handle.rightVertex]){let n=this._getManipulatorInfoFromHandle(t);n!=null&&e.push(n.manipulator.events.on(`location-update`,()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=o(e),this._manipulatorHandles.add(m.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);let h=R(p,(e,n,a,o)=>{let c=null,{snappingStep:u,cancelSnapping:d}=V({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:t,pointer:o,excludeFeature:this.object.graphic,visualizer:new he}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});a.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>c=l(c)),t)).next(d);let{elevationAlignedLocation:f}=e,p=this.object.graphic??void 0,h=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,i,p):D(r,f,t,s,p);n.next(e=>this._trackNumDragging(e)).next(e=>{if(e.action===`start`&&i&&(c=i.createUndoGroup()),m.type===`edge`){let t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(z(r,f)).next(h).next(Me(r,t,p)).next(...u).next(L()).next(e=>{this._perVertexManipulatorDragAction(e),e.action===`end`&&(c=l(c)),this._resetTooltip()})});return this._manipulatorHandles.add([h,p.events.on(`immediate-click`,e=>this._manipulatorClickCallback(e,m)),p.events.on(`select-changed`,()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),p.events.on(`focus-changed`,()=>{this._resetTooltip()})],p),this.events.emit(`manipulators-changed`),m}_screenToSceneMapForVertexDrag(e,t,n){let{view:r}=this,{coordinateHelper:i,spatialReference:a}=t.data,o=null;return t=>{if(t.action===`start`&&(o=i.vectorToPoint(t.snapOrigin)),o==null)return null;let s=r.toMap(t.screenEnd,{exclude:n,excludeLabels:!0});return s==null||(s.z=ue(s,r,e),!ce(s,s,a))?null:{...t,mapStart:o,mapEnd:s}}}_trackNumDragging(e){switch(e.action){case`start`:this._numDragging++;break;case`end`:this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit(`move`,{type:`move`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape`,object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,n){let r=this._settings;switch(t.type){case`vertex`:{e.selectable=!0,e.cursor=`move`,e.collisionPriority=2,e.elevationInfo=n;let t=this._operations?.data.type;e.interactive=t!=null&&t!==`point`&&t!==`mesh`;let{size:i,collisionPadding:a}=r.manipulators.vertex;e.radius=i/2+a,e.state=Q;break}case`line`:{e.state=$,e.selectable=!1,e.cursor=`copy`,e.collisionPriority=2;let{size:t,collisionPadding:i}=r.manipulators.edge;e.radius=t/2+i,e.elevationInfo=n.mode===`on-the-ground`&&!de(this.object.graphic?.symbol)?n:{mode:`absolute-height`,offset:0};break}}}_watchAndUpdateGrabState(e,t){return e.events.on(`grab-changed`,n=>{this._onGrabStateChanged(e,t,n.action,n.pointerType)})}_onGrabStateChanged(e,t,n,r=`mouse`){if(!this._recreatingManipulators){if(n===`start`)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(W),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(r!==`touch`||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,n=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&n!=null&&n!==`point`&&n!==`mesh`,Y(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit(`manipulators-changed`))}_removeManipulator(e){e!=null&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),n(this._manipulatorInfos,e),this.events.emit(`manipulators-changed`),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(e!=null&&t){if(e.type===`vertex`)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,X),e.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if(e.type===`edge`){let n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(n==null||r==null)return;let i=n.manipulator,a=r.manipulator;if(e.manipulator.elevationInfo?.mode===`on-the-ground`){let n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),c=n.y+o*(r.y-n.y),l=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=S(s,c,l,t.data.spatialReference)}else x(Z,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Z}}}_splitEdgeManipulator(e,t=.5){let n=this._operations,r=n.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=l(e.locationUpdateHandle);let i=this.object.elevationInfo,a;this.enableEdgeOffset?(this._removeManipulator(e),a=this._createVertexOrEdgeManipulator(r)):(a=e,a.handle=r,a.type=`vertex`,this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,i)),r.leftSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.leftSegment),r.rightSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.rightSegment),this._updateManipulatorPosition(a),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let o=this._updateEventState(2),s=n.data.coordinateHelper.vectorToArray(a.handle.pos),c=n.data.parts.indexOf(r.part);return this.events.emit(`vertex-add`,{type:`vertex-add`,object:this.object,vertices:[{coordinates:s,componentIndex:c,vertexIndex:r.index}],added:s}),o&&this._updateEventState(0),a}_updateMoveManipulationPosition(){let e=ee(Z,0,0,0),t=0,n=!1,r=null,i=null;for(let a of this._manipulatorInfos)a.type===`vertex`&&(a.manipulator.selected?(t++,te(e,e,a.manipulator.renderLocation),r==null||a.selectedIndex>r.selectedIndex?(i=r,r=a):(i==null||a.selectedIndex>i.selectedIndex)&&(i=a)):n=!0);let a=this.object,o=this._operations?.data.geometry;if(t===0){let e=a.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&O(this._operations,a.elevationInfo),this._moveManipulation.angle=ve(o),this._moveManipulation.radius=k.radiusForSymbol(a.graphic?.symbol)}else{let e=a.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&O(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&t!==1;let n=0;if(r!=null){let e=r.handle.pos,t=i==null?r.handle.leftSegment?.leftVertex?r.handle.leftSegment.leftVertex.pos:null:i.handle.pos,a=i==null&&r.handle.rightSegment?.rightVertex?r.handle.rightSegment.rightVertex.pos:null;t&&a?this._moveManipulation.xyAxisManipulation.available=!1:t?n=Re(t,e):a&&(n=Re(e,a))}this._moveManipulation.angle=n,this._moveManipulation.radius=xe}t!==0&&n?(ne(e,e,1/t),X.spatialReference=this._operations.data.spatialReference,X.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,X),this._moveManipulation.elevationAlignedLocation=X):this._outlineVisualElement!=null&&!this.object.isDraped&&this._outlineVisualElement.attachmentOrigin!=null?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:fe(this._moveManipulation,this.object)}_removeVertices(e){let t=[],n=this._operations;if(!n)return;let r=e.filter(e=>e.type===`vertex`&&n.canRemoveVertex(e.handle.part));if(r.length>0){let e=this._createBeforeVertexRemoveEvent(r);if(this.events.emit(`before-vertex-remove`,e),e.defaultPrevented)return}for(let e of r){let r=e.handle.part;if(n.canRemoveVertex(r)){t.push(e.handle),this._removeManipulator(e),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightSegment));let i=n.removeVertices([e.handle]).removedVertices?.[0].createdSegment;i&&i.type===`line`?this._createVertexOrEdgeManipulator(i):this.enableEdgeOffset&&r.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(r.segments[0]))}}if(t.length>0){let e=t.map(e=>{let t=n.data.parts.indexOf(e.part);return{coordinates:n.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),r=this._updateEventState(2);if(this.destroyed||(this.events.emit(`vertex-remove`,{type:`vertex-remove`,object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||r&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){let t=this._operations,n=e.map(e=>{let n=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:n,vertexIndex:e.handle.index}}),r=!1;return{type:`before-vertex-remove`,object:this.object,removed:n.map(e=>e.coordinates),vertices:n,get defaultPrevented(){return r},preventDefault(){r=!0}}}_moveVertices(e,t,n=t.action===`start`?0:1){let r=this._operations;if(r&&(e.length>0&&r.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,n),!this._movingManipulatorsHidden))for(let t of e)this._updateManipulatorPosition(t)}_offsetEdge(e,t,n){if(!this._operations)return;let r=t.clone();r.distance=n,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],r),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),t.type===`vertex`&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===I.Right&&this._removeVertices([t])),t.type===`edge`&&e.button===I.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){this._defaultTooltipInfo==null?this._updateTranslateObjectTooltip(e,t):this._resetTooltip()}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=Oe(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=N(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&e?.type===`reshape-edge-offset`)return;let t=null;t=this._pendingEdgeOffsetInfo||this._findActiveEdgeOffsetManipulatorInfo()!=null?N(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(e==null||t==null||this.tooltip.mode!==`input`)&&(this.activeTooltipInfo=t)}get _defaultTooltipInfo(){switch(this._operations?.data.type){case`polyline`:case`polygon`:return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case`point`:case`mesh`:return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.length===1?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>e.type===`vertex`&&e.manipulator.selected)}_forEachVertex(e){for(let t of this._manipulatorInfos)t.type===`vertex`&&e(t)}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};e([g()],q.prototype,`_numGrabbing`,void 0),e([g()],q.prototype,`_numDragging`,void 0),e([g()],q.prototype,`_pendingEdgeOffsetInfo`,void 0),e([g()],q.prototype,`_operations`,null),e([g()],q.prototype,`_segmentLabels`,void 0),e([g({constructOnly:!0})],q.prototype,`tool`,void 0),e([g()],q.prototype,`tooltip`,void 0),e([g()],q.prototype,`activeTooltipInfo`,void 0),e([g({readOnly:!0})],q.prototype,`updating`,null),e([g()],q.prototype,`manipulators`,null),e([g()],q.prototype,`view`,null),e([g()],q.prototype,`object`,null),e([g()],q.prototype,`enableZShape`,null),e([g()],q.prototype,`enableDeleteVertices`,null),e([g()],q.prototype,`enableZVertex`,null),e([g()],q.prototype,`autoHideManipulators`,null),e([g()],q.prototype,`enableMoveObject`,null),e([g()],q.prototype,`enableMidpoints`,null),e([g()],q.prototype,`enableEdgeOffset`,null),e([g()],q.prototype,`_toolOptions`,null),e([g()],q.prototype,`_accentColor`,null),e([g()],q.prototype,`_tooltipsContext`,null),q=e([_(`esri.views.3d.interactive.editingTools.reshape.ReshapeOperation`)],q);function Le(){return e=>{let{operation:t,mapEnd:n}=e;return t==null||n==null?e:{...e,signedDistance:t.signedDistanceToPoint(n)}}}function Re(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function J(e){return new oe({x:0,y:0,z:0,spatialReference:e})}function Y(e){return e.type===`edge`&&`edgeManipulator`in e}const X=S(0,0,void 0,le.WGS84),Z=ie(),ze=1e-6,Q=16,$=32;export{q as ReshapeOperation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as n}from"../../../../../core/colorUtils.js";import{cyclicalPI as r}from"../../../../../core/Cyclical.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{clamp as a,rad2deg as o}from"../../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as c,initial as l}from"../../../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../../../core/scheduling.js";import{createScreenPointArray as d}from"../../../../../core/screenUtils.js";import{property as f,subclass as p}from"../../../../../core/accessorSupport/decorators.js";import{fromRotation as m,fromScaling as h,multiply as g,scale as _,rotate as v}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as ee}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as y,subtract as b,length as x,squaredDistance as S,cross as C,add as w}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as T,clone as E}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPositionAndNormal as D,create as te,getNormal as O}from"../../../../../geometry/support/plane.js";import{wrap as k,distance2 as A}from"../../../../../geometry/support/ray.js";import{sm4d as j,sv3d as M}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as N}from"../../Manipulator3D.js";import{calculateInputRotationTransform as P}from"../../manipulatorUtils.js";import{RenderObject as F}from"../../RenderObject.js";import{screenToRenderPlane as ne}from"../dragEventPipeline3D.js";import{ringIndicatorDelayMs as re,rotateIndicatorArrowPlacementPercentage as I,ringThickness as L,ringRadius as R,innerIndicatorRadius as ie,outerIndicatorRadius as z,rotateIndicatorArrowTipRadius as ae,rotateIndicatorArrowTipLength as oe,scaleIndicatorOffset1 as B,scaleIndicatorOffset2 as V,indicatorThickness as H,geometrySegments as U,rotateIndicatorArcLength as W,scaleIndicatorArcLength as G,rotateIndicatorDirectionBuffer as K,scaleIndicatorDirectionBuffer as se,ringHeight as q,dragThresholdPx as J,ringResetAnimationSpeedFactor as ce}from"../manipulations/config.js";import{createExtrudedTriangle as le,transformInPlace as ue,createPathExtrusionGeometry as de}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as fe}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as pe}from"../../../../interactive/dragEventPipeline.js";const Y={ScaleIn:32,ScaleOut:64,RotateLeft:128,RotateRight:256,Unlocked:1024,DelayedFocused:2048};let X=class extends t{get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(e){this._ringManipulator.location=e}set elevationAlignedLocation(e){this._ringManipulator.elevationAlignedLocation=e}get grabbing(){return this._ringManipulator.grabbing}set interactive(e){this._ringManipulator.interactive=e}get updating(){return!!this._activeAnimation}constructor(e){super(e),this.mode=null,this._scaleRotateDragData=null,this._activeAnimation=null,this._ringIndicatorDelayMs=re,this.events=new i,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>this._scaleRotateDragData?.mode===`scale`?this.adapter.scale:1}initialize(){this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this.addHandles([c(()=>{let{adapter:e}=this;return[e.angle,e.scale]},()=>this._updateManipulatorTransform())])}destroy(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=null,this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null}startAnimation(e){this.cancelActiveAnimation(),e.start();let t=u({update:({deltaTime:t})=>{e.update(t)&&this.cancelActiveAnimation()}});this._activeAnimation={...e,frameTask:t}}cancelActiveAnimation(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=s(this._activeAnimation)}forEachManipulator(e){e(this._ringManipulator,4)}disableDisplay(){return this._ringManipulator.disableDisplay()}_createManipulator(){let e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);let t=this.tool.object,n=pe(e,(e,n,i)=>{this._scaleRotateDragData=null;let s=this.adapter.startInteraction(),c={mode:`none`,origin:E(e.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();let l=M.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,l),n.next(ne(this.tool.view,D(e.renderLocation,l,te()))).next(e=>{let n=O(e.plane),i=P(e.renderStart,e.renderEnd,c.origin,n),l=r.shortestSignedDiff(c.angle,i);c.angleDir=a(c.angleDir+l,-.3,K),c.angle=i;let u=me(c,e),d=u-this.adapter.scale;if(c.scaleDir=a(c.scaleDir+d,-.2,se),this._onScaleChanged(),c.mode===`none`){let n=this.mode||he(e,e.plane,c.origin,this.tool.view.state.camera);if(n!=null){switch(n){case`rotate`:this.tool.events.emit(`rotate-start`,{object:t,angle:0}),this.tool.events.emit(`record-undo`,{updates:[this.adapter.createUndoRecord()]});break;case`scale`:this.tool.events.emit(`scale-start`,{object:t,xScale:1,yScale:1}),this.tool.events.emit(`record-undo`,{updates:[this.adapter.createUndoRecord()]})}c.mode=n}}switch(c.mode){case`rotate`:s.state.angle=c.initialAngle+i;break;case`scale`:s.state.scale=u,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case`start`:case`update`:switch(c.mode){case`rotate`:this.tool.events.emit(`rotate`,{object:t,angle:o(c.angle)});break;case`scale`:this.tool.events.emit(`scale`,{object:t,xScale:u,yScale:u})}break;case`end`:switch(c.mode){case`rotate`:this.tool.events.emit(`rotate-stop`,{object:t,angle:o(c.angle)});break;case`scale`:this.tool.events.emit(`scale-stop`,{object:t,xScale:u,yScale:u})}}return e.action===`end`&&(this.startAnimation(Q(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState(),s.done()),e}),i.next(()=>{if(s.cancel(),this._scaleRotateDragData!=null){switch(this._scaleRotateDragData.mode){case`none`:break;case`rotate`:this.tool.events.emit(`rotate-stop`,{object:t,angle:0});break;case`scale`:this.tool.events.emit(`scale-stop`,{object:t,xScale:1,yScale:1})}this.startAnimation(Q(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState()}})});this.addHandles([n,e.events.on(`focus-changed`,e=>{e.action===`focus`?this.startAnimation(ge(this,()=>this._updateDelayedFocusedState(),{delayMs:this._ringIndicatorDelayMs})):this._updateDelayedFocusedState()}),e.events.on(`immediate-click`,e=>{e.stopPropagation()}),c(()=>this.tool.object.visible,e=>this._ringManipulator.available=e,l)])}_onScaleChanged(){this.events.emit(`scale-changed`),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(Y.DelayedFocused,this.getFocused())}_updateDragState(){if(this._ringManipulator.updateStateEnabled(Y.Unlocked,this._scaleRotateDragData==null||this._scaleRotateDragData?.mode===`none`),this._scaleRotateDragData!=null)switch(this._scaleRotateDragData.mode){case`rotate`:this._ringManipulator.updateStateEnabled(Y.ScaleIn|Y.ScaleOut,!1),this._ringManipulator.updateStateEnabled(Y.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(Y.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case`scale`:this._ringManipulator.updateStateEnabled(Y.RotateLeft|Y.RotateRight,!1),this._ringManipulator.updateStateEnabled(Y.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(Y.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(Y.ScaleIn|Y.ScaleOut|Y.RotateLeft|Y.RotateRight,!1)}_updateManipulatorTransform(){let e=m(j.get(),this.adapter.angle,T(0,0,1));if(e==null)return;let t=this.getScale(),n=h(j.get(),y(M.get(),t,t,t));this._ringManipulator.modelTransform=g(j.get(),n,e)}_createRingManipulator(){let e=(e,t,n)=>{let r=[],i=Math.ceil(U*(t-e)/(2*Math.PI));for(let a=0;a<i+1;a++){let o=e+a*(t-e)/i;r.push(T(n*Math.cos(o),n*Math.sin(o),0))}return r},t=t=>e(0,Math.PI*2,t),n=e=>[[-e/2,0],[e/2,0],[e/2,q/2],[-e/2,q/2]],r=this._createMaterial(1),i=(e,t,i=r)=>de(i,n(t),e,[],[],!1),a=t(R),o=i(a,L),s={left:[],right:[]},c=[];for(let t=0;t<2;t++){let n=t*Math.PI-Math.PI/4,a=Math.PI/2-W,o=n+a,l=n+Math.PI/2-a,u=e(o,l,ie),d=i(u,H);c.push(u),c.push(e(o,l,z-L/2)),s.left.push(d),s.right.push(d.instantiate());for(let e=0;e<2;e++){let t=e===0,n=ee();if(t){_(n,n,[1,-1,1]),v(n,n,-o,[0,0,1]);let e=Math.round(I*(u.length-1));n[12]=u[e][0],n[13]=u[e][1],n[14]=u[e][2]}else{v(n,n,l,[0,0,1]);let e=Math.round((1-I)*(u.length-1));n[12]=u[e][0],n[13]=u[e][1],n[14]=u[e][2]}let i=le(r,oe,0,ae,q);ue(i,n),(t?s.left:s.right).push(i)}}let l=[];for(let t=0;t<2;t++){let n=t*Math.PI-Math.PI/4,r=Math.PI/2-G,a=e(n+r,n+Math.PI/2-r,z);l.push(i(a,H))}let u=this._createMaterial(.66),d=this._createMaterial(.5),f=this._createMaterial(.33),p=t(R+B),m=t(R+V),h=i(p,H,u),g=i(m,H,f),y=t(R-B),b=t(R-V),x=i(y,H,u),S=i(b,H,f),C=[new F(o,Y.DelayedFocused),new F(o.instantiate({material:d}),0)];this.mode&&this.mode!==`scale`||(C=C.concat([...l.map(e=>new F(e,Y.DelayedFocused|Y.Unlocked)),new F(h,Y.DelayedFocused|Y.ScaleIn),new F(g,Y.DelayedFocused|Y.ScaleIn),new F(x,Y.DelayedFocused|Y.ScaleOut),new F(S,Y.DelayedFocused|Y.ScaleOut)])),this.mode&&this.mode!==`rotate`||(C=C.concat([...s.right.map(e=>new F(e.instantiate(),Y.DelayedFocused|Y.Unlocked)),...s.left.map(e=>new F(e,Y.DelayedFocused|Y.RotateLeft)),...s.right.map(e=>new F(e,Y.DelayedFocused|Y.RotateRight))]));let w=[a,...c];return new N({view:this.tool.view,renderObjects:C,autoScaleRenderObjects:!1,worldOriented:!0,radius:L,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:this.tool.object.elevationInfo,collisionType:{type:`ribbon`,paths:w,direction:T(0,0,1)}})}_createMaterial(e){let t=new fe({cullFace:2,renderOccluded:2,isDecoration:!0});return this.addHandles(c(()=>n(this.tool.view.effectiveTheme.accentColor,e),e=>t.setParameters({color:e}),l)),t}get test(){}};e([f({constructOnly:!0})],X.prototype,`tool`,void 0),e([f({constructOnly:!0})],X.prototype,`adapter`,void 0),e([f({constructOnly:!0})],X.prototype,`toolOptions`,void 0),e([f()],X.prototype,`mode`,void 0),e([f()],X.prototype,`_activeAnimation`,void 0),e([f()],X.prototype,`updating`,null),X=e([p(`esri.views.3d.interactive.editingTools.transform.ScaleRotateTransform`)],X);function me(e,t){let n=b(M.get(),t.renderStart,e.origin),r=b(M.get(),t.renderEnd,e.origin),i=x(n),a=x(r);return i===0?0:a/i}function he(e,t,n,r){let{renderStart:i,renderEnd:a}=e,o=Z(i,r,M.get()),s=Z(a,r,M.get());if(S(o,s)<J*J)return null;let c=b(M.get(),i,n),l=C(M.get(),c,O(t)),u=i,d=w(M.get(),u,l),f=Z(n,r,M.get()),p=o,m=Z(d,r,M.get()),h=b(M.get(),m,p),g=b(M.get(),o,f),_=k(p,h),v=k(f,g);return A(_,s)<A(v,s)?`rotate`:`scale`}function Z(e,t,n){return t.projectToScreen(e,$),y(n,$[0],$[1],0)}function Q(e,t){let n=null,r=1,i=()=>r;return{start:()=>{r=e.getScale(),n=e.getScale,e.getScale=i,t()},update:e=>{let n=(r+1)/2-r;return r+=n*Math.min(e*ce,1),t(),+(Math.abs(r-1)<.01)},destroy:()=>{n&&(e.getScale=n),t()}}}function ge(e,t,n){let r=0,i=null,a=()=>!1;return{start:()=>{i=e.getFocused,e.getFocused=a,r=0,t()},update:e=>(r+=e,+(!i?.()||r>=n.delayMs)),destroy:()=>{i&&(e.getFocused=i),t()}}}const $=d();export{X as ScaleRotateTransform};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as n}from"../../../../../core/colorUtils.js";import{cyclicalPI as r}from"../../../../../core/Cyclical.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{clamp as a,rad2deg as o}from"../../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as c,initial as l}from"../../../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../../../core/scheduling.js";import{createScreenPointArray as d}from"../../../../../core/screenUtils.js";import{property as f,subclass as p}from"../../../../../core/accessorSupport/decorators.js";import{fromRotation as m,fromScaling as h,multiply as g,scale as _,rotate as v}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as ee}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as y,subtract as b,length as x,squaredDistance as S,cross as C,add as w}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as T,clone as E}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPositionAndNormal as D,create as te,getNormal as O}from"../../../../../geometry/support/plane.js";import{wrap as k,distance2 as A}from"../../../../../geometry/support/ray.js";import{sm4d as j,sv3d as M}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as N}from"../../Manipulator3D.js";import{calculateInputRotationTransform as P}from"../../manipulatorUtils.js";import{RenderObject as F}from"../../RenderObject.js";import{screenToRenderPlane as ne}from"../dragEventPipeline3D.js";import{ringIndicatorDelayMs as re,rotateIndicatorArrowPlacementPercentage as I,ringThickness as L,ringRadius as R,innerIndicatorRadius as ie,outerIndicatorRadius as z,rotateIndicatorArrowTipRadius as ae,rotateIndicatorArrowTipLength as oe,scaleIndicatorOffset1 as B,scaleIndicatorOffset2 as V,indicatorThickness as H,geometrySegments as U,rotateIndicatorArcLength as W,scaleIndicatorArcLength as G,rotateIndicatorDirectionBuffer as K,scaleIndicatorDirectionBuffer as se,ringHeight as q,dragThresholdPx as J,ringResetAnimationSpeedFactor as ce}from"../manipulations/config.js";import{createExtrudedTriangle as le,transformInPlace as ue,createPathExtrusionGeometry as de}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as fe}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as pe}from"../../../../interactive/dragEventPipeline.js";const Y={ScaleIn:32,ScaleOut:64,RotateLeft:128,RotateRight:256,Unlocked:1024,DelayedFocused:2048};let X=class extends t{get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(e){this._ringManipulator.location=e}set elevationAlignedLocation(e){this._ringManipulator.elevationAlignedLocation=e}get grabbing(){return this._ringManipulator.grabbing}set interactive(e){this._ringManipulator.interactive=e}get updating(){return!!this._activeAnimation}constructor(e){super(e),this.mode=null,this._scaleRotateDragData=null,this._activeAnimation=null,this._ringIndicatorDelayMs=re,this.events=new i,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>this._scaleRotateDragData?.mode===`scale`?this.adapter.scale:1}initialize(){this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this.addHandles([c(()=>{let{adapter:e}=this;return[e.angle,e.scale]},()=>this._updateManipulatorTransform())])}destroy(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=null,this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null}startAnimation(e){this.cancelActiveAnimation(),e.start();let t=u({update:({deltaTime:t})=>{e.update(t)&&this.cancelActiveAnimation()}});this._activeAnimation={...e,frameTask:t}}cancelActiveAnimation(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=s(this._activeAnimation)}forEachManipulator(e){e(this._ringManipulator,4)}disableDisplay(){return this._ringManipulator.disableDisplay()}_createManipulator(){let e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);let t=this.tool.object,n=pe(e,(e,n,i)=>{this._scaleRotateDragData=null;let s=this.adapter.startInteraction(),c={mode:`none`,origin:E(e.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();let l=M.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,l),n.next(ne(this.tool.view,D(e.renderLocation,l,te()))).next(e=>{let n=O(e.plane),i=P(e.renderStart,e.renderEnd,c.origin,n),l=r.shortestSignedDiff(c.angle,i);c.angleDir=a(c.angleDir+l,-.3,K),c.angle=i;let u=me(c,e),d=u-this.adapter.scale;if(c.scaleDir=a(c.scaleDir+d,-.2,se),this._onScaleChanged(),c.mode===`none`){let n=this.mode||he(e,e.plane,c.origin,this.tool.view.state.camera);if(n!=null){switch(n){case`rotate`:this.tool.events.emit(`rotate-start`,{object:t,angle:0}),this.tool.events.emit(`record-undo`,{updates:[this.adapter.createUndoRecord()]});break;case`scale`:this.tool.events.emit(`scale-start`,{object:t,xScale:1,yScale:1}),this.tool.events.emit(`record-undo`,{updates:[this.adapter.createUndoRecord()]})}c.mode=n}}switch(c.mode){case`rotate`:s.state.angle=c.initialAngle+i;break;case`scale`:s.state.scale=u,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case`start`:case`update`:switch(c.mode){case`rotate`:this.tool.events.emit(`rotate`,{object:t,angle:o(c.angle)});break;case`scale`:this.tool.events.emit(`scale`,{object:t,xScale:u,yScale:u})}break;case`end`:switch(c.mode){case`rotate`:this.tool.events.emit(`rotate-stop`,{object:t,angle:o(c.angle)});break;case`scale`:this.tool.events.emit(`scale-stop`,{object:t,xScale:u,yScale:u})}}return e.action===`end`&&(this.startAnimation(Q(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState(),s.done()),e}),i.next(()=>{if(s.cancel(),this._scaleRotateDragData!=null){switch(this._scaleRotateDragData.mode){case`none`:break;case`rotate`:this.tool.events.emit(`rotate-stop`,{object:t,angle:0});break;case`scale`:this.tool.events.emit(`scale-stop`,{object:t,xScale:1,yScale:1})}this.startAnimation(Q(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState()}})});this.addHandles([n,e.events.on(`focus-changed`,e=>{e.action===`focus`?this.startAnimation(ge(this,()=>this._updateDelayedFocusedState(),{delayMs:this._ringIndicatorDelayMs})):this._updateDelayedFocusedState()}),e.events.on(`immediate-click`,e=>{e.stopPropagation()}),c(()=>this.tool.object.visible,e=>this._ringManipulator.available=e,l)])}_onScaleChanged(){this.events.emit(`scale-changed`),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(Y.DelayedFocused,this.getFocused())}_updateDragState(){if(this._ringManipulator.updateStateEnabled(Y.Unlocked,this._scaleRotateDragData==null||this._scaleRotateDragData?.mode===`none`),this._scaleRotateDragData!=null)switch(this._scaleRotateDragData.mode){case`rotate`:this._ringManipulator.updateStateEnabled(Y.ScaleIn|Y.ScaleOut,!1),this._ringManipulator.updateStateEnabled(Y.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(Y.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case`scale`:this._ringManipulator.updateStateEnabled(Y.RotateLeft|Y.RotateRight,!1),this._ringManipulator.updateStateEnabled(Y.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(Y.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(Y.ScaleIn|Y.ScaleOut|Y.RotateLeft|Y.RotateRight,!1)}_updateManipulatorTransform(){let e=m(j.get(),this.adapter.angle,T(0,0,1));if(e==null)return;let t=this.getScale(),n=h(j.get(),y(M.get(),t,t,t));this._ringManipulator.modelTransform=g(j.get(),n,e)}_createRingManipulator(){let e=(e,t,n)=>{let r=[],i=Math.ceil(U*(t-e)/(2*Math.PI));for(let a=0;a<i+1;a++){let o=e+a*(t-e)/i;r.push(T(n*Math.cos(o),n*Math.sin(o),0))}return r},t=t=>e(0,Math.PI*2,t),n=e=>[[-e/2,0],[e/2,0],[e/2,q/2],[-e/2,q/2]],r=this._createMaterial(1),i=(e,t,i=r)=>de(i,n(t),e,[],[],!1),a=t(R),o=i(a,L),s={left:[],right:[]},c=[];for(let t=0;t<2;t++){let n=t*Math.PI-Math.PI/4,a=Math.PI/2-W,o=n+a,l=n+Math.PI/2-a,u=e(o,l,ie),d=i(u,H);c.push(u),c.push(e(o,l,z-L/2)),s.left.push(d),s.right.push(d.instantiate());for(let e=0;e<2;e++){let t=e===0,n=ee();if(t){_(n,n,[1,-1,1]),v(n,n,-o,[0,0,1]);let e=Math.round(I*(u.length-1));n[12]=u[e][0],n[13]=u[e][1],n[14]=u[e][2]}else{v(n,n,l,[0,0,1]);let e=Math.round((1-I)*(u.length-1));n[12]=u[e][0],n[13]=u[e][1],n[14]=u[e][2]}let i=le(r,oe,0,ae,q);ue(i,n),(t?s.left:s.right).push(i)}}let l=[];for(let t=0;t<2;t++){let n=t*Math.PI-Math.PI/4,r=Math.PI/2-G,a=e(n+r,n+Math.PI/2-r,z);l.push(i(a,H))}let u=this._createMaterial(.66),d=this._createMaterial(.5),f=this._createMaterial(.33),p=t(R+B),m=t(R+V),h=i(p,H,u),g=i(m,H,f),y=t(R-B),b=t(R-V),x=i(y,H,u),S=i(b,H,f),C=[new F(o,Y.DelayedFocused),new F(o.instantiate({material:d}),0)];this.mode&&this.mode!==`scale`||(C=C.concat([...l.map(e=>new F(e,Y.DelayedFocused|Y.Unlocked)),new F(h,Y.DelayedFocused|Y.ScaleIn),new F(g,Y.DelayedFocused|Y.ScaleIn),new F(x,Y.DelayedFocused|Y.ScaleOut),new F(S,Y.DelayedFocused|Y.ScaleOut)])),this.mode&&this.mode!==`rotate`||(C=C.concat([...s.right.map(e=>new F(e.instantiate(),Y.DelayedFocused|Y.Unlocked)),...s.left.map(e=>new F(e,Y.DelayedFocused|Y.RotateLeft)),...s.right.map(e=>new F(e,Y.DelayedFocused|Y.RotateRight))]));let w=[a,...c];return new N({view:this.tool.view,renderObjects:C,autoScaleRenderObjects:!1,worldOriented:!0,radius:L,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:this.tool.object.elevationInfo,collisionType:{type:`ribbon`,paths:w,direction:T(0,0,1)}})}_createMaterial(e){let t=new fe({cullFace:2,renderOccluded:2,isDecoration:!0},this.tool.view.state.isGlobal);return this.addHandles(c(()=>n(this.tool.view.effectiveTheme.accentColor,e),e=>t.setParameters({color:e}),l)),t}get test(){}};e([f({constructOnly:!0})],X.prototype,`tool`,void 0),e([f({constructOnly:!0})],X.prototype,`adapter`,void 0),e([f({constructOnly:!0})],X.prototype,`toolOptions`,void 0),e([f()],X.prototype,`mode`,void 0),e([f()],X.prototype,`_activeAnimation`,void 0),e([f()],X.prototype,`updating`,null),X=e([p(`esri.views.3d.interactive.editingTools.transform.ScaleRotateTransform`)],X);function me(e,t){let n=b(M.get(),t.renderStart,e.origin),r=b(M.get(),t.renderEnd,e.origin),i=x(n),a=x(r);return i===0?0:a/i}function he(e,t,n,r){let{renderStart:i,renderEnd:a}=e,o=Z(i,r,M.get()),s=Z(a,r,M.get());if(S(o,s)<J*J)return null;let c=b(M.get(),i,n),l=C(M.get(),c,O(t)),u=i,d=w(M.get(),u,l),f=Z(n,r,M.get()),p=o,m=Z(d,r,M.get()),h=b(M.get(),m,p),g=b(M.get(),o,f),_=k(p,h),v=k(f,g);return A(_,s)<A(v,s)?`rotate`:`scale`}function Z(e,t,n){return t.projectToScreen(e,$),y(n,$[0],$[1],0)}function Q(e,t){let n=null,r=1,i=()=>r;return{start:()=>{r=e.getScale(),n=e.getScale,e.getScale=i,t()},update:e=>{let n=(r+1)/2-r;return r+=n*Math.min(e*ce,1),t(),+(Math.abs(r-1)<.01)},destroy:()=>{n&&(e.getScale=n),t()}}}function ge(e,t,n){let r=0,i=null,a=()=>!1;return{start:()=>{i=e.getFocused,e.getFocused=a,r=0,t()},update:e=>(r+=e,+(!i?.()||r>=n.delayMs)),destroy:()=>{i&&(e.getFocused=i),t()}}}const $=d();export{X as ScaleRotateTransform};
|