@arcgis/core 5.0.0-next.66 → 5.0.0-next.68
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/Ground.d.ts +4 -4
- package/Map.d.ts +1 -1
- package/WebDocument2D.d.ts +2 -3
- package/WebScene.d.ts +2 -3
- package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +9 -6
- package/analysis/ElevationProfile/ElevationProfileLineViewOptions.js +1 -1
- package/applications/Components/QuantityFormatter.d.ts +14 -1
- package/applications/Components/SelectionOperation.d.ts +45 -9
- package/applications/Components/SketchTooltipControls.d.ts +31 -6
- package/applications/Components/actionUtils.d.ts +1 -0
- package/applications/Components/analysisUtils.d.ts +98 -26
- package/applications/Components/arcadeEditorUtils.d.ts +3 -0
- package/applications/Components/arcadeFeatureUtils.d.ts +34 -6
- package/applications/Components/baUtils.d.ts +8 -8
- package/applications/Components/basemapUtils.d.ts +2 -0
- package/applications/Components/drawUtils.d.ts +6 -1
- package/applications/Components/featureUtils.d.ts +9 -0
- package/applications/Components/fontUtils.d.ts +2 -0
- package/applications/Components/formatUtils.d.ts +2 -0
- package/applications/Components/getDefaultUnits.d.ts +2 -0
- package/applications/Components/imageryUtils.d.ts +135 -27
- package/applications/Components/layerOriginUtils.d.ts +5 -0
- package/applications/Components/layersEffectsJsonUtils.d.ts +2 -0
- package/applications/Components/previewSymbol2D.d.ts +2 -0
- package/applications/Components/reactiveUtils.d.ts +13 -9
- package/applications/Components/sanitizerUtils.d.ts +2 -0
- package/applications/Components/stringUtils.d.ts +5 -0
- package/applications/Components/styleUtils.d.ts +2 -0
- package/applications/Components/svgUtils.d.ts +4 -0
- package/applications/Components/testUtils.d.ts +3 -0
- package/applications/Components/viewUtils.d.ts +2 -0
- package/applications/Components/webStyleSymbolUtils.d.ts +2 -0
- package/applications/Excalibur/videoViewUtils.d.ts +19 -3
- package/applications/ExperienceBuilder/sketchUtils.d.ts +10 -1
- package/applications/KnowledgeStudio/dataModelVisualization.d.ts +2 -0
- package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +33 -4
- package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +73 -10
- package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +12 -1
- package/applications/KnowledgeStudio/reshape.d.ts +144 -28
- package/applications/KnowledgeStudio/resourceSerializationUtils.d.ts +17 -3
- package/applications/MapViewer/layerUtils.d.ts +2 -0
- package/applications/MapViewer/mediaUtils.d.ts +42 -8
- package/applications/MapViewer/templateUtils.d.ts +78 -16
- package/applications/PortalApp/layerUtils.d.ts +2 -0
- package/applications/SceneViewer/colorUtils.d.ts +2 -0
- package/applications/SceneViewer/devEnvironmentUtils.d.ts +3 -0
- package/applications/SceneViewer/layerUtils.d.ts +5 -3
- package/applications/SceneViewer/sceneViewerUtils.d.ts +52 -5
- package/applications/SceneViewer/symbolUtils.d.ts +2 -0
- package/applications/Urban/LineImagePattern3D.d.ts +8 -2
- package/applications/Urban/imagePatternUtils.d.ts +10 -2
- package/applications/Urban/meshUtils.d.ts +2 -0
- package/applications/WebEditor/sketchUtils.d.ts +24 -4
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/batchExec.js +1 -1
- package/arcade/compilerUtils.js +1 -1
- package/arcade/featureset/actions/SpatialFilter.js +1 -1
- package/arcade/geometry/unitConversion.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/arcade.js +1 -1
- package/assets/components/assets/icon/fileEsl16.json +1 -0
- package/assets/components/assets/icon/fileEsl24.json +1 -0
- package/assets/components/assets/icon/fileEsl32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{251eb6e00f99a816d55c.js → 0326314947734b8e640a.js} +1 -1
- package/assets/esri/core/workers/chunks/04176244b0a3539c9681.js +1 -0
- package/assets/esri/core/workers/chunks/04958494022f82dca473.js +1 -0
- package/assets/esri/core/workers/chunks/0b7bbdc0d71ee6721751.js +2 -0
- package/assets/esri/core/workers/chunks/{5909a0e763fddc3542e7.js.LICENSE.txt → 0b7bbdc0d71ee6721751.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/0f8149fdcf0adeca268e.js +1 -0
- package/assets/esri/core/workers/chunks/{aa7a1705266eec353cb6.js → 0fc22ad791d3ec0a9c5e.js} +1 -1
- package/assets/esri/core/workers/chunks/10e474d664b20adcd917.js +1 -0
- package/assets/esri/core/workers/chunks/12f9a55253084a910b2e.js +1 -0
- package/assets/esri/core/workers/chunks/14dedd80fb797303f91f.js +1 -0
- package/assets/esri/core/workers/chunks/1a6d2f525dd30d08cf9b.js +1 -0
- package/assets/esri/core/workers/chunks/{81d89107ff82604a3ea0.js → 1b445981fbc8373f4dd8.js} +1 -1
- package/assets/esri/core/workers/chunks/{6ba3c2b9f699d94d62b8.js → 1ec1a1997b5577619040.js} +1 -1
- package/assets/esri/core/workers/chunks/204d738c8b651314ae64.js +1 -0
- package/assets/esri/core/workers/chunks/2085084324cd5a81783f.js +1 -0
- package/assets/esri/core/workers/chunks/{e95821a199e10b389e29.js → 25f3ee666f545a7a7993.js} +2 -2
- package/assets/esri/core/workers/chunks/{e95821a199e10b389e29.js.LICENSE.txt → 25f3ee666f545a7a7993.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/2c2c0f66cffc521df736.js +1 -0
- package/assets/esri/core/workers/chunks/2dd347aa2a061d536e69.js +1 -0
- package/assets/esri/core/workers/chunks/2dfa7abf2d39fa5a3874.js +1 -0
- package/assets/esri/core/workers/chunks/322085d63719da6e443c.js +1 -0
- package/assets/esri/core/workers/chunks/{76086517591d0eb35156.js → 34a2e0462eb05986cdd1.js} +1 -1
- package/assets/esri/core/workers/chunks/{a6dcd13c792b6538ac50.js → 35593a9790818b689455.js} +1 -1
- package/assets/esri/core/workers/chunks/36ecf951c0c7dad84b69.js +1 -0
- package/assets/esri/core/workers/chunks/37002a46f03a9fc5f644.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/3a04153ca9d8e4f01185.js +1 -0
- package/assets/esri/core/workers/chunks/{4e9a8fce55cad841c731.js → 3b25f5d9c8f78bb6e011.js} +1 -1
- package/assets/esri/core/workers/chunks/3e7ea06b342e33bc48a5.js +1 -0
- package/assets/esri/core/workers/chunks/3ed317900f0edf635508.js +1 -0
- package/assets/esri/core/workers/chunks/401ce5cb98fa14c1a725.js +1 -0
- package/assets/esri/core/workers/chunks/4319b89cfa02894a8cae.js +1 -0
- package/assets/esri/core/workers/chunks/43e2c1d72cd9c8beed2f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/45a9cd722e98dd1548ae.js +1 -0
- package/assets/esri/core/workers/chunks/4a060147d25929680ec8.js +1 -0
- package/assets/esri/core/workers/chunks/4bcd74951477e8977ba1.js +1 -0
- package/assets/esri/core/workers/chunks/4d0eaeb4cd6cd55e25fd.js +1 -0
- package/assets/esri/core/workers/chunks/{687d2b761dc5b5cf0c31.js → 4d4d71d24c1a9cb342b8.js} +1 -1
- package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +1 -0
- package/assets/esri/core/workers/chunks/50f03813fba4b752ca9f.js +1 -0
- package/assets/esri/core/workers/chunks/{abc236e99b52be1c83b9.js → 52a14266fe239b95c5ce.js} +1 -1
- package/assets/esri/core/workers/chunks/53b5c77832df7df4d4e3.js +1 -0
- package/assets/esri/core/workers/chunks/{34178ace79e8dea3567d.js → 562cddaf63985e53ee6e.js} +1 -1
- package/assets/esri/core/workers/chunks/59a45533e96cedf1c480.js +1 -0
- package/assets/esri/core/workers/chunks/{c2aeecd27e004c6cd7e1.js → 5b9f2aa3ba1bf12c3240.js} +2 -2
- package/assets/esri/core/workers/chunks/{c2aeecd27e004c6cd7e1.js.LICENSE.txt → 5b9f2aa3ba1bf12c3240.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{6599cc702a46f81a5634.js → 5dd5be91038df8902dc4.js} +1 -1
- package/assets/esri/core/workers/chunks/{49a1b7f700b8a42de817.js → 60c7f896f2246a8aa6d7.js} +19 -19
- package/assets/esri/core/workers/chunks/60f363ee2add089e8f0b.js +1 -0
- package/assets/esri/core/workers/chunks/61801bb8c7be8fe77086.js +1 -0
- package/assets/esri/core/workers/chunks/679cd6424e0e2d7f372b.js +1 -0
- package/assets/esri/core/workers/chunks/68074a484d7f9bc713c0.js +1 -0
- package/assets/esri/core/workers/chunks/6acfa51b81e6f4255118.js +1 -0
- package/assets/esri/core/workers/chunks/{3fe7be535affae31de7e.js → 6b85a8776ec2beff63cb.js} +1 -1
- package/assets/esri/core/workers/chunks/6be530ab81291745485b.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/6df484faf54e90a6cc77.js +1 -0
- package/assets/esri/core/workers/chunks/6ea6ad894ac634aa4391.js +1 -0
- package/assets/esri/core/workers/chunks/6f8098f9fe233833245a.js +1 -0
- package/assets/esri/core/workers/chunks/73c416ae0ec5a1815591.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/75fd2ef1236a9364ca7f.js +1 -0
- package/assets/esri/core/workers/chunks/{23b623637126f8411a30.js → 7aec07f2482934259d12.js} +1 -1
- package/assets/esri/core/workers/chunks/7be9bbae23895d1cfa92.js +1 -0
- package/assets/esri/core/workers/chunks/{741d170187e58e81584d.js → 7d744554d14057d9b2b1.js} +1 -1
- package/assets/esri/core/workers/chunks/7ea48661f1087d06aa41.js +1 -0
- package/assets/esri/core/workers/chunks/{47e5149765beee46f208.js → 7ee68f67f9cc48a328f0.js} +1 -1
- package/assets/esri/core/workers/chunks/866477acdf03b8a40bc9.js +1 -0
- package/assets/esri/core/workers/chunks/8e83c133b201b9b61e70.js +1 -0
- package/assets/esri/core/workers/chunks/9086a4933d3d3d9ffa72.js +1 -0
- package/assets/esri/core/workers/chunks/94174d40de39dbe7d0bf.js +1 -0
- package/assets/esri/core/workers/chunks/98f4b44eca91c42ca08e.js +1 -0
- package/assets/esri/core/workers/chunks/9ccabf8142fb5de4d3e2.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{dd99b77a7c0a052507bb.js → 9d88b4ba8e511da64583.js} +3 -3
- package/assets/esri/core/workers/chunks/a808be466812db51813d.js +1 -0
- package/assets/esri/core/workers/chunks/{6b4a24248182245167ca.js → a931515a2569713e743b.js} +1 -1
- package/assets/esri/core/workers/chunks/a95e28ade258b144cbb5.js +1 -0
- package/assets/esri/core/workers/chunks/adc68e2c6d2698a52bfe.js +1 -0
- package/assets/esri/core/workers/chunks/aeb524eded012217a865.js +1 -0
- package/assets/esri/core/workers/chunks/b2a1e5e9182b643909eb.js +316 -0
- package/assets/esri/core/workers/chunks/{ac6f002cfad42e60de8f.js → b48033645091c91e0d88.js} +1 -1
- package/assets/esri/core/workers/chunks/b8988771bfa4e785ebd6.js +1 -0
- package/assets/esri/core/workers/chunks/bb4574a87ca21e719f0d.js +1 -0
- package/assets/esri/core/workers/chunks/{07639f406b71bb49ffd6.js → bdbb5b33f0f49661bf6d.js} +1 -1
- package/assets/esri/core/workers/chunks/c042269586921e337be9.js +1 -0
- package/assets/esri/core/workers/chunks/c623918e289a09905cd1.js +1 -0
- package/assets/esri/core/workers/chunks/c7391b0b5a9c916a53f7.js +1 -0
- package/assets/esri/core/workers/chunks/{ac83c2999a3d2ffb4356.js → c7838ac0db8570a2d2c1.js} +1 -1
- package/assets/esri/core/workers/chunks/c91ef3814e7f024043cf.js +1 -0
- package/assets/esri/core/workers/chunks/{43d28c6509c21b8917a8.js → ca7523c14d81c470e92e.js} +1 -1
- package/assets/esri/core/workers/chunks/cd2708fb7636b3ace229.js +1 -0
- package/assets/esri/core/workers/chunks/{310f3268582e61cd86da.js → d21480925a8bc9c7de96.js} +1 -1
- package/assets/esri/core/workers/chunks/d445e9399fe4ca3d2a50.js +1 -0
- package/assets/esri/core/workers/chunks/d7683a95775c9f401a7e.js +1 -0
- package/assets/esri/core/workers/chunks/{9d6945cda99d14af83ac.js → d7d9656b990ce8be2152.js} +1 -1
- package/assets/esri/core/workers/chunks/d9ca754f51b9812bb179.js +1 -0
- package/assets/esri/core/workers/chunks/d9ef0b3341e2744d8f2f.js +1 -0
- package/assets/esri/core/workers/chunks/df4a0af329ce94a47a7b.js +1 -0
- package/assets/esri/core/workers/chunks/e10d6e511921394474ca.js +1 -0
- package/assets/esri/core/workers/chunks/e4b6aa8f67c2bd285020.js +1 -0
- package/assets/esri/core/workers/chunks/e5aac523c37d906eece6.js +1 -0
- package/assets/esri/core/workers/chunks/e6ca02f98f855024f74b.js +1 -0
- package/assets/esri/core/workers/chunks/{892157696e8f9e38c472.js → e6e837e43b9348050832.js} +1 -1
- package/assets/esri/core/workers/chunks/{d3325ed8d224e2350db7.js → e8a3ad00936f2ccaf362.js} +1 -1
- package/assets/esri/core/workers/chunks/{f351007cdcd0938d3b6c.js → eeb24a4ab4993f1f4e8e.js} +1 -1
- package/assets/esri/core/workers/chunks/ef7063ee790d2d64d4b2.js +1 -0
- package/assets/esri/core/workers/chunks/{b65fcfde62d49de1fa54.js → ef977be20a647aeded0a.js} +1 -1
- package/assets/esri/core/workers/chunks/efb631371b6bb3f043bb.js +1 -0
- package/assets/esri/core/workers/chunks/{0f5693541111fcae0c2f.js → f0914715e90e43466f8c.js} +1 -1
- package/assets/esri/core/workers/chunks/f25bebd2b6eb0d0f6626.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/f95e488d2b86e320624f.js +1 -0
- package/assets/esri/core/workers/chunks/{bfc063d4431bfa162160.js → fd09f38fb4d99bf34988.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/libs/text/pkg/bundle_bg.wasm +0 -0
- package/chunks/boundedPlane.js +1 -1
- package/chunks/bundle2.js +5 -0
- package/config.js +1 -1
- package/copyright.txt +70 -1
- package/core/BidiText.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/compilerUtils.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/core/units.js +1 -1
- package/core/workers/loaderConfig.js +1 -1
- package/editing/sharedTemplates/SharedTemplate.js +1 -1
- package/geometry/support/FloatArray.js +1 -1
- package/geometry/support/Indices.js +1 -1
- package/geometry/support/MeshTexture.js +1 -1
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/boundedPlane.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/meshUtils/External.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/imageutils.js +1 -1
- package/geometry/support/meshUtils/loadExternal.js +1 -1
- package/geometry/support/rotate.js +1 -1
- package/interfaces.d.ts +23 -24
- package/kernel.js +1 -1
- package/layers/BingMapsLayer.d.ts +2 -3
- package/layers/BuildingSceneLayer.d.ts +3 -5
- package/layers/CatalogLayer.d.ts +2 -4
- package/layers/DimensionLayer.d.ts +2 -3
- package/layers/ElevationLayer.d.ts +2 -4
- package/layers/FeatureLayer.d.ts +2 -4
- package/layers/GaussianSplatLayer.d.ts +1 -3
- package/layers/GeoJSONLayer.d.ts +2 -3
- package/layers/GeoRSSLayer.d.ts +2 -3
- package/layers/GroupLayer.d.ts +2 -3
- package/layers/ImageryLayer.d.ts +2 -5
- package/layers/ImageryTileLayer.d.ts +3 -7
- package/layers/IntegratedMesh3DTilesLayer.d.ts +2 -4
- package/layers/IntegratedMeshLayer.d.ts +2 -4
- package/layers/KMLLayer.d.ts +2 -3
- package/layers/KnowledgeGraphLayer.d.ts +2 -4
- package/layers/LineOfSightLayer.d.ts +2 -3
- package/layers/LinkChartLayer.d.ts +2 -3
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/MapImageLayer.d.ts +2 -4
- package/layers/MapNotesLayer.d.ts +2 -3
- package/layers/MediaLayer.d.ts +3 -4
- package/layers/OGCFeatureLayer.d.ts +2 -3
- package/layers/ParquetLayer.d.ts +2 -3
- package/layers/PointCloudLayer.d.ts +2 -4
- package/layers/RouteLayer.d.ts +2 -3
- package/layers/SceneLayer.d.ts +2 -4
- package/layers/StreamLayer.d.ts +2 -4
- package/layers/SubtypeGroupLayer.d.ts +2 -4
- package/layers/TileLayer.d.ts +2 -4
- package/layers/UnknownLayer.d.ts +2 -3
- package/layers/UnsupportedLayer.d.ts +2 -3
- package/layers/VectorTileLayer.d.ts +2 -4
- package/layers/VideoLayer.d.ts +8 -9
- package/layers/ViewshedLayer.d.ts +2 -3
- package/layers/VoxelLayer.d.ts +2 -4
- package/layers/WCSLayer.d.ts +2 -4
- package/layers/WFSLayer.d.ts +2 -3
- package/layers/WMSLayer.d.ts +5 -6
- package/layers/WMTSLayer.d.ts +4 -5
- package/layers/WebTileLayer.d.ts +2 -3
- package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +1 -1
- package/layers/buildingSublayers/BuildingSublayer.d.ts +3 -3
- package/layers/buildingSublayers/BuildingSublayer.js +1 -1
- package/layers/catalog/CatalogDynamicGroupLayer.d.ts +2 -3
- package/layers/catalog/CatalogFootprintLayer.d.ts +2 -3
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/dehydratedFeatureComparison.js +1 -1
- package/layers/graphics/dehydratedFeatures.js +1 -1
- package/layers/graphics/hydratedFeatures.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +4 -6
- package/layers/{support/media.d.ts → media/types.d.ts} +9 -9
- package/layers/mixins/ArcGISImageService.d.ts +1 -1
- package/layers/mixins/ImageryTileMixin.d.ts +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/raster/datasets/wcsCoverageParser.d.ts +1 -1
- package/layers/raster/functions/changeDetectionUtils.js +1 -1
- package/layers/raster/functions/creators/createLocalFunctions.d.ts +1 -1
- package/layers/raster/functions/customBandIndexUtils.js +1 -1
- package/layers/raster/functions/focalStatUtils.js +1 -1
- package/layers/raster/functions/pixelTransformUtils.js +1 -1
- package/layers/raster/functions/types.d.ts +1 -1
- package/layers/{support/RasterTypes.d.ts → raster/types.d.ts} +2 -2
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/ElevationQuery.d.ts +2 -2
- package/layers/support/ElevationSampler.js +1 -1
- package/layers/support/FeatureType.d.ts +2 -2
- package/layers/support/Field.d.ts +2 -3
- package/layers/support/FieldConfiguration.d.ts +1 -1
- package/layers/support/ImageElement.d.ts +3 -3
- package/layers/support/LocalMediaElementSource.d.ts +1 -1
- package/layers/support/MediaElementBase.d.ts +4 -7
- package/layers/support/PixelBlock.d.ts +1 -1
- package/layers/support/RasterFunction.d.ts +1 -1
- package/layers/support/RasterInfo.d.ts +1 -1
- package/layers/support/Sublayer.d.ts +2 -3
- package/layers/support/Subtype.d.ts +2 -2
- package/layers/support/SubtypeSublayer.d.ts +2 -3
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/VideoElement.d.ts +2 -2
- package/layers/support/WMSSublayer.d.ts +6 -6
- package/layers/support/WMSSublayer.js +1 -1
- package/layers/support/domains.js +1 -1
- package/layers/support/rasterFunctionUtils.d.ts +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/types.d.ts +33 -1
- package/layers/types.d.ts +17 -2
- package/layers/wmts/types.d.ts +2 -0
- package/libs/text/loadTextModule.js +5 -0
- package/linkChart/LinkChartProperties.d.ts +4 -6
- package/linkChart/LinkChartProperties.js +1 -1
- package/networks/Network.d.ts +2 -4
- package/networks/support/NamedTraceConfiguration.d.ts +3 -3
- package/networks/support/NamedTraceConfiguration.js +1 -1
- package/networks/support/TopologyValidationJobInfo.js +1 -1
- package/networks/support/TraceJobInfo.js +1 -1
- package/package.json +3 -3
- package/popup/FieldInfo.d.ts +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/rendererConversion.js +1 -1
- package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
- package/request/process.js +1 -1
- package/rest/geometryService/types.d.ts +59 -0
- package/rest/geometryService.d.ts +3 -5
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/query/support/AttachmentInfo.d.ts +2 -2
- package/rest/support/AlgorithmicColorRamp.d.ts +2 -2
- package/rest/support/BinParametersBase.d.ts +2 -2
- package/rest/support/BinParametersBase.js +1 -1
- package/rest/support/DateBinTimeInterval.d.ts +1 -1
- package/rest/support/GeneralizeParameters.d.ts +1 -1
- package/rest/support/ImageSampleParameters.d.ts +1 -1
- package/rest/support/JobInfo.js +1 -1
- package/rest/support/PrintTemplate.d.ts +4 -6
- package/rest/support/ServiceAreaParameters.js +1 -1
- package/rest/support/types.d.ts +17 -1
- package/smartMapping/heuristics/sizeRange.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/smartMapping/support/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/WebStyleSymbol.d.ts +0 -24
- package/symbols/WebStyleSymbol.js +1 -1
- package/symbols/support/ElevationInfo.d.ts +2 -2
- package/symbols/support/IconSymbol3DLayerResource.d.ts +1 -1
- package/symbols/support/defaults.js +1 -1
- package/symbols/support/defaults3D.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/symbolLayerUtils3D.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +16 -11
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/GlyphSDFCreator.js +5 -0
- package/views/2d/engine/webgl/GlyphSource.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/TextureUploadManager.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/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/input/handlers/DoubleTapDragZoom.js +1 -1
- package/views/2d/input/handlers/KeyZoom.js +1 -1
- package/views/2d/layers/BaseLayerView2D.d.ts +3 -6
- package/views/2d/layers/BaseLayerViewGL2D.d.ts +3 -6
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/utils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +16 -11
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/CloudsRenderer.js +1 -1
- package/views/3d/environment/SceneViewEnvironment.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/internal/fillDefaults.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/isSupportedObjectUtils.js +1 -1
- package/views/3d/interactive/editingTools/move/isSupportedObject.js +1 -1
- package/views/3d/interactive/editingTools/transform/isSupportedGraphic.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/LabelInfo.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/graphics/lineUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/primitiveObjectUtils.js +1 -1
- package/views/3d/layers/graphics/primitiveObjectSymbolUtils.js +1 -1
- package/views/3d/layers/i3s/BuildingFilterUtil.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
- package/views/3d/layers/i3s/SphereCone.js +5 -0
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/edgeUtils.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/buffer/glUtil.js +1 -1
- package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +8 -8
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeWorkerHandle.js +1 -1
- package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +4 -4
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +8 -8
- package/views/VideoView.d.ts +2 -3
- package/views/VideoView.js +1 -1
- package/views/View2D.d.ts +2 -3
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/draw/Draw.js +1 -1
- package/views/input/ViewEvents.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
- package/views/interactive/snapping/featureSources/snappingCandidateElevationFilter.js +1 -1
- package/views/interactive/snapping/featureSources/symbologySnappingCandidates.js +1 -1
- package/views/layers/MediaLayerViewMixin.d.ts +1 -1
- package/views/support/PromiseQueue.js +1 -1
- package/views/support/screenUtils.js +1 -1
- package/views/support/screenshotUtils.js +1 -1
- package/views/types.d.ts +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Uniform.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/webdoc/applicationProperties/SearchLayerField.d.ts +1 -1
- package/webdoc/applicationProperties/SearchTableField.d.ts +1 -1
- package/webscene/Slide.d.ts +2 -2
- package/webscene/spec-certification/api.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/workflowAdapters/pendingFeatureList/{CreateFeaturesWorkflowPendingFeatureListAdapter.ts.js → CreateFeaturesWorkflowPendingFeatureListAdapter.js} +1 -1
- package/widgets/Editor/types.d.ts +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature.d.ts +3 -5
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/FieldInput.d.ts +2 -2
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.d.ts +1 -1
- package/widgets/FeatureTemplates/TemplateItem.d.ts +1 -1
- package/widgets/FeatureTemplates/types.d.ts +1 -1
- package/widgets/Features.d.ts +3 -5
- package/widgets/Print/CustomTemplate.d.ts +3 -4
- package/widgets/Print/TemplateOptions.d.ts +3 -4
- package/widgets/Print/types.d.ts +3 -4
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/support/OperationHandle.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0099f4729c94c779ba35.js +0 -1
- package/assets/esri/core/workers/chunks/058fb2cd6387acfd458c.js +0 -1
- package/assets/esri/core/workers/chunks/0ae018098906d6a88904.js +0 -1
- package/assets/esri/core/workers/chunks/0dc3a04ce717b7ddd957.js +0 -1
- package/assets/esri/core/workers/chunks/0e5cd0cf6ab7cb37d723.js +0 -1
- package/assets/esri/core/workers/chunks/0ee407b8db5c07a00d82.js +0 -1
- package/assets/esri/core/workers/chunks/10373885604655f673df.js +0 -1
- package/assets/esri/core/workers/chunks/13d61d34e55c80e4ecdf.js +0 -1
- package/assets/esri/core/workers/chunks/17dea03fc4eb414f0022.js +0 -1
- package/assets/esri/core/workers/chunks/1967239713b58dccfd81.js +0 -1
- package/assets/esri/core/workers/chunks/1ab98591d2f2bc604505.js +0 -1
- package/assets/esri/core/workers/chunks/1b838638e66e82d76cf3.js +0 -1
- package/assets/esri/core/workers/chunks/1c350a2c4014146dbcd9.js +0 -1
- package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +0 -1
- package/assets/esri/core/workers/chunks/226acd251ad7d7ee3b57.js +0 -1
- package/assets/esri/core/workers/chunks/22b07c54a5fcc27771b0.js +0 -1
- package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +0 -1
- package/assets/esri/core/workers/chunks/22dd5cecc7e2d4d0baf8.js +0 -316
- package/assets/esri/core/workers/chunks/2402d305a77fef4694a0.js +0 -1
- package/assets/esri/core/workers/chunks/27f096c434f049b8df01.js +0 -1
- package/assets/esri/core/workers/chunks/2a6231db5ee6cbfd59a5.js +0 -1
- package/assets/esri/core/workers/chunks/3371935a4fd6346d3a17.js +0 -1
- package/assets/esri/core/workers/chunks/3c4f8597f602779174f1.js +0 -1
- package/assets/esri/core/workers/chunks/3da53c017f9c5d2d778a.js +0 -1
- package/assets/esri/core/workers/chunks/45b898367b6224dda46f.js +0 -1
- package/assets/esri/core/workers/chunks/4785cd108e2dec6e1697.js +0 -1
- package/assets/esri/core/workers/chunks/4d6d962d25aa836f53ee.js +0 -1
- package/assets/esri/core/workers/chunks/4f33a2ecb154a2c2449c.js +0 -1
- package/assets/esri/core/workers/chunks/52726458f590e726d52c.js +0 -1
- package/assets/esri/core/workers/chunks/536c492fdda30f2f1288.js +0 -1
- package/assets/esri/core/workers/chunks/5909a0e763fddc3542e7.js +0 -2
- package/assets/esri/core/workers/chunks/5cee6c3ff23fb93f857a.js +0 -1
- package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +0 -1
- package/assets/esri/core/workers/chunks/6035daa65fc3ebf86515.js +0 -1
- package/assets/esri/core/workers/chunks/63b8cd7d5cafbaeed894.js +0 -1
- package/assets/esri/core/workers/chunks/6cb44cd319cb6c2539c8.js +0 -1
- package/assets/esri/core/workers/chunks/7033fa18b7dd7bd3e49c.js +0 -1
- package/assets/esri/core/workers/chunks/7306b5b66e738a281d83.js +0 -1
- package/assets/esri/core/workers/chunks/7694abe44d55dae8872d.js +0 -1
- package/assets/esri/core/workers/chunks/7f4fa2f2e85863d3cfb9.js +0 -1
- package/assets/esri/core/workers/chunks/8f4c480c418eba299c2b.js +0 -1
- package/assets/esri/core/workers/chunks/964de713042f52d71e42.js +0 -1
- package/assets/esri/core/workers/chunks/a3836f6a93924ee4816e.js +0 -1
- package/assets/esri/core/workers/chunks/ab520fd1ae917daf07d8.js +0 -1
- package/assets/esri/core/workers/chunks/acc7ff44bfcb5c195114.js +0 -1
- package/assets/esri/core/workers/chunks/ad92427bf597a6e0a299.js +0 -1
- package/assets/esri/core/workers/chunks/b25a131c04092c3ab75d.js +0 -1
- package/assets/esri/core/workers/chunks/b285de471ca90f38ec25.js +0 -1
- package/assets/esri/core/workers/chunks/b8f83a272fc41765031d.js +0 -1
- package/assets/esri/core/workers/chunks/b9909264cfea68d5f2a1.js +0 -1
- package/assets/esri/core/workers/chunks/bb08359610a41e304b55.js +0 -1
- package/assets/esri/core/workers/chunks/bcf612eabe7577540953.js +0 -1
- package/assets/esri/core/workers/chunks/bfbbcaa1fb04f17fc869.js +0 -1
- package/assets/esri/core/workers/chunks/c02b09f16241db233103.js +0 -1
- package/assets/esri/core/workers/chunks/c3007b916ba933137709.js +0 -1
- package/assets/esri/core/workers/chunks/cc5c1887e6d7079e5fe3.js +0 -1
- package/assets/esri/core/workers/chunks/ce8f075c814a8378c00c.js +0 -1
- package/assets/esri/core/workers/chunks/cfe1506a443fc84a0b91.js +0 -1
- package/assets/esri/core/workers/chunks/d30cfc5fa302cc08d862.js +0 -1
- package/assets/esri/core/workers/chunks/d723619579cc8f5ef2cd.js +0 -1
- package/assets/esri/core/workers/chunks/da99fd0d3106dd357743.js +0 -1
- package/assets/esri/core/workers/chunks/de71db3b0fb947b13c97.js +0 -1
- package/assets/esri/core/workers/chunks/dfbbead4c24d13682891.js +0 -1
- package/assets/esri/core/workers/chunks/e69255e38ff200dda14b.js +0 -1
- package/assets/esri/core/workers/chunks/e705d041f6c1632bfbcc.js +0 -1
- package/assets/esri/core/workers/chunks/e85da52d9cc7d9396872.js +0 -1
- package/assets/esri/core/workers/chunks/ee186ddbb1eb5144a790.js +0 -1
- package/assets/esri/core/workers/chunks/f9370830051865a3435b.js +0 -1
- package/core/MultiOriginJSONSupport.d.ts +0 -13
- package/core/NumericIdentifiable.d.ts +0 -6
- package/core/ReadOnlyMultiOriginJSONSupport.d.ts +0 -6
- package/core/WriteableMultiOriginJSONMixin.d.ts +0 -6
- package/layers/knowledgeGraph/KnowledgeGraphSublayerBase.d.ts +0 -6
- package/layers/mixins/ArcGISService.d.ts +0 -6
- package/layers/mixins/RasterJobHandlerMixin.d.ts +0 -6
- package/layers/support/RasterFunctionProperties.d.ts +0 -2
- package/layers/support/domains.d.ts +0 -5
- package/layers/support/editableLayers.d.ts +0 -11
- package/layers/support/exifUtils.d.ts +0 -21
- package/layers/support/fieldFormatUtils.d.ts +0 -4
- package/layers/support/fieldType.d.ts +0 -2
- package/layers/support/layerUtils.d.ts +0 -4
- package/layers/support/wmtsUtils.d.ts +0 -2
- package/layers/video/videoUtils.d.ts +0 -5
- package/rest/geometryService/cut.d.ts +0 -7
- package/rest/geometryService/fromGeoCoordinateString.d.ts +0 -28
- package/rest/geometryService/toGeoCoordinateString.d.ts +0 -25
- package/rest/operations/generalize.d.ts +0 -3
- package/rest/support/DateBinUtils.d.ts +0 -2
- package/rest/support/colorRamps.d.ts +0 -6
- package/rest/support/fileFormat.d.ts +0 -4
- package/rest/support/layoutTemplate.d.ts +0 -2
- package/rest/support/reportTemplate.d.ts +0 -2
- package/views/2d/layers/LayerView2D.d.ts +0 -6
- package/views/Viewport2DBaseMixin.d.ts +0 -6
- package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
- package/views/layers/RefreshableLayerView.d.ts +0 -6
- package/widgets/Feature/support/FeatureContentMixin.d.ts +0 -6
- /package/layers/video/{IVideoController.d.ts → types.d.ts} +0 -0
- /package/layers/{support/wmsUtils.d.ts → wms/types.d.ts} +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../Color.js";import{linearize as t}from"../../../../colorUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{releaseMaybe as o}from"../../../../core/maybe.js";import{isPromiseLike as n}from"../../../../core/promiseUtils.js";import{normalFromMat4 as a,fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromTranslation as l,multiply as c,invert as u,getTranslation as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f,IDENTITY as p,clone as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as g,i as x,j as _,p as y,t as T,n as b,c as v,e as w,f as C,g as j}from"../../../../chunks/vec32.js";import{create as M,fromValues as R,ONES as A,ZEROS as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{canProjectWithoutEngine as I}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as B}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as U}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as E}from"../../../../geometry/projection/projectVectorToVector.js";import{fromBuffer as F,create as O,intersectsClippingArea as V}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as $}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as G,getContinuousIndexArray as D}from"../../../../geometry/support/Indices.js";import L from"../../../../geometry/support/MeshComponent.js";import N from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import H from"../../../../geometry/support/MeshTextureTransform.js";import{isRelativeVertexSpace as k,isAbsoluteVertexSpace as z}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{equals as q,isPlateCarree as W}from"../../../../geometry/support/spatialReferenceUtils.js";import{t as Y}from"../../../../chunks/vec3.js";import{transformNormal as K,transformVectorENUPlateCarree as J,transformVectorWMPlateCarree as Q,projectNormalToPCPF as X,transformTangent as Z,projectTangentToPCPF as ee}from"../../../../geometry/support/meshUtils/projection.js";import{projectMeshVertexPositions as te}from"../../../../geometry/support/meshUtils/projectMeshVertexPositions.js";import{getEmissiveMode as re}from"../../../../symbols/support/materialUtils.js";import{isEncodedMeshTexture as oe}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as ne}from"../../glTF/internal/TextureTransformUtils.js";import{defaultSymbolLayerMemoryComplexity as ae}from"./defaultSymbolComplexity.js";import{perObjectElevationAligner as se}from"./ElevationAligners.js";import{needsElevationUpdates3D as ie,evaluateElevationInfoAtPoint as le}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as ce}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as ue}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as me,nanFallbackColor as fe}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as pe,MeshFastUpdateProcessor as he}from"./MeshFastUpdateProcessor.js";import{SymbolComplexity as de}from"./SymbolComplexity.js";import{hasEdges as ge,createMaterial as xe}from"../support/edgeUtils.js";import{debugFlags as _e}from"../../support/debugFlags.js";import{Attribute as ye}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Te}from"../../webgl-engine/lib/Geometry.js";import{ManagedTexture as be}from"../../webgl-engine/lib/ManagedTexture.js";import{Object3D as ve}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as we}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as Ce}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as je,advancedMRRFactors as Me,schematicMRRFactors as Re}from"../../webgl-engine/materials/pbrUtils.js";const Ae=["mesh"];class Pe extends me{constructor(e,t,r,o){super(e,t,r,o,We(t)),this._materialInfoCache=new pe,this._fastUpdateProcessor=new he,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){_e.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new Ce({color:[1,0,1,1]}),this._debugTangentNormalMaterial=new Ce({color:[1,.5,0,1]}),this._debugFaceNormalMaterial=new Ce({color:[0,1,1,1]})),this.updateComplexity()}destroy(){super.destroy(),this._textures.forEach(e=>e.unload()),this._context.stage.removeTextures(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy()}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Ae,"fill on mesh-3d"))return null;const r=this.createElevationContextForGraphic(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters(e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTextureAlphaMode(t,e)}),e?.forEach(e=>t(e)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,ie)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters(({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),e?.forEach(e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters(({material:t})=>t.setParameters({usePBR:e})),!0}updateTransform(e,t,r,o){if(!e.fastTransformUpdatesAllowed)return!1;const n=e.fastTransformUpdatesEnabled;switch(o){case 0:if(n)return!0;break;case 1:if(!n)return!0;break;default:if(!n)return!!this.updateTransform(e,t,r,0)&&(e.autoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0)}const a=this._context.renderCoordsHelper.spatialReference,s=tt,{origin:i,transform:l}=r;if(!B(t,g(Je,i.x,i.y,i.z??0),s,a))return!1;switch(o){case 0:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case 1:this._fastUpdateProcessor.disable(e,this._materialInfoCache);break;case 2:e.updateFastLocalOrigin(s,l,this._context.localOriginFactory)}const{elevationContext:c}=e;c.centerInElevationSR=this._getCenterInElevationSR(s);const{elevationProvider:u,renderCoordsHelper:m}=this._context,f=(e,t)=>le(e,u,c,m,t);return e.alignedSampledElevation=se(e,c,u.spatialReference,f,m,s),e.updateTransform(s,l,this._context.isAsync),e.updateAutoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0}computeComplexity(){if(!this._textures||0===this._textures.size)return super.computeComplexity();let e=0;for(const o of this._textures.values())e+=o.usedMemory;const t={...ae(this.symbol,this.symbolLayer),resourceBytes:e},r=ge(this.symbolLayer)?2:0;return new de({drawCallsPerFeature:r,memory:t})}_requiresSymbolVertexColors(){return this._hasDrivenColorOrOpacity}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,n=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:n,uid:`vc:${o},vt:${n},vct${t},svc:${r}`}}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:n,colorTexture:a,colorTextureTransform:s,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,f=ke(n),p=ke(a),h=ze(s),d=ke(i),g=ze(l);if(o.color=n,o.colorTexture=a,o.normalTexture=i,o.uid=`${o.uid},cmuid:${f},ctmuid:${p},cttuid:${h},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof N){const{metallic:e,roughness:r,metallicRoughnessTexture:n,metallicRoughnessTextureTransform:a,emissiveColor:i,emissiveStrength:c,emissiveTexture:u,emissiveTextureTransform:m,occlusionTexture:f,occlusionTextureTransform:p}=t.material,h=ke(n),d=ze(a),g=ke(i),x=ke(u),_=ze(m),y=ke(f),T=ze(p);o.uid=[o.uid,`mrm:${e}`,`mrr:${r}`,`mrt:${h}`,`mrtt:${d}`,`emuid:${g}`,`ems:${c}`,`etmuid:${x}`,`ett:${_}`,`otmuid:${y}`,`ott:${T}`].join(","),o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=n,o.emissiveColor=i,o.emissiveStrength=c,o.emissiveTexture=u,o.occlusionTexture=f,o.colorTextureTransform=$e(s),o.normalTextureTransform=$e(l),o.emissiveTextureTransform=$e(m),o.occlusionTextureTransform=$e(p),o.metallicRoughnessTextureTransform=$e(a)}return o}_getInternalTexture(e,t=!1,r=1){const a=He(e);if(!a)return null;const s=`${e.contentHash}/${r}`;let i=this._textures.get(s);if(i){const e=this._context.stage.renderView.textures;let t=null;const r=e.acquire(i.id);return null==r||n(r)||(i.events.on("unloaded",()=>t=o(t)),t=r),i}let l=null;const c=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,u={wrap:Ge(e.wrap),noUnpackFlip:!0,maxAnisotropy:c,mipmap:c>1};return oe(a)?(l=a.data,u.preMultiplyAlpha=!1,u.encoding=a.encoding):(l=a,u.preMultiplyAlpha=1!==r,u.compressionOptions=t?{compressionTracker:this._context.compressionTracker,compressionCallback:()=>this.updateComplexity()}:void 0),i=new be(l,u),this._textures.set(s,i),i.events.on("loaded",()=>this.updateComplexity()),i.load(this._context.stage.renderView.renderingContext),this._context.stage.addTexture(i),i.events.on("unloaded",()=>{this._textures.delete(s)}),i}_setInternalMaterialTextureParameters(e,r){if(null!=e.colorTexture){const t=1!==r.textureAlphaMode,o=this._getInternalTexture(e.colorTexture,t,r.textureAlphaMode);o?(r.textureId=o.id,r.textureAlphaPremultiplied=!!o.parameters.preMultiplyAlpha):r.textureId=void 0}if(e.normalTexture&&(r.normalTextureId=this._getInternalTexture(e.normalTexture)?.id),e.emissiveColor){const o=e.emissiveColor?.toUnitRGB();r.emissiveBaseColor=R(t(o[0]),t(o[1]),t(o[2]))}e.emissiveStrength&&(r.emissiveStrengthKHR=e.emissiveStrength),e.emissiveTexture&&(r.emissiveTextureId=this._getInternalTexture(e.emissiveTexture)?.id),e.occlusionTexture&&(r.occlusionTextureId=this._getInternalTexture(e.occlusionTexture,!0)?.id),e.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTexture(e.metallicRoughnessTexture,!0)?.id)}_setInternalMaterialParameters(e,t,r){null!=e.color&&Ne(e.color,t,r),this._setInternalMaterialTextureParameters(e,t),t.colorTextureTransformMatrix=ne(e.colorTextureTransform),t.normalTextureTransformMatrix=ne(e.normalTextureTransform);const o=null!=e.normalTextureTransform?.scale?e.normalTextureTransform?.scale:d;t.scale=[o[0],o[1]],t.occlusionTextureTransformMatrix=ne(e.occlusionTextureTransform),t.emissiveTextureTransformMatrix=ne(e.emissiveTextureTransform),t.metallicRoughnessTextureTransformMatrix=ne(e.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(e,t=this._materialColor){const r=this._drivenProperties.color,o=this._drivenProperties.opacity;if(r)e.externalColor=S;else{const r=t??null;if(r){const t=r.toUnitRGBA();o&&(t[3]=1),e.externalColor=t}else e.externalColor=fe}e.colorMixMode=this.symbolLayer.material?.colorMixMode??"multiply",e.castShadows=!!this.symbolLayer.castShadows,e.emissiveStrengthFromSymbol=this.symbolLayer?.material?.emissive?.strength??1,e.emissiveSource=re(this.symbolLayer?.material?.emissive?.source??"emissive")}_getOrCreateMaterial(e,t){const r=t.material?.color,o=t.material?.colorTexture,n=t.material?.alphaMode,a="blend"===n,s=!("opaque"===n)&&(Le(e)||null!=r&&r.a<1||o?.transparent||a),i=this._materialProperties(e,t,s),l=this._materialInfoCache.byUid(i.uid);if(l)return this._setInternalMaterialTextureParameters(i,l.material.parameters),l.material;const c={uid:i.uid,material:null,isComponentTransparent:s,alphaMode:t.material?t.material.alphaMode:"opaque"},u=je({normalTexture:i.normalTexture,metallicRoughnessTexture:i.metallicRoughnessTexture,metallicFactor:i.metallic,roughnessFactor:i.roughness,emissiveTexture:i.emissiveTexture,emissiveFactor:i.emissiveColor?.toUnitRGB(),occlusionTexture:i.occlusionTexture}),m={usePBR:this._usePBR(),isSchematic:u,hasVertexColors:i.hasVertexColors,hasSymbolColors:i.hasSymbolVertexColors,hasVertexTangents:i.hasVertexTangents,ambient:P,diffuse:A,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:0,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,drivenOpacity:this.needsDrivenTransparentPass||c.isComponentTransparent};m.mrrFactors=u?Re:[i.metallic,i.roughness,Me[2]],t.material&&(m.doubleSided=t.material.doubleSided,m.cullFace=t.material.doubleSided?0:2,m.textureAlphaCutoff=t.material.alphaCutoff),this._setExternalMaterialParameters(m),this._setMaterialTextureAlphaMode(m,c),this._setInternalMaterialParameters(i,m,c);const f=new we(m,this._context);return c.material=f,this._materialInfoCache.set(i.uid,c),f}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchColor(e,t)}_preparePatchColor(e,t){if(!t.material||"partial"!==t.material.type)return;const r=t.material.diff;if(!r.color||"complete"!==r.color.type||null==r.color.newValue||null==r.color.oldValue)return;const o=r.color.newValue;delete r.color,e.symbolLayerStatePatches.push(()=>{this._updateMaterialParameters(e=>{const t=e.material.parameters;this._setExternalMaterialParameters(t,o),this._setMaterialTextureAlphaMode(t,e),e.material.setParameters({externalColor:t.externalColor})})})}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTextureAlphaMode(e,t){if("auto"===t.alphaMode){const r=this.needsDrivenTransparentPass||t.isComponentTransparent||(e.layerOpacity??1)<1||(e.opacity??1)<1||(e.externalColor?.[3]??1)<1;e.textureAlphaMode=r?3:1}else e.textureAlphaMode="opaque"===t.alphaMode?1:"mask"===t.alphaMode?2:0}_createFaceDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,n=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),s=[],l=[],c=t[0].transformation,u=a(i(),c);for(let a=0;a<r;a++){const e=t[a].attributes.get("position");if(!e)continue;const r=e.data,o=e.indices;for(let t=0;t<o.length;t+=3)Ve(r,o,t,Ze),Oe(r,o,t,Je,Qe,Xe),x(Je,Je,Qe),x(Je,Je,Xe),_(Je,Je,1/3),y(Je,Je,c),s.push(...Je),T(Ze,Ze,u),b(Ze,Ze),v(Je,Je,Ze,n),s.push(...Je),l.push(l.length),l.push(l.length)}return s.length?new Te(this._debugFaceNormalMaterial,[["position",new ye(s,l,3,!0)]],null,2):null}_createPerVertexDebugVectors(e,t,r,o,n){const l=t.length,c=e.spatialReference.isGeographic?20015077/180:1,u=.1*n*Math.max(e.extent.width*c,e.extent.height*c,e.extent.zmax-e.extent.zmin),m=[],f=[],p=t[0].transformation,h=a(i(),p);"tangent"===r&&s(h,p);for(let a=0;a<l;a++){const e=t[a],o=e.attributes.get("position"),n=e.attributes.get(r);if(!o||!n)continue;const s=o.data,i=o.indices,l=n.data,c=n.indices;for(let t=0;t<i.length;t++){const e=3*i[t],r=c[t]*n.stride;g(Je,s[e+0],s[e+1],s[e+2]),y(Je,Je,p),m.push(...Je),g(Qe,l[r+0],l[r+1],l[r+2]),T(Qe,Qe,h),b(Qe,Qe),v(Je,Je,Qe,u),m.push(...Je),f.push(f.length),f.push(f.length)}}return m.length?new Te(o,[["position",new ye(m,f,3,!0)]],null,2):null}_createAs3DShape(e,t,r,o){const n=e.geometry;if("mesh"!==n.type)return null;const a=this._createGeometryInfo(n,t,o);if(null==a)return null;const{geometries:s,objectTransformation:i}=a;if(_e.DRAW_MESH_GEOMETRY_NORMALS){const e=this._createPerVertexDebugVectors(n,s,"normal",this._debugVertexNormalMaterial,1),t=this._createPerVertexDebugVectors(n,s,"tangent",this._debugTangentNormalMaterial,.5),r=this._createFaceDebugNormals(n,s);e&&s.push(e),t&&s.push(t),r&&s.push(r)}const l=this._context.layerViewUid,c=new ve({geometries:s,layerViewUid:l,graphicUid:o,isElevationSource:!0});c.transformation=i;const u=xe(this.symbolLayer,{opacity:this._getLayerOpacity()}),m=u?new ue(s[0].material,u,this._context.slicePlaneEnabled):null,f=new ce(this,c,null,se,r,m);this._fastUpdateProcessor.onAddGraphic(),f.needsElevationUpdates=ie(r.mode),f.useObjectOriginAsAttachmentOrigin=!0,f.fastTransformUpdatesAllowed=this._fastTransformUpdatesAllowed(n),r.centerInElevationSR=this._getCenterInElevationSR(c.transformation);const{elevationProvider:p,renderCoordsHelper:h}=this._context,d=(e,t)=>le(e,p,r,h,t);return f.alignedSampledElevation=se(f,r,p.spatialReference,d,h),f}_fastTransformUpdatesAllowed(e){const{vertexSpace:t,spatialReference:r}=e;if(!k(t))return!1;const{type:o}=t,{view:n}=this._context.graphicsCoreOwner,{viewingMode:a}=n.state,s=n.spatialReference;return 1===a&&"local"===o||2===a&&q(s,r)&&"georeferenced"===o&&!r.isGeographic}_getElevationSR(){return this._context.elevationProvider.spatialReference??null}_getCenterInElevationSR(e){const t=M(),r=g(nt,e[12],e[13],e[14]);return E(r,this._context.renderCoordsHelper.spatialReference,t,this._getElevationSR()),t}_passthroughReprojectionInfo(e){return 0===e.reprojection&&!!e.objectTransformation}_createPositionBuffer(e,t){const r=e.vertexAttributes.position;let o,n=r;if(0===t.reprojection)return{position:n,georeferencedPositionBuffer:o};const a=1===t.reprojection?t.transformBeforeProject:null;a&&(n=Y(new Float64Array(n.length),n,a));const{normal:s,tangent:i}=e.vertexAttributes;this._passthroughReprojectionInfo(t)||!s&&!i||(o=n);const l=n===r||n===o?new Float64Array(n.length):n;return U(n,e.spatialReference,0,l,this._context.renderCoordsHelper.spatialReference,0),{position:l,georeferencedPositionBuffer:o}}_createNormalBuffer(e,t,r,o){const n=e.vertexAttributes.normal;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=K(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!W(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return J(a,0,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Q(a,0,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return X(a,r,e.spatialReference,t,c,l)}_createTangentBuffer(e,t,r,o){const n=e.vertexAttributes.tangent;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=Z(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!W(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return J(a,1,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Q(a,1,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return ee(a,r,e.spatialReference,t,c,l)}_createSymbolColorBuffer(e){return this._requiresSymbolVertexColors()?new Uint8Array(this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!0)):null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,n=e.vertexAttributes.uv,a=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(n&&n.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const s=this._computeReprojectionInfo(e),{position:i,georeferencedPositionBuffer:l}=this._createPositionBuffer(e,s),c=qe(e),u=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,l,s),p=this._createTangentBuffer(e,i,l,s),h=n,{transformation:d,position:g,normal:x,tangent:_}=this._passthroughReprojectionInfo(s)?{transformation:s.objectTransformation,position:i,normal:m,tangent:p}:this._transformOriginLocal(e,i,m,p);return{positionBuffer:g,normalBuffer:x,tangentBuffer:_,uvBuffer:h,colorBuffer:c,symbolColorBuffer:u,objectTransformation:d,geometryTransformation:0===s.reprojection&&s.geometryTransformation?s.geometryTransformation:f()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r="georeferenced"===t.type?q(this._context.renderCoordsHelper.spatialReference,e.spatialReference)?0:1:0;if(z(t))return{reprojection:r};const o=t.origin,n=f(),a=e.transform?.localMatrix??p;if(0===r){B(e.spatialReference,o,n,this._context.renderCoordsHelper.spatialReference);return{reprojection:r,objectTransformation:n,geometryTransformation:h(a)}}const s=l(f(),o);return c(s,s,a),{reprojection:r,transformBeforeProject:s}}_transformOriginLocal(e,t,r,o){const n=this._context.renderCoordsHelper.spatialReference,a=e.origin;Ke[0]=a.x,Ke[1]=a.y,Ke[2]=a.z??0;const s=f();B(e.spatialReference,Ke,s,n),u(et,s);const{position:i,normal:l,tangent:c}=e.vertexAttributes,m=t===i?new Float64Array(t.length):t;Y(m,t,et);const p=r?r===l?new Float32Array(r.length):r:null,h=o?o===c?new Float32Array(o.length):o:null;return r&&p&&K(r,p,et),o&&h&&Z(o,h,et),{transformation:s,position:m,normal:p,tangent:h}}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=te(e,r??e.spatialReference);return!!o&&(F(o,rt),!V(rt,this._context.clippingExtent))}_createGeometryInfo(e,t,r){if(!I(e.spatialReference,this._context.renderCoordsHelper.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(!this._validateVertexSpace(e))return null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:n,uvBuffer:a,colorBuffer:s,symbolColorBuffer:i,normalBuffer:l,tangentBuffer:c,objectTransformation:u,geometryTransformation:f}=o,p=e.components??ot,h=new Array;let d=!1;const g=m(Je,u),x=this._context.localOriginFactory.getOrigin(g);for(const m of p){if(!this._validateFaces(e,m))return null;const t=Ie(e,m);if(0===t.length)continue;const o=Be(n,l,m,t);o.didFlipNormals&&(d=!0);const u=[["position",new ye(n,t,3,!0)],["normal",new ye(o.normals,o.indices,3,!0)]];s&&u.push(["color",new ye(s,t,4,!0)]),i&&u.push(["symbolColor",new ye(i,G(t.length),4,!0)]),a&&u.push(["uv0",new ye(a,t,2,!0)]),c&&u.push(["tangent",new ye(c,t,4,!0)]);const p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerViewUid:this._context.layerViewUid}),g=this._getOrCreateMaterial(e,m),_=new Te(g,u,null,0,p);_.transformation=f,_.localOrigin=x,h.push(_)}return d&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:h,objectTransformation:u}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial((e,t)=>{t.setParameters(e.parameters)})}_validateVertexSpace(e){const{_context:{graphicsCoreOwner:{view:{state:{viewingMode:t}}}}}=this,{vertexSpace:r}=e;return 2!==t||"local"!==r.type||(this.logger.warn("Displaying a mesh with a local vertex space in a view in local viewing mode is not supported."),!1)}test(){return{...super.test(),materials:this._materialInfoCache.materials}}get _materialColor(){return this.symbolLayer.material?.color}}class Se{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}function Ie(e,t){return t.faces??D(e.vertexAttributes.position.length/3)}function Be(e,t,r,o){switch(r.shading||"flat"){default:case"source":return Ee(e,t,r,o);case"flat":return Ue(e,o);case"smooth":return Fe(e,o)}}function Ue(e,t){const r=$(t.length),o=new Array(3*t.length);for(let n=0;n<t.length;n+=3){const a=Ve(e,t,n,Ze);for(let e=0;e<3;e++)r[n+e]=a[e],o[n+e]=n/3}return new Se(r,o,!1)}function Ee(e,t,r,o){if(null==t)return Ue(e,o);let n=!1;if(!r.trustSourceNormals)for(let a=0;a<o.length;a+=3){Ve(e,o,a,Ze);for(let e=0;e<3;e++){const r=3*o[a+e];Je[0]=t[r],Je[1]=t[r+1],Je[2]=t[r+2],j(Ze,Je)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],n=!0)}}return new Se(t,o,n)}function Fe(e,t){const r={};for(let a=0;a<t.length;a+=3){const o=Ve(e,t,a,Ze);for(let e=0;e<3;e++){const n=t[a+e];let s=r[n];s||(s={normal:M(),count:0},r[n]=s),x(s.normal,s.normal,o),s.count++}}const o=$(3*t.length),n=new Array(3*t.length);for(let a=0;a<t.length;a++){const e=r[t[a]];1!==e.count&&(b(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*a+t]=e.normal[t];n[a]=a}return new Se(o,n,!1)}function Oe(e,t,r,o,n,a){const s=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[s],o[1]=e[s+1],o[2]=e[s+2],n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],a[0]=e[l],a[1]=e[l+1],a[2]=e[l+2]}function Ve(e,t,r,o){return Oe(e,t,r,Je,Qe,Xe),w(Qe,Qe,Je),w(Xe,Xe,Je),C(Je,Qe,Xe),b(o,Je),o}function $e(e){if(!e)return null;const{scale:t,offset:o,rotation:n}=e;return{scale:t,offset:o,rotation:r(n)}}function Ge(e="repeat"){if("string"==typeof e){const t=De(e);return{s:t,t}}return{s:De(e.horizontal),t:De(e.vertical)}}function De(e){switch(e){case"clamp":return 33071;case"mirror":return 33648;default:return 10497}}function Le(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}function Ne(e,t,r){t.diffuse=e.toUnitRGB(),t.opacity="opaque"===r.alphaMode?1:e.a}function He(e){return e.data??e.url}function ke(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}function ze(e){const{offset:t,scale:r,rotation:o}=e??Ye;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}function qe(e){return e.vertexAttributes.color}function We(e){return 1===(e.material?.color?.a??0)}const Ye=new H,Ke=M(),Je=M(),Qe=M(),Xe=M(),Ze=M(),et=f(),tt=f(),rt=O(),ot=[new L],nt=M();export{Pe as Graphics3DMeshFillSymbolLayer};
|
|
5
|
+
import e from"../../../../Color.js";import{linearize as t}from"../../../../colorUtils.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{releaseMaybe as o}from"../../../../core/maybe.js";import{isPromiseLike as n}from"../../../../core/promiseUtils.js";import{normalFromMat4 as a,fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromTranslation as l,multiply as c,invert as u,getTranslation as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f,IDENTITY as p,clone as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as g,i as x,j as _,p as y,t as T,n as b,c as v,e as w,f as C,g as j}from"../../../../chunks/vec32.js";import{create as M,fromValues as R,ONES as A,ZEROS as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{canProjectWithoutEngine as I}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as B}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as U}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as E}from"../../../../geometry/projection/projectVectorToVector.js";import{fromBuffer as F,create as O,intersectsClippingArea as V}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as $}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as G,getContinuousIndexArray as D}from"../../../../geometry/support/Indices.js";import L from"../../../../geometry/support/MeshComponent.js";import N from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import H from"../../../../geometry/support/MeshTextureTransform.js";import{isRelativeVertexSpace as k,isAbsoluteVertexSpace as z}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{equals as q,isPlateCarree as W}from"../../../../geometry/support/spatialReferenceUtils.js";import{t as Y}from"../../../../chunks/vec3.js";import{transformNormal as K,transformVectorENUPlateCarree as J,transformVectorWMPlateCarree as Q,projectNormalToPCPF as X,transformTangent as Z,projectTangentToPCPF as ee}from"../../../../geometry/support/meshUtils/projection.js";import{projectMeshVertexPositions as te}from"../../../../geometry/support/meshUtils/projectMeshVertexPositions.js";import{getEmissiveMode as re}from"../../../../symbols/support/materialUtils.js";import{isEncodedMeshTexture as oe}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as ne}from"../../glTF/internal/TextureTransformUtils.js";import{defaultSymbolLayerMemoryComplexity as ae}from"./defaultSymbolComplexity.js";import{perObjectElevationAligner as se}from"./ElevationAligners.js";import{needsElevationUpdates3D as ie,evaluateElevationInfoAtPoint as le}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as ce}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as ue}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as me,nanFallbackColor as fe}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as pe,MeshFastUpdateProcessor as he}from"./MeshFastUpdateProcessor.js";import{SymbolComplexity as de}from"./SymbolComplexity.js";import{hasEdges as ge,createMaterial as xe}from"../support/edgeUtils.js";import{debugFlags as _e}from"../../support/debugFlags.js";import{Attribute as ye}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Te}from"../../webgl-engine/lib/Geometry.js";import{ManagedTexture as be}from"../../webgl-engine/lib/ManagedTexture.js";import{Object3D as ve}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as we}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as Ce}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as je,advancedMRRFactors as Me,schematicMRRFactors as Re}from"../../webgl-engine/materials/pbrUtils.js";const Ae=["mesh"];class Pe extends me{constructor(e,t,r,o){super(e,t,r,o,We(t)),this._materialInfoCache=new pe,this._fastUpdateProcessor=new he,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){_e.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new Ce({color:[1,0,1,1]}),this._debugTangentNormalMaterial=new Ce({color:[1,.5,0,1]}),this._debugFaceNormalMaterial=new Ce({color:[0,1,1,1]})),this.updateComplexity()}destroy(){super.destroy(),this._textures.forEach(e=>e.unload()),this._context.stage.removeTextures(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy()}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Ae,"fill on mesh-3d"))return null;const r=this.createElevationContextForGraphic(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters(e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTextureAlphaMode(t,e)}),e?.forEach(e=>t(e)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,ie)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters(({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),e?.forEach(e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters(({material:t})=>t.setParameters({usePBR:e})),!0}updateTransform(e,t,r,o){if(!e.fastTransformUpdatesAllowed)return!1;const n=e.fastTransformUpdatesEnabled;switch(o){case 0:if(n)return!0;break;case 1:if(!n)return!0;break;default:if(!n)return!!this.updateTransform(e,t,r,0)&&(e.autoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0)}const a=this._context.renderCoordsHelper.spatialReference,s=tt,{origin:i,transform:l}=r;if(!B(t,g(Je,i.x,i.y,i.z??0),s,a))return!1;switch(o){case 0:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case 1:this._fastUpdateProcessor.disable(e,this._materialInfoCache);break;case 2:e.updateFastLocalOrigin(s,l,this._context.localOriginFactory)}const{elevationContext:c}=e;c.centerInElevationSR=this._getCenterInElevationSR(s);const{elevationProvider:u,renderCoordsHelper:m}=this._context,f=(e,t)=>le(e,u,c,m,t);return e.alignedSampledElevation=se(e,c,u.spatialReference,f,m,s),e.updateTransform(s,l,this._context.isAsync),e.updateAutoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0}computeComplexity(){if(!this._textures||0===this._textures.size)return super.computeComplexity();let e=0;for(const o of this._textures.values())e+=o.usedMemory;const t={...ae(this.symbol,this.symbolLayer),resourceBytes:e},r=ge(this.symbolLayer)?2:0;return new de({drawCallsPerFeature:r,memory:t})}_requiresSymbolVertexColors(){return this._hasDrivenColorOrOpacity}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,n=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:n,uid:`vc:${o},vt:${n},vct${t},svc:${r}`}}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:n,colorTexture:a,colorTextureTransform:s,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,f=ke(n),p=ke(a),h=ze(s),d=ke(i),g=ze(l);if(o.color=n,o.colorTexture=a,o.normalTexture=i,o.uid=`${o.uid},cmuid:${f},ctmuid:${p},cttuid:${h},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof N){const{metallic:e,roughness:r,metallicRoughnessTexture:n,metallicRoughnessTextureTransform:a,emissiveColor:i,emissiveStrength:c,emissiveTexture:u,emissiveTextureTransform:m,occlusionTexture:f,occlusionTextureTransform:p}=t.material,h=ke(n),d=ze(a),g=ke(i),x=ke(u),_=ze(m),y=ke(f),T=ze(p);o.uid=[o.uid,`mrm:${e}`,`mrr:${r}`,`mrt:${h}`,`mrtt:${d}`,`emuid:${g}`,`ems:${c}`,`etmuid:${x}`,`ett:${_}`,`otmuid:${y}`,`ott:${T}`].join(","),o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=n,o.emissiveColor=i,o.emissiveStrength=c,o.emissiveTexture=u,o.occlusionTexture=f,o.colorTextureTransform=$e(s),o.normalTextureTransform=$e(l),o.emissiveTextureTransform=$e(m),o.occlusionTextureTransform=$e(p),o.metallicRoughnessTextureTransform=$e(a)}return o}_getInternalTexture(e,t=!1,r=1){const a=He(e);if(!a)return null;const s=`${e.contentHash}/${r}`;let i=this._textures.get(s);if(i){const e=this._context.stage.renderView.textures;let t=null;const r=e.acquire(i.id);return null==r||n(r)||(i.events.on("unloaded",()=>t=o(t)),t=r),i}let l=null;const c=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,u={wrap:Ge(e.wrap),noUnpackFlip:!0,maxAnisotropy:c,mipmap:c>1};return oe(a)?(l=a.data,u.preMultiplyAlpha=!1,u.encoding=a.encoding):(l=a,u.preMultiplyAlpha=1!==r,u.compressionOptions=t?{compressionTracker:this._context.compressionTracker,compressionCallback:()=>this.updateComplexity()}:void 0),i=new be(l,u),this._textures.set(s,i),i.events.on("loaded",()=>this.updateComplexity()),i.load(this._context.stage.renderView.renderingContext),this._context.stage.addTexture(i),i.events.on("unloaded",()=>{this._textures.delete(s)}),i}_setInternalMaterialTextureParameters(e,r){if(null!=e.colorTexture){const t=1!==r.textureAlphaMode,o=this._getInternalTexture(e.colorTexture,t,r.textureAlphaMode);o?(r.textureId=o.id,r.textureAlphaPremultiplied=!!o.parameters.preMultiplyAlpha):r.textureId=void 0}if(e.normalTexture&&(r.normalTextureId=this._getInternalTexture(e.normalTexture)?.id),e.emissiveColor){const o=e.emissiveColor?.toUnitRGB();r.emissiveBaseColor=R(t(o[0]),t(o[1]),t(o[2]))}e.emissiveStrength&&(r.emissiveStrengthKHR=e.emissiveStrength),e.emissiveTexture&&(r.emissiveTextureId=this._getInternalTexture(e.emissiveTexture)?.id),e.occlusionTexture&&(r.occlusionTextureId=this._getInternalTexture(e.occlusionTexture,!0)?.id),e.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTexture(e.metallicRoughnessTexture,!0)?.id)}_setInternalMaterialParameters(e,t,r){null!=e.color&&Ne(e.color,t,r),this._setInternalMaterialTextureParameters(e,t),t.colorTextureTransformMatrix=ne(e.colorTextureTransform),t.normalTextureTransformMatrix=ne(e.normalTextureTransform);const o=null!=e.normalTextureTransform?.scale?e.normalTextureTransform?.scale:d;t.scale=[o[0],o[1]],t.occlusionTextureTransformMatrix=ne(e.occlusionTextureTransform),t.emissiveTextureTransformMatrix=ne(e.emissiveTextureTransform),t.metallicRoughnessTextureTransformMatrix=ne(e.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(e,t=this._materialColor){const r=this._drivenProperties.color,o=this._drivenProperties.opacity;if(r)e.externalColor=S;else{const r=t??null;if(r){const t=r.toUnitRGBA();o&&(t[3]=1),e.externalColor=t}else e.externalColor=fe}e.colorMixMode=this.symbolLayer.material?.colorMixMode??"multiply",e.castShadows=!!this.symbolLayer.castShadows,e.emissiveStrengthFromSymbol=this.symbolLayer?.material?.emissive?.strength??1,e.emissiveSource=re(this.symbolLayer?.material?.emissive?.source??"emissive")}_getOrCreateMaterial(e,t){const r=t.material?.color,o=t.material?.colorTexture,n=t.material?.alphaMode,a="blend"===n,s=!("opaque"===n)&&(Le(e)||null!=r&&r.a<1||o?.transparent||a),i=this._materialProperties(e,t,s),l=this._materialInfoCache.byUid(i.uid);if(l)return this._setInternalMaterialTextureParameters(i,l.material.parameters),l.material;const c={uid:i.uid,material:null,isComponentTransparent:s,alphaMode:t.material?t.material.alphaMode:"opaque"},u=je({normalTexture:i.normalTexture,metallicRoughnessTexture:i.metallicRoughnessTexture,metallicFactor:i.metallic,roughnessFactor:i.roughness,emissiveTexture:i.emissiveTexture,emissiveFactor:i.emissiveColor?.toUnitRGB(),occlusionTexture:i.occlusionTexture}),m={usePBR:this._usePBR(),isSchematic:u,hasVertexColors:i.hasVertexColors,hasSymbolColors:i.hasSymbolVertexColors,hasVertexTangents:i.hasVertexTangents,ambient:P,diffuse:A,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:0,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,drivenOpacity:this.needsDrivenTransparentPass||c.isComponentTransparent};m.mrrFactors=u?Re:[i.metallic,i.roughness,Me[2]],t.material&&(m.doubleSided=t.material.doubleSided,m.cullFace=t.material.doubleSided?0:2,m.textureAlphaCutoff=t.material.alphaCutoff),this._setExternalMaterialParameters(m),this._setMaterialTextureAlphaMode(m,c),this._setInternalMaterialParameters(i,m,c);const f=new we(m,this._context);return c.material=f,this._materialInfoCache.set(i.uid,c),f}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchColor(e,t)}_preparePatchColor(e,t){if(!t.material||"partial"!==t.material.type)return;const r=t.material.diff;if(!r.color||"complete"!==r.color.type||null==r.color.newValue||null==r.color.oldValue)return;const o=r.color.newValue;delete r.color,e.symbolLayerStatePatches.push(()=>{this._updateMaterialParameters(e=>{const t=e.material.parameters;this._setExternalMaterialParameters(t,o),this._setMaterialTextureAlphaMode(t,e),e.material.setParameters({externalColor:t.externalColor})})})}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTextureAlphaMode(e,t){if("auto"===t.alphaMode){const r=this.needsDrivenTransparentPass||t.isComponentTransparent||(e.layerOpacity??1)<1||(e.opacity??1)<1||(e.externalColor?.[3]??1)<1;e.textureAlphaMode=r?3:1}else e.textureAlphaMode="opaque"===t.alphaMode?1:"mask"===t.alphaMode?2:0}_createFaceDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,n=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),s=[],l=[],c=t[0].transformation,u=a(i(),c);for(let a=0;a<r;a++){const e=t[a].attributes.get("position");if(!e)continue;const r=e.data,o=e.indices;for(let t=0;t<o.length;t+=3)Ve(r,o,t,Ze),Oe(r,o,t,Je,Qe,Xe),x(Je,Je,Qe),x(Je,Je,Xe),_(Je,Je,1/3),y(Je,Je,c),s.push(...Je),T(Ze,Ze,u),b(Ze,Ze),v(Je,Je,Ze,n),s.push(...Je),l.push(l.length),l.push(l.length)}return s.length?new Te(this._debugFaceNormalMaterial,[["position",new ye(s,l,3,!0)]],null,2):null}_createPerVertexDebugVectors(e,t,r,o,n){const l=t.length,c=e.spatialReference.isGeographic?20015077/180:1,u=.1*n*Math.max(e.extent.width*c,e.extent.height*c,e.extent.zmax-e.extent.zmin),m=[],f=[],p=t[0].transformation,h=a(i(),p);"tangent"===r&&s(h,p);for(let a=0;a<l;a++){const e=t[a],o=e.attributes.get("position"),n=e.attributes.get(r);if(!o||!n)continue;const s=o.data,i=o.indices,l=n.data,c=n.indices;for(let t=0;t<i.length;t++){const e=3*i[t],r=c[t]*n.stride;g(Je,s[e+0],s[e+1],s[e+2]),y(Je,Je,p),m.push(...Je),g(Qe,l[r+0],l[r+1],l[r+2]),T(Qe,Qe,h),b(Qe,Qe),v(Je,Je,Qe,u),m.push(...Je),f.push(f.length),f.push(f.length)}}return m.length?new Te(o,[["position",new ye(m,f,3,!0)]],null,2):null}_createAs3DShape(e,t,r,o){const n=e.geometry;if("mesh"!==n.type)return null;const a=this._createGeometryInfo(n,t,o);if(null==a)return null;const{geometries:s,objectTransformation:i}=a;if(_e.DRAW_MESH_GEOMETRY_NORMALS){const e=this._createPerVertexDebugVectors(n,s,"normal",this._debugVertexNormalMaterial,1),t=this._createPerVertexDebugVectors(n,s,"tangent",this._debugTangentNormalMaterial,.5),r=this._createFaceDebugNormals(n,s);e&&s.push(e),t&&s.push(t),r&&s.push(r)}const l=this._context.layerViewUid,c=new ve({geometries:s,layerViewUid:l,graphicUid:o,isElevationSource:!0});c.transformation=i;const u=xe(this.symbolLayer,{opacity:this._getLayerOpacity()}),m=u?new ue(s[0].material,u,this._context.slicePlaneEnabled):null,f=new ce(this,c,null,se,r,m);this._fastUpdateProcessor.onAddGraphic(),f.needsElevationUpdates=ie(r.mode),f.useObjectOriginAsAttachmentOrigin=!0,f.fastTransformUpdatesAllowed=this._fastTransformUpdatesAllowed(n),r.centerInElevationSR=this._getCenterInElevationSR(c.transformation);const{elevationProvider:p,renderCoordsHelper:h}=this._context,d=(e,t)=>le(e,p,r,h,t);return f.alignedSampledElevation=se(f,r,p.spatialReference,d,h),f}_fastTransformUpdatesAllowed(e){const{vertexSpace:t,spatialReference:r}=e;if(!k(t))return!1;const{type:o}=t,{view:n}=this._context.graphicsCoreOwner,{viewingMode:a}=n.state,s=n.spatialReference;return 1===a&&"local"===o||2===a&&q(s,r)&&"georeferenced"===o&&!r.isGeographic}_getElevationSR(){return this._context.elevationProvider.spatialReference??null}_getCenterInElevationSR(e){const t=M(),r=g(nt,e[12],e[13],e[14]);return E(r,this._context.renderCoordsHelper.spatialReference,t,this._getElevationSR()),t}_passthroughReprojectionInfo(e){return 0===e.reprojection&&!!e.objectTransformation}_createPositionBuffer(e,t){const r=e.vertexAttributes.position;let o,n=r;if(0===t.reprojection)return{position:n,georeferencedPositionBuffer:o};const a=1===t.reprojection?t.transformBeforeProject:null;a&&(n=Y(new Float64Array(n.length),n,a));const{normal:s,tangent:i}=e.vertexAttributes;this._passthroughReprojectionInfo(t)||!s&&!i||(o=n);const l=n===r||n===o?new Float64Array(n.length):n;return U(n,e.spatialReference,0,l,this._context.renderCoordsHelper.spatialReference,0),{position:l,georeferencedPositionBuffer:o}}_createNormalBuffer(e,t,r,o){const n=e.vertexAttributes.normal;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=K(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!W(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return J(a,0,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Q(a,0,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return X(a,r,e.spatialReference,t,c,l)}_createTangentBuffer(e,t,r,o){const n=e.vertexAttributes.tangent;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=Z(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!W(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return J(a,1,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Q(a,1,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return ee(a,r,e.spatialReference,t,c,l)}_createSymbolColorBuffer(e){return this._requiresSymbolVertexColors()?new Uint8Array(this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!0)):null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,n=e.vertexAttributes.uv,a=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(n&&n.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const s=this._computeReprojectionInfo(e),{position:i,georeferencedPositionBuffer:l}=this._createPositionBuffer(e,s),c=qe(e),u=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,l,s),p=this._createTangentBuffer(e,i,l,s),h=n,{transformation:d,position:g,normal:x,tangent:_}=this._passthroughReprojectionInfo(s)?{transformation:s.objectTransformation,position:i,normal:m,tangent:p}:this._transformOriginLocal(e,i,m,p);return{positionBuffer:g,normalBuffer:x,tangentBuffer:_,uvBuffer:h,colorBuffer:c,symbolColorBuffer:u,objectTransformation:d,geometryTransformation:0===s.reprojection&&s.geometryTransformation?s.geometryTransformation:f()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r="georeferenced"===t.type?q(this._context.renderCoordsHelper.spatialReference,e.spatialReference)?0:1:0;if(z(t))return{reprojection:r};const o=t.origin,n=f(),a=e.transform?.localMatrix??p;if(0===r){B(e.spatialReference,o,n,this._context.renderCoordsHelper.spatialReference);return{reprojection:r,objectTransformation:n,geometryTransformation:h(a)}}const s=l(f(),o);return c(s,s,a),{reprojection:r,transformBeforeProject:s}}_transformOriginLocal(e,t,r,o){const n=this._context.renderCoordsHelper.spatialReference,a=e.origin;Ke[0]=a.x,Ke[1]=a.y,Ke[2]=a.z??0;const s=f();B(e.spatialReference,Ke,s,n),u(et,s);const{position:i,normal:l,tangent:c}=e.vertexAttributes,m=t===i?new Float64Array(t.length):t;Y(m,t,et);const p=r?r===l?new Float32Array(r.length):r:null,h=o?o===c?new Float32Array(o.length):o:null;return r&&p&&K(r,p,et),o&&h&&Z(o,h,et),{transformation:s,position:m,normal:p,tangent:h}}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=te(e,r??e.spatialReference);return!!o&&(F(o,rt),!V(rt,this._context.clippingExtent))}_createGeometryInfo(e,t,r){if(!I(e.spatialReference,this._context.renderCoordsHelper.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(!this._validateVertexSpace(e))return null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:n,uvBuffer:a,colorBuffer:s,symbolColorBuffer:i,normalBuffer:l,tangentBuffer:c,objectTransformation:u,geometryTransformation:f}=o,p=e.components??ot,h=new Array;let d=!1;const g=m(Je,u),x=this._context.localOriginFactory.getOrigin(g);for(const m of p){if(!this._validateFaces(e,m))return null;const t=Ie(e,m);if(0===t.length)continue;const o=Be(n,l,m,t);o.didFlipNormals&&(d=!0);const u=[["position",new ye(n,t,3,!0)],["normal",new ye(o.normals,o.indices,3,!0)]];s&&u.push(["color",new ye(s,t,4,!0)]),i&&u.push(["symbolColor",new ye(i,G(t.length),4,!0)]),a&&u.push(["uv0",new ye(a,t,2,!0)]),c&&u.push(["tangent",new ye(c,t,4,!0)]);const p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerViewUid:this._context.layerViewUid}),g=this._getOrCreateMaterial(e,m),_=new Te(g,u,null,0,p);_.transformation=f,_.localOrigin=x,h.push(_)}return d&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:h,objectTransformation:u}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial((e,t)=>{t.setParameters(e.parameters)})}_validateVertexSpace(e){const{_context:{graphicsCoreOwner:{view:{state:{viewingMode:t}}}}}=this,{vertexSpace:r}=e;return 2!==t||"local"!==r.type||(this.logger.warn("Displaying a mesh with a local vertex space in a view in local viewing mode is not supported."),!1)}test(){return{...super.test(),materials:this._materialInfoCache.materials}}get _materialColor(){return this.symbolLayer.material?.color}}class Se{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}function Ie(e,t){return t.faces??D(e.vertexAttributes.position.length/3)}function Be(e,t,r,o){switch(r.shading||"flat"){default:case"source":return Ee(e,t,r,o);case"flat":return Ue(e,o);case"smooth":return Fe(e,o)}}function Ue(e,t){const r=$(t.length),o=new Array(3*t.length);for(let n=0;n<t.length;n+=3){const a=Ve(e,t,n,Ze);for(let e=0;e<3;e++)r[n+e]=a[e],o[n+e]=n/3}return new Se(r,o,!1)}function Ee(e,t,r,o){if(null==t)return Ue(e,o);let n=!1;if(!r.trustSourceNormals)for(let a=0;a<o.length;a+=3){Ve(e,o,a,Ze);for(let e=0;e<3;e++){const r=3*o[a+e];Je[0]=t[r],Je[1]=t[r+1],Je[2]=t[r+2],j(Ze,Je)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],n=!0)}}return new Se(t,o,n)}function Fe(e,t){const r={};for(let a=0;a<t.length;a+=3){const o=Ve(e,t,a,Ze);for(let e=0;e<3;e++){const n=t[a+e];let s=r[n];s||(s={normal:M(),count:0},r[n]=s),x(s.normal,s.normal,o),s.count++}}const o=$(3*t.length),n=new Array(3*t.length);for(let a=0;a<t.length;a++){const e=r[t[a]];1!==e.count&&(b(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*a+t]=e.normal[t];n[a]=a}return new Se(o,n,!1)}function Oe(e,t,r,o,n,a){const s=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[s],o[1]=e[s+1],o[2]=e[s+2],n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],a[0]=e[l],a[1]=e[l+1],a[2]=e[l+2]}function Ve(e,t,r,o){return Oe(e,t,r,Je,Qe,Xe),w(Qe,Qe,Je),w(Xe,Xe,Je),C(Je,Qe,Xe),b(o,Je),o}function $e(e){if(!e)return null;const{scale:t,offset:o,rotation:n}=e;return{scale:t,offset:o,rotation:r(n)}}function Ge(e="repeat"){if("string"==typeof e){const t=De(e);return{s:t,t}}return{s:De(e.horizontal),t:De(e.vertical)}}function De(e){switch(e){case"clamp":return 33071;case"mirror":return 33648;default:return 10497}}function Le(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}function Ne(e,t,r){t.diffuse=e.toUnitRGB(),t.opacity="opaque"===r.alphaMode?1:e.a}function He(e){return e.data??e.url}function ke(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}function ze(e){const{offset:t,scale:r,rotation:o}=e??Ye;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}function qe(e){return e.vertexAttributes.color}function We(e){return 1===(e.material?.color?.a??0)}const Ye=new H,Ke=M(),Je=M(),Qe=M(),Xe=M(),Ze=M(),et=f(),tt=f(),rt=O(),ot=[new L],nt=M();export{Pe as Graphics3DMeshFillSymbolLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import e from"../../../../core/Error.js";import{translate as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as r,create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as o,fromArray as n,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h}from"../../../../chunks/vec32.js";import{fromArray as c,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as m}from"../../../../geometry/projection/projectBuffer.js";import{create as f,fromSubBuffer as d,intersectsClippingArea as u}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as g,doubleArrayFrom as _}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as b}from"../../../../geometry/support/FloatArray.js";import{needsElevationUpdates3D as y,evaluateElevationAlignmentAtPoint as v,SampleElevationInfo as w}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as x}from"./Graphics3DObject3DGraphicLayer.js";import{pathNumRoundJoinSubdivisions as S,pathNumRoundCapExtrusionSubdivisions as C}from"./Graphics3DPathSymbolLayerConstants.js";import{Graphics3DSymbolLayer as P,nanFallbackColor as D}from"./Graphics3DSymbolLayer.js";import{isValidSize as j}from"./graphicUtils.js";import{ConvertOptions as V,initFastSymbolUpdatesState as U,updateFastSymbolUpdatesState as A,getAttributeValue as z}from"../support/FastSymbolUpdates.js";import{SamplePosition as E}from"../../support/ElevationProvider.js";import{Object3D as R}from"../../webgl-engine/lib/Object3D.js";import{Path as k}from"../../webgl-engine/lib/Path.js";import{PathBuilder as L}from"../../webgl-engine/lib/PathBuilder.js";import{RoundCapBuilder as G,TriangulationCapBuilder as O,NoCapBuilder as I}from"../../webgl-engine/lib/PathCapBuilder.js";import{SimpleExtruder as B,MiterExtruder as F}from"../../webgl-engine/lib/PathExtruder.js";import{PathGeometry as M,isPathGeometry as T}from"../../webgl-engine/lib/PathGeometry.js";import{FastUpdatePathGeometry as q,StaticPathGeometry as H}from"../../webgl-engine/lib/PathGeometryData.js";import{computeMinimumRotationTangentFrame as N}from"../../webgl-engine/lib/pathGeometryUtils.js";import{quadProfiles as W,circleProfiles as Z}from"../../webgl-engine/lib/PathProfile.js";import{newPathVertex as J}from"../../webgl-engine/lib/PathVertex.js";import{DefaultMaterial as K}from"../../webgl-engine/materials/DefaultMaterial.js";import{PathMaterial as Q}from"../../webgl-engine/materials/PathMaterial.js";const X=["polyline"];class Y extends P{constructor(e,t,r,i){super(e,t,r,i,ie(t)),this._intrinsicSize=o(1,1),this._upVectorAlignment=1,this._stencilWidth=.1,this.ensureDrapedStatus(!1)}async doLoad(){const t=this.symbolLayer,r=null!=t.width?t.width:t.height,i=null!=t.height?t.height:r;this._vvConvertOptions=new V({supports:{size:!0,color:!0,rotation:!1,opacity:!0},modelSize:[1,1,1],symbolSize:[r,1,i],unitInMeters:this._context.renderCoordsHelper.unitInMeters,fallbackColor:this._getFallbackOpacityAndColor(D),fallbackSize:[r,1,i]});const o=this._context.renderer?.visualVariables;this._fastUpdates=o?.length?U(this._context.renderer,this._vvConvertOptions):null;const l=t.anchor||"center";this._upVectorAlignment="heading"===t.profileRotation?0:1;const h=t.profile||"circle";switch(h){default:case"circle":this._profile=Z[l];break;case"quad":this._profile=W[l]}switch(t.join){case"round":this._extruder=new F(0,S);break;case"bevel":this._extruder=new F(0,1);break;case"miter":this._extruder=new F(.8*Math.PI,1);break;default:this._extruder=new B}switch(this._cap){case"none":this._startCap=new I,this._endCap=new I;break;case"butt":default:this._startCap=new O(this._profile,0),this._endCap=new O(this._profile,0,!0);break;case"square":this._startCap=new O(this._profile,-.5),this._endCap=new O(this._profile,.5,!0);break;case"round":{const e="quad"===h;this._startCap=new G({profile:this._profile,flip:!1,breakNormals:e,subdivisions:C}),this._endCap=new G({profile:this._profile,flip:!0,breakNormals:e,subdivisions:C});break}}const p=this._materialColor,m=this._getCombinedOpacityAndColor(p),f=c(m),d=m[3],u=this.needsDrivenTransparentPass,g=t.material?.emissive,_={diffuse:f,ambient:f,emissiveStrengthFromSymbol:g?.strength??0,emissiveSource:1,opacity:d,drivenOpacity:u,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(s(this._intrinsicSize,r,i),!j(this._intrinsicSize[0])||!j(this._intrinsicSize[1])))throw new e("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");let b;this._fastUpdates?.visualVariables.size||a(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates?b=new Q({..._,...this._fastUpdates.materialParameters,size:n(this._intrinsicSize)},this._context):(_.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,_.normalType=1,b=new K(_,this._context)),b.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._materials[0]=b,this._updateTransparentDepedentMaterialParameters()}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,X,this.symbolLayer.type))return null;const r=this.createElevationContextForGraphic(t);return this._createAs3DShape(e,r)}layerOpacityChanged(){const e=this._materialColor,t=this._getCombinedOpacity(e),r=this._materials[0];r&&(r.setParameters({opacity:t}),this._updateTransparentDepedentMaterialParameters())}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,y)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!A(this._fastUpdates,t,this._vvConvertOptions))return 0;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return 2}_getVertexData(e){let t=0;const r=e.paths,i=[],s=e.spatialReference,a=this._context.elevationProvider.spatialReference,o=this._context.renderCoordsHelper.spatialReference;for(const c of r)t+=c.length;const n=g(3*t);let l,h=0;for(const c of r){i.push({offset:h,numVertices:c.length});for(const t of c)n[h++]=t[0],n[h++]=t[1],n[h++]=e.hasZ?t[2]:0}return null==a||s.equals(a)||m(n,s,0,n,a,0,t)?(null==a||a.equals(o)?l=_(n):(l=g(3*t),m(n,a,0,l,o,0,t)),{pathVertexDataInfos:i,vertexDataES:n,vertexDataRS:l}):null}_createAs3DShape(e,s){const{graphic:a,renderingInfo:o}=e,n=a.geometry,c=this._getVertexData(n);if(null==c)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(0===c.pathVertexDataInfos.length)return 0!==n.paths.length&&n.paths.some(e=>e.length>0)||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),null;const p=new Array,m=n.spatialReference,g=f(),_=this._context.renderCoordsHelper,w=new E(c.vertexDataES),S=a.uid,C=b(c.vertexDataRS.length);for(const f of c.pathVertexDataInfos){const e=f.numVertices;if(e<2)continue;const n=f.offset;if(null!=this._context.clippingExtent&&(d(c.vertexDataES,n,e,g),!u(g,this._context.clippingExtent)))continue;const b=new Array,y=n+3*e;for(let t=n;t<y;t+=3){w.offset=t;const e=v(w,this._context.elevationProvider,s,_);h(se,c.vertexDataRS[t],c.vertexDataRS[t+1],c.vertexDataRS[t+2]),_.setAltitude(se,e),c.vertexDataRS[t]=se[0],c.vertexDataRS[t+1]=se[1],c.vertexDataRS[t+2]=se[2],b.push(J(this._upVectorAlignment))}const x=new k(b,c.vertexDataES,c.vertexDataRS,n,C);$(x,this._upVectorAlignment,this._context.renderCoordsHelper);const P=new L(x,this._profile,this._extruder,this._startCap,this._endCap);let D=null;if(this._fastUpdates){const e=this._fastUpdates.visualVariables,t=z(e.size?.field,a),r=z(e.color?.field,a),i=z(e.opacity?.field,a);D=new q(P,t,r,i)}else{const e=l(this._intrinsicSize);if(this._drivenProperties.size){const t=o.size??["symbol-value","symbol-value","symbol-value"];e[0]*=ee(t[0],"symbol-value"===t[2]?this.symbolLayer.height||0:t[2],this.symbolLayer.width||0),e[1]*=ee(t[2],"symbol-value"===t[0]?this.symbolLayer.width||0:t[0],this.symbolLayer.height||0)}const t=new H(P);t.bake(e);const r=this._getDrivenColor(o);r&&t.bakeVertexColors(r),D=t}const j=D.createGeometryData(),V=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:S,layerViewUid:this._context.layerViewUid}),U=new M(this._materials[0],j,D,m,this._stencilWidth,V);U.transformation=t(i(),r,P.path.origin),p.push(U)}if(0===p.length)return null;const P=new R({geometries:p,layerViewUid:this._context.layerViewUid,graphicUid:S}),D=new x(this,P,null,(e,t,r,i,s)=>re(e,t,i,s,this._upVectorAlignment),s,null);return D.alignedSampledElevation=0,D.needsElevationUpdates=y(s.mode),D}_getDrivenColor(e){return this._hasDrivenColorOrOpacity?this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!1):null}get _materialColor(){return this.symbolLayer.material?.color}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}get _cap(){return this.symbolLayer.cap||"butt"}_updateTransparentDepedentMaterialParameters(){const e=this._materials[0];e&&e.setParameters({cullFace:e.transparent||"none"===this._cap?0:2})}}function $(e,t,r){const{origin:i,positions:s}=e;let a=e.offset;switch(t){default:case 0:for(const t of e.vertices)se[0]=s[a++]+i[0],se[1]=s[a++]+i[1],se[2]=s[a++]+i[2],r.worldUpAtPosition(se,se),t.setFrameFromUpVector(se);break;case 1:se[0]=s[a]+i[0],se[1]=s[a+1]+i[1],se[2]=s[a+2]+i[2],r.worldUpAtPosition(se,se),N(e,se)}}function ee(e,t,r){switch(e){case"symbol-value":return r;case"proportional":return t;default:return e}}function te(e,t,r,i){let s=0;const{origin:a,vertices:o,positions:n,positionsES:l}=e,c=e.offset+3*o.length;for(let p=e.offset;p<c;p+=3)h(se,l[p],l[p+1],l[p+2]),r(se,ae),s+=ae.sampledElevation,se[0]=n[p]+a[0],se[1]=n[p+1]+a[1],se[2]=n[p+2]+a[2],i.setAltitude(se,ae.z),n[p]=se[0]-a[0],n[p+1]=se[1]-a[1],n[p+2]=se[2]-a[2];return e.updatePathVertexInformation(),s/o.length}function re(e,t,r,i,s){const a=e.stageObject,o=a.geometries;let n=0;for(const l of o){if(!T(l))continue;const e=l.path,o=e.builder.path;n+=te(o,t,r,i),0!==s&&$(o,s,i),e.onPathChanged(l),l.invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(l,"position")}return n/o.length}function ie(e){return 1===(e.material?.color?.a??0)}const se=p(),ae=new w;export{Y as Graphics3DPathSymbolLayer};
|
|
5
|
+
import e from"../../../../core/Error.js";import{translate as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as r,create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as o,fromArray as n,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h}from"../../../../chunks/vec32.js";import{fromArray as c,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as m}from"../../../../geometry/projection/projectBuffer.js";import{create as f,fromSubBuffer as d,intersectsClippingArea as u}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as g,doubleArrayFrom as _}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as b}from"../../../../geometry/support/FloatArray.js";import{needsElevationUpdates3D as y,evaluateElevationAlignmentAtPoint as v,SampleElevationInfo as w}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as x}from"./Graphics3DObject3DGraphicLayer.js";import{pathNumRoundJoinSubdivisions as S,pathNumRoundCapExtrusionSubdivisions as C}from"./Graphics3DPathSymbolLayerConstants.js";import{Graphics3DSymbolLayer as P,nanFallbackColor as D}from"./Graphics3DSymbolLayer.js";import{isValidSize as j}from"./graphicUtils.js";import{ConvertOptions as V,initFastSymbolUpdatesState as U,updateFastSymbolUpdatesState as A,getAttributeValue as z}from"../support/FastSymbolUpdates.js";import{SamplePosition as E}from"../../support/ElevationProvider.js";import{Object3D as R}from"../../webgl-engine/lib/Object3D.js";import{Path as k}from"../../webgl-engine/lib/Path.js";import{PathBuilder as L}from"../../webgl-engine/lib/PathBuilder.js";import{RoundCapBuilder as G,TriangulationCapBuilder as O,NoCapBuilder as I}from"../../webgl-engine/lib/PathCapBuilder.js";import{SimpleExtruder as B,MiterExtruder as F}from"../../webgl-engine/lib/PathExtruder.js";import{PathGeometry as M,isPathGeometry as T}from"../../webgl-engine/lib/PathGeometry.js";import{FastUpdatePathGeometry as q,StaticPathGeometry as H}from"../../webgl-engine/lib/PathGeometryData.js";import{computeMinimumRotationTangentFrame as N}from"../../webgl-engine/lib/pathGeometryUtils.js";import{quadProfiles as W,circleProfiles as Z}from"../../webgl-engine/lib/PathProfile.js";import{newPathVertex as J}from"../../webgl-engine/lib/PathVertex.js";import{DefaultMaterial as K}from"../../webgl-engine/materials/DefaultMaterial.js";import{PathMaterial as Q}from"../../webgl-engine/materials/PathMaterial.js";const X=["polyline"];class Y extends P{constructor(e,t,r,i){super(e,t,r,i,ie(t)),this._intrinsicSize=o(1,1),this._upVectorAlignment=1,this._stencilWidth=.1,this.ensureDrapedStatus(!1)}async doLoad(){const t=this.symbolLayer,r=null!=t.width?t.width:t.height,i=null!=t.height?t.height:r;this._vvConvertOptions=new V({supports:{size:!0,color:!0,rotation:!1,opacity:!0},modelSize:[1,1,1],symbolSize:[r,1,i],unitInMeters:this._context.renderCoordsHelper.unitInMeters,fallbackColor:this._getFallbackOpacityAndColor(D),fallbackSize:[r,1,i]});const o=this._context.renderer?.visualVariables;this._fastUpdates=o?.length?U(this._context.renderer,this._vvConvertOptions):null;const l=t.anchor||"center";this._upVectorAlignment="heading"===t.profileRotation?0:1;const h=t.profile||"circle";switch(h){default:case"circle":this._profile=Z[l];break;case"quad":this._profile=W[l]}switch(t.join){case"round":this._extruder=new F(0,S);break;case"bevel":this._extruder=new F(0,1);break;case"miter":this._extruder=new F(.8*Math.PI,1);break;default:this._extruder=new B}switch(this._cap){case"none":this._startCap=new I,this._endCap=new I;break;case"butt":default:this._startCap=new O(this._profile,0),this._endCap=new O(this._profile,0,!0);break;case"square":this._startCap=new O(this._profile,-.5),this._endCap=new O(this._profile,.5,!0);break;case"round":{const e="quad"===h;this._startCap=new G({profile:this._profile,flip:!1,breakNormals:e,subdivisions:C}),this._endCap=new G({profile:this._profile,flip:!0,breakNormals:e,subdivisions:C});break}}const p=this._materialColor,m=this._getCombinedOpacityAndColor(p),f=c(m),d=m[3],u=this.needsDrivenTransparentPass,g=t.material?.emissive,_={diffuse:f,ambient:f,emissiveStrengthFromSymbol:g?.strength??0,emissiveSource:1,opacity:d,drivenOpacity:u,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(s(this._intrinsicSize,r,i),!j(this._intrinsicSize[0])||!j(this._intrinsicSize[1])))throw new e("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");let b;this._fastUpdates?.visualVariables.size||a(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates?b=new Q({..._,...this._fastUpdates.materialParameters,size:n(this._intrinsicSize)},this._context):(_.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,_.normalType=1,b=new K(_,this._context)),b.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._materials[0]=b,this._updateTransparentDepedentMaterialParameters()}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,X,this.symbolLayer.type))return null;const r=this.createElevationContextForGraphic(t);return this._createAs3DShape(e,r)}layerOpacityChanged(){const e=this._materialColor,t=this._getCombinedOpacity(e),r=this._materials[0];r&&(r.setParameters({opacity:t}),this._updateTransparentDepedentMaterialParameters())}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,y)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!A(this._fastUpdates,t,this._vvConvertOptions))return 0;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return 2}_getVertexData(e){let t=0;const r=e.paths,i=[],s=e.spatialReference,a=this._context.elevationProvider.spatialReference,o=this._context.renderCoordsHelper.spatialReference;for(const c of r)t+=c.length;const n=g(3*t);let l,h=0;for(const c of r){i.push({offset:h,numVertices:c.length});for(const t of c)n[h++]=t[0],n[h++]=t[1],n[h++]=e.hasZ?t[2]:0}return null==a||s.equals(a)||m(n,s,0,n,a,0,t)?(null==a||a.equals(o)?l=_(n):(l=g(3*t),m(n,a,0,l,o,0,t)),{pathVertexDataInfos:i,vertexDataES:n,vertexDataRS:l}):null}_createAs3DShape(e,s){const{graphic:a,renderingInfo:o}=e,n=a.geometry,c=this._getVertexData(n);if(null==c)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(0===c.pathVertexDataInfos.length)return 0!==n.paths.length&&n.paths.some(e=>e.length>0)||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),null;const p=new Array,m=n.spatialReference,g=f(),_=this._context.renderCoordsHelper,w=new E(c.vertexDataES),S=a.uid,C=b(c.vertexDataRS.length);for(const f of c.pathVertexDataInfos){const e=f.numVertices;if(e<2)continue;const n=f.offset;if(null!=this._context.clippingExtent&&(d(c.vertexDataES,n,e,g),!u(g,this._context.clippingExtent)))continue;const b=new Array,y=n+3*e;for(let t=n;t<y;t+=3){w.offset=t;const e=v(w,this._context.elevationProvider,s,_);h(se,c.vertexDataRS[t],c.vertexDataRS[t+1],c.vertexDataRS[t+2]),_.setAltitude(se,e),c.vertexDataRS[t]=se[0],c.vertexDataRS[t+1]=se[1],c.vertexDataRS[t+2]=se[2],b.push(J(this._upVectorAlignment))}const x=new k(b,c.vertexDataES,c.vertexDataRS,n,C);$(x,this._upVectorAlignment,this._context.renderCoordsHelper);const P=new L(x,this._profile,this._extruder,this._startCap,this._endCap);let D=null;if(this._fastUpdates){const e=this._fastUpdates.visualVariables,t=z(e.size?.field,a),r=z(e.color?.field,a),i=z(e.opacity?.field,a);D=new q(P,t,r,i)}else{const e=l(this._intrinsicSize);if(this._drivenProperties.size){const t=o.size??["symbol-value","symbol-value","symbol-value"];e[0]*=ee(t[0],"symbol-value"===t[2]?this.symbolLayer.height||0:t[2],this.symbolLayer.width||0),e[1]*=ee(t[2],"symbol-value"===t[0]?this.symbolLayer.width||0:t[0],this.symbolLayer.height||0)}const t=new H(P);t.bake(e);const r=this._getDrivenColor(o);r&&t.bakeVertexColors(r),D=t}const j=D.createGeometryData(),V=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:S,layerViewUid:this._context.layerViewUid}),U=new M(this._materials[0],j,D,m,this._stencilWidth,V);U.transformation=t(i(),r,P.path.origin),p.push(U)}if(0===p.length)return null;const P=new R({geometries:p,layerViewUid:this._context.layerViewUid,graphicUid:S}),D=new x(this,P,null,(e,t,r,i,s)=>re(e,t,i,s,this._upVectorAlignment),s,null);return D.alignedSampledElevation=0,D.needsElevationUpdates=y(s.mode),D}_getDrivenColor(e){return this._hasDrivenColorOrOpacity?this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!1):null}get _materialColor(){return this.symbolLayer.material?.color}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}get _cap(){return this.symbolLayer.cap||"butt"}_updateTransparentDepedentMaterialParameters(){const e=this._materials[0];e&&e.setParameters({cullFace:e.transparent||"none"===this._cap?0:2})}}function $(e,t,r){const{origin:i,positions:s}=e;let a=e.offset;switch(t){default:case 0:for(const t of e.vertices)se[0]=s[a++]+i[0],se[1]=s[a++]+i[1],se[2]=s[a++]+i[2],r.worldUpAtPosition(se,se),t.setFrameFromUpVector(se);break;case 1:se[0]=s[a]+i[0],se[1]=s[a+1]+i[1],se[2]=s[a+2]+i[2],r.worldUpAtPosition(se,se),N(e,se)}}function ee(e,t,r){switch(e){case"symbol-value":return r;case"proportional":return t;default:return e}}function te(e,t,r,i){let s=0;const{origin:a,vertices:o,positions:n,positionsES:l}=e,c=e.offset+3*o.length;for(let p=e.offset;p<c;p+=3)h(se,l[p],l[p+1],l[p+2]),r(se,ae),s+=ae.sampledElevation,se[0]=n[p]+a[0],se[1]=n[p+1]+a[1],se[2]=n[p+2]+a[2],i.setAltitude(se,ae.z),n[p]=se[0]-a[0],n[p+1]=se[1]-a[1],n[p+2]=se[2]-a[2];return e.updatePathVertexInformation(),s/o.length}function re(e,t,r,i,s){const a=e.stageObject,o=a.geometries;let n=0;for(const l of o){if(!T(l))continue;const e=l.path,o=e.builder.path;n+=te(o,t,r,i),0!==s&&$(o,s,i),e.onPathChanged(l),l.invalidateBoundingInfo(),a.geometryVertexAttributeUpdated(l,"position")}return n/o.length}function ie(e){return 1===(e.material?.color?.a??0)}const se=p(),ae=new w;export{Y as Graphics3DPathSymbolLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import e from"../../../../core/Logger.js";import{ONES as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as r,s as i}from"../../../../chunks/vec42.js";import{fromValues as o,ONES as n,ZEROS as s,fromArray as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{closeRings as l}from"../../../../geometry/support/coordsUtils.js";import{defaultSymbolLayerComplexity as p}from"./defaultSymbolComplexity.js";import{ElevationContext as c}from"./ElevationContext.js";import{zeroContext as d}from"./featureExpressionInfoUtils.js";import{mixinColorAndOpacity as h}from"./graphicUtils.js";import{Loadable as u}from"./Loadable.js";import{getAttributeValue as y}from"../support/FastSymbolUpdates.js";import{encodeNaNUInt8 as f}from"../support/symbolColorUtils.js";const g=()=>e.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer");class v extends u{constructor(e,t,r,i,o=!0){super(r.schedule),this.symbol=e,this.symbolLayer=t,this._context=r,this._drivenOpacityFallbackAlwaysOpaque=o,this.ignoreDrivers=!1,this._drivenProperties={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1,rotation:!1},this._materials=[],this.logger=g(),this._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0},this.skipHighSymbolLodsChanged=!0,this._renderPriority=i.renderPriority,this._renderPriorityStep=i.renderPriorityStep,this._elevationContext=new c,this.updateComplexity(),this.ignoreDrivers=i.ignoreDrivers,this.ignoreDrivers||(this._drivenProperties=m(this._context.renderer,o)),this._updateElevationContext()}destroy(){this.complexity=null,this._materials.length=0,super.destroy()}get view(){return this._context.stage.view}getCachedSize(){return null}get extentPadding(){return 0}get materials(){return this._materials}get estimatedMemory(){const{complexity:e}=this;if(null==e)return 0;return(this.draped?e.memory.draped:e.memory).bytesPerFeature}get usedMemory(){return this.estimatedMemory}_drivenPropertiesChanged(e){if(this.ignoreDrivers)return!1;const t=this._drivenProperties,r=m(e,this._drivenOpacityFallbackAlwaysOpaque);return r.color!==t.color||r.opacity!==t.opacity||r.opacityAlwaysOpaque!==t.opacityAlwaysOpaque||r.size!==t.size||r.rotation!==t.rotation}get needsDrivenTransparentPass(){return this._hasDrivenColorOrOpacity&&!this._drivenProperties.opacityAlwaysOpaque}get _hasDrivenColorOrOpacity(){return this._drivenProperties.color||this._drivenProperties.opacity}_logGeometryCreationWarnings(e,t,r,i){const o=e.projectionSuccess,n="polygons"in e?e.polygons:null,s=`${i} geometry failed to be created`;o?!this._logGeometryValidationWarnings(t,r,i)&&0===n?.length&&"rings"===r&&t.length>0&&t[0].length>2&&g().warnOncePerTick(`${s} (filled rings should use clockwise winding - try reversing the order of vertices)`):g().warnOncePerTick(`${s} (failed to project geometry to view spatial reference)`)}get needsUpdateFocus(){return!1}_logGeometryValidationWarnings(e,t,r){const i=`${r} geometry failed to be created`;return!e.length||1===e.length&&!e[0].length?(g().warnOncePerTick(`${i} (no ${t} were defined)`),!0):(!Array.isArray(e)||!Array.isArray(e[0]))&&(g().warnOncePerTick(`${i} (${t} should be defined as a 2D array)`),!0)}_validateGeometry(e,t=null,r=null){if(null!=t&&!t.includes(e.type))return this.logger.warn("unsupported geometry type for "+r+` symbol: ${e.type}`),!1;switch(e.type){case"point":{const t=e;if(!isFinite(t.x)||!isFinite(t.y))return g().warn("point coordinate is not a valid number, graphic skipped"),!1;break}case"polygon":l(e)}return!0}_defaultElevationInfoNoZ(){return _}_defaultElevationInfoZ(){return x}_updateElevationContext(){null!=this._elevationInfoOverride?(this._elevationContext.setFromElevationInfo(this._elevationInfoOverride),this._elevationContext.setFeatureExpressionInfoContext(null)):this._context.layer.elevationInfo?(this._elevationContext.setFromElevationInfo(this._context.layer.elevationInfo),this._elevationContext.setFeatureExpressionInfoContext(this._context.featureExpressionInfoContext)):this._elevationContext.reset()}getDefaultElevationInfo(e){return e.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ()}getGeometryElevationMode(e,t=this.getDefaultElevationInfo(e)){return this._elevationContext.mode||t.mode}setElevationInfoOverride(e){this._elevationInfoOverride=e,this._updateElevationContext()}createElevationContextForGraphic(e){const t=new c;return this.updateElevationContextForGraphic(t,e),t}updateElevationContextForGraphic(e,t){const r=t.geometry,i=this.getDefaultElevationInfo(r);e.unit=null!=this._elevationContext.unit?this._elevationContext.unit:i.unit,e.mode=this.getGeometryElevationMode(r,i),e.offsetMeters=this._elevationContext.meterUnitOffset??i.offset??0;const o=!this._elevationOptions.supportsOnTheGround&&"on-the-ground"===e.mode;o&&(e.mode="relative-to-ground",e.offsetMeters=0);const n=o?d:this._elevationContext.featureExpressionInfoContext;n?e.updateFeatureExpressionInfoContextForGraphic(n,t,this._context.layer):e.setFeatureExpressionInfoContext(null)}prepareSymbolLayerPatch(e){}onRemoveGraphic(e){}_getLayerOpacity(){if(this._context.graphicsCoreOwner&&"fullOpacity"in this._context.graphicsCoreOwner)return this._context.graphicsCoreOwner.fullOpacity??0;const e=this._context.layer.opacity;return e??1}_getCombinedOpacity(e,t=C){const r=this.draped?1:this._getLayerOpacity();return this._drivenProperties.color?r:e?r*(this._drivenProperties.opacity?1:e.a):t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(e,r=C){const i=this._getCombinedOpacity(e,r);if(this._drivenProperties.color)return h(null,i);const o=e?.toUnitRGB()??t;return h(o,i)}_getDrivenUInt8Color({color:e,opacity:t},r,i){const{color:o,opacity:a}=this._drivenProperties,l=r?.toUnitRGBA()??(i?n:s),p=o?e??l:null,c=e||r||i,d=o?null:l[3];return h(p,a&&c?t??d:null,255)}_getDrivenUInt8ColorWithNaNSupport({color:e,opacity:t},n,s){const l=n?a(n.toUnitRGBA()):o(NaN,NaN,NaN,s?NaN:0);return this._drivenProperties.color&&null!=e&&r(l,e),this._drivenProperties.opacity&&null!=t&&(l[3]=t),i(l,l,255),f(l,l)}isFastUpdatesEnabled(){return null!=this._fastUpdates}updateComplexity(){this.complexity=this.computeComplexity()}computeComplexity(){return p(this.symbol,this.symbolLayer)}globalPropertyChanged(e,t,r){switch(e){case"opacity":return this.layerOpacityChanged(t,r),!0;case"screenSizePerspectiveEnabled":return this.layerScreenSizePerspectiveChanged(t,r),!0;case"elevationInfo":{const e=this._elevationContext.mode;this._updateElevationContext();return 2!==this.layerElevationInfoChanged(t,r,e)}case"slicePlaneEnabled":return this.slicePlaneEnabledChanged(t,r);case"physicalBasedRenderingEnabled":return this.physicalBasedRenderingChanged();case"pixelRatio":return this.pixelRatioChanged;case"skipHighSymbolLods":return this.skipHighSymbolLodsChanged;case"terrainTransparency":return this.terrainTransparencyChanged();default:return!1}}terrainTransparencyChanged(){return!0}get pixelRatioChanged(){return!0}updateGraphics3DGraphicElevationInfo(e,t,r){let i=1;return e?.forEach(e=>{const o=t(e);if(null!=o){const t=e.graphic;this.updateElevationContextForGraphic(o.elevationContext,t),o.needsElevationUpdates=r(o.elevationContext.mode)}else i=2}),i}applyRendererDiff(e,t){return 0}getFastUpdateAttrValues(e){if(!this._fastUpdates)return null;const t=this._fastUpdates.visualVariables,r=t.size?y(t.size.field,e):0,i=t.color?y(t.color.field,e):0,n=t.opacity?y(t.opacity.field,e):0;return o(r,i,n,0)}get draped(){return this._draped}ensureDrapedStatus(e){return null==this._draped?(this._draped=e,!0):(e!==this.draped&&g().warnOnce("A symbol can only produce either draped or non-draped visualizations. Use two separate symbol instances for draped and non-draped graphics if necessary."),!1)}test(){const e=()=>({size:this._fastUpdates?.visualVariables.size?.field??null,color:this._fastUpdates?.visualVariables.color?.field??null,opacity:this._fastUpdates?.visualVariables.opacity?.field??null,rotation:this._fastUpdates?.visualVariables.rotation?.field??null});return{drivenProperties:this._drivenProperties,getVisVarFields:e}}}function m(e,t){const r={color:!1,opacity:!1,opacityAlwaysOpaque:t,size:!1,rotation:!1};return e&&"visualVariables"in e&&e.visualVariables&&e.visualVariables.forEach(e=>{switch(e.type){case"color":if(r.color=!0,e.stops)for(let t=0;t<e.stops.length;t++){const i=e.stops[t].color;i&&i.a<1&&(r.opacityAlwaysOpaque=!1)}break;case"opacity":r.opacity=!0,r.opacityAlwaysOpaque=!1;break;case"size":r.size=!0;break;case"rotation":r.rotation=!0}}),r}const _={mode:"on-the-ground",offset:0,unit:"meters"},x={mode:"absolute-height",offset:0,unit:"meters"},C={hasIntrinsicColor:!1},b=o(NaN,NaN,NaN,NaN);export{v as Graphics3DSymbolLayer,m as getDrivenProperties,b as nanFallbackColor};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import e from"../../../../core/Logger.js";import{d as t,h as n,b as r}from"../../../../chunks/vec32.js";import{ZEROS as l,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,center as s,height as i}from"../../../../geometry/support/aaBoundingBox.js";import{labelMarginPx as o}from"./constants.js";import{getGraphics3DSymbol as f}from"./graphicSymbolUtils.js";import{LabelPlacement as m}from"./LabelParameters.js";import{textVerticalPaddingPx as h}from"../../webgl-engine/lib/TextRenderer.js";import{HUDMaterial as p}from"../../webgl-engine/materials/HUDMaterial.js";const u=()=>e.getLogger("esri.views.3d.layers.graphics.labelPlacement");class b{constructor(e,t,n,r=null){this._graphic=e,this._symbol=t,this._class=n,this._disablePlacement=r}get placement(){const e=this._verticalOffsetPlacement;if(null==e)return null;const t=this._getPlacementInfo(e);if(null==t)return null;const n=t.anchor,r=!!e.hasLabelVerticalOffset,l=e.verticalOffset,a=new m(l,n,r);return this._calculatePlacementOffsets(a,t)}get _verticalOffsetPlacement(){const e=this._class.labelPlacement,{_symbol:t,_graphic:n}=this,r=f(n.graphics3DSymbol),l="point-3d"===r?.symbol.type?r.symbol:null,a=P[e]||this._defaultPlacementInfo;return l?.supportsCallout()&&l.hasVisibleVerticalOffset()&&!n.isDraped?{placement:null,hasLabelVerticalOffset:!1,verticalOffset:l.verticalOffset.clone(),anchor:null,normalizedOffset:null}:!t?.hasVisibleVerticalOffset()||null!=l&&l.supportsCallout()&&l.verticalOffset&&!n.isDraped?{placement:null,verticalOffset:null,anchor:null,normalizedOffset:null,hasLabelVerticalOffset:!1}:a&&d(a.placement)?{placement:"above-center",verticalOffset:t.verticalOffset.clone(),anchor:"bottom",normalizedOffset:[0,a.normalizedOffset[1],0],hasLabelVerticalOffset:!0}:(u().errorOncePerTick("Callouts and vertical offset on labels are currently only supported with 'above-center' label placement (not with "+e+" placement)"),null)}_getPlacementInfo(e){if(e.anchor)return e;const t=this._class.labelPlacement,n=P[t],r=n||this._defaultPlacementInfo;return t&&!n&&u().warnOnce(`the requested label placement '${t}' is currently unsupported in SceneView.`),this._validatePlacementInfo(r)}_calculatePlacementOffsets(e,t){const n=this._graphic.graphic.geometry;if(null==n)return null;switch(n.type){case"point":this._setPointSpecificPlacement(e,t);break;case"mesh":this._setMeshSpecificPlacement(e,t);break;case"polygon":this._setPolygonSpecificPlacement(e,t)}const r=o-h;return e.screenOffset[0]+=r*t.normalizedOffset[0],e.screenOffset[1]+=r*t.normalizedOffset[1],e}get _defaultPlacementInfo(){const e=this._graphic.graphic.geometry;if(null==e)return null;switch(e.type){case"polyline":case"extent":case"multipoint":return{placement:"center-center",normalizedOffset:l,anchor:"center"};case"polygon":{const e=this._firstSymbolLayer;return"extrude"===e?.type?P["above-center"]:{placement:"center-center",normalizedOffset:l,anchor:"center"}}case"point":case"mesh":return P["above-center"];default:return}}_validatePlacementInfo(e){const t=this._graphic.graphic.geometry;if(null==t)return null;if(null!=this._disablePlacement){const t=this._class.labelPlacement;return t?(u().warnOncePerTick(g(t,this._disablePlacement.logEntityDescription)),this._defaultPlacementInfo):e}const n=t.type;switch(n){case"polyline":case"polygon":case"extent":case"multipoint":{const e=this._class.labelPlacement;if(e)return P[e]&&u().warnOnce(g(e,`'${n}' geometries`)),this._defaultPlacementInfo;break}case"point":case"mesh":return e}return e}_setPointSpecificPlacement(e,r){const l=this._firstSymbolLayer;if(null==l)return;const a=this._graphic.layers[0];switch(null!=a?t(e.translation,a.getCenterObjectSpace()):n(e.translation,0,0,0),l.type){case"icon":case"text":this._setHUDSpecificPlacement(e,r,a);break;case"object":O(e,r,a)}}_setMeshSpecificPlacement(e,t){const n=this._firstSymbolLayer;if(null!=n&&"fill"===n.type){O(e,t,this._graphic.layers[0])}}_setPolygonSpecificPlacement(e,t){const r=this._firstSymbolLayer;if(null!=r)switch(r.type){case"extrude":{const r=this._graphic.layers[0];null!=r?(r.getBoundingBoxObjectSpace(v),s(v,e.translation),e.translation[2]=i(v)/2):n(e.translation,0,0,0),O(e,t,r);break}}}_setHUDSpecificPlacement(e,t,n){const r=null!=n?n.getScreenSize():null;if(this._graphic.isDraped||null==r)e.hasLabelVerticalOffset||"center"===e.anchor||(P[this._class.labelPlacement]&&u().warnOncePerTick(`the requested placement '${t.placement}' is currently unsupported for draped graphics`),e.anchor="center");else{const n=this._normalizedSymbolAnchorPos;e.screenOffset[0]=r[0]/2*(t.normalizedOffset[0]-n[0]);const l=r[1]/2*(t.normalizedOffset[1]-n[1]);e.hasLabelVerticalOffset?(e.centerOffset[1]=l,e.centerOffsetUnits="screen"):e.screenOffset[1]=l}}get _firstSymbolLayer(){const e=this._graphic.graphics3DSymbol,t=f(e);return null!=t?t.symbol.symbolLayers.at(0):null}get _normalizedSymbolAnchorPos(){const e=this._graphic.layers[0],t=e?.stageObject.geometries[0].material??null;if(t&&t instanceof p){const e=t.parameters.anchorPosition;_[0]=2*(e[0]-.5),_[1]=2*(e[1]-.5)}else _[0]=0,_[1]=0;return _}}function g(e,t){return`the requested label placement '${e}' is currently unsupported for ${t} in SceneView.`}function O(e,t,n){const l=null!=n?n.getBoundingBoxObjectSpace(v):v,c=a(l[3]-l[0],l[4]-l[1],l[5]-l[2]),s=Math.sqrt(c[0]*c[0]+c[1]*c[1]);e.centerOffset[0]=s/2*t.normalizedOffset[0];const i=e.translation[2],o=c[2]/2*t.normalizedOffset[1];e.translation[2]=0,e.elevationOffset=i+o;const f=r(c);e.centerOffset[2]=f/2*t.normalizedOffset[2]}function d(e){return"above-center"===e}const P={"above-center":{placement:"above-center",normalizedOffset:[0,1,0],anchor:"bottom"},"above-left":{placement:"above-left",normalizedOffset:[-1,1,0],anchor:"bottom-right"},"above-right":{placement:"above-right",normalizedOffset:[1,1,0],anchor:"bottom-left"},"below-center":{placement:"below-center",normalizedOffset:[0,-1,2],anchor:"top"},"below-left":{placement:"below-left",normalizedOffset:[-1,-1,0],anchor:"top-right"},"below-right":{placement:"below-right",normalizedOffset:[1,-1,0],anchor:"top-left"},"center-center":{placement:"center-center",normalizedOffset:[0,0,1],anchor:"center"},"center-left":{placement:"center-left",normalizedOffset:[-1,0,0],anchor:"right"},"center-right":{placement:"center-right",normalizedOffset:[1,0,0],anchor:"left"}},y={"above-center":["default","esriServerPointLabelPlacementAboveCenter"],"above-left":["esriServerPointLabelPlacementAboveLeft"],"above-right":["esriServerPointLabelPlacementAboveRight"],"below-center":["esriServerPointLabelPlacementBelowCenter"],"below-left":["esriServerPointLabelPlacementBelowLeft"],"below-right":["esriServerPointLabelPlacementBelowRight"],"center-center":["esriServerPointLabelPlacementCenterCenter"],"center-left":["esriServerPointLabelPlacementCenterLeft"],"center-right":["esriServerPointLabelPlacementCenterRight"]};for(const S in y){const e=y[S],t=P[S];e.forEach(e=>{P[e]=t})}Object.freeze&&(Object.freeze(P),Object.keys(P).forEach(e=>{Object.freeze(P[e]),Object.freeze(P[e]?.normalizedOffset)}));const _=[0,0],v=c();export{b as LabelInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import has from"../../../../core/has.js";import{defaultObjectPrimitive as e}from"../../../../symbols/support/primitives.js";import{pathNumCircleProfileSubdivisions as r,pathNumRoundJoinSubdivisions as t,pathNumRoundCapExtrusionSubdivisions as a}from"./Graphics3DPathSymbolLayerConstants.js";import{primitiveLodResources as s}from"./primitiveObjectSymbolUtils.js";import{EstimatedSymbolComplexity as u,SymbolComplexityMemory as o,EstimatedAggregateSymbolComplexity as b,AggregateSymbolComplexity as i,SymbolComplexity as y}from"./SymbolComplexity.js";import{hasEdges as n}from"../support/edgeUtils.js";import{DefaultMaterial as c}from"../../webgl-engine/materials/DefaultMaterial.js";const P=new u({});function l(e){if("web-style"===e.type)return P;return F(e.symbolLayers.toArray().map(r=>p(e,r)))}function F(e){let r=0,t=0,a=0,s=!1,u=0;const y=new o;for(const o of e)null!=o&&(r+=o.verticesPerFeature,t+=o.verticesPerCoordinate,a+=o.drawCallsPerFeature,y.bytesPerFeature+=o.memory.bytesPerFeature,y.bytesPerFeatureLabel+=o.memory.bytesPerFeatureLabel,y.resourceBytes+=o.memory.resourceBytes,y.draped.bytesPerFeature+=o.memory.bytesPerFeature,y.draped.bytesPerFeatureLabel+=o.memory.bytesPerFeatureLabel,s=s||o.estimated,++u);return s?new b(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:y}):new i(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:y})}function m(e){const r=F(e);return r.numComplexities>0&&(r.verticesPerFeature/=r.numComplexities,r.verticesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.resourceBytes/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities),r}const d={};function p(s,o){const b=L(s,o),i=n(o)?2:0;switch(o.type){case"extrude":return new y({verticesPerFeature:-12,verticesPerCoordinate:12,drawCallsPerFeature:i,memory:b});case"fill":if("mesh-3d"===s.type)return new y({drawCallsPerFeature:i,memory:b});if(null!=o.outline&&o.outline.size>0)return new y({verticesPerFeature:-12,verticesPerCoordinate:9,memory:b});case"water":return new y({verticesPerFeature:-6,verticesPerCoordinate:3,memory:b});case"line":return new y({verticesPerFeature:-6,verticesPerCoordinate:6,memory:b});case"object":return o.resource?.href?new u({verticesPerFeature:100,memory:b}):{...C(o.resource?.primitive??e),memory:b};case"path":{let e=0,s=0;switch(o.profile){case"circle":e=r;break;case"quad":e=4;break;default:return void o.profile}switch(o.join){case"round":s=t;break;case"miter":case"bevel":s=1;break;default:return}const u=2*e,i=e*s*2,n=i+u;let c=-2*i-u;switch(o.cap){case"none":break;case"butt":case"square":c+=2*(e-1);break;case"round":c+=2*(e*(a-1)*2+e);break;default:return}return new y({verticesPerFeature:c,verticesPerCoordinate:n,memory:b})}case"text":{const e="label-3d"===s.type?0:2;return new y({verticesPerFeature:6,memory:b,drawCallsPerFeature:e})}case"icon":return new y({verticesPerFeature:6,memory:b});default:return}}function L(e,r){const t="point-3d"===e.type;switch(r.type){case"extrude":return r.edges&&r.edges.size>0?w.EXTRUDE_EDGES:w.EXTRUDE;case"fill":return null!=r.outline&&r.outline.size>0?w.FILL_OUTLINE:w.FILL;case"water":return w.FILL;case"line":return"round"===r.join?w.LINE_ROUND:w.LINE_MITER;case"path":switch(r.join){case"round":switch(r.profile){case"circle":return w.PATH_ROUND_CIRCLE;case"quad":return w.PATH_ROUND_QUAD;default:return void r.profile}case"miter":case"bevel":switch(r.profile){case"circle":return w.PATH_MITER_CIRCLE;case"quad":return w.PATH_MITER_QUAD;default:return void r.profile}default:return}case"object":return t?w.OBJECT_POINT:w.OBJECT_POLYGON;case"icon":case"text":return t?w.ICON_POINT:w.ICON_POLYGON;default:return}}function C(e){const r=d[e];if(r)return r;const t=f(s(e,new c({},{spherical:!0})).levels);return d[e]=new y({verticesPerFeature:t}),d[e]}function f(e){return e.reduce((e,r,t)=>e+r.numVertices*(1/10**t),0)/e.reduce((e,r,t)=>e+1/10**t,0)}const w={ICON_POINT:{bytesPerFeature:2658,bytesPerFeatureLabel:3484,resourceBytes:0,draped:{bytesPerFeature:1845,bytesPerFeatureLabel:3498}},ICON_POLYGON:{bytesPerFeature:3086,bytesPerFeatureLabel:2996,resourceBytes:0,draped:{bytesPerFeature:2694,bytesPerFeatureLabel:3014}},OBJECT_POINT:{bytesPerFeature:497,bytesPerFeatureLabel:2933,resourceBytes:0,draped:{bytesPerFeature:497,bytesPerFeatureLabel:2933}},OBJECT_POLYGON:{bytesPerFeature:867,bytesPerFeatureLabel:2491,resourceBytes:0,draped:{bytesPerFeature:867,bytesPerFeatureLabel:2491}},LINE_MITER:{bytesPerFeature:2337,bytesPerFeatureLabel:2658,resourceBytes:0,draped:{bytesPerFeature:1864,bytesPerFeatureLabel:2656}},LINE_ROUND:{bytesPerFeature:2341,bytesPerFeatureLabel:2672,resourceBytes:0,draped:{bytesPerFeature:1873,bytesPerFeatureLabel:2643}},PATH_MITER_CIRCLE:{bytesPerFeature:22374,bytesPerFeatureLabel:2558,resourceBytes:0,draped:{bytesPerFeature:22374,bytesPerFeatureLabel:2558}},PATH_ROUND_CIRCLE:{bytesPerFeature:24004,bytesPerFeatureLabel:2598,resourceBytes:0,draped:{bytesPerFeature:24004,bytesPerFeatureLabel:2598}},PATH_MITER_QUAD:{bytesPerFeature:24040,bytesPerFeatureLabel:2940,resourceBytes:0,draped:{bytesPerFeature:24040,bytesPerFeatureLabel:2940}},PATH_ROUND_QUAD:{bytesPerFeature:23088,bytesPerFeatureLabel:2886,resourceBytes:0,draped:{bytesPerFeature:23088,bytesPerFeatureLabel:2886}},FILL:{bytesPerFeature:3059,bytesPerFeatureLabel:2838,resourceBytes:0,draped:{bytesPerFeature:2352,bytesPerFeatureLabel:2808}},FILL_OUTLINE:{bytesPerFeature:3093,bytesPerFeatureLabel:2632,resourceBytes:0,draped:{bytesPerFeature:2480,bytesPerFeatureLabel:2601}},EXTRUDE:{bytesPerFeature:5075,bytesPerFeatureLabel:2559,resourceBytes:0,draped:{bytesPerFeature:5075,bytesPerFeatureLabel:2559}},EXTRUDE_EDGES:{bytesPerFeature:2843,bytesPerFeatureLabel:2139,resourceBytes:0,draped:{bytesPerFeature:2843,bytesPerFeatureLabel:2139}}};if(has("esri-tests-disable-symbol-memory-estimators"))for(const E in w){const e=w[E];e.bytesPerFeature=0,e.bytesPerFeatureLabel=0,e.draped.bytesPerFeature=0,e.draped.bytesPerFeatureLabel=0}export{m as averageSymbolComplexities,l as defaultSymbolComplexity,p as defaultSymbolLayerComplexity,L as defaultSymbolLayerMemoryComplexity,P as emptySymbolComplexity,f as estimateNumVerticesForLods,w as memoryEstimators,F as totalSymbolComplexities};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
function r(r){switch(r){case"butt":return 0;case"square":return 1;case"round":return 2;default:return null}}function t(r){return"diamond"===r?"kite":r}export{r as parseCapType,t as parseLineMarkerStyle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import r from"../../../../../../core/Accessor.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../../../../../../core/Accessor.js";import{createAbortError as t}from"../../../../../../core/promiseUtils.js";import{property as s,subclass as i}from"../../../../../../core/accessorSupport/decorators.js";import{ONES as d}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{DirectRenderer as n}from"./DirectRenderer.js";import{LodRenderer as o}from"./LodRenderer.js";import{ManagedTexture as l}from"../../../../webgl-engine/lib/ManagedTexture.js";import{DefaultMaterial as c}from"../../../../webgl-engine/materials/DefaultMaterial.js";import{HUDMaterial as u}from"../../../../webgl-engine/materials/HUDMaterial.js";import{schematicMRRFactors as m}from"../../../../webgl-engine/materials/pbrUtils.js";let h=class extends r{constructor(e){super(),this.view=null,this.layerViewUid=null,this._stage=null,this._materials=new Map,this._textures=new Map,this._directRenderers=new Map,this._lodRenderers=new Map,this.totalFeatures=0,this.view=e.view,this.layerViewUid=e.layerViewUid}initialize(){this._stage=this.view.stage}destroy(){this.removeAllHandles(),this._lodRenderers.forEach(e=>e.destroy())}async createTexture(e,r){const{_textures:t,_stage:s}=this,i=new l(e,r);return t.set(i.id,i),s&&(i.load(s.renderView.renderingContext),s.addTexture(i)),i.id}async releaseTexture(e){const{_textures:r,_stage:t}=this,s=r.get(e);s&&(t&&(s.unload(),t.removeTexture(s)),r.delete(e))}_destroyTexture(e){const{_textures:r,_stage:t}=this,s=r.get(e);s&&(t&&(s.unload(),t.removeTexture(s)),r.delete(e))}async createMaterial(e){const{view:r}=this,t=1===r.state.viewingMode;let s=null;switch(e.type){case"default":{const r=e.parameters,i=new c(r,{spherical:t});i.setParameters({cullFace:i.transparent?0:2}),s=i;break}case"hud":{const r=e.parameters;s=new u(r,t)}}this._materials.set(e.materialId,s)}async destroyMaterial(e){this._materials.delete(e)}async updateMaterial(e){}async createDirectRenderer(e){if(this._directRenderers.has(e))return;const r=this._materials.get(e);if(null==r)throw new Error(`material not found ${e}`);const{view:t}=this,s=new n({material:r,layerViewUid:this.layerViewUid});this._directRenderers.set(e,s),t.stage.addRenderPlugin(s),t.stage.renderView.renderer.updateHasFlags()}setBaseInstance(e,r){const t=this._directRenderers.get(e);if(null==t)throw new Error(`renderer not found ${e}`);t.setBaseInstance(r)}async destroyDirectRenderer(e){const r=this._directRenderers.get(e);if(null==r)return;const t=this.view;t.stage.removeRenderPlugin(r),this._directRenderers.delete(e),t.stage.renderView.renderer.updateHasFlags()}async createLoDRenderer(e,r,s){const i=new o({view:this.view,layerViewUid:this.layerViewUid}),d=e=>this._materials.get(e);if(await i.doLoad(r,d,s),s?.aborted)throw i.destroy(),t();this._lodRenderers.set(e,i)}async destroyLoDRenderer(e,r){const t=this._lodRenderers.get(e);null!=t&&(t.destroy(),this._lodRenderers.delete(e))}_destroyLodRenderer({rendererId:e}){const r=this._lodRenderers.get(e);null!=r&&(r.destroy(),this._lodRenderers.delete(e))}async executeRenderCommands(e){for(const r of e)switch(r.id){case"destroy-texture":this._destroyTexture(r.textureId);break;case"update-material":this._updateMaterial(r);break;case"destroy-material":this._destroyMaterial(r);break;case"add-direct-renderer-geometry-buffer":this._addDirectRendererGeometryBuffer(r);break;case"update-direct-renderer-geometry-buffer":this._updateDirectRendererGeometryBuffer(r);break;case"remove-direct-renderer-geometry-buffer":this._removeDirectRendererGeometryBuffer(r);break;case"destroy-lod-renderer":this._destroyLodRenderer(r);break;case"add-lod-instances":this._addLodInstances(r);break;case"remove-lod-instances":this._removeLodInstances(r);break;case"update-lod-instance-data":this._updateLodInstanceData(r);break;case"update-visibility":this._updateVisibility(r)}e.length>0&&this._updateFeatureCount()}_updateFeatureCount(){let e=0;for(const r of this._directRenderers.values())e+=r.numFeatures;for(const r of this._lodRenderers.values())e+=r.numFeatures;this._set("totalFeatures",e)}get usedMemory(){let e=0;for(const r of this._directRenderers.values())e+=r.usedMemory;for(const r of this._lodRenderers.values())e+=r.usedMemory;return e}_updateMaterial({materialId:e,parameters:r}){const t=this._materials.get(e);null!=t?t.setParameters(r):console.error("material not found")}_destroyMaterial({materialId:e}){null!=this._materials.get(e)?this._materials.delete(e):console.error("material not found")}_addDirectRendererGeometryBuffer({groupId:e,rendererId:r,renderGeometryBuffer:t,renderGeometryBufferItems:s,localOrigin:i}){const d=this._directRenderers.get(r);null!=d?(d.addRenderGeometryBuffer(e,t,s,i),this.view.stage.renderView.requestRender()):console.error("no renderer assigned to provided material")}_updateDirectRendererGeometryBuffer({groupId:e,rendererId:r,renderGeometryBuffer:t,renderGeometryBufferItems:s,localOrigin:i}){const d=this._directRenderers.get(r);null!=d?(d.updateRenderGeometryBuffer(e,t,s,i),this.view.stage.renderView.requestRender()):console.error("no renderer assigned to provided material")}_removeDirectRendererGeometryBuffer({groupId:e,rendererId:r}){const t=this._directRenderers.get(r);null!=t?(t.removeRenderGeometryBuffer(e),this.view.stage.renderView.requestRender()):console.error("no renderer assigned to provided material")}_addLodInstances({rendererId:e,groupId:r,data:t}){const s=this._lodRenderers.get(e);if(null==s)throw new Error("no lod renderer assigned to provided lod renderer Id");s.addInstances(r,t),this.view.stage.renderView.requestRender()}_removeLodInstances({rendererId:e,groupId:r}){const t=this._lodRenderers.get(e);if(null==t)throw new Error("no lod renderer assigned to provided lod renderer Id");t.removeInstances(r),this.view.stage.renderView.requestRender()}_updateLodInstanceData({rendererId:e,groupId:r,globalTransforms:t}){const s=this._lodRenderers.get(e);if(null==s)throw new Error("No renderer found with the provided id");null!=t&&s.updateGlobalTransforms(r,t),this.view.stage.renderView.requestRender()}_updateVisibility({rendererId:e,groupId:r,visibility:t}){const s=this._directRenderers.get(e)??this._lodRenderers.get(e);if(null==s)throw new Error("No renderer found with the provided id");s.updateVisibility(r,t),this.view.stage.renderView.requestRender()}};function f(e,r,t){const s={usePBR:r.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:m,ambient:d,diffuse:d,hasSlicePlane:r.slicePlaneEnabled,castShadows:r.castShadows,offsetTransparentBackfaces:!r.isPrimitive};r.screenSizePerspectiveEnabled&&(s.screenSizePerspective=e.screenSizePerspective.parameters),s.externalColor=a,s.instanced=!0;const i=new c(s,{spherical:t});return i.setParameters({cullFace:i.transparent?0:2}),i}e([s({readOnly:!0})],h.prototype,"totalFeatures",void 0),h=e([i("esri.views.3d.layers.graphics.pipeline.rendering.FeaturePipelineRenderManager")],h);export{h as FeaturePipelineRenderManager,f as createDefaultMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import{inputAttributesToAttributesMap as e}from"./symbolizationUtils.js";import{cloneAttributeData as t}from"../../../../webgl-engine/lib/AttributeArray.js";import{createPolySphereData as n,createConeGeometryData as i}from"../../../../webgl-engine/lib/GeometryUtil.js";function a(t,a){const o=(t,n,i=!1)=>({levels:t.map(t=>{const o=e(n(t.tesselation));i&&s(o);return{components:[{attributes:o,olidColor:void 0,transformation:null,materialId:a,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:t.minScreenSpaceRadius}})});switch(t){case"cone":return o(r,e=>i(1,.5,e,!1),!0);case"sphere":return o([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],e=>n(.5,e,!0));case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function s(e){const t=e,n=t.get("position").data,i=t.get("normal").data;if(i){const t=o(e,"normal").data;for(let e=0;e<i.length;e+=3){const n=i[e+1];t[e+1]=-i[e+2],t[e+2]=n}}if(n){const t=o(e,"position").data;for(let e=0;e<n.length;e+=3){const i=n[e+1];t[e+1]=-n[e+2],t[e+2]=i}}}function o(e,n){let i=e.get(n);return i&&!i.exclusive&&(i={...i,exclusive:!0,data:t(i.data)},e.set(n,i)),i}const r=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];export{a as createPrimitiveGeometry};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import{cgToGIS as e,createDiamondGeometry as n,createTetrahedronGeometry as s,createCylinderGeometry as a,createConeGeometry as c,createBoxGeometry as i,createPolySphereGeometry as t}from"../../webgl-engine/lib/GeometryUtil.js";import{LodResources as r,LodLevelResources as o,LodComponentResources as u,LodComponentEngineGeometry as d}from"../../webgl-engine/lib/lodRendering/LodResources.js";function S(e){switch(e){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}function l(S,l){const p=(n,s,a=!1)=>new r(n.map(n=>{const c=s(n.tesselation);return a&&e(c),new o([new u(new d(c))],n.minScreenSpaceRadius)}));switch(S){case"sphere":return p([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],e=>t(l,.5,e,!0));case"cube":return p([{tesselation:0,minScreenSpaceRadius:0}],()=>i(l,1));case"cone":return p(m,e=>c(l,1,.5,e,!1),!0);case"inverted-cone":return p(m,e=>c(l,1,.5,e,!0),!0);case"cylinder":return p(m,e=>a(l,1,.5,e,[0,0,1],[0,0,.5]));case"tetrahedron":return p([{tesselation:0,minScreenSpaceRadius:0}],()=>s(l,1),!0);case"diamond":return p([{tesselation:0,minScreenSpaceRadius:0}],()=>n(l,1),!0);default:return}}const m=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];export{S as isValidPrimitive,l as primitiveLodResources};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{createMaterialFromEdges as r}from"../support/edgeUtils.js";const o=.15,t=.5*o;function a(e){switch(e.filterMode.type){case"solid":return{mode:0};case"wire-frame":return{mode:1,edgeMaterial:r(e.filterMode.edges,{})};case"x-ray":return{mode:2}}}function l(e,r){if(null==r)return e.color[3]=0,void(e.edgeMaterial=null);switch(r.mode){case 0:return;case 1:return e.color[3]=0,void(e.edgeMaterial=r.edgeMaterial);case 2:return e.color[0]=1,e.color[1]=1,e.color[2]=1,e.color[3]*=o,e.colorMixMode=3,e.castShadows=!1,e.pickable=!1,void(e.edgeMaterial=c(e.edgeMaterial))}}function c(e){return null==e?null:(n.lastMaterial!==e&&(n.cachedMaterial=i(e),n.lastMaterial=e),n.cachedMaterial)}function i(r){const o=e(r.color);return o[3]*=t,{...r,color:o}}const n={cachedMaterial:null,lastMaterial:null};export{l as applyFilterMode,a as parseFilterMode};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{I3sTarget as e}from"./Intersector.js";import{IntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as n}from"../../webgl-engine/lib/RayIntersections.js";import{getVerticalOffsetI3S as i}from"../../webgl-engine/lib/verticalOffsetUtils.js";class r{constructor(e){this.type=2,this._needVerticalOffset=!1,this.layerViewUid=e.layerViewUid,this.sublayerId=e.sublayerId,this._collection=e.collection,this._traverseNodeHierarchy=e.traverseNodeHierarchy,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isGround=e.isGround}updateElevationAlignState(e,t){this._needVerticalOffset=e&&1===t}intersect(r,l,o,c,a,d){const u=2===r.options.store,b=r.ray.direction;let
|
|
5
|
+
import{I3sTarget as e}from"./Intersector.js";import{IntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as n}from"../../webgl-engine/lib/RayIntersections.js";import{getVerticalOffsetI3S as i}from"../../webgl-engine/lib/verticalOffsetUtils.js";class r{constructor(e){this.type=2,this._needVerticalOffset=!1,this.layerViewUid=e.layerViewUid,this.sublayerId=e.sublayerId,this._collection=e.collection,this._traverseNodeHierarchy=e.traverseNodeHierarchy,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isGround=e.isGround}updateElevationAlignState(e,t){this._needVerticalOffset=e&&1===t}intersect(r,l,o,c,a,d){const u=2===r.options.store,b=r.ray.direction;let f=e=>e,h=e=>e;const y=i(r.verticalOffset??(this._needVerticalOffset?0:null));null!=r.verticalOffset&&null!=y&&(f=e=>y.applyToMbs(e),h=e=>y.applyToObb(e));const{results:m,tolerance:p}=r,R=new n(p,d,r.options.normalRequired),g=(n,i)=>{if(0===n.childrenLoaded)return!1;const a=n.serviceObbInRenderSR?.isValid?n.serviceObbInRenderSR:null;if(a&&!h(a).intersectRay(o,b,p))return!1;const{serviceMbsInRenderSRElevationAdjusted:d}=n;return!i||!a&&d.isValid&&!s(f(d),o,b,p)||null!=n.geometryObbInRenderSR&&!h(n.geometryObbInRenderSR).intersectRay(o,b,p)||this._collection.intersect(i,o,c,y,R,(i,s,a,d)=>{if(s<0||null!=l&&!l(o,c,s))return;const b=t=>{const r=new e(this.layerViewUid,this.sublayerId,n.index,i,d);t.set(this.type,r,s,a)};if(this.isGround&&(null==m.ground.distance||s<m.ground.distance)&&b(m.ground),!r.options.isFiltered&&((null==m.min.distance||s<m.min.distance)&&b(m.min),(null==m.max.distance||s>m.max.distance)&&b(m.max),u)){const e=new t(r.ray);b(e),r.results.all.push(e)}}),!0};this._traverseNodeHierarchy(g)}}function s(e,t,n,i=0){const r=e.radius+i,s=t[0]-e.center[0],l=t[1]-e.center[1],o=t[2]-e.center[2],[c,a,d]=n,u=c*s+a*l+d*o;return u*u-(c*c+a*a+d*d)*(s*s+l*l+o*o-r*r)>=0}export{r as I3SIntersectionHandler};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{Sphere as e}from"../../../../geometry/support/sphere.js";import{ElevationRange as s}from"../../support/ElevationRange.js";class
|
|
5
|
+
import{Sphere as e}from"../../../../geometry/support/sphere.js";import{ElevationRange as s}from"../../support/ElevationRange.js";class i extends s{constructor(s,i){super(NaN,NaN),this.id=s,this.serviceMbsInIndexSR=i,this._serviceMbsInRenderSRElevationAdjusted=new e(0,0,0,-1),this._serviceMbsInRenderSR=new e(0,0,0,-1),this._mbsConeInRenderSR=null}get serviceMbsInRenderSRElevationAdjusted(){return this._serviceMbsInRenderSRElevationAdjusted}updateServiceMbsInRenderSRElevationAdjusted(e){return this._serviceMbsInRenderSRElevationAdjusted.copyFrom(e),this._serviceMbsInRenderSRElevationAdjusted}get serviceMbsInRenderSR(){return this._serviceMbsInRenderSR}updateServiceMbsInRenderSR(e){return this._serviceMbsInRenderSR.copyFrom(e),this._serviceMbsInRenderSR}get mbsConeInRenderSR(){return this._mbsConeInRenderSR}updateMbsConeInRenderSR(e){return this._mbsConeInRenderSR=e?.clone()??null,this._mbsConeInRenderSR}invalidateServiceBVsInRenderSR(){this._serviceMbsInRenderSRElevationAdjusted.invalidate(),this._serviceMbsInRenderSR.invalidate(),this._mbsConeInRenderSR=null,this.serviceObbInRenderSR?.invalidate()}shareServiceBVsInRenderSRWith(e){this.serviceObbInRenderSR=e.serviceObbInRenderSR,this._serviceMbsInRenderSRElevationAdjusted=e._serviceMbsInRenderSRElevationAdjusted,this._serviceMbsInRenderSR=e._serviceMbsInRenderSR,this._mbsConeInRenderSR=e._mbsConeInRenderSR}}class t extends i{constructor(e,s,i,t,n,d,a,R,o,h){super(e,i),this.index=s,this.childCount=t,this.level=n,this.resources=d,this.version=a,this.lodMetric=R,this.maxError=o,this.numFeatures=h,this.failed=!1,this.cacheState=0,this.vertexCount=0,this.memory=0,this.childrenLoaded=0,this.hasModifications=!1,this.imModificationImpact=4,this.elevationAgnosticBoundingVolume=new r}invalidateServiceBVsInRenderSR(){super.invalidateServiceBVsInRenderSR(),this.elevationAgnosticBoundingVolume.invalidate()}}class n{constructor(e,s,i,t){this.nodeHasLOD=e,this.isChosen=s,this.lodLevel=i,this.version=t}}class r{constructor(){this._data=[0,0,0,r.invalidRadius]}static{this.invalidRadius=-2}invalidate(){this._data[3]=r.invalidRadius}get valid(){return this._data[3]!==r.invalidRadius}get radius(){return this._data[3]}getAxis(e){return e[0]=this._data[0],e[1]=this._data[1],e[2]=this._data[2],e}set(e,s){this._data[0]=e[0],this._data[1]=e[1],this._data[2]=e[2],this._data[3]=s}}export{r as ElevationAgnosticBoundingVolume,t as Node,i as NodeBoundingData,n as NodeTraversalState};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{n as e,a as t,g as i,c as s,h as r,E as n,e as o,d as a,u as c,G as u,j as l,F as h,s as d,B as m,b as _,D as p,i as f}from"../../../../chunks/vec32.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as R}from"../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingSphere as b}from"../../../../geometry/projection/projectBoundingSphere.js";import{getProjector as S}from"../../../../geometry/projection/projectors.js";import{create as M,fromMatrix as x,createPoints as I,intersectsSphere as C}from"../../../../geometry/support/frustum.js";import{getNormal as D,signedDistance as P}from"../../../../geometry/support/plane.js";import{isPlateCarree as E}from"../../../../geometry/support/spatialReferenceUtils.js";import{Sphere as O}from"../../../../geometry/support/sphere.js";import{evaluateElevationAlignmentAtPoint as F}from"../graphics/elevationAlignmentUtils.js";import{ElevationContext as V}from"../graphics/ElevationContext.js";import{createContextWithoutExpressionSupport as A,extractExpressionInfo as B}from"../graphics/featureExpressionInfoUtils.js";import{intersectBoundingRectWithMbs as L}from"./I3SUtil.js";import{Obb as j,computeOffsetObb as y}from"../../support/orientedBoundingBox.js";const w=1e5;class q{get _frustumMbsCenter(){return this._frustumMbs.center}get _frustumMbsRadius(){return this._frustumMbs.radius}get _frustumPlanes(){return this._frustum}constructor(e,t,i,s,r,n,o,a,c={}){this._indexSR=e,this._renderCoordsHelper=t,this._clippingArea=r,this._elevationProvider=n,this._viewingMode=o,this._options=c,this._frustum=M(),this._frustumMbs=new O,this._viewDirection=v(),this._useFrustumCulling=!1,this._poi=v(),this._cameraPOIDirection=v(),this._elevationContext=null,this.minDistance=1/0,this.maxDistance=0,this.maxLodLevel=2,this._screenspaceErrorBias=c.screenspaceErrorBias||1,this._progressiveLoadFactor=c.progressiveLoadFactor||1,this.updateCamera(i,s);const u=this._renderCoordsHelper.spatialReference;this._renderSR=u,this._renderSRSphericalPCPF=R(u),this._isGlobalMode=u===this._renderSRSphericalPCPF,this.updateElevationInfo(a),this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(u.isWebMercator||E(u)),this._indexSREllipsoidRadius=g(this._indexSR).radius,this._indexSRSphericalPCPF=R(e),this._projectorIndexSRToIndexSRSphericalPCPF=S(this._indexSR,this._indexSRSphericalPCPF)}updateElevationInfo(e){null!=e?(this._elevationContext=V.fromElevationInfo(e),this._elevationContext.setFeatureExpressionInfoContext(A(B(e,!1)))):this._elevationContext=null}updateCamera(r,n){if(this._useFrustumCulling=n,e(this._viewDirection,r.viewForward),n){x(r.viewMatrix,r.projectionMatrix,this._frustum,U);{const e=r.eye,n=N;t(n,U[4],e);const o=.5*i(n,n)/i(this._viewDirection,n),a=this._frustumMbs,c=a.center;s(c,e,this._viewDirection,o);const u=1+o;a.radius=u}}this._screenSizeFactor=1/(r.perScreenPixelRatio/2),this._camPos=r.eye,this._updateCameraPOIDirection(),this.minDistance=1/0,this.maxDistance=0}setPointOfInterest(e){this._poi=e,this._updateCameraPOIDirection()}updateScreenSpaceErrorBias(e){const t=this._screenspaceErrorBias;return this._screenspaceErrorBias=e,t}updateClippingArea(e){this._clippingArea=e}expandElevationRange(e,t,i){if(null==this._elevationContext)return;const s=e.serviceMbsInIndexSR;if(!s)return;const r="relative-to-scene"===this._elevationContext.mode?"scene":"ground",n=this._elevationProvider;if(n.getSphereElevationRange){const e=n.getSphereElevationRange(s,this._indexSR,r);if(e)return void i.expandElevationRange(e)}const[o,a,c]=s.center,u=n.getElevation(o,a,c,this._indexSR,r);u&&i.expandElevationRangeValues(u,u);const l=t?null:n.getRootElevationRange?.();l&&i.expandElevationRange(l)}calculateServiceMbsInRenderSR(e){const{serviceMbsInRenderSR:t}=e;if(t.isValid)return t;const{serviceMbsInIndexSR:i}=e;if(!i)return t;const s=ee;s.copyFrom(i);const{minElevation:r}=e,{_elevationContext:n,_renderCoordsHelper:o}=this,{center:a}=s;if(n&&Number.isFinite(r)){let t=0,i=0;const{maxElevation:c}=e;switch(n.mode){case"relative-to-ground":case"relative-to-scene":t=n.geometryZWithOffset(a[2],o)+r-a[2],i=c-r;break;case"on-the-ground":t=r-a[2],i=c-r}a[2]+=t+.5*i,s.radius+=.5*i}else n&&s.radius<w&&(a[2]=F(a,this._elevationProvider,n,o));return b(s,this._indexSR,s,this._renderSR),e.updateServiceMbsInRenderSR(s)}getAndUpdateVisibilityObbInRenderSR(e){{const t=e.visibilityObbInRenderSR;if(t)return t}const t=.01*this._indexSREllipsoidRadius,{serviceMbsInIndexSR:i,serviceObbInIndexSR:s}=e;if(null==s||!i||!s.isValid||this._isECEFOBBInLocalMode&&(s.halfSizeX>t||s.halfSizeY>t||s.halfSizeZ>t))return null;{let t=e.serviceObbInRenderSR;if(null==t)t=new j,e.serviceObbInRenderSR=t;else if(t.isValid)return t;const n=i.radius;let o=0,a=0;const c=s.centerZ,u=this._renderCoordsHelper,l=this._elevationContext;if(l&&e.elevationRangeValid){const{minElevation:t,maxElevation:i}=e;switch(l.mode){case"relative-to-ground":case"relative-to-scene":o=l.geometryZWithOffset(c,u)+t-c,a=i-t;break;case"on-the-ground":o=t-c,a=i-t}}else if(l&&n<w){const e=r(Z,s.centerX,s.centerY,c);o=F(e,this._elevationProvider,l,u)-c}const h=a>0,d=h?W:t;return s.transform(d,this._indexSR,this._renderSR,o,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),h&&y(d,0,a,this._viewingMode,t),t}}getNodeObbInRenderSRIndependentOfElevationOffset(e){{const t=e.visibilityObbInRenderSR??e.serviceObbInRenderSR??null;if(t?.isValid)return t}const t=e.serviceObbInIndexSR;return t?(t.transform(W,this._indexSR,this._renderSR,void 0,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),W):null}ensureElevationAgnosticBoundingVolume(e){return!e.elevationAgnosticBoundingVolume.valid&&e.level>0&&(1===this._viewingMode?this._updateElevationAgnosticBoundingVolumeGlobal(e):this._updateElevationAgnosticBoundingVolumeLocal(e)),e.elevationAgnosticBoundingVolume}_updateCameraPOIDirection(){n(this._poi,this._camPos)?this._cameraPOIDirection=this._viewDirection:(o(this._cameraPOIDirection,this._camPos,this._poi),e(this._cameraPOIDirection,this._cameraPOIDirection))}_updateElevationAgnosticBoundingVolumeGlobal(t){const s=this.getNodeObbInRenderSRIndependentOfElevationOffset(t),r=t.elevationAgnosticBoundingVolume;let n,o=-1;if(s){const t=Z;s.getCenter(t),e(t,t),n=t,s.getCorners(X);for(const s of X){e(s,s);const n=i(s,t);if(n<=0)return void r.invalidate();const a=Math.sqrt(1-n*n);o=Math.max(o,a)}}else{const i=t.serviceMbsInRenderSR;if(!i.isValid)return void r.invalidate();const s=a(Z,i.center),u=i.radius,l=c(s);if(l<u)return void r.invalidate();o=u/l,e(s,s),n=s}const u=.001;r.set(n,o+u)}_updateElevationAgnosticBoundingVolumeLocal(e){const t=e.elevationAgnosticBoundingVolume,i=this.getNodeObbInRenderSRIndependentOfElevationOffset(e);if(i){const e=i.getCenter(Z);e[2]=0;let s=0;const r=Y;i.getCorners(X);for(const t of X){t[2]=0;const e=u(r,t);s=Math.max(s,e)}t.set(e,Math.sqrt(s))}else{const i=e.serviceMbsInRenderSR;if(i.isValid){const e=a(Z,i.center);e[2]=0,t.set(e,i.radius)}}}isNodeVisible(e){const t=this.calculateServiceMbsInRenderSR(e);if(!this._isMBSinClippingArea(t))return!1;if(!this._useFrustumCulling)return!0;const i=this.getAndUpdateVisibilityObbInRenderSR(e);return i?i.intersectsFrustumConservativeApproximation(this._frustum):C(this._frustum,t)}isElevationAgnosticBoundingVolumeVisible(e){return!this._useFrustumCulling||(!e.valid||(1===this._viewingMode?this._isConeVisibleInFrustum(e):this._isCylinderVisibleInFrustum(e)))}_isConeVisibleInFrustum(r){if(!this._isConeVisibleInFrustumMbs(r))return!1;const n=r.radius;if(-1===n||n>.9)return!0;const o=this._frustumPlanes,a=this._frustumMbsCenter,c=r.getAxis($),u=i(c,a),h=this._frustumMbsRadius,d=u-h,m=u+h;if(d<=0)return!0;const _=l(k,c,d),p=l(z,c,m),f=n/Math.sqrt(1-n*n);for(const v of o){const r=D(v),n=e(H,r),o=i(n,c);if(Math.abs(1-o)<.01)continue;const a=J;l(a,c,o),t(a,a,n),e(a,a);const u=K;s(u,_,a,d*f);if(P(v,u)<=0)continue;s(u,p,a,m*f);if(P(v,u)<=0)continue;return!1}return!0}_isConeVisibleInFrustumMbs(e){const t=e.radius;if(t>.9)return!0;const s=this._frustumMbsRadius,r=this._frustumMbsCenter,n=c(r);if(n<=s)return!0;const o=e.getAxis($),a=i(o,r);{const e=l(T,o,a);if(h(e,r)<s)return!0}const u=a/n;if(a<=0){return-u<s}const d=Math.sqrt(1-u*u);if(d<t)return!0;const m=s/n;return d*Math.sqrt(1-m*m)-m*u<t}isObbVisibleIndependentOfElevation(e,t){if(!this._useFrustumCulling)return!0;if(!e.valid)return!0;const s=this._frustumMbsRadius,r=this._frustumMbsCenter,n=this._frustumPlanes,o=X;if(t.getCorners(o),1===this._viewingMode){const t=e.getAxis($),a=i(t,r),c=a-s,u=a+s;if(c<=0)return!0;for(const e of n){let s=!0;for(const r of o){const n=i(r,t),o=Q;if(l(o,r,c/n),P(e,o)<=0){s=!1;break}const a=Q;if(l(a,r,u/n),P(e,a)<=0){s=!1;break}}if(s)return!1}}else{const e=r[2]-s,t=r[2]+s;for(const i of n){let s=!0;const r=D(i),n=r[0],a=r[1],c=r[2],u=i[3];for(const i of o){const r=n*i[0]+a*i[1]+u;if(r+c*e<=0||r+c*t<=0){s=!1;break}}if(s)return!1}}return!0}_isCylinderVisibleInFrustum(e){const t=this._frustumMbsCenter,i=this._frustumMbsRadius,s=a(T,t);s[2]=0;const r=e.radius,n=e.getAxis($);return h(s,n)<=r+i}isGeometryVisible(e){if(!this._useFrustumCulling)return!0;const t=e.geometryObbInRenderSR;return t?.intersectsFrustumConservativeApproximation(this._frustum)??this.isNodeVisible(e)}_isMBSinClippingArea(e){return null==this._clippingArea||0!==L(this._clippingArea,e)}_screenSpaceDiameterMbs(e,t){const i=this.calculateServiceMbsInRenderSR(e),s=Math.sqrt(d(i.center,this._camPos)),r=s-i.radius;return this._updateMinMaxDistance(s),r<0?.5*Number.MAX_VALUE:t/r*this._screenSizeFactor}calcCameraDistance(e){return this.calcCameraDistanceToCenter(e)-this.calculateServiceMbsInRenderSR(e).radius}calcCameraDistanceToCenter(e){const t=this.calculateServiceMbsInRenderSR(e),i=m(t.center,this._camPos);return this._updateMinMaxDistance(i),i}calcAngleDependentLoD(e){const{center:s,radius:r}=this.calculateServiceMbsInRenderSR(e),n=t(Y,s,this._camPos),o=(Math.abs(i(s,n))/_(s)+r)/_(n);return Math.min(1,o)}hasLOD(e){return 0!==e.lodMetric}_getDistanceGlobeMode(e,t){const s=_(t.center),r=_(e)-s;l(te,e,i(e,t.center)/p(e));const n=d(t.center,te),a=t.radius;if(n<=a*a)return Math.abs(r);{const n=l(te,t.center,1/s),c=l(ie,n,s-a*a/2/s),u=e,h=o(se,u,c),d=o(se,h,l(re,n,i(n,h))),p=f(se,c,l(se,d,a/_(d)));let v=m(u,p);if(r>=2e5){const e=o(ie,u,p);let t=i(e,n)/_(e);t<.08&&(t=1e-4),v/=t}return v}}_getDistance(e,t){return this._isGlobalMode?this._getDistanceGlobeMode(e,t):G(e,t)}_updateMinMaxDistance(e){e>0?(this.minDistance=Math.min(this.minDistance,e),this.maxDistance=Math.max(this.maxDistance,e)):(this.minDistance=0,this.maxDistance=Math.max(this.maxDistance,-e))}getLodLevel(e){if(0===e.lodMetric)return 0;if(0===e.childCount)return this.maxLodLevel;if(this._useFrustumCulling&&this._progressiveLoadFactor<1){const t=this._progressiveLoadFactor*this._screenspaceErrorBias,i=this._screenspaceErrorBias;return this.evaluateLODmetric(e,t)?this.evaluateLODmetric(e,i)?2:1:0}return this.evaluateLODmetric(e,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(e,t){switch(e.lodMetric){case 2:{const i=this.calculateServiceMbsInRenderSR(e),s=this._getDistance(this._camPos,i),r=2*s/this._screenSizeFactor,n=s+i.radius;return this._updateMinMaxDistance(n),e.maxError*t<=r}case 1:{let i=this._screenSpaceDiameterMbs(e,(e.serviceMbsInIndexSR?.radius??0)*t);return this._options.angleDependentLoD&&(i*=this.calcAngleDependentLoD(e)),i<e.maxError}case 3:return this._screenSpaceDiameterMbs(e,e.maxError)*t<10;case 4:return this.calcCameraDistance(e)>e.maxError*t}return!1}distToCameraPOIRay(e){if(null==e)return 0;const t=this.calculateServiceMbsInRenderSR(e),s=t.center,r=i(s,this._cameraPOIDirection),n=r*r,o=p(s)-n;return Math.sqrt(o)-t.radius}distCameraToPOI(){return m(this._camPos,this._poi)}}function G(e,t){const i=e[0]-t.center[0],s=e[1]-t.center[1],r=e[2]-t.center[2],n=i*i+s*s,o=t.radius;if(n<=o*o)return Math.abs(r);const a=Math.sqrt(n)-o;return Math.sqrt(r*r+a*a)}const U=I(),N=v(),T=v(),k=v(),z=v(),H=v(),W=new j,Z=v(),X=[v(),v(),v(),v(),v(),v(),v(),v()],Y=v(),J=v(),K=v(),Q=v(),$=v(),ee=new O,te=v(),ie=v(),se=v(),re=v();export{q as default};
|
|
5
|
+
import{n as e,a as t,g as i,c as s,h as n,E as r,e as o,u as a,G as c,d as u,j as l,F as d,B as h,b as m,D as _,s as p,i as f}from"../../../../chunks/vec32.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as R}from"../../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as S}from"../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingSphere as b}from"../../../../geometry/projection/projectBoundingSphere.js";import{getProjector as g}from"../../../../geometry/projection/projectors.js";import{create as M,fromMatrix as x,createPoints as I,intersectsSphere as C}from"../../../../geometry/support/frustum.js";import{getNormal as E,signedDistance as D}from"../../../../geometry/support/plane.js";import{isPlateCarree as P}from"../../../../geometry/support/spatialReferenceUtils.js";import{Sphere as A}from"../../../../geometry/support/sphere.js";import{evaluateElevationAlignmentAtPoint as F}from"../graphics/elevationAlignmentUtils.js";import{ElevationContext as O}from"../graphics/ElevationContext.js";import{createContextWithoutExpressionSupport as V,extractExpressionInfo as j}from"../graphics/featureExpressionInfoUtils.js";import{intersectBoundingRectWithMbs as B}from"./I3SUtil.js";import{SphereCylinderLocal as L,SphereConeGlobal as w}from"./SphereCone.js";import{Obb as y,computeOffsetObb as U}from"../../support/orientedBoundingBox.js";const G=1e5;class q{get _frustumMbsCenter(){return this._frustumMbs.center}get _frustumMbsRadius(){return this._frustumMbs.radius}get _frustumPlanes(){return this._frustum}constructor(e,t,i,s,n,r,o,a,c={}){this._indexSR=e,this._renderCoordsHelper=t,this._clippingArea=n,this._elevationProvider=r,this._viewingMode=o,this._options=c,this._frustum=M(),this._frustumMbs=new A,this._viewDirection=v(),this._useFrustumCulling=!1,this._poi=v(),this._cameraPOIDirection=v(),this._elevationContext=null,this.minDistance=1/0,this.maxDistance=0,this.maxLodLevel=2,this._screenspaceErrorBias=c.screenspaceErrorBias||1,this._progressiveLoadFactor=c.progressiveLoadFactor||1,this.updateCamera(i,s);const u=this._renderCoordsHelper.spatialReference;this._renderSR=u,this._renderSRSphericalPCPF=S(u),this._isGlobalMode=u===this._renderSRSphericalPCPF,this.updateElevationInfo(a),this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(u.isWebMercator||P(u)),this._indexSREllipsoidRadius=R(this._indexSR).radius,this._indexSRSphericalPCPF=S(e),this._projectorIndexSRToIndexSRSphericalPCPF=g(this._indexSR,this._indexSRSphericalPCPF)}updateElevationInfo(e){null!=e?(this._elevationContext=O.fromElevationInfo(e),this._elevationContext.setFeatureExpressionInfoContext(V(j(e,!1)))):this._elevationContext=null}updateCamera(n,r){if(this._useFrustumCulling=r,e(this._viewDirection,n.viewForward),r){x(n.viewMatrix,n.projectionMatrix,this._frustum,T);{const e=n.eye,r=k;t(r,T[4],e);const o=.5*i(r,r)/i(this._viewDirection,r),a=this._frustumMbs,c=a.center;s(c,e,this._viewDirection,o);const u=1+o;a.radius=u}}this._screenSizeFactor=1/(n.perScreenPixelRatio/2),this._camPos=n.eye,this._updateCameraPOIDirection(),this.minDistance=1/0,this.maxDistance=0}setPointOfInterest(e){this._poi=e,this._updateCameraPOIDirection()}updateScreenSpaceErrorBias(e){const t=this._screenspaceErrorBias;return this._screenspaceErrorBias=e,t}updateClippingArea(e){this._clippingArea=e}expandElevationRange(e,t,i){if(null==this._elevationContext)return;const s=e.serviceMbsInIndexSR;if(!s)return;const n="relative-to-scene"===this._elevationContext.mode?"scene":"ground",r=this._elevationProvider;if(r.getSphereElevationRange){const e=r.getSphereElevationRange(s,this._indexSR,n);if(e)return void i.expandElevationRange(e)}const[o,a,c]=s.center,u=r.getElevation(o,a,c,this._indexSR,n);u&&i.expandElevationRangeValues(u,u);const l=t?null:r.getRootElevationRange?.();l&&i.expandElevationRange(l)}calculateServiceMbsInRenderSR(e){const{serviceMbsInRenderSR:t}=e;if(t.isValid)return t;const{serviceMbsInIndexSR:i}=e;if(!i?.isValid)return t;const s=ie;return b(i,this._indexSR,s,this._renderSR),e.updateServiceMbsInRenderSR(s)}calculateServiceMbsInRenderSRElevationAdjusted(e){const{serviceMbsInRenderSRElevationAdjusted:t}=e;if(t.isValid)return t;const{serviceMbsInIndexSR:i}=e,s=this.calculateServiceMbsInRenderSR(e);if(!s.isValid||!i?.isValid)return t;const n=ie;n.copyFrom(s);const{_elevationContext:r}=this;if(r){const{minElevation:t}=e,{_renderCoordsHelper:s}=this,o=i.center;let a=0;if(Number.isFinite(t)){let i=0,c=0;const{maxElevation:u}=e,l=o[2];switch(r.mode){case"relative-to-ground":case"relative-to-scene":i=r.geometryZWithOffset(l,s)+t-l,c=u-t;break;case"on-the-ground":i=t-l,c=u-t}a=i+.5*c,n.radius+=.5*c}else n.radius<G&&(a=F(o,this._elevationProvider,r,s)-o[2]);a&&ae(n,a,this._viewingMode)}return e.updateServiceMbsInRenderSRElevationAdjusted(n)}calculateMbsConeInRenderSR(e){const{mbsConeInRenderSR:t}=e;if(t)return t;if(!e.elevationRangeValid)return null;const{minElevation:i,maxElevation:s}=e;if(!(Number.isFinite(i)&&i<s))return null;const n=this.calculateServiceMbsInRenderSR(e);if(!n.isValid)return null;const r=this._renderCoordsHelper.referenceEllipsoid.radius,o=2===this._viewingMode?new L(n,i,s):new w(n,r+i,r+s);return e.updateMbsConeInRenderSR(o)}getAndUpdateVisibilityObbInRenderSR(e){{const t=e.visibilityObbInRenderSR;if(t)return t}const t=.01*this._indexSREllipsoidRadius,{serviceMbsInIndexSR:i,serviceObbInIndexSR:s}=e;if(null==s||!i||!s.isValid||this._isECEFOBBInLocalMode&&(s.halfSizeX>t||s.halfSizeY>t||s.halfSizeZ>t))return null;{let t=e.serviceObbInRenderSR;if(null==t)t=new y,e.serviceObbInRenderSR=t;else if(t.isValid)return t;const r=i.radius;let o=0,a=0;const c=s.centerZ,u=this._renderCoordsHelper,l=this._elevationContext;if(l&&e.elevationRangeValid){const{minElevation:t,maxElevation:i}=e;switch(l.mode){case"relative-to-ground":case"relative-to-scene":o=l.geometryZWithOffset(c,u)+t-c,a=i-t;break;case"on-the-ground":o=t-c,a=i-t}}else if(l&&r<G){const e=n(Y,s.centerX,s.centerY,c);o=F(e,this._elevationProvider,l,u)-c}const d=a>0,h=d?X:t;return s.transform(h,this._indexSR,this._renderSR,o,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),d&&U(h,0,a,this._viewingMode,t),t}}getNodeObbInRenderSRIndependentOfElevationOffset(e){{const t=e.visibilityObbInRenderSR??e.serviceObbInRenderSR??null;if(t?.isValid)return t}const t=e.serviceObbInIndexSR;return t?(t.transform(X,this._indexSR,this._renderSR,void 0,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),X):null}ensureElevationAgnosticBoundingVolume(e){return!e.elevationAgnosticBoundingVolume.valid&&e.level>0&&(1===this._viewingMode?this._updateElevationAgnosticBoundingVolumeGlobal(e):this._updateElevationAgnosticBoundingVolumeLocal(e)),e.elevationAgnosticBoundingVolume}_updateCameraPOIDirection(){r(this._poi,this._camPos)?this._cameraPOIDirection=this._viewDirection:(o(this._cameraPOIDirection,this._camPos,this._poi),e(this._cameraPOIDirection,this._cameraPOIDirection))}_updateElevationAgnosticBoundingVolumeGlobal(t){const s=this.getNodeObbInRenderSRIndependentOfElevationOffset(t),n=t.elevationAgnosticBoundingVolume;let r,o=-1;if(s){const t=Y;s.getCenter(t),e(t,t),r=t,s.getCorners(J);for(const s of J){e(s,s);const r=i(s,t);if(r<=0)return void n.invalidate();const a=Math.sqrt(1-r*r);o=Math.max(o,a)}}else{const i=t.serviceMbsInRenderSR;if(!i.isValid)return void n.invalidate();const{center:s,radius:c}=i,u=a(s);if(u<c)return void n.invalidate();o=c/u,r=e(te,s)}n.set(r,o+ce)}_updateElevationAgnosticBoundingVolumeLocal(e){const t=e.elevationAgnosticBoundingVolume,i=this.getNodeObbInRenderSRIndependentOfElevationOffset(e);if(i){const e=i.getCenter(Y);e[2]=0;let s=0;const n=K;i.getCorners(J);for(const t of J){t[2]=0;const e=c(n,t);s=Math.max(s,e)}t.set(e,Math.sqrt(s))}else{const i=e.serviceMbsInRenderSR;if(i.isValid){const e=u(Y,i.center);e[2]=0,t.set(e,i.radius)}}}isNodeVisible(e){if(!this._isMBSinClippingArea(this.calculateServiceMbsInRenderSR(e)))return!1;if(!this._useFrustumCulling)return!0;const t=this.getAndUpdateVisibilityObbInRenderSR(e);return t?t.intersectsFrustumConservativeApproximation(this._frustum):C(this._frustum,this.calculateServiceMbsInRenderSRElevationAdjusted(e))}isElevationAgnosticBoundingVolumeVisible(e){return!this._useFrustumCulling||(!e.valid||(1===this._viewingMode?this._isConeVisibleInFrustum(e):this._isCylinderVisibleInFrustum(e)))}_isConeVisibleInFrustum(n){if(!this._isConeVisibleInFrustumMbs(n)||!n.valid)return!1;const r=n.radius;if(r>.9)return!0;const o=this._frustumPlanes,a=this._frustumMbsCenter,c=n.getAxis(te),u=i(c,a),d=this._frustumMbsRadius,h=u-d,m=u+d;if(h<=0)return!0;const _=l(W,c,h),p=l(H,c,m),f=r/Math.sqrt(1-r*r);for(const v of o){const n=E(v),r=e(Z,n),o=i(r,c);if(Math.abs(1-o)<.01)continue;const a=Q;l(a,c,o),t(a,a,r),e(a,a);const u=$;s(u,_,a,h*f);if(D(v,u)<=0)continue;s(u,p,a,m*f);if(D(v,u)<=0)continue;return!1}return!0}_isConeVisibleInFrustumMbs(e){const t=e.radius;if(t>.9)return!0;const s=this._frustumMbsRadius,n=this._frustumMbsCenter,r=a(n);if(r<=s)return!0;const o=e.getAxis(te),c=i(o,n);{const e=l(z,o,c);if(d(e,n)<s)return!0}const u=c/r;if(c<=0){return-u<s}const h=Math.sqrt(1-u*u);if(h<t)return!0;const m=s/r;return h*Math.sqrt(1-m*m)-m*u<t}isObbVisibleIndependentOfElevation(e,t){if(!this._useFrustumCulling)return!0;if(!e.valid)return!0;const s=this._frustumMbsRadius,n=this._frustumMbsCenter,r=this._frustumPlanes,o=J;if(t.getCorners(o),1===this._viewingMode){const t=e.getAxis(te),a=i(t,n),c=a-s,u=a+s;if(c<=0)return!0;for(const e of r){let s=!0;for(const n of o){const r=i(n,t),o=ee;if(l(o,n,c/r),D(e,o)<=0){s=!1;break}const a=ee;if(l(a,n,u/r),D(e,a)<=0){s=!1;break}}if(s)return!1}}else{const e=n[2]-s,t=n[2]+s;for(const i of r){let s=!0;const n=E(i),r=n[0],a=n[1],c=n[2],u=i[3];for(const i of o){const n=r*i[0]+a*i[1]+u;if(n+c*e<=0||n+c*t<=0){s=!1;break}}if(s)return!1}}return!0}_isCylinderVisibleInFrustum(e){const t=this._frustumMbsCenter,i=this._frustumMbsRadius,s=u(z,t);s[2]=0;const n=e.radius,r=e.getAxis(te);return d(s,r)<=n+i}isGeometryVisible(e){if(!this._useFrustumCulling)return!0;const t=e.geometryObbInRenderSR;return t?.intersectsFrustumConservativeApproximation(this._frustum)??this.isNodeVisible(e)}_isMBSinClippingArea(e){return null==this._clippingArea||0!==B(this._clippingArea,e)}_screenSpaceDiameterMbs(e,t){const i=this.calcCameraDistanceAndUpdateMinmaxWithCone(e);return i<0?.5*Number.MAX_VALUE:t/i*this._screenSizeFactor}calcCameraDistanceAndUpdateMinmaxWithCone(e){const t=this.calculateMbsConeInRenderSR(e),i=t?.calculateSurfaceDistanceFromPoint(this._camPos)??this.calcCameraDistanceAndUpdateMinmax(e);return t&&this._updateMinMaxDistance(i),i}calcCameraDistanceAndUpdateMinmax(e){return this.calcCameraDistanceToCenterAndUpdateMinmax(e)-this.calculateServiceMbsInRenderSRElevationAdjusted(e).radius}calcCameraDistanceToCenterAndUpdateMinmax(e){const t=this.calculateServiceMbsInRenderSRElevationAdjusted(e),i=h(t.center,this._camPos);return this._updateMinMaxDistance(i),i}calcAngleDependentLoD(e){const{center:s,radius:n}=this.calculateServiceMbsInRenderSRElevationAdjusted(e),r=t(K,s,this._camPos),o=(Math.abs(i(s,r))/m(s)+n)/m(r);return Math.min(1,o)}hasLOD(e){return 0!==e.lodMetric}_getDistanceGlobeMode(e,t){const s=m(t.center),n=m(e)-s;l(se,e,i(e,t.center)/_(e));const r=p(t.center,se),a=t.radius;if(r<=a*a)return Math.abs(n);{const r=l(se,t.center,1/s),c=l(ne,r,s-a*a/2/s),u=e,d=o(re,u,c),_=o(re,d,l(oe,r,i(r,d))),p=f(re,c,l(re,_,a/m(_)));let v=h(u,p);if(n>=2e5){const e=o(ne,u,p);let t=i(e,r)/m(e);t<.08&&(t=1e-4),v/=t}return v}}_getDistance(e,t){return this._isGlobalMode?this._getDistanceGlobeMode(e,t):N(e,t)}_updateMinMaxDistance(e){e>0?(this.minDistance=Math.min(this.minDistance,e),this.maxDistance=Math.max(this.maxDistance,e)):(this.minDistance=0,this.maxDistance=Math.max(this.maxDistance,-e))}getLodLevel(e){if(0===e.lodMetric)return 0;if(0===e.childCount)return this.maxLodLevel;if(this._useFrustumCulling&&this._progressiveLoadFactor<1){const t=this._progressiveLoadFactor*this._screenspaceErrorBias,i=this._screenspaceErrorBias;return this.evaluateLODmetric(e,t)?this.evaluateLODmetric(e,i)?2:1:0}return this.evaluateLODmetric(e,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(e,t){switch(e.lodMetric){case 1:{let i=this._screenSpaceDiameterMbs(e,(e.serviceMbsInIndexSR?.radius??0)*t);return this._options.angleDependentLoD&&(i*=this.calcAngleDependentLoD(e)),i<e.maxError}case 2:{const i=this.calculateServiceMbsInRenderSRElevationAdjusted(e),s=this._getDistance(this._camPos,i),n=2*s/this._screenSizeFactor,r=s+i.radius;return this._updateMinMaxDistance(r),e.maxError*t<=n}case 3:return this._screenSpaceDiameterMbs(e,e.maxError)*t<10;case 4:return this.calcCameraDistanceAndUpdateMinmax(e)>e.maxError*t}return!1}distToCameraPOIRay(e){if(null==e)return 0;const t=this.calculateServiceMbsInRenderSRElevationAdjusted(e),s=t.center,n=i(s,this._cameraPOIDirection),r=n*n,o=_(s)-r;return Math.sqrt(o)-t.radius}distCameraToPOI(){return h(this._camPos,this._poi)}}function N(e,t){const i=e[0]-t.center[0],s=e[1]-t.center[1],n=e[2]-t.center[2],r=i*i+s*s,o=t.radius;if(r<=o*o)return Math.abs(n);const a=Math.sqrt(r)-o;return Math.sqrt(n*n+a*a)}const T=I(),k=v(),z=v(),W=v(),H=v(),Z=v(),X=new y,Y=v(),J=[v(),v(),v(),v(),v(),v(),v(),v()],K=v(),Q=v(),$=v(),ee=v(),te=v(),ie=new A,se=v(),ne=v(),re=v(),oe=v();function ae(e,t,i){if(2===i)e.center[2]+=t;else{const i=m(e.center);l(e.center,e.center,1+t/i)}}const ce=.001;export{q as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import e from"../../../../renderers/PointCloudClassBreaksRenderer.js";import r from"../../../../renderers/PointCloudStretchRenderer.js";import o from"../../../../renderers/PointCloudUniqueValueRenderer.js";import{createGeometryIndexFromSchema as t,createTypedView as n,readBinaryAttribute as l}from"./I3SBinaryReader.js";import{decodeXYZ as s}from"./LEPCC.js";function i(t,n,l,s){const{rendererJSON:i,isRGBRenderer:u}=t;let c=null,a=null;if(n&&u)c=n;else if(n&&"pointCloudUniqueValueRenderer"===i?.type){a=o.fromJSON(i);const e=a.colorUniqueValueInfos;c=new Uint8Array(3*s);const r=d(a.fieldTransformType);for(let o=0;o<s;o++){const t=(r?r(n[o]):n[o])+"";for(let r=0;r<e.length;r++)if(e[r].values.includes(t)){c[3*o]=e[r].color.r,c[3*o+1]=e[r].color.g,c[3*o+2]=e[r].color.b;break}}}else if(n&&"pointCloudStretchRenderer"===i?.type){a=r.fromJSON(i);const e=a.stops;c=new Uint8Array(3*s);const o=d(a.fieldTransformType);for(let r=0;r<s;r++){const t=o?o(n[r]):n[r],l=e.length-1;if(t<e[0].value)c[3*r]=e[0].color.r,c[3*r+1]=e[0].color.g,c[3*r+2]=e[0].color.b;else if(t>=e[l].value)c[3*r]=e[l].color.r,c[3*r+1]=e[l].color.g,c[3*r+2]=e[l].color.b;else for(let o=1;o<e.length;o++)if(t<e[o].value){const n=(t-e[o-1].value)/(e[o].value-e[o-1].value);c[3*r]=e[o].color.r*n+e[o-1].color.r*(1-n),c[3*r+1]=e[o].color.g*n+e[o-1].color.g*(1-n),c[3*r+2]=e[o].color.b*n+e[o-1].color.b*(1-n);break}}}else if(n&&"pointCloudClassBreaksRenderer"===i?.type){a=e.fromJSON(i);const r=a.colorClassBreakInfos;c=new Uint8Array(3*s);const o=d(a.fieldTransformType);for(let e=0;e<s;e++){const t=o?o(n[e]):n[e];for(let o=0;o<r.length;o++)if(t>=r[o].minValue&&t<=r[o].maxValue){c[3*e]=r[o].color.r,c[3*e+1]=r[o].color.g,c[3*e+2]=r[o].color.b;break}}}else c=new Uint8Array(3*s).fill(255);if(l&&a?.colorModulation){const e=a.colorModulation.minValue,r=a.colorModulation.maxValue,o=.3;for(let t=0;t<s;t++){const n=l[t],s=n>=r?1:n<=e?o:o+(1-o)*(n-e)/(r-e);c[3*t]=s*c[3*t],c[3*t+1]=s*c[3*t+1],c[3*t+2]=s*c[3*t+2]}}return c}function u(e,r){if(null==e.encoding||""===e.encoding){const o=t(r,e);if(null==o.vertexAttributes.position)return;const l=n(r,o.vertexAttributes.position),s=o.header.fields,i=[s.offsetX,s.offsetY,s.offsetZ],u=[s.scaleX,s.scaleY,s.scaleZ],c=l.length/3,a=new Float64Array(3*c);for(let e=0;e<c;e++)a[3*e]=l[3*e]*u[0]+i[0],a[3*e+1]=l[3*e+1]*u[1]+i[1],a[3*e+2]=l[3*e+2]*u[2]+i[2];return a}if("lepcc-xyz"===e.encoding)return s(r).result}function c(e,r,o){return e?.attributeInfo.useElevation?r?a(r,o):null:e?.attributeInfo.storageInfo?l(e.attributeInfo.storageInfo,e.buffer,o,!0):null}function a(e,r){const o=new Float64Array(r);for(let t=0;t<r;t++)o[t]=e[3*t+2];return o}function f(e,r,o,t,n){const l=e.length/3;let s=0;for(let i=0;i<l;i++){let l=!0;for(let e=0;e<t.length&&l;e++){const{filterJSON:r}=t[e],o=n[e].values[i];switch(r.type){case"pointCloudValueFilter":{const e="exclude"===r.mode;r.values.includes(o)===e&&(l=!1);break}case"pointCloudBitfieldFilter":{const e=b(r.requiredSetBits),t=b(r.requiredClearBits);(o&e)===e&&0===(o&t)||(l=!1);break}case"pointCloudReturnFilter":{const e=15&o,t=o>>>4&15,n=t>1,s=1===e,i=e===t;let u=!1;for(const o of r.includedReturns)if("last"===o&&i||"firstOfMany"===o&&s&&n||"lastOfMany"===o&&i&&n||"single"===o&&!n){u=!0;break}u||(l=!1);break}}}l&&(o[s]=i,e[3*s]=e[3*i],e[3*s+1]=e[3*i+1],e[3*s+2]=e[3*i+2],r[3*s]=r[3*i],r[3*s+1]=r[3*i+1],r[3*s+2]=r[3*i+2],s++)}return s}function d(e){switch(e){default:case null:case"none":return e=>e;case"low-four-bit":return e=>15&e;case"high-four-bit":return e=>(240&e)>>4;case"absolute-value":return e=>Math.abs(e);case"modulo-ten":return e=>e%10}}function b(e){let r=0;for(const o of e||[])r|=1<<o;return r}export{a as elevationFromPositions,i as evaluateRenderer,f as filterInPlace,c as getAttributeValues,u as readGeometry};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{n as e,b as t,g as s,j as r,B as h}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";class i{constructor(e,t){if(this.h1=e,this.h2=t,!(e<t))throw new Error(`Invalid elevated sphere: ${e}..${t}`)}}class n extends i{constructor(t,s,r){if(super(s,r),this.baseSphere=t,s<=0)throw new Error(`Invalid elevated sphere: ${s}..${r}`);this.axis=e(a(),t.center)}clone(){return new n(this.baseSphere,this.h1,this.h2)}calculateSurfaceDistanceFromPoint(e){const i=t(this.baseSphere.center),{h2:n}=this,c=this.baseSphere.radius;if(i<=c){const s=t(e);return Math.max(0,s-(n+c))}const{axis:o,h1:u}=this,p=c*u/i,l=c*n/i,S=i**2-c**2,d=S/c,f=d*u/i,m=d*n/i,x=s(o,e);if(x<=f-p)return this._distanceSphere(e,u,p);if(x>=m)return this._distanceSphere(e,n,l);const b=Math.sqrt(S),M=c*b/i,v=r(a(),o,x),w=h(v,e),_=M*x/d;if(_<=w)return 0;const q=b*n/i,$=b*x/d;return $<=b*u/i?this._distanceSphere(e,u,p):$>=q?this._distanceSphere(e,n,l):(w-_)*x/$}_distanceSphere(e,t,s){const i=r(a(),this.axis,t),n=h(i,e);return n<s?0:n-s}}class c extends i{constructor(e,t,s){super(t,s),this.baseSphere=e}clone(){return new c(this.baseSphere,this.h1,this.h2)}calculateSurfaceDistanceFromPoint(e){const{center:t,radius:s}=this.baseSphere,r=e[2],h=(e[0]-t[0])**2+(e[1]-t[1])**2,{h1:a,h2:i}=this;return r<=a?Math.max(0,Math.sqrt(h+(r-a)**2)-s):r>=i?Math.max(0,Math.sqrt(h+(r-i)**2)-s):Math.max(0,Math.sqrt(h)-s)}}export{i as SphereCone,n as SphereConeGlobal,c as SphereCylinderLocal};
|