@arcgis/core 4.23.0-next.20220126 → 4.23.0-next.20220130
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/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02fbc76dfdc20e628c61.js +1 -0
- package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +1 -0
- package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
- package/assets/esri/core/workers/chunks/0cd0a6eef51fc5b9ea61.js +1 -0
- package/assets/esri/core/workers/chunks/{97ec9eef0048760fa260.js → 0d02c6ad1f4688bfa374.js} +1 -1
- package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +1 -0
- package/assets/esri/core/workers/chunks/0e17691520d890d34efb.js +1 -0
- package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +1 -0
- package/assets/esri/core/workers/chunks/{0ce1dc14280d6f188468.js → 17de7a324dfa7f57ad5d.js} +1 -1
- package/assets/esri/core/workers/chunks/{b313ab14a643273e7d09.js → 1877ab1b6a115dbba1c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
- package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +1 -0
- package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +1 -0
- package/assets/esri/core/workers/chunks/1c733b7db092a2a88ef3.js +1 -0
- package/assets/esri/core/workers/chunks/1f8c6a179e39fd4c5e6f.js +1 -0
- package/assets/esri/core/workers/chunks/2076fcbae63f1bfb7143.js +1 -0
- package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
- package/assets/esri/core/workers/chunks/27474b007988855bea9d.js +1 -0
- package/assets/esri/core/workers/chunks/281b89dbf5574fc642ae.js +1 -0
- package/assets/esri/core/workers/chunks/2c8fe9bc988c3c5760a5.js +1 -0
- package/assets/esri/core/workers/chunks/34b59d7099904dcb28b5.js +1 -0
- package/assets/esri/core/workers/chunks/357033117dfe61eb81ea.js +1 -0
- package/assets/esri/core/workers/chunks/{b2ebe4f6d100e15b512d.js → 37c03cfc19086ce631c6.js} +1 -1
- package/assets/esri/core/workers/chunks/386f86f961146f530aa7.js +1 -0
- package/assets/esri/core/workers/chunks/{e6165e17fbb07bfc40a1.js → 391e96192d1ec4e55ce2.js} +1 -1
- package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
- package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
- package/assets/esri/core/workers/chunks/{c959e0d1cf7dce0421b9.js → 48fa8aed6c24877b44c4.js} +1 -1
- package/assets/esri/core/workers/chunks/{438f0b5ae5c53ae4f06a.js → 4954fd86b48cc68b737c.js} +1 -1
- package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
- package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +1 -0
- package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +1 -0
- package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +1 -0
- package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
- package/assets/esri/core/workers/chunks/{b9c177524b3e7de1ffd1.js → 5790d171072b3c7d108f.js} +1 -1
- package/assets/esri/core/workers/chunks/{5dfe1f8d520025e2118b.js → 57b349d1dbc0bed75b79.js} +1 -1
- package/assets/esri/core/workers/chunks/{97a28641b3b2fd31bea2.js → 5bcb3240b3c005e5fe72.js} +1 -1
- package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +1 -0
- package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +1 -0
- package/assets/esri/core/workers/chunks/5ec98f4ddac707d0fbd1.js +1 -0
- package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +1 -0
- package/assets/esri/core/workers/chunks/{ba5eb394f098968c22d2.js → 655b55ac0cd533d7e9d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{b0b036ad3ad3cd956747.js → 69fd99b7c76e9992ccf3.js} +1 -1
- package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +1 -0
- package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
- package/assets/esri/core/workers/chunks/{cc146c57bbdac8029fd8.js → 7a5f5acfbd4ca1a5c1f3.js} +1 -1
- package/assets/esri/core/workers/chunks/83d00afae4406ec78bc9.js +1 -0
- package/assets/esri/core/workers/chunks/{434b16731c6a81f868ef.js → 85b1f36790df95b17659.js} +1 -1
- package/assets/esri/core/workers/chunks/89820b200ee44e678af5.js +1 -0
- package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
- package/assets/esri/core/workers/chunks/{94b8dbf859df71858d1c.js → 929c9b7cdab7c4ca3d87.js} +1 -1
- package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
- package/assets/esri/core/workers/chunks/{601e697dc7414bda128a.js → 952980635afc7ec81804.js} +1 -1
- package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +1 -0
- package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
- package/assets/esri/core/workers/chunks/{010a71c2aa1b7681e191.js → 9d11f84e6c893b9d0019.js} +1 -1
- package/assets/esri/core/workers/chunks/a1930e4f035bc9aa1ae5.js +1 -0
- package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +1 -0
- package/assets/esri/core/workers/chunks/{f760a3e030b0f358a92a.js → aeaa1667c2d9f1b3366b.js} +1 -1
- package/assets/esri/core/workers/chunks/{3f343f792fd9f44d6f25.js → b3f5e91116112b0b612a.js} +1 -1
- package/assets/esri/core/workers/chunks/b97953694f42bfec1b3c.js +1 -0
- package/assets/esri/core/workers/chunks/b9e9cb354822c6d995a4.js +1 -0
- package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +1 -0
- package/assets/esri/core/workers/chunks/{e4b84ca8ddfd48dd79b1.js → bac9fc90e6756e211160.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c76146014dc15143ba3.js → be588873c16770ceb9ef.js} +1 -1
- package/assets/esri/core/workers/chunks/bf97a933ea3b220115e1.js +1 -0
- package/assets/esri/core/workers/chunks/bfedd6ebff817c9b31c0.js +1 -0
- package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +1 -0
- package/assets/esri/core/workers/chunks/c1135cb02ec46c491459.js +1 -0
- package/assets/esri/core/workers/chunks/{e4e2036373166c1d5cf5.js → c2253a9f29c1aabb2b75.js} +1 -1
- package/assets/esri/core/workers/chunks/d04fca5d46cca02500b7.js +1 -0
- package/assets/esri/core/workers/chunks/d08efbc349dd9f999497.js +1 -0
- package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
- package/assets/esri/core/workers/chunks/{a8b13fb804bb775e4967.js → db3c729ce0c0b2690dc9.js} +1 -1
- package/assets/esri/core/workers/chunks/dd13772a5e2eccc6a2bc.js +1 -0
- package/assets/esri/core/workers/chunks/dedc333a61081772ca7b.js +1 -0
- package/assets/esri/core/workers/chunks/{6f50a9647f026a8d4729.js → e0c8d61c7a85ce15499a.js} +1 -1
- package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
- package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
- package/assets/esri/core/workers/chunks/e287f49184d076af17e2.js +1 -0
- package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
- package/assets/esri/core/workers/chunks/e8e775758b79c5a084c8.js +1 -0
- package/assets/esri/core/workers/chunks/e93dfdede0532a89ffa5.js +1 -0
- package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +1 -0
- package/assets/esri/core/workers/chunks/eb82ff10cef2bde6e57f.js +1 -0
- package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
- package/assets/esri/core/workers/chunks/{1305ef8717da6e902a55.js → ec10151a2a95e95a0bb5.js} +1 -1
- package/assets/esri/core/workers/chunks/eccba071ced2d922bb85.js +1 -0
- package/assets/esri/core/workers/chunks/ee6e0db58dc64410e687.js +1 -0
- package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
- package/assets/esri/core/workers/chunks/f2124f4d0f2b8a91f0ea.js +1 -0
- package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/dark-blue/main.css +1 -1
- package/assets/esri/themes/dark-green/main.css +1 -1
- package/assets/esri/themes/dark-purple/main.css +1 -1
- package/assets/esri/themes/dark-red/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/themes/light-blue/main.css +1 -1
- package/assets/esri/themes/light-green/main.css +1 -1
- package/assets/esri/themes/light-purple/main.css +1 -1
- package/assets/esri/themes/light-red/main.css +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
- package/chunks/BlendLayers.glsl.js +2 -2
- package/chunks/ChapmanAtmosphere.glsl.js +17 -17
- package/chunks/CheckerBoard.glsl.js +3 -3
- package/chunks/Clouds.glsl.js +2 -2
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +12 -12
- package/chunks/ComponentShader.glsl.js +3 -3
- package/chunks/Compositing.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +33 -33
- package/chunks/EdgeShaderProgram.glsl.js +7 -7
- package/chunks/Fog.glsl.js +10 -12
- package/chunks/HUDMaterial.glsl.js +2 -2
- package/chunks/HighlightComposition.glsl.js +5 -5
- package/chunks/ImageMaterial.glsl.js +6 -6
- package/chunks/LaserlinePath.glsl.js +8 -8
- package/chunks/LineCallout.glsl.js +6 -6
- package/chunks/MeasurementArrow.glsl.js +1 -1
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/Path.glsl.js +5 -5
- package/chunks/Pattern.glsl.js +9 -9
- package/chunks/PointRenderer.glsl.js +14 -14
- package/chunks/Precipitation.glsl.js +91 -0
- package/chunks/RealisticTree.glsl.js +21 -21
- package/chunks/RibbonLine.glsl.js +11 -11
- package/chunks/SMAA.glsl.js +40 -40
- package/chunks/ShadedColorMaterial.glsl.js +12 -12
- package/chunks/ShadowCast.glsl.js +6 -6
- package/chunks/ShadowHighlight.glsl.js +4 -4
- package/chunks/SimpleAtmosphere.glsl.js +3 -3
- package/chunks/SlicePlaneMaterial.glsl.js +3 -3
- package/chunks/Stars.glsl.js +3 -3
- package/chunks/Terrain.glsl.js +11 -11
- package/chunks/TextureOnly.glsl.js +2 -2
- package/chunks/WaterSurface.glsl.js +5 -5
- package/chunks/boundedPlane.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/clock.js +1 -1
- package/core/jsonMap.js +1 -1
- package/core/loadAll.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/reactiveUtils.js +1 -1
- package/form/ExpressionInfo.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +232 -38
- package/layers/VectorTileLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/package.json +1 -1
- package/rest/print.js +1 -1
- package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
- package/support/arcadeOnDemand.js +1 -1
- package/support/featureFlags.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/FillSymbol3DLayer.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/ObjectSymbol3DLayer.js +1 -1
- package/symbols/Symbol3D.js +1 -1
- package/symbols/WebStyleSymbol.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/support/IconSymbol3DLayerResource.js +1 -1
- package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
- package/symbols/support/Symbol3DFillMaterial.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/Thumbnail.js +1 -1
- package/symbols/support/webStyleSymbolUtils.js +1 -1
- package/views/2d/MapViewConstraints.js +1 -1
- package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsComposition.glsl.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/CloudsPresets.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.glsl.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.glsl.js +5 -0
- package/views/3d/environment/Precipitation.js +5 -0
- package/views/3d/environment/PrecipitationTechnique.js +5 -0
- package/views/3d/environment/RainyWeather.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/SnowyWeather.js +5 -0
- package/views/3d/environment/Stars.glsl.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/environment/weather.js +1 -1
- package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
- package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/lineUtils.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/symbolComplexity.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
- package/views/3d/layers/support/overlayImageUtils.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/support/LaserlinePathData.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
- package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +10 -10
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureUniformName.js +4 -0
- package/views/3d/webgl-engine/lib/UniformName.js +4 -0
- package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
- package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/input/recognizers/DoubleTapDrag.js +1 -1
- package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
- package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
- package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/WatchUpdatingTracking.js +1 -1
- package/views/support/projectionUtils.js +5 -0
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/InstanceCounter.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/webdoc/support/{Thumbnail.js → SlideThumbnail.js} +1 -1
- package/webmap/Bookmark.js +1 -1
- package/webmap/Version.js +1 -1
- package/webscene/Slide.js +1 -1
- package/webscene/Version.js +1 -1
- package/webscene/support/SlideVisibleLayer.js +1 -1
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather/enums.js +5 -0
- package/widgets/Weather.js +1 -1
- package/widgets/support/InteractiveToolViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/00c5bb5eecb0e89266df.js +0 -1
- package/assets/esri/core/workers/chunks/021a37e2b191298e80b7.js +0 -1
- package/assets/esri/core/workers/chunks/1370c92c40fd6271553c.js +0 -1
- package/assets/esri/core/workers/chunks/14bef72154b3a19561a7.js +0 -1
- package/assets/esri/core/workers/chunks/18668dc45eb9e35530df.js +0 -1
- package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +0 -1
- package/assets/esri/core/workers/chunks/1fbcc8424452d0256bd6.js +0 -1
- package/assets/esri/core/workers/chunks/208a7e24e19fc5633dd7.js +0 -1
- package/assets/esri/core/workers/chunks/22b09e276c9b9f22f0f8.js +0 -1
- package/assets/esri/core/workers/chunks/23b15e7c2f96d260e16c.js +0 -1
- package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +0 -1
- package/assets/esri/core/workers/chunks/2792ca40f1e92849247c.js +0 -1
- package/assets/esri/core/workers/chunks/2a96f1bba9ce6883e5e0.js +0 -1
- package/assets/esri/core/workers/chunks/3231ee3e090bb4cac3fc.js +0 -1
- package/assets/esri/core/workers/chunks/36a3f6fb4d1d18fcb642.js +0 -1
- package/assets/esri/core/workers/chunks/36e250278b5622ccf068.js +0 -1
- package/assets/esri/core/workers/chunks/395ba088d4864588ff66.js +0 -1
- package/assets/esri/core/workers/chunks/3aa4194dc5497c57647f.js +0 -1
- package/assets/esri/core/workers/chunks/3cc77692b2eee27b9c9e.js +0 -1
- package/assets/esri/core/workers/chunks/40a1e713f63ec77110c0.js +0 -1
- package/assets/esri/core/workers/chunks/4385a268c2a64281d1c1.js +0 -1
- package/assets/esri/core/workers/chunks/46b4bb66a54bbd8e2e57.js +0 -1
- package/assets/esri/core/workers/chunks/4bfbf5a34c9207fdcf44.js +0 -1
- package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +0 -1
- package/assets/esri/core/workers/chunks/5d4863a92b03bebc1b54.js +0 -1
- package/assets/esri/core/workers/chunks/5d991b74d958005c26c4.js +0 -1
- package/assets/esri/core/workers/chunks/634b5ccd7a3ac67f855d.js +0 -1
- package/assets/esri/core/workers/chunks/662d13f68cf3ec92439b.js +0 -1
- package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
- package/assets/esri/core/workers/chunks/7bc5cc5dbf1b7b70ddac.js +0 -1
- package/assets/esri/core/workers/chunks/7d661129a0d8c466eeec.js +0 -1
- package/assets/esri/core/workers/chunks/8070972c0efb78523b68.js +0 -1
- package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +0 -1
- package/assets/esri/core/workers/chunks/8b6ab6202a40fe622833.js +0 -1
- package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +0 -1
- package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
- package/assets/esri/core/workers/chunks/98986e6601b0366376b4.js +0 -1
- package/assets/esri/core/workers/chunks/9cdcf9309d6feda70185.js +0 -1
- package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +0 -1
- package/assets/esri/core/workers/chunks/aace7e1fef256bb961c9.js +0 -1
- package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +0 -1
- package/assets/esri/core/workers/chunks/af5694b4d278cf1db2d9.js +0 -1
- package/assets/esri/core/workers/chunks/afbb4f802ca5774f0326.js +0 -1
- package/assets/esri/core/workers/chunks/b2c5f92e3d7606297ca9.js +0 -1
- package/assets/esri/core/workers/chunks/b8316c6469a543029bc6.js +0 -1
- package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +0 -1
- package/assets/esri/core/workers/chunks/ba6654a885be4b7a43f0.js +0 -1
- package/assets/esri/core/workers/chunks/bf0a65b4be31959f921d.js +0 -1
- package/assets/esri/core/workers/chunks/c11474b702dfb94e8e87.js +0 -1
- package/assets/esri/core/workers/chunks/c890c7fca27170e3341f.js +0 -1
- package/assets/esri/core/workers/chunks/c976785f2391c77d8a30.js +0 -1
- package/assets/esri/core/workers/chunks/ca2f5faa01d99c21ec14.js +0 -1
- package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +0 -1
- package/assets/esri/core/workers/chunks/cfbffa429d88e7709c3f.js +0 -1
- package/assets/esri/core/workers/chunks/d24c4fbc567486b1188f.js +0 -1
- package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
- package/assets/esri/core/workers/chunks/e4f93c55eaefab4192b5.js +0 -1
- package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
- package/assets/esri/core/workers/chunks/ec89466f76d0ba22525e.js +0 -1
- package/assets/esri/core/workers/chunks/ee45618c45806ab654cb.js +0 -1
- package/assets/esri/core/workers/chunks/f467c8f1fce22f6f599c.js +0 -1
- package/assets/esri/core/workers/chunks/f4baa5ea2e42b1317941.js +0 -1
- package/assets/esri/core/workers/chunks/face43cf5abcd2f5bd9d.js +0 -1
- package/assets/esri/core/workers/chunks/ffaf091c6023225cf5aa.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../core/Logger.js";import{lerp as t,clamp as r}from"../../../core/mathUtils.js";import{removeMaybe as i,disposeMaybe as s,abortMaybe as o,isNone as a}from"../../../core/maybe.js";import{createResolver as n,isAbortError as h}from"../../../core/promiseUtils.js";import{init as m}from"../../../core/watchUtils.js";import{n as l}from"../../../chunks/mat4.js";import{c}from"../../../chunks/mat4f64.js";import{s as d}from"../../../chunks/vec2.js";import{a as u}from"../../../chunks/vec2f64.js";import{l as p,a as f,b as _,i as g,c as R,p as
|
|
5
|
+
import e from"../../../core/Logger.js";import{lerp as t,clamp as r}from"../../../core/mathUtils.js";import{removeMaybe as i,disposeMaybe as s,abortMaybe as o,isNone as a}from"../../../core/maybe.js";import{createResolver as n,isAbortError as h}from"../../../core/promiseUtils.js";import{init as m}from"../../../core/watchUtils.js";import{n as l}from"../../../chunks/mat4.js";import{c}from"../../../chunks/mat4f64.js";import{s as d}from"../../../chunks/vec2.js";import{a as u}from"../../../chunks/vec2f64.js";import{l as p,a as f,b as _,i as g,c as R,p as x}from"../../../chunks/vec3.js";import{c as C}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as V}from"../../../geometry/projectionEllipsoid.js";import{isMars as j}from"../../../geometry/support/spatialReferenceUtils.js";import{requestImage as y}from"../../../support/requestImageUtils.js";import{computeInnerAltitudeFade as v,innerAtmosphereDepth as b}from"./atmosphereUtils.js";import{S as U}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechniqueConfiguration as A,SimpleAtmosphereTechnique as T}from"./SimpleAtmosphereTechnique.js";import w from"./resources/MarsAtmosphereTexture.js";import D from"./resources/SimpleAtmosphereTexture.js";import{makePiecewiseLinearFunction as q}from"../support/mathUtils.js";import{glLayout as S}from"../support/buffer/glUtil.js";import{newLayout as F}from"../support/buffer/InterleavedLayout.js";import{Default3D as M}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createQuadVAO as I}from"../webgl-engine/lib/glUtil3D.js";import{project as L}from"../webgl-engine/lib/Util.js";import{VertexAttribute as O}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as E}from"../../webgl/BufferObject.js";import{PixelFormat as W,PixelType as k,TextureWrapMode as P,TextureSamplingMode as N,PrimitiveType as G,Usage as B}from"../../webgl/enums.js";import{Texture as H}from"../../webgl/Texture.js";import{vertexCount as z}from"../../webgl/Util.js";import{VertexArrayObject as Y}from"../../webgl/VertexArrayObject.js";const J=e.getLogger("esri.views.3d.environment.SimpleAtmosphere"),K=128,Q=-b,X=0,Z=50,$=()=>1-511/512,ee=q([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);class te{constructor(e){this.view=e,this.type="simple",this._renderData={texV:u(),silCircleCenter:C(),silCircleV1:C(),silCircleV2:C(),altitudeFade:0,innerScale:0,undergroundFadeAlpha:0},this._fadeVaoCount=0,this._readyResolver=n(),this._readyController=new AbortController,this.texV1=1,this.canRender=!0,this.isOnMars=j(e.spatialReference);const t=V(e.spatialReference);this.planetRadius=t.radius,this.outerRimWidth=t.outerAtmosphereRimWidth,this.innerRimFactor=(this.planetRadius+Q)/this.planetRadius,this.middleRimFactor=(this.planetRadius+X)/this.planetRadius,this.outerRimFactor=(this.planetRadius+this.outerRimWidth)/this.planetRadius,this.texV0=X/this.outerRimWidth,this.texVScale=this.texV1-this.texV0}destroy(){this._readyResolver.reject(),this._cameraChangeHandle=i(this._cameraChangeHandle),this._texture=s(this._texture),this._fadeVao=s(this._fadeVao),this._vao=s(this._vao),this._readyController=o(this._readyController)}when(){return this._readyResolver.promise}initializeRenderContext(e){this._shaderTechniqueRepository=e.shaderTechniqueRep;const t=e.renderContext.rctx;this._cameraChangeHandle=m(this.view,"state.camera",(()=>e.requestRender()),!0),this._vao=this._createRibbon(t),this._vaoCount=z(this._vao,"geometry"),this._fadeVao=I(t),this._fadeVaoCount=z(this._fadeVao,"geometry"),y(this.isOnMars?w:D,{signal:this._readyController.signal}).then((r=>{this._texture=new H(t,{pixelFormat:W.RGBA,dataType:k.UNSIGNED_BYTE,wrapMode:P.CLAMP_TO_EDGE,samplingMode:N.LINEAR,flipped:!0},r),e.requestRender(),this._readyController=null,this._readyResolver.resolve()})).catch((e=>{h(e)||J.error("Unable to initialize simple atmosphere: image request failed",e),this._readyResolver.reject(e)}))}get atmosphereConeTechnique(){if(a(this._atmosphereConeTechnique)){const e=new A;e.geometry=U.Cone,this._atmosphereConeTechnique=this._shaderTechniqueRepository.acquire(T,e)}return this._atmosphereConeTechnique}get atmosphereUndergroundTechnique(){if(a(this._atmosphereUndergroundTechnique)){const e=new A;e.geometry=U.Underground,this._atmosphereUndergroundTechnique=this._shaderTechniqueRepository.acquire(T,e)}return this._atmosphereUndergroundTechnique}render(e){this._update(e.camera);const t=e.rctx;if(this.atmosphereConeTechnique.bindPipelineState(t),this._renderData.undergroundFadeAlpha<1){const r=this.atmosphereConeTechnique.program;t.useProgram(r),r.setUniformMatrix4fv("proj",e.camera.projectionMatrix),r.setUniformMatrix4fv("view",e.camera.viewMatrix),r.setUniform3fv("silCircleCenter",this._renderData.silCircleCenter),r.setUniform3fv("silCircleV1",this._renderData.silCircleV1),r.setUniform3fv("silCircleV2",this._renderData.silCircleV2),r.setUniform2fv("texV",this._renderData.texV),r.bindTexture(this._texture,"tex"),e.scenelightingData.setLightDirectionUniform(r),r.setUniform1f("altitudeFade",this._renderData.altitudeFade),r.setUniform1f("innerScale",this._renderData.innerScale),t.bindVAO(this._vao),t.drawArrays(G.TRIANGLES,0,this._vaoCount)}if(this._renderData.undergroundFadeAlpha>0){const r=this.atmosphereUndergroundTechnique.program;t.useProgram(r),r.setUniform1f("undergroundFadeAlpha",this._renderData.undergroundFadeAlpha),e.scenelightingData.setLightDirectionUniform(r),r.setUniform3fv("cameraPosition",e.camera.eye),t.bindVAO(this._fadeVao),t.drawArrays(G.TRIANGLE_STRIP,0,this._fadeVaoCount)}}renderHaze(){return!1}_update(e){const i=C(),s=this.planetRadius,o=p(e.eye),a=o-s;if(a<0){const e=Math.min(-a/5e3,1);this._renderData.undergroundFadeAlpha=e}else this._renderData.undergroundFadeAlpha=0;const n=Math.max(Z,a),h=s+Q;this._renderData.innerScale=ae(s+n,s,h)-1,this._renderData.altitudeFade=v(a),f(i,e.eye,(s+Z)/o),re(i,e.center,e.up,s,this._renderData);const m=this._computeScreenRimWidth(e,i,e.up,this._renderData),l=$(),c=ee(a);let u=this.texV0+l*this.texVScale,_=this.texV0+m*c*this.texVScale;if(a>Z){re(e.eye,e.center,e.up,s,this._renderData);const i=this._computeScreenRimWidth(e,e.eye,e.up,this._renderData),o=r((i-1.5)/(m-1.5),0,1);u=this.texV0+o*l*this.texVScale,_=this.texV0+t(this.texV1,m*c,o)*this.texVScale}d(this._renderData.texV,u,_)}_createRibbon(e){const t=new Float32Array(3+3*K*3),r=new Uint32Array(3*K*5);t[0]=0,t[1]=0,t[2]=-1;for(let o=0;o<K;o++){const e=9*o+3;t[e+0]=o,t[e+1]=this.innerRimFactor,t[e+2]=-1,t[e+3]=o,t[e+4]=this.middleRimFactor,t[e+5]=0,t[e+6]=o,t[e+7]=this.outerRimFactor,t[e+8]=1;const i=3*o+1,s=o===K-1?1:i+3,a=15*o;r[a+0]=i,r[a+1]=i+1,r[a+2]=s+1,r[a+3]=s+1,r[a+4]=s,r[a+5]=i,r[a+6]=i+1,r[a+7]=i+2,r[a+8]=s+2,r[a+9]=s+2,r[a+10]=s+1,r[a+11]=i+1,r[a+12]=i,r[a+13]=s,r[a+14]=0}const i=ne.createBuffer(r.length),s=i.position;for(let o=0;o<r.length;++o){const e=3*r[o];s.set(o,0,t[e]),s.set(o,1,t[e+1]),s.set(o,2,t[e+2])}return new Y(e,M,{geometry:S(ne)},{geometry:E.createVertex(e,B.STATIC_DRAW,i.buffer)})}_computeScreenRimWidth(e,t,r,i){return _(se,i.silCircleCenter,i.silCircleV2),f(oe,se,this.outerRimFactor),l(ie,t,se,r),L(se,ie,e.projectionMatrix,e.viewport),L(oe,ie,e.projectionMatrix,e.viewport),g(se,oe)/e.height}}function re(e,t,r,i,s){const o=p(e),a=i*Math.sqrt(o*o-i*i)/o,n=Math.sqrt(i*i-a*a),h=s.silCircleV1,m=s.silCircleV2;return f(s.silCircleCenter,e,n/o),R(h,e,t),x(h)<1&&R(h,e,r),f(h,h,a/p(h)),R(m,h,e),f(m,m,a/p(m)),a}const ie=c(),se=C(),oe=C();function ae(e,t,r){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-r*r)+t*r)}const ne=F().vec3f(O.POSITION);export{te as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as o}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{enumeration as t}from"../../../core/accessorSupport/decorators/enumeration.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";var p;let i=p=class extends r{constructor(o){super(o),this.type="snowy",this.cloudCover=.5,this.precipitation=.5}clone(){return new p({cloudCover:this.cloudCover,precipitation:this.precipitation})}};o([t({snowy:"snowy"})],i.prototype,"type",void 0),o([e({type:Number,nonNullable:!0,range:{min:0,max:1}})],i.prototype,"cloudCover",void 0),o([e({type:Number,nonNullable:!0,range:{min:0,max:1}})],i.prototype,"precipitation",void 0),i=p=o([s("esri.views.3d.environment.SnowyWeather")],i);const c=i;export{c 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/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js";import"../webgl-engine/core/shaderModules/interfaces.js";import"../webgl-engine/core/shaderModules/ShaderBuilder.js";import"../webgl-engine/lib/
|
|
5
|
+
import"../webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js";import"../webgl-engine/core/shaderModules/interfaces.js";import"../webgl-engine/core/shaderModules/ShaderBuilder.js";import"../webgl-engine/lib/VertexAttribute.js";export{b as build}from"../../../chunks/Stars.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{fetchAsset as e}from"../../../assets.js";import r from"../../../core/Accessor.js";import s from"../../../core/Error.js";import
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{fetchAsset as e}from"../../../assets.js";import r from"../../../core/Accessor.js";import s from"../../../core/Error.js";import i from"../../../core/Logger.js";import{isSome as a,abortMaybe as o,disposeMaybe as n,isNone as c}from"../../../core/maybe.js";import{createTask as f,isAbortError as u}from"../../../core/promiseUtils.js";import{initial as h}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{c as p,g as l,m as g}from"../../../chunks/mat4.js";import{c as _,f as b}from"../../../chunks/mat4f64.js";import{StarsTechnique as v}from"./StarsTechnique.js";import{glLayout as y}from"../support/buffer/glUtil.js";import{newLayout as j}from"../support/buffer/InterleavedLayout.js";import{Default3D as w}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{VertexAttribute as T}from"../webgl-engine/lib/VertexAttribute.js";import{WatchUpdatingTracking as k}from"../../support/WatchUpdatingTracking.js";import{BufferObject as D}from"../../webgl/BufferObject.js";import{PrimitiveType as P,Usage as x}from"../../webgl/enums.js";import{VertexArrayObject as A}from"../../webgl/VertexArrayObject.js";const S=i.getLogger("esri.views.3d.environment.Stars");let O=class extends r{constructor(t){super(t),this._loadDataTask=null,this._numPoints=0,this._renderParameter={camera:null,modelMatrix:_()},this._updatingTracking=new k}get updating(){return this._updatingTracking.updating||this.loading}get loading(){return a(this._loadDataTask)&&!this._loadDataTask.finished}initialize(){this._loadDataTask=this._createLoadDataTask()}destroy(){this._loadDataTask=o(this._loadDataTask),this._updatingTracking.destroy(),this._numPoints=0,this._technique=n(this._technique),this._vao=n(this._vao)}render(t){const{rctx:e,camera:r}=t;if(this._ensureResources(e),c(this._technique)||c(this._vao))return;const s=this._technique.program;e.useProgram(s),this._renderParameter.camera=r,this._technique.bindPass(this._renderParameter),this._technique.bindPipelineState(e),e.bindVAO(this._vao),s.assertCompatibleVertexAttributeLocations(this._vao),e.drawArrays(P.POINTS,0,this._numPoints)}_ensureResources(t){if(a(this._technique)||c(U))return;this._technique=new v({rctx:t,viewingMode:this.view.state.viewingMode},null),this._numPoints=U.byteLength/L;const e=new Float32Array(U,0,2*this._numPoints),r=new Uint8Array(U,2*this._numPoints*4,this._numPoints);this._vao=this._createVertexArrayObject(t,e,r,this._numPoints),this._updatingTracking.add((()=>{var t,e,r;return null==(t=this.view)||null==(e=t.environment)||null==(r=e.lighting)?void 0:r.date}),(t=>this._update(t)),h)}_computeDayDuration(t){const e=t,r=new Date(t.getFullYear(),0,1,11,58,56);return(+e-+r)/(+new Date(t.getFullYear()+1,0,1,11,58,55)-+r)}_update(t){if(!t)return;const e=(t.getHours()/12+t.getMinutes()/60*(2/24)+t.getSeconds()/60*(2/1440)-.9972222)%2,r=2*this._computeDayDuration(t),s=this._renderParameter.modelMatrix;p(s,I),l(s,s,-r*Math.PI),g(s,M,s),l(s,s,-e*Math.PI),this.requestRender()}_hexToRGB(t){return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]}_unpackUint8Attributes(t){return t>=192?[2.9,t-192]:t>=160?[2.5,t-160]:t>=128?[2,t-128]:t>=96?[1.5,t-96]:t>=64?[1,t-64]:t>=32?[.7,t-32]:[.4,t]}_createVertexArrayObject(t,e,r,s){const i=R.createBuffer(s),a=i.position,o=i.color,n=i.size;for(let c=0;c<s;c++){const t=e[2*c+0],s=e[2*c+1];a.set(c,0,-Math.cos(t)*Math.sin(s)),a.set(c,1,-Math.sin(t)*Math.sin(s)),a.set(c,2,-Math.cos(s));const i=this._unpackUint8Attributes(r[c]),f=this._hexToRGB(q[i[1]]);o.set(c,0,255*f[0]),o.set(c,1,255*f[1]),o.set(c,2,255*f[2]),o.set(c,3,255),n.set(c,i[0])}return new A(t,w,{geometry:y(R)},{geometry:D.createVertex(t,x.STATIC_DRAW,i.buffer)})}_createLoadDataTask(){if(a(U))return null;const t=f((async t=>{const{data:r}=await e("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:t});this._verifyStarData(r),U=r}));return t.promise.catch((t=>{u(t)||S.error(t)})).then((()=>{this.destroyed||(this.requestRender(),this.notifyChange("updating"))})),t}_verifyStarData(t){if(!t)throw new s("stars:no-data-received","Failed to create stars because star catalogue is missing");const e=t.byteLength/L;if(e%1!=0||e>5e4||e<5e3)throw new s("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}};t([d({constructOnly:!0})],O.prototype,"view",void 0),t([d({constructOnly:!0})],O.prototype,"requestRender",void 0),t([d({readOnly:!0})],O.prototype,"updating",null),t([d()],O.prototype,"_loadDataTask",void 0),t([d()],O.prototype,"_updatingTracking",void 0),O=t([m("esri.views.3d.environment.Stars")],O);const q=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],M=b(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),I=b(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),L=9,R=j().vec3f(T.POSITION).vec4u8(T.COLOR).f32(T.SIZE);let U=null;export{O as Stars};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"./CloudyWeather.js";import
|
|
5
|
+
import e from"./CloudyWeather.js";import o from"./FoggyWeather.js";import r from"./RainyWeather.js";import t from"./SnowyWeather.js";import n from"./SunnyWeather.js";const y={key:"type",base:null,typeMap:{sunny:n,cloudy:e,rainy:r,snowy:t,foggy:o}},s=1e4;function a(e,o){if(e.type!==o.type)return!1;switch(e.type){case"sunny":case"rainy":case"snowy":case"cloudy":return e.cloudCover===o.cloudCover;case"foggy":return e.fogStrength===o.fogStrength}}export{a as weatherEquals,s as weatherHeightLimit,y as weatherTypes};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/clock.js";import i from"../../../../../core/Handles.js";import{releaseMaybe as a,destroyMaybe as s,isSome as n,isNone as r,removeMaybe as l}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../../../core/scheduling.js";import{createScreenPoint as u,screenPointObjectToArray as c,createScreenPointArray as d}from"../../../../../core/screenUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{d as y,u as P,m as w}from"../../../../../chunks/mat4.js";import{d as g,l as m,g as f,a as M,b as V,m as D,n as T,s as b}from"../../../../../chunks/vec3.js";import{a as k,c as E}from"../../../../../chunks/vec3f64.js";import{c as S,a as H,n as x,f as I}from"../../../../../chunks/boundedPlane.js";import{signedDistance as R,create as j,intersectRay as C,normal as O}from"../../../../../geometry/support/plane.js";import{create as z}from"../../../../../geometry/support/ray.js";import{sv3d as G,sm4d as U,sv2d as L}from"../../../../../geometry/support/vectorStacks.js";import{calculateInputRotationTransform as K}from"../../manipulatorUtils.js";import{PLANE_PREVIEW_OUTLINE_WIDTH as A,forceVerticalModifier as B,forceHorizontalModifier as F,PREVIEW_FADE_DURATION_SECONDS as N,POINTER_MOVE_TIMER_MS as q,PLANE_OUTLINE_COLOR as Z,PLANE_BACKGROUND_COLOR as J,PREVIEW_FADE_DOT_THRESHOLD as Q,INITIAL_DEPTH_OFFSET_FRAC as W}from"./sliceToolConfig.js";import{createShiftManipulator as X,createRotateManipulator as Y,createResizeManipulator as $,createGridVisualElement as tt,createOutlineVisualElement as et,planeToShape as it,createRotatePlane as at,RotationAxis as st,resizePlane as nt,calculatePlaneHalfSize as rt,SliceOrientation as lt,createPlane as ot,DidPointerMoveRecentlyFlag as ht,calculateBoundedPlaneTranslateRotate as pt,updateShiftRestartHandle as ut,updateRotateHeadingHandle as ct,updateRotateTiltHandle as dt,updateResizeHandle as _t,createShiftPlane as vt}from"./sliceToolUtils.js";import{getRotateHeadingTexture as yt,getTiltRotateTexture as Pt}from"./images/Factory.js";import{screenToRenderPlane as wt}from"../../editingTools/dragEventPipeline3D.js";import{fromScreen as gt}from"../../../support/geometryUtils/ray.js";import{newIntersector as mt}from"../../../webgl-engine/lib/Intersector.js";import{StoreResults as ft}from"../../../webgl-engine/lib/IntersectorInterfaces.js";import{createManipulatorDragEventPipeline as Mt}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Vt}from"../../../../interactive/InteractiveToolBase.js";import{createScreenPointFromEvent as Dt}from"../../../../support/screenUtils.js";import Tt from"../../../../../widgets/Slice/SlicePlane.js";let bt=class extends Vt{constructor(t){super(t),this.clock=e,this._previewPlaneOpacity=1,this.analysisView=null,this.layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this.disableEngineLayers=!1,this._handles=new i,this._viewHandles=new i,this._frameTask=null,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=S(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=u(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=mt(t.view.state.viewingMode),this._intersector.options.store=ft.MIN}initialize(){this._initialize()}async _initialize(){const t=()=>{if("creating"===this.toolState||"created"===this.toolState)throw new Error("Unexpected toolState");return!this.destroyed};if(!t())return;if(this.analysisView=await this.view.whenAnalysisView(this.analysis),!t())return;if(null==this.analysis)throw new Error("SliceTool requires valid model, but null was provided.");this.analysisViewData=this.analysisView,this.rotateHeadingImage=yt(this.view.toolViewManager.textures),this.rotateTiltImage=Pt(this.view.toolViewManager.textures);const e=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(n(this.analysisViewData.plane)&&H(this.analysisViewData.plane,this._startPlane),this.inputState=null)};this.shiftManipulator=X(this.view),this.manipulators.add(this.shiftManipulator),this.shiftManipulator.events.on("grab-changed",(t=>{this._onShiftGrab(t),e(this.shiftManipulator)})),this._handles.add(this._createShiftDragPipeline(this.shiftManipulator)),this.rotateHeadingManipulator=Y(this.view,this.rotateHeadingImage.texture),this.manipulators.add(this.rotateHeadingManipulator),this.rotateHeadingManipulator.events.on("grab-changed",(t=>{this._onRotateHeadingGrab(t),e(this.rotateHeadingManipulator)})),this._handles.add(this._createRotateHeadingDragPipeline(this.rotateHeadingManipulator)),this.rotateTiltManipulator=Y(this.view,this.rotateTiltImage.texture),this.manipulators.add(this.rotateTiltManipulator),this.rotateTiltManipulator.events.on("grab-changed",(t=>{this._onRotateTiltGrab(t),e(this.rotateTiltManipulator)})),this._handles.add(this._createRotateTiltDragPipeline(this.rotateTiltManipulator)),this.resizeManipulators=this._resizeHandles.map(((t,i)=>{const a=$(this.view,t);return a.events.on("grab-changed",(t=>{this._onResizeGrab(t,i),e(a)})),this._handles.add(this._createResizeDragPipeline(a)),a})),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=tt(this.view),this._previewPlaneOutlineVisualElement=et(this.view),this._previewPlaneOutlineVisualElement.width=A,this._handles.add(this.analysisViewData.watch("plane",(()=>this._updateManipulators()),!0)),this.startToolCreation();const i=o((()=>this.state),(t=>{"sliced"===t&&this.finishToolCreation()}),h);this._handles.add([i,o((()=>this.view.state.camera),(()=>this._onCameraChange()))])}destroy(){this.rotateHeadingImage=a(this.rotateHeadingImage),this.rotateTiltImage=a(this.rotateTiltImage),this._handles=s(this._handles),this._viewHandles=s(this._viewHandles),this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=s(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=s(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this._get("cursor")}set analysis(t){if(null==t)throw new Error("SliceTool requires valid model, but null was provided.");this._handles.remove("analysis"),this._set("analysis",t)}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisView.showGrid=n(t)&&"resize"===t.type,this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return n(this.inputState)&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){r(this.analysisViewData.plane)||(this._set("layersMode","exclude"),this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){r(this.analysisViewData.plane)||(this._set("layersMode","none"),this.active&&(this.view.activeTool=null))}onDeactivate(){this._updateMouseCursor(),this._set("layersMode","none"),this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this.analysis.visible=t,this._updateMouseCursor(),this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Et(t))return;this._isPlacingSlicePlane?this._onClickPlacePlane(t)&&(t.stopPropagation(),this._updateMouseCursor()):this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t),this._updateMouseCursor();break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Et(t))return;this._onClickPlacePlane(t)&&(t.stopPropagation(),this._updateMouseCursor());break;case"click":if(!Et(t))return;this._onClickExcludeLayer(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisView&&(this.analysisView.editable=this.editable)}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&n(e)&&"shift"===e.type){const i=Dt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Dt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&n(this.analysisViewData.plane)){const e=Dt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),H(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if("exclude"===this.layersMode)return!1;if(this._isPlacingSlicePlane){const e=Dt(t),i=S();if(this._pickPlane(e,!1,this._activeKeyModifiers,i)){if(H(i,this._startPlane),this.analysis.shape=it(i,this.view,this.view.spatialReference,new Tt),"pointer-drag"===t.type){const a=this._calculatePickRay(e);this.inputState=kt(a,t.pointerId,i.origin,i)}return!0}}return!1}_onClickExcludeLayer(t){return!("exclude"!==this.layersMode||!this.created)&&(this.view.hitTest(Dt(t)).then((t=>{if(t.results.length){const e=t.results[0],i=e&&e.graphic;if(i){const t=i.sourceLayer||i.layer;t&&this.analysis.excludedLayers.push(t)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0})),this._set("layersMode","none"),this.active&&(this.view.activeTool=null),!0)}_onKeyDown(t){return(t.key===B||t.key===F)&&(this._activeKeyModifiers[t.key]=!0,n(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==B&&t.key!==F||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],n(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=this._calculatePickRay(t.screenPoint);H(this.analysisViewData.plane,this._startPlane),this.inputState=kt(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"shift"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_shiftDragAdjustSensitivity(t){return e=>{if(r(this.analysisViewData.plane))return null;const i=.001,a=Math.min((1-Math.abs(g(x(this.analysisViewData.plane),e.ray.direction)/m(e.ray.direction)))/i,1),s=-R(this._startPlane.plane,e.renderEnd),n=-R(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(r(this.analysisViewData.plane))return;const e=f(G.get(),this._startPlane.origin),i=f(G.get(),x(this._startPlane));M(i,i,-t.depth),V(i,i,e);const a=I(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,S());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,st.HEADING,j()),i=this._calculatePickRay(t.screenPoint),a=E();C(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"rotate"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_onRotateTiltGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,st.TILT,j()),i=this._calculatePickRay(t.screenPoint),a=E();C(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"rotate"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_rotateDragRenderPlaneToRotate(t){return e=>{if(r(this.analysisViewData.plane))return null;const i=O(t.rotatePlane),a=K(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(r(this.analysisViewData.plane))return;const e=y(U.get(),t.rotateAngle,t.rotateAxis),i=D(G.get(),this._startPlane.basis1,e),a=D(G.get(),this._startPlane.basis2,e),s=I(this.analysisViewData.plane.origin,i,a,S());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||r(this.analysisViewData.plane))return;const i=this._calculatePickRay(t.screenPoint),a=G.get();C(this.analysisViewData.plane.plane,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:k(a)})}_createResizeDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"resize"!==a.type||r(this.analysisViewData.plane))return;const s=H(this.analysisViewData.plane,S());e.next(wt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next((()=>{this._updateBoundedPlane(s)}))}))}_resizeDragUpdatePlane(t){return e=>{if(r(this.analysisViewData.plane))return;const i=this._resizeHandles[t.activeHandleIdx],a=nt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,H(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(!n(e))throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){let i=this._previewPlane;if(this._previewPlane=null,r(t))return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=n(i)?i:S();if(i=n(i)?H(i,St):null,this._pickPlane(t,!0,e,a)){const t=Q;let e=!1;n(i)&&(e=g(i.plane,a.plane)<t||g(T(G.get(),i.basis1),T(G.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}n(this._previewPlane)&&r(this._frameTask)&&0===this._previewPlaneOpacity?this._frameTask=p({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*N),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):r(this._previewPlane)&&n(this._frameTask)?this._removeFrameTask():n(this._previewPlane)&&this._updateManipulators()}_removeFrameTask(){this._frameTask=l(this._frameTask)}_calculatePickRay(t){const e=z(),i=c(t,Ht);return gt(this.view.state.camera,i,e),T(e.direction,e.direction),e}_pickMinResult(t){const e=c(t,L.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=G.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(G.get()),l=this.view.state.camera;g(r,l.viewForward)>0&&M(r,r,-1);const o=rt(n,l),h=(e?1:-1)*o*W,p=M(G.get(),r,h);V(p,p,n);const u=this.analysis.tiltEnabled?lt.TILTED:lt.HORIZONTAL_OR_VERTICAL,c=i[B]?lt.VERTICAL:i[F]?lt.HORIZONTAL:u;return ot(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_updateMouseCursor(){this._set("cursor",null),this._isPlacingSlicePlane||"exclude"===this.layersMode?this._set("cursor","crosshair"):n(this._creatingPointerId)&&this._set("cursor","grabbing")}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=l(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ht,this.rotateHeadingManipulator.state|=ht,this.rotateTiltManipulator.state|=ht,this._prevPointerMoveTimeout=this.clock.setTimeout((()=>{this.shiftManipulator.state&=~ht,this.rotateHeadingManipulator.state&=~ht,this.rotateTiltManipulator.state&=~ht}),q)}_updateManipulators(){if(this.disableEngineLayers)return;let t=null,e=!1;if(n(this.analysisViewData.plane))t=this.analysisViewData.plane,e=!1;else{if(!n(this._previewPlane))return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);t=this._previewPlane,e=!0}const i=pt(t,U.get());e?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach((t=>t.available=!0)),ut(this.shiftManipulator,i,t,this.view.state.camera),ct(this.rotateHeadingManipulator,i,t,this.view.renderCoordsHelper),dt(this.rotateTiltManipulator,i,t),this.resizeManipulators.forEach(((e,a)=>_t(e,this._resizeHandles[a],i,t))),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=b(G.get(),m(t.basis1),m(t.basis2),1),s=P(U.get(),a),r=w(s,i,s);this._previewPlaneOutlineVisualElement.transform=r,this._previewPlaneGridVisualElement.transform=r,this._updateMaterials()}_updateMaterials(){const t=[Z[0],Z[1],Z[2],Z[3]*this._previewPlaneOpacity];this._previewPlaneOutlineVisualElement.color=t;const e=[J[0],J[1],J[2],J[3]*this._previewPlaneOpacity],i=[0,0,0,0];this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=i}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach((t=>{t.interactive=!0}));this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach((e=>{e.interactive=e===t}))}testData(){return{plane:this.analysisViewData.plane}}};function kt(t,e,i,a){const s=vt(i,x(a),t.direction,j()),n=E();return C(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Et(t){return"mouse"!==t.pointerType||0===t.button}t([_()],bt.prototype,"clock",void 0),t([_({constructOnly:!0})],bt.prototype,"view",void 0),t([_()],bt.prototype,"analysisView",void 0),t([_()],bt.prototype,"analysisViewData",void 0),t([_({readOnly:!0})],bt.prototype,"state",null),t([_({readOnly:!0,value:null})],bt.prototype,"cursor",null),t([_()],bt.prototype,"analysis",null),t([_({readOnly:!0})],bt.prototype,"layersMode",void 0),t([_({value:null})],bt.prototype,"inputState",null),bt=t([v("esri.views.3d.interactive.analysisTools.slice.SliceTool")],bt);const St=S(),Ht=d(),xt=bt;export{xt as default};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{clock as e}from"../../../../../core/clock.js";import i from"../../../../../core/Handles.js";import{releaseMaybe as a,destroyMaybe as s,isSome as n,isNone as r,removeMaybe as l}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../../../core/scheduling.js";import{createScreenPoint as u,screenPointObjectToArray as c,createScreenPointArray as d}from"../../../../../core/screenUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{d as y,u as P,m as w}from"../../../../../chunks/mat4.js";import{d as g,l as m,g as f,a as M,b as V,m as D,n as T,s as b}from"../../../../../chunks/vec3.js";import{a as k,c as E}from"../../../../../chunks/vec3f64.js";import{c as S,a as H,n as x,f as I}from"../../../../../chunks/boundedPlane.js";import{signedDistance as R,create as j,intersectRay as C,normal as O}from"../../../../../geometry/support/plane.js";import{create as z}from"../../../../../geometry/support/ray.js";import{sv3d as G,sm4d as U,sv2d as L}from"../../../../../geometry/support/vectorStacks.js";import{calculateInputRotationTransform as K}from"../../manipulatorUtils.js";import{PLANE_PREVIEW_OUTLINE_WIDTH as A,forceVerticalModifier as B,forceHorizontalModifier as F,PREVIEW_FADE_DURATION_SECONDS as N,POINTER_MOVE_TIMER_MS as q,PLANE_OUTLINE_COLOR as Z,PLANE_BACKGROUND_COLOR as J,PREVIEW_FADE_DOT_THRESHOLD as Q,INITIAL_DEPTH_OFFSET_FRAC as W}from"./sliceToolConfig.js";import{createShiftManipulator as X,createRotateManipulator as Y,createResizeManipulator as $,createGridVisualElement as tt,createOutlineVisualElement as et,planeToShape as it,createRotatePlane as at,RotationAxis as st,resizePlane as nt,calculatePlaneHalfSize as rt,SliceOrientation as lt,createPlane as ot,DidPointerMoveRecentlyFlag as ht,calculateBoundedPlaneTranslateRotate as pt,updateShiftRestartHandle as ut,updateRotateHeadingHandle as ct,updateRotateTiltHandle as dt,updateResizeHandle as _t,createShiftPlane as vt}from"./sliceToolUtils.js";import{getRotateHeadingTexture as yt,getTiltRotateTexture as Pt}from"./images/Factory.js";import{screenToRenderPlane as wt}from"../../editingTools/dragEventPipeline3D.js";import{fromScreen as gt}from"../../../support/geometryUtils/ray.js";import{newIntersector as mt}from"../../../webgl-engine/lib/Intersector.js";import{StoreResults as ft}from"../../../webgl-engine/lib/IntersectorInterfaces.js";import{createManipulatorDragEventPipeline as Mt}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Vt}from"../../../../interactive/InteractiveToolBase.js";import{createScreenPointFromEvent as Dt}from"../../../../support/screenUtils.js";import Tt from"../../../../../widgets/Slice/SlicePlane.js";let bt=class extends Vt{constructor(t){super(t),this.clock=e,this._previewPlaneOpacity=1,this.analysisView=null,this.layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this.disableEngineLayers=!1,this._handles=new i,this._viewHandles=new i,this._frameTask=null,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=S(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=u(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=mt(t.view.state.viewingMode),this._intersector.options.store=ft.MIN}initialize(){this._initialize()}async _initialize(){const t=()=>{if("creating"===this.toolState||"created"===this.toolState)throw new Error("Unexpected toolState");return!this.destroyed};if(!t())return;if(this.analysisView=await this.view.whenAnalysisView(this.analysis),!t())return;if(null==this.analysis)throw new Error("SliceTool requires valid model, but null was provided.");this.analysisViewData=this.analysisView,this.rotateHeadingImage=yt(this.view.toolViewManager.textures),this.rotateTiltImage=Pt(this.view.toolViewManager.textures);const e=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(n(this.analysisViewData.plane)&&H(this.analysisViewData.plane,this._startPlane),this.inputState=null)};this.shiftManipulator=X(this.view),this.manipulators.add(this.shiftManipulator),this.shiftManipulator.events.on("grab-changed",(t=>{this._onShiftGrab(t),e(this.shiftManipulator)})),this._handles.add(this._createShiftDragPipeline(this.shiftManipulator)),this.rotateHeadingManipulator=Y(this.view,this.rotateHeadingImage.texture),this.manipulators.add(this.rotateHeadingManipulator),this.rotateHeadingManipulator.events.on("grab-changed",(t=>{this._onRotateHeadingGrab(t),e(this.rotateHeadingManipulator)})),this._handles.add(this._createRotateHeadingDragPipeline(this.rotateHeadingManipulator)),this.rotateTiltManipulator=Y(this.view,this.rotateTiltImage.texture),this.manipulators.add(this.rotateTiltManipulator),this.rotateTiltManipulator.events.on("grab-changed",(t=>{this._onRotateTiltGrab(t),e(this.rotateTiltManipulator)})),this._handles.add(this._createRotateTiltDragPipeline(this.rotateTiltManipulator)),this.resizeManipulators=this._resizeHandles.map(((t,i)=>{const a=$(this.view,t);return a.events.on("grab-changed",(t=>{this._onResizeGrab(t,i),e(a)})),this._handles.add(this._createResizeDragPipeline(a)),a})),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=tt(this.view),this._previewPlaneOutlineVisualElement=et(this.view),this._previewPlaneOutlineVisualElement.width=A,this._handles.add(this.analysisViewData.watch("plane",(()=>this._updateManipulators()),!0)),this.startToolCreation();const i=o((()=>this.state),(t=>{"sliced"===t&&this.finishToolCreation()}),h);this._handles.add([i,o((()=>this.view.state.camera),(()=>this._onCameraChange()))])}destroy(){this.rotateHeadingImage=a(this.rotateHeadingImage),this.rotateTiltImage=a(this.rotateTiltImage),this._handles=s(this._handles),this._viewHandles=s(this._viewHandles),this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=s(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=s(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this._get("cursor")}set analysis(t){if(null==t)throw new Error("SliceTool requires valid model, but null was provided.");this._handles.remove("analysis"),this._set("analysis",t)}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisView.showGrid=n(t)&&"resize"===t.type,this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return n(this.inputState)&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){r(this.analysisViewData.plane)||(this._set("layersMode","exclude"),this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){r(this.analysisViewData.plane)||(this._set("layersMode","none"),this.active&&(this.view.activeTool=null))}onDeactivate(){this._updateMouseCursor(),this._set("layersMode","none"),this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this.analysis.visible=t,this._updateMouseCursor(),this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Et(t))return;this._isPlacingSlicePlane?this._onClickPlacePlane(t)&&(t.stopPropagation(),this._updateMouseCursor()):this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t),this._updateMouseCursor();break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Et(t))return;this._onClickPlacePlane(t)&&(t.stopPropagation(),this._updateMouseCursor());break;case"click":if(!Et(t))return;this._onClickExcludeLayer(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisView&&(this.analysisView.editable=this.editable)}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&n(e)&&"shift"===e.type){const i=Dt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Dt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&n(this.analysisViewData.plane)){const e=Dt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),H(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if("exclude"===this.layersMode)return!1;if(this._isPlacingSlicePlane){const e=Dt(t),i=S();if(this._pickPlane(e,!1,this._activeKeyModifiers,i)){if(H(i,this._startPlane),this.analysis.shape=it(i,this.view,this.view.spatialReference,new Tt),"pointer-drag"===t.type){const a=this._calculatePickRay(e);this.inputState=kt(a,t.pointerId,i.origin,i)}return!0}}return!1}_onClickExcludeLayer(t){return!("exclude"!==this.layersMode||!this.created)&&(this.view.hitTest(Dt(t)).then((t=>{if(t.results.length){const e=t.results[0],i=e&&e.graphic;if(i){const t=i.sourceLayer||i.layer;t&&this.analysis.excludedLayers.push(t)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0})),this._set("layersMode","none"),this.active&&(this.view.activeTool=null),!0)}_onKeyDown(t){return(t.key===B||t.key===F)&&(this._activeKeyModifiers[t.key]=!0,n(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==B&&t.key!==F||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],n(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=this._calculatePickRay(t.screenPoint);H(this.analysisViewData.plane,this._startPlane),this.inputState=kt(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"shift"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_shiftDragAdjustSensitivity(t){return e=>{if(r(this.analysisViewData.plane))return null;const i=.001,a=Math.min((1-Math.abs(g(x(this.analysisViewData.plane),e.ray.direction)/m(e.ray.direction)))/i,1),s=-R(this._startPlane.plane,e.renderEnd),n=-R(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(r(this.analysisViewData.plane))return;const e=f(G.get(),this._startPlane.origin),i=f(G.get(),x(this._startPlane));M(i,i,-t.depth),V(i,i,e);const a=I(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,S());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,st.HEADING,j()),i=this._calculatePickRay(t.screenPoint),a=E();C(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"rotate"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_onRotateTiltGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,st.TILT,j()),i=this._calculatePickRay(t.screenPoint),a=E();C(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"rotate"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_rotateDragRenderPlaneToRotate(t){return e=>{if(r(this.analysisViewData.plane))return null;const i=O(t.rotatePlane),a=K(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(r(this.analysisViewData.plane))return;const e=y(U.get(),t.rotateAngle,t.rotateAxis),i=D(G.get(),this._startPlane.basis1,e),a=D(G.get(),this._startPlane.basis2,e),s=I(this.analysisViewData.plane.origin,i,a,S());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||r(this.analysisViewData.plane))return;const i=this._calculatePickRay(t.screenPoint),a=G.get();C(this.analysisViewData.plane.plane,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:k(a)})}_createResizeDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"resize"!==a.type||r(this.analysisViewData.plane))return;const s=H(this.analysisViewData.plane,S());e.next(wt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next((()=>{this._updateBoundedPlane(s)}))}))}_resizeDragUpdatePlane(t){return e=>{if(r(this.analysisViewData.plane))return;const i=this._resizeHandles[t.activeHandleIdx],a=nt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,H(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(!n(e))throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){let i=this._previewPlane;if(this._previewPlane=null,r(t))return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=n(i)?i:S();if(i=n(i)?H(i,St):null,this._pickPlane(t,!0,e,a)){const t=Q;let e=!1;n(i)&&(e=g(i.plane,a.plane)<t||g(T(G.get(),i.basis1),T(G.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}n(this._previewPlane)&&r(this._frameTask)&&0===this._previewPlaneOpacity?this._frameTask=p({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*N),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):r(this._previewPlane)&&n(this._frameTask)?this._removeFrameTask():n(this._previewPlane)&&this._updateManipulators()}_removeFrameTask(){this._frameTask=l(this._frameTask)}_calculatePickRay(t){const e=z(),i=c(t,Ht);return gt(this.view.state.camera,i,e),T(e.direction,e.direction),e}_pickMinResult(t){const e=c(t,L.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=G.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(G.get()),l=this.view.state.camera;g(r,l.viewForward)>0&&M(r,r,-1);const o=rt(n,l),h=(e?1:-1)*o*W,p=M(G.get(),r,h);V(p,p,n);const u=this.analysis.tiltEnabled?lt.TILTED:lt.HORIZONTAL_OR_VERTICAL,c=i[B]?lt.VERTICAL:i[F]?lt.HORIZONTAL:u;return ot(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_updateMouseCursor(){this._set("cursor",null),this._isPlacingSlicePlane||"exclude"===this.layersMode?this._set("cursor","crosshair"):n(this._creatingPointerId)&&this._set("cursor","grabbing")}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=l(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ht,this.rotateHeadingManipulator.state|=ht,this.rotateTiltManipulator.state|=ht,this._prevPointerMoveTimeout=this.clock.setTimeout((()=>{this.shiftManipulator.state&=~ht,this.rotateHeadingManipulator.state&=~ht,this.rotateTiltManipulator.state&=~ht}),q)}_updateManipulators(){if(this.disableEngineLayers)return;let t=null,e=!1;if(n(this.analysisViewData.plane))t=this.analysisViewData.plane,e=!1;else{if(!n(this._previewPlane))return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);t=this._previewPlane,e=!0}const i=pt(t,U.get());e?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach((t=>t.available=!0)),ut(this.shiftManipulator,i,t,this.view.state.camera),ct(this.rotateHeadingManipulator,i,t,this.view.renderCoordsHelper),dt(this.rotateTiltManipulator,i,t),this.resizeManipulators.forEach(((e,a)=>_t(e,this._resizeHandles[a],i,t))),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=b(G.get(),m(t.basis1),m(t.basis2),1),s=P(U.get(),a),r=w(s,i,s);this._previewPlaneOutlineVisualElement.transform=r,this._previewPlaneGridVisualElement.transform=r,this._updateMaterials()}_updateMaterials(){const t=[Z[0],Z[1],Z[2],Z[3]*this._previewPlaneOpacity];this._previewPlaneOutlineVisualElement.color=t;const e=[J[0],J[1],J[2],J[3]*this._previewPlaneOpacity],i=[0,0,0,0];this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=i}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach((t=>{t.interactive=!0}));this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach((e=>{e.interactive=e===t}))}testData(){return{plane:this.analysisViewData.plane}}};function kt(t,e,i,a){const s=vt(i,x(a),t.direction,j()),n=E();return C(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Et(t){return"mouse"!==t.pointerType||0===t.button}t([_()],bt.prototype,"clock",void 0),t([_({constructOnly:!0})],bt.prototype,"view",void 0),t([_()],bt.prototype,"analysisView",void 0),t([_()],bt.prototype,"analysisViewData",void 0),t([_({readOnly:!0})],bt.prototype,"state",null),t([_({readOnly:!0,value:null})],bt.prototype,"cursor",null),t([_()],bt.prototype,"analysis",null),t([_({readOnly:!0})],bt.prototype,"layersMode",void 0),t([_({value:null})],bt.prototype,"inputState",null),bt=t([v("esri.views.3d.interactive.analysisTools.slice.SliceTool")],bt);const St=S(),Ht=d(),xt=bt;export{xt 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/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../../geometry.js";import{neverReached as e}from"../../../../../core/compilerUtils.js";import t from"../../../../../core/Logger.js";import{rad2deg as r,deg2rad as s}from"../../../../../core/mathUtils.js";import{isNone as i,isSome as n}from"../../../../../core/maybe.js";import{castRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{g as a,b as c,h as l,m as u,r as d,i as m,j as p,k as g}from"../../../../../chunks/mat4.js";import{c as f}from"../../../../../chunks/mat4f64.js";import{r as b}from"../../../../../chunks/quat.js";import{a as h,g as T,d as y,c as O,n as w,b as I,l as E,f as R,p as j,s as A,v as M}from"../../../../../chunks/vec3.js";import{a as L,c as P,f as k}from"../../../../../chunks/vec3f64.js";import{tryProjectWithZConversion as C}from"../../../../../geometry/projection.js";import{Axis as _}from"../../../../../geometry/support/Axis.js";import{r as v,f as N,i as U,c as S,n as V,u as G}from"../../../../../chunks/boundedPlane.js";import{fromPositionAndNormal as x,fromVectorsAndPoint as F}from"../../../../../geometry/support/plane.js";import{create as H}from"../../../../../geometry/support/ray.js";import{angleAroundAxis as D}from"../../../../../geometry/support/vector.js";import{sv3d as z,sm4d as X,sq4d as Y}from"../../../../../geometry/support/vectorStacks.js";import{applyProjectionAndElevationAlignment as Z}from"../../../analysis/support/projectionUtils.js";import{Manipulator3D as B}from"../../Manipulator3D.js";import{calculateTranslateRotateFromBases as W}from"../../manipulatorUtils.js";import{SHIFT_RESTART_TIP_RADIUS as q,RESIZE_HANDLE_EDGE_PADDING_FRAC as $,VERTICAL_DOT_THRESHOLD as J,SMALL_ANGLE_DOT_THRESHOLD as K,PLANE_MIN_BASIS_SCREEN_LEN2 as Q,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as ee,SHIFT_RESTART_OFFSET_DISTANCE as te,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as re,SHIFT_RESTART_ARROW_TIP_COLOR as se,SHIFT_RESTART_ARROW_CAP_COLOR as ie,SHIFT_RESTART_TUBE_COLOR as ne,SHIFT_RESTART_OUTLINE_COLOR as oe,SHIFT_RESTART_CALLOUT_COLOR as ae,ROTATE_HEADING_OFFSET_DISTANCE as ce,ROTATE_HEADING_DISC_RADIUS as le,ROTATE_HEADING_CALLOUT_COLOR as ue,PLANE_OUTLINE_COLOR as de,PLANE_OUTLINE_WIDTH as me,PLANE_BACKGROUND_COLOR as pe,GRID_COLOR as ge,RESIZE_HANDLE_CORNER_INPUT_RADIUS as fe,RESIZE_HANDLE_EDGE_INPUT_RADIUS as be,ROTATE_HEADING_TIP_LENGTH as he,ROTATE_HEADING_DISC_RADIUS_FOCUS_MULTIPLIER as Te,RESIZE_HANDLE_COLOR as ye,DISPLAY_FOCUS_MULTIPLIER as Oe,RESIZE_HANDLE_EDGE_WIDTH as we,SHIFT_RESTART_ARROW_LENGTH as Ie,SHIFT_RESTART_TUBE_RADIUS as Ee,SHIFT_RESTART_TIP_LENGTH as Re,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as je,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as Ae,RESIZE_HANDLE_CORNER_WIDTH as Me}from"./sliceToolConfig.js";import{LineVisualElement as Le}from"../../visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as Pe}from"../../visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as ke}from"../../../support/RenderCoordsHelper.js";import{fromRender as Ce}from"../../../support/geometryUtils/ray.js";import{CullFaceOptions as _e,VertexAttribute as ve}from"../../../webgl-engine/lib/basicInterfaces.js";import{Geometry as Ne}from"../../../webgl-engine/lib/Geometry.js";import Ue from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as Se}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as Ve}from"../../../webgl-engine/materials/ColorMaterial.js";import{ImageMaterial as Ge}from"../../../webgl-engine/materials/ImageMaterial.js";import{NativeLineMaterial as xe}from"../../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as Fe}from"../../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateCustomFlags as He,ManipulatorStateFlags as De}from"../../../../interactive/interfaces.js";import ze from"../../../../../widgets/Slice/SlicePlane.js";import Xe from"../../../../../geometry/Extent.js";const Ye=t.getLogger("esri.views.3d.interactive.analysisTools.slice.sliceToolUtils");function Ze(e,t,r,s,i,n,o,a){return Be(t,o.worldUpAtPosition(e,z.get()),i,n,a.basis1,a.basis2),h(a.basis1,a.basis1,r),h(a.basis2,a.basis2,s),T(a.origin,e),F(a.basis2,a.basis1,a.origin,a.plane),a}function Be(e,t,r,s,i,n){const o=y(e,t),a=z.get(),c=z.get();switch(s===Ct.HORIZONTAL_OR_VERTICAL?Math.abs(o)>J?Ct.HORIZONTAL:Ct.VERTICAL:s){case Ct.VERTICAL:{const s=Math.abs(o)<=K?e:r.viewUp;O(a,s,t),T(c,t);break}case Ct.HORIZONTAL:O(a,r.viewUp,t),O(c,t,a);break;case Ct.TILTED:{const s=Math.abs(o)<=K?t:r.viewUp;O(a,s,e),O(c,e,a);break}}const l=O(z.get(),a,c);y(l,r.viewForward)>0&&h(c,c,-1),w(i,a),w(n,c)}function We(e,t,r){const s=t.worldUpAtPosition(e.origin,z.get()),i=e.basis1,n=It(e,s),o=Math.round(n/Nt)*Nt;return v(e,o-n,i,r)}function qe(e,t,r,s,i,n){const o=T(z.get(),i.origin);I(o,o,h(z.get(),i.basis1,e.direction[0]<0?1:-1)),I(o,o,h(z.get(),i.basis2,e.direction[1]<0?1:-1));const a=E(i.basis1),c=E(i.basis2),l=R(z.get(),r,o),u=R(z.get(),t,o);let d=0,m=0;if(ut(e)){const t=lt(i),r=lt(n);d=a-.5*e.direction[0]*y(i.basis1,u)/a,m=c-.5*e.direction[1]*y(i.basis2,u)/c;const s=r/t;d*=s,m*=s}const p=d+.5*e.direction[0]*y(i.basis1,l)/a,g=m+.5*e.direction[1]*y(i.basis2,l)/c,f=h(z.get(),i.basis1,p/a),b=h(z.get(),i.basis2,g/c);(p<=0||at(n.origin,f,s)<=Q)&&T(f,n.basis1),(g<=0||at(n.origin,b,s)<=Q)&&T(b,n.basis2);const O=T(z.get(),o);return I(O,O,h(z.get(),f,e.direction[0]<0?-1:1)),I(O,O,h(z.get(),b,e.direction[1]<0?-1:1)),N(O,f,b,n)}function $e(e,t){return ee*Math.min(t.width,t.height)*t.computeRenderPixelSizeAt(e)}function Je(e,t,r,s){const i=O(z.get(),t,r);return O(i,i,t),x(e,i,s)}function Ke(e,t){return W(e.basis1,e.basis2,e.origin,t)}function Qe(e,t,r,s){const i=t.worldUpAtPosition(e.origin,z.get()),n=z.get();switch(r){case kt.HEADING:T(n,i);break;case kt.TILT:T(n,e.basis1)}return x(e.origin,n,s)}function et(e,t,r,s){const i=ot(r,nt.NEGATIVE_X),n=X.get();a(n,t,i.edge*Math.PI/2);const c=w(z.get(),i.basis);let l=h(z.get(),c,i.direction*s.computeScreenPixelSizeAt(i.position)*te);I(l,l,i.position);const u=s.projectToRenderScreen(l,o(z.get())),d=tt(s,u);Ce(s,u,vt),w(vt.direction,vt.direction);const m=z.get();!d&&U(r,vt,m)&&(l=m),n[12]=0,n[13]=0,n[14]=0,e.modelTransform=n,e.renderLocation=L(l),d?e.state|=_t:e.state&=~_t}function tt(e,t){const[r,s,i,n]=e.viewport,o=Math.min(i,n)/16;let a=!0;return t[0]<r+o?(t[0]=r+o,a=!1):t[0]>r+i-o&&(t[0]=r+i-o,a=!1),t[1]<s+o?(t[1]=s+o,a=!1):t[1]>s+n-o&&(t[1]=s+n-o,a=!1),a}function rt(e,t,r,s){const i=E(s.basis1),n=E(s.basis2),o=ct(s),a=lt(s),d=A(z.get(),0,0,0);I(d,h(z.get(),s.basis1,t.direction[0]),h(z.get(),s.basis2,t.direction[1])),I(d,s.origin,d);let m=0,p=1;if(ut(t))1===t.direction[0]&&-1===t.direction[1]?m=Nt:1===t.direction[0]&&1===t.direction[1]?m=Math.PI:-1===t.direction[0]&&1===t.direction[1]&&(m=3*Math.PI/2),p=a;else{const e=0!==t.direction[0]?1:2;m=1===e?Nt:0,p=(1===e?n:i)-o}const g=c(X.get(),m);l(g,g,A(z.get(),p,p,p)),u(g,r,g),g[12]=0,g[13]=0,g[14]=0,e.modelTransform=g,e.renderLocation=d}function st(e,t,r,s){const i=s.worldUpAtPosition(r.origin,z.get()),n=ot(r,nt.POSITIVE_X),o=c(X.get(),n.edge*Math.PI/2);d(o,o,-It(r,i)),u(o,t,o),o[12]=0,o[13]=0,o[14]=0,e.modelTransform=o,e.renderLocation=n.position}function it(e,t,r){const s=ot(r,nt.POSITIVE_Y),i=c(X.get(),s.edge*Math.PI/2);d(i,i,Nt),u(i,t,i),i[12]=0,i[13]=0,i[14]=0,e.modelTransform=i,e.renderLocation=s.position}var nt;function ot(e,t){switch(t){case nt.POSITIVE_X:return{basis:e.basis1,direction:1,position:I(z.get(),e.origin,e.basis1),edge:t};case nt.POSITIVE_Y:return{basis:e.basis2,direction:1,position:I(z.get(),e.origin,e.basis2),edge:t};case nt.NEGATIVE_X:return{basis:e.basis1,direction:-1,position:R(z.get(),e.origin,e.basis1),edge:t};case nt.NEGATIVE_Y:return{basis:e.basis2,direction:-1,position:R(z.get(),e.origin,e.basis2),edge:t}}}function at(e,t,r){const s=r.projectToRenderScreen(I(z.get(),e,t),o(z.get())),i=r.projectToRenderScreen(R(z.get(),e,t),o(z.get()));return j(R(s,s,i))}function ct(e){const t=E(e.basis1),r=E(e.basis2);return $*Math.min(t,r)}function lt(e){return ct(e)}function ut(e){return 0!==e.direction[0]&&0!==e.direction[1]}function dt(e,t=Vt.CENTER_ON_ARROW){const r=t===Vt.CENTER_ON_CALLOUT?te:0,s=[k(r,0,-Ie/2),k(r,0,Ie/2)],i=Tt(s,!0),n=(e,t)=>bt(s,s,{tubeRadius:Ee,tipRadius:q,tipLength:Re,tubeFocusMultiplier:je,tipFocusMultiplier:Ae,padding:e,bothEnds:!0,flat:null,focusTipLength:!0,addCap:t}),o=n(0,!1),a=n(re,!0),c=new Ve({color:se,cullFace:_e.Back,renderOccluded:Se.Opaque}),l=new Ve({color:ie,cullFace:_e.Back,renderOccluded:Se.Opaque}),u=new Ve({color:ne,cullFace:_e.Back,renderOccluded:Se.Opaque}),d=new Ve({color:oe,transparent:!0,writeDepth:!1,cullFace:_e.Front,renderOccluded:Se.Transparent}),m=Ue.createPolylineGeometry([[r,0,0],[r-te,0,0]]),p=Ue.createPolylineGeometry([[r,0,0],[r-te,0,0]]),g=new xe({color:ae,renderOccluded:Se.OccludeAndTransparent});return new B({view:e,renderObjects:[...o.normal.map((({part:e,geometry:t,transform:r})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:u,transform:r,stateMask:De.Unfocused|Pt}))),...a.normal.map((({geometry:e,transform:t})=>({geometry:e,material:d,transform:t,stateMask:De.Unfocused|Pt}))),{geometry:m,material:g,stateMask:De.Unfocused|Pt|_t},...o.focused.map((({part:e,geometry:t,transform:r})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:u,transform:r,stateMask:De.Focused|Pt}))),...a.focused.map((({geometry:e,transform:t})=>({geometry:e,material:d,transform:t,stateMask:De.Focused|Pt}))),{geometry:p,material:g,stateMask:De.Focused|Pt|_t}],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[i]},collisionPriority:1,radius:q,state:Pt})}function mt(e,t){const r=new Ge({transparent:!0,writeDepth:!1,textureId:t.id,renderOccluded:Se.Opaque}),s=ce,i=le,n=i*Te,o=e=>{const t=new Uint32Array([0,1,2,2,3,0]);return new Ne([[ve.POSITION,{size:3,data:[s-e,-e,0,s+e,-e,0,s+e,e,0,s-e,e,0],exclusive:!0}],[ve.UV0,{size:2,data:[0,0,1,0,1,1,0,1]}]],[[ve.POSITION,t],[ve.UV0,t]])},a=Ue.createPolylineGeometry([[0,0,0],[s-i,0,0]]),c=Ue.createPolylineGeometry([[0,0,0],[s-n,0,0]]),l=new xe({color:ue,renderOccluded:Se.OccludeAndTransparent}),u=[{geometry:o(i),material:r,stateMask:De.Unfocused|Pt},{geometry:a,material:l,stateMask:De.Unfocused|Pt},{geometry:o(n),material:r,stateMask:De.Focused|Pt},{geometry:c,material:l,stateMask:De.Focused|Pt}];return new B({view:e,renderObjects:u,autoScaleRenderObjects:!1,collisionType:{type:"disc",direction:[0,0,1],offset:[s,0,0]},collisionPriority:1,radius:i/2,state:Pt})}function pt(e){const t=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new Le({view:e,attached:!0,color:de,width:me,writeDepthEnabled:!1,renderOccluded:Se.OccludeAndTransparent,geometry:[t]})}function gt(e){return new Pe({view:e,attached:!0,backgroundColor:[...pe],gridColor:ge,gridWidth:4,renderOccluded:Se.OccludeAndTransparent})}function ft(e,t){const r=ut(t),s=r?[k(1,0,0),k(0,0,0),k(0,1,0)]:[k(1,0,0),k(-1,0,0)],i=Ue.createPolylineGeometry(s),n=ye,o=e=>new Fe({color:n,width:e,renderOccluded:Se.OccludeAndTransparent}),a=()=>new xe({color:n,renderOccluded:Se.OccludeAndTransparent}),c=r?Me:we,l=c*Oe,u=we,d=e=>e>1?o(e):a(),m=[{geometry:i,material:d(c),stateMask:De.Unfocused|Ut},{geometry:i,material:d(l),stateMask:De.Focused|Ut},{geometry:i,material:d(u),stateMask:St}],p=new B({view:e,renderObjects:m,collisionType:{type:"line",paths:[s]},autoScaleRenderObjects:!1,worldSized:!0,radius:r?fe:be});return p.state=Ut,p}function bt(e,t,r){const s=s=>{const i=(s?t:e).slice(0),o=R(z.get(),i[0],i[1]);w(o,o);const a=R(z.get(),i[i.length-1],i[i.length-2]);if(w(a,a),r.padding>0){const e=h(P(),a,-r.padding);if(i[i.length-1]=I(e,e,i[i.length-1]),r.bothEnds){const e=h(P(),o,-r.padding);i[0]=I(e,e,i[0])}}const c=s?r.tipFocusMultiplier:1,d=r.tipLength*(r.focusTipLength?c:1),T=r.tipRadius*c,y=m(X.get());if(r.padding>0){const e=d/4,t=A(z.get(),0,e,0),s=1+r.padding/e;p(y,y,t),l(y,y,A(z.get(),s,s,s)),p(y,y,h(t,t,-1/s))}const O=m(f()),E=k(0,1,0),j=g(f(),b(Y.get(),E,a));j[12]=i[i.length-1][0],j[13]=i[i.length-1][1],j[14]=i[i.length-1][2],u(j,j,y);const M=[{part:"tube",geometry:ht(r.tubeRadius*(s?r.tubeFocusMultiplier:1)+r.padding,r.flat,i),transform:O}];let L,C;if(n(r.flat)?L=Ue.createExtrudedTriangle(d,T,T,r.flat.thickness):(L=Ue.createConeGeometry(d,T,24,!1,!1,!0),C=Ue.createConeGeometry(d,T,24,!1,!0,!1)),M.push({part:"tip",geometry:L,transform:j}),C&&M.push({part:"cap",geometry:C,transform:j}),r.bothEnds){const e=g(f(),b(Y.get(),E,o));e[12]=i[0][0],e[13]=i[0][1],e[14]=i[0][2],u(e,e,y),M.push({part:"tip",geometry:L,transform:e}),C&&M.push({part:"cap",geometry:C,transform:e})}return M};return{normal:s(!1),focused:s(!0)}}function ht(e,t,r){const s=[];if(n(t))s.push([e,t.thickness/2],[-e,t.thickness/2],[-e,-t.thickness/2],[e,-t.thickness/2]);else{const t=12;for(let r=0;r<t;r++){const i=r/t*2*Math.PI;s.push([Math.cos(i)*e,Math.sin(i)*e])}}return Ue.createPathExtrusionGeometry(s,r,[],[],!1)}function Tt(e,t){const r=R(P(),e[e.length-1],e[e.length-2]);if(w(r,r),h(r,r,he),I(r,r,e[e.length-1]),t){const t=R(P(),e[0],e[1]);return w(t,t),h(t,t,he),I(t,t,e[0]),[t,...e,r]}return[...e,r]}function yt(e,t,s,n=new ze){if(i(e))return null;const{renderCoordsHelper:o}=t,a=o.fromRenderCoords(e.origin,t.spatialReference);if(i(a))return null;const c=C(a,s);if(i(c))return null;n.position=c;const l=o.worldUpAtPosition(e.origin,z.get()),u=o.worldBasisAtPosition(e.origin,_.Y,z.get()),d=2*E(e.basis1),m=2*E(e.basis2),p=ke.renderUnitScaleFactor(t.spatialReference,s);return n.width=d*p,n.height=m*p,n.tilt=r(It(e,l)),n.heading=r(Et(e,l,u)),n}function Ot(e,t,r){if(i(e)||i(e.position))return null;const{spatialReference:s}=e.position,o=wt(At(e,{renderCoordsHelper:t,spatialReference:s},r),t,s);return!e.position.hasZ&&n(o)&&(o.zmin=null,o.zmax=null),o}function wt(e,t,r){if(i(e))return null;const s=e.origin,n=z.get(),o=z.get(),a=z.get(),c=z.get();let l,u,d,m,p,g;I(n,s,e.basis1),I(n,n,e.basis2),I(o,s,e.basis1),M(o,o,e.basis2),M(a,s,e.basis1),M(a,a,e.basis2),M(c,s,e.basis1),I(c,c,e.basis2);for(const f of[n,o,a,c]){const e=t.fromRenderCoords(f,f,r);if(i(e))return null;l=null==l?e[0]:Math.min(l,e[0]),u=null==u?e[0]:Math.max(u,e[0]),d=null==d?e[1]:Math.min(d,e[1]),m=null==m?e[1]:Math.max(m,e[1]),p=null==p?e[2]:Math.min(p,e[2]),g=null==g?e[2]:Math.max(g,e[2])}return new Xe({xmin:l,xmax:u,ymin:d,ymax:m,zmin:p,zmax:g,spatialReference:r})}function It(e,t){return D(t,e.basis2,e.basis1)+Nt}function Et(e,t,r){return D(e.basis1,r,t)-Nt}function Rt(e,t,r,i,n,o,a=S()){return o.toRenderCoords(e,a.origin)?(o.worldBasisAtPosition(a.origin,_.X,a.basis1),o.worldBasisAtPosition(a.origin,_.Y,a.basis2),F(a.basis2,a.basis1,a.origin,a.plane),v(a,-s(t),V(a),a),v(a,s(r),a.basis1,a),h(a.basis1,a.basis1,i/2),h(a.basis2,a.basis2,n/2),G(a),a):(Ye.error(`Failed to project slice plane position, projection from ${e.spatialReference.wkid} is not supported`),null)}function jt(e,t){if(i(e)||i(e.position))return null;const r=Z(e.position,t.spatialReference,t.elevationProvider);if(i(r))return null;const s=ke.renderUnitScaleFactor(e.position.spatialReference,t.spatialReference),n=e.width*s,o=e.height*s;return{position:r,heading:e.heading,tilt:e.tilt,renderWidth:n,renderHeight:o}}function At(e,t,r,s=S()){const n=jt(e,t);return i(n)?null:Mt(n,t,r,s)}function Mt(e,t,r,s=S()){if(i(e))return null;const o=Rt(e.position,e.heading,e.tilt,e.renderWidth,e.renderHeight,t.renderCoordsHelper,s);return!r.tiltEnabled&&n(o)&&We(o,t.renderCoordsHelper,o),o}function Lt(t){switch(t.type){case"analysis":case"building-scene":case"csv":case"feature":case"geo-rss":case"geojson":case"graphics":case"group":case"integrated-mesh":case"kml":case"map-notes":case"ogc-feature":case"point-cloud":case"route":case"scene":case"stream":case"voxel":case"subtype-group":case"unknown":case"unsupported":case"wfs":case null:return!1;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"elevation":case"imagery":case"imagery-tile":case"map-image":case"open-street-map":case"tile":case"vector-tile":case"wcs":case"web-tile":case"wms":case"wmts":return!0;default:return e(t.type),!1}}!function(e){e[e.POSITIVE_X=0]="POSITIVE_X",e[e.POSITIVE_Y=1]="POSITIVE_Y",e[e.NEGATIVE_X=2]="NEGATIVE_X",e[e.NEGATIVE_Y=3]="NEGATIVE_Y"}(nt||(nt={}));const Pt=He.Custom1;var kt,Ct;!function(e){e[e.HEADING=1]="HEADING",e[e.TILT=2]="TILT"}(kt||(kt={})),function(e){e[e.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",e[e.HORIZONTAL=1]="HORIZONTAL",e[e.VERTICAL=2]="VERTICAL",e[e.TILTED=3]="TILTED"}(Ct||(Ct={}));const _t=He.Custom2,vt=H(),Nt=Math.PI/2,Ut=He.Custom1,St=He.Custom2;var Vt;function Gt(e){const t="building-scene-3d"===e.type?e:null;return n(t)}!function(e){e[e.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",e[e.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(Vt||(Vt={}));export{Pt as DidPointerMoveRecentlyFlag,_t as IsShiftEdgeOnScreenFlag,Vt as OffsetMode,kt as RotationAxis,Ct as SliceOrientation,Tt as addArrowTips,Ke as calculateBoundedPlaneTranslateRotate,lt as calculateDiagonalResizeHandleScale,$e as calculatePlaneHalfSize,ct as calculateResizeHandlePadding,at as calculateScreenSpaceBasisLength2,bt as createArrowGeometry,gt as createGridVisualElement,pt as createOutlineVisualElement,Ze as createPlane,ft as createResizeManipulator,mt as createRotateManipulator,Qe as createRotatePlane,dt as createShiftManipulator,Je as createShiftPlane,We as forceHorizontalOrVertical,Lt as isAlwaysDrapedLayer,ut as isDiagonalResizeHandle,Gt as isIBuildingSceneLayerView3D,Be as normalToBases,wt as planeToExtent,yt as planeToShape,jt as projectAndElevationAlignShape,Mt as projectedShapeToPlane,Ut as resizeNormal,St as resizeOutlineOnly,qe as resizePlane,Ot as shapeToExtent,At as shapeToPlane,rt as updateResizeHandle,st as updateRotateHeadingHandle,it as updateRotateTiltHandle,et as updateShiftRestartHandle};
|
|
5
|
+
import"../../../../../geometry.js";import{neverReached as e}from"../../../../../core/compilerUtils.js";import t from"../../../../../core/Logger.js";import{rad2deg as r,deg2rad as s}from"../../../../../core/mathUtils.js";import{isNone as i,isSome as n}from"../../../../../core/maybe.js";import{castRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{g as a,b as c,h as l,m as u,r as d,i as m,j as p,k as g}from"../../../../../chunks/mat4.js";import{c as f}from"../../../../../chunks/mat4f64.js";import{r as b}from"../../../../../chunks/quat.js";import{a as h,g as T,d as y,c as w,n as O,b as I,l as E,f as R,p as j,s as A,v as M}from"../../../../../chunks/vec3.js";import{a as L,c as P,f as k}from"../../../../../chunks/vec3f64.js";import{tryProjectWithZConversion as C}from"../../../../../geometry/projection.js";import{Axis as _}from"../../../../../geometry/support/Axis.js";import{r as v,f as N,i as U,c as V,n as S,u as x}from"../../../../../chunks/boundedPlane.js";import{fromPositionAndNormal as G,fromVectorsAndPoint as F}from"../../../../../geometry/support/plane.js";import{create as H}from"../../../../../geometry/support/ray.js";import{angleAroundAxis as D}from"../../../../../geometry/support/vector.js";import{sv3d as z,sm4d as X,sq4d as Y}from"../../../../../geometry/support/vectorStacks.js";import{applyProjectionAndElevationAlignment as Z}from"../../../analysis/support/projectionUtils.js";import{Manipulator3D as B}from"../../Manipulator3D.js";import{calculateTranslateRotateFromBases as W}from"../../manipulatorUtils.js";import{SHIFT_RESTART_TIP_RADIUS as q,RESIZE_HANDLE_EDGE_PADDING_FRAC as $,VERTICAL_DOT_THRESHOLD as J,SMALL_ANGLE_DOT_THRESHOLD as K,PLANE_MIN_BASIS_SCREEN_LEN2 as Q,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as ee,SHIFT_RESTART_OFFSET_DISTANCE as te,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as re,SHIFT_RESTART_ARROW_TIP_COLOR as se,SHIFT_RESTART_ARROW_CAP_COLOR as ie,SHIFT_RESTART_TUBE_COLOR as ne,SHIFT_RESTART_OUTLINE_COLOR as oe,SHIFT_RESTART_CALLOUT_COLOR as ae,ROTATE_HEADING_OFFSET_DISTANCE as ce,ROTATE_HEADING_DISC_RADIUS as le,ROTATE_HEADING_CALLOUT_COLOR as ue,PLANE_OUTLINE_COLOR as de,PLANE_OUTLINE_WIDTH as me,PLANE_BACKGROUND_COLOR as pe,GRID_COLOR as ge,RESIZE_HANDLE_CORNER_INPUT_RADIUS as fe,RESIZE_HANDLE_EDGE_INPUT_RADIUS as be,ROTATE_HEADING_TIP_LENGTH as he,ROTATE_HEADING_DISC_RADIUS_FOCUS_MULTIPLIER as Te,RESIZE_HANDLE_COLOR as ye,DISPLAY_FOCUS_MULTIPLIER as we,RESIZE_HANDLE_EDGE_WIDTH as Oe,SHIFT_RESTART_ARROW_LENGTH as Ie,SHIFT_RESTART_TUBE_RADIUS as Ee,SHIFT_RESTART_TIP_LENGTH as Re,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as je,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as Ae,RESIZE_HANDLE_CORNER_WIDTH as Me}from"./sliceToolConfig.js";import{LineVisualElement as Le}from"../../visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as Pe}from"../../visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as ke}from"../../../support/RenderCoordsHelper.js";import{fromRender as Ce}from"../../../support/geometryUtils/ray.js";import{CullFaceOptions as _e}from"../../../webgl-engine/lib/basicInterfaces.js";import{Geometry as ve}from"../../../webgl-engine/lib/Geometry.js";import Ne from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as Ue}from"../../../webgl-engine/lib/Material.js";import{VertexAttribute as Ve}from"../../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as Se}from"../../../webgl-engine/materials/ColorMaterial.js";import{ImageMaterial as xe}from"../../../webgl-engine/materials/ImageMaterial.js";import{NativeLineMaterial as Ge}from"../../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as Fe}from"../../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateCustomFlags as He,ManipulatorStateFlags as De}from"../../../../interactive/interfaces.js";import ze from"../../../../../widgets/Slice/SlicePlane.js";import Xe from"../../../../../geometry/Extent.js";const Ye=t.getLogger("esri.views.3d.interactive.analysisTools.slice.sliceToolUtils");function Ze(e,t,r,s,i,n,o,a){return Be(t,o.worldUpAtPosition(e,z.get()),i,n,a.basis1,a.basis2),h(a.basis1,a.basis1,r),h(a.basis2,a.basis2,s),T(a.origin,e),F(a.basis2,a.basis1,a.origin,a.plane),a}function Be(e,t,r,s,i,n){const o=y(e,t),a=z.get(),c=z.get();switch(s===Ct.HORIZONTAL_OR_VERTICAL?Math.abs(o)>J?Ct.HORIZONTAL:Ct.VERTICAL:s){case Ct.VERTICAL:{const s=Math.abs(o)<=K?e:r.viewUp;w(a,s,t),T(c,t);break}case Ct.HORIZONTAL:w(a,r.viewUp,t),w(c,t,a);break;case Ct.TILTED:{const s=Math.abs(o)<=K?t:r.viewUp;w(a,s,e),w(c,e,a);break}}const l=w(z.get(),a,c);y(l,r.viewForward)>0&&h(c,c,-1),O(i,a),O(n,c)}function We(e,t,r){const s=t.worldUpAtPosition(e.origin,z.get()),i=e.basis1,n=It(e,s),o=Math.round(n/Nt)*Nt;return v(e,o-n,i,r)}function qe(e,t,r,s,i,n){const o=T(z.get(),i.origin);I(o,o,h(z.get(),i.basis1,e.direction[0]<0?1:-1)),I(o,o,h(z.get(),i.basis2,e.direction[1]<0?1:-1));const a=E(i.basis1),c=E(i.basis2),l=R(z.get(),r,o),u=R(z.get(),t,o);let d=0,m=0;if(ut(e)){const t=lt(i),r=lt(n);d=a-.5*e.direction[0]*y(i.basis1,u)/a,m=c-.5*e.direction[1]*y(i.basis2,u)/c;const s=r/t;d*=s,m*=s}const p=d+.5*e.direction[0]*y(i.basis1,l)/a,g=m+.5*e.direction[1]*y(i.basis2,l)/c,f=h(z.get(),i.basis1,p/a),b=h(z.get(),i.basis2,g/c);(p<=0||at(n.origin,f,s)<=Q)&&T(f,n.basis1),(g<=0||at(n.origin,b,s)<=Q)&&T(b,n.basis2);const w=T(z.get(),o);return I(w,w,h(z.get(),f,e.direction[0]<0?-1:1)),I(w,w,h(z.get(),b,e.direction[1]<0?-1:1)),N(w,f,b,n)}function $e(e,t){return ee*Math.min(t.width,t.height)*t.computeRenderPixelSizeAt(e)}function Je(e,t,r,s){const i=w(z.get(),t,r);return w(i,i,t),G(e,i,s)}function Ke(e,t){return W(e.basis1,e.basis2,e.origin,t)}function Qe(e,t,r,s){const i=t.worldUpAtPosition(e.origin,z.get()),n=z.get();switch(r){case kt.HEADING:T(n,i);break;case kt.TILT:T(n,e.basis1)}return G(e.origin,n,s)}function et(e,t,r,s){const i=ot(r,nt.NEGATIVE_X),n=X.get();a(n,t,i.edge*Math.PI/2);const c=O(z.get(),i.basis);let l=h(z.get(),c,i.direction*s.computeScreenPixelSizeAt(i.position)*te);I(l,l,i.position);const u=s.projectToRenderScreen(l,o(z.get())),d=tt(s,u);Ce(s,u,vt),O(vt.direction,vt.direction);const m=z.get();!d&&U(r,vt,m)&&(l=m),n[12]=0,n[13]=0,n[14]=0,e.modelTransform=n,e.renderLocation=L(l),d?e.state|=_t:e.state&=~_t}function tt(e,t){const[r,s,i,n]=e.viewport,o=Math.min(i,n)/16;let a=!0;return t[0]<r+o?(t[0]=r+o,a=!1):t[0]>r+i-o&&(t[0]=r+i-o,a=!1),t[1]<s+o?(t[1]=s+o,a=!1):t[1]>s+n-o&&(t[1]=s+n-o,a=!1),a}function rt(e,t,r,s){const i=E(s.basis1),n=E(s.basis2),o=ct(s),a=lt(s),d=A(z.get(),0,0,0);I(d,h(z.get(),s.basis1,t.direction[0]),h(z.get(),s.basis2,t.direction[1])),I(d,s.origin,d);let m=0,p=1;if(ut(t))1===t.direction[0]&&-1===t.direction[1]?m=Nt:1===t.direction[0]&&1===t.direction[1]?m=Math.PI:-1===t.direction[0]&&1===t.direction[1]&&(m=3*Math.PI/2),p=a;else{const e=0!==t.direction[0]?1:2;m=1===e?Nt:0,p=(1===e?n:i)-o}const g=c(X.get(),m);l(g,g,A(z.get(),p,p,p)),u(g,r,g),g[12]=0,g[13]=0,g[14]=0,e.modelTransform=g,e.renderLocation=d}function st(e,t,r,s){const i=s.worldUpAtPosition(r.origin,z.get()),n=ot(r,nt.POSITIVE_X),o=c(X.get(),n.edge*Math.PI/2);d(o,o,-It(r,i)),u(o,t,o),o[12]=0,o[13]=0,o[14]=0,e.modelTransform=o,e.renderLocation=n.position}function it(e,t,r){const s=ot(r,nt.POSITIVE_Y),i=c(X.get(),s.edge*Math.PI/2);d(i,i,Nt),u(i,t,i),i[12]=0,i[13]=0,i[14]=0,e.modelTransform=i,e.renderLocation=s.position}var nt;function ot(e,t){switch(t){case nt.POSITIVE_X:return{basis:e.basis1,direction:1,position:I(z.get(),e.origin,e.basis1),edge:t};case nt.POSITIVE_Y:return{basis:e.basis2,direction:1,position:I(z.get(),e.origin,e.basis2),edge:t};case nt.NEGATIVE_X:return{basis:e.basis1,direction:-1,position:R(z.get(),e.origin,e.basis1),edge:t};case nt.NEGATIVE_Y:return{basis:e.basis2,direction:-1,position:R(z.get(),e.origin,e.basis2),edge:t}}}function at(e,t,r){const s=r.projectToRenderScreen(I(z.get(),e,t),o(z.get())),i=r.projectToRenderScreen(R(z.get(),e,t),o(z.get()));return j(R(s,s,i))}function ct(e){const t=E(e.basis1),r=E(e.basis2);return $*Math.min(t,r)}function lt(e){return ct(e)}function ut(e){return 0!==e.direction[0]&&0!==e.direction[1]}function dt(e,t=St.CENTER_ON_ARROW){const r=t===St.CENTER_ON_CALLOUT?te:0,s=[k(r,0,-Ie/2),k(r,0,Ie/2)],i=Tt(s,!0),n=(e,t)=>bt(s,s,{tubeRadius:Ee,tipRadius:q,tipLength:Re,tubeFocusMultiplier:je,tipFocusMultiplier:Ae,padding:e,bothEnds:!0,flat:null,focusTipLength:!0,addCap:t}),o=n(0,!1),a=n(re,!0),c=new Se({color:se,cullFace:_e.Back,renderOccluded:Ue.Opaque}),l=new Se({color:ie,cullFace:_e.Back,renderOccluded:Ue.Opaque}),u=new Se({color:ne,cullFace:_e.Back,renderOccluded:Ue.Opaque}),d=new Se({color:oe,transparent:!0,writeDepth:!1,cullFace:_e.Front,renderOccluded:Ue.Transparent}),m=Ne.createPolylineGeometry([[r,0,0],[r-te,0,0]]),p=Ne.createPolylineGeometry([[r,0,0],[r-te,0,0]]),g=new Ge({color:ae,renderOccluded:Ue.OccludeAndTransparent});return new B({view:e,renderObjects:[...o.normal.map((({part:e,geometry:t,transform:r})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:u,transform:r,stateMask:De.Unfocused|Pt}))),...a.normal.map((({geometry:e,transform:t})=>({geometry:e,material:d,transform:t,stateMask:De.Unfocused|Pt}))),{geometry:m,material:g,stateMask:De.Unfocused|Pt|_t},...o.focused.map((({part:e,geometry:t,transform:r})=>({geometry:t,material:"tip"===e?c:"cap"===e?l:u,transform:r,stateMask:De.Focused|Pt}))),...a.focused.map((({geometry:e,transform:t})=>({geometry:e,material:d,transform:t,stateMask:De.Focused|Pt}))),{geometry:p,material:g,stateMask:De.Focused|Pt|_t}],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[i]},collisionPriority:1,radius:q,state:Pt})}function mt(e,t){const r=new xe({transparent:!0,writeDepth:!1,textureId:t.id,renderOccluded:Ue.Opaque}),s=ce,i=le,n=i*Te,o=e=>{const t=new Uint32Array([0,1,2,2,3,0]);return new ve([[Ve.POSITION,{size:3,data:[s-e,-e,0,s+e,-e,0,s+e,e,0,s-e,e,0],exclusive:!0}],[Ve.UV0,{size:2,data:[0,0,1,0,1,1,0,1]}]],[[Ve.POSITION,t],[Ve.UV0,t]])},a=Ne.createPolylineGeometry([[0,0,0],[s-i,0,0]]),c=Ne.createPolylineGeometry([[0,0,0],[s-n,0,0]]),l=new Ge({color:ue,renderOccluded:Ue.OccludeAndTransparent}),u=[{geometry:o(i),material:r,stateMask:De.Unfocused|Pt},{geometry:a,material:l,stateMask:De.Unfocused|Pt},{geometry:o(n),material:r,stateMask:De.Focused|Pt},{geometry:c,material:l,stateMask:De.Focused|Pt}];return new B({view:e,renderObjects:u,autoScaleRenderObjects:!1,collisionType:{type:"disc",direction:[0,0,1],offset:[s,0,0]},collisionPriority:1,radius:i/2,state:Pt})}function pt(e){const t=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new Le({view:e,attached:!0,color:de,width:me,writeDepthEnabled:!1,renderOccluded:Ue.OccludeAndTransparent,geometry:[t]})}function gt(e){return new Pe({view:e,attached:!0,backgroundColor:[...pe],gridColor:ge,gridWidth:4,renderOccluded:Ue.OccludeAndTransparent})}function ft(e,t){const r=ut(t),s=r?[k(1,0,0),k(0,0,0),k(0,1,0)]:[k(1,0,0),k(-1,0,0)],i=Ne.createPolylineGeometry(s),n=ye,o=e=>new Fe({color:n,width:e,renderOccluded:Ue.OccludeAndTransparent}),a=()=>new Ge({color:n,renderOccluded:Ue.OccludeAndTransparent}),c=r?Me:Oe,l=c*we,u=Oe,d=e=>e>1?o(e):a(),m=[{geometry:i,material:d(c),stateMask:De.Unfocused|Ut},{geometry:i,material:d(l),stateMask:De.Focused|Ut},{geometry:i,material:d(u),stateMask:Vt}],p=new B({view:e,renderObjects:m,collisionType:{type:"line",paths:[s]},autoScaleRenderObjects:!1,worldSized:!0,radius:r?fe:be});return p.state=Ut,p}function bt(e,t,r){const s=s=>{const i=(s?t:e).slice(0),o=R(z.get(),i[0],i[1]);O(o,o);const a=R(z.get(),i[i.length-1],i[i.length-2]);if(O(a,a),r.padding>0){const e=h(P(),a,-r.padding);if(i[i.length-1]=I(e,e,i[i.length-1]),r.bothEnds){const e=h(P(),o,-r.padding);i[0]=I(e,e,i[0])}}const c=s?r.tipFocusMultiplier:1,d=r.tipLength*(r.focusTipLength?c:1),T=r.tipRadius*c,y=m(X.get());if(r.padding>0){const e=d/4,t=A(z.get(),0,e,0),s=1+r.padding/e;p(y,y,t),l(y,y,A(z.get(),s,s,s)),p(y,y,h(t,t,-1/s))}const w=m(f()),E=k(0,1,0),j=g(f(),b(Y.get(),E,a));j[12]=i[i.length-1][0],j[13]=i[i.length-1][1],j[14]=i[i.length-1][2],u(j,j,y);const M=[{part:"tube",geometry:ht(r.tubeRadius*(s?r.tubeFocusMultiplier:1)+r.padding,r.flat,i),transform:w}];let L,C;if(n(r.flat)?L=Ne.createExtrudedTriangle(d,T,T,r.flat.thickness):(L=Ne.createConeGeometry(d,T,24,!1,!1,!0),C=Ne.createConeGeometry(d,T,24,!1,!0,!1)),M.push({part:"tip",geometry:L,transform:j}),C&&M.push({part:"cap",geometry:C,transform:j}),r.bothEnds){const e=g(f(),b(Y.get(),E,o));e[12]=i[0][0],e[13]=i[0][1],e[14]=i[0][2],u(e,e,y),M.push({part:"tip",geometry:L,transform:e}),C&&M.push({part:"cap",geometry:C,transform:e})}return M};return{normal:s(!1),focused:s(!0)}}function ht(e,t,r){const s=[];if(n(t))s.push([e,t.thickness/2],[-e,t.thickness/2],[-e,-t.thickness/2],[e,-t.thickness/2]);else{const t=12;for(let r=0;r<t;r++){const i=r/t*2*Math.PI;s.push([Math.cos(i)*e,Math.sin(i)*e])}}return Ne.createPathExtrusionGeometry(s,r,[],[],!1)}function Tt(e,t){const r=R(P(),e[e.length-1],e[e.length-2]);if(O(r,r),h(r,r,he),I(r,r,e[e.length-1]),t){const t=R(P(),e[0],e[1]);return O(t,t),h(t,t,he),I(t,t,e[0]),[t,...e,r]}return[...e,r]}function yt(e,t,s,n=new ze){if(i(e))return null;const{renderCoordsHelper:o}=t,a=o.fromRenderCoords(e.origin,t.spatialReference);if(i(a))return null;const c=C(a,s);if(i(c))return null;n.position=c;const l=o.worldUpAtPosition(e.origin,z.get()),u=o.worldBasisAtPosition(e.origin,_.Y,z.get()),d=2*E(e.basis1),m=2*E(e.basis2),p=ke.renderUnitScaleFactor(t.spatialReference,s);return n.width=d*p,n.height=m*p,n.tilt=r(It(e,l)),n.heading=r(Et(e,l,u)),n}function wt(e,t,r){if(i(e)||i(e.position))return null;const{spatialReference:s}=e.position,o=Ot(At(e,{renderCoordsHelper:t,spatialReference:s},r),t,s);return!e.position.hasZ&&n(o)&&(o.zmin=null,o.zmax=null),o}function Ot(e,t,r){if(i(e))return null;const s=e.origin,n=z.get(),o=z.get(),a=z.get(),c=z.get();let l,u,d,m,p,g;I(n,s,e.basis1),I(n,n,e.basis2),I(o,s,e.basis1),M(o,o,e.basis2),M(a,s,e.basis1),M(a,a,e.basis2),M(c,s,e.basis1),I(c,c,e.basis2);for(const f of[n,o,a,c]){const e=t.fromRenderCoords(f,f,r);if(i(e))return null;l=null==l?e[0]:Math.min(l,e[0]),u=null==u?e[0]:Math.max(u,e[0]),d=null==d?e[1]:Math.min(d,e[1]),m=null==m?e[1]:Math.max(m,e[1]),p=null==p?e[2]:Math.min(p,e[2]),g=null==g?e[2]:Math.max(g,e[2])}return new Xe({xmin:l,xmax:u,ymin:d,ymax:m,zmin:p,zmax:g,spatialReference:r})}function It(e,t){return D(t,e.basis2,e.basis1)+Nt}function Et(e,t,r){return D(e.basis1,r,t)-Nt}function Rt(e,t,r,i,n,o,a=V()){return o.toRenderCoords(e,a.origin)?(o.worldBasisAtPosition(a.origin,_.X,a.basis1),o.worldBasisAtPosition(a.origin,_.Y,a.basis2),F(a.basis2,a.basis1,a.origin,a.plane),v(a,-s(t),S(a),a),v(a,s(r),a.basis1,a),h(a.basis1,a.basis1,i/2),h(a.basis2,a.basis2,n/2),x(a),a):(Ye.error(`Failed to project slice plane position, projection from ${e.spatialReference.wkid} is not supported`),null)}function jt(e,t){if(i(e)||i(e.position))return null;const r=Z(e.position,t.spatialReference,t.elevationProvider);if(i(r))return null;const s=ke.renderUnitScaleFactor(e.position.spatialReference,t.spatialReference),n=e.width*s,o=e.height*s;return{position:r,heading:e.heading,tilt:e.tilt,renderWidth:n,renderHeight:o}}function At(e,t,r,s=V()){const n=jt(e,t);return i(n)?null:Mt(n,t,r,s)}function Mt(e,t,r,s=V()){if(i(e))return null;const o=Rt(e.position,e.heading,e.tilt,e.renderWidth,e.renderHeight,t.renderCoordsHelper,s);return!r.tiltEnabled&&n(o)&&We(o,t.renderCoordsHelper,o),o}function Lt(t){switch(t.type){case"analysis":case"building-scene":case"csv":case"feature":case"geo-rss":case"geojson":case"graphics":case"group":case"integrated-mesh":case"kml":case"map-notes":case"ogc-feature":case"point-cloud":case"route":case"scene":case"stream":case"voxel":case"subtype-group":case"unknown":case"unsupported":case"wfs":case null:return!1;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"elevation":case"imagery":case"imagery-tile":case"map-image":case"open-street-map":case"tile":case"vector-tile":case"wcs":case"web-tile":case"wms":case"wmts":return!0;default:return e(t.type),!1}}!function(e){e[e.POSITIVE_X=0]="POSITIVE_X",e[e.POSITIVE_Y=1]="POSITIVE_Y",e[e.NEGATIVE_X=2]="NEGATIVE_X",e[e.NEGATIVE_Y=3]="NEGATIVE_Y"}(nt||(nt={}));const Pt=He.Custom1;var kt,Ct;!function(e){e[e.HEADING=1]="HEADING",e[e.TILT=2]="TILT"}(kt||(kt={})),function(e){e[e.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",e[e.HORIZONTAL=1]="HORIZONTAL",e[e.VERTICAL=2]="VERTICAL",e[e.TILTED=3]="TILTED"}(Ct||(Ct={}));const _t=He.Custom2,vt=H(),Nt=Math.PI/2,Ut=He.Custom1,Vt=He.Custom2;var St;function xt(e){const t="building-scene-3d"===e.type?e:null;return n(t)}!function(e){e[e.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",e[e.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(St||(St={}));export{Pt as DidPointerMoveRecentlyFlag,_t as IsShiftEdgeOnScreenFlag,St as OffsetMode,kt as RotationAxis,Ct as SliceOrientation,Tt as addArrowTips,Ke as calculateBoundedPlaneTranslateRotate,lt as calculateDiagonalResizeHandleScale,$e as calculatePlaneHalfSize,ct as calculateResizeHandlePadding,at as calculateScreenSpaceBasisLength2,bt as createArrowGeometry,gt as createGridVisualElement,pt as createOutlineVisualElement,Ze as createPlane,ft as createResizeManipulator,mt as createRotateManipulator,Qe as createRotatePlane,dt as createShiftManipulator,Je as createShiftPlane,We as forceHorizontalOrVertical,Lt as isAlwaysDrapedLayer,ut as isDiagonalResizeHandle,xt as isIBuildingSceneLayerView3D,Be as normalToBases,Ot as planeToExtent,yt as planeToShape,jt as projectAndElevationAlignShape,Mt as projectedShapeToPlane,Ut as resizeNormal,Vt as resizeOutlineOnly,qe as resizePlane,wt as shapeToExtent,At as shapeToPlane,rt as updateResizeHandle,st as updateRotateHeadingHandle,it as updateRotateTiltHandle,et as updateShiftRestartHandle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import e from"../../../../core/Handles.js";import{isSome as t,unwrap as s,isNone as i,unwrapOr as r}from"../../../../core/maybe.js";import{g as n,f as a,k as l,o}from"../../../../chunks/vec3.js";import{c as h,f as _}from"../../../../chunks/vec3f64.js";import{g as d,c as p}from"../../../../chunks/vec4.js";import{f as u,a as c}from"../../../../chunks/vec4f32.js";import{create as f,fromRay as m,getStart as y,getEnd as g}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as x}from"../../../../geometry/support/frustum.js";import{create as w,fromPoints as b,pointAt as E}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as O}from"../../../../geometry/support/ray.js";import{LaserlineVisualElement as D}from"./LaserlineVisualElement.js";import{Object3DVisualElement as
|
|
5
|
+
import"../../../../core/has.js";import e from"../../../../core/Handles.js";import{isSome as t,unwrap as s,isNone as i,unwrapOr as r}from"../../../../core/maybe.js";import{g as n,f as a,k as l,o}from"../../../../chunks/vec3.js";import{c as h,f as _}from"../../../../chunks/vec3f64.js";import{g as d,c as p}from"../../../../chunks/vec4.js";import{f as u,a as c}from"../../../../chunks/vec4f32.js";import{create as f,fromRay as m,getStart as y,getEnd as g}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as x}from"../../../../geometry/support/frustum.js";import{create as w,fromPoints as b,pointAt as E}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as O}from"../../../../geometry/support/ray.js";import{LaserlineVisualElement as D}from"./LaserlineVisualElement.js";import{Object3DVisualElement as A}from"./Object3DVisualElement.js";import C from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as P}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as j}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as v}from"../../webgl-engine/materials/RibbonLineMaterial.js";class M extends A{constructor(t){super(t),this._ray=R(),this._externalResources=null,this._handles=new e,this._isWorldDown=!1,this._start=h(),this._end=_(1,0,0),this._width=1,this._color=u(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=u(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=T.LINE,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=P.OccludeAndTransparent,this._fadedExtensions=N,this.applyProps(t)}createExternalResources(){const e=new v(this.materialParameters);this._handles.add(this.view.state.watch("camera",(()=>{this._updateGeometry()})));const t=new D({view:this.view,attached:this._laserlineEnabled});this._externalResources={material:e,laserline:t}}destroyExternalResources(){t(this._externalResources)&&this._externalResources.laserline.destroy(),this._externalResources=null,this._handles.removeAll()}forEachExternalMaterial(e){t(this._externalResources)&&e(this._externalResources.material)}createGeometries(e){const t=[h(),h()],i=this.extensionType===T.FADED;i&&t.push(h(),h());const r=i?new Float32Array([1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]):null,n=C.createPolylineGeometry(t,null,r);e.addGeometry(n,s(this._externalResources).material),this._updateVertices(e)}updateVisibility(e){super.updateVisibility(e),t(this._externalResources)&&(this._externalResources.laserline.visible=e)}setStartEndFromWorldDownAtLocation(e){this._isWorldDown=!0,n(this._start,e),this.view.renderCoordsHelper.worldUpAtPosition(e,this._end),a(this._end,e,this._end),O(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(e){this._isWorldDown=!1,l(this._start,e)||(n(this._start,e),O(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(e){this._isWorldDown=!1,l(this._end,e)||(n(this._end,e),O(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){d(e,this._color)||(p(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){d(e,this._innerColor)||(p(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const s=t(e)!==t(this._stipplePattern);this._stipplePattern=e,s?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){(i(e)||i(this._stippleOffColor)||!d(e,this._stippleOffColor))&&(this._stippleOffColor=t(e)?c(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this._updateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&t(this._laserlineStyle)}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,t(this._externalResources)&&(this._externalResources.laserline.attached=this._laserlineAttached,t(e)&&(this._externalResources.laserline.style=e))}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,t(this._externalResources)&&(this._externalResources.laserline.attached=this._laserlineAttached))}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=r(e,N),this.recreateGeometry()}_updateMaterial(){if(i(this._externalResources))return;this._externalResources.material.setParameters(this.materialParameters)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,polygonOffset:this._polygonOffset,renderOccluded:this._renderOccluded,writeDepth:this._writeDepthEnabled}}_updateGeometry(){t(this.object)&&this._updateVertices(this.object)}_updateVertices(e){const s=this._extensionType===T.FADED?this._updateLineSegmentFinite(S):this._updateLineSegmentInfinite(this._extensionType,S);this._updateVertexAttributes(e,s),t(this._externalResources)&&(this._externalResources.laserline.intersectsLine=s)}_updateLineSegmentFinite(e){return b(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const s=this.view.state.camera;switch(m(this._ray,G),e){case T.LINE:G.c0=-Number.MAX_VALUE;break;case T.RAY:case T.GROUND_RAY:{const e=this._ray.origin,t=r(this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground"),0),s=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&s<t&&o(G.ray.direction,G.ray.direction),this._extensionType===T.GROUND_RAY&&null!=t&&(G.c1=Math.abs(s-t));break}}if(!x(s.frustum,G))return b(this._start,this._end,t);const i=y(G,W),n=g(G,L);return b(i,n,t)}_updateVertexAttributes(e,t){const s=e.geometries[0].getMutableAttribute(j.POSITION).data;if(this.extensionType===T.FADED){const e=E(t,-this.fadedExtensions.start,W);s[0]=e[0],s[1]=e[1],s[2]=e[2];const i=E(t,0,W);s[3]=i[0],s[4]=i[1],s[5]=i[2];const r=E(t,1,W);s[6]=r[0],s[7]=r[1],s[8]=r[2];const n=E(t,1+this.fadedExtensions.end,W);s[9]=n[0],s[10]=n[1],s[11]=n[2]}else{const e=E(t,0,W);s[0]=e[0],s[1]=e[1],s[2]=e[2];const i=E(t,1,W);s[3]=i[0],s[4]=i[1],s[5]=i[2]}e.geometryVertexAttrsUpdated(e.geometryRecords[0])}}const G=f(),W=h(),L=h(),S=w();var T;!function(e){e[e.LINE=0]="LINE",e[e.RAY=1]="RAY",e[e.GROUND_RAY=2]="GROUND_RAY",e[e.FADED=3]="FADED"}(T||(T={}));const V=1/3,N={start:V,end:V};export{M as ExtendedLineVisualElement,T as ExtensionType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e,isNone as r}from"../../../../core/maybe.js";import{B as t}from"../../../../chunks/mat4.js";import{f as s}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{g as i,c}from"../../../../chunks/vec4.js";import{f as a}from"../../../../chunks/vec4f64.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import{
|
|
5
|
+
import{isSome as e,isNone as r}from"../../../../core/maybe.js";import{B as t}from"../../../../chunks/mat4.js";import{f as s}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{g as i,c}from"../../../../chunks/vec4.js";import{f as a}from"../../../../chunks/vec4f64.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import{Geometry as h}from"../../webgl-engine/lib/Geometry.js";import{RenderOccludedFlag as n}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as d}from"../../webgl-engine/lib/VertexAttribute.js";import{CheckerBoardMaterial as _}from"../../webgl-engine/materials/CheckerBoardMaterial.js";class m extends l{constructor(e){super(e),this._checkerBoardMaterial=null,this._renderOccluded=n.OccludeAndTransparent,this._geometry=null,this._size=[1,1],this._color1=a(1,.5,0,.5),this._color2=a(1,1,1,.5),this.applyProps(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this._geometryChanged()}get size(){return this._size}set size(e){this._size=e,this._updateMaterial()}get color1(){return this._color1}set color1(e){i(e,this._color1)||(c(this._color1,e),this._updateMaterial())}get color2(){return this._color2}set color2(e){i(e,this._color2)||(c(this._color2,e),this._updateMaterial())}_updateMaterial(){e(this._checkerBoardMaterial)&&this._checkerBoardMaterial.setParameters({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded})}createExternalResources(){this._checkerBoardMaterial=new _({size:this._size,color1:this._color1,color2:this._color2,transparent:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:n.OccludeAndTransparent})}destroyExternalResources(){this._checkerBoardMaterial=null}forEachExternalMaterial(r){e(this._checkerBoardMaterial)&&r(this._checkerBoardMaterial)}createGeometries(e){if(r(this._geometry)||r(this._checkerBoardMaterial))return;const i=u;t(i,this.transform);const c=this._geometry,a=[],l=o();c.position.forEach((e=>{s(l,e,i),a.push(l[0],l[1],l[2])}));const n=[];c.uv.forEach((e=>{n.push(e[0],e[1])}));const _=new h([[d.POSITION,{size:3,data:a,exclusive:!0}],[d.UV0,{size:2,data:n,exclusive:!0}]],[[d.POSITION,c.triangleIndices],[d.UV0,c.triangleIndices]]);e.addGeometry(_,this._checkerBoardMaterial)}_geometryChanged(){this.recreateGeometry()}}const u=o();export{m as MeasurementAreaVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Evented.js";import{isSome as t,unwrap as r,isNone as s}from"../../../../core/maybe.js";import{s as i,b as a,a as n}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{g as l,c as h,s as c}from"../../../../chunks/vec4.js";import{f as d,a as
|
|
5
|
+
import e from"../../../../core/Evented.js";import{isSome as t,unwrap as r,isNone as s}from"../../../../core/maybe.js";import{s as i,b as a,a as n}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{g as l,c as h,s as c}from"../../../../chunks/vec4.js";import{f as d,a as u}from"../../../../chunks/vec4f32.js";import{projectBuffer as p}from"../../../../geometry/projection.js";import{create as m,empty as f,expandWithBuffer as _}from"../../../../geometry/support/aaBoundingBox.js";import{makeDehydratedPoint as g}from"../../../../layers/graphics/dehydratedFeatures.js";import{getGeometryEffectiveElevationMode as y}from"../../../../support/elevationInfoUtils.js";import v from"../../../../symbols/support/ElevationInfo.js";import{DrapedVisualElementResources as O}from"./DrapedVisualElementResources.js";import{LaserlineVisualElement as w}from"./LaserlineVisualElement.js";import{VisualElementResources as C}from"./VisualElementResources.js";import{ElevationContext as b}from"../../layers/graphics/ElevationContext.js";import{geometryToRenderInfoDraped as R,RemoveDuplicateStartEnd as E,createGeometry as D,geometryToRenderInfo as P}from"../../layers/graphics/lineUtils.js";import{computeAttachmentOriginLines as j}from"../../webgl-engine/lib/geometryDataUtils.js";import{RenderOccludedFlag as I}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as A}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as G}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as M}from"../../webgl-engine/materials/RibbonLineMaterial.js";class S{constructor(t){this.view=null,this._attachmentOrigin=g(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._isDraped=!1,this._geometry=null,this._width=1,this._color=d(1,0,1,1),this._innerWidth=0,this._innerColor=d(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=I.OccludeAndTransparentStencil,this.resources=new C({view:t.view,createResources:e=>this._createResources(e),recreateGeometry:(e,t)=>(e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries),e.geometries)}),this._attachmentOrigin.spatialReference=t.view.spatialReference,this.drapedResources=new O({view:t.view,createResources:()=>this._createDrapedResources(),recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()}});let r=!0;this._laserline=new w({view:t.view});for(const e in t)e in this?"attached"===e?r=t[e]:this[e]=t[e]:console.error("Cannot set unknown property",e);this.attached=r}destroy(){this.resources.destroy(),this.drapedResources.destroy(),this._laserline.destroy()}get isDraped(){return this._isDraped}set isDraped(e){e!==this._isDraped&&(this._isDraped=e,this._updateAttached(this.attached),this._laserline.attached=this.laserlineAttached)}get laserlineAttached(){return this.attached&&this.visible&&t(this._laserlineStyle)&&!this.isDraped&&this.laserlineEnabled}get visible(){return this.resources.visible}set visible(e){this.resources.visible=e,this.drapedResources.visible=e,this._laserline.attached=this.laserlineAttached}get attached(){return this.resources.attached||this.drapedResources.attached}set attached(e){this._updateAttached(e)}_updateAttached(e){this.resources.attached=!this.isDraped&&e,this.drapedResources.attached=this.isDraped&&e,this._laserline.attached=this.laserlineAttached,this.attached&&this._attachmentOriginChanged()}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.resources.recreateGeometry(),this.drapedResources.recreateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){l(e,this._color)||(h(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){l(e,this._innerColor)||(h(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const r=t(e)!==t(this._stipplePattern);this._stipplePattern=e,r?this.resources.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&l(e,this._stippleOffColor)||(this._stippleOffColor=e?u(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.resources.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this.laserlineAttached,t(e)&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this.laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;const e=t(this.resources.resources)?this.resources.resources.geometries:null;if(!e||0===e.length)return null;i(V,0,0,0);let s=0;for(const t of e){const e=t.vertexAttributes.get(G.POSITION),i=t.indices.get(G.POSITION),n=r(this.resources.resources).material.isClosed(e.data,i);j(e,i,n,W)&&(a(V,V,W),s++)}return 0===s?null:(n(V,V,1/s),this.view.renderCoordsHelper.fromRenderCoords(V,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){t(this.resources.resources)&&this.resources.resources.material.setParameters(this.materialParameters),t(this.drapedResources.resources)&&this.drapedResources.resources.material.setParameters(this.materialParameters)}get isClosed(){return t(this.geometry)&&"polygon"===this.geometry.type}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this.isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:"round",polygonOffset:!0,renderOccluded:this.normalizedRenderOccluded}}get normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===I.OccludeAndTransparentStencil?I.OccludeAndTransparent:this._renderOccluded}_recreateGeometry(e,t,r){const s=this._createRenderGeometries();for(const i of s)e.addGeometry(i,t),r.push(i);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit("attachment-origin-changed")}_createResources(e){const t=new M(this.materialParameters),r=[];return this._recreateGeometry(e,t,r),{material:t,geometries:r,forEach:e=>{e(t),r.forEach(e)}}}_createDrapedResources(){const e=new M(this.materialParameters);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){const t=this.geometry;if(s(t))return[];const r=R(t,this.view.basemapTerrain.spatialReference),i=[];for(const{position:s}of r.lines){const t={overlayInfo:{spatialReference:this.view.basemapTerrain.spatialReference,renderCoordsHelper:this.view.renderCoordsHelper},attributeData:{position:s},removeDuplicateStartEnd:this.isClosed?E.REMOVE:E.KEEP},r=new A(D(t),e),a=f(T);_(a,s),c(r.boundingSphere,.5*(a[0]+a[3]),.5*(a[1]+a[4]),0,.5*Math.sqrt((a[3]-a[0])*(a[3]-a[0])+(a[4]-a[1])*(a[4]-a[1]))),i.push(r)}return i}calculateMapBounds(e){if(s(this.resources.resources))return!1;const t=this.view.renderCoordsHelper;for(const r of this.resources.resources.geometries){const s=r.vertexAttributes.get(G.POSITION),i=new Float64Array(s.data.length);p(s.data,t.spatialReference,0,i,this.view.spatialReference,0,s.data.length/3),_(e,i)}return!0}_createRenderGeometries(){var e;const t=this.geometry;if(s(t))return[];const r=P(t,this.view.elevationProvider,this.view.renderCoordsHelper,b.fromElevationInfo(null!=(e=this.elevationInfo)?e:new v({mode:y(t,null)}))),i=[],a=[];for(const{position:s,mapPosition:n}of r.lines){const e={overlayInfo:null,attributeData:{position:s,mapPosition:n},removeDuplicateStartEnd:this.isClosed?E.REMOVE:E.KEEP};i.push(D(e)),a.push(s)}return this._laserline.pathVerticalPlane=a,i}}const T=m(),W=o(),V=o();export{S as OutlineVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Handles.js";import{unwrap as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{i as o,f as a,g as c,s as n,m as h}from"../../../../chunks/vec2.js";import{k as l,g as d,n as m,f as u,b as _}from"../../../../chunks/vec3.js";import{c as p,f}from"../../../../chunks/vec3f64.js";import{g,c as y}from"../../../../chunks/vec4.js";import{f as b}from"../../../../chunks/vec4f32.js";import{Object3DVisualElement as j}from"./Object3DVisualElement.js";import
|
|
5
|
+
import e from"../../../../core/Handles.js";import{unwrap as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{i as o,f as a,g as c,s as n,m as h}from"../../../../chunks/vec2.js";import{k as l,g as d,n as m,f as u,b as _}from"../../../../chunks/vec3.js";import{c as p,f}from"../../../../chunks/vec3f64.js";import{g,c as y}from"../../../../chunks/vec4.js";import{f as b}from"../../../../chunks/vec4f32.js";import{Object3DVisualElement as j}from"./Object3DVisualElement.js";import w from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as x}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as G}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as O}from"../../webgl-engine/materials/RibbonLineMaterial.js";class R extends j{constructor(t){super(t),this._handles=new e,this._location=p(),this._direction=f(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=b(1,0,1,1),this._renderOccluded=x.OccludeAndTransparent,this.applyProps(t)}get location(){return this._location}set location(e){l(this._location,e)||(d(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){l(this._direction,e)||(d(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){m(this._direction,u(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){g(e,this._color)||(y(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}createExternalResources(){const e=new O(this.materialParameters);this._handles.add(this.view.state.watch("camera",(()=>{this._updateGeometry()}))),this._externalResources={material:e}}destroyExternalResources(){this._handles.removeAll(),this._externalResources=null}createGeometries(e){const r=w.createPolylineGeometry([p(),p()]),s=w.createPolylineGeometry([p(),p()]),i=t(this._externalResources).material;e.addGeometry(r,i),e.addGeometry(s,i),this._updateVertices(e)}forEachExternalMaterial(e){r(this._externalResources)&&e(this._externalResources.material)}_updateMaterial(){if(s(this._externalResources))return;this._externalResources.material.setParameters(this.materialParameters)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded}}_updateGeometry(){const e=this.object;s(e)||this._updateVertices(e)}_updateVertices(e){const t=this.view.state.camera;t.projectToScreen(this.location,V),_(P,this.location,this.direction),t.projectToScreen(P,v),o(v,a(v,v,V)),this._updateVertexAttributes(t,e,0,V,v,1),this._updateVertexAttributes(t,e,1,V,v,-1)}_updateVertexAttributes(e,t,r,s,i,o){const a=t.geometryRecords[r],l=a.geometry.getMutableAttribute(G.POSITION).data,d=c(A,n(A,i[1]*o,i[0]*-o),this.offset+this.width/2),m=h(M,h(M,h(M,s,c(M,i,this.length/2)),d),d),u=h(k,m,c(k,i,-this.length));e.unprojectFromScreen(m,P),l[0]=P[0],l[1]=P[1],l[2]=P[2],e.unprojectFromScreen(u,P),l[3]=P[0],l[4]=P[1],l[5]=P[2],t.geometryVertexAttrsUpdated(a)}}const P=p(),V=i(),v=i(),A=i(),M=i(),k=i();export{R as ParallelLineVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as e,nextHighestPowerOfTwo as t}from"../../../../core/mathUtils.js";import{isSome as r,isNone as i}from"../../../../core/maybe.js";import{s}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{g as n,c as a}from"../../../../chunks/vec4.js";import{f as l}from"../../../../chunks/vec4f64.js";import{projectVectorToVector as
|
|
5
|
+
import{clamp as e,nextHighestPowerOfTwo as t}from"../../../../core/mathUtils.js";import{isSome as r,isNone as i}from"../../../../core/maybe.js";import{s}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{g as n,c as a}from"../../../../chunks/vec4.js";import{f as l}from"../../../../chunks/vec4f64.js";import{projectVectorToVector as u}from"../../../../geometry/projection.js";import{expandWithBuffer as c}from"../../../../geometry/support/aaBoundingBox.js";import{sv3d as h}from"../../../../geometry/support/vectorStacks.js";import{VisualElementResources as m}from"./VisualElementResources.js";import{evaluateElevationAlignmentAtPoint as p}from"../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as g}from"../../layers/graphics/ElevationContext.js";import{createType as d}from"../../layers/graphics/sdfPrimitives.js";import _ from"../../webgl-engine/lib/GeometryUtil.js";import{Texture as f}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as y}from"../../webgl-engine/lib/VertexAttribute.js";import{HUDMaterial as v}from"../../webgl-engine/materials/HUDMaterial.js";import{TextureWrapMode as S}from"../../../webgl/enums.js";class b{constructor(e){this.view=null,this._geometry=null,this._size=3,this._color=l(1,0,1,1),this._pixelSnappingEnabled=!0,this._primitive="square",this._outlineSize=1,this._outlineColor=l(1,1,1,1),this._elevationInfo=null,this.resources=new m({view:e.view,createResources:e=>this._createResources(e),recreateGeometry:(e,t)=>(e.geometry=this._recreateGeometry(t,e.material),r(e.geometry)?[e.geometry]:[])});let t=!0;for(const r in e)r in this?"attached"===r?t=e[r]:this[r]=e[r]:console.error("Cannot set unknown property",r);this.attached=t}destroy(){this.resources.destroy()}get visible(){return this.resources.visible}set visible(e){this.resources.visible=e}get attached(){return this.resources.attached}set attached(e){this.resources.attached=e}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.resources.recreateGeometry()}get size(){return this._size}set size(e){if(e!==this._size){const t=this.preferredTextureSize;this._size=e,t<this.preferredTextureSize?r(this.resources)&&this.resources.recreate():this._updateSizeAttribute()}}get color(){return this._color}set color(e){n(e,this._color)||(a(this._color,e),this._updateMaterial())}get pixelSnappingEnabled(){return this._pixelSnappingEnabled}set pixelSnappingEnabled(e){this._pixelSnappingEnabled!==e&&(this._pixelSnappingEnabled=e,this._updateMaterial())}get primitive(){return this._primitive}set primitive(e){this._primitive!==e&&(this._primitive=e,r(this.resources)&&this.resources.recreate())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){n(e,this._outlineColor)||(a(this._outlineColor,e),this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.resources&&this.resources.recreateGeometry()}_updateMaterial(){const e=this.resources.resources;i(e)||e.material.setParameters(this._materialParameters(e.texture.id))}_updateSizeAttribute(){const e=this.resources.resources,t=this.resources.object;if(i(e)||i(t))return;const r=e.geometry;if(i(r))return;const s=r.getMutableAttribute(y.SIZE).data,o=this.geometrySize;s[0]=o,s[1]=o,t.geometryVertexAttrsUpdated(t.geometryRecords[0])}_materialParameters(e){return{color:this._color,textureIsSignedDistanceField:!0,distanceFieldBoundingBox:z,occlusionTest:!1,outlineColor:this._outlineColor,outlineSize:this._outlineSize,textureId:e,polygonOffset:!1,shaderPolygonOffset:0,drawInSecondSlot:!0,depthEnabled:!1,pixelSnappingEnabled:this.pixelSnappingEnabled}}get geometrySize(){return this._size/x}_recreateGeometry(e,t){const i=this._createRenderGeometry();return r(i)&&e.addGeometry(i,t),i}_createResources(e){const t=this._createTexture(),i=new v(this._materialParameters(t.id)),s=this._recreateGeometry(e,i);return{material:i,texture:t,geometry:s,forEach(e){e(t),e(i),r(this.geometry)&&e(this.geometry)}}}get preferredTextureSize(){return e(t(2*this.geometrySize),16,128)}_createTexture(){const e=this.preferredTextureSize;return new f(d(this._primitive,e,e*x),{mipmap:!1,wrap:{s:S.CLAMP_TO_EDGE,t:S.CLAMP_TO_EDGE},width:e,height:e,components:4,noUnpackFlip:!0})}calculateMapBounds(e){if(i(this.resources.resources)||i(this.resources.resources.geometry))return!1;const t=this.resources.resources.geometry.vertexAttributes.get(y.POSITION);return u(t.data,this.view.renderCoordsHelper.spatialReference,j,this.view.spatialReference),c(e,j),!0}_createRenderGeometry(){const e=this.geometry;if(i(e))return null;const{renderCoordsHelper:t,elevationProvider:r}=this.view,o=p(e,r,g.fromElevationInfo(this.elevationInfo),t),n=s(h.get(),e.x,e.y,o),a=h.get();u(n,e.spatialReference,a,t.spatialReference);const l=this.geometrySize;return _.createPointGeometry(null,a,null,[l,l],[0,0,0,1])}}const x=.5,z=[x/2,x/2,1-x/2,1-x/2],j=o();export{b as PointVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Handles.js";import{isSome as t}from"../../../../core/maybe.js";import{f as i,h as r}from"../../../../chunks/mat4.js";import{c as s}from"../../../../chunks/mat4f64.js";import{i as a,n as o,f as l,g as n,b as u}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec3f64.js";import{c}from"../../../../chunks/vec4.js";import{f as
|
|
5
|
+
import e from"../../../../core/Handles.js";import{isSome as t}from"../../../../core/maybe.js";import{f as i,h as r}from"../../../../chunks/mat4.js";import{c as s}from"../../../../chunks/mat4f64.js";import{i as a,n as o,f as l,g as n,b as u}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec3f64.js";import{c as d}from"../../../../chunks/vec4.js";import{f as c}from"../../../../chunks/vec4f32.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as m}from"./Object3DVisualElement.js";import{Geometry as p}from"../../webgl-engine/lib/Geometry.js";import M from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as g}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as f}from"../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as O}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as y}from"../../webgl-engine/materials/RibbonLineMaterial.js";class z extends m{constructor(t){super(t),this._handles=new e,this._quadMaterial=null,this._outlineMaterial=null,this._maxSize=0,this._position=h(),this._up=h(),this._right=h(),this._renderOccluded=g.OccludeAndTransparent,this._color=c(1,0,0,1),this._outlineColor=c(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=g.Opaque,this.applyProps(t)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get color(){return this._color}set color(e){d(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){d(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:i}){this._maxSize=Math.min(a(t,e),a(t,i))/3,o(this._up,l(this._up,e,t)),o(this._right,l(this._right,i,t)),n(this._position,t),this.recreateGeometry()}createExternalResources(){this._quadMaterial=new O(this.quadMaterialParameters),this._outlineMaterial=new y(this.outlineMaterialParameters),this._handles.add(this.view.state.watch("camera",(()=>this._updateTransform())))}destroyExternalResources(){this._quadMaterial=null,this._outlineMaterial=null,this._handles.removeAll()}forEachExternalMaterial(e){e(this._quadMaterial),e(this._outlineMaterial)}createGeometries(e){this._createQuadGeometry(e),this._createOutlineGeometry(e),this._updateTransform(e)}_createQuadGeometry(e){const t=this._quadGeometryData(this._up,this._right);e.addGeometry(t,this._quadMaterial)}_createOutlineGeometry(e){if(0===this._outlineSize)return;const t=u(_.get(),this._up,this._right),i=M.createPolylineGeometry([this._up,t,this._right]);e.addGeometry(i,this._outlineMaterial)}_updateTransform(e=this.object){const s=this.view.state.camera,a=this._size*s.computeScreenPixelSizeAt(this._position),o=Math.min(this._maxSize,a);i(j,this._position),r(j,j,[o,o,o]),t(e)&&(e.transformation=j)}_quadGeometryData(e,t){const i=u(_.get(),e,t);return new p([[f.POSITION,{size:3,data:[0,0,0,...t,...e,...i],exclusive:!0}]],[[f.POSITION,new Uint16Array([0,1,2,1,2,3])]])}get quadMaterialParameters(){return{color:this._color,transparent:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded}}_updateQuadMaterial(){this._quadMaterial&&this._quadMaterial.setParameters(this.quadMaterialParameters)}get outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded}}_updateOutlineMaterial(){this._outlineMaterial&&this._outlineMaterial.setParameters(this.outlineMaterialParameters)}}const j=s();export{z as RightAngleQuadVisualElement};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as t,isSome as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as t,isNone as s,isSome as o}from"../../../core/maybe.js";import{initial as i,watch as a,when as l,syncAndInitial as u}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGeometry as p}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as c}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import{FeatureLikeLayerView3D as h}from"./FeatureLikeLayerView3D.js";import{LayerView3D as d}from"./LayerView3D.js";import{FeatureTileFetcher3DLayerViewContext as y}from"./support/FeatureTileFetcher3DLayerViewContext.js";import{EventedSet as f}from"../support/EventedSet.js";import{updatingProgress as g}from"../support/updatingProperties.js";import{UpdatePolicy as F}from"../webgl-engine/lib/basicInterfaces.js";import{FeatureLayerView as b}from"../../layers/FeatureLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as x}from"../../layers/RefreshableLayerView.js";let M=class extends(x(h(b(d(v))))){constructor(e){super(e),this._controllerTotal=0,this._processorTotal=0,this.suspendResumeExtentMode="data"}initialize(){this.updatingHandles.add((()=>this.view.floors),(()=>this.processor.filterVisibility.filterChanged()))}destroy(){this.updatingHandles.removeAll(),this.handles.removeAll(),this.fetcherContext=t(this.fetcherContext)}get maximumNumberOfFeatures(){var e,r;return null!=(e=null==(r=this.controller)?void 0:r.maximumNumberOfFeatures)?e:this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(e){this._set("maximumNumberOfFeatures",e),this.controller&&(this.controller.maximumNumberOfFeatures=e)}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){var e,r;let t=0;if(null!=(e=this.controller)&&e.updating){const e=this.controller.updatingRemaining,r=Math.max(this.controller.updatingTotal,this._controllerTotal);r>0&&(t=(r-e)/r,this._controllerTotal=r)}let s=0;if(null!=(r=this.processor)&&r.updating){const e=this.processor.updatingRemaining,r=Math.max(e,this._processorTotal);r>0&&(s=(r-e)/r,this._processorTotal=r)}return.5*(t+s)}get updatePolicy(){if(!this.controller)return F.ASYNC;switch(this.controller.mode){case"snapshot":{const e=O[this.layer.geometryType];return null==e||this.controller.serviceDataCount>e?F.ASYNC:F.SYNC}case"tiles":return F.ASYNC}}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){var t;null==(t=this.processor)||t.setObjectIdVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}beforeSetController(e){e.maximumNumberOfFeatures=this.maximumNumberOfFeatures}createController(){this.fetcherContext=new y({layerView:this,returnZ:this.hasZ,returnM:this.hasM});const e=new c({layerView:this,context:this.fetcherContext,graphics:new f,extent:this.clippingExtent});return this.updatingHandles.add((()=>e.serviceDataExtent),(e=>{this.processor&&(this.processor.dataExtent=e)}),i),this.handles.add(a((()=>this.suspended),(r=>{r?e.suspend():e.resume()}),u)),this.updatingHandles.add((()=>{var e;return null==(e=this.processor)?void 0:e.displayFeatureLimit}),(()=>this._updateDisplayFeatureLimit(e)),i),this.handles.add([this.view.resourceController.memoryController.events.on("quality-changed",(()=>this._updateDisplayFeatureLimit())),l((()=>!this.updating),(()=>{this._controllerTotal=0,this._processorTotal=0}))]),e}async doRefresh(e){e&&!this.suspended&&this.controller&&this.controller.refetch(),this.processor.filterVisibility.dirty=!0}getUsedMemory(){var e,r,t,s;return(null!=(e=null==(r=this.processor)?void 0:r.usedMemory)?e:0)+(null!=(t=null==(s=this.controller)?void 0:s.memoryForUnusedFeatures)?t:0)}getUnloadedMemory(){var e,r,t,s,o;return(null!=(e=null==(r=this.processor)?void 0:r.unprocessedMemoryEstimate)?e:0)+(null!=(t=(null==(s=this.controller)?void 0:s.expectedFeatureDiff)*(null==(o=this.processor)?void 0:o.usedMemoryPerFeature))?t:0)}ignoresMemoryFactor(){var e;return null==(e=this.controller)?void 0:e.hasMaximumNumberOfFeaturesOverride}_updateDisplayFeatureLimit(e=this.controller){if(!e||!this.processor)return;const r=this.processor.displayFeatureLimit,t=this.view.resourceController.memoryController.memoryFactor;if(1===t)e.displayFeatureLimit=r;else{const s=Math.ceil(r.maximumNumberOfFeatures*t),o=Math.ceil(r.maximumTotalNumberOfFeatures*t),i=Math.ceil(r.minimumTotalNumberOfFeatures*t);e.displayFeatureLimit={...r,maximumNumberOfFeatures:s,maximumTotalNumberOfFeatures:o,minimumTotalNumberOfFeatures:i}}}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r();if(e&&e.outStatistics||s(this.graphics3DProcessor))return t;const o=this.layer.objectIdField,i=this.graphics3DProcessor.graphics3DGraphicsByObjectID,a=[];for(const s of t.features)if(s.geometry){const e=i.get(s.attributes[o]);e&&(s.geometry=p(e.graphic.geometry),a.push(s))}else a.push(s);return t.features=a,t}async _validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},s=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of s)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),o(e.outSpatialReference)&&!e.outSpatialReference.equals(this.view.spatialReference)&&t("outSpatialReference")}get performanceInfo(){var e,r,t,s,i;const a=null==(e=this.controller)?void 0:e.displayFeatureLimit,l=o(a)&&a.averageSymbolComplexity,u=o(l)?`f:${l.primitivesPerFeature},v:${l.primitivesPerCoordinate}`:"n/a",n={...this._getResourceInfo(),storedFeatures:0,totalVertices:0,partial:this.maximumNumberOfFeaturesExceeded,mode:null!=(r=null==(t=this.controller)?void 0:t.mode)?r:"n/a",symbolComplexity:u,nodes:null!=(s=null==(i=this.controller)?void 0:i.tileDescriptors.length)?s:0};if(this.controller&&n.displayedNumberOfFeatures){const e=this.controller.debug;n.storedFeatures=e.storedFeatures,n.totalVertices=e.totalVertices}return n}get test(){return{updatePolicy:this.updatePolicy,controller:this.controller}}};e([n()],M.prototype,"layer",void 0),e([n()],M.prototype,"controller",void 0),e([n()],M.prototype,"_controllerTotal",void 0),e([n()],M.prototype,"_processorTotal",void 0),e([n()],M.prototype,"maximumNumberOfFeatures",null),e([n()],M.prototype,"maximumNumberOfFeaturesExceeded",null),e([n(g)],M.prototype,"updatingProgress",void 0),e([n({readOnly:!0})],M.prototype,"updatingProgressValue",null),e([n({readOnly:!0})],M.prototype,"updatePolicy",null),e([n({readOnly:!0})],M.prototype,"hasZ",null),e([n({readOnly:!0})],M.prototype,"hasM",null),e([n()],M.prototype,"suspendResumeExtentMode",void 0),M=e([m("esri.views.3d.layers.FeatureLayerViewBase3D")],M);const O={point:5e3,polygon:500,polyline:1e3},w=M;export{w as default};
|