@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 has from"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as r,removeMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a,createAbortError as o}from"../../../core/promiseUtils.js";import{initial as s,watch as c,when as l}from"../../../core/reactiveUtils.js";import{schedule as u}from"../../../core/scheduling.js";import{isUint8Array as d,isFloat32Array as f,isUint32Array as p,isUint16Array as m}from"../../../core/typedArrayUtil.js";import{property as h,subclass as g}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as _,invert as v}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as y,IDENTITY as b}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as x}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as S}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as C,sub as w,dot as T,set as E}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as D,freeze as O,clone as k,ZEROS as A,fromValues as j}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as ee,clone as te,ONES as ne}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as M,isMars as N,getReferenceEllipsoid as P,SphericalECEFSpatialReferenceLike as F}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as I}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as re}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as ie}from"../../../geometry/projection/projectVectorToVector.js";import{create as ae}from"../../../geometry/support/aaBoundingRect.js";import{isInEffectiveScaleRange as oe,validateScaleRange as se}from"../../../geometry/support/scaleUtils.js";import{isCGCS2000 as ce}from"../../../geometry/support/spatialReferenceUtils.js";import{BufferViewVec4u8 as le,BufferViewVec3u8 as ue,BufferViewVec2f as L,BufferViewVec3f as R,BufferViewUint32 as z,BufferViewUint16 as B}from"../../../geometry/support/buffer/BufferView.js";import{nullId as V}from"../../../layers/ILyr3DWasmPerSceneView.js";import H from"../../../layers/support/SceneModification.js";import{validateEntity3D as U,makeCacheKey as W,isValidHandle as G}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as K}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as de}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as fe}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as pe}from"./Lyr3DViewPerformanceInfo.js";import{getLyr3DWasm as me}from"./Lyr3DWasm.js";import{toWasmModification as he}from"./SceneLayerWorkerHandle.js";import{IntegratedMesh3DTilesLayerView3DSymbol as ge}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as _e,alphaModeConversion as ve,faceCullingConversion as ye,wrapModeConversion as be}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as xe}from"./support/makeScheduleFunction.js";import{intersectsRay as q,intersectsSphere as Se}from"./support/tileBoundingVolumeUtils.js";import{Tiles3DLayerViewRegistration as Ce}from"./support/Tiles3DLayerViewRegistration.js";import{Tiles3DMeshIntersectionHandler as we}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as Te}from"../state/Frustum.js";import{ElevationRange as Ee}from"../support/ElevationRange.js";import{toBoundingRect as De}from"../support/extentUtils.js";import{Obb as Oe}from"../support/orientedBoundingBox.js";import{glLayout as ke}from"../support/buffer/glUtil.js";import{getGroundTransparencyModeFromOpacity as Ae}from"../terrain/TransparencyMode.js";import{ComponentGeometryParameters as je,SourceGeometry as Me}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as Ne}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Pe}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as Fe}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as Ie}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as Le}from"../webgl-engine/materials/pbrUtils.js";import Re from"../../layers/LayerView.js";import{TaskPriority as ze}from"../../support/Scheduler.js";import{CompressedTextureFormat as J,SizedPixelFormat as Y}from"../../webgl/enums.js";import{alphaCutoff as X}from"../../../webscene/support/AlphaCutoff.js";var Z;function Be(e,t,n){if(t===`image/vnd-ms.dds`)switch(n){case`Dxt1`:return J.COMPRESSED_RGB_S3TC_DXT1_EXT;case`Dxt5`:return J.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if(t===`image/ktx`)return n===`Etc1`?J.COMPRESSED_RGB8_ETC2:null;switch(e){case 33319:return Y.RG8;case 6407:return Y.RGB8;case 6408:return Y.RGBA8;case 6403:return Y.R8;default:return null}}let Q=class extends fe(Re){static{Z=ge}constructor(e){super(e),this[Z]=!0,this.type=`integrated-mesh-3dtiles`,this._registration=new Ce(this),this.skipHeightModelInfoValidation=!0,this.freeze=!1,this._modifications=[],this._visibleGeometryChangedSchedulerHandle=null,this._initializationController=null,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this.fullExtentInLocalViewSpatialReference=null,this._applySSAO=!has(`disable-feature:im-ssao`),this._imShading=!!has(`enable-feature:im-shading`),this._imVertexNormals=!!has(`enable-feature:im-vertex-normals`),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._dbgFlags=new Set;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._frameTask=t.scheduler.registerTask(ze.TILES3D,this),this._frustum=new Te(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{a(t);let n=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=n}):null}canRecycleWith(e){return e.url===this.layer.url&&e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain===this._replacesTerrain}initialize(){this._dbg(2,`Tiles3DLayerView3D initialize() called`);let{view:e}=this;this._workerHandle=new de(xe(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),this._initializationController=new AbortController,this.addResolvingPromise(this._registration.initialize(this._initializationController.signal,()=>this._initializeRegistered(e)))}_initializeRegistered(e){let t=new we(this);this._intersectionHandler=t,this._registration.registerQueries(t,this._getElevationContext()),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.overlayManager.renderer.isEmpty,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),s),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),s),this._updatingHandles.add(()=>this.layer.isUsedAsGroundLayer,()=>this._groundUsageChanged()),e.overlayManager.registerDrapeTarget(this),this.addHandles([c(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),l(()=>this.fullOpacity,()=>this._opacityChange())]),this._registration.synchronizeSuspension(),this.addHandles(c(()=>this.freeze,e=>{e?this._wasm?.incrementFrozenLayerViewCount(this):(this._wasm?.decrementFrozenLayerViewCount(this),this._cameraChanged())})),this._initializationController=null,this.addHandles(c(()=>this._replacesTerrain&&!!this._wasm?.isTerrainReady||!this._replacesTerrain&&!!has(`enable-feature:im-as-ground`)&&this.layer.isUsedAsGroundLayer,e=>{this.layer.queryElevationCallback=e?(e,t)=>this._queryElevation(e,t):null},s))}destroy(){this.freeze=!1,this._initializationController=n(this._initializationController),this._dbg(2,`Tiles3DLayerView3D destroy() called`),this._workerHandle?.destroyContextAndSelf(this.uid),this._registration.unregisterWasm(),this.layer.queryElevationCallback=null,this._registration.unregisterQueries(e=>{let t=Array.from(this._lyrHandleToObjects.values()),n=t.reduce((e,{componentObjects:t})=>e+t.length,0);e.notifyObjectsChangedFunctional(n,e=>{for(let{componentObjects:n}of t)for(let{obb:t}of n)if(!e(t))return})}),this._intersectionHandler=null,this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=r(this._updatingHandles),this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=i(this._visibleGeometryChangedSchedulerHandle)}get usedAsGround(){return this.layer.isUsedAsGroundLayer}get replacesTerrain(){return this._replacesTerrain}get fullOpacity(){return has(`enable-feature:im-as-ground`)?this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity:this.replacesTerrain?this.view.map.ground.opacity:1}get opaque(){return this._groundTransparencyMode===0}get invisible(){return this._groundTransparencyMode===3}get _groundTransparencyMode(){return(has(`enable-feature:im-as-ground`)?!this.usedAsGround:!this._replacesTerrain)?0:Ae(this.fullOpacity,this.view.overlayManager.renderer.isEmpty)}get _renderOpacity(){switch(this._groundTransparencyMode){case 3:return 0;case 2:return X;default:return this.fullOpacity}}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){let e=this._renderOpacity,t=this._groundTransparencyMode;this.forEachComponentObject(n=>this._collection.updateObjectOpacity(n,e,t))}_getElevationContext(){return this.replacesTerrain?0:has(`enable-feature:im-as-ground`)?this.usedAsGround?1:2:1}_groundUsageChanged(){this._registration.setElevationContext(this._getElevationContext()),this._intersectionHandler.isGround=!has(`enable-feature:im-as-ground`)||this.usedAsGround,this._intersectionHandler.slicePlaneEnabled=this.slicePlaneEnabled&&!this.replacesTerrain,this.view.overlayManager.unregisterDrapeTarget(this),this.view.overlayManager.registerDrapeTarget(this),this._loadModifications();let e=has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,t=this._renderOpacity,n=this._groundTransparencyMode;this.forEachComponentObject(r=>r.updateMaterial({isGround:e,opacity:t,groundTransparencyMode:n}))}_cameraChanged(){if(this.freeze)return;let e=this._frustum;e.update(this.view.state.contentCamera);let t=this._visibleObjects,n=!1;this._loadedObjects.forEach(r=>{let i=r.obb?.intersectsFrustum(e)??!1;i!==r.isVisible&&(r.isVisible=i,i?t.add(r):t.delete(r),r.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,i)),n||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(i,r.elevationRange))}),n&&this._setVisibleElevationRangeDirty()}intersect(e,t,n,r){this._intersectionHandler.intersectRay(e,t,n,r,null,!1)}get ready(){return!this.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){let e=this.useEsriCrs?this.layer.supportedSpatialReferences[1]:this.layer.supportedSpatialReferences[0],t=he(this._layerClippingArea,this._modifications,e,this.view.state.isGlobal);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){let e=this.layer.spatialReference,t=ae();this._layerClippingArea=De(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=u(()=>{this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,K(e))}get _wasm(){return me(this.view)}_queryElevation(e,t){return this.destroying||this.destroyed?Promise.reject(o()):this._wasm?.queryElevation(this,e,t)??Promise.reject(o())}get wasmLayerId(){return this._registration.wasmLayerId}get metersPerVCSUnit(){return this._registration.metersPerVCSUnit}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._registration.useEsriCrs}get visibleAtCurrentScale(){return this.replacesTerrain||oe(this.layer.effectiveScaleRange,this.view.scale)}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this.replacesTerrain||se(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,n=0,r=0,i=0,a=0;return this._lyrHandleToObjects.forEach(o=>{o.isLoaded?(e+=o.textureMemoryUsage,t+=o.vboMemoryUsage,i++):(n+=o.textureMemoryUsage,r+=o.vboMemoryUsage,a++)}),new pe(this.usedMemory,i,a,$(t),$(e),$(r),$(n))}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._registration.elevationProvider}get elevationOffset(){return K(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){let e=new Ee;this._visibleObjects.size===0?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));let t=this._get(`visibleElevationRange`);return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange(`visibleElevationRange`)}_forEachRelevantVisibleTile(e){let{view:t}=this,{spatialReference:n}=t,r=n.isWGS84||n.isWebMercator||ce(n)||M(n)||N(n);if(this.view.state.isGlobal||!r)return this.forEachVisibleTile(e);let i=P(n).radius,{eye:a,viewForward:o,near:s}=t.state.contentCamera,c=C(D(),o),l=Math.max(a[2],500),u=l+i,d=Math.sqrt(u**2-i**2),f=Math.abs(Math.atan2(d,i))*i,p=l>.5*i?.5*Math.PI*i:f,m=D();this.forEachVisibleTile(t=>{let{mbsRadius:n,mbsCenter:r}=t;if(n<0)return;w(m,r,a);let i=T(m,c);Math.abs(i)<p&&i+n>s&&i-n<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(let t of this._visibleObjects)e(t)}forEachTile(e){for(let t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(let{componentObjects:n}of e)for(let e of n)t(e)}get drapeTargetType(){return has(`enable-feature:im-as-ground`)?+!this.usedAsGround:+!this.replacesTerrain}isUpdating(){let e=this._wasm;return!this.freeze&&this.wasmLayerId>=0&&e!=null&&e.isUpdating(this.wasmLayerId)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let{entity3d:t}=e;if(!U(t))throw Error(`entity3D not valid`);let n=new Map,r;try{r=this._createPrimitiveTextureBundles(t,n)}catch(e){throw n.forEach(e=>this._stage?.removeTexture(e)),e}let i=null;try{if(i=await this._createRenderableMain(t,r),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance`);let{tileObb:a,componentObjects:o,elevationRange:s}=i,c=0,l=0,u=0;for(let e of o){let{texture:t,textureMetallicRoughness:n,textureEmissive:r,textureOcclusion:i,textureNormal:a}=e.renderable.drawParameters;c+=(t?.usedMemory??0)+(n?.usedMemory??0)+(r?.usedMemory??0)+(i?.usedMemory??0)+(a?.usedMemory??0),l+=this._collection.getObjectGPUMemoryUsage(e),u+=e.intersectionGeometry.usedMemory}let d=Array.from(n.values()),f=new He(e.handle,o,d,u,l,c,a,e.stableNodeId,e.nodeDepth,s);return this._lyrHandleToObjects.set(e.handle,f),()=>{this._memCache.put(W(f.handle),f);let{usedMemory:e}=f;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(e){throw r.forEach(e=>e.cleanup()),i?.componentObjects.forEach(e=>this._collection.destroyObject(e)),n.forEach(e=>this._stage?.removeTexture(e)),e}}_createPrimitiveTextureBundles(e,t){let n=[];try{let r=e.desc.geometry;for(let i of e.validPrimitiveIndices){let a=r.prims[i].materialId,o=e.desc.materials?.materials&&a!=null&&a!==V?e.desc.materials.materials[a]:null,s=Promise.resolve(We),c=null,l=null,u=null,d=null,f=null;if(o){let n=o.lightingModel===`Pbr`;c=this._getTexture(o.baseColorTex,e,t),l=n?this._getTexture(o.metalTex,e,t):null,u=n?this._getTexture(o.emissiveTex,e,t):null,d=n?this._getTexture(o.occlusionTex,e,t):null,f=n?this._getTexture(o.normalTex,e,t):null;let r=[c,l,u,d,f].map(e=>e?.loadPromise??null);s=Promise.all(r)}n.push(new Ge(s,c,l,u,d,f))}}catch(e){throw n.forEach(e=>e.cleanup()),e}return n}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy`);let n=[],r=e.desc,i=O(...e.origin),a=this.view.groundView.spatialReference,o=this.view.state.isGlobal,s=b;if(o){let e=x();I(F,i,e,a),s=_(y(),e)}let c=Ue(r.obb),l=o?P(this.view.spatialReference).radius:0,u=o?Math.hypot(c.centerX,c.centerY,c.centerZ)-l:c.centerZ,d=o?Math.max(-l,u-c.radius):u-c.radius,f=u+c.radius,p=[];try{let u=-1;for(let n of e.validPrimitiveIndices){u+=1;let i=r.geometry.prims[n],a=t[u];if(this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(i)),_e[i.ptype]==null){this._dbg(2,`[Unsupported Feature] Unsupported primitive mode (`+i.ptype+`). Skipping primitive.`),a.cleanup();continue}let{positionView:o,normalsData:s,colorView:c,texCoord0Data:l,indicesView:d}=this._getBufferViews(i,e);if(o==null||d==null){a.cleanup();continue}let f=o.count,m=(e,t)=>e!=null&&e!==f?(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1):!0;!m(l==null?void 0:l.length/2,`numTexcoord`)||!m(c?.count,`numColors`)||!m(s?.length,`normals`)?a.cleanup():p.push({componentIndex:u,positionView:o,indicesView:d,texCoord0Data:l,colorView:c,normalsData:s})}let m=s!==b,h=m?v(y(),s)??b:b,{vertexProcessingOutputs:g,obbHalfSizeAccumulator:_,elevationRange:x}=await this._workerHandle.processTiles3DVertices(p,i,l,o,s,c,this._imVertexNormals&&!this.usedAsGround);if(this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);let S=r.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);g.length>0&&c.setHalfSize(_);for(let o of g){let{componentIndex:s,positionView:l,indicesView:u,layout:d,textureCoordinateType:f,interleavedVertexData:p,indices:g}=o,_=e.validPrimitiveIndices[s],v=r.geometry.prims[_],y=t[s],b=c.clone(),x=ke(d),C=new Uint32Array([0,u.typedBuffer.length]),w=new je(x,this._imShading?2:0,f,m?2:0),T=new Me({interleavedVertexData:p,vertexCount:p.byteLength/x[0].stride,indexData:g},{positions:l.typedBuffer,indices:u.typedBuffer},C,w),E=this.view.renderSpatialReference,O=D(),k=[1,1,1];re(i,E,k,a)||this._dbg(3,`Unsupported coordinate system for IM overlay`),ie(i,E,O,a);let A=this._createComponentMaterialInitParameters(S,v.materialId,y);A.baseColorTexture||this._dbg(3,`No colour texture 1`);let j=this._collection.createObject({toMapSpace:ee(O[0],O[1],k[0],k[1]),transform:new Ne(i,h),obb:b,geometry:T,elevationAlignable:!1},A);n.push(j)}return x.minElevation=Math.max(x.minElevation,d),x.maxElevation=Math.min(x.maxElevation,f),{tileObb:c,componentObjects:n,elevationRange:x}}catch(e){throw n.forEach(e=>this._collection.destroyObject(e)),e}}_createComponentMaterialInitParameters(e,t,n){let r=e?.materials!=null&&t!=null&&t!==V?e.materials[t]:null,i=1,a=r?.baseColorTex?.imageId;if(a!=null&&e&&Array.isArray(e.images)&&a>=0&&a<e.images.length){let t=e.images[a];t.alpha&&(i=ve[t.alpha])}let o=(r==null?`Unlit`:r.lightingModel)===`Pbr`,s=ne,c=X,l=!1,u=2,d=j(0,0,0),f=k(Le),p=n.baseColorTexture,m=n.metallicRoughnessTexture,h=n.emissionTexture,g=n.occlusionTexture,_=n.normalTexture;return r&&(s=te(r.baseColorFactor),c=r.alphaCutoff??X,o&&(E(f,r.metallicFactor,r.roughnessFactor,0),r.emissiveFactor&&(d=r.emissiveFactor)),l=r.isDoubleSided,u=ye[r.faceCulling??`NotSet`]),{isIntegratedMesh:!0,baseColor:s,textureAlphaCutoff:c,mrrFactors:f,baseColorTexture:p,metallicRoughnessTexture:m,normalTexture:_,occlusionTexture:g,emissionTexture:h,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:i,doubleSided:l,cullFace:u,isGround:has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,groundTransparencyMode:this._groundTransparencyMode,emissiveBaseColor:d,usePBR:o,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this._renderOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){let t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){let t=W(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,n){if(this.destroyed||this.destroying)return;let r=this._frustum,i=[],a=!1,o=!1;for(let s=0;s<n;++s){if(!t[s])continue;let n=e[s],c=this._lyrHandleToObjects.get(n);if(c){if(c.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${c.stableNodeId}`);continue}a=!0,c.isLoaded=!0,this._loadedObjects.add(c),this._intersectionHandler.addTile(c),this._usedMemory+=c.usedMemory,this._cacheMemory-=c.usedMemory;let e=c.obb?.intersectsFrustum(r)??!0;c.isVisible=e,e&&(this._visibleObjects.add(c),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,c.elevationRange)),i.push(c.obb),c.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(W(n))}else this._dbg(3,`Tried to mark Non existent object ${n} as loaded`)}for(let r=0;r<n;++r){let n=e[r];if(t[r])continue;let a=this._lyrHandleToObjects.get(n);if(a){if(!a.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${a.stableNodeId}`);continue}let e=a.isVisible;this._visibleObjects.delete(a),a.isVisible=!1,a.isLoaded=!1,this._loadedObjects.delete(a),this._intersectionHandler.removeTile(a),e&&(this._visibleGeometryChanged(),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,a.elevationRange)),this._usedMemory-=a.usedMemory,this._cacheMemory+=a.usedMemory,i.push(a.obb),a.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(W(n),a)}else this._dbg(3,`Tried to mark Non existent object ${n} as not loaded`)}a&&this._visibleGeometryChanged(),i.length>0&&this.elevationProvider.notifyObjectsChanged(i),o&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){let{visibleElevationRange:n}=this,{minElevation:r,maxElevation:i}=t;return e?r<n.minElevation||i>n.maxElevation:r===n.minElevation||i===n.maxElevation}_getTexture(e,t,n){let r=e&&t.desc.materials?.images?.[e.imageId];if(!r||!G(r.data))return null;let i=t.assets[r.data];if(!i||i.byteCount<1||i.dataType!==`U8`)return null;let a=n.get(r)??this._createTexture(e,r,i,n);return a?new Pe(this._stage.renderView.textures,a.id):null}_createTexture(e,n,r,i){let a=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,o=n.mipCount?!0:a>1,s=be[e.wrapMode??`None`],c=n.alpha?6408:6407,l=new Uint8Array(r.data.buffer,0,r.byteCount),u=null,d=null;switch(n.format){case`Raw`:if(n.pixelFormat===`R8`)u=l,c=6403,d=``;else if(n.pixelFormat===`Rg8`||n.pixelFormat===`Ga8`)u=l,c=33319,d=``;else if(n.pixelFormat===`Rgb8`)u=l,c=6407,d=``;else if(n.pixelFormat===`Rgba8`)u=l,c=6408,d=``;else return t.getLogger(this).error(`Raw texture pixel format ${n.pixelFormat} not supported`),null;break;case`Dxt1`:u=l,c=6407,d=`image/vnd-ms.dds`;break;case`Dxt5`:u=l,c=6408,d=`image/vnd-ms.dds`;break;case`Basis`:u=l,c=6407,d=`image/ktx2`;break;case`Etc1`:u=l,c=6407,d=`image/ktx`;break;default:return t.getLogger(this).error(`${n.format} texture not supported`),null}if(u&&d!=null){let e=Be(c,d,n.format),t=new Fe(u,{mipmap:o,maxAnisotropy:a,encoding:d,wrap:s,pixelFormat:c,internalFormat:e??void 0,immutable:e!=null,noUnpackFlip:!0,width:n.mip0Width,height:n.mip0Height});return this._stage.addTexture(t),i.set(n,t),t}return null}_getBufferViews(e,t){let n,r,i,a;for(let o=0;o<e.atrbs.length;o++){let s=e.atrbs[o],c=t.assets[s.assetId];if(!c)continue;let l=c.data.buffer,u=c.byteCount;try{switch(s.sem){case`Position`:c.ncomp!==3||c.dataType!==`F32`||!f(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Position (`+c+`)`):n=new R(l,0,void 0,u);break;case`Normal`:if(c.ncomp!==3||c.dataType!==`F32`||!f(c.data))this._dbg(3,`[Unsupported Feature] Unsupported view for Normal (`+c+`)`);else{let e=new R(l,0,void 0,u);a=new Uint32Array(e.count),Ie(e.typedBuffer,new Int16Array(a.buffer,a.byteOffset,a.length*2))}break;case`TexCoord`:c.ncomp!==2||c.dataType!==`F32`||!f(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Texcoord (`+c+`)`):i===void 0&&(i=new L(l,0,void 0,u).typedBuffer);break;case`Color`:c.dataType===`U8`&&d(c.data)&&(c.ncomp===4?r=new le(l,0,void 0,u):c.ncomp===3&&(r=new ue(l,0,void 0,u))),r??this._dbg(3,`[Unsupported Feature] Unsupported view for Color (`+c+`)`);break;case`FeatureIndex`:break;default:this._dbg(2,`[Unsupported Feature] Unsupported semantic (`+s.sem+`). Skipping vertex attribute.`)}}catch(e){this._dbg(2,`Error Creating buffer (`+e+`). Skipping vertex attribute.`)}}let o,s=!1;if(G(e.index)){let n=t.assets[e.index];if(!n)s=!0;else{let e=n.byteCount;switch(n.dataType){case`U16`:n.ncomp===1&&m(n.data)&&(o=new B(n.data.buffer,0,void 0,e));break;case`U32`:n.ncomp===1&&p(n.data)&&(o=new z(n.data.buffer,0,void 0,e))}s=!o}}if(!s&&o==null&&n!=null){let e=n.count;o=o=e<65535?new B(new Uint16Array(e).buffer):new z(new Uint32Array(e).buffer);for(let t=0;t<e;t++)o.set(t,t)}return{positionView:n,colorView:r,texCoord0Data:i,indicesView:o,normalsData:a}}_loadModifications(){if(this.removeHandles(`modifications`),this.layer.modifications==null){this._modifications=[];return}let e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.usedAsGround&&e.type!==`replace`)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info(`Ground layers only support replace modifications. Other modification types have been ignored.`)},s),`modifications`)}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,n){this._dbgFlags.has(e)&&(e===3?t.getLogger(this).error(n):t.getLogger(this).warn(n))}};e([h()],Q.prototype,`freeze`,void 0),e([h()],Q.prototype,`fullOpacity`,null),e([h()],Q.prototype,`opaque`,null),e([h()],Q.prototype,`invisible`,null),e([h({readOnly:!0})],Q.prototype,`ready`,null),e([h({type:[H]})],Q.prototype,`_modifications`,void 0),e([h()],Q.prototype,`_visibleGeometryChangedSchedulerHandle`,void 0),e([h()],Q.prototype,`layer`,void 0),e([h({readOnly:!0})],Q.prototype,`visibleAtCurrentScale`,null),e([h({readOnly:!0})],Q.prototype,`_collection`,null),e([h()],Q.prototype,`elevationOffset`,null),e([h({readOnly:!0})],Q.prototype,`visibleElevationRange`,null),e([h()],Q.prototype,`fullExtentInLocalViewSpatialReference`,void 0),Q=e([g(`esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D`)],Q);const Ve=Q;class He{constructor(e,t,n,r,i,a,o,s,c,l){this.handle=e,this.componentObjects=t,this.textures=n,this.cpuMemoryUsage=r,this.vboMemoryUsage=i,this.textureMemoryUsage=a,this.obb=o,this.stableNodeId=s,this.nodeDepth=c,this.elevationRange=l,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;let u=D();o?.getCenter(u),this._obbCenterX=u[0],this._obbCenterY=u[1],this._obbCenterZ=u[2];let d=o?.radius??-1;this._obbRadius=d,this._obbRadiusSquared=d*d,this._obbShortestHalfsize=o?Math.min(o.halfSizeX,o.halfSizeY,o.halfSizeZ):0,this._mbsCenter=o?o.getCenter(D()):A}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){return q(this.obb,this._obbCenterX,this._obbCenterY,this._obbCenterZ,this._obbRadiusSquared,e,t)}boundingVolumeIntersectsSphere(e){return Se(this.obb,this._obbCenterX,this._obbCenterY,this._obbCenterZ,this._obbRadius,this._obbShortestHalfsize,e)}}function $(e){return Math.round(e/1048.576)/1e3}function Ue(e){return new Oe(e.center,e.halfSize,S(...e.quaternion))}const We=[];class Ge{constructor(e,t,n,r,i,a){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=n,this.emissionTexture=r,this.occlusionTexture=i,this.normalTexture=a}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}export{Ve as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as r,removeMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a,createAbortError as o}from"../../../core/promiseUtils.js";import{initial as s,watch as c,when as l}from"../../../core/reactiveUtils.js";import{schedule as u}from"../../../core/scheduling.js";import{isUint8Array as d,isFloat32Array as f,isUint32Array as p,isUint16Array as m}from"../../../core/typedArrayUtil.js";import{property as h,subclass as g}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as _,invert as v}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as y,IDENTITY as b}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as x}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as S}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as C,sub as w,dot as T,set as E}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as D,freeze as O,clone as k,ZEROS as A,fromValues as j}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as ee,clone as M,ONES as te}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as ne,isMars as N,getReferenceEllipsoid as P,SphericalECEFSpatialReferenceLike as F}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as I}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as L}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as re}from"../../../geometry/projection/projectVectorToVector.js";import{create as ie}from"../../../geometry/support/aaBoundingRect.js";import{isInEffectiveScaleRange as ae,validateScaleRange as oe}from"../../../geometry/support/scaleUtils.js";import{isCGCS2000 as se}from"../../../geometry/support/spatialReferenceUtils.js";import{BufferViewVec4u8 as ce,BufferViewVec3u8 as le,BufferViewVec2f as ue,BufferViewVec3f as R,BufferViewUint32 as z,BufferViewUint16 as B}from"../../../geometry/support/buffer/BufferView.js";import{nullId as V}from"../../../layers/ILyr3DWasmPerSceneView.js";import H from"../../../layers/support/SceneModification.js";import{validateEntity3D as U,makeCacheKey as W,isValidHandle as G}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as K}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as de}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as fe}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as pe}from"./Lyr3DViewPerformanceInfo.js";import{getLyr3DWasm as me}from"./Lyr3DWasm.js";import{toWasmModification as he}from"./SceneLayerWorkerHandle.js";import{IntegratedMesh3DTilesLayerView3DSymbol as ge}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as _e,alphaModeConversion as ve,faceCullingConversion as ye,wrapModeConversion as be}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as xe}from"./support/makeScheduleFunction.js";import{intersectsRay as Se,intersectsSphere as q}from"./support/tileBoundingVolumeUtils.js";import{Tiles3DLayerViewRegistration as Ce}from"./support/Tiles3DLayerViewRegistration.js";import{Tiles3DMeshIntersectionHandler as we}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as Te}from"../state/Frustum.js";import{ElevationRange as Ee}from"../support/ElevationRange.js";import{toBoundingRect as De}from"../support/extentUtils.js";import{Obb as Oe}from"../support/orientedBoundingBox.js";import{glLayout as ke}from"../support/buffer/glUtil.js";import{getGroundTransparencyModeFromOpacity as Ae}from"../terrain/TransparencyMode.js";import{ComponentGeometryParameters as je,SourceGeometry as Me}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as Ne}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Pe}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as Fe}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as Ie}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as Le}from"../webgl-engine/materials/pbrUtils.js";import Re from"../../layers/LayerView.js";import{TaskPriority as ze}from"../../support/Scheduler.js";import{CompressedTextureFormat as J,SizedPixelFormat as Y}from"../../webgl/enums.js";import{alphaCutoff as X}from"../../../webscene/support/AlphaCutoff.js";var Z;function Be(e,t,n){if(t===`image/vnd-ms.dds`)switch(n){case`Dxt1`:return J.COMPRESSED_RGB_S3TC_DXT1_EXT;case`Dxt5`:return J.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if(t===`image/ktx`)return n===`Etc1`?J.COMPRESSED_RGB8_ETC2:null;switch(e){case 33319:return Y.RG8;case 6407:return Y.RGB8;case 6408:return Y.RGBA8;case 6403:return Y.R8;default:return null}}let Q=class extends fe(Re){static{Z=ge}constructor(e){super(e),this[Z]=!0,this.type=`integrated-mesh-3dtiles`,this._registration=new Ce(this),this.skipHeightModelInfoValidation=!0,this.freeze=!1,this._modifications=[],this._visibleGeometryChangedSchedulerHandle=null,this._initializationController=null,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this.fullExtentInLocalViewSpatialReference=null,this._applySSAO=!has(`disable-feature:im-ssao`),this._imShading=!!has(`enable-feature:im-shading`),this._imVertexNormals=!!has(`enable-feature:im-vertex-normals`),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._dbgFlags=new Set;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._frameTask=t.scheduler.registerTask(ze.TILES3D,this),this._frustum=new Te(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{a(t);let n=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=n}):null}canRecycleWith(e){return e.url===this.layer.url&&e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain===this._replacesTerrain}initialize(){this._dbg(2,`Tiles3DLayerView3D initialize() called`);let{view:e}=this;this._workerHandle=new de(xe(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),this._initializationController=new AbortController,this.addResolvingPromise(this._registration.initialize(this._initializationController.signal,()=>this._initializeRegistered(e)))}_initializeRegistered(e){let t=new we(this);this._intersectionHandler=t,this._registration.registerQueries(t,this._getElevationContext()),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.overlayManager.renderer.isEmpty,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),s),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),s),this._updatingHandles.add(()=>this.layer.isUsedAsGroundLayer,()=>this._groundUsageChanged()),e.overlayManager.registerDrapeTarget(this),this.addHandles([c(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),l(()=>this.fullOpacity,()=>this._opacityChange())]),this._registration.synchronizeSuspension(),this.addHandles(c(()=>this.freeze,e=>{e?this._wasm?.incrementFrozenLayerViewCount(this):(this._wasm?.decrementFrozenLayerViewCount(this),this._cameraChanged())})),this._initializationController=null,this.addHandles(c(()=>this._replacesTerrain&&!!this._wasm?.isTerrainReady||!this._replacesTerrain&&!!has(`enable-feature:im-as-ground`)&&this.layer.isUsedAsGroundLayer,e=>{this.layer.queryElevationCallback=e?(e,t)=>this._queryElevation(e,t):null},s))}destroy(){this.freeze=!1,this._initializationController=n(this._initializationController),this._dbg(2,`Tiles3DLayerView3D destroy() called`),this._workerHandle?.destroyContextAndSelf(this.uid),this._registration.unregisterWasm(),this.layer.queryElevationCallback=null,this._registration.unregisterQueries(e=>{let t=Array.from(this._lyrHandleToObjects.values()),n=t.reduce((e,{componentObjects:t})=>e+t.length,0);e.notifyObjectsChangedFunctional(n,e=>{for(let{componentObjects:n}of t)for(let{obb:t}of n)if(!e(t))return})}),this._intersectionHandler=null,this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=r(this._updatingHandles),this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=i(this._visibleGeometryChangedSchedulerHandle)}get usedAsGround(){return this.layer.isUsedAsGroundLayer}get replacesTerrain(){return this._replacesTerrain}get fullOpacity(){return has(`enable-feature:im-as-ground`)?this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity:this.replacesTerrain?this.view.map.ground.opacity:1}get opaque(){return this._groundTransparencyMode===0}get invisible(){return this._groundTransparencyMode===3}get _groundTransparencyMode(){return(has(`enable-feature:im-as-ground`)?!this.usedAsGround:!this._replacesTerrain)?0:Ae(this.fullOpacity,this.view.overlayManager.renderer.isEmpty)}get _renderOpacity(){switch(this._groundTransparencyMode){case 3:return 0;case 2:return X;default:return this.fullOpacity}}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){let e=this._renderOpacity,t=this._groundTransparencyMode;this.forEachComponentObject(n=>this._collection.updateObjectOpacity(n,e,t))}_getElevationContext(){return this.replacesTerrain?0:has(`enable-feature:im-as-ground`)?this.usedAsGround?1:2:1}_groundUsageChanged(){this._registration.setElevationContext(this._getElevationContext()),this._intersectionHandler.isGround=!has(`enable-feature:im-as-ground`)||this.usedAsGround,this._intersectionHandler.slicePlaneEnabled=this.slicePlaneEnabled&&!this.replacesTerrain,this.view.overlayManager.unregisterDrapeTarget(this),this.view.overlayManager.registerDrapeTarget(this),this._loadModifications();let e=has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,t=this._renderOpacity,n=this._groundTransparencyMode;this.forEachComponentObject(r=>r.updateMaterial({isGround:e,opacity:t,groundTransparencyMode:n}))}_cameraChanged(){if(this.freeze)return;let e=this._frustum;e.update(this.view.state.contentCamera);let t=this._visibleObjects,n=!1;this._loadedObjects.forEach(r=>{let i=r.obb?.intersectsFrustum(e)??!1;i!==r.isVisible&&(r.isVisible=i,i?t.add(r):t.delete(r),r.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,i)),n||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(i,r.elevationRange))}),n&&this._setVisibleElevationRangeDirty()}intersect(e,t,n,r){this._intersectionHandler.intersectRay(e,t,n,r,null,!1)}get ready(){return!this.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){let e=this.useEsriCrs?this.layer.supportedSpatialReferences[1]:this.layer.supportedSpatialReferences[0],t=he(this._layerClippingArea,this._modifications,e,this.view.state.isGlobal);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){let e=this.layer.spatialReference,t=ie();this._layerClippingArea=De(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=u(()=>{this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,K(e))}get _wasm(){return me(this.view)}_queryElevation(e,t){return this.destroying||this.destroyed?Promise.reject(o()):this._wasm?.queryElevation(this,e,t)??Promise.reject(o())}get wasmLayerId(){return this._registration.wasmLayerId}get metersPerVCSUnit(){return this._registration.metersPerVCSUnit}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._registration.useEsriCrs}get visibleAtCurrentScale(){return this.replacesTerrain||ae(this.layer.effectiveScaleRange,this.view.scale)}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this.replacesTerrain||oe(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,n=0,r=0,i=0,a=0;return this._lyrHandleToObjects.forEach(o=>{o.isLoaded?(e+=o.textureMemoryUsage,t+=o.vboMemoryUsage,i++):(n+=o.textureMemoryUsage,r+=o.vboMemoryUsage,a++)}),new pe(this.usedMemory,i,a,$(t),$(e),$(r),$(n))}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._registration.elevationProvider}get elevationOffset(){return K(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){let e=new Ee;this._visibleObjects.size===0?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));let t=this._get(`visibleElevationRange`);return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange(`visibleElevationRange`)}_forEachRelevantVisibleTile(e){let{view:t}=this,{spatialReference:n}=t,r=n.isWGS84||n.isWebMercator||se(n)||ne(n)||N(n);if(this.view.state.isGlobal||!r)return this.forEachVisibleTile(e);let i=P(n).radius,{eye:a,viewForward:o,near:s}=t.state.contentCamera,c=C(D(),o),l=Math.max(a[2],500),u=l+i,d=Math.sqrt(u**2-i**2),f=Math.abs(Math.atan2(d,i))*i,p=l>.5*i?.5*Math.PI*i:f,m=D();this.forEachVisibleTile(t=>{let{mbsRadius:n,mbsCenter:r}=t;if(n<0)return;w(m,r,a);let i=T(m,c);Math.abs(i)<p&&i+n>s&&i-n<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(let t of this._visibleObjects)e(t)}forEachTile(e){for(let t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(let{componentObjects:n}of e)for(let e of n)t(e)}get drapeTargetType(){return has(`enable-feature:im-as-ground`)?+!this.usedAsGround:+!this.replacesTerrain}isUpdating(){let e=this._wasm;return!this.freeze&&this.wasmLayerId>=0&&e!=null&&e.isUpdating(this.wasmLayerId)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let{entity3d:t}=e;if(!U(t))throw Error(`entity3D not valid`);let n=new Map,r;try{r=this._createPrimitiveTextureBundles(t,n)}catch(e){throw n.forEach(e=>this._stage?.removeTexture(e)),e}let i=null;try{if(i=await this._createRenderableMain(t,r),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance`);let{tileObb:a,componentObjects:o,elevationRange:s}=i,c=0,l=0,u=0;for(let e of o){let{texture:t,textureMetallicRoughness:n,textureEmissive:r,textureOcclusion:i,textureNormal:a}=e.renderable.drawParameters;c+=(t?.usedMemory??0)+(n?.usedMemory??0)+(r?.usedMemory??0)+(i?.usedMemory??0)+(a?.usedMemory??0),l+=this._collection.getObjectGPUMemoryUsage(e),u+=e.intersectionGeometry.usedMemory}let d=Array.from(n.values()),f=new He(e.handle,o,d,u,l,c,a,e.stableNodeId,e.nodeDepth,s);return this._lyrHandleToObjects.set(e.handle,f),()=>{this._memCache.put(W(f.handle),f);let{usedMemory:e}=f;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(e){throw r.forEach(e=>e.cleanup()),i?.componentObjects.forEach(e=>this._collection.destroyObject(e)),n.forEach(e=>this._stage?.removeTexture(e)),e}}_createPrimitiveTextureBundles(e,t){let n=[];try{let r=e.desc.geometry;for(let i of e.validPrimitiveIndices){let a=r.prims[i].materialId,o=e.desc.materials?.materials&&a!=null&&a!==V?e.desc.materials.materials[a]:null,s=Promise.resolve(We),c=null,l=null,u=null,d=null,f=null;if(o){let n=o.lightingModel===`Pbr`;c=this._getTexture(o.baseColorTex,e,t),l=n?this._getTexture(o.metalTex,e,t):null,u=n?this._getTexture(o.emissiveTex,e,t):null,d=n?this._getTexture(o.occlusionTex,e,t):null,f=n?this._getTexture(o.normalTex,e,t):null;let r=[c,l,u,d,f].map(e=>e?.loadPromise??null);s=Promise.all(r)}n.push(new Ge(s,c,l,u,d,f))}}catch(e){throw n.forEach(e=>e.cleanup()),e}return n}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy`);let n=[],r=e.desc,i=O(...e.origin),a=this.view.groundView.spatialReference,o=this.view.state.isGlobal,s=b;if(o){let e=x();I(F,i,e,a),s=_(y(),e)}let c=Ue(r.obb),l=o?P(this.view.spatialReference).radius:0,u=o?Math.hypot(c.centerX,c.centerY,c.centerZ)-l:c.centerZ,d=o?Math.max(-l,u-c.radius):u-c.radius,f=u+c.radius,p=[];try{let u=-1;for(let n of e.validPrimitiveIndices){u+=1;let i=r.geometry.prims[n],a=t[u];if(this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(i)),_e[i.ptype]==null){this._dbg(2,`[Unsupported Feature] Unsupported primitive mode (`+i.ptype+`). Skipping primitive.`),a.cleanup();continue}let{positionView:o,normalsData:s,colorView:c,texCoord0Data:l,indicesView:d}=this._getBufferViews(i,e);if(o==null||d==null){a.cleanup();continue}let f=o.count,m=(e,t)=>e!=null&&e!==f?(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1):!0;!m(l==null?void 0:l.length/2,`numTexcoord`)||!m(c?.count,`numColors`)||!m(s?.length,`normals`)?a.cleanup():p.push({componentIndex:u,positionView:o,indicesView:d,texCoord0Data:l,colorView:c,normalsData:s})}let m=s!==b,h=m?v(y(),s)??b:b,{vertexProcessingOutputs:g,obbHalfSizeAccumulator:_,elevationRange:x}=await this._workerHandle.processTiles3DVertices(p,i,l,o,s,c,this._imVertexNormals&&!this.usedAsGround);if(this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);let S=r.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);g.length>0&&c.setHalfSize(_);for(let o of g){let{componentIndex:s,positionView:l,indicesView:u,layout:d,textureCoordinateType:f,interleavedVertexData:p,indices:g,aabbInWorldCoordinates:_}=o,v=e.validPrimitiveIndices[s],y=r.geometry.prims[v],b=t[s],x=c.clone(),C=ke(d),w=new Uint32Array([0,u.typedBuffer.length]),T=new je(C,this._imShading?2:0,f,m?2:0),E=new Me({interleavedVertexData:p,vertexCount:p.byteLength/C[0].stride,indexData:g},{positions:l.typedBuffer,indices:u.typedBuffer},w,T),O=this.view.renderSpatialReference,k=D(),A=[1,1,1];L(i,O,A,a)||this._dbg(3,`Unsupported coordinate system for IM overlay`),re(i,O,k,a);let j=this._createComponentMaterialInitParameters(S,y.materialId,b);j.baseColorTexture||this._dbg(3,`No colour texture 1`);let M=this._collection.createObject({toMapSpace:ee(k[0],k[1],A[0],A[1]),transform:new Ne(i,h),obb:x,geometry:E,elevationAlignable:!1,aabbInWorldCoordinates:_},j);n.push(M)}return x.minElevation=Math.max(x.minElevation,d),x.maxElevation=Math.min(x.maxElevation,f),{tileObb:c,componentObjects:n,elevationRange:x}}catch(e){throw n.forEach(e=>this._collection.destroyObject(e)),e}}_createComponentMaterialInitParameters(e,t,n){let r=e?.materials!=null&&t!=null&&t!==V?e.materials[t]:null,i=1,a=r?.baseColorTex?.imageId;if(a!=null&&e&&Array.isArray(e.images)&&a>=0&&a<e.images.length){let t=e.images[a];t.alpha&&(i=ve[t.alpha])}let o=(r==null?`Unlit`:r.lightingModel)===`Pbr`,s=te,c=X,l=!1,u=2,d=j(0,0,0),f=k(Le),p=n.baseColorTexture,m=n.metallicRoughnessTexture,h=n.emissionTexture,g=n.occlusionTexture,_=n.normalTexture;return r&&(s=M(r.baseColorFactor),c=r.alphaCutoff??X,o&&(E(f,r.metallicFactor,r.roughnessFactor,0),r.emissiveFactor&&(d=r.emissiveFactor)),l=r.isDoubleSided,u=ye[r.faceCulling??`NotSet`]),{isIntegratedMesh:!0,baseColor:s,textureAlphaCutoff:c,mrrFactors:f,baseColorTexture:p,metallicRoughnessTexture:m,normalTexture:_,occlusionTexture:g,emissionTexture:h,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:i,doubleSided:l,cullFace:u,isGround:has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,groundTransparencyMode:this._groundTransparencyMode,emissiveBaseColor:d,usePBR:o,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this._renderOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){let t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){let t=W(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,n){if(this.destroyed||this.destroying)return;let r=this._frustum,i=[],a=!1,o=!1;for(let s=0;s<n;++s){if(!t[s])continue;let n=e[s],c=this._lyrHandleToObjects.get(n);if(c){if(c.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${c.stableNodeId}`);continue}a=!0,c.isLoaded=!0,this._loadedObjects.add(c),this._intersectionHandler.addTile(c),this._usedMemory+=c.usedMemory,this._cacheMemory-=c.usedMemory;let e=c.obb?.intersectsFrustum(r)??!0;c.isVisible=e,e&&(this._visibleObjects.add(c),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,c.elevationRange)),i.push(c.obb),c.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(W(n))}else this._dbg(3,`Tried to mark Non existent object ${n} as loaded`)}for(let r=0;r<n;++r){let n=e[r];if(t[r])continue;let a=this._lyrHandleToObjects.get(n);if(a){if(!a.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${a.stableNodeId}`);continue}let e=a.isVisible;this._visibleObjects.delete(a),a.isVisible=!1,a.isLoaded=!1,this._loadedObjects.delete(a),this._intersectionHandler.removeTile(a),e&&(this._visibleGeometryChanged(),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,a.elevationRange)),this._usedMemory-=a.usedMemory,this._cacheMemory+=a.usedMemory,i.push(a.obb),a.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(W(n),a)}else this._dbg(3,`Tried to mark Non existent object ${n} as not loaded`)}a&&this._visibleGeometryChanged(),i.length>0&&this.elevationProvider.notifyObjectsChanged(i),o&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){let{visibleElevationRange:n}=this,{minElevation:r,maxElevation:i}=t;return e?r<n.minElevation||i>n.maxElevation:r===n.minElevation||i===n.maxElevation}_getTexture(e,t,n){let r=e&&t.desc.materials?.images?.[e.imageId];if(!r||!G(r.data))return null;let i=t.assets[r.data];if(!i||i.byteCount<1||i.dataType!==`U8`)return null;let a=n.get(r)??this._createTexture(e,r,i,n);return a?new Pe(this._stage.renderView.textures,a.id):null}_createTexture(e,n,r,i){let a=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,o=n.mipCount?!0:a>1,s=be[e.wrapMode??`None`],c=n.alpha?6408:6407,l=new Uint8Array(r.data.buffer,0,r.byteCount),u=null,d=null;switch(n.format){case`Raw`:if(n.pixelFormat===`R8`)u=l,c=6403,d=``;else if(n.pixelFormat===`Rg8`||n.pixelFormat===`Ga8`)u=l,c=33319,d=``;else if(n.pixelFormat===`Rgb8`)u=l,c=6407,d=``;else if(n.pixelFormat===`Rgba8`)u=l,c=6408,d=``;else return t.getLogger(this).error(`Raw texture pixel format ${n.pixelFormat} not supported`),null;break;case`Dxt1`:u=l,c=6407,d=`image/vnd-ms.dds`;break;case`Dxt5`:u=l,c=6408,d=`image/vnd-ms.dds`;break;case`Basis`:u=l,c=6407,d=`image/ktx2`;break;case`Etc1`:u=l,c=6407,d=`image/ktx`;break;default:return t.getLogger(this).error(`${n.format} texture not supported`),null}if(u&&d!=null){let e=Be(c,d,n.format),t=new Fe(u,{mipmap:o,maxAnisotropy:a,encoding:d,wrap:s,pixelFormat:c,internalFormat:e??void 0,immutable:e!=null,noUnpackFlip:!0,width:n.mip0Width,height:n.mip0Height});return this._stage.addTexture(t),i.set(n,t),t}return null}_getBufferViews(e,t){let n,r,i,a;for(let o=0;o<e.atrbs.length;o++){let s=e.atrbs[o],c=t.assets[s.assetId];if(!c)continue;let l=c.data.buffer,u=c.byteCount;try{switch(s.sem){case`Position`:c.ncomp!==3||c.dataType!==`F32`||!f(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Position (`+c+`)`):n=new R(l,0,void 0,u);break;case`Normal`:if(c.ncomp!==3||c.dataType!==`F32`||!f(c.data))this._dbg(3,`[Unsupported Feature] Unsupported view for Normal (`+c+`)`);else{let e=new R(l,0,void 0,u);a=new Uint32Array(e.count),Ie(e.typedBuffer,new Int16Array(a.buffer,a.byteOffset,a.length*2))}break;case`TexCoord`:c.ncomp!==2||c.dataType!==`F32`||!f(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Texcoord (`+c+`)`):i===void 0&&(i=new ue(l,0,void 0,u).typedBuffer);break;case`Color`:c.dataType===`U8`&&d(c.data)&&(c.ncomp===4?r=new ce(l,0,void 0,u):c.ncomp===3&&(r=new le(l,0,void 0,u))),r??this._dbg(3,`[Unsupported Feature] Unsupported view for Color (`+c+`)`);break;case`FeatureIndex`:break;default:this._dbg(2,`[Unsupported Feature] Unsupported semantic (`+s.sem+`). Skipping vertex attribute.`)}}catch(e){this._dbg(2,`Error Creating buffer (`+e+`). Skipping vertex attribute.`)}}let o,s=!1;if(G(e.index)){let n=t.assets[e.index];if(!n)s=!0;else{let e=n.byteCount;switch(n.dataType){case`U16`:n.ncomp===1&&m(n.data)&&(o=new B(n.data.buffer,0,void 0,e));break;case`U32`:n.ncomp===1&&p(n.data)&&(o=new z(n.data.buffer,0,void 0,e))}s=!o}}if(!s&&o==null&&n!=null){let e=n.count;o=o=e<65535?new B(new Uint16Array(e).buffer):new z(new Uint32Array(e).buffer);for(let t=0;t<e;t++)o.set(t,t)}return{positionView:n,colorView:r,texCoord0Data:i,indicesView:o,normalsData:a}}_loadModifications(){if(this.removeHandles(`modifications`),this.layer.modifications==null){this._modifications=[];return}let e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.usedAsGround&&e.type!==`replace`)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info(`Ground layers only support replace modifications. Other modification types have been ignored.`)},s),`modifications`)}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,n){this._dbgFlags.has(e)&&(e===3?t.getLogger(this).error(n):t.getLogger(this).warn(n))}};e([h()],Q.prototype,`freeze`,void 0),e([h()],Q.prototype,`fullOpacity`,null),e([h()],Q.prototype,`opaque`,null),e([h()],Q.prototype,`invisible`,null),e([h({readOnly:!0})],Q.prototype,`ready`,null),e([h({type:[H]})],Q.prototype,`_modifications`,void 0),e([h()],Q.prototype,`_visibleGeometryChangedSchedulerHandle`,void 0),e([h()],Q.prototype,`layer`,void 0),e([h({readOnly:!0})],Q.prototype,`visibleAtCurrentScale`,null),e([h({readOnly:!0})],Q.prototype,`_collection`,null),e([h()],Q.prototype,`elevationOffset`,null),e([h({readOnly:!0})],Q.prototype,`visibleElevationRange`,null),e([h()],Q.prototype,`fullExtentInLocalViewSpatialReference`,void 0),Q=e([g(`esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D`)],Q);const Ve=Q;class He{constructor(e,t,n,r,i,a,o,s,c,l){this.handle=e,this.componentObjects=t,this.textures=n,this.cpuMemoryUsage=r,this.vboMemoryUsage=i,this.textureMemoryUsage=a,this.obb=o,this.stableNodeId=s,this.nodeDepth=c,this.elevationRange=l,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;let u=D();o?.getCenter(u),this._obbCenterX=u[0],this._obbCenterY=u[1],this._obbCenterZ=u[2];let d=o?.radius??-1;this._obbRadius=d,this._obbRadiusSquared=d*d,this._obbShortestHalfsize=o?Math.min(o.halfSizeX,o.halfSizeY,o.halfSizeZ):0,this._mbsCenter=o?o.getCenter(D()):A}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){return Se(this.obb,this._obbCenterX,this._obbCenterY,this._obbCenterZ,this._obbRadiusSquared,e,t)}boundingVolumeIntersectsSphere(e){return q(this.obb,this._obbCenterX,this._obbCenterY,this._obbCenterZ,this._obbRadius,this._obbShortestHalfsize,e)}}function $(e){return Math.round(e/1048.576)/1e3}function Ue(e){return new Oe(e.center,e.halfSize,S(...e.quaternion))}const We=[];class Ge{constructor(e,t,n,r,i,a){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=n,this.emissionTexture=r,this.occlusionTexture=i,this.normalTexture=a}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}export{Ve as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{clone as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewUint16 as n,BufferViewUint32 as r,BufferViewVec3f as i,BufferViewVec3u8 as a,BufferViewVec3u16 as o,BufferViewVec4f as s,BufferViewVec4u8 as c,BufferViewVec4u16 as l}from"../../../geometry/support/buffer/BufferView.js";import{processTiles3DVertices as u}from"./support/IntegratedMesh3DTilesVertexProcessing.js";function d(){}function f(e){let{colorData:t,colorElementCount:n}=e;if(t==null||n===0)return;let r=t.byteOffset,u=r+t.byteLength;return n===3?t instanceof Float32Array?new i(t.buffer,r,void 0,u):t instanceof Uint8Array?new a(t.buffer,r,void 0,u):new o(t.buffer,r,void 0,u):t instanceof Float32Array?new s(t.buffer,r,void 0,u):t instanceof Uint8Array?new c(t.buffer,r,void 0,u):new l(t.buffer,r,void 0,u)}function p(e){return e.map((e,t)=>{let{indicesData:a}=e,o=e.positionData.byteOffset,s=o+e.positionData.byteLength,c=e.positionStride*Float32Array.BYTES_PER_ELEMENT,l=a.byteOffset,u=l+a.byteLength;return{componentIndex:t,positionView:new i(e.positionData.buffer,o,c,s),indicesView:a instanceof Uint16Array?new n(a.buffer,l,void 0,u):new r(a.buffer,l,void 0,u),texCoord0Data:e.texCoord0Data??void 0,colorView:f(e),normalsData:e.normalsData??void 0}})}function m(e,t){return e.map(e=>({positionData:t?e.positionView.typedBuffer:null,interleavedVertexData:e.interleavedVertexData,renderIndices:e.indices===e.indicesView.typedBuffer?null:e.indices}))}function h(e){let t=[];for(let n of e)n.positionData!=null&&t.push(n.positionData.buffer),t.push(n.interleavedVertexData),n.renderIndices!=null&&t.push(n.renderIndices.buffer);return t}async function g(n){let r={center:t(n.tileObbCenter),quaternionConjugate:e(n.tileObbQuaternionConjugate)},{vertexProcessingOutputs:i,obbHalfSizeAccumulator:a,elevationRange:o}=u(p(n.inputs),n.origin,n.ellipsoidRadius,n.isGlobal,n.ecefRotation,r,n.imVertexNormals),s=m(i,n.isGlobal),c=h(s);return{result:{outputs:s,obbHalfSizeAccumulator:t(a),minElevation:o.minElevation,maxElevation:o.maxElevation},transferList:c}}function _(e){}export{_ as destroyContext,d as initialize,g as processVertices};
|
|
2
|
+
import{clone as e}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{clone as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewUint16 as n,BufferViewUint32 as r,BufferViewVec3f as i,BufferViewVec3u8 as a,BufferViewVec3u16 as o,BufferViewVec4f as s,BufferViewVec4u8 as c,BufferViewVec4u16 as l}from"../../../geometry/support/buffer/BufferView.js";import{processTiles3DVertices as u}from"./support/IntegratedMesh3DTilesVertexProcessing.js";function d(){}function f(e){let{colorData:t,colorElementCount:n}=e;if(t==null||n===0)return;let r=t.byteOffset,u=r+t.byteLength;return n===3?t instanceof Float32Array?new i(t.buffer,r,void 0,u):t instanceof Uint8Array?new a(t.buffer,r,void 0,u):new o(t.buffer,r,void 0,u):t instanceof Float32Array?new s(t.buffer,r,void 0,u):t instanceof Uint8Array?new c(t.buffer,r,void 0,u):new l(t.buffer,r,void 0,u)}function p(e){return e.map((e,t)=>{let{indicesData:a}=e,o=e.positionData.byteOffset,s=o+e.positionData.byteLength,c=e.positionStride*Float32Array.BYTES_PER_ELEMENT,l=a.byteOffset,u=l+a.byteLength;return{componentIndex:t,positionView:new i(e.positionData.buffer,o,c,s),indicesView:a instanceof Uint16Array?new n(a.buffer,l,void 0,u):new r(a.buffer,l,void 0,u),texCoord0Data:e.texCoord0Data??void 0,colorView:f(e),normalsData:e.normalsData??void 0}})}function m(e,t){return e.map(e=>({positionData:t?e.positionView.typedBuffer:null,interleavedVertexData:e.interleavedVertexData,renderIndices:e.indices===e.indicesView.typedBuffer?null:e.indices,aabbInWorldCoordinates:e.aabbInWorldCoordinates}))}function h(e){let t=[];for(let n of e)n.positionData!=null&&t.push(n.positionData.buffer),t.push(n.interleavedVertexData),n.renderIndices!=null&&t.push(n.renderIndices.buffer);return t}async function g(n){let r={center:t(n.tileObbCenter),quaternionConjugate:e(n.tileObbQuaternionConjugate)},{vertexProcessingOutputs:i,obbHalfSizeAccumulator:a,elevationRange:o}=u(p(n.inputs),n.origin,n.ellipsoidRadius,n.isGlobal,n.ecefRotation,r,n.imVertexNormals),s=m(i,n.isGlobal),c=h(s);return{result:{outputs:s,obbHalfSizeAccumulator:t(a),minElevation:o.minElevation,maxElevation:o.maxElevation},transferList:c}}function _(e){}export{_ as destroyContext,d as initialize,g as processVertices};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{clone as n,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WorkerHandle as i}from"../../../core/workers/WorkerHandle.js";import{BufferViewVec3f as a}from"../../../geometry/support/buffer/BufferView.js";import{ElevationRange as o}from"../support/ElevationRange.js";import{createVertexBufferLayout as s,VertexBufferLayoutCreationParameters as c}from"../webgl-engine/collections/Component/SourceGeometry.js";function l(e){let t=[];for(let n of e.inputs)t.push(n.positionData.buffer,n.indicesData.buffer),n.texCoord0Data!=null&&t.push(n.texCoord0Data.buffer),n.colorData!=null&&t.push(n.colorData.buffer),n.normalsData!=null&&t.push(n.normalsData.buffer);return t}function u(i,a,o,s,c,l,u){return{inputs:i.map(e=>({positionData:e.positionView.typedBuffer.slice(),positionStride:e.positionView.typedBufferStride,indicesData:e.indicesView.typedBuffer.slice(),texCoord0Data:e.texCoord0Data==null?null:e.texCoord0Data.slice(),colorData:e.colorView==null?null:e.colorView.typedBuffer.slice(),colorElementCount:e.colorView?.elementCount===3||e.colorView?.elementCount===4?e.colorView.elementCount:0,normalsData:e.normalsData==null?null:e.normalsData.slice()})),origin:n(a),ellipsoidRadius:o,isGlobal:s,ecefRotation:e(c),tileObbCenter:l.getCenter(r()),tileObbQuaternionConjugate:l.getQuaternionConjugate(t()),imVertexNormals:u}}function d(e,t,n){return e.outputs.map((e,r)=>{let i=t[r],o=e.positionData==null?i.positionView:new a(e.positionData.buffer,e.positionData.byteOffset,i.positionView.typedBufferStride*Float32Array.BYTES_PER_ELEMENT,e.positionData.byteOffset+e.positionData.byteLength),l=i.indicesView,u=i.texCoord0Data==null?0:1,d=s(new c(i.colorView!=null,i.normalsData!=null||n,u));return{componentIndex:i.componentIndex,positionView:o,indicesView:l,layout:d,textureCoordinateType:u,interleavedVertexData:e.interleavedVertexData,indices:e.renderIndices??i.indicesView.typedBuffer}})}class f extends i{constructor(e){super(`IntegratedMesh3DTilesLayerWorker`,`processVertices`,{processVertices:e=>l(e)},e,{hasInitialize:!0})}processVertices(e){return this.invoke(e)}async processTiles3DVertices(e,t,r,i,a,s,c){let l=u(e,t,r,i,a,s,c),f=await this.processVertices(l);return{vertexProcessingOutputs:d(f,e,c),obbHalfSizeAccumulator:n(f.obbHalfSizeAccumulator),elevationRange:new o(f.minElevation,f.maxElevation)}}destroyContext(e){return this.broadcast(e,`destroyContext`)}async destroyContextAndSelf(e){await this.destroyContext(e),this.destroy()}}export{f as IntegratedMesh3DTilesLayerWorkerHandle};
|
|
2
|
+
import{clone as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{clone as n,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WorkerHandle as i}from"../../../core/workers/WorkerHandle.js";import{BufferViewVec3f as a}from"../../../geometry/support/buffer/BufferView.js";import{ElevationRange as o}from"../support/ElevationRange.js";import{createVertexBufferLayout as s,VertexBufferLayoutCreationParameters as c}from"../webgl-engine/collections/Component/SourceGeometry.js";function l(e){let t=[];for(let n of e.inputs)t.push(n.positionData.buffer,n.indicesData.buffer),n.texCoord0Data!=null&&t.push(n.texCoord0Data.buffer),n.colorData!=null&&t.push(n.colorData.buffer),n.normalsData!=null&&t.push(n.normalsData.buffer);return t}function u(i,a,o,s,c,l,u){return{inputs:i.map(e=>({positionData:e.positionView.typedBuffer.slice(),positionStride:e.positionView.typedBufferStride,indicesData:e.indicesView.typedBuffer.slice(),texCoord0Data:e.texCoord0Data==null?null:e.texCoord0Data.slice(),colorData:e.colorView==null?null:e.colorView.typedBuffer.slice(),colorElementCount:e.colorView?.elementCount===3||e.colorView?.elementCount===4?e.colorView.elementCount:0,normalsData:e.normalsData==null?null:e.normalsData.slice()})),origin:n(a),ellipsoidRadius:o,isGlobal:s,ecefRotation:e(c),tileObbCenter:l.getCenter(r()),tileObbQuaternionConjugate:l.getQuaternionConjugate(t()),imVertexNormals:u}}function d(e,t,n){return e.outputs.map((e,r)=>{let i=t[r],o=e.positionData==null?i.positionView:new a(e.positionData.buffer,e.positionData.byteOffset,i.positionView.typedBufferStride*Float32Array.BYTES_PER_ELEMENT,e.positionData.byteOffset+e.positionData.byteLength),l=i.indicesView,u=i.texCoord0Data==null?0:1,d=s(new c(i.colorView!=null,i.normalsData!=null||n,u));return{componentIndex:i.componentIndex,positionView:o,indicesView:l,layout:d,textureCoordinateType:u,interleavedVertexData:e.interleavedVertexData,indices:e.renderIndices??i.indicesView.typedBuffer,aabbInWorldCoordinates:e.aabbInWorldCoordinates}})}class f extends i{constructor(e){super(`IntegratedMesh3DTilesLayerWorker`,`processVertices`,{processVertices:e=>l(e)},e,{hasInitialize:!0})}processVertices(e){return this.invoke(e)}async processTiles3DVertices(e,t,r,i,a,s,c){let l=u(e,t,r,i,a,s,c),f=await this.processVertices(l);return{vertexProcessingOutputs:d(f,e,c),obbHalfSizeAccumulator:n(f.obbHalfSizeAccumulator),elevationRange:new o(f.minElevation,f.maxElevation)}}destroyContext(e){return this.broadcast(e,`destroyContext`)}async destroyContextAndSelf(e){await this.destroyContext(e),this.destroy()}}export{f as IntegratedMesh3DTilesLayerWorkerHandle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{transformMat3 as e}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{decompressNormal as n,compressNormal as r}from"../webgl-engine/lib/Normals.js";import{DataType as i}from"../../webgl/enums.js";import{VertexElementDescriptor as a}from"../../webgl/VertexElementDescriptor.js";class o{constructor(e,t){this.data=e,this.indices=t}}class s{constructor(e,t,n,r,i){this.indices=e,this.packedNormals=t,this.appendedVertexToOriginal=n,this.outputVertexCount=r,this.appendedVertexCount=i}}function c(e,t,n,r,i){return!r||n.some(({name:e})=>e===`normal`||e===`normalCompressed`)?l(e,t,n,i):u(e,t,n,i)}function l(i,a,s,c){let l=new o(i.slice().buffer,a);if(!c)return l;let u=s[0].stride,d=l.data.byteLength/u;for(let i of s)if(i.name===`normalCompressed`){let{offset:a}=i,o=new Int16Array(l.data),s=t();for(let t=0;t<d;++t)n(s,o,t,u/2,a/2),e(s,s,c),r(o,t,s[0],s[1],s[2],u/2,a/2)}else if(i.name===`normal`){let{offset:n}=i,r=new Float32Array(l.data),a=t();for(let t=0;t<d;++t){let i=(t*u+n)/4;a[0]=r[i],a[1]=r[i+1],a[2]=r[i+2],e(a,a,c),r[i]=a[0],r[i+1]=a[1],r[i+2]=a[2]}}return l}function u(e,t,n,r){let o=n[0].stride,s=o/4,c=new Float32Array(e.buffer,e.byteOffset,e.byteLength/4),l=e.byteLength/o,u=1<n.length?n[1].offset/4:s,p=o+4;return n.forEach((e,t)=>{e.stride=p,t>=1&&(e.offset+=4)}),n.splice(1,0,new a(`normalCompressed`,2,i.SHORT,12,p,!0)),f(c,l,u,o,p,d(t,c,s,r))}function d(e,t,n,r){let i=e.length/3,a=t.length/n,{faceNormals:o,faceAreas:s,faceEdges:c,edgeFaces:l,vertexFaces:u,vertexFaceCountAndOffset:d}=g(t,n,a,e,i,r);return _(e,i,o,s,c,l),h(i,a,e,o,s,u,d)}function f(e,t,n,r,i,a){let s=r/4,c=i/4,l=a.outputVertexCount,u=new Float32Array(l*c),d=new Uint32Array(u.buffer),f=new Uint32Array(e.buffer,e.byteOffset,e.length);return p(d,c,n,f,s,t,a.packedNormals),m(d,c,n,f,s,t,l,a.appendedVertexToOriginal,a.packedNormals,!0),new o(u.buffer,a.indices)}function p(e,t,n,r,i,a,o){for(let s=0;s<a;++s){let a=s*i,c=s*t;for(let t=0;t<n;++t)e[c+t]=r[a+t];e[c+n]=o[s];for(let t=n;t<i;++t)e[c+t+1]=r[a+t]}}function m(e,t,n,r,i,a,o,s,c,l){for(let u=a;u<o;++u){let o=s[u-a]*i,d=u*t;for(let t=0;t<i;++t)e[d+t+(l&&t>=n?1:0)]=r[o+t];e[d+n]=c[u]}}function h(e,t,n,r,i,a,o){let c=e*3,l=new(c<256?Uint8Array:c<2**16?Uint16Array:Uint32Array)(n),u=t,d=new(t<256?Uint8Array:t<2**16?Uint16Array:Uint32Array)(c-t),f=new ArrayBuffer(c*4),p=new Int16Array(f),m=new Uint32Array(f),h=0,g=0,_=new Uint32Array(e),v=0,y=1-x;for(let e=0;e<t;++e){h=o[e*2+1],g=h+o[e*2];let n=e;for(;h<g;){{let e=a[--g],t=e*3,o=r[t],s=r[t+1],c=r[t+2];v=0,_[v++]=e;let l=h;for(;l<g;){let e=a[l],t=e*3,n=r[t],i=r[t+1],u=r[t+2];if(o*n+s*i+c*u>y){_[v++]=e;let t=--g;if(l<t){a[l]=a[t];continue}}++l}let u=0,d=0,f=0;if(v===1)u=o,d=s,f=c;else{for(let e=0;e<v;++e){let t=_[e],n=i[t],a=t*3;u+=r[a]*n,d+=r[a+1]*n,f+=r[a+2]*n}let e=Math.sqrt(u*u+d*d+f*f)||1;u/=e,d/=e,f/=e}{let e=1/(Math.abs(u)+Math.abs(d)+Math.abs(f)),t=u*e,r=d*e,i=t,a=r;f<=0&&(i=(t>=0?1:-1)*(1-Math.abs(r)),a=(r>=0?1:-1)*(1-Math.abs(t)));let o=n*2,s=Math.round(i*32767),c=Math.round(a*32767);p[o]=s<-32767?-32767:s>32767?32767:s,p[o+1]=c<-32767?-32767:c>32767?32767:c}}if(n!==e)for(let t=0;t<v;++t){let r=_[t]*3;l[r]===e&&(l[r]=n),l[r+1]===e&&(l[r+1]=n),l[r+2]===e&&(l[r+2]=n)}if(h>=g)break;n=u++,d[n-t]=e}}let b=u,S=b-t;return new s(l,m,d,b,S)}function g(e,t,n,r,i,a){let o=new Float32Array(i*3),s=new Float32Array(i),c=new Uint32Array(i*3),l=i*3,u=new Int32Array(l*2),d=i*3,f=new Uint32Array(d),p=new Uint32Array(n*2);for(let e=0;e<i;++e){let t=e*3;for(let e=0;e<3;++e){let n=r[t+e];++p[n*2]}}{let e=0;for(let t=0;t<n;++t){let n=t*2;p[n+1]=e;let r=p[n];e+=r}for(let e=0;e<i;++e){let t=e*3;for(let n=0;n<3;++n){let i=r[t+n],a=p[i*2+1]++;f[a]=e}}for(let e=0;e<n;++e)p[e*2+1]-=p[e*2]}let m=0,h=new Uint32Array(d*2*2),g=new Uint32Array(n*2);for(let e=0;e<n;++e){let t=e*2,n=p[t+1]*4;g[t]=n,g[t+1]=n}function _(e,t,n){let r=Math.min(e,t),i=Math.max(e,t),a=e<t?0:1,o=r*2,s=g[o],c=g[o+1],l=-1;for(let e=s;e<c;e+=2)if(h[e]===i){l=h[e+1];break}return l===-1&&(l=m++,h[c]=i,h[c+1]=l,g[o+1]=c+2,u[2*l+(1-a)]=-1),u[2*l+a]=n,l}for(let n=0;n<r.length;n+=3){let i=r[n],l=i*t,u=e[l],d=e[l+1],f=e[l+2],p=r[n+1],m=p*t,h=e[m],g=e[m+1],v=e[m+2],y=r[n+2],b=y*t,x=e[b],S=e[b+1],C=e[b+2],w=u-h,T=d-g,E=f-v,D=u-x,O=d-S,k=f-C,A=T*k-E*O,j=E*D-w*k,M=w*O-T*D,N=Math.sqrt(A*A+j*j+M*M)||1,P=n/3;s[P]=.5*N;let F=1/N;if(a){let e=a[0]*A+a[3]*j+a[6]*M,t=a[1]*A+a[4]*j+a[7]*M,n=a[2]*A+a[5]*j+a[8]*M;o[P*3]=e*F,o[P*3+1]=t*F,o[P*3+2]=n*F}else o[P*3]=A*F,o[P*3+1]=j*F,o[P*3+2]=M*F;let I=_(i,p,P),L=_(p,y,P),R=_(y,i,P);c[P*3]=I,c[P*3+1]=L,c[P*3+2]=R}return{faceNormals:o,faceAreas:s,faceEdges:c,vertexFaces:f,vertexFaceCountAndOffset:p,edgeFaces:u}}function _(e,t,n,r,i,a){let o=new Uint8Array(t),s=new Uint32Array(t),c=new Uint32Array(t*3),l=0,u=new Uint32Array(t),d=0;for(let t=0;t<e.length;t+=3){let e=t/3;if(o[e]===1)continue;o[e]=1;let f=n[e*3],p=n[e*3+1],m=n[e*3+2];for(d=0,u[d++]=e,c[0]=i[e*3],c[1]=i[e*3+1],c[2]=i[e*3+2],l=3,s[e]=e+1;l>0;){let t=c[--l];for(let r=0;r<2;++r){let h=a[t*2+r];if(h===-1||s[h]===e+1)continue;s[h]=e+1;let g=n[h*3],_=n[h*3+1],v=n[h*3+2];if(Math.abs(1-(f*g+p*_+m*v))<b){u[d++]=h,o[h]=1;for(let e=0;e<3;++e){let n=i[h*3+e];n!==t&&(c[l++]=n)}}}}if(d>1){let e=0,t=0,i=0,a=0;for(let o=0;o<d;++o){let s=u[o],c=r[s];e+=c,t+=n[s*3]*c,i+=n[s*3+1]*c,a+=n[s*3+2]*c}let o=Math.sqrt(t*t+i*i+a*a)||1;t/=o,i/=o,a/=o;for(let o=0;o<d;++o){let s=u[o];n[s*3]=t,n[s*3+1]=i,n[s*3+2]=a,r[s]=e}}}}function v(e,t,n,r,i,a,o,s,c,l){let u=new Uint32Array(r*2);for(let e=0;e<n;++e){let t=c[e*2],i=c[e*2+1];for(let a=t;a<i;a+=2){let t=l[a],i=l[a+1];i>=r||i<0?console.error(`Invalid edge index ${i} for vertex ${e}`):t>=n||t<0||t<e?console.error(`Invalid vertex ${t} for edge ${i}`):(u[i*2]=e,u[i*2+1]=t)}}for(let n=0;n<t;++n){let t=[e[n*3],e[n*3+1],e[n*3+2]],r=[s[n*3],s[n*3+1],s[n*3+2]];for(let e of t){let t=i[e*2+1]
|
|
2
|
+
import{transformMat3 as e}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{decompressNormal as n,compressNormal as r}from"../webgl-engine/lib/Normals.js";import{DataType as i}from"../../webgl/enums.js";import{VertexElementDescriptor as a}from"../../webgl/VertexElementDescriptor.js";class o{constructor(e,t){this.data=e,this.indices=t}}class s{constructor(e,t,n,r,i){this.indices=e,this.packedNormals=t,this.appendedVertexToOriginal=n,this.outputVertexCount=r,this.appendedVertexCount=i}}function c(e,t,n,r,i){return!r||n.some(({name:e})=>e===`normal`||e===`normalCompressed`)?l(e,t,n,i):u(e,t,n,i)}function l(i,a,s,c){let l=new o(i.slice().buffer,a);if(!c)return l;let u=s[0].stride,d=l.data.byteLength/u;for(let i of s)if(i.name===`normalCompressed`){let{offset:a}=i,o=new Int16Array(l.data),s=t();for(let t=0;t<d;++t)n(s,o,t,u/2,a/2),e(s,s,c),r(o,t,s[0],s[1],s[2],u/2,a/2)}else if(i.name===`normal`){let{offset:n}=i,r=new Float32Array(l.data),a=t();for(let t=0;t<d;++t){let i=(t*u+n)/4;a[0]=r[i],a[1]=r[i+1],a[2]=r[i+2],e(a,a,c),r[i]=a[0],r[i+1]=a[1],r[i+2]=a[2]}}return l}function u(e,t,n,r){let o=n[0].stride,s=o/4,c=new Float32Array(e.buffer,e.byteOffset,e.byteLength/4),l=e.byteLength/o,u=1<n.length?n[1].offset/4:s,p=o+4;return n.forEach((e,t)=>{e.stride=p,t>=1&&(e.offset+=4)}),n.splice(1,0,new a(`normalCompressed`,2,i.SHORT,12,p,!0)),f(c,l,u,o,p,d(t,c,s,r))}function d(e,t,n,r){let i=e.length/3,a=t.length/n,{faceNormals:o,faceAreas:s,faceEdges:c,edgeFaces:l,vertexFaces:u,vertexFaceCountAndOffset:d}=g(t,n,a,e,i,r);return _(e,i,o,s,c,l),h(i,a,e,o,s,u,d)}function f(e,t,n,r,i,a){let s=r/4,c=i/4,l=a.outputVertexCount,u=new Float32Array(l*c),d=new Uint32Array(u.buffer),f=new Uint32Array(e.buffer,e.byteOffset,e.length);return p(d,c,n,f,s,t,a.packedNormals),m(d,c,n,f,s,t,l,a.appendedVertexToOriginal,a.packedNormals,!0),new o(u.buffer,a.indices)}function p(e,t,n,r,i,a,o){for(let s=0;s<a;++s){let a=s*i,c=s*t;for(let t=0;t<n;++t)e[c+t]=r[a+t];e[c+n]=o[s];for(let t=n;t<i;++t)e[c+t+1]=r[a+t]}}function m(e,t,n,r,i,a,o,s,c,l){for(let u=a;u<o;++u){let o=s[u-a]*i,d=u*t;for(let t=0;t<i;++t)e[d+t+(l&&t>=n?1:0)]=r[o+t];e[d+n]=c[u]}}function h(e,t,n,r,i,a,o){let c=e*3,l=new(c<256?Uint8Array:c<2**16?Uint16Array:Uint32Array)(n),u=t,d=new(t<256?Uint8Array:t<2**16?Uint16Array:Uint32Array)(c-t),f=new ArrayBuffer(c*4),p=new Int16Array(f),m=new Uint32Array(f),h=0,g=0,_=new Uint32Array(e),v=0,y=1-x;for(let e=0;e<t;++e){h=o[e*2+1],g=h+o[e*2];let n=e;for(;h<g;){{let e=a[--g],t=e*3,o=r[t],s=r[t+1],c=r[t+2];v=0,_[v++]=e;let l=h;for(;l<g;){let e=a[l],t=e*3,n=r[t],i=r[t+1],u=r[t+2];if(o*n+s*i+c*u>y){_[v++]=e;let t=--g;if(l<t){a[l]=a[t];continue}}++l}let u=0,d=0,f=0;if(v===1)u=o,d=s,f=c;else{for(let e=0;e<v;++e){let t=_[e],n=i[t],a=t*3;u+=r[a]*n,d+=r[a+1]*n,f+=r[a+2]*n}let e=Math.sqrt(u*u+d*d+f*f)||1;u/=e,d/=e,f/=e}{let e=1/(Math.abs(u)+Math.abs(d)+Math.abs(f)),t=u*e,r=d*e,i=t,a=r;f<=0&&(i=(t>=0?1:-1)*(1-Math.abs(r)),a=(r>=0?1:-1)*(1-Math.abs(t)));let o=n*2,s=Math.round(i*32767),c=Math.round(a*32767);p[o]=s<-32767?-32767:s>32767?32767:s,p[o+1]=c<-32767?-32767:c>32767?32767:c}}if(n!==e)for(let t=0;t<v;++t){let r=_[t]*3;l[r]===e&&(l[r]=n),l[r+1]===e&&(l[r+1]=n),l[r+2]===e&&(l[r+2]=n)}if(h>=g)break;n=u++,d[n-t]=e}}let b=u,S=b-t;return new s(l,m,d,b,S)}function g(e,t,n,r,i,a){let o=new Float32Array(i*3),s=new Float32Array(i),c=new Uint32Array(i*3),l=i*3,u=new Int32Array(l*2),d=i*3,f=new Uint32Array(d),p=new Uint32Array(n*2);for(let e=0;e<i;++e){let t=e*3;for(let e=0;e<3;++e){let n=r[t+e];++p[n*2]}}{let e=0;for(let t=0;t<n;++t){let n=t*2;p[n+1]=e;let r=p[n];e+=r}for(let e=0;e<i;++e){let t=e*3;for(let n=0;n<3;++n){let i=r[t+n],a=p[i*2+1]++;f[a]=e}}for(let e=0;e<n;++e)p[e*2+1]-=p[e*2]}let m=0,h=new Uint32Array(d*2*2),g=new Uint32Array(n*2);for(let e=0;e<n;++e){let t=e*2,n=p[t+1]*4;g[t]=n,g[t+1]=n}function _(e,t,n){let r=Math.min(e,t),i=Math.max(e,t),a=e<t?0:1,o=r*2,s=g[o],c=g[o+1],l=-1;for(let e=s;e<c;e+=2)if(h[e]===i){l=h[e+1];break}return l===-1&&(l=m++,h[c]=i,h[c+1]=l,g[o+1]=c+2,u[2*l+(1-a)]=-1),u[2*l+a]=n,l}for(let n=0;n<r.length;n+=3){let i=r[n],l=i*t,u=e[l],d=e[l+1],f=e[l+2],p=r[n+1],m=p*t,h=e[m],g=e[m+1],v=e[m+2],y=r[n+2],b=y*t,x=e[b],S=e[b+1],C=e[b+2],w=u-h,T=d-g,E=f-v,D=u-x,O=d-S,k=f-C,A=T*k-E*O,j=E*D-w*k,M=w*O-T*D,N=Math.sqrt(A*A+j*j+M*M)||1,P=n/3;s[P]=.5*N;let F=1/N;if(a){let e=a[0]*A+a[3]*j+a[6]*M,t=a[1]*A+a[4]*j+a[7]*M,n=a[2]*A+a[5]*j+a[8]*M;o[P*3]=e*F,o[P*3+1]=t*F,o[P*3+2]=n*F}else o[P*3]=A*F,o[P*3+1]=j*F,o[P*3+2]=M*F;let I=_(i,p,P),L=_(p,y,P),R=_(y,i,P);c[P*3]=I,c[P*3+1]=L,c[P*3+2]=R}return{faceNormals:o,faceAreas:s,faceEdges:c,vertexFaces:f,vertexFaceCountAndOffset:p,edgeFaces:u}}function _(e,t,n,r,i,a){let o=new Uint8Array(t),s=new Uint32Array(t),c=new Uint32Array(t*3),l=0,u=new Uint32Array(t),d=0;for(let t=0;t<e.length;t+=3){let e=t/3;if(o[e]===1)continue;o[e]=1;let f=n[e*3],p=n[e*3+1],m=n[e*3+2];for(d=0,u[d++]=e,c[0]=i[e*3],c[1]=i[e*3+1],c[2]=i[e*3+2],l=3,s[e]=e+1;l>0;){let t=c[--l];for(let r=0;r<2;++r){let h=a[t*2+r];if(h===-1||s[h]===e+1)continue;s[h]=e+1;let g=n[h*3],_=n[h*3+1],v=n[h*3+2];if(Math.abs(1-(f*g+p*_+m*v))<b){u[d++]=h,o[h]=1;for(let e=0;e<3;++e){let n=i[h*3+e];n!==t&&(c[l++]=n)}}}}if(d>1){let e=0,t=0,i=0,a=0;for(let o=0;o<d;++o){let s=u[o],c=r[s];e+=c,t+=n[s*3]*c,i+=n[s*3+1]*c,a+=n[s*3+2]*c}let o=Math.sqrt(t*t+i*i+a*a)||1;t/=o,i/=o,a/=o;for(let o=0;o<d;++o){let s=u[o];n[s*3]=t,n[s*3+1]=i,n[s*3+2]=a,r[s]=e}}}}function v(e,t,n,r,i,a,o,s,c,l){let u=new Uint32Array(r*2);for(let e=0;e<n;++e){let t=c[e*2],i=c[e*2+1];for(let a=t;a<i;a+=2){let t=l[a],i=l[a+1];i>=r||i<0?console.error(`Invalid edge index ${i} for vertex ${e}`):t>=n||t<0||t<e?console.error(`Invalid vertex ${t} for edge ${i}`):(u[i*2]=e,u[i*2+1]=t)}}for(let n=0;n<t;++n){let t=[e[n*3],e[n*3+1],e[n*3+2]],r=[s[n*3],s[n*3+1],s[n*3+2]];for(let e of t){let t=i[e*2+1];y(a,t,t+i[e*2],1,n)||console.error(`Face ${n} not found in vertexFaces for vertex ${e}`)}for(let e of r){let t=o[2*e],r=o[2*e+1];t===-1&&r===-1?console.error(`Edge ${e} of face ${n} has no faces`):n!==t&&n!==r&&console.error(`Edge ${e} of face ${n} does not list it as a face`)}}for(let e=0;e<r;++e){let t=o[2*e],n=o[2*e+1];if(t===-1&&n===-1){console.error(`Edge ${e} has no faces`);continue}for(let r of[t,n].filter(e=>e!==-1)){let t=s[r*3],n=s[r*3+1],i=s[r*3+2];e!==t&&e!==n&&e!==i&&console.error(`Edge ${e} not found in edgesPerFace for face ${r}`)}let r=u[2*e],i=u[2*e+1];r===i&&console.error(`Edge ${e} is degenerate with identical vertices ${r}`);let a=Math.min(r,i),d=c[a*2],f=c[a*2+1];y(l,d+1,f,2,e)||console.error(`Edge ${e} not found in edgeMap for vertex ${a}`)}for(let r=0;r<n;++r){let n=i[r*2+1],o=i[r*2];for(let i=n;i<n+o;++i){let n=a[i];(n<0||n>=t)&&console.error(`Invalid face ${n} in vertexFaces for vertex ${r}`),y(e,n*3,n*3+3,1,r)||console.error(`Face ${n} in vertexFaces for vertex ${r} does not reference it in indices`)}}}function y(e,t,n,r,i){for(let a=t;a<n;a+=r)if(e[a]===i)return!0;return!1}const b=.04,x=.8;export{s as ComputedNormalData,o as NormalData,h as buildSmoothedIndexedNormalsData,g as calculateTopology,v as checkTopology,u as computeAndMaterializeNormals,d as computeNormals,_ as mergeFaceNormals,l as packAndTransformNormals,c as processNormals,m as writeAddedVerticesAndNormals};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{copy as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,add as r,subtract as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a,ZEROS as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as s}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as c}from"../../../../geometry/projection/projectBuffer.js";import{BufferViewVec3f as l,BufferViewVec4f16 as u}from"../../../../geometry/support/buffer/BufferView.js";import{SampleElevationInfo as d,updateBufferPointGroundDistance as f,computePointTransformation as p,applyBufferPointTransformation as m}from"./elevationAlignmentUtils.js";import{
|
|
2
|
+
import{copy as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,add as r,subtract as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a,ZEROS as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as s}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as c}from"../../../../geometry/projection/projectBuffer.js";import{BufferViewVec3f as l,BufferViewVec4f16 as u}from"../../../../geometry/support/buffer/BufferView.js";import{SampleElevationInfo as d,updateBufferPointGroundDistance as f,computePointTransformation as p,applyBufferPointTransformation as m}from"./elevationAlignmentUtils.js";import{updatePlateNormals as h}from"./extrudePolygon.js";import{debugFlags as g}from"../../support/debugFlags.js";import{SamplePosition as _}from"../../support/ElevationProvider.js";import{updateVertexFieldVec3f as v,updateObjectVertexField as y}from"../../webgl-engine/lib/bufferGeometryUtils.js";import{isGeometryWithMapPositions as b}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{assert as x}from"../../webgl-engine/lib/Util.js";import{writeLineMarkerPositions as S}from"../../webgl-engine/materials/internal/lineMarkerBufferUtils.js";import{getRibbonLineBufferPositions as C,fillRibbonLinePadding as w,updateRibbonLineDistances as T}from"../../webgl-engine/materials/internal/ribbonLineBufferUtils.js";function E(e,t,a,o,s,d){let f=P/s.unitInMeters,p=0,m=0;for(let{line:h,marker:v,wireframe:y}of d){let{mapPositions:d,material:b,localOrigin:E}=h,D=b.parameters,O=h.getMutableStorageField(`position`,l),k=C(O,!!D.isClosed);if(d==null||k.count===0)continue;let A=new _(d,a),j=0,M=!g.ENABLE_OPTIMIZATIONS;for(let e=0;e<k.count;e++,A.offset+=3)o(A,B),t.requiresSampledElevationInfo&&(j+=B.sampledElevation),k.getVec(e,L),g.ENABLE_OPTIMIZATIONS?(r(F,L,E.vec3),s.setAltitude(F,B.z)):(n(F,A.array[A.offset],A.array[A.offset+1],B.z),c(F,a,0,F,s.spatialReference,0,1)),i(F,F,E.vec3),M||=H(L,F[0],F[1],F[2],f),k.setVec(e,F);j/=k.count,w(h.buffers.storage,k.count,!!D.isClosed&&k.count>2),T(h,!!D.isClosed),M&&e.geometryVertexAttributeUpdated(h,`position`),p+=j,m++,y!=null&&(x(y.localOrigin===E,`Line outputs must use the same local origin`),y.getMutableStorageField(`position`,l),y.buffers.storage.copyFrom(h.buffers.storage),M&&e.geometryVertexAttributeUpdated(y,`position`),p+=j,m++),v!=null&&(x(v.localOrigin===E,`Line outputs must use the same local origin`),S(k,v.material.parameters,{position:v.getMutableVertexField(`position`,l),previousDelta:v.getMutableVertexField(`previousDelta`,u),offset:0}),M&&e.geometryVertexAttributeUpdated(v,`position`),p+=j,m++)}return m===0?0:p/m}function D(e,t,n,r,i,a){let o=e.stageObject,s=o.geometries,c=0;for(let e of s){if(!b(e))continue;let{update:s,averageGeometrySampledElevation:l}=V(e,t,n,r,i);c+=l,s&&(a&&(h(e,a),o.geometryVertexAttributeUpdated(e,`normalCompressed`)),o.geometryVertexAttributeUpdated(e,`position`))}return c/s.length}function O(e,t,a,o,s){let u=t.requiresSampledElevationInfo,{geometries:d}=e,f=P/s.unitInMeters,p=0;if(d.length===0)return 0;for(let t of d){let d=t.buffers.vertex.getField(`position`,l);if(t.mapPositions==null||d.count===0)continue;let m=t.localOrigin.vec3,h=new _(t.mapPositions,a),y=0,b=!1;for(let e=0;e<d.count;e++,h.offset+=3)o(h,B),u&&(y+=B.sampledElevation),d.getVec(e,L),g.ENABLE_OPTIMIZATIONS?(r(F,L,m),s.setAltitude(F,B.z)):(n(F,h.array[h.offset],h.array[h.offset+1],B.z),c(F,a,0,F,s.spatialReference,0,1)),i(F,F,m),(!g.ENABLE_OPTIMIZATIONS||H(L,F[0],F[1],F[2],f))&&(b=v(t,`position`,e,F)||b);b&&e.geometryVertexAttributeUpdated(t,`position`),p+=y/d.count}return p/d.length}function k(t,r,i,a,o,c){let l=t.stageObject,u=r.centerInElevationSR;a(u,B);let d=r.requiresSampledElevationInfo?B.sampledElevation:0,f=e(M,c??l.transformation),p=n(z,f[12],f[13],f[14]);g.ENABLE_OPTIMIZATIONS?o.setAltitudeOfTransformation(B.z,f):(F[0]=u[0],F[1]=u[1],F[2]=B.z,s(i,F,f,o.spatialReference)&&(c?e(c,f):l.transformation=f));let m=P/o.unitInMeters;return H(p,f[12],f[13],f[14],m)&&(c?e(c,f):l.transformation=f),d}function A(e,t,n,r,i){return j(e,t,n,r,i,o)}function j(e,t,a,o,s,c){let u=t.centerInElevationSR;if(o(u,B),f(e,B.verticalDistanceToGround),g.ENABLE_OPTIMIZATIONS){let t=P/s.unitInMeters;for(let n of e.geometries){let a=n.buffers.vertex.getField(`position`,l),o=n.localOrigin.vec3;a.getVec(0,L),r(F,L,o),i(F,F,c),s.setAltitude(F,B.z),r(F,F,c),i(F,F,o),H(L,F[0],F[1],F[2],t)&&y(e,v,n,`position`,0,F)}}else n(F,u[0],u[1],B.z),p(F,a,s,M)&&(M[12]+=c[0],M[13]+=c[1],M[14]+=c[2],m(e,M));return B.sampledElevation}const M=t();function N(e,t,r,i,a){let o=e.graphics3DSymbolLayer.lodRenderer;if(o==null)return 0;let c=t.centerInElevationSR;i(c,B);let l=t.mode===`absolute-height`?0:B.sampledElevation,u=o.instanceData,d=e.instanceIndex,f=R;u.getGlobalTransform(d,f);let p=n(z,f[12],f[13],f[14]);g.ENABLE_OPTIMIZATIONS?a.setAltitudeOfTransformation(B.z,f):(F[0]=c[0],F[1]=c[1],F[2]=B.z,s(r,F,f,a.spatialReference)&&u.setGlobalTransform(d,f));let m=P/a.unitInMeters;return(!g.ENABLE_OPTIMIZATIONS||H(p,f[12],f[13],f[14],m))&&u.setGlobalTransform(d,f),l}const P=.01,F=a(),I=a(),L=a(),R=t(),z=a(),B=new d;function V(e,t,n,r,i){let a=!1,o=e.transformation,s=t.requiresSampledElevationInfo;I[0]=o[12],I[1]=o[13],I[2]=o[14],e.invalidateBoundingInfo();let l=e.getMutableAttribute(`position`),u=l.data,d=l.size,f=u.length/d,p=new _(e.mapPositions,n),m=0,h=0;for(let e=0;e<f;e++){if(L[0]=u[m],L[1]=u[m+1],L[2]=u[m+2],r(p,B),s&&(h+=B.sampledElevation),g.ENABLE_OPTIMIZATIONS){F[0]=u[m]+I[0],F[1]=u[m+1]+I[1],F[2]=u[m+2]+I[2],i.setAltitude(F,B.z),u[m]=F[0]-I[0],u[m+1]=F[1]-I[1],u[m+2]=F[2]-I[2];let e=P/i.unitInMeters;H(L,u[m],u[m+1],u[m+2],e)&&(a=!0)}else u[m]=p.array[p.offset],u[m+1]=p.array[p.offset+1],u[m+2]=B.z,c(u,n,m,u,i.spatialReference,m,1),u[m]-=I[0],u[m+1]-=I[1],u[m+2]-=I[2],a=!0;m+=d,p.offset+=3}return h/=f,{update:a,averageGeometrySampledElevation:h}}function H(e,t,n,r,i){return Math.abs(e[0]-t)>=i||Math.abs(e[1]-n)>=i||Math.abs(e[2]-r)>=i}export{E as perBufferLineElevationAligner,A as perBufferPointElevationAligner,O as perBufferVertexElevationAligner,N as perLodInstanceElevationAligner,k as perObjectElevationAligner,j as perTranslatedBufferPointElevationAligner,D as perVertexElevationAligner};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../core/lang.js";import{estimateArrayMemory as t}from"../../../../core/memoryEstimations.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/units.js";import{normalFromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as a,invertOrIdentity 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{set as c,sub as l,cross as u,add as d,normalize as f,transformMat4 as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as m,create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g,ZEROS as _}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as v}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as y,fromBuffer as b,intersectsClippingArea as x}from"../../../../geometry/support/aaBoundingBox.js";import{getZeroIndexArray as S}from"../../../../geometry/support/Indices.js";import{t as C}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as w,SnappingCandidateEdge as T}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as E}from"../../../../renderers/support/renderingInfoUtils.js";import{isDrivenOpacityFallbackAlwaysOpaque as D}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{needsElevationUpdates3D as O,SampleElevationInfo as k}from"./elevationAlignmentUtils.js";import{extrudePolygon as A}from"./extrudePolygon.js";import{Object3DEdgeState as ee,Graphics3DObject3DGraphicLayer as j}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as M}from"./Graphics3DSymbolLayer.js";import{computeCentroid as N}from"./graphicUtils.js";import{addOlidAttribute as P}from"./olidUtils.js";import{geometryAsPolygon as te}from"./polygonUtils.js";import{createMaterial as ne}from"../support/edgeUtils.js";import{encodeNaNUInt8 as F}from"../support/symbolColorUtils.js";import{debugFlags as I}from"../../support/debugFlags.js";import{SamplePosition as L}from"../../support/ElevationProvider.js";import{loadTessellationUtils as R,preloadedPolygonToRenderInfoElevationAligned as z}from"../../support/renderInfoUtils/polygon.js";import{Attribute as B}from"../../webgl-engine/lib/Attribute.js";import{Geometry as V}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as H}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as re,compressNormal as U}from"../../webgl-engine/lib/Normals.js";import{Object3D as ie}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as W}from"../../webgl-engine/materials/DefaultMaterial.js";const G=[`polygon`,`extent`];class K extends M{constructor(e,t,n,r){super(e,t,n,r,D(t)),this.ensureDrapedStatus(!1)}async doLoad(){let e=this.symbolLayer,t=e?.material,n=this.symbolLayer.material?.color?.a,r=this._hasDrivenColorOrOpacity,i=this.needsDrivenTransparentPass||r&&n!=null&&n<1,a=t?.emissive,o=(a?.source===`color`?a?.strength:void 0)??0,s=!r&&(n==null||n===0),c=r?g:this._materialColor?.toUnitRGBA()??_,l={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:m,diffuse:m,externalColor:c,opacity:+!s,layerOpacity:this._getLayerOpacity(),drivenOpacity:i,hasSymbolColors:r,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:e.castShadows,emissiveStrengthFromSymbol:o,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},u=new W(l,this._context.spherical),d=new W({...l,cullFace:2},this._context.spherical);this._materials[0]=u,this._materials[1]=d,this._updateTransparentDepedentMaterialParameters(),await R()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,G,this.symbolLayer.type))return null;let n=this._getDrivenUInt8ColorWithNaNSupport(e.renderingInfo,this._materialColor,!1);F(n,n);let r=this.createElevationContextForGraphic(t);return this._createAs3DShape(t,e.renderingInfo,n,r,t.uid)}layerOpacityChanged(e,t){let n=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:n}),this._materials[1]?.setParameters({layerOpacity:n}),this._updateTransparentDepedentMaterialParameters(),e?.forEach(e=>t(e)?.layerOpacityChanged(n,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,O)}slicePlaneEnabledChanged(e,t){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e?.forEach(e=>{t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){let e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(e),this._materials[1]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?E(e.size.output,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}_containsRenderableGeometry(e){return`polygonIndexCount`in e&&`outlineIndexCount`in e?e.polygonIndexCount>0||e.outlineIndexCount>0:super._containsRenderableGeometry(e)}applyRendererDiff(e,t){return+!this._drivenPropertiesChanged(t)}async queryForSnapping(t,r,i,a){let o=this._getExtrusionSize(i)*this._context.renderCoordsHelper.unitInMeters/n(r),{objectId:s,target:c}=t,l=e(c);switch(l.z=(l.z??0)+o,t.type){case`edge`:{let{start:n,end:r}=t,i=e(n),a=e(r);return i.z=(i.z??0)+o,a.z=(a.z??0)+o,[new T(s,l,1/0,i,a)]}case`vertex`:return[new w(s,l,1/0),new T(s,c,1/0,c,l)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,n,o,c,l){let u=te(e.geometry);if(u==null)return null;if(u.rings.length===0||!u.rings.some(e=>e.length>0))return this._logGeometryValidationWarnings(u.rings,`rings`,`ExtrudeSymbol3DLayer`),null;let d=z(u,this._context.elevationProvider,this._context.renderCoordsHelper,c,{outlineOutput:`tessellated-indices`,owner:this._context.layer});if(d==null)return;this._logGeometryCreationWarnings(d,u.rings,`rings`,`ExtrudeSymbol3DLayer`);let f=N(u);if(f==null)return null;let p=[],m=[],g=y(),_=h(),S=this._context.renderCoordsHelper.viewingMode===1;S||this._context.renderCoordsHelper.worldUpAtPosition(null,_);let w=s();v(u.spatialReference,[f.x,f.y,0],w,this._context.renderCoordsHelper.spatialReference);let T=s();a(T,w);let E=i();r(E,T);let D=new Map,k=this._materials[0];if(this._context.clippingExtent&&(b(d.mapPositions,g),!x(g,this._context.clippingExtent))||d.polygonIndexCount===0&&d.outlineIndexCount===0)return;let M=this._getExtrusionSize(n),P=A(d,{height:M,worldUp:_,spherical:S,requireElevation:!0,requireNormals:!0,requireSizes:!0});if(P==null)return;C(P.vertices,P.vertices,T);let F=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerViewUid:this._context.layerViewUid}),I=new ue(P.vertices,P.elevation,re(P.normals),P.sizes),L=q(k,P.indices,P.indices.length-P.bottomIndices.length,I,o,F),R=d.vertexCount,B=d.outlineSegmentCount*2,V=d.polygonIndexCount/3,H=new de(R,B,V);if(X(L,H,w),D.set(L,H),p.push(L),P.bottomIndices.length>0&&p.push(q(this._materials[1],P.bottomIndices,0,I,o,F)),m.push(I.heights),p.length===0)return null;let U=new ie({geometries:p,layerViewUid:this._context.layerViewUid,graphicUid:l,isElevationSource:!0});U.transformation=w;let W=ne(this.symbolLayer,{opacity:this._getLayerOpacity()}),G=W?new ee(this._materials[0],W,this._context.slicePlaneEnabled):null,K=new j(this,U,null,(e,t,n,r,i)=>ae(e,t,n,r,i,m,D),c,G,m.reduce((e,n)=>e+t(n,8),0));return K.alignedSampledElevation=d.sampledElevation,K.needsElevationUpdates=O(c.mode),K}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){let e=this._materials[0];e?.setParameters({cullFace:e.transparent?0:2})}}function q(e,t,n,r,i,a){let{attributeIndices:o,drawIndices:s}=J(t),c=[[`position`,new B(r.positions,o,3,!0)],[`normalCompressed`,new B(r.normals,o,2,!0)]],l=null;return e.parameters.hasSymbolColors&&(l=S(o.length),c.push([`symbolColor`,new B(i,l,4,!0)])),a!=null&&(l??=S(o.length),P(c,a,l)),new V(e,c,r.elevation,n,null,s)}function J(e){if(e.length===0)return{attributeIndices:[],drawIndices:[]};let t=new Map,n=Array(e.length).fill(0);for(let r=0;r<e.length;++r){let i=e[r],a=t.get(i);a??(a=t.size,t.set(i,a)),n[r]=a}let r=Array(t.size).fill(0);for(let[e,n]of t)r[n]=e;return{attributeIndices:r,drawIndices:n}}const Y=h();function ae(e,t,n,r,i,a,l){let u=e.stageObject,d=u.geometries,f=d.length,m=t.mode!==`absolute-height`,h=0,g=u.transformation,_=o(s(),g);for(let e=0,t=0;e<f;++e){let o=d[e],s=l.get(o);if(!s||!H(o))continue;let f=o.getMutableAttribute(`position`).data,v=a[t++],y=new L(o.mapPositions),b=f.length/3,x=!1,S=0;{let e=0;for(let t=0;t<b;t++){Y[0]=f[e],Y[1]=f[e+1],Y[2]=f[e+2],r(y,Q),m&&(S+=Q.sampledElevation),I.ENABLE_OPTIMIZATIONS?(c(Z,f[e],f[e+1],f[e+2]),p(Z,Z,g),i.setAltitude(Z,Q.z+v[e/3]),p(Z,Z,_)):(c(Z,y.array[y.offset],y.array[y.offset+1],Q.z+v[e/3]),n!=null&&i.toRenderCoords(Z,n,Z),p(Z,Z,_)),f[e]=Z[0],f[e+1]=Z[1],f[e+2]=Z[2];let t=se/i.unitInMeters;(Math.abs(Y[0]-f[e])>=t||Math.abs(Y[1]-f[e+1])>=t||Math.abs(Y[2]-f[e+2])>=t)&&(x=!0),y.offset+=3,e+=3}}if(x){X(o,s,g),u.geometryVertexAttributeUpdated(d[e],`normalCompressed`),o.invalidateBoundingInfo(),u.geometryVertexAttributeUpdated(d[e],`position`);let t=d[e+1],n=!l.has(t);t&&n&&(t.invalidateBoundingInfo(),u.geometryVertexAttributeUpdated(t,`position`))}h+=S/b}return h/f}function X(e,t,n){let r=e.getMutableAttribute(`normalCompressed`).data,i=e.readPrimitivePosition,{plateVertexCount:a,topFaceStart:o,topFaceCount:s}=t,m=o+s,h=ce,g=le,_=$,v=oe,y=Z;c(y,0,0,0);let b=(e,t)=>{p(t,i(t,e),n)};for(let e=o;e<m;++e){let t=e*3;b(t,h[0]),b(t+1,h[1]),b(t+2,h[2]),l(g,h[1],h[0]),l(_,h[2],h[0]),u(v,g,_),d(y,y,v)}f(y,y);for(let e=0;e<a;++e){let t=y[0],n=y[1],i=y[2];U(r,e,-t,-n,-i),U(r,e+a,t,n,i)}}const Z=h(),oe=h(),Q=new k,se=.01,ce=[h(),h(),h()],le=h(),$=h();class ue{constructor(e,t,n,r){this.positions=e,this.elevation=t,this.normals=n,this.heights=r}}class de{constructor(e,t,n){this.plateVertexCount=e,this.topFaceStart=t,this.topFaceCount=n}}export{K as Graphics3DExtrudeSymbolLayer,J as remapIndicesToAttributeSubset};
|
|
2
|
+
import{clone as e}from"../../../../core/lang.js";import{estimateArrayMemory as t}from"../../../../core/memoryEstimations.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/units.js";import{normalFromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as a,invertOrIdentity 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{set as c,transformMat4 as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as u,create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as f,ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as m}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as h,fromBuffer as g,intersectsClippingArea as _}from"../../../../geometry/support/aaBoundingBox.js";import{getZeroIndexArray as v}from"../../../../geometry/support/Indices.js";import{t as y}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as b,SnappingCandidateEdge as x}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as S}from"../../../../renderers/support/renderingInfoUtils.js";import{isDrivenOpacityFallbackAlwaysOpaque as C}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{needsElevationUpdates3D as w,SampleElevationInfo as T}from"./elevationAlignmentUtils.js";import{extrudePolygon as ee,updatePlateNormals as E,PlateLayoutInformation as D}from"./extrudePolygon.js";import{Object3DEdgeState as O,Graphics3DObject3DGraphicLayer as k}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as A}from"./Graphics3DSymbolLayer.js";import{computeCentroid as j}from"./graphicUtils.js";import{addOlidAttribute as M}from"./olidUtils.js";import{geometryAsPolygon as N}from"./polygonUtils.js";import{createMaterial as te}from"../support/edgeUtils.js";import{encodeNaNUInt8 as P}from"../support/symbolColorUtils.js";import{debugFlags as F}from"../../support/debugFlags.js";import{SamplePosition as I}from"../../support/ElevationProvider.js";import{loadTessellationUtils as L,preloadedPolygonToRenderInfoElevationAligned as R}from"../../support/renderInfoUtils/polygon.js";import{Attribute as z}from"../../webgl-engine/lib/Attribute.js";import{Geometry as B}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as V}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as H}from"../../webgl-engine/lib/Normals.js";import{Object3D as U}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as W}from"../../webgl-engine/materials/DefaultMaterial.js";const G=[`polygon`,`extent`];class K extends A{constructor(e,t,n,r){super(e,t,n,r,C(t)),this.ensureDrapedStatus(!1)}async doLoad(){let e=this.symbolLayer,t=e?.material,n=this.symbolLayer.material?.color?.a,r=this._hasDrivenColorOrOpacity,i=this.needsDrivenTransparentPass||r&&n!=null&&n<1,a=t?.emissive,o=(a?.source===`color`?a?.strength:void 0)??0,s=!r&&(n==null||n===0),c=r?f:this._materialColor?.toUnitRGBA()??p,l={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:u,diffuse:u,externalColor:c,opacity:+!s,layerOpacity:this._getLayerOpacity(),drivenOpacity:i,hasSymbolColors:r,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:e.castShadows,emissiveStrengthFromSymbol:o,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1,pretransformedNormals:!0},d=new W(l,this._context.spherical),m=new W({...l,cullFace:2},this._context.spherical);this._materials[0]=d,this._materials[1]=m,this._updateTransparentDepedentMaterialParameters(),await L()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,G,this.symbolLayer.type))return null;let n=this._getDrivenUInt8ColorWithNaNSupport(e.renderingInfo,this._materialColor,!1);P(n,n);let r=this.createElevationContextForGraphic(t);return this._createAs3DShape(t,e.renderingInfo,n,r,t.uid)}layerOpacityChanged(e,t){let n=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:n}),this._materials[1]?.setParameters({layerOpacity:n}),this._updateTransparentDepedentMaterialParameters(),e?.forEach(e=>t(e)?.layerOpacityChanged(n,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,w)}slicePlaneEnabledChanged(e,t){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e?.forEach(e=>{t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){let e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(e),this._materials[1]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?S(e.size.output,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}_containsRenderableGeometry(e){return`polygonIndexCount`in e&&`outlineIndexCount`in e?e.polygonIndexCount>0||e.outlineIndexCount>0:super._containsRenderableGeometry(e)}applyRendererDiff(e,t){return+!this._drivenPropertiesChanged(t)}async queryForSnapping(t,r,i,a){let o=this._getExtrusionSize(i)*this._context.renderCoordsHelper.unitInMeters/n(r),{objectId:s,target:c}=t,l=e(c);switch(l.z=(l.z??0)+o,t.type){case`edge`:{let{start:n,end:r}=t,i=e(n),a=e(r);return i.z=(i.z??0)+o,a.z=(a.z??0)+o,[new x(s,l,1/0,i,a)]}case`vertex`:return[new b(s,l,1/0),new x(s,c,1/0,c,l)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,n,o,c,l){let u=N(e.geometry);if(u==null)return null;if(u.rings.length===0||!u.rings.some(e=>e.length>0))return this._logGeometryValidationWarnings(u.rings,`rings`,`ExtrudeSymbol3DLayer`),null;let f=R(u,this._context.elevationProvider,this._context.renderCoordsHelper,c,{outlineOutput:`tessellated-indices`,owner:this._context.layer});if(f==null)return;this._logGeometryCreationWarnings(f,u.rings,`rings`,`ExtrudeSymbol3DLayer`);let p=j(u);if(p==null)return null;let v=[],b=[],x=h(),S=d(),C=this._context.renderCoordsHelper.viewingMode===1;C||this._context.renderCoordsHelper.worldUpAtPosition(null,S);let T=s();m(u.spatialReference,[p.x,p.y,0],T,this._context.renderCoordsHelper.spatialReference);let A=s();a(A,T);let M=i();r(M,A);let P=new Map,F=this._materials[0];if(this._context.clippingExtent&&(g(f.mapPositions,x),!_(x,this._context.clippingExtent))||f.polygonIndexCount===0&&f.outlineIndexCount===0)return;let I=this._getExtrusionSize(n),L=ee(f,{height:I,worldUp:S,spherical:C,requireElevation:!0,requireNormals:!0,requireSizes:!0});if(L==null)return;y(L.vertices,L.vertices,A);let z=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerViewUid:this._context.layerViewUid}),B=new ne(L.vertices,L.elevation,H(L.normals),L.sizes),V=q(F,L.indices,L.indices.length-L.bottomIndices.length,B,o,z),W=f.vertexCount,G=f.outlineSegmentCount*2,K=f.polygonIndexCount/3,J=new D(W,W,0,G,K);if(E(V,J,T),P.set(V,J),v.push(V),L.bottomIndices.length>0&&v.push(q(this._materials[1],L.bottomIndices,0,B,o,z)),b.push(B.heights),v.length===0)return null;let Y=new U({geometries:v,layerViewUid:this._context.layerViewUid,graphicUid:l,isElevationSource:!0});Y.transformation=T;let Z=te(this.symbolLayer,{opacity:this._getLayerOpacity()}),Q=Z?new O(this._materials[0],Z,this._context.slicePlaneEnabled):null,$=new k(this,Y,null,(e,t,n,r,i)=>X(e,t,n,r,i,b,P),c,Q,b.reduce((e,n)=>e+t(n,8),0));return $.alignedSampledElevation=f.sampledElevation,$.needsElevationUpdates=w(c.mode),$}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){let e=this._materials[0];e?.setParameters({cullFace:e.transparent?0:2})}}function q(e,t,n,r,i,a){let{attributeIndices:o,drawIndices:s}=J(t),c=[[`position`,new z(r.positions,o,3,!0)],[`normalCompressed`,new z(r.compressedNormals,o,2,!0)]],l=null;return e.parameters.hasSymbolColors&&(l=v(o.length),c.push([`symbolColor`,new z(i,l,4,!0)])),a!=null&&(l??=v(o.length),M(c,a,l)),new B(e,c,r.elevation,n,null,s)}function J(e){if(e.length===0)return{attributeIndices:[],drawIndices:[]};let t=new Map,n=Array(e.length).fill(0);for(let r=0;r<e.length;++r){let i=e[r],a=t.get(i);a??(a=t.size,t.set(i,a)),n[r]=a}let r=Array(t.size).fill(0);for(let[e,n]of t)r[n]=e;return{attributeIndices:r,drawIndices:n}}const Y=d();function X(e,t,n,r,i,a,u){let d=e.stageObject,f=d.geometries,p=f.length,m=t.mode!==`absolute-height`,h=0,g=d.transformation,_=o(s(),g);for(let e=0,t=0;e<p;++e){let o=f[e],s=u.get(o);if(!s||!V(o))continue;let p=o.getMutableAttribute(`position`).data,v=a[t++],y=new I(o.mapPositions),b=p.length/3,x=!1,S=0;{let e=0;for(let t=0;t<b;t++){Y[0]=p[e],Y[1]=p[e+1],Y[2]=p[e+2],r(y,Q),m&&(S+=Q.sampledElevation),F.ENABLE_OPTIMIZATIONS?(c(Z,p[e],p[e+1],p[e+2]),l(Z,Z,g),i.setAltitude(Z,Q.z+v[e/3]),l(Z,Z,_)):(c(Z,y.array[y.offset],y.array[y.offset+1],Q.z+v[e/3]),n!=null&&i.toRenderCoords(Z,n,Z),l(Z,Z,_)),p[e]=Z[0],p[e+1]=Z[1],p[e+2]=Z[2];let t=$/i.unitInMeters;(Math.abs(Y[0]-p[e])>=t||Math.abs(Y[1]-p[e+1])>=t||Math.abs(Y[2]-p[e+2])>=t)&&(x=!0),y.offset+=3,e+=3}}if(x){E(o,s,g),d.geometryVertexAttributeUpdated(f[e],`normalCompressed`),o.invalidateBoundingInfo(),d.geometryVertexAttributeUpdated(f[e],`position`);let t=f[e+1],n=!u.has(t);t&&n&&(t.invalidateBoundingInfo(),d.geometryVertexAttributeUpdated(t,`position`))}h+=S/b}return h/p}const Z=d(),Q=new T,$=.01;class ne{constructor(e,t,n,r){this.positions=e,this.elevation=t,this.compressedNormals=n,this.heights=r}}export{K as Graphics3DExtrudeSymbolLayer,J as remapIndicesToAttributeSubset};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{onePixelInPoints as t,pt2px as n,onePointInPixels as r}from"../../../../core/screenUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as o,clone as s,ones as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as l,fromBuffer as u,intersectsClippingArea as d,empty as f,expandWithAABB as p}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as m}from"../../../../renderers/support/renderingInfoUtils.js";import{getTransformationType as h}from"../../../../renderers/visualVariables/support/sizeVariableUtils.js";import{perBufferLineElevationAligner as g}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as _,needsElevationUpdates2D as v}from"./elevationAlignmentUtils.js";import{Graphics3DBufferGraphicLayer as y}from"./Graphics3DBufferGraphicLayer.js";import{Graphics3DDrapedBufferGraphicLayer as b}from"./Graphics3DDrapedBufferGraphicLayer.js";import{Graphics3DSymbolLayer as x,nanFallbackColor as S}from"./Graphics3DSymbolLayer.js";import{parseCapType as C,computeSymbolLayerIndex as w,parseLineMarkerStyle as T}from"./lineUtils.js";import{initFastSymbolUpdatesState as E,updateFastSymbolUpdatesState as D,getAttributeValue as O,getSizeAttributeValue as k,ConvertOptions as A}from"../support/FastSymbolUpdates.js";import{debugFlags as j}from"../../support/debugFlags.js";import{selectLocalOrigin as M,createBufferGeometry as N}from"../../support/engineContent/line.js";import{geometryToRenderInfo as P,geometryToRenderInfoDraped as F}from"../../support/renderInfoUtils/line.js";import{BufferObject3D as I}from"../../webgl-engine/lib/BufferObject3D.js";import{LineMarkerMaterial as L}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as R,patternHidesLine as z}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as B}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createLineMarkerBufferGeometry as V}from"../../webgl-engine/materials/internal/lineMarkerBufferUtils.js";const H=[`polyline`];class U extends x{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,K(t))}async doLoad(){if(this._fastUpdates=E(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastMarkerUpdates=E(this._context.renderer,this._fastVisualVariableConvertOptions(!0)),!this._drivenProperties.size&&(this.symbolLayer.size==null?t:this.symbolLayer.size)<0)throw new e(`graphics3dlinesymbollayer:invalid-size`,`Symbol sizes may not be negative values`)}_getMaterialParameters(e,t){let n=this._screenSizePerspective,r=!!has(`enable-feature:emissive-on-non-volumetric`)&&!this.draped,{symbolLayer:i}=this,{worldSized:a}=this.symbol,o={...this._getMaterialColorParameters(t),shadingEnabled:r,width:this._computeMaterialWidth(i.size,a),worldSized:a,polygonOffset:3,polygonOffsetIndex:w(this._renderPriority,this._renderPriorityStep),join:i.join||`miter`,cap:C(i.cap||`butt`),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:R(i.pattern??i.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:n};if(t===2){if(this._fastMarkerUpdates?.visualVariables)return{...o,...this._fastMarkerUpdates.materialParameters}}else if(o.hasVertexColor=this._hasDrivenColorOrOpacity,o.hasVertexSize=this._drivenProperties.size,o.hasLineDistance=o.stipplePattern!=null,this._fastUpdates?.visualVariables)return{...o,...this._fastUpdates.materialParameters};return o}_getMaterialColorParameters(e){let t=e===2,n=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(n[3]=0),{color:n}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return this._materials[0]??=new B(this._getMaterialParameters(!1,0),this.view),this._materials[0]}get _wireframeLineMaterial(){return this._materials[1]??=new B({...this._getMaterialParameters(!1,1),wireframe:!0},this.view),this._materials[1]}get _markerMaterial(){return this._materials[2]==null&&this.symbolLayer.marker!=null&&(this._materials[2]=new L({...this._getMaterialParameters(!1,2),placement:this.symbolLayer.marker.placement,markerPrimitive:T(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[2]}_getDrivenSize(e){if(this._drivenProperties.size){let t=e.size;if(t==null)return this._getFallbackSize();let n=m(t.output);return this._getWorldOrScreenSize(n)}return 1}_getDrivenColor({color:e,opacity:t}){let n=c();return this._drivenProperties.color&&(a(n,e?.output??this._getFallbackOpacityAndColor(o)),t==null)||this._drivenProperties.opacity&&(e||this._materialColor)&&(n[3]=t?.output??this._getFallbackOpacity()),n}_getDrivenMarkerColor({color:e,opacity:t}){let n=c();return this._drivenProperties.color&&(a(n,e?.output??this._getFallbackMarkerOpacityAndColor(o)),t==null)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(n[3]=t?.output??this._getFallbackMarkerOpacity()),n}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validatePolylineContext(e))return null;this._warnIfVVRequiresWorldSized(e.renderingInfo);let n=this.createElevationContextForGraphic(t),r=n.mode===`on-the-ground`;return this.ensureDrapedStatus(r),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,n,t.uid)}_validatePolylineContext(e){let t=e.graphic.geometry;return this._validateGeometry(t,H,this.symbolLayer.type)&&t.type===`polyline`}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:{let e=this._fastUpdates;if(D(e,t,this._fastVisualVariableConvertOptions()))for(let t of this._materials)t instanceof B&&t.setParameters(e.materialParameters);else return 0;let n=this._fastMarkerUpdates;if(D(n,t,this._fastVisualVariableConvertOptions(!0)))for(let e of this._materials)e instanceof L&&e.setParameters(n.materialParameters);else return 0}break;default:return 0}return`visualVariables`in e.diff&&this._warnIfVVRequiresWorldSized(),2}_warnIfVVRequiresWorldSized(e){if(this.symbol.worldSized||this.ignoreDrivers)return;let t=this._getSizeVariable(e);t==null||t.useSymbolValue||t.target===`outline`||h(t)===`real-world-size`&&this.logger.warnOnce(`SizeVariable uses real-world units, but LineSymbol3D.worldSized is false. Set LineSymbol3D.worldSized to true to render real-world line widths.`)}_getSizeVariable(e){let t=this._fastUpdates?.visualVariables.size;if(t)return t.variables[0];let n=e?.size,r=n?.output.findIndex(e=>typeof e==`number`);return r==null?null:n?.variables[r]}prepareSymbolLayerPatch(e){if(e.diff.type!==`partial`)return;let t=e.diff.diff,n={};t.size?.type===`complete`&&(n.width=this._computeMaterialWidth(t.size.newValue,this.symbol.worldSized),delete t.size),t.cap?.type===`complete`&&(n.cap=C(t.cap.newValue??`butt`),delete t.cap);let r=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,r),e.symbolLayerStatePatches.push(()=>{for(let e of this._materials)e?.setParameters(n)})}layerOpacityChanged(){for(let e=0;e<3;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){let e=this._screenSizePerspective;for(let t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=_(U.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=v(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){let e={hasSlicePlane:this._context.slicePlaneEnabled};for(let t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,n){let r=e.graphic,i=W(r.geometry);if(i==null)return null;let a=[],o=[],s=l(),c=P(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(c,i.paths,`paths`,`LineSymbol3DLayer`);for(let t=0;t<c.lines.length;t++){let r=c.lines[t],i=r.position,l=r.mapPositions;if(this._context.clippingExtent!=null&&(u(l,s),!d(s,this._context.clippingExtent)))continue;let f=this._createGeometryParts(e,i,l,1,n);o.push(f),a.push(f.line),f.wireframe!=null&&a.push(f.wireframe),f.marker!=null&&a.push(f.marker)}if(a.length===0)return null;let f=this._context.layerViewUid,p=new I({geometries:a,castShadow:!1,layerViewUid:f,graphicUid:n}),m=new y(this,p,null,(e,t,n,r,i)=>g(e,t,n,r,i,o),t);return m.alignedSampledElevation=c.sampledElevation,m.needsElevationUpdates=v(t.mode),m}_createGeometryParts(e,t,n,r,i){let a=r===0?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,o=this._fastUpdates?.visualVariables.color,s=this._fastUpdates?.visualVariables.size,c=this._fastUpdates?.visualVariables.opacity,l=this._context.layerViewUid,u=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:i,layerViewUid:l}),{renderingInfo:d}=e,f={position:t,size:s?null:this._getDrivenSize(d),color:o?null:this._getDrivenColor(d),sizeFeature:s?k(s,d.size):null,colorFeature:o?O(o,d.color):null,opacityFeature:c?O(c,d.opacity):null},p=r===0?this._context.drapeSourceRenderer.rendererContext.localOriginFactory:this._context.localOriginFactory,m=M(t,p),h={overlayInfo:a,mapPositions:n,attributeData:f},g=N(this._lineMaterial,h,m,u),_=j.LINE_WIREFRAMES?N(this._wireframeLineMaterial,h,m,u):null,v=this._markerMaterial,y=null;v!=null&&(h.attributeData={...f,color:o?null:this._getDrivenMarkerColor(d)},y=V(v,h,m));for(let e of[g,y,_])e!=null&&(e.layerViewUid=l,e.graphicUid=i);return{line:g,marker:y,wireframe:_}}_createAsOverlay(e){let t=e.graphic,{geometry:n}=t;this._lineMaterial.renderPriority=this._renderPriority;let r=j.LINE_WIREFRAMES?this._wireframeLineMaterial:null,i=this._markerMaterial;r!=null&&(r.renderPriority=this._renderPriority-.001),i!=null&&(i.renderPriority=this._renderPriority-.002);let a=[],o=l(),s=f(),c=F(n,this._context.overlaySR);this._logGeometryCreationWarnings(c,n.paths,`paths`,`LineSymbol3DLayer`);for(let n of c.lines){if(u(n.position,o),!d(o,this._context.clippingExtent))continue;p(s,o);let r=this._createGeometryParts(e,n.position,void 0,0,t.uid);r.marker!=null&&a.push(r.marker),a.push(r.line),r.wireframe!=null&&a.push(r.wireframe)}return new b(this,a,s,this._context.drapeSourceRenderer)}get _patternHidesLine(){return z(this.symbolLayer.pattern)}_computeMaterialWidth(e,i){return i?this._drivenProperties.size?1:e??1:(e??=t,this._drivenProperties.size?this._fastUpdates?.visualVariables.size?r:1:n(e))}_prepareMaterialPatch(e,t,n){let r=t.material;if(r==null){n.changed&&n.useMaterialColor&&G(this._getCombinedOpacityAndColor(this._materialColor),this._materials[2],e);return}if(r.type===`collection`)return;let i=r.type===`complete`?r.newValue?.color:r.diff.color?.type===`complete`?r.diff.color.newValue:null,a=this._getCombinedOpacityAndColor(i);n.useMaterialColor&&G(s(a),this._materials[2],e),this._patternHidesLine&&(a[3]=0),G(a,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){let n=t.marker,r=this._markerMaterial;if(n==null||n.type!==`partial`||n.diff==null||n.diff.placement!=null||n.diff.style!=null&&n.diff.style.type!==`complete`||n.diff.color!=null&&n.diff.color.type!==`complete`||r==null)return{changed:!1,useMaterialColor:this._markerColor==null};let i=n.diff.color,a=i!=null,o=a?i.newValue:null,s=o==null&&this._markerColor==null;o&&G(this._getCombinedOpacityAndColor(o),r,e);let c=n.diff.style?.newValue;return c&&e.symbolLayerStatePatches.push(()=>r.setParameters({markerPrimitive:T(c)})),delete t.marker,{changed:a,useMaterialColor:s}}_fastVisualVariableConvertOptions(e=!1){let t=this._getFallbackSize(),{size:n}=this.symbolLayer;return new A({supports:{size:!0,color:!0,rotation:!1,opacity:!0},symbolSize:i(n,n,n),fallbackColor:e?this._getFallbackMarkerOpacityAndColor(S):this._getFallbackOpacityAndColor(S),fallbackSize:i(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer.marker?.color?.a??this._getFallbackOpacity()}_getWorldOrScreenSize(e){return this.symbol.worldSized?e:n(e)}_getFallbackSize(){return this._getWorldOrScreenSize(this.symbolLayer.size)}}function W(e){return e.type===`polyline`?e:null}function G(e,t,n){t!=null&&n.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function K(e){return(e.material?.color?.a??1)===1&&(e.marker?.color?.a??1)===1}export{U as Graphics3DLineSymbolLayer};
|
|
2
|
+
import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{onePixelInPoints as t,pt2px as n,onePointInPixels as r}from"../../../../core/screenUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as o,clone as s,ones as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as l,fromBuffer as u,intersectsClippingArea as d,empty as f,expandWithAABB as p}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as m}from"../../../../renderers/support/renderingInfoUtils.js";import{getTransformationType as h}from"../../../../renderers/visualVariables/support/sizeVariableUtils.js";import{perBufferLineElevationAligner as g}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as _,needsElevationUpdates2D as v}from"./elevationAlignmentUtils.js";import{Graphics3DBufferGraphicLayer as y}from"./Graphics3DBufferGraphicLayer.js";import{Graphics3DDrapedBufferGraphicLayer as b}from"./Graphics3DDrapedBufferGraphicLayer.js";import{Graphics3DSymbolLayer as x,nanFallbackColor as S}from"./Graphics3DSymbolLayer.js";import{parseCapType as C,computeSymbolLayerIndex as w,parseLineMarkerStyle as T}from"./lineUtils.js";import{initFastSymbolUpdatesState as E,updateFastSymbolUpdatesState as D,getAttributeValue as O,getSizeAttributeValue as k,ConvertOptions as A}from"../support/FastSymbolUpdates.js";import{debugFlags as j}from"../../support/debugFlags.js";import{selectLocalOrigin as M,createBufferGeometry as N}from"../../support/engineContent/line.js";import{geometryToRenderInfo as P,geometryToRenderInfoDraped as F}from"../../support/renderInfoUtils/line.js";import{BufferObject3D as I}from"../../webgl-engine/lib/BufferObject3D.js";import{LineMarkerMaterial as L}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as R,patternHidesLine as z}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as B}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createLineMarkerBufferGeometry as V}from"../../webgl-engine/materials/internal/lineMarkerBufferUtils.js";const H=[`polyline`];class U extends x{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,K(t))}async doLoad(){if(this._fastUpdates=E(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastMarkerUpdates=E(this._context.renderer,this._fastVisualVariableConvertOptions(!0)),!this._drivenProperties.size&&(this.symbolLayer.size==null?t:this.symbolLayer.size)<0)throw new e(`graphics3dlinesymbollayer:invalid-size`,`Symbol sizes may not be negative values`)}_getMaterialParameters(e,t){let n=this._screenSizePerspective,r=!!has(`enable-feature:emissive-on-non-volumetric`)&&!this.draped,{symbolLayer:i}=this,{worldSized:a}=this.symbol,o={...this._getMaterialColorParameters(t),shadingEnabled:r,width:this._computeMaterialWidth(i.size,a),worldSized:a,polygonOffset:3,polygonOffsetIndex:w(this._renderPriority,this._renderPriorityStep),join:i.join||`miter`,cap:C(i.cap||`butt`),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:R(i.pattern??i.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:n};if(t===2){if(this._fastMarkerUpdates?.visualVariables)return{...o,...this._fastMarkerUpdates.materialParameters}}else if(o.hasVertexColor=this._hasDrivenColorOrOpacity,o.hasVertexSize=this._drivenProperties.size,o.hasLineDistance=o.stipplePattern!=null,this._fastUpdates?.visualVariables)return{...o,...this._fastUpdates.materialParameters};return o}_getMaterialColorParameters(e){let t=e===2,n=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(n[3]=0),{color:n}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return this._materials[0]??=new B(this._getMaterialParameters(!1,0),this.view),this._materials[0]}get _wireframeLineMaterial(){return this._materials[1]??=new B({...this._getMaterialParameters(!1,1),wireframe:!0},this.view),this._materials[1]}get _markerMaterial(){return this._materials[2]==null&&this.symbolLayer.marker!=null&&(this._materials[2]=new L({...this._getMaterialParameters(!1,2),placement:this.symbolLayer.marker.placement,markerPrimitive:T(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[2]}_getDrivenSize(e){if(this._drivenProperties.size){let t=e.size;if(t==null)return this._getFallbackSize();let n=m(t.output);return this._getWorldOrScreenSize(n)}return 1}_getDrivenColor({color:e,opacity:t}){let n=c();return this._drivenProperties.color&&(a(n,e?.output??this._getFallbackOpacityAndColor(o)),t==null)||this._drivenProperties.opacity&&(e||this._materialColor)&&(n[3]=t?.output??this._getFallbackOpacity()),n}_getDrivenMarkerColor({color:e,opacity:t}){let n=c();return this._drivenProperties.color&&(a(n,e?.output??this._getFallbackMarkerOpacityAndColor(o)),t==null)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(n[3]=t?.output??this._getFallbackMarkerOpacity()),n}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validatePolylineContext(e))return null;this._warnIfVVRequiresWorldSized(e.renderingInfo);let n=this.createElevationContextForGraphic(t),r=n.mode===`on-the-ground`;return this.ensureDrapedStatus(r),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,n,t.uid)}_validatePolylineContext(e){let t=e.graphic.geometry;return this._validateGeometry(t,H,this.symbolLayer.type)&&t.type===`polyline`}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:{let e=this._fastUpdates;if(D(e,t,this._fastVisualVariableConvertOptions()))for(let t of this._materials)t instanceof B&&t.setParameters(e.materialParameters);else return 0;let n=this._fastMarkerUpdates;if(D(n,t,this._fastVisualVariableConvertOptions(!0)))for(let e of this._materials)e instanceof L&&e.setParameters(n.materialParameters);else return 0}break;default:return 0}return`visualVariables`in e.diff&&this._warnIfVVRequiresWorldSized(),2}_warnIfVVRequiresWorldSized(e){if(this.symbol.worldSized||this.ignoreDrivers)return;let t=this._getSizeVariable(e);t==null||t.useSymbolValue||t.target===`outline`||h(t)===`real-world-size`&&this.logger.warnOnce(`SizeVariable uses real-world units, but LineSymbol3D.worldSized is false. Set LineSymbol3D.worldSized to true to render real-world line widths.`)}_getSizeVariable(e){let t=this._fastUpdates?.visualVariables.size;if(t)return t.variables[0];let n=e?.size,r=n?.output.findIndex(e=>typeof e==`number`);return r==null?null:n?.variables[r]}prepareSymbolLayerPatch(e){if(e.diff.type!==`partial`)return;let t=e.diff.diff,n={};t.size?.type===`complete`&&(n.width=this._computeMaterialWidth(t.size.newValue,this.symbol.worldSized),delete t.size),t.cap?.type===`complete`&&(n.cap=C(t.cap.newValue??`butt`),delete t.cap);let r=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,r),e.symbolLayerStatePatches.push(()=>{for(let e of this._materials)e?.setParameters(n)})}layerOpacityChanged(){for(let e=0;e<3;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){let e=this._screenSizePerspective;for(let t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=_(U.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=v(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){let e={hasSlicePlane:this._context.slicePlaneEnabled};for(let t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,n){let r=W(e.graphic.geometry);if(r==null)return null;let i=[],a=[],o=l(),s=P(r,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(s,r.paths,`paths`,`LineSymbol3DLayer`);for(let t=0;t<s.lines.length;t++){let r=s.lines[t],c=r.position,l=r.mapPositions;if(this._context.clippingExtent!=null&&(u(l,o),!d(o,this._context.clippingExtent)))continue;let f=this._createGeometryParts(e,c,l,1,n);a.push(f),i.push(f.line),f.wireframe!=null&&i.push(f.wireframe),f.marker!=null&&i.push(f.marker)}if(i.length===0)return null;let c=this._context.layerViewUid,f=new I({geometries:i,castShadow:!1,layerViewUid:c,graphicUid:n}),p=new y(this,f,null,(e,t,n,r,i)=>g(e,t,n,r,i,a),t);return p.alignedSampledElevation=s.sampledElevation,p.needsElevationUpdates=v(t.mode),p}_createGeometryParts(e,t,n,r,i){let a=r===0?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,o=this._fastUpdates?.visualVariables.color,s=this._fastUpdates?.visualVariables.size,c=this._fastUpdates?.visualVariables.opacity,l=this._context.layerViewUid,u=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:i,layerViewUid:l}),{renderingInfo:d}=e,f={position:t,size:s?null:this._getDrivenSize(d),color:o?null:this._getDrivenColor(d),sizeFeature:s?k(s,d.size):null,colorFeature:o?O(o,d.color):null,opacityFeature:c?O(c,d.opacity):null},p=r===0?this._context.drapeSourceRenderer.rendererContext.localOriginFactory:this._context.localOriginFactory,m=M(t,p),h={overlayInfo:a,mapPositions:n,attributeData:f},g=N(this._lineMaterial,h,m,u),_=j.LINE_WIREFRAMES?N(this._wireframeLineMaterial,h,m,u):null,v=this._markerMaterial,y=null;v!=null&&(h.attributeData={...f,color:o?null:this._getDrivenMarkerColor(d)},y=V(v,h,m));for(let e of[g,y,_])e!=null&&(e.layerViewUid=l,e.graphicUid=i);return{line:g,marker:y,wireframe:_}}_createAsOverlay(e){let t=e.graphic,{geometry:n}=t;this._lineMaterial.renderPriority=this._renderPriority;let r=j.LINE_WIREFRAMES?this._wireframeLineMaterial:null,i=this._markerMaterial;r!=null&&(r.renderPriority=this._renderPriority-.001),i!=null&&(i.renderPriority=this._renderPriority-.002);let a=[],o=l(),s=f(),c=F(n,this._context.overlaySR);this._logGeometryCreationWarnings(c,n.paths,`paths`,`LineSymbol3DLayer`);for(let n of c.lines){if(u(n.position,o),!d(o,this._context.clippingExtent))continue;p(s,o);let r=this._createGeometryParts(e,n.position,void 0,0,t.uid);r.marker!=null&&a.push(r.marker),a.push(r.line),r.wireframe!=null&&a.push(r.wireframe)}return new b(this,a,s,this._context.drapeSourceRenderer)}get _patternHidesLine(){return z(this.symbolLayer.pattern)}_computeMaterialWidth(e,i){return i?this._drivenProperties.size?1:e??1:(e??=t,this._drivenProperties.size?this._fastUpdates?.visualVariables.size?r:1:n(e))}_prepareMaterialPatch(e,t,n){let r=t.material;if(r==null){n.changed&&n.useMaterialColor&&G(this._getCombinedOpacityAndColor(this._materialColor),this._materials[2],e);return}if(r.type===`collection`)return;let i=r.type===`complete`?r.newValue?.color:r.diff.color?.type===`complete`?r.diff.color.newValue:null,a=this._getCombinedOpacityAndColor(i);n.useMaterialColor&&G(s(a),this._materials[2],e),this._patternHidesLine&&(a[3]=0),G(a,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){let n=t.marker,r=this._markerMaterial;if(n==null||n.type!==`partial`||n.diff==null||n.diff.placement!=null||n.diff.style!=null&&n.diff.style.type!==`complete`||n.diff.color!=null&&n.diff.color.type!==`complete`||r==null)return{changed:!1,useMaterialColor:this._markerColor==null};let i=n.diff.color,a=i!=null,o=a?i.newValue:null,s=o==null&&this._markerColor==null;o&&G(this._getCombinedOpacityAndColor(o),r,e);let c=n.diff.style?.newValue;return c&&e.symbolLayerStatePatches.push(()=>r.setParameters({markerPrimitive:T(c)})),delete t.marker,{changed:a,useMaterialColor:s}}_fastVisualVariableConvertOptions(e=!1){let t=this._getFallbackSize(),{size:n}=this.symbolLayer;return new A({supports:{size:!0,color:!0,rotation:!1,opacity:!0},symbolSize:i(n,n,n),fallbackColor:e?this._getFallbackMarkerOpacityAndColor(S):this._getFallbackOpacityAndColor(S),fallbackSize:i(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer.marker?.color?.a??this._getFallbackOpacity()}_getWorldOrScreenSize(e){return this.symbol.worldSized?e:n(e)}_getFallbackSize(){return this._getWorldOrScreenSize(this.symbolLayer.size)}}function W(e){return e.type===`polyline`?e:null}function G(e,t,n){t!=null&&n.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function K(e){return(e.material?.color?.a??1)===1&&(e.marker?.color?.a??1)===1}export{U as Graphics3DLineSymbolLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{throwIfAborted as e}from"../../../../core/promiseUtils.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{identity as n,scale as r,translate as i,copy 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{length as s,negate as c,copy as l,multiply as u,add as d,set as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as p,ONES as m,ZEROS as h,fromValues as g,create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as v,ONES as y,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as x}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as S}from"../../../../geometry/projection/projectPointToVector.js";import{create as C,size as w,containsPoint as T,center as E}from"../../../../geometry/support/aaBoundingBox.js";import{getEmissiveMode as ee}from"../../../../symbols/support/materialUtils.js";import{defaultObjectPrimitive as D}from"../../../../symbols/support/primitives.js";import{objectSymbolLayerPrimitiveBoundingBox as te,objectSymbolLayerSizeWithResourceSize as O}from"../../../../symbols/support/symbolLayerUtils3D.js";import{estimateNumVerticesForLods as ne,defaultSymbolLayerMemoryComplexity as re}from"./defaultSymbolComplexity.js";import{perLodInstanceElevationAligner as ie}from"./ElevationAligners.js";import{needsElevationUpdates3D as k,SampleElevationInfo as A,evaluateElevationInfoAtPoint as j}from"./elevationAlignmentUtils.js";import{preparePatchEmissiveStrength as M}from"./emissiveUtils.js";import{Graphics3DLodInstanceGraphicLayer as ae}from"./Graphics3DLodInstanceGraphicLayer.js";import{Graphics3DSymbolLayer as oe,nanFallbackColor as N}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as P,computeObjectScale as F,computeObjectRotation as I}from"./graphicUtils.js";import{makeLodResources as se}from"./lodResourceUtils.js";import{fetch as ce}from"./objectResourceUtils.js";import{placePointOnGeometry as L,extendPointGraphicElevationContext as R}from"./pointUtils.js";import{isValidPrimitive as z,primitiveLodResources as B}from"./primitiveObjectSymbolUtils.js";import{SymbolComplexity as V}from"./SymbolComplexity.js";import{getResourceUrlFromSymbolStyle as H}from"./webStyleUtils.js";import{initFastSymbolUpdatesState as U,updateFastSymbolUpdatesState as W,ConvertOptions as le,evaluateModelTransformScale as ue,evaluateModelTransform as de}from"../support/FastSymbolUpdates.js";import{VerticalOffsetParameters as fe}from"../../webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{LodRenderer as pe}from"../../webgl-engine/lib/lodRendering/LodRenderer.js";import{DefaultMaterial as me}from"../../webgl-engine/materials/DefaultMaterial.js";import{schematicMRRFactors as he}from"../../webgl-engine/materials/pbrUtils.js";class G{constructor(e,t,n,r,i,a,o,s,c,l,u=null){this.lodResources=e,this.lodRenderer=t,this.stageResources=n,this.resourceSize=r,this.isEsriSymbolResource=i,this.isWosr=a,this.resourceBoundingBox=o,this.symbolSize=s,this.extentPadding=c,this.physicalBasedRenderingEnabled=l,this.pivotOffset=u}}class ge extends oe{getCachedSize(){let[e,t,n]=this._resources==null?[1,1,1]:this._resources.symbolSize;return{width:e,depth:t,height:n}}constructor(e,t,n,r){super(e,t,n,r,_e(t)),this._resources=null,this._instanceIndexToGraphicUid=new Map,this._hasLoadedPBRTextures=!1,this._disposeResourceHandles=[],this.skipHighSymbolLodsChanged=!1,this.ensureDrapedStatus(!1),this._hasLoadedPBRTextures=n.physicalBasedRenderingEnabled}async doLoad(e){if(!this._drivenProperties.size){let e=P(this.symbolLayer);if(e)throw Error(e)}if(this._isPrimitive){let t=this.symbolLayer.resource,n=t&&z(t?.primitive)?t.primitive:D;this._resources=await this._createResourcesForPrimitive(n,e)}else{let t=(await H(this.symbol.styleOrigin))?.href??this.symbolLayer.resource?.href;this._resources=await this._createResourcesForUrl(t,e)}this.layerOpacityChanged(),this.slicePlaneEnabledChanged(),this.physicalBasedRenderingChanged(),this.updateComplexity()}get extentPadding(){return this._resources==null?0:this._resources.extentPadding}get _isPrimitive(){return this._primitive!=null}get lodRenderer(){return this._resources?.lodRenderer}get materials(){return this._resources?.stageResources.materials??[]}async _createResourcesForPrimitive(t,n){let r=this.symbolLayer,i=C(te(t)),a=p(w(i)),o=p(O(a,r)),c=s(o),l=r.material?.emissive,u=(l?.source===`color`?l?.strength:void 0)??0,d={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:he,ambient:m,diffuse:m,opacity:1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:r.castShadows,emissiveStrengthFromSymbol:u,emissiveSource:1,offsetTransparentBackfaces:!1,drivenOpacity:this.needsDrivenTransparentPass},f=!!d.usePBR,h=this.symbol;h.type===`point-3d`&&h.verticalOffset&&(d.verticalOffset=new fe(h.verticalOffset),d.castShadows=!1),this._context.screenSizePerspectiveEnabled&&(d.screenSizePerspective=this.view.screenSizePerspective.parameters),d.externalColor=this._hasDrivenColorOrOpacity?N:this._materialColor?.toUnitRGBA()??v,this._fastUpdates=U(this._context.renderer,this._fastVisualVariableConvertOptions(i,o,a,null)),d.instanced=!0,this._fastUpdates?(Object.assign(d,this._fastUpdates.materialParameters),d.instancedFeatureAttribute=!0):this._hasDrivenColorOrOpacity&&(d.instancedColor=!0);let g=new me(d,this._context.spherical);g.setParameters({cullFace:J(g.transparent)});let _=B(t,g);if(!_)throw Error(`Unknown object symbol primitive: ${t}`);let y=await this._createStageResources(_,f,n);e(n);let b=await this._createLodRenderer(_,n);return new G(_,b,y,a,!1,!1,i,o,c,f)}async _createResourcesForUrl(n,r){let i={instanced:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows},a={spherical:this._context.spherical,materialParameters:i,cache:this._context.sharedResources.objectResourceCache,compressionOptions:{compressionTracker:this._context.compressionTracker,compressionCallback:()=>this.updateComplexity()}};this._fastUpdates=U(this._context.renderer,this._fastVisualVariableConvertOptions(null,null,null,null)),this._fastUpdates?(Object.assign(a.materialParameters,this._fastUpdates.materialParameters),a.materialParameters.instancedFeatureAttribute=!0):this._hasDrivenColorOrOpacity&&(a.materialParameters.instancedColor=!0);let o=this.symbol;if(o.type===`point-3d`&&o.verticalOffset){let{screenLength:e,minWorldLength:n,maxWorldLength:r}=o.verticalOffset;a.materialParameters.verticalOffset={screenLength:t(e),minWorldLength:n||0,maxWorldLength:r??1/0},a.materialParameters.castShadows=!1}let c=this._context.physicalBasedRenderingEnabled;a.signal=r,a.usePBR=c,a.useEmissive=this.view.stage.renderView.renderingContext.driverTest.floatBufferBlend.result,a.skipHighLods=this._context.skipHighSymbolLods;let l=this.symbolLayer.material;a.materialParameters.emissiveStrengthFromSymbol=l?.emissive?.strength??1,a.materialParameters.emissiveSource=ee(l?.emissive?.source??`emissive`);let u=await ce(n,a),d=u.isEsriSymbolResource,f=u.isWosr,m=se(u.lods),h=this._context,g=this._getExternalColorParameters(l),_=this.needsDrivenTransparentPass,v=m.getMaterials();v.forEach(e=>{e.setParameters({...g,drivenOpacity:_}),h.screenSizePerspectiveEnabled&&e.setParameters({screenSizePerspective:this.view.screenSizePerspective.parameters})});let y=u.referenceBoundingBox,b=p(w(y)),x=p(m.levels[0].pivotOffset),S=p(O(b,this.symbolLayer)),C=s(S),T=this._fastUpdates;W(T,this._context.renderer,this._fastVisualVariableConvertOptions(y,S,b,x))&&v.forEach(e=>e.setParameters(T.materialParameters));let E=await this._createStageResources(m,c,r);e(r);let D=await this._createLodRenderer(m,r);return new G(m,D,E,b,d,f,y,S,C,c,x)}_addDisposeResource(e){this._disposeResourceHandles.push(e)}async _createStageResources(t,n,r){let i=this._context.stage,a=t.getMaterials();n!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged();let o=t.getTextures();return i.addTextures(o),this._addDisposeResource(()=>{o.forEach(e=>e.unload()),i.removeTextures(o)}),await Promise.all(o.map(e=>this._context.stage.schedule(()=>e.load(i.renderView.renderingContext),r))),e(r),{materials:a,textures:o,geometries:t.getEngineGeometries()}}async _createLodRenderer(e,t){let n=this._context.stage,r={layerViewUid:this._context.layerViewUid,graphicUid:e=>this._instanceIndexToGraphicUid.get(e),notifyGraphicGeometryChanged:e=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(e)),notifyGraphicVisibilityChanged:e=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(e))},i=this._fastUpdates,o=new pe({symbol:e,metadata:r,shaderTransformation:i?{applyTransform:(e,t,n)=>{e.getFeatureAttribute(t,Q),a(n,de(i.materialParameters,Q,n))},scaleFactor:(e,t,n)=>{t.getFeatureAttribute(n,Q),ue(e,i.materialParameters,Q)}}:null},this._context.scheduler);return o.slicePlaneEnabled=this._context.slicePlaneEnabled,this._addDisposeResource(()=>{n.removeRenderPlugin(o),o.destroy()}),await n.addRenderPlugin(o,t),o}_getExternalColorParameters(e){let t={};if(t.externalColor=N,!this._drivenProperties.color&&e?.color!=null){let n=e.color.toUnitRGBA();this._drivenProperties.opacity&&(n[3]=NaN),t.externalColor=n}return t}destroy(){super.destroy(),this._cleanupResources()}_cleanupResources(){this._disposeResourceHandles.forEach(e=>e()),this._disposeResourceHandles.length=0,this._resources=null}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let n=L(t.geometry);if(n==null)return this.logger.warn(`unsupported geometry type for object symbol: ${t.geometry.type}`),null;let r=this.createElevationContextForGraphic(t),i=e.renderingInfo;return this._createAs3DShape(n,i,r,t.uid)}notifyDestroyGraphicLayer(e){this._instanceIndexToGraphicUid.delete(e.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){if(this._resources==null)return;let e=this._getLayerOpacity(),t=this._resources.stageResources.materials;for(let n=0;n<t.length;n++){let r=t[n];r.setParameters({layerOpacity:e}),this._isPrimitive&&r.setParameters({cullFace:J(r.transparent)})}}layerScreenSizePerspectiveChanged(){if(this._resources==null)return;let e=this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null;for(let t of this._resources.stageResources.materials)t.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,k)}slicePlaneEnabledChanged(){if(this._resources==null)return!0;this._resources.lodRenderer.slicePlaneEnabled=this._context.slicePlaneEnabled;for(let e of this._resources.stageResources.materials)e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){if(this._resources==null)return!0;let{stageResources:e,isWosr:t}=this._resources;for(let n of e.materials)this._isPrimitive?n.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}):t||n.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!1});return this._hasLoadedPBRTextures===!1&&this._context.physicalBasedRenderingEnabled===!0?(this._hasLoadedPBRTextures=!0,!1):!0}applyRendererDiff(e,t){if(this._resources==null)return 0;let{stageResources:{materials:n},lodRenderer:r,resourceBoundingBox:i,symbolSize:a,resourceSize:o,pivotOffset:s}=this._resources;for(let c in e.diff)switch(c){case`visualVariables`:if(W(this._fastUpdates,t,this._fastVisualVariableConvertOptions(i,a,o,s))){for(let e of n)e.setParameters(this._fastUpdates.materialParameters);r.notifyShaderTransformationChanged()}else return 0;break;default:return 0}return 2}computeComplexity(){if(this._resources==null)return super.computeComplexity();let e=this._resources.lodResources,t=ne(e.levels),n=e.computeUsedMemory(),r={...re(this.symbol,this.symbolLayer),resourceBytes:n};return new V({verticesPerFeature:t,memory:r})}_hasLodRenderer(){return this._resources!=null}_createAs3DShape(e,t,n,r){if(!this._hasLodRenderer()||this._resources==null)return null;let i=this.getFastUpdateAttrValues(t),a=this._context.clippingExtent;if(S(e,Y,this._context.elevationProvider.spatialReference),a!=null&&!T(a,Y))return null;let o=q(n),s=this._computeGlobalTransform(e,n,Z,$),c=this._computeLocalTransform(this._resources,this.symbolLayer,t,X),l=this._resources.lodRenderer.instanceData,u=l.addInstance();this._instanceIndexToGraphicUid.set(u,r),l.setLocalTransform(u,c,!1),l.setGlobalTransform(u,s),i&&l.setFeatureAttribute(u,i),this._fastUpdates==null&&this._hasDrivenColorOrOpacity&&l.setColor(u,this._getDrivenUInt8ColorWithNaNSupport(t,this._materialColor,!this._isPrimitive));let d=this._context.stage.renderView.olidRenderHelper;if(d){let e=d.getObjectAndLayerIdColor({graphicUid:r,layerViewUid:this._context.layerViewUid});l.setObjectAndLayerIdColor(u,e)}let f=new ae(this,u,ie,n,this._context.stage.view.state.highlightOrderMap);return o&&(f.alignedSampledElevation=$.sampledElevation),f.needsElevationUpdates=k(n.mode),R(f,e,this._context.elevationProvider),f}_computeGlobalTransform(e,t,n,r){return j(e,this._context.elevationProvider,t,this._context.renderCoordsHelper,r),Y[0]=e.x,Y[1]=e.y,Y[2]=r.z,x(e.spatialReference,Y,n,this._context.renderCoordsHelper.spatialReference),n}_computeLocalTransform(e,t,r,i){return n(i),this._applyObjectRotationVisualVariables(r,!1,i),this._applyObjectRotation(t,!0,i),this._applyObjectScale(e,r,i),this._applyAnchor(e,t,i),i}_applyObjectScale(e,t,n){if(this._fastUpdates?.requiresShaderTransformation)return;let i=this._drivenProperties.size&&t.size?t.size.output:e.symbolSize,a=F(i,e.symbolSize,e.resourceSize,this._context.renderCoordsHelper.unitInMeters);if(a[0]!==1||a[1]!==1||a[2]!==1)r(n,n,a);else return}prepareSymbolLayerPatch(e){if(e.diff.type!==`partial`)return;let t=e.diff.diff;this._preparePatchTransform(e,t),this._preparePatchColor(e,t),this._preparePatchEmissive(e,t)}updateGeometry(e,t){if(this._resources==null)return!0;let n=e.geometry;if(!n)return!1;let r=L(n);if(r==null)return!1;let i=this.getGeometryElevationMode(n),{elevationContext:a}=t;return a.mode===i&&(a.updateFeatureExpressionFeature(e,this._context.layer),this._computeGlobalTransform(r,a,Z,$),q(a)&&(t.alignedSampledElevation=$.sampledElevation),this._resources.lodRenderer.instanceData.setGlobalTransform(t.instanceIndex,Z,!0),R(t,r,this._context.elevationProvider),!0)}_preparePatchTransform(e,t){if(!t.heading&&!t.tilt&&!t.roll&&!t.width&&!t.height&&!t.depth&&!t.anchor&&!t.anchorPosition||this._resources==null)return;let n=(e,t,n)=>(e!=null&&e.type===`complete`?e.newValue:t)??n,r=n(t.heading,this.symbolLayer.heading,0),i=n(t.tilt,this.symbolLayer.tilt,0),a=n(t.roll,this.symbolLayer.roll,0),o=n(t.width,this.symbolLayer.width,void 0),s=n(t.height,this.symbolLayer.height,void 0),c=n(t.depth,this.symbolLayer.depth,void 0),l=n(t.anchor,this.symbolLayer.anchor,void 0),u=n(t.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete t.heading,delete t.tilt,delete t.roll,delete t.width,delete t.height,delete t.depth,delete t.anchor,delete t.anchorPosition;let d={heading:r,tilt:i,roll:a,anchor:l,anchorPosition:u},f=this._resources;this.loadStatus===1&&e.symbolLayerStatePatches.push(()=>{f.symbolSize=p(O(f.resourceSize,{width:o,height:s,depth:c,isPrimitive:this._isPrimitive}))}),e.graphics3DGraphicPatches.push(({instanceIndex:e},t)=>{let n=this._computeLocalTransform(f,d,t,X);f.lodRenderer.instanceData.setLocalTransform(e,n,!0)})}_preparePatchColor(e,t){if(!t.material||t.material.type!==`partial`)return;let n=t.material.diff;if(!n.color||n.color.type!==`complete`||n.color.newValue==null||n.color.oldValue==null)return;let r=n.color.newValue,i=r==null?y:r.toUnitRGBA();delete n.color;let a=this._resources;if(a==null)return;let o=this._isPrimitive;e.graphics3DGraphicPatches.push(({instanceIndex:e})=>{if(this._hasDrivenColorOrOpacity)a.lodRenderer.instanceData.setColor(e,i);else{let e={externalColor:i};for(let t of a.stageResources.materials)t.setParameters(e),o&&t.setParameters({cullFace:J(t.transparent)})}})}_preparePatchEmissive(e,t){return M(e,t,e=>{this._resources?.stageResources.materials.forEach(t=>{if(!this._isPrimitive){t.setParameters({emissiveStrengthFromSymbol:e??1});return}let n=this.symbolLayer.material?.emissive?.source===`color`;t.setParameters({emissiveStrengthFromSymbol:n?e??0:0})})},this.view.stage.renderView.renderingContext.driverTest.floatBufferBlend.result)}_applyObjectRotationVisualVariables(e,t,n){this._fastUpdates?.requiresShaderTransformation&&t||I(e.heading?.output,e.tilt?.output,e.roll?.output,n)}_applyObjectRotation(e,t,n){this._fastUpdates?.requiresShaderTransformation&&t||I(e.heading,e.tilt,e.roll,n)}_applyAnchor(e,t,n){if(this._fastUpdates?.requiresShaderTransformation)return;let r=K(e.resourceBoundingBox,e.pivotOffset,t);r&&i(n,n,r)}_fastVisualVariableConvertOptions(e,t,n,r){let i=e==null?m:p(w(e)),a=e==null?h:K(e,r,this.symbolLayer),o=this._context.renderCoordsHelper.unitInMeters,s=F(t??void 0,t,n,o),c=g(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return new le({supports:{size:!0,color:!0,rotation:!0,opacity:!1},modelSize:i,symbolSize:t??m,unitInMeters:o,anchor:a,scale:s,rotation:c,fallbackColor:this._getFallbackOpacityAndColor(),fallbackSize:s})}get _primitive(){let{resource:e}=this.symbolLayer;return e?.href==null?e?.primitive??D:null}_getFallbackOpacityAndColor(){return this._materialColor?.toUnitRGBA()??(this._isPrimitive?v:N)}get _materialColor(){return this.symbolLayer.material?.color}}function K(e,t,n){let r=_();switch(n.anchor){case`center`:l(r,E(e)),c(r,r);break;case`top`:{let t=E(e);f(r,-t[0],-t[1],-e[5]);break}case`bottom`:{let t=E(e);f(r,-t[0],-t[1],-e[2]);break}case`relative`:{let t=E(e),i=w(e),a=n.anchorPosition,o=a?g(a.x,a.y,a.z):h;u(r,i,o),d(r,r,t),c(r,r);break}default:t==null?l(r,h):c(r,t)}return r}function q(e){return e.mode!==`absolute-height`}function _e(e){return(e.material?.color?.a??1)===1&&e.resource?.href==null}function J(e){return e?0:2}const Y=_(),X=o(),Z=o(),Q=b(),$=new A;export{ge as Graphics3DObjectSymbolLayer};
|
|
2
|
+
import{throwIfAborted as e}from"../../../../core/promiseUtils.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{identity as n,scale as r,translate as i,copy 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{length as s,negate as c,copy as l,multiply as u,add as d,set as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as p,ONES as m,ZEROS as h,fromValues as g,create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as v,ONES as y,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as x}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as S}from"../../../../geometry/projection/projectPointToVector.js";import{create as C,size as w,containsPoint as T,center as E}from"../../../../geometry/support/aaBoundingBox.js";import{getEmissiveMode as ee}from"../../../../symbols/support/materialUtils.js";import{defaultObjectPrimitive as D}from"../../../../symbols/support/primitives.js";import{objectSymbolLayerPrimitiveBoundingBox as te,objectSymbolLayerSizeWithResourceSize as O}from"../../../../symbols/support/symbolLayerUtils3D.js";import{estimateNumVerticesForLods as ne,defaultSymbolLayerMemoryComplexity as re}from"./defaultSymbolComplexity.js";import{perLodInstanceElevationAligner as ie}from"./ElevationAligners.js";import{needsElevationUpdates3D as k,SampleElevationInfo as A,evaluateElevationInfoAtPoint as j}from"./elevationAlignmentUtils.js";import{preparePatchEmissiveStrength as M}from"./emissiveUtils.js";import{Graphics3DLodInstanceGraphicLayer as ae}from"./Graphics3DLodInstanceGraphicLayer.js";import{Graphics3DSymbolLayer as oe,nanFallbackColor as N}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as P,computeObjectScale as F,computeObjectRotation as I}from"./graphicUtils.js";import{makeLodResources as se}from"./lodResourceUtils.js";import{fetch as ce}from"./objectResourceUtils.js";import{placePointOnGeometry as L,extendPointGraphicElevationContext as R}from"./pointUtils.js";import{isValidPrimitive as z,primitiveLodResources as B}from"./primitiveObjectSymbolUtils.js";import{SymbolComplexity as V}from"./SymbolComplexity.js";import{getResourceUrlFromSymbolStyle as H}from"./webStyleUtils.js";import{initFastSymbolUpdatesState as U,updateFastSymbolUpdatesState as W,ConvertOptions as le,evaluateModelTransformScale as ue,evaluateModelTransform as de}from"../support/FastSymbolUpdates.js";import{VerticalOffsetParameters as fe}from"../../webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{LodRenderer as pe}from"../../webgl-engine/lib/lodRendering/LodRenderer.js";import{DefaultMaterial as me}from"../../webgl-engine/materials/DefaultMaterial.js";import{schematicMRRFactors as he}from"../../webgl-engine/materials/pbrUtils.js";class G{constructor(e,t,n,r,i,a,o,s,c,l,u=null){this.lodResources=e,this.lodRenderer=t,this.stageResources=n,this.resourceSize=r,this.isEsriSymbolResource=i,this.isWosr=a,this.resourceBoundingBox=o,this.symbolSize=s,this.extentPadding=c,this.physicalBasedRenderingEnabled=l,this.pivotOffset=u}}class ge extends oe{getCachedSize(){let[e,t,n]=this._resources==null?[1,1,1]:this._resources.symbolSize;return{width:e,depth:t,height:n}}constructor(e,t,n,r){super(e,t,n,r,_e(t)),this._resources=null,this._instanceIndexToGraphicUid=new Map,this._hasLoadedPBRTextures=!1,this._disposeResourceHandles=[],this.skipHighSymbolLodsChanged=!1,this.ensureDrapedStatus(!1),this._hasLoadedPBRTextures=n.physicalBasedRenderingEnabled}async doLoad(e){if(!this._drivenProperties.size){let e=P(this.symbolLayer);if(e)throw Error(e)}if(this._isPrimitive){let t=this.symbolLayer.resource,n=t&&z(t?.primitive)?t.primitive:D;this._resources=await this._createResourcesForPrimitive(n,e)}else{let t=(await H(this.symbol.styleOrigin))?.href??this.symbolLayer.resource?.href;this._resources=await this._createResourcesForUrl(t,e)}this.layerOpacityChanged(),this.slicePlaneEnabledChanged(),this.physicalBasedRenderingChanged(),this.updateComplexity()}get extentPadding(){return this._resources==null?0:this._resources.extentPadding}get _isPrimitive(){return this._primitive!=null}get lodRenderer(){return this._resources?.lodRenderer}get materials(){return this._resources?.stageResources.materials??[]}async _createResourcesForPrimitive(t,n){let r=this.symbolLayer,i=C(te(t)),a=p(w(i)),o=p(O(a,r)),c=s(o),l=r.material?.emissive,u=(l?.source===`color`?l?.strength:void 0)??0,d={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:he,ambient:m,diffuse:m,opacity:1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:r.castShadows,emissiveStrengthFromSymbol:u,emissiveSource:1,offsetTransparentBackfaces:!1,drivenOpacity:this.needsDrivenTransparentPass,normalType:1},f=!!d.usePBR,h=this.symbol;h.type===`point-3d`&&h.verticalOffset&&(d.verticalOffset=new fe(h.verticalOffset),d.castShadows=!1),this._context.screenSizePerspectiveEnabled&&(d.screenSizePerspective=this.view.screenSizePerspective.parameters),d.externalColor=this._hasDrivenColorOrOpacity?N:this._materialColor?.toUnitRGBA()??v,this._fastUpdates=U(this._context.renderer,this._fastVisualVariableConvertOptions(i,o,a,null)),d.instanced=!0,this._fastUpdates?(Object.assign(d,this._fastUpdates.materialParameters),d.instancedFeatureAttribute=!0):this._hasDrivenColorOrOpacity&&(d.instancedColor=!0);let g=new me(d,this._context.spherical);g.setParameters({cullFace:J(g.transparent)});let _=B(t,g);if(!_)throw Error(`Unknown object symbol primitive: ${t}`);let y=await this._createStageResources(_,f,n);e(n);let b=await this._createLodRenderer(_,n);return new G(_,b,y,a,!1,!1,i,o,c,f)}async _createResourcesForUrl(n,r){let i={instanced:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows},a={spherical:this._context.spherical,materialParameters:i,cache:this._context.sharedResources.objectResourceCache,compressionOptions:{compressionTracker:this._context.compressionTracker,compressionCallback:()=>this.updateComplexity()}};this._fastUpdates=U(this._context.renderer,this._fastVisualVariableConvertOptions(null,null,null,null)),this._fastUpdates?(Object.assign(a.materialParameters,this._fastUpdates.materialParameters),a.materialParameters.instancedFeatureAttribute=!0):this._hasDrivenColorOrOpacity&&(a.materialParameters.instancedColor=!0);let o=this.symbol;if(o.type===`point-3d`&&o.verticalOffset){let{screenLength:e,minWorldLength:n,maxWorldLength:r}=o.verticalOffset;a.materialParameters.verticalOffset={screenLength:t(e),minWorldLength:n||0,maxWorldLength:r??1/0},a.materialParameters.castShadows=!1}let c=this._context.physicalBasedRenderingEnabled;a.signal=r,a.usePBR=c,a.useEmissive=this.view.stage.renderView.renderingContext.driverTest.floatBufferBlend.result,a.skipHighLods=this._context.skipHighSymbolLods;let l=this.symbolLayer.material;a.materialParameters.emissiveStrengthFromSymbol=l?.emissive?.strength??1,a.materialParameters.emissiveSource=ee(l?.emissive?.source??`emissive`);let u=await ce(n,a),d=u.isEsriSymbolResource,f=u.isWosr,m=se(u.lods),h=this._context,g=this._getExternalColorParameters(l),_=this.needsDrivenTransparentPass,v=m.getMaterials();v.forEach(e=>{e.setParameters({...g,drivenOpacity:_}),h.screenSizePerspectiveEnabled&&e.setParameters({screenSizePerspective:this.view.screenSizePerspective.parameters})});let y=u.referenceBoundingBox,b=p(w(y)),x=p(m.levels[0].pivotOffset),S=p(O(b,this.symbolLayer)),C=s(S),T=this._fastUpdates;W(T,this._context.renderer,this._fastVisualVariableConvertOptions(y,S,b,x))&&v.forEach(e=>e.setParameters(T.materialParameters));let E=await this._createStageResources(m,c,r);e(r);let D=await this._createLodRenderer(m,r);return new G(m,D,E,b,d,f,y,S,C,c,x)}_addDisposeResource(e){this._disposeResourceHandles.push(e)}async _createStageResources(t,n,r){let i=this._context.stage,a=t.getMaterials();n!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged();let o=t.getTextures();return i.addTextures(o),this._addDisposeResource(()=>{o.forEach(e=>e.unload()),i.removeTextures(o)}),await Promise.all(o.map(e=>this._context.stage.schedule(()=>e.load(i.renderView.renderingContext),r))),e(r),{materials:a,textures:o,geometries:t.getEngineGeometries()}}async _createLodRenderer(e,t){let n=this._context.stage,r={layerViewUid:this._context.layerViewUid,graphicUid:e=>this._instanceIndexToGraphicUid.get(e),notifyGraphicGeometryChanged:e=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(e)),notifyGraphicVisibilityChanged:e=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(e))},i=this._fastUpdates,o=new pe({symbol:e,metadata:r,shaderTransformation:i?{applyTransform:(e,t,n)=>{e.getFeatureAttribute(t,Q),a(n,de(i.materialParameters,Q,n))},scaleFactor:(e,t,n)=>{t.getFeatureAttribute(n,Q),ue(e,i.materialParameters,Q)}}:null},this._context.scheduler);return o.slicePlaneEnabled=this._context.slicePlaneEnabled,this._addDisposeResource(()=>{n.removeRenderPlugin(o),o.destroy()}),await n.addRenderPlugin(o,t),o}_getExternalColorParameters(e){let t={};if(t.externalColor=N,!this._drivenProperties.color&&e?.color!=null){let n=e.color.toUnitRGBA();this._drivenProperties.opacity&&(n[3]=NaN),t.externalColor=n}return t}destroy(){super.destroy(),this._cleanupResources()}_cleanupResources(){this._disposeResourceHandles.forEach(e=>e()),this._disposeResourceHandles.length=0,this._resources=null}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let n=L(t.geometry);if(n==null)return this.logger.warn(`unsupported geometry type for object symbol: ${t.geometry.type}`),null;let r=this.createElevationContextForGraphic(t),i=e.renderingInfo;return this._createAs3DShape(n,i,r,t.uid)}notifyDestroyGraphicLayer(e){this._instanceIndexToGraphicUid.delete(e.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){if(this._resources==null)return;let e=this._getLayerOpacity(),t=this._resources.stageResources.materials;for(let n=0;n<t.length;n++){let r=t[n];r.setParameters({layerOpacity:e}),this._isPrimitive&&r.setParameters({cullFace:J(r.transparent)})}}layerScreenSizePerspectiveChanged(){if(this._resources==null)return;let e=this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null;for(let t of this._resources.stageResources.materials)t.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,k)}slicePlaneEnabledChanged(){if(this._resources==null)return!0;this._resources.lodRenderer.slicePlaneEnabled=this._context.slicePlaneEnabled;for(let e of this._resources.stageResources.materials)e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){if(this._resources==null)return!0;let{stageResources:e,isWosr:t}=this._resources;for(let n of e.materials)this._isPrimitive?n.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}):t||n.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!1});return this._hasLoadedPBRTextures===!1&&this._context.physicalBasedRenderingEnabled===!0?(this._hasLoadedPBRTextures=!0,!1):!0}applyRendererDiff(e,t){if(this._resources==null)return 0;let{stageResources:{materials:n},lodRenderer:r,resourceBoundingBox:i,symbolSize:a,resourceSize:o,pivotOffset:s}=this._resources;for(let c in e.diff)switch(c){case`visualVariables`:if(W(this._fastUpdates,t,this._fastVisualVariableConvertOptions(i,a,o,s))){for(let e of n)e.setParameters(this._fastUpdates.materialParameters);r.notifyShaderTransformationChanged()}else return 0;break;default:return 0}return 2}computeComplexity(){if(this._resources==null)return super.computeComplexity();let e=this._resources.lodResources,t=ne(e.levels),n=e.computeUsedMemory(),r={...re(this.symbol,this.symbolLayer),resourceBytes:n};return new V({verticesPerFeature:t,memory:r})}_hasLodRenderer(){return this._resources!=null}_createAs3DShape(e,t,n,r){if(!this._hasLodRenderer()||this._resources==null)return null;let i=this.getFastUpdateAttrValues(t),a=this._context.clippingExtent;if(S(e,Y,this._context.elevationProvider.spatialReference),a!=null&&!T(a,Y))return null;let o=q(n),s=this._computeGlobalTransform(e,n,Z,$),c=this._computeLocalTransform(this._resources,this.symbolLayer,t,X),l=this._resources.lodRenderer.instanceData,u=l.addInstance();this._instanceIndexToGraphicUid.set(u,r),l.setLocalTransform(u,c,!1),l.setGlobalTransform(u,s),i&&l.setFeatureAttribute(u,i),this._fastUpdates==null&&this._hasDrivenColorOrOpacity&&l.setColor(u,this._getDrivenUInt8ColorWithNaNSupport(t,this._materialColor,!this._isPrimitive));let d=this._context.stage.renderView.olidRenderHelper;if(d){let e=d.getObjectAndLayerIdColor({graphicUid:r,layerViewUid:this._context.layerViewUid});l.setObjectAndLayerIdColor(u,e)}let f=new ae(this,u,ie,n,this._context.stage.view.state.highlightOrderMap);return o&&(f.alignedSampledElevation=$.sampledElevation),f.needsElevationUpdates=k(n.mode),R(f,e,this._context.elevationProvider),f}_computeGlobalTransform(e,t,n,r){return j(e,this._context.elevationProvider,t,this._context.renderCoordsHelper,r),Y[0]=e.x,Y[1]=e.y,Y[2]=r.z,x(e.spatialReference,Y,n,this._context.renderCoordsHelper.spatialReference),n}_computeLocalTransform(e,t,r,i){return n(i),this._applyObjectRotationVisualVariables(r,!1,i),this._applyObjectRotation(t,!0,i),this._applyObjectScale(e,r,i),this._applyAnchor(e,t,i),i}_applyObjectScale(e,t,n){if(this._fastUpdates?.requiresShaderTransformation)return;let i=this._drivenProperties.size&&t.size?t.size.output:e.symbolSize,a=F(i,e.symbolSize,e.resourceSize,this._context.renderCoordsHelper.unitInMeters);if(a[0]!==1||a[1]!==1||a[2]!==1)r(n,n,a);else return}prepareSymbolLayerPatch(e){if(e.diff.type!==`partial`)return;let t=e.diff.diff;this._preparePatchTransform(e,t),this._preparePatchColor(e,t),this._preparePatchEmissive(e,t)}updateGeometry(e,t){if(this._resources==null)return!0;let n=e.geometry;if(!n)return!1;let r=L(n);if(r==null)return!1;let i=this.getGeometryElevationMode(n),{elevationContext:a}=t;return a.mode===i&&(a.updateFeatureExpressionFeature(e,this._context.layer),this._computeGlobalTransform(r,a,Z,$),q(a)&&(t.alignedSampledElevation=$.sampledElevation),this._resources.lodRenderer.instanceData.setGlobalTransform(t.instanceIndex,Z,!0),R(t,r,this._context.elevationProvider),!0)}_preparePatchTransform(e,t){if(!t.heading&&!t.tilt&&!t.roll&&!t.width&&!t.height&&!t.depth&&!t.anchor&&!t.anchorPosition||this._resources==null)return;let n=(e,t,n)=>(e!=null&&e.type===`complete`?e.newValue:t)??n,r=n(t.heading,this.symbolLayer.heading,0),i=n(t.tilt,this.symbolLayer.tilt,0),a=n(t.roll,this.symbolLayer.roll,0),o=n(t.width,this.symbolLayer.width,void 0),s=n(t.height,this.symbolLayer.height,void 0),c=n(t.depth,this.symbolLayer.depth,void 0),l=n(t.anchor,this.symbolLayer.anchor,void 0),u=n(t.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete t.heading,delete t.tilt,delete t.roll,delete t.width,delete t.height,delete t.depth,delete t.anchor,delete t.anchorPosition;let d={heading:r,tilt:i,roll:a,anchor:l,anchorPosition:u},f=this._resources;this.loadStatus===1&&e.symbolLayerStatePatches.push(()=>{f.symbolSize=p(O(f.resourceSize,{width:o,height:s,depth:c,isPrimitive:this._isPrimitive}))}),e.graphics3DGraphicPatches.push(({instanceIndex:e},t)=>{let n=this._computeLocalTransform(f,d,t,X);f.lodRenderer.instanceData.setLocalTransform(e,n,!0)})}_preparePatchColor(e,t){if(!t.material||t.material.type!==`partial`)return;let n=t.material.diff;if(!n.color||n.color.type!==`complete`||n.color.newValue==null||n.color.oldValue==null)return;let r=n.color.newValue,i=r==null?y:r.toUnitRGBA();delete n.color;let a=this._resources;if(a==null)return;let o=this._isPrimitive;e.graphics3DGraphicPatches.push(({instanceIndex:e})=>{if(this._hasDrivenColorOrOpacity)a.lodRenderer.instanceData.setColor(e,i);else{let e={externalColor:i};for(let t of a.stageResources.materials)t.setParameters(e),o&&t.setParameters({cullFace:J(t.transparent)})}})}_preparePatchEmissive(e,t){return M(e,t,e=>{this._resources?.stageResources.materials.forEach(t=>{if(!this._isPrimitive){t.setParameters({emissiveStrengthFromSymbol:e??1});return}let n=this.symbolLayer.material?.emissive?.source===`color`;t.setParameters({emissiveStrengthFromSymbol:n?e??0:0})})},this.view.stage.renderView.renderingContext.driverTest.floatBufferBlend.result)}_applyObjectRotationVisualVariables(e,t,n){this._fastUpdates?.requiresShaderTransformation&&t||I(e.heading?.output,e.tilt?.output,e.roll?.output,n)}_applyObjectRotation(e,t,n){this._fastUpdates?.requiresShaderTransformation&&t||I(e.heading,e.tilt,e.roll,n)}_applyAnchor(e,t,n){if(this._fastUpdates?.requiresShaderTransformation)return;let r=K(e.resourceBoundingBox,e.pivotOffset,t);r&&i(n,n,r)}_fastVisualVariableConvertOptions(e,t,n,r){let i=e==null?m:p(w(e)),a=e==null?h:K(e,r,this.symbolLayer),o=this._context.renderCoordsHelper.unitInMeters,s=F(t??void 0,t,n,o),c=g(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return new le({supports:{size:!0,color:!0,rotation:!0,opacity:!1},modelSize:i,symbolSize:t??m,unitInMeters:o,anchor:a,scale:s,rotation:c,fallbackColor:this._getFallbackOpacityAndColor(),fallbackSize:s})}get _primitive(){let{resource:e}=this.symbolLayer;return e?.href==null?e?.primitive??D:null}_getFallbackOpacityAndColor(){return this._materialColor?.toUnitRGBA()??(this._isPrimitive?v:N)}get _materialColor(){return this.symbolLayer.material?.color}}function K(e,t,n){let r=_();switch(n.anchor){case`center`:l(r,E(e)),c(r,r);break;case`top`:{let t=E(e);f(r,-t[0],-t[1],-e[5]);break}case`bottom`:{let t=E(e);f(r,-t[0],-t[1],-e[2]);break}case`relative`:{let t=E(e),i=w(e),a=n.anchorPosition,o=a?g(a.x,a.y,a.z):h;u(r,i,o),d(r,r,t),c(r,r);break}default:t==null?l(r,h):c(r,t)}return r}function q(e){return e.mode!==`absolute-height`}function _e(e){return(e.material?.color?.a??1)===1&&e.resource?.href==null}function J(e){return e?0:2}const Y=_(),X=o(),Z=o(),Q=b(),$=new A;export{ge as Graphics3DObjectSymbolLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{pt2px as e}from"../../../../core/screenUtils.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromBuffer as n,intersectsClippingArea as r,empty as i,expandWithAABB as a,create as o}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as s,doubleSubArray as c}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as l}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as u}from"../../../../geometry/support/Indices.js";import{isDrivenOpacityFallbackAlwaysOpaque as d}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{elevationModeChangeUpdateType as f,needsElevationUpdates2D as p}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as m}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as h}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as g}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as _}from"./graphicUtils.js";import{parseCapType as v,computeSymbolLayerIndex as y}from"./lineUtils.js";import{geometryAsPolygon as b,createColorGeometry as x,PolygonCreationDataBase as S}from"./polygonUtils.js";import{initFastSymbolUpdatesState as C,updateFastSymbolUpdatesState as w,getAttributeValue as T,ConvertOptions as E}from"../support/FastSymbolUpdates.js";import{createMaterial as D,uvElevationAligner as O}from"../support/patternUtils.js";import{writeMapSpaceUVCoordsPerConnectedPart as k,writeMapSpaceUVCoordsDraped as A}from"../support/uvUtils.js";import{createGeometry as j}from"../../support/engineContent/line.js";import{loadTessellationUtils as M,preloadedPolygonToRenderInfoElevationAligned as N,preloadedPolygonToRenderInfoDraped as P}from"../../support/renderInfoUtils/polygon.js";import{Object3D as F}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as I}from"../../webgl-engine/lib/RenderGeometry.js";import{isScreenSizePerspectiveEnabled as L}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{getStipplePatternForLinePattern as R}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as z}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as B}from"../../webgl-engine/materials/RibbonLineMaterial.js";const V=[`polyline`,`polygon`,`extent`];class H extends g{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,d(t)),this._needsUV=!1,this._materials=[]}async doLoad(){this._fastUpdates=C(this._context.renderer,this._vvConvertOptions),await M()}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}_createMaterials(){if(this._materials.length>0)return;let{_materialColor:t,draped:n}=this,r=this._getCombinedOpacityAndColor(t);this._materials[0]=D(this.symbolLayer,{color:r,forceTransparentMode:this.needsDrivenTransparentPass,hasVertexColors:this._drivenProperties.color||this._drivenProperties.opacity,draped:n,hasSlicePlane:this._context.slicePlaneEnabled,emissiveStrength:this._emissiveStrength,...this._fastUpdates?.materialParameters}),this._needsUV=this._materials[0]instanceof z;let i=this.symbolLayer.outline;if(K(i)){let t=R(i.pattern),n=v(i.pattern?i.patternCap||`butt`:`square`);this._materials[1]=new B({width:e(i.size),color:this._getOutlineColor(),polygonOffset:3,polygonOffsetIndex:y(this._renderPriority,this._renderPriorityStep),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:t,cap:n,screenSizePerspective:this._outlineScreenSizePerspective},this.view)}}get _outlineScreenSizePerspective(){return!this.draped&&L(this._context.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,V,this.symbolLayer.type))return null;let n=this._getDrivenUInt8Color(e.renderingInfo,this._materialColor,!1),r=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus(r.mode===`on-the-ground`),this._createMaterials(),this.draped?this._createAsOverlay(e.renderingInfo,t,n):this._createAs3DShape(e.renderingInfo,t,n,r)}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:if(w(this._fastUpdates,t,this._vvConvertOptions))this._materials[0]?.setParameters(this._fastUpdates.materialParameters);else return 0;break;default:return 0}return 2}layerOpacityChanged(){if(this._materials[0]!=null){let e=this._materials[0].parameters.color,t=this._materialColor,n=this._getCombinedOpacity(t);this._materials[0].setParameters({color:[e[0],e[1],e[2],n],forceTransparentMode:this.needsDrivenTransparentPass})}if(this._materials[1]!=null){let e=this._materials[1].parameters.color;this._materials[1].setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}}layerScreenSizePerspectiveChanged(){this._materials[1]?.setParameters({screenSizePerspective:this._outlineScreenSizePerspective})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=f(H.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=p(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){if(this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]){let e={hasSlicePlane:this._context.slicePlaneEnabled};this._materials[1].setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}_containsRenderableGeometry(e){return e.polygonIndexCount>0?!0:this._materials[1]==null?!1:e.outline.output===`vertex-data`?e.outline.outlines.length>0:e.outlineIndexCount>0}_createAs3DShape(e,t,n,r){let i=b(t.geometry);if(!i)return null;let a=N(i,this._context.elevationProvider,this._context.renderCoordsHelper,r,{projectIfNearlyVertical:!0,outlineOutput:`vertex-data`,owner:this._context.layer});if(a==null)return null;let o=new W(a,n,this._context.layerViewUid,t.uid),d=o.renderInfo.vertexCount;if(this._needsUV){o.uvMapSpace=l(d*4,!0),o.textureElementIndices=Array(d),o.boundingRect=s(9*(o.renderInfo.polygonIndices.length/3));let e=k(o.uvMapSpace,o.boundingRect,o.textureElementIndices,o.renderInfo.positions,o.renderInfo.polygonIndices,this._context.renderCoordsHelper);o.boundingRect=c(o.boundingRect,0,9*e),o.boundingRectIndices=u(e)}if(o.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAs3DShapeFill(e,o),this._materials[1]&&this._createAs3DShapeOutline(o),this._logGeometryCreationWarnings(o.renderInfo,i.rings,`rings`,`FillSymbol3DLayer`),o.outGeometries.length===0)return null;let f=new F({geometries:o.outGeometries,castShadow:!1,layerViewUid:this._context.layerViewUid,graphicUid:t.uid}),m=new h(this,f,null,O,r);return m.alignedSampledElevation=o.renderInfo.sampledElevation,m.needsElevationUpdates=p(r.mode),m}_createAs3DShapeFill(e,t){let{mapPositions:i,positions:a,polygonIndices:o,polygonIndexCount:s}=t.renderInfo;if(s===0||this._context.clippingExtent!=null&&(n(i,U),!r(U,this._context.clippingExtent)))return;let c=this._fastUpdates?.visualVariables.color,l=x({material:this._materials[0],indices:o,mapPositions:i,attributeData:{position:a,color:c?null:t.color,colorFeature:c?T(c,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,boundingRect:this._needsUV?t.boundingRect:null,textureElementIndices:this._needsUV?t.textureElementIndices:null,boundingRectIndices:this._needsUV?t.boundingRectIndices:null,olidColor:t.olidColor}});t.outGeometries.push(l)}_createAs3DShapeOutline(e){if(this._materials[1]==null)return;let{outline:t}=e.renderInfo;if(t.output!==`vertex-data`)return;let{outlines:i}=t;if(i!=null&&i.length!==0)for(let{mapPositions:t,position:a}of i){if(this._context.clippingExtent!=null&&(n(t,U),!r(U,this._context.clippingExtent)))continue;let i=j(this._materials[1],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:t,attributeData:{position:a}},e.olidColor);e.outGeometries.push(i)}}_createAsOverlay(e,t,n){let r=b(t.geometry);if(r==null)return null;this._materials[0].renderPriority=this._renderPriority+this._renderPriorityStep/2,this._materials[1]!=null&&(this._materials[1].renderPriority=this._renderPriority);let a=P(r,{drapedSpatialReference:this._context.overlaySR,outlineOutput:`vertex-data`,owner:this._context.layer});if(a==null)return null;let o=new G(a,n,this._context.layerViewUid,t.uid);return this._needsUV&&(o.uvMapSpace=l(o.renderInfo.vertexCount*4,!0),A(o.uvMapSpace,o.renderInfo.positions,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode)),o.outBoundingBox=i(),o.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAsOverlayFill(e,o),this._materials[1]&&this._createAsOverlayOutline(o),this._logGeometryCreationWarnings(o.renderInfo,r.rings,`rings`,`FillSymbol3DLayer`),new m(this,o.outGeometries,o.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(e,t){let{positions:i,polygonIndices:o,polygonIndexCount:s}=t.renderInfo;if(s===0)return;let c=n(i,U);if(!r(c,this._context.clippingExtent))return;a(t.outBoundingBox,c);let l=this._fastUpdates?.visualVariables.color,u=x({material:this._materials[0],indices:o,attributeData:{position:i,color:l?null:t.color,colorFeature:l?T(l,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,olidColor:t.olidColor}});t.outGeometries.push(new I(u,t))}_createAsOverlayOutline(e){if(this._materials[1]==null)return;let{outline:t}=e.renderInfo;if(t.output!==`vertex-data`)return;let{outlines:i}=t;for(let{position:t}of i){if(n(t,U),!r(U,this._context.clippingExtent))continue;a(e.outBoundingBox,U);let i=j(this._materials[1],{overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:!0,attributeData:{position:t}},e.olidColor);e.outGeometries.push(new I(i,e))}}_getOutlineOpacity(){let e=this.symbolLayer?.outline?.color;return(this.draped?1:this._getLayerOpacity())*(e==null?0:e.a)}_getOutlineColor(){let e=this.symbolLayer?.outline?.color,t=this._getOutlineOpacity();return _(e?.toUnitRGB(),t)}test(){return{...super.test(),createAsOverlay:(e,t,n)=>this._createAsOverlay(e,t,n),createAs3DShape:(e,t,n,r)=>this._createAs3DShape(e,t,n,r)}}get _vvConvertOptions(){return new E({supports:{size:!1,color:!0,rotation:!1,opacity:!1},fallbackColor:this._materialColor?.toUnitRGBA()??t})}}const U=o();class W extends S{constructor(e,t,n,r){super(e,n,r),this.color=t}}class G extends S{constructor(e,t,n,r){super(e,n,r),this.color=t}}function K(e){return e?.size!=null&&e.size>0&&e.color!=null&&(e.pattern==null||e.pattern.type!==`style`||e.pattern.style!==`none`)}export{H as Graphics3DPolygonFillSymbolLayer};
|
|
2
|
+
import{has}from"../../../../applications/Components/baUtils.js";import{pt2px as e}from"../../../../core/screenUtils.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromBuffer as n,intersectsClippingArea as r,empty as i,expandWithAABB as a,create as o}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as s,doubleSubArray as c}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as l}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as u}from"../../../../geometry/support/Indices.js";import{isDrivenOpacityFallbackAlwaysOpaque as d}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{elevationModeChangeUpdateType as f,needsElevationUpdates2D as p}from"./elevationAlignmentUtils.js";import{PlateLayoutInformation as m,updatePlateNormals as h}from"./extrudePolygon.js";import{Graphics3DDrapedGraphicLayer as g}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as _}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as v}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as y}from"./graphicUtils.js";import{parseCapType as b,computeSymbolLayerIndex as x}from"./lineUtils.js";import{geometryAsPolygon as S,createColorGeometry as C,PolygonCreationDataBase as w}from"./polygonUtils.js";import{initFastSymbolUpdatesState as T,updateFastSymbolUpdatesState as E,getAttributeValue as D,ConvertOptions as O}from"../support/FastSymbolUpdates.js";import{createMaterial as k,uvElevationAligner as A}from"../support/patternUtils.js";import{writeMapSpaceUVCoordsPerConnectedPart as j,writeMapSpaceUVCoordsDraped as M}from"../support/uvUtils.js";import{createGeometry as N}from"../../support/engineContent/line.js";import{loadTessellationUtils as P,preloadedPolygonToRenderInfoElevationAligned as F,preloadedPolygonToRenderInfoDraped as I}from"../../support/renderInfoUtils/polygon.js";import{Object3D as L}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as R}from"../../webgl-engine/lib/RenderGeometry.js";import{isScreenSizePerspectiveEnabled as z}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{getStipplePatternForLinePattern as B}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as V}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as H}from"../../webgl-engine/materials/RibbonLineMaterial.js";const U=[`polyline`,`polygon`,`extent`];class W extends v{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,d(t)),this._needsUV=!1,this._materials=[]}async doLoad(){this._fastUpdates=T(this._context.renderer,this._vvConvertOptions),await P()}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}get _shadingEnabled(){return!this.draped&&!!has(`enable-feature:emissive-on-non-volumetric`)}_createMaterials(){if(this._materials.length>0)return;let{_materialColor:t,draped:n,_shadingEnabled:r}=this,i=this._getCombinedOpacityAndColor(t);this._materials[0]=k(this.symbolLayer,{color:i,forceTransparentMode:this.needsDrivenTransparentPass,hasVertexColors:this._drivenProperties.color||this._drivenProperties.opacity,draped:n,shading:+!!r,castShadows:r,hasSlicePlane:this._context.slicePlaneEnabled,emissiveStrength:this._emissiveStrength,...this._fastUpdates?.materialParameters},this._context),this._needsUV=this._materials[0]instanceof V;let a=this.symbolLayer.outline;if(J(a)){let t=B(a.pattern),n=b(a.pattern?a.patternCap||`butt`:`square`);this._materials[1]=new H({color:this._getOutlineColor(),width:e(a.size),polygonOffset:3,polygonOffsetIndex:x(this._renderPriority,this._renderPriorityStep),shadingEnabled:r,hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:t,cap:n,screenSizePerspective:this._outlineScreenSizePerspective},this.view)}}get _outlineScreenSizePerspective(){return!this.draped&&z(this._context.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,U,this.symbolLayer.type))return null;let n=this._getDrivenUInt8Color(e.renderingInfo,this._materialColor,!1),r=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus(r.mode===`on-the-ground`),this._createMaterials(),this.draped?this._createAsOverlay(e.renderingInfo,t,n):this._createAs3DShape(e.renderingInfo,t,n,r)}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:if(E(this._fastUpdates,t,this._vvConvertOptions))this._materials[0]?.setParameters(this._fastUpdates.materialParameters);else return 0;break;default:return 0}return 2}layerOpacityChanged(){if(this._materials[0]!=null){let e=this._materials[0].parameters.color,t=this._materialColor,n=this._getCombinedOpacity(t);this._materials[0].setParameters({color:[e[0],e[1],e[2],n],forceTransparentMode:this.needsDrivenTransparentPass})}if(this._materials[1]!=null){let e=this._materials[1].parameters.color;this._materials[1].setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}}layerScreenSizePerspectiveChanged(){this._materials[1]?.setParameters({screenSizePerspective:this._outlineScreenSizePerspective})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=f(W.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=p(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){if(this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]){let e={hasSlicePlane:this._context.slicePlaneEnabled};this._materials[1].setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}_containsRenderableGeometry(e){return e.polygonIndexCount>0?!0:this._materials[1]==null?!1:e.outline.output===`vertex-data`?e.outline.outlines.length>0:e.outlineIndexCount>0}_createAs3DShape(e,t,n,r){let i=S(t.geometry);if(!i)return null;let a=this._shadingEnabled,o=F(i,this._context.elevationProvider,this._context.renderCoordsHelper,r,{projectIfNearlyVertical:!0,requireNormals:a,outlineOutput:`vertex-data`,owner:this._context.layer});if(o==null)return null;let d=new K(o,n,this._context.layerViewUid,t.uid),f=d.renderInfo.vertexCount;if(this._needsUV){d.uvMapSpace=l(f*4,!0),d.textureElementIndices=Array(f),d.boundingRect=s(9*(d.renderInfo.polygonIndices.length/3));let e=j(d.uvMapSpace,d.boundingRect,d.textureElementIndices,d.renderInfo.positions,d.renderInfo.polygonIndices,this._context.renderCoordsHelper);d.boundingRect=c(d.boundingRect,0,9*e),d.boundingRectIndices=u(e)}if(d.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(d),this._createAs3DShapeFill(e,d),this._materials[1]&&this._createAs3DShapeOutline(d),this._logGeometryCreationWarnings(d.renderInfo,i.rings,`rings`,`FillSymbol3DLayer`),d.outGeometries.length===0)return null;let m=new L({geometries:d.outGeometries,castShadow:this._shadingEnabled,layerViewUid:this._context.layerViewUid,graphicUid:t.uid}),h=new _(this,m,null,(e,t,n,r,i)=>A(e,t,n,r,i,d.plateLayout),r);return h.alignedSampledElevation=d.renderInfo.sampledElevation,h.needsElevationUpdates=p(r.mode),h}_createAs3DShapeFill(e,t){let{mapPositions:i,positions:a,polygonIndices:o,polygonIndexCount:s,vertexCount:c,compressedNormals:l}=t.renderInfo;if(s===0||this._context.clippingExtent!=null&&(n(i,G),!r(G,this._context.clippingExtent)))return;let u=this._fastUpdates?.visualVariables.color,d=C({material:this._materials[0],indices:o,mapPositions:i,attributeData:{position:a,color:u?null:t.color,compressedNormals:l,colorFeature:u?D(u,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,boundingRect:this._needsUV?t.boundingRect:null,textureElementIndices:this._needsUV?t.textureElementIndices:null,boundingRectIndices:this._needsUV?t.boundingRectIndices:null,olidColor:t.olidColor}});t.plateLayout=new m(c,0,null,0,s/3),h(d,t.plateLayout),t.outGeometries.push(d)}_createAs3DShapeOutline(e){if(this._materials[1]==null)return;let{outline:t}=e.renderInfo;if(t.output!==`vertex-data`)return;let{outlines:i}=t;if(i!=null&&i.length!==0)for(let{mapPositions:t,position:a}of i){if(this._context.clippingExtent!=null&&(n(t,G),!r(G,this._context.clippingExtent)))continue;let i=N(this._materials[1],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:t,attributeData:{position:a}},e.olidColor);e.outGeometries.push(i)}}_createAsOverlay(e,t,n){let r=S(t.geometry);if(r==null)return null;this._materials[0].renderPriority=this._renderPriority+this._renderPriorityStep/2,this._materials[1]!=null&&(this._materials[1].renderPriority=this._renderPriority);let a=I(r,{drapedSpatialReference:this._context.overlaySR,outlineOutput:`vertex-data`,owner:this._context.layer});if(a==null)return null;let o=new q(a,n,this._context.layerViewUid,t.uid);return this._needsUV&&(o.uvMapSpace=l(o.renderInfo.vertexCount*4,!0),M(o.uvMapSpace,o.renderInfo.positions,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode)),o.outBoundingBox=i(),o.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAsOverlayFill(e,o),this._materials[1]&&this._createAsOverlayOutline(o),this._logGeometryCreationWarnings(o.renderInfo,r.rings,`rings`,`FillSymbol3DLayer`),new g(this,o.outGeometries,o.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(e,t){let{positions:i,polygonIndices:o,polygonIndexCount:s}=t.renderInfo;if(s===0)return;let c=n(i,G);if(!r(c,this._context.clippingExtent))return;a(t.outBoundingBox,c);let l=this._fastUpdates?.visualVariables.color,u=C({material:this._materials[0],indices:o,attributeData:{position:i,color:l?null:t.color,colorFeature:l?D(l,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,olidColor:t.olidColor}});t.outGeometries.push(new R(u,t))}_createAsOverlayOutline(e){if(this._materials[1]==null)return;let{outline:t}=e.renderInfo;if(t.output!==`vertex-data`)return;let{outlines:i}=t;for(let{position:t}of i){if(n(t,G),!r(G,this._context.clippingExtent))continue;a(e.outBoundingBox,G);let i=N(this._materials[1],{overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:!0,attributeData:{position:t}},e.olidColor);e.outGeometries.push(new R(i,e))}}_getOutlineOpacity(){let e=this.symbolLayer?.outline?.color;return(this.draped?1:this._getLayerOpacity())*(e==null?0:e.a)}_getOutlineColor(){let e=this.symbolLayer?.outline?.color,t=this._getOutlineOpacity();return y(e?.toUnitRGB(),t)}test(){return{...super.test(),createAsOverlay:(e,t,n)=>this._createAsOverlay(e,t,n),createAs3DShape:(e,t,n,r)=>this._createAs3DShape(e,t,n,r)}}get _vvConvertOptions(){return new O({supports:{size:!1,color:!0,rotation:!1,opacity:!1},fallbackColor:this._materialColor?.toUnitRGBA()??t})}}const G=o();class K extends w{constructor(e,t,n,r){super(e,n,r),this.color=t}}class q extends w{constructor(e,t,n,r){super(e,n,r),this.color=t}}function J(e){return e?.size!=null&&e.size>0&&e.color!=null&&(e.pattern==null||e.pattern.type!==`style`||e.pattern.style!==`none`)}export{W as Graphics3DPolygonFillSymbolLayer};
|