@arcgis/core 6.0.0-next.40 → 6.0.0-next.41
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/Camera.js +1 -1
- package/applications/Components/arcadeFeatureUtils.d.ts +12 -0
- package/applications/Components/arcadeFeatureUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +1 -0
- package/assets/esri/core/workers/chunks/059cda6f11a91dbc9e28.js +1 -0
- package/assets/esri/core/workers/chunks/{1c406ab2bf99ac563316.js → 0696fa44a04b99738d7b.js} +1 -1
- package/assets/esri/core/workers/chunks/073f0232135f71b6c7a5.js +1 -0
- package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +1 -0
- package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +1 -0
- package/assets/esri/core/workers/chunks/0bf43d80cb40c2b43333.js +1 -0
- package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +1 -0
- package/assets/esri/core/workers/chunks/1866f832e5f52958bc97.js +1 -0
- package/assets/esri/core/workers/chunks/19e51cbb354954ddafbd.js +1 -0
- package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +1 -0
- package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +1 -0
- package/assets/esri/core/workers/chunks/23f3692c7426173e8352.js +1 -0
- package/assets/esri/core/workers/chunks/24bdeafbb16ae83bb8c3.js +1 -0
- package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +1 -0
- package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +1 -0
- package/assets/esri/core/workers/chunks/2dfe6af28cd1b29d5ebc.js +1 -0
- package/assets/esri/core/workers/chunks/2e760d04641755d1820d.js +1 -0
- package/assets/esri/core/workers/chunks/{0b21d0e2e5a91c34a108.js → 2f54e4feb554c1a7b9c4.js} +1 -1
- package/assets/esri/core/workers/chunks/305eeaac0b4d5b79ebde.js +1 -0
- package/assets/esri/core/workers/chunks/353976c812ebf0c98549.js +1 -0
- package/assets/esri/core/workers/chunks/45aaefbdffe5e15dfb24.js +1 -0
- package/assets/esri/core/workers/chunks/{592b5db1459c02cf6a0c.js → 46504fc81f357bc7465a.js} +1 -1
- package/assets/esri/core/workers/chunks/4caebb64a365da18453f.js +1 -0
- package/assets/esri/core/workers/chunks/{2fcd7db1e192858a650e.js → 503ee206e7de1f65e291.js} +1 -1
- package/assets/esri/core/workers/chunks/{76e80381fa6d1e084796.js → 54de7dc0597fc80d7a52.js} +1 -1
- package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +1 -0
- package/assets/esri/core/workers/chunks/598ba405e93ebccf7b2d.js +1 -0
- package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +1 -0
- package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +1 -0
- package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +1 -0
- package/assets/esri/core/workers/chunks/{00311d1b18d5952a014b.js → 6738b3d6bce34a1e8be2.js} +1 -1
- package/assets/esri/core/workers/chunks/67c2e5953087dadfd245.js +1 -0
- package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +1 -0
- package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +1 -0
- package/assets/esri/core/workers/chunks/6d863761f29f31a030eb.js +1 -0
- package/assets/esri/core/workers/chunks/{ce8ef2eec290e1df6b2a.js → 7390af96250e89194332.js} +1 -1
- package/assets/esri/core/workers/chunks/7452b5ae971a9ff2e6e9.js +1 -0
- package/assets/esri/core/workers/chunks/7672c123cfb960f4ddad.js +1 -0
- package/assets/esri/core/workers/chunks/{9934e8e19f94e9169eea.js → 776b64a1e1a57878c34c.js} +1 -1
- package/assets/esri/core/workers/chunks/{58716a3a6106a1b0fb9d.js → 832c887fdc5af4c08cf2.js} +1 -1
- package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +1 -0
- package/assets/esri/core/workers/chunks/8b0be232723424dda320.js +1 -0
- package/assets/esri/core/workers/chunks/{7023651ed6398dcf8efb.js → 8b0efcc30184593a0812.js} +21 -21
- package/assets/esri/core/workers/chunks/8b38fad017c4c0d9e1ec.js +1 -0
- package/assets/esri/core/workers/chunks/{b2d6b1ac9fbb50c7c8ab.js → 929ca32ddbb43328ef31.js} +1 -1
- package/assets/esri/core/workers/chunks/98958203a5ca45b24d72.js +1 -0
- package/assets/esri/core/workers/chunks/a03f15f2cbc3fed291c2.js +1 -0
- package/assets/esri/core/workers/chunks/{22e73501e1435a896826.js → a5f17e9a025ac2b6e1bf.js} +1 -1
- package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +1 -0
- package/assets/esri/core/workers/chunks/af2087b75225d7d7dbd8.js +1 -0
- package/assets/esri/core/workers/chunks/afe3e89737fb45189a99.js +1 -0
- package/assets/esri/core/workers/chunks/b18459c1bed75dbdec08.js +1 -0
- package/assets/esri/core/workers/chunks/{f07fb9b3fa30d7ee1681.js → b386e921c273de3ac7a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{d03b82e962c70a3fd377.js → b4928831a2a13b2da745.js} +1 -1
- package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +1 -0
- package/assets/esri/core/workers/chunks/{dae2036faa28dade2119.js → beccbfff549902733c4e.js} +1 -1
- package/assets/esri/core/workers/chunks/c5364ff8dd1358af3603.js +1 -0
- package/assets/esri/core/workers/chunks/{9e2c30b67bab5795306e.js → cb2329d1ea72ce5cc057.js} +1 -1
- package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +1 -0
- package/assets/esri/core/workers/chunks/d0172d31389dbfaaa848.js +1 -0
- package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +1 -0
- package/assets/esri/core/workers/chunks/dff845574c0037a1dca6.js +1 -0
- package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +1 -0
- package/assets/esri/core/workers/chunks/e0cf6e1e21d0ee739009.js +1 -0
- package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +1 -0
- package/assets/esri/core/workers/chunks/{396299c22994c502e41c.js → efc1a90742813b55602e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9feffb9884cfed52c4b.js → f190a3124d6d03417d73.js} +1 -1
- package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +1 -0
- package/assets/esri/core/workers/chunks/f6f5937a1308f28bb959.js +1 -0
- package/assets/esri/core/workers/chunks/fd17c4a9e13bf77aa86a.js +1 -0
- package/assets/esri/core/workers/chunks/fdd2b35388f9fe42b623.js +1 -0
- package/assets/esri/core/workers/chunks/fe24e039385473bf77f9.js +1 -0
- package/chunks/cameraUtilsPlanar.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.d.ts +1 -1
- package/core/Accessor.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/Property.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/mat4.js +1 -1
- package/core/workers/workers.js +1 -6
- package/core/workers.d.ts +1 -2
- package/geometry/Extent.js +1 -1
- package/geometry/Geometry.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/Polyline.js +1 -1
- package/geometry/coordinateFormatter.js +1 -1
- package/geometry/operators/gx/operatorRelate.js +2 -0
- package/geometry/operators/relateOperator.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.js +1 -1
- package/layers/BaseTileLayer.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoRSSLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/OpenStreetMapLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/WebTileLayer.js +1 -1
- package/layers/graphics/sources/CSVSource.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/formats/tiffParser.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/GeometryDescriptor.js +1 -1
- package/layers/support/KMLSublayer.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/package.json +3 -3
- package/portal/PortalItem.js +1 -1
- package/rest/query/executePivotQuery.js +1 -1
- package/rest/query/operations/queryPivot.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/PivotQuery.js +1 -1
- package/rest/support/Query.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
- package/symbols/PictureFillSymbol.js +1 -1
- package/symbols/PictureMarkerSymbol.js +1 -1
- package/symbols/SimpleFillSymbol.js +1 -1
- package/symbols/SimpleLineSymbol.js +1 -1
- package/symbols/SimpleMarkerSymbol.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/symbols/cim/Rasterizer.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/PaddedViewState.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/WMSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStateSet.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStates.js +1 -1
- package/views/3d/layers/i3s/Highlights.js +1 -1
- package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
- package/views/3d/layers/support/createFeatureFilterHighlight.js +2 -0
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/highlightUtils.js +1 -1
- package/views/3d/layers/support/selectTiles3DSpatialReference.js +2 -0
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/earthUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/createWebGLContext.js +2 -0
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/ribbonLineBufferUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl.d.ts +2 -1
- package/views/3d/webgl.js +1 -1
- package/views/SceneView.d.ts +7 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +3 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/GraphicsLayerView.d.ts +3 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/SceneLayerView.d.ts +3 -2
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/types.d.ts +1 -0
- package/webscene/version.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/support/FeatureElementInfo.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/SizeRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltip.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Spinner.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList/ListItemPanel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.js +1 -1
- package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider.js +1 -1
- package/widgets/smartMapping/OpacitySlider.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/PluginSettingsControls.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/TimezonePicker.js +1 -1
- package/widgets/support/UnitSelect.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/01803f76bc0d9f2cd566.js +0 -1
- package/assets/esri/core/workers/chunks/02940f7ddaf98e69521e.js +0 -1
- package/assets/esri/core/workers/chunks/07e5482e1fc69be5de09.js +0 -1
- package/assets/esri/core/workers/chunks/0c893837f67829757df7.js +0 -1
- package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +0 -1
- package/assets/esri/core/workers/chunks/1a91443970d64a59521d.js +0 -1
- package/assets/esri/core/workers/chunks/20a2124cbe43e5527c40.js +0 -1
- package/assets/esri/core/workers/chunks/26ea39dfdf887f357fce.js +0 -1
- package/assets/esri/core/workers/chunks/276a0b549acf048e8673.js +0 -1
- package/assets/esri/core/workers/chunks/2c3612379111457c3221.js +0 -1
- package/assets/esri/core/workers/chunks/34467f7d84baffd772a3.js +0 -1
- package/assets/esri/core/workers/chunks/398ec098fffe6abceedd.js +0 -1
- package/assets/esri/core/workers/chunks/3b32a24488b3068f0cb7.js +0 -1
- package/assets/esri/core/workers/chunks/427d929dc7f89b0a1ea9.js +0 -1
- package/assets/esri/core/workers/chunks/432728c557be5dfa26b5.js +0 -1
- package/assets/esri/core/workers/chunks/4c240ca50f70bf30813f.js +0 -1
- package/assets/esri/core/workers/chunks/514cc15acb77dc85035c.js +0 -1
- package/assets/esri/core/workers/chunks/585ae43c7bcb86a26762.js +0 -1
- package/assets/esri/core/workers/chunks/5e48898cebb6dbaf09b5.js +0 -1
- package/assets/esri/core/workers/chunks/5ec5a6cef9ee9a8cc400.js +0 -1
- package/assets/esri/core/workers/chunks/601e1d020b8115497944.js +0 -1
- package/assets/esri/core/workers/chunks/687deb918eb48a963c8f.js +0 -1
- package/assets/esri/core/workers/chunks/6a21dc13a465757ba007.js +0 -1
- package/assets/esri/core/workers/chunks/6e910342ada398c98e30.js +0 -1
- package/assets/esri/core/workers/chunks/78818c2a898444f7e890.js +0 -1
- package/assets/esri/core/workers/chunks/7d2cbc767c336d15e4d5.js +0 -1
- package/assets/esri/core/workers/chunks/7d497df6e13162156342.js +0 -1
- package/assets/esri/core/workers/chunks/7dbf4c7480bf9c72820d.js +0 -1
- package/assets/esri/core/workers/chunks/80c234ee5276ea1645db.js +0 -1
- package/assets/esri/core/workers/chunks/966204d6dedc8149c3e9.js +0 -1
- package/assets/esri/core/workers/chunks/9ab0735e86cf8932bf9d.js +0 -1
- package/assets/esri/core/workers/chunks/a0356702f2d3f787aeac.js +0 -1
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +0 -1
- package/assets/esri/core/workers/chunks/ab0ea4042f4e13874aed.js +0 -1
- package/assets/esri/core/workers/chunks/ab98ade3257360015d6c.js +0 -1
- package/assets/esri/core/workers/chunks/b13d8f4e4e80ef00b1bd.js +0 -1
- package/assets/esri/core/workers/chunks/b15a8d4322f3b7819d2f.js +0 -1
- package/assets/esri/core/workers/chunks/b472c0a21ae29e653f7d.js +0 -1
- package/assets/esri/core/workers/chunks/b90271ce38522bcf813b.js +0 -1
- package/assets/esri/core/workers/chunks/ba91df9835cdea7698a9.js +0 -1
- package/assets/esri/core/workers/chunks/bd812dd75d2a3d7d0441.js +0 -1
- package/assets/esri/core/workers/chunks/bfe13ac9fa1aafb190a1.js +0 -1
- package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +0 -1
- package/assets/esri/core/workers/chunks/c31830ee897d5a7f2582.js +0 -1
- package/assets/esri/core/workers/chunks/c48d97c38e821be17dc5.js +0 -1
- package/assets/esri/core/workers/chunks/c7ad62f54d2abe1d17a0.js +0 -1
- package/assets/esri/core/workers/chunks/cf21b217b13770757cb8.js +0 -1
- package/assets/esri/core/workers/chunks/d42a4f47843e075c56a8.js +0 -1
- package/assets/esri/core/workers/chunks/deb408bee61ca192b2ce.js +0 -1
- package/assets/esri/core/workers/chunks/e121d15b883184ee83e7.js +0 -1
- package/assets/esri/core/workers/chunks/e4042e43f0081fe49f7b.js +0 -1
- package/assets/esri/core/workers/chunks/e932951598499befabf5.js +0 -1
- package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +0 -1
- package/assets/esri/core/workers/chunks/f06ef153e106b26a6748.js +0 -1
- package/assets/esri/core/workers/chunks/faae3c43048b42341536.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../Camera.js";import t from"../../../core/Logger.js";import{deg2rad as n,rad2deg as r,asinClamped as i}from"../../../core/mathUtils.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{copy as o,distance as s,dist as c,length as l}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,clone as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectAsync as m,project as h}from"../../../geometry/projectionUtils.js";import g from"../../../geometry/SpatialReference.js";import{projectPointToVectorAsync as _,projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as y,projectVectorToPoint as b}from"../../../geometry/projection/projectVectorToPoint.js";import{gcsCyclical as x,webMercatorCyclical as S}from"../../../geometry/support/normalizeUtils.js";import{toRenderCamera as C}from"../webgl.js";import{scaleToDistance as w,distanceToScale as T}from"./cameraScaleUtils.js";import{getGreatCircleSpanAt as E}from"./earthUtils.js";import{getElevationAtPoint as D}from"./ElevationProvider.js";import{viewModeDependentUtil as O,directionToHeadingTilt as k}from"./viewingModeUtils.js";import{isSpatialReferenceSupported as A}from"../../support/spatialReferenceSupport.js";const j=()=>t.getLogger(`esri.views.3d.support.cameraUtils`),M=u();function N(e){return e.spatialReference??g.WGS84}function ee(e,t,n,r,i){return O(e).headingTiltToDirectionUp(t,n,r,i)}function P(e,t,n,r){let i=r.levelAtScale(t),a=k(e,n.eye,n.viewForward,n.up).tilt,o=I(a),s=Math.max(i-o,0);return r.scaleAtLevel(s)}function F(e,t,n){let r=n.levelAtScale(e),i=I(t);return n.scaleAtLevel(r+i)}function I(e){return 2*((e>90?180-e:e)/90)**2}function te(e,t,n=0){let r=e.basemapTerrain?.tilingScheme;if(!r)return 0;let i=f(e.spatialReference).radius,a=e.state.viewingMode===2?t.eye[2]:l(t.eye)-i,o=Math.abs(a-n);return P(e,T(e,o),t,r)}function ne(e,t,n=0){let r=C(e,t);return r?te(e,r,n):0}const re=1;function ie(e,t,a,o){if(t===0)return 0;let c=e.state.contentCamera,u=s(c.eye,a),d=e.basemapTerrain?.tilingScheme;if(!d)return j().error(`#scaleToTargetDistance()`,`Cannot compute distance from scale without a tiling scheme`),u;let p=u,m=k(e,c.eye,c.viewForward,c.up),h=m.tilt>90;if(e.state.isLocal){let r=F(t,m.tilt,d),i=(w(e,r)-Math.abs(c.eye[2]-o[2]))/Math.cos(n(m.tilt));return p=h?p-i:p+i,p}let g=1/0,_=0,v=z(e,m.heading,m.tilt,a,u,1);if(!v)return p;let y=l(o);for(;g>1&&_<100;){let o=l(v.eye),u=h?180-v.tilt:v.tilt,b=n(u),x=Math.sin(b)*o,S=Math.cos(b)*o,C=F(t,v.tilt,d),T=w(e,C),E=h?y-T:y+T,D=i(x/E),O=Math.cos(D)*E-S,k=s(v.eye,a);p=h?k-O:k+O,v=z(e,m.heading,m.tilt,a,p,1);let A=Q(e,v,r(c.fov));if(!v||!A)return p;let j=f(e.spatialReference).radius,M=ne(e,A,y-j);g=Math.abs(t-M),++_}return p}async function ae(e,t,n,r,i,a){return L(e,t,w(e,n),r,i,a)}function oe(e,t,n,r,i,a){return Q(e,z(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function L(e,t,n,r,i,o){let s=await B(e,r.heading,r.tilt,t,n,i,o);return a(o),$(e,s,r.fov,o)}function R(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,M,e.spatialReference)&&e.elevationProvider&&(D(e.elevationProvider,M)??0)>M[2]-1)}async function se(e,t,n){if(R(e,t))return!0;let{elevationProvider:r,spatialReference:i,renderCoordsHelper:o}=e;if(r==null||!o.fromRenderCoords(t,M,i))return!1;let[s,c,l]=M,u=await r.queryElevation(s,c,l,i,`ground`,n)??0;return a(n),u>l-1}async function ce(e,t,n){let r=u();if(t==null)return o(r,e.state.camera.center);if(t instanceof p){let{renderSpatialReference:i,basemapTerrain:o,elevationProvider:s}=e,c=t.spatialReference;if(await _(t,r,i,{signal:n}),a(n),t.z==null&&o!=null&&s!=null){let i=await s.queryElevation(t.x,t.y,t.z??0,c,`ground`,n);a(n),i!=null&&e.renderCoordsHelper.setAltitude(r,i)}return r}return o(r,t)}function le(e,t){let n=u();if(t==null)return o(n,e.state.camera.center);if(t instanceof p){if(!v(t,n,e.renderSpatialReference))return null;let{basemapTerrain:r,elevationProvider:i}=e;if(t.z==null&&r!=null&&i!=null){let r=D(i,t);r!=null&&e.renderCoordsHelper.setAltitude(n,r)}return n}return o(n,t)}function z(e,t,n,r,i,a){return V(e,t,n,r instanceof p?r:null,le(e,r),i,a)}async function B(e,t,n,r,i,o,s){let c=r instanceof p?r:null,l=await ce(e,r,s);return a(s),H(e,t,n,c,l,i,o,s)}function V(e,t,n,r,i,a,o){if(i==null||!r&&(r=new p({spatialReference:N(e)}),!b(i,e.renderSpatialReference,r)))return null;let s=U(e,t,n,i,a,o);if(W(e,n,o)&&R(e,s.eye)){let{tilt:o,mode:s}=G(e,n,i,a);return V(e,t,o,r,i,a,s)}return K(s,i)}async function H(e,t,n,r,i,o,s,c){r||(r=new p({spatialReference:N(e)}),await y(i,e.renderSpatialReference,r,{signal:c})||(r=null)),a(c);let l=U(e,t,n,i,o,s);if(W(e,n,s)&&await se(e,l.eye,c)){a(c);let{tilt:s,mode:l}=G(e,n,i,o);return H(e,t,s,r,i,o,l,c)}return K(l,i)}function U(e,t,n,r,i,a){i=Math.max(i,e.state.constraints.minimumPoiDistance);let o=he(e,t,n,r,i,a),s=O(e).eyeForCenterWithHeadingTilt;return s(r,i,o.heading,o.tilt)}function W(e,t,n){let r=e.map.ground.navigationConstraint;return n===1&&e.state.isGlobal&&t>0&&(r==null||r.type===`stay-above`)}function G(e,t,n,r){let i=X(e,n,r,_e(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function K(e,t){return{...e,center:d(t)}}function q(e,t){let{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&A(i,1)||n.isLocal&&r.equals(i)}function J(e,t){let n,r,i;if(e.state.isGlobal){let e=new p(t.xmin,t.ymin,t.spatialReference),a=new p(t.xmax,t.ymax,t.spatialReference),o=t.spatialReference.isGeographic?x:S;n=new p({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});let s=f(t.spatialReference),c=E(n,e,a);r=c.lon,i=c.lat,o.diff(e.x,a.x)>o.range/2&&(r+=s.halfCircumference),r=Math.min(r,s.halfCircumference),i=Math.min(i,s.halfCircumference)}else{let a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=h(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;let o=t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0;n=new p({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}let a=t.zmax!=null&&t.zmin!=null?t.zmax-t.zmin:0,o=e.state.camera,s=1/Math.tan(o.fovX/2),c=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2),u=Math.max(.5*r*s,.5*i*c,.5*a*l)/1;return{center:n,distance:u}}async function ue(e,t,n,r,i,o){let s=q(e,t)?t:await m(t,e.spatialReference,{signal:o});a(o);let{center:c,distance:l}=J(e,s),u=await B(e,n,r,c,l,i,o);return a(o),$(e,u,e.camera.fov,o)}function de(e,t,n,r,i,a){let o;try{o=q(e,t)?t:h(t,e.spatialReference)}catch{return null}let{center:s,distance:c}=J(e,o),l=z(e,n,r,s,c,i);return l==null?null:Q(e,l,e.camera.fov,a)}function fe(e,t,n){let r=e.renderSpatialReference,i=new p({spatialReference:N(e)});if(!b(n,r,i))return null;let a=Math.tan(t.fovX/2),o=Math.tan(t.fovY/2),s=c(t.eye,n),l=2*s*a*1,u=2*s*o*1;return O(e).toExtent(e,i,l,u)}function pe(e,t){return O(e).toArea(e,t)}function me(e,t,n){let r=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(n/r)/Math.LN2>8)return!0;let i=t,a=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return s(i,a)/(Math.tan(e.state.camera.fov*.5)*r)>5}function he(e,t,n,r,i,a){let o=0;return a===1&&me(e,r,i)?(t=0,o=ge(e,i,n,r)):o=Z(e,r,i,n),o=e.state.constraints.clampTilt(i,o),n=X(e,r,i,o),{heading:t,tilt:n}}const Y=.7;function ge(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);a.max=Math.min(a.max,Math.PI*.5);let o=a.min*.30000000000000004+a.max*Y;return Math.min(i,o)}function _e(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);return i=Math.min(i,Math.PI*.5),a.min*.30000000000000004+i*Y}function X(e,t,n,r){return O(e).lookAtTiltToEyeTilt(r,t,n)}function Z(e,t,n,r){return O(e).eyeTiltToLookAtTilt(r,t,n)}function Q(t,n,r,i){if(n==null)return null;let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return b(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function $(t,n,r,i){let o=t.renderSpatialReference,s=new p({spatialReference:N(t)});return await y(n.eye,o,s,{signal:i}),a(i),new e(s,n.heading,n.tilt,r)}function ve(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#scaleToZoom()`,`Cannot compute zoom from scale without a tiling scheme`);else return n.levelAtScale(t)}function ye(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#zoomToScale()`,`Cannot compute scale from zoom without a tiling scheme`);else return n.scaleAtLevel(t)}export{P as applyTiltAdjustToScale,L as fromCenterDistanceAsync,oe as fromCenterDistanceSync,ae as fromCenterScale,ue as fromExtentAsync,de as fromExtentSync,B as getObserverForPointAtDistanceAsync,z as getObserverForPointAtDistanceSync,N as getViewSR,ee as headingTiltToDirectionUp,F as removeTiltAdjustFromScale,re as scaleErrorThreshold,ve as scaleToZoom,pe as toArea,fe as toExtent,ie as viewScaleToCameraDistance,ye as zoomToScale};
|
|
2
|
+
import e from"../../../Camera.js";import t from"../../../core/Logger.js";import{deg2rad as n,rad2deg as r,asinClamped as i}from"../../../core/mathUtils.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{copy as o,distance as s,dist as c,length as l}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,clone as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectAsync as m,project as h}from"../../../geometry/projectionUtils.js";import g from"../../../geometry/SpatialReference.js";import{projectPointToVectorAsync as _,projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as y,projectVectorToPoint as b}from"../../../geometry/projection/projectVectorToPoint.js";import{gcsCyclical as x,webMercatorCyclical as S}from"../../../geometry/support/normalizeUtils.js";import{toRenderCamera as C}from"../webgl.js";import{scaleToDistance as w,distanceToScale as T}from"./cameraScaleUtils.js";import{getGreatCircleSpanAt as E}from"./earthUtils.js";import{getElevationAtPoint as D}from"./ElevationProvider.js";import{viewModeDependentUtil as O,directionToHeadingTilt as k}from"./viewingModeUtils.js";import{isSpatialReferenceSupported as A}from"../../support/spatialReferenceSupport.js";const j=()=>t.getLogger(`esri.views.3d.support.cameraUtils`),M=u();function N(e){return e.spatialReference??g.WGS84}function ee(e,t,n,r,i){return O(e).headingTiltToDirectionUp(t,n,r,i)}function P(e,t,n,r){let i=r.levelAtScale(t),a=k(e,n.eye,n.viewForward,n.up).tilt,o=I(a),s=Math.max(i-o,0);return r.scaleAtLevel(s)}function F(e,t,n){let r=n.levelAtScale(e),i=I(t);return n.scaleAtLevel(r+i)}function I(e){return 2*((e>90?180-e:e)/90)**2}function te(e,t,n=0){let r=e.basemapTerrain?.tilingScheme;if(!r)return 0;let i=f(e.spatialReference).radius,a=e.state.viewingMode===2?t.eye[2]:l(t.eye)-i,o=Math.abs(a-n);return P(e,T(e,o),t,r)}function ne(e,t,n=0){let r=C(e,t);return r?te(e,r,n):0}const re=1;function ie(e,t,a,o){if(t===0)return 0;let c=e.state.contentCamera,u=s(c.eye,a),d=e.basemapTerrain?.tilingScheme;if(!d)return j().error(`#scaleToTargetDistance()`,`Cannot compute distance from scale without a tiling scheme`),u;let p=u,m=k(e,c.eye,c.viewForward,c.up),h=m.tilt>90;if(e.state.isLocal){let r=F(t,m.tilt,d),i=(w(e,r)-Math.abs(c.eye[2]-o[2]))/Math.cos(n(m.tilt));return p=h?p-i:p+i,p}let g=1/0,_=0,v=z(e,m.heading,m.tilt,a,u,1);if(!v)return p;let y=l(o);for(;g>1&&_<100;){let o=l(v.eye),u=h?180-v.tilt:v.tilt,b=n(u),x=Math.sin(b)*o,S=Math.cos(b)*o,C=F(t,v.tilt,d),T=w(e,C),E=h?y-T:y+T,D=i(x/E),O=Math.cos(D)*E-S,k=s(v.eye,a);p=h?k-O:k+O,v=z(e,m.heading,m.tilt,a,p,1);let A=Q(e,v,r(c.fov));if(!v||!A)return p;let j=f(e.spatialReference).radius,M=ne(e,A,y-j);g=Math.abs(t-M),++_}return p}async function ae(e,t,n,r,i,a){return L(e,t,w(e,n),r,i,a)}function oe(e,t,n,r,i,a){return Q(e,z(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function L(e,t,n,r,i,o){let s=await B(e,r.heading,r.tilt,t,n,i,o);return a(o),$(e,s,r.fov,o)}function R(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,M,e.spatialReference)&&e.elevationProvider&&(D(e.elevationProvider,M)??0)>M[2]-1)}async function se(e,t,n){if(R(e,t))return!0;let{elevationProvider:r,spatialReference:i,renderCoordsHelper:o}=e;if(r==null||!o.fromRenderCoords(t,M,i))return!1;let[s,c,l]=M,u=await r.queryElevation(s,c,l,i,`ground`,n)??0;return a(n),u>l-1}async function ce(e,t,n){let r=u();if(t==null)return o(r,e.state.camera.center);if(t instanceof p){let{renderSpatialReference:i,basemapTerrain:o,elevationProvider:s}=e,c=t.spatialReference;if(await _(t,r,i,{signal:n}),a(n),t.z==null&&o!=null&&s!=null){let i=await s.queryElevation(t.x,t.y,t.z??0,c,`ground`,n);a(n),i!=null&&e.renderCoordsHelper.setAltitude(r,i)}return r}return o(r,t)}function le(e,t){let n=u();if(t==null)return o(n,e.state.camera.center);if(t instanceof p){if(!v(t,n,e.renderSpatialReference))return null;let{basemapTerrain:r,elevationProvider:i}=e;if(t.z==null&&r!=null&&i!=null){let r=D(i,t);r!=null&&e.renderCoordsHelper.setAltitude(n,r)}return n}return o(n,t)}function z(e,t,n,r,i,a){return V(e,t,n,r instanceof p?r:null,le(e,r),i,a)}async function B(e,t,n,r,i,o,s){let c=r instanceof p?r:null,l=await ce(e,r,s);return a(s),H(e,t,n,c,l,i,o,s)}function V(e,t,n,r,i,a,o){if(i==null||!r&&(r=new p({spatialReference:N(e)}),!b(i,e.renderSpatialReference,r)))return null;let s=U(e,t,n,i,a,o);if(W(e,n,o)&&R(e,s.eye)){let{tilt:o,mode:s}=G(e,n,i,a);return V(e,t,o,r,i,a,s)}return K(s,i)}async function H(e,t,n,r,i,o,s,c){r||(r=new p({spatialReference:N(e)}),await y(i,e.renderSpatialReference,r,{signal:c})||(r=null)),a(c);let l=U(e,t,n,i,o,s);if(W(e,n,s)&&await se(e,l.eye,c)){a(c);let{tilt:s,mode:l}=G(e,n,i,o);return H(e,t,s,r,i,o,l,c)}return K(l,i)}function U(e,t,n,r,i,a){i=Math.max(i,e.state.constraints.minimumPoiDistance);let o=he(e,t,n,r,i,a),s=O(e).eyeForCenterWithHeadingTilt;return s(r,i,o.heading,o.tilt)}function W(e,t,n){let r=e.map.ground.navigationConstraint;return n===1&&e.state.isGlobal&&t>0&&(r==null||r.type===`stay-above`)}function G(e,t,n,r){let i=X(e,n,r,_e(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function K(e,t){return{...e,center:d(t)}}function q(e,t){let{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&A(i,1)||n.isLocal&&r.equals(i)}function J(e,t){let n,r,i;if(e.state.isGlobal){let e=new p({x:t.xmin,y:t.ymin,spatialReference:t.spatialReference}),a=new p({x:t.xmax,y:t.ymax,spatialReference:t.spatialReference}),o=t.spatialReference.isGeographic?x:S;n=new p({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});let s=f(t.spatialReference),c=E(n,e,a);r=c.lon,i=c.lat,o.diff(e.x,a.x)>o.range/2&&(r+=s.halfCircumference),r=Math.min(r,s.halfCircumference),i=Math.min(i,s.halfCircumference)}else{let a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=h(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;let o=t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0;n=new p({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}let a=t.zmax!=null&&t.zmin!=null?t.zmax-t.zmin:0,o=e.state.camera,s=1/Math.tan(o.fovX/2),c=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2),u=Math.max(.5*r*s,.5*i*c,.5*a*l)/1;return{center:n,distance:u}}async function ue(e,t,n,r,i,o){let s=q(e,t)?t:await m(t,e.spatialReference,{signal:o});a(o);let{center:c,distance:l}=J(e,s),u=await B(e,n,r,c,l,i,o);return a(o),$(e,u,e.camera.fov,o)}function de(e,t,n,r,i,a){let o;try{o=q(e,t)?t:h(t,e.spatialReference)}catch{return null}let{center:s,distance:c}=J(e,o),l=z(e,n,r,s,c,i);return l==null?null:Q(e,l,e.camera.fov,a)}function fe(e,t,n){let r=e.renderSpatialReference,i=new p({spatialReference:N(e)});if(!b(n,r,i))return null;let a=Math.tan(t.fovX/2),o=Math.tan(t.fovY/2),s=c(t.eye,n),l=2*s*a*1,u=2*s*o*1;return O(e).toExtent(e,i,l,u)}function pe(e,t){return O(e).toArea(e,t)}function me(e,t,n){let r=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(n/r)/Math.LN2>8)return!0;let i=t,a=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return s(i,a)/(Math.tan(e.state.camera.fov*.5)*r)>5}function he(e,t,n,r,i,a){let o=0;return a===1&&me(e,r,i)?(t=0,o=ge(e,i,n,r)):o=Z(e,r,i,n),o=e.state.constraints.clampTilt(i,o),n=X(e,r,i,o),{heading:t,tilt:n}}const Y=.7;function ge(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);a.max=Math.min(a.max,Math.PI*.5);let o=a.min*.30000000000000004+a.max*Y;return Math.min(i,o)}function _e(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);return i=Math.min(i,Math.PI*.5),a.min*.30000000000000004+i*Y}function X(e,t,n,r){return O(e).lookAtTiltToEyeTilt(r,t,n)}function Z(e,t,n,r){return O(e).eyeTiltToLookAtTilt(r,t,n)}function Q(t,n,r,i){if(n==null)return null;let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return b(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function $(t,n,r,i){let o=t.renderSpatialReference,s=new p({spatialReference:N(t)});return await y(n.eye,o,s,{signal:i}),a(i),new e({position:s,heading:n.heading,tilt:n.tilt,fov:r})}function ve(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#scaleToZoom()`,`Cannot compute zoom from scale without a tiling scheme`);else return n.levelAtScale(t)}function ye(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#zoomToScale()`,`Cannot compute scale from zoom without a tiling scheme`);else return n.scaleAtLevel(t)}export{P as applyTiltAdjustToScale,L as fromCenterDistanceAsync,oe as fromCenterDistanceSync,ae as fromCenterScale,ue as fromExtentAsync,de as fromExtentSync,B as getObserverForPointAtDistanceAsync,z as getObserverForPointAtDistanceSync,N as getViewSR,ee as headingTiltToDirectionUp,F as removeTiltAdjustFromScale,re as scaleErrorThreshold,ve as scaleToZoom,pe as toArea,fe as toExtent,ie as viewScaleToCameraDistance,ye as zoomToScale};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{asinClamped as e,deg2rad as t,rad2deg as n}from"../../../core/mathUtils.js";import{getReferenceEllipsoid as r}from"../../../geometry/ellipsoidUtils.js";import i from"../../../geometry/Point.js";function a(e,t,n){if(t.longitude==null||t.latitude==null||n.longitude==null||n.latitude==null)throw Error(`Invalid points: no lon/lat`);return o(e,t.longitude,t.latitude,n.longitude,n.latitude)}function o(n,r,i,a,o){let s=t(i),c=t(o),l=t(r),u=t(a),d=s-c,f=l-u,p=Math.sin(d/2),m=Math.sin(f/2),h=2*e(Math.sqrt(p*p+Math.cos(s)*Math.cos(c)*m*m))*n;return Math.round(h*1e4)/1e4}function s(e,t,n){let o=t.spatialReference,s=r(o),c=new i(t.x,e.y,o),l=new i(n.x,e.y,o),u=new i(e.x,t.y,o),d=new i(e.x,n.y,o);return{lon:a(s.radius,c,l),lat:a(s.radius,u,d)}}function c(r,i,a){let o=i/a,s=t(r),c=Math.sin(o/2),l=Math.cos(s),u=2*e(Math.sqrt(c*c/(l*l)));return n(u)}function l(e,t){let n=e/15;return t||(n=Math.round(n)),n}function u(e,t){let n=e?.[0];if(n==null)return null;t||={hours:0,minutes:0,seconds:0},t.hours=l(n,!0);let r=t.hours%1;t.hours-=r,t.minutes=r*60;let i=t.minutes%1;return t.minutes-=i,t.seconds=Math.round(i*60),t}export{o as getGreatCircleDistance,a as getGreatCircleDistanceFromPoints,s as getGreatCircleSpanAt,c as getLonDeltaForDistance,l as longitudeToTimezone,u as positionToTimezoneInfo};
|
|
2
|
+
import{asinClamped as e,deg2rad as t,rad2deg as n}from"../../../core/mathUtils.js";import{getReferenceEllipsoid as r}from"../../../geometry/ellipsoidUtils.js";import i from"../../../geometry/Point.js";function a(e,t,n){if(t.longitude==null||t.latitude==null||n.longitude==null||n.latitude==null)throw Error(`Invalid points: no lon/lat`);return o(e,t.longitude,t.latitude,n.longitude,n.latitude)}function o(n,r,i,a,o){let s=t(i),c=t(o),l=t(r),u=t(a),d=s-c,f=l-u,p=Math.sin(d/2),m=Math.sin(f/2),h=2*e(Math.sqrt(p*p+Math.cos(s)*Math.cos(c)*m*m))*n;return Math.round(h*1e4)/1e4}function s(e,t,n){let o=t.spatialReference,s=r(o),c=new i({x:t.x,y:e.y,spatialReference:o}),l=new i({x:n.x,y:e.y,spatialReference:o}),u=new i({x:e.x,y:t.y,spatialReference:o}),d=new i({x:e.x,y:n.y,spatialReference:o});return{lon:a(s.radius,c,l),lat:a(s.radius,u,d)}}function c(r,i,a){let o=i/a,s=t(r),c=Math.sin(o/2),l=Math.cos(s),u=2*e(Math.sqrt(c*c/(l*l)));return n(u)}function l(e,t){let n=e/15;return t||(n=Math.round(n)),n}function u(e,t){let n=e?.[0];if(n==null)return null;t||={hours:0,minutes:0,seconds:0},t.hours=l(n,!0);let r=t.hours%1;t.hours-=r,t.minutes=r*60;let i=t.minutes%1;return t.minutes-=i,t.seconds=Math.round(i*60),t}export{o as getGreatCircleDistance,a as getGreatCircleDistanceFromPoints,s as getGreatCircleSpanAt,c as getLonDeltaForDistance,l as longitudeToTimezone,u as positionToTimezoneInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{translateAffine as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t,IDENTITY as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as r,dist as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{negate as o,set as s,transformMat4 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as d}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as f}from"../../../../geometry/projection/projectors.js";import{center as p,fromBuffer as m,setEmpty as h,expandWithVec3 as g,create as _}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as v}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as ee}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as y}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as b}from"../../../../geometry/support/Indices.js";import{addOlidAttribute as te}from"../../layers/graphics/olidUtils.js";import{getPlanarDistanceToGroundRatio as ne}from"../planarDistanceToGroundRatio.js";import{Attribute as x}from"../../webgl-engine/lib/Attribute.js";import{BufferGeometry as S}from"../../webgl-engine/lib/BufferGeometry.js";import{Buffers as C}from"../../webgl-engine/lib/Buffers.js";import{Geometry as w}from"../../webgl-engine/lib/Geometry.js";import{createVerticesView as T}from"../../webgl-engine/lib/VerticesView.js";import{isImagePattern as re}from"../../webgl-engine/materials/lineStippleUtils.js";import{isClosed as E,ribbonLineVertexCount as ie,writeRibbonLineTextureBuffer as D,writeRibbonLineVertices as ae}from"../../webgl-engine/materials/internal/ribbonLineBufferUtils.js";import{getLayout as oe,getTextureBufferLayout as O}from"../../webgl-engine/shaders/RibbonLineLayouts.js";function k(e,t,n=null){let r=[],i=t.mapPositions,a=P(t,r),o=a.data,s=a.indices.length,c=b(s);return F(t,r,c),R(t,r,c),I(t,r,c),L(t,r,a.indices,c),z(t,r,a.indices,c),B(t,r),V(t,r,a.indices,c),H(e,t,r,o),n!=null&&te(r,n,c),new w(e,r,i)}function A(t,r,i,a,s=null){let c=r.attributeData,l=T({data:c.position,size:3,stride:3},3),u=E(t.parameters,l.count),d=oe(t.parameters).createBuffer(ie(l.count,u,t.parameters)),f=O(t.parameters).createBuffer(l.count+(u?3:2)),p=f.layout.fields.has(`u0`)?U(t.parameters,r.overlayInfo,c.position):null;return o(Q,i.vec3),e($,s??n,Q),D({...c,position:l,distancesToStart:p,olidColor:a},u,{buffer:f,offset:0},$),ae(l.count,u,t.parameters,{buffer:d,offset:0},0),new S(t,new C(d,f),i,r.mapPositions)}function j(t,r,i,a=null){o(Q,t.localOrigin.vec3),e($,a??n,Q);let s=T({data:r,size:3,stride:3},3);D({position:s,color:i},E(t.material.parameters,s.count),{buffer:t.getMutableBuffers().storage,offset:0},$)}function M(e,t,n=null){let r=Y(X,e,n);return p(r,Z),t.getOrigin(Z)}function N(e,t,n,r=null){let i=Y(X,n,r);return p(i,Z),t.needsOriginUpdate(e,Z,0)}function P(e,t){let{attributeData:{position:n},removeDuplicateStartEnd:r}=e,i=n.length/3,a=i>2&&W(n)&&r,o=i-+!!a,s=Array(2*(o-1)),c=a?n.slice(0,-3):n,l=0;for(let e=0;e<o-1;e++)s[l++]=e,s[l++]=e+1;let u=new x(c,s,3,a);return t.push([`position`,u]),u}function F(e,t,n){if(e.attributeData.colorFeature!=null)return;let r=e.attributeData.color;t.push([`color`,new x(r??u,n,4)])}function I(e,t,n){e.attributeData.normal&&t.push([`normal`,new x(e.attributeData.normal,n,3)])}function L(e,t,n,r){let i=e.attributeData.colorFeature;i!=null&&(typeof i==`number`?t.push([`colorFeatureAttribute`,new x([i],r,1,!0)]):t.push([`colorFeatureAttribute`,new x(i,n,1,!0)]))}function R(e,t,n){e.attributeData.sizeFeature??t.push([`size`,new x([e.attributeData.size??1],n,1,!0)])}function z(e,t,n,r){let i=e.attributeData.sizeFeature;i!=null&&(typeof i==`number`?t.push([`sizeFeatureAttribute`,new x([i],r,1,!0)]):t.push([`sizeFeatureAttribute`,new x(i,n,1,!0)]))}function B(e,t){let{attributeData:{position:n,timeStamps:r}}=e;if(!r)return;let i=n.length/3,a=Array(2*(i-1)),o=0;for(let e=0;e<i-1;e++)a[o++]=e,a[o++]=e+1;t.push([`timeStamps`,new x(r,a,q,!0)])}function V(e,t,n,r){let i=e.attributeData.opacityFeature;i!=null&&(typeof i==`number`?t.push([`opacityFeatureAttribute`,new x([i],r,1,!0)]):t.push([`opacityFeatureAttribute`,new x(i,n,1,!0)]))}function H(e,{overlayInfo:t},n,r){let i=U(e.parameters,t,r);i!=null&&n.push([`distanceToStart`,new x(i,n[0][1].indices,1,!0)])}function U(e,t,n){if(t==null||!G(e)||e.stipplePattern==null)return null;let{renderCoordsHelper:a,spatialReference:o}=t,s=o.isGeographic&&a.viewingMode===1,c=e.worldSized||re(e.stipplePattern);if(!c&&!s)return null;let l=n;if(s){let e=v(n.length),t=d(o);for(let r=0;r<e.length;r+=3)f(n,r,e,r,t);l=e}let u=n.length/3,p=ee(u+1),m=a.viewingMode===1,h=K,g=se,_=0,y=0,b=0;r(h,l[y++],l[y++]),y++,p[0]=0;for(let e=1;e<u+1;++e){e===u&&(y=0);let t=y;r(g,l[y++],l[y++]),y++;let a=(n[b+1]+n[t+1])/2,s=c?ne(o,m,a):1;_+=i(h,g)*s,p[e]=_,[h,g]=[g,h],b=t}return p}function W(e){let t=e.length;return e[0]===e[t-3]&&e[1]===e[t-2]&&e[2]===e[t-1]}function G(e){return`stipplePattern`in e}const K=a(),se=a(),q=4;function ce(e,t,n,r,i,a){if(e==null||e.length===0)return[];let o=[];for(let s=0;s<e.length;s++){let c=e[s];if(c.length<2)continue;let l=c.length,u=v(l*3);for(let e=0;e<l;e++){let t=c[e];u[e*3]=t[0],u[e*3+1]=t[1],u[e*3+2]=t[2]}let d=a?.[s];o.push({attributeData:{position:u,normal:t,colorFeature:n?.[s],opacityFeature:r?.[s],sizeFeature:i?.[s],timeStamps:d==null?void 0:J(d.timeStamps,d.stage)},removeDuplicateStartEnd:!1})}return o}function le(e,t=0,n=.01){let r=y(e.length);r[0]=0;for(let t=1;t<e.length;t++){let n=e[t-1],i=e[t],a=Math.sqrt((i[0]-n[0])**2+(i[1]-n[1])**2+(i[2]-n[2])**2);r[t]=r[t-1]+a}let i=r.map(e=>e*n);if(t!==0&&t<i.length){let e=i[t];for(let t=0;t<i.length;t++)i[t]-=e}return i}function J(e,t){let n=y(e.length*4),r=e[0],i=e[e.length-1];for(let a=0;a<e.length;a++)n[a*4]=e[a],n[a*4+1]=r,n[a*4+2]=i,n[a*4+3]=t+.5;return n}function Y(e,t,n){if(n==null)return m(t,e);h(e);for(let r=0;r<t.length;r+=3)s(Z,t[r],t[r+1],t[r+2]),c(Z,Z,n),g(e,Z);return e}const X=_(),Z=l(),Q=l(),$=t();export{U as computeLineDistances,A as createBufferGeometry,k as createGeometry,le as getLinearTimeStamps,ce as lineStripsToParameters,N as needsBufferGeometryOriginUpdate,q as numTimeStampValuesPerVertex,M as selectLocalOrigin,J as timeStampsToAttribute,j as updateBufferGeometry};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newFloatArray as t}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as n}from"../../../../geometry/support/HalfFloatArray.js";import{zValueInAbsoluteHeightMode as r}from"../../../../support/elevationInfoUtils.js";import{convertVisualVariables as i,ConvertOptions as a}from"../../layers/support/FastSymbolUpdates.js";import{
|
|
2
|
+
import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newFloatArray as t}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as n}from"../../../../geometry/support/HalfFloatArray.js";import{zValueInAbsoluteHeightMode as r}from"../../../../support/elevationInfoUtils.js";import{convertVisualVariables as i,ConvertOptions as a}from"../../layers/support/FastSymbolUpdates.js";import{lineStripsToParameters as o,selectLocalOrigin as s,createBufferGeometry as c}from"../engineContent/line.js";import{valuesPerFlowVertex as l}from"./loadUtils.js";import{drapedZ as u}from"../../terrain/DrapedZ.js";function d(e,r,{vertices:i,stage:a,hasMagnitude:d},f,m,h){let{spatialReference:g}=r.extent,_=[],v=l(d),y=r.flowExtentInfo.modelSize[0],b=0;for(let t=0;t<i.length;t+=v){if(h&&t>0){let e=i[t]-i[t-v];e>y/2?b-=y:-e>y/2&&(b+=y)}let[n,a]=r.modelToMapSpace(i[t]+b,i[t+1],!1),o=h?[n,a,u]:p(n,a,g,e,f);_.push(o)}let x=Math.floor(i.length/v),S=n(x);for(let e=0;e<x;e++)S[e]=i[e*v+2];let{hasVVColor:C,hasVVOpacity:w,hasVVSize:T}=m.parameters,E=C||w||T,D,O,k;if(d&&E){let e=t(x);for(let t=0;t<x;t++)e[t]=i[t*v+3];C&&(D=[e]),w&&(O=[e]),T&&(k=[e])}let A=o([_],void 0,D,O,k,[{timeStamps:S,stage:a}]),j=h?e.overlayManager.renderer.localOriginFactory:e.stage.localOriginFactory,M=s(A[0].attributeData.position,j);return c(m,A[0],M)}function f(e,t,n){if(e==null)return{};let r=null;if(e.visualVariables){let t=[],n=e.visualVariables,o=new a({supports:{size:!0,color:!0,rotation:!1,opacity:!0}});r=i(n,o,t)}let o=r?.color?[1,1,1,1]:e.color.toUnitRGBA();return o[3]*=t,{color:o,width:e.trailWidth,cap:0,animationSpeed:e.flowSpeed,trailLength:e.trailLength,animation:3,emissiveStrength:n,vvColor:r?.color,vvOpacity:r?.opacity,vvSize:r?.size}}function p(t,n,i,a,o){let{absoluteZ:s}=r(t,n,0,i,a,o),c=e(t,n,s);return a.renderCoordsHelper.toRenderCoords(c,i,c),c}export{d as createStreamlineGeometry,f as materialParametersFromRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../Graphic.js";import has from"../../../core/has.js";import{isIterable as t}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as n,isScreenPolygon as r,isScreenRect as i,createScreenPointArray as a,createScreenPoint as o}from"../../../core/screenUtils.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{Sphere as d}from"../../../geometry/support/sphere.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as p}from"../../../layers/support/layerUtils.js";import{debugFlags as m}from"./debugFlags.js";import{getElevationAtPoint as h}from"./ElevationProvider.js";import{getGraphicHitDedupeKey as g,resolveOrderedIntersectionHits as _}from"./intersectionHitUtils.js";import{Intersector as v}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResultRay as y}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as b,toOwner as x}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as S}from"../webgl-engine/lib/verticalOffsetUtils.js";async function C(e,t,n,o){let s=n?F(e,n):o;if(r(t))return w(e,t,s,n?.excludeLabels);if(i(t))return w(e,D(t),s,n?.excludeLabels);let c=t,l=a(c.x,c.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;let u=new v(e.state.viewingMode);u.options.selectionMode=!0,u.options.store=2,u.options.excludeLabels=n?.excludeLabels??!1,e.sceneIntersectionHelper.intersectIntersectorScreen(l,u,s);let d=await Array.fromAsync(k(e,u.results.all,s.graphics,{getDistance:e=>e.distanceInRenderSpace,getMapPoint:t=>A(e,t),stopAtSupportSurface:!0})),f=u.results.ground,h=x(f,e),g=h!=null&&`type`in h&&p(h)&&(!has(`enable-feature:im-as-ground`)||h.isUsedAsGroundLayer)?h:null,_={screenPoint:c,results:d,ground:{mapPoint:A(e,f),distance:y(f)?f.distanceInRenderSpace:0,layer:g}};return m.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(_.intersector=u),_}async function w(e,t,r,i){r.enableDraped=!0;let a=new v(e.state.viewingMode);a.options.selectionMode=!0,a.options.store=2,a.options.excludeLabels=i??!1,await e.sceneIntersectionHelper.intersectIntersectorScreenPolygon(t.map(e=>n(e)),a,r);let o=[];await e.sceneIntersectionHelper.screenPolygonIntersectionTask.scheduleGenerator(async function*(t){for await(let n of k(e,T(e,a.polygonResults.all),r.graphics,{getDistance:e=>e.distance,getMapPoint:()=>null}))o.push(n),t.madeProgress()&&(t=yield)});let s={screenPoint:null,results:o,ground:{mapPoint:null,distance:0,layer:null}};return m.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(s.intersector=a),s}function*T(e,t){let n=E(e);if(n==null)yield*t;else for(let e of t)e.distance!=null&&e.distance<=n&&(yield e)}function E(e){let t=e.basemapTerrain,n=e.state.camera;return e.state.viewingMode!==1||!n.aboveGround||!t?.opaque?null:(W.radius=t.getLowerBoundRadius(),W.distanceToSilhouette(n.eye)*G)}function D(e){return[o(e.x,e.y),o(e.x+e.width,e.y),o(e.x+e.width,e.y+e.height),o(e.x,e.y+e.height)]}function O(e,t,r,i){let a=r?F(e,r):i,o=!!(a.graphics?.include||a.graphics?.exclude),s=!!(a.mediaElements?.include||a.mediaElements?.exclude),c=n(t);a.enableDraped=a.include&&!a.include.has(S)||a.exclude?.has(S);let l=e.sceneIntersectionHelper,u=new v(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||s?2:0,u.options.excludeLabels=r?.excludeLabels??!1,l.intersectIntersectorScreen(c,u,a),o||s){for(let t of u.results.all){let n=b(t,e);if(n==null||o&&(n.type!==`graphic`||M(a.graphics,n.graphic))||s&&(n.type!==`media`||N(a.mediaElements,n.element)))return A(e,t)}return null}return A(e,u.results.min)}async function*k(e,t,n,r){let i=_(e,r.stopAtSupportSurface?(function*(){for(let n of t){yield n;let t=x(n,e);if(t!=null&&(t===e.map.ground||`type`in t&&p(t)&&(!has(`enable-feature:im-as-ground`)||t.isUsedAsGroundLayer)))break}})():t,{getDedupeKey:e=>e.type===`graphic`?j(e.graphic):null,filterHit:e=>e.type!==`graphic`||M(n,e.graphic)});for await(let{input:e,hit:t}of i){let n=r.getMapPoint(e),i=r.getDistance(e);if(t.type===`media`){let e=n?t.element.toSource(n):null;yield{...t,mapPoint:n,distance:i,sourcePoint:e}}else yield{...t,mapPoint:n,distance:i}}}function A(e,t,n){return t.getIntersectionPoint(U)?(n=P(e,U,n),t.intersector===7&&e.basemapTerrain&&(n.z=h(e.basemapTerrain,n)??0),n):null}function j(e){let t=e.getObjectId()??e.attributes?.[f];return e.origin&&t!=null?`o-${e.origin.id}-${t}`:`u-${g(e)}`}function M(e,t){return N(e,j(t))}function N(e,t){return e==null||(e.include==null||e.include.has(t))&&(e.exclude==null||!e.exclude.has(t))}function P(e,t,n){let r=e.spatialReference||l.WGS84;return u(t,e.renderSpatialReference,U,r)?t=U:(r=l.WGS84,u(t,e.renderSpatialReference,U,r)&&(t=U)),n?(n.x=t[0],n.y=t[1],n.z=t[2],n.spatialReference=r):n=new c(t,r),n}function F(e,t){let n=I(e,t.include,0),r=I(e,t.exclude,1);return{include:n.layerViewUids,exclude:r.layerViewUids,graphics:{include:n.graphicUids,exclude:r.graphicUids},mediaElements:{include:n.mediaElements,exclude:r.mediaElements}}}function I(n,r,i,a=new L){if(!r)return a;if(r instanceof e)V(a,j(r)),i===0&&(n.graphicsView!=null&&r.layer===n?z(a,n.graphicsView.uid):r.layer&&R(a,n,r.layer.uid));else if(`layer`in r&&`element`in r)H(a,r.element),i===0&&R(a,n,r.layer.uid);else if(!t(r))`layer`in r&&B(a,n,r),`uid`in r&&R(a,n,r.uid);else for(let e of r)if(e===n.graphics&&n.graphicsView!=null)z(a,n.graphicsView.uid);else if(e===n.map.ground){z(a,S);for(let e of n.map.ground.allIntegratedMeshGround)R(a,n,e.uid)}else I(n,e,i,a);return a}class L{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function R(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n);r&&z(e,r.uid)}function z(e,t){e.layerViewUids??=new Map,e.layerViewUids.set(t,!0)}function B(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n.layer.uid);if(!r)return;e.layerViewUids??=new Map;let i=e.layerViewUids.get(r.uid);i!==!0&&(i?i.add(n.id):e.layerViewUids.set(r.uid,new Set([n.id])))}function V(e,t){e.graphicUids??=new Set,e.graphicUids.add(t)}function H(e,t){e.mediaElements??=new Set,e.mediaElements.add(t)}const U=s(),W=new d,G=1.2;export{P as computeMapPointFromVec3d,F as externalToInternalIntersectOptions,C as hitTest,A as intersectResultToMapPoint,M as testGraphicUidFilter,O as toMap};
|
|
2
|
+
import e from"../../../Graphic.js";import has from"../../../core/has.js";import{isIterable as t}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as n,isScreenPolygon as r,isScreenRect as i,createScreenPointArray as a,createScreenPoint as o}from"../../../core/screenUtils.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{Sphere as d}from"../../../geometry/support/sphere.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as p}from"../../../layers/support/layerUtils.js";import{debugFlags as m}from"./debugFlags.js";import{getElevationAtPoint as h}from"./ElevationProvider.js";import{getGraphicHitDedupeKey as g,resolveOrderedIntersectionHits as _}from"./intersectionHitUtils.js";import{Intersector as v}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResultRay as y}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as b,toOwner as x}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as S}from"../webgl-engine/lib/verticalOffsetUtils.js";async function C(e,t,n,o){let s=n?F(e,n):o;if(r(t))return w(e,t,s,n?.excludeLabels);if(i(t))return w(e,D(t),s,n?.excludeLabels);let c=t,l=a(c.x,c.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;let u=new v(e.state.viewingMode);u.options.selectionMode=!0,u.options.store=2,u.options.excludeLabels=n?.excludeLabels??!1,e.sceneIntersectionHelper.intersectIntersectorScreen(l,u,s);let d=await Array.fromAsync(k(e,u.results.all,s.graphics,{getDistance:e=>e.distanceInRenderSpace,getMapPoint:t=>A(e,t),stopAtSupportSurface:!0})),f=u.results.ground,h=x(f,e),g=h!=null&&`type`in h&&p(h)&&(!has(`enable-feature:im-as-ground`)||h.isUsedAsGroundLayer)?h:null,_={screenPoint:c,results:d,ground:{mapPoint:A(e,f),distance:y(f)?f.distanceInRenderSpace:0,layer:g}};return m.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(_.intersector=u),_}async function w(e,t,r,i){r.enableDraped=!0;let a=new v(e.state.viewingMode);a.options.selectionMode=!0,a.options.store=2,a.options.excludeLabels=i??!1,await e.sceneIntersectionHelper.intersectIntersectorScreenPolygon(t.map(e=>n(e)),a,r);let o=[];await e.sceneIntersectionHelper.screenPolygonIntersectionTask.scheduleGenerator(async function*(t){for await(let n of k(e,T(e,a.polygonResults.all),r.graphics,{getDistance:e=>e.distance,getMapPoint:()=>null}))o.push(n),t.madeProgress()&&(t=yield)});let s={screenPoint:null,results:o,ground:{mapPoint:null,distance:0,layer:null}};return m.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(s.intersector=a),s}function*T(e,t){let n=E(e);if(n==null)yield*t;else for(let e of t)e.distance!=null&&e.distance<=n&&(yield e)}function E(e){let t=e.basemapTerrain,n=e.state.camera;return e.state.viewingMode!==1||!n.aboveGround||!t?.opaque?null:(W.radius=t.getLowerBoundRadius(),W.distanceToSilhouette(n.eye)*G)}function D(e){return[o(e.x,e.y),o(e.x+e.width,e.y),o(e.x+e.width,e.y+e.height),o(e.x,e.y+e.height)]}function O(e,t,r,i){let a=r?F(e,r):i,o=!!(a.graphics?.include||a.graphics?.exclude),s=!!(a.mediaElements?.include||a.mediaElements?.exclude),c=n(t);a.enableDraped=a.include&&!a.include.has(S)||a.exclude?.has(S);let l=e.sceneIntersectionHelper,u=new v(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||s?2:0,u.options.excludeLabels=r?.excludeLabels??!1,l.intersectIntersectorScreen(c,u,a),o||s){for(let t of u.results.all){let n=b(t,e);if(n==null||o&&(n.type!==`graphic`||M(a.graphics,n.graphic))||s&&(n.type!==`media`||N(a.mediaElements,n.element)))return A(e,t)}return null}return A(e,u.results.min)}async function*k(e,t,n,r){let i=_(e,r.stopAtSupportSurface?(function*(){for(let n of t){yield n;let t=x(n,e);if(t!=null&&(t===e.map.ground||`type`in t&&p(t)&&(!has(`enable-feature:im-as-ground`)||t.isUsedAsGroundLayer)))break}})():t,{getDedupeKey:e=>e.type===`graphic`?j(e.graphic):null,filterHit:e=>e.type!==`graphic`||M(n,e.graphic)});for await(let{input:e,hit:t}of i){let n=r.getMapPoint(e),i=r.getDistance(e);if(t.type===`media`){let e=n?t.element.toSource(n):null;yield{...t,mapPoint:n,distance:i,sourcePoint:e}}else yield{...t,mapPoint:n,distance:i}}}function A(e,t,n){return t.getIntersectionPoint(U)?(n=P(e,U,n),t.intersector===7&&e.basemapTerrain&&(n.z=h(e.basemapTerrain,n)??0),n):null}function j(e){let t=e.getObjectId()??e.attributes?.[f];return e.origin&&t!=null?`o-${e.origin.id}-${t}`:`u-${g(e)}`}function M(e,t){return N(e,j(t))}function N(e,t){return e==null||(e.include==null||e.include.has(t))&&(e.exclude==null||!e.exclude.has(t))}function P(e,t,n){let r=e.spatialReference||l.WGS84;return u(t,e.renderSpatialReference,U,r)?t=U:(r=l.WGS84,u(t,e.renderSpatialReference,U,r)&&(t=U)),n?(n.x=t[0],n.y=t[1],n.z=t[2],n.spatialReference=r):n=new c({x:t[0],y:t[1],z:t[2],m:t[3],spatialReference:r}),n}function F(e,t){let n=I(e,t.include,0),r=I(e,t.exclude,1);return{include:n.layerViewUids,exclude:r.layerViewUids,graphics:{include:n.graphicUids,exclude:r.graphicUids},mediaElements:{include:n.mediaElements,exclude:r.mediaElements}}}function I(n,r,i,a=new L){if(!r)return a;if(r instanceof e)V(a,j(r)),i===0&&(n.graphicsView!=null&&r.layer===n?z(a,n.graphicsView.uid):r.layer&&R(a,n,r.layer.uid));else if(`layer`in r&&`element`in r)H(a,r.element),i===0&&R(a,n,r.layer.uid);else if(!t(r))`layer`in r&&B(a,n,r),`uid`in r&&R(a,n,r.uid);else for(let e of r)if(e===n.graphics&&n.graphicsView!=null)z(a,n.graphicsView.uid);else if(e===n.map.ground){z(a,S);for(let e of n.map.ground.allIntegratedMeshGround)R(a,n,e.uid)}else I(n,e,i,a);return a}class L{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function R(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n);r&&z(e,r.uid)}function z(e,t){e.layerViewUids??=new Map,e.layerViewUids.set(t,!0)}function B(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n.layer.uid);if(!r)return;e.layerViewUids??=new Map;let i=e.layerViewUids.get(r.uid);i!==!0&&(i?i.add(n.id):e.layerViewUids.set(r.uid,new Set([n.id])))}function V(e,t){e.graphicUids??=new Set,e.graphicUids.add(t)}function H(e,t){e.mediaElements??=new Set,e.mediaElements.add(t)}const U=s(),W=new d,G=1.2;export{P as computeMapPointFromVec3d,F as externalToInternalIntersectOptions,C as hitTest,A as intersectResultToMapPoint,M as testGraphicUidFilter,O as toMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{destroyMaybe as e}from"../../../core/maybe.js";class t{constructor(e){this._getFadeDuration=e,this._fadeStart=0,this._delayedTime=0}clear(){this._current=e(this._current),this._next=e(this._next),this._waiting=e(this._waiting),this._delayed=e(this._delayed)}get current(){if(this._current==null)return null;if(!this._isFadingEnabled){let e=null;this._delayed?(e=this._delayed,this._delayed=null):this._waiting?(e=this._waiting,this._waiting=null):this._next&&=(e=this._next,null),e&&(this.clear(),this._current=e)}let n=t.test.fadeMoment;if(this._delayed&&(n||=performance.now(),n>=this._delayedTime&&(this._push(this._delayed,0),this._delayed=null)),this._next){n||=performance.now();let t=this._fadeDuration,r=this._current!=null&&this._next.texture===this._current.texture,i=this._next.update!==0,a=n-this._fadeStart>=t;(r||i||a)&&(e(this._current),this._current=this._next,this._next=this._waiting,this._waiting=null,this._fadeStart=this._alignFadeStart(n))}return this._current}get next(){return this._next}get fadeFactor(){if(this._next==null)return 1;let e=t.test.fadeMoment||performance.now(),n=Math.max(0,e-this._fadeStart),r=this._fadeDuration;return n>r?0:1-n/r}get isFading(){return this._next!=null||this._delayed!=null}push(t,n=0){this._delayed=e(this._delayed),this._push(t,n)}_push(n,r){if(this._isFadingEnabled||this.clear(),this._current==null){this._current=n;return}let i=this._waiting??this._next??this._current;if(n?.equals(i)){n.destroy();return}let a=t.test.fadeMoment||performance.now();r===0?this._next==null?(this._next=n,this._fadeStart=this._alignFadeStart(a)):n!=null&&(e(this._waiting),this._waiting=n):(this._delayed=n,this._delayedTime=a+r)}get _fadeDuration(){let e=this._getFadeDuration();return this._waiting?e*.5:e}_alignFadeStart(e){let t=this._getFadeDuration();return e+t-e%t}get _isFadingEnabled(){return this._getFadeDuration()>0}static{this.test={fadeMoment:0}}}export{t as TextureFader};
|
|
2
|
+
import{destroyMaybe as e}from"../../../core/maybe.js";class t{constructor(e){this._getFadeDuration=e,this._fadeStart=0,this._delayedTime=0}clear(){this._current=e(this._current),this._next=e(this._next),this._waiting=e(this._waiting),this._delayed=e(this._delayed)}get current(){if(this._current==null)return null;if(!this.isFading)return this._current;if(!this._isFadingEnabled){let e=null;this._delayed?(e=this._delayed,this._delayed=null):this._waiting?(e=this._waiting,this._waiting=null):this._next&&=(e=this._next,null),e&&(this.clear(),this._current=e)}let n=t.test.fadeMoment;if(this._delayed&&(n||=performance.now(),n>=this._delayedTime&&(this._push(this._delayed,0),this._delayed=null)),this._next){n||=performance.now();let t=this._fadeDuration,r=this._current!=null&&this._next.texture===this._current.texture,i=this._next.update!==0,a=n-this._fadeStart>=t;(r||i||a)&&(e(this._current),this._current=this._next,this._next=this._waiting,this._waiting=null,this._fadeStart=this._alignFadeStart(n))}return this._current}get next(){return this._next}get fadeFactor(){if(this._next==null)return 1;let e=t.test.fadeMoment||performance.now(),n=Math.max(0,e-this._fadeStart),r=this._fadeDuration;return n>r?0:1-n/r}get isFading(){return this._next!=null||this._delayed!=null}push(t,n=0){this._delayed=e(this._delayed),this._push(t,n)}_push(n,r){if(this._isFadingEnabled||this.clear(),this._current==null){this._current=n;return}let i=this._waiting??this._next??this._current;if(n?.equals(i)){n.destroy();return}let a=t.test.fadeMoment||performance.now();r===0?this._next==null?(this._next=n,this._fadeStart=this._alignFadeStart(a)):n!=null&&(e(this._waiting),this._waiting=n):(this._delayed=n,this._delayedTime=a+r)}get _fadeDuration(){let e=this._getFadeDuration();return this._waiting?e*.5:e}_alignFadeStart(e){let t=this._getFadeDuration();return e+t-e%t}get _isFadingEnabled(){return this._getFadeDuration()>0}static{this.test={fadeMoment:0}}}export{t as TextureFader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{removeUnordered as n}from"../../../core/arrayUtils.js";import{toConst as r}from"../../../core/compilerUtils.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{isPromiseLike as a}from"../../../core/promiseUtils.js";import{signal as o}from"../../../core/signal.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{isIntersectionHandler as l}from"../state/helpers/SceneIntersectionHelper.js";import{debugFlags as u}from"../support/debugFlags.js";import{TextureCollection as d}from"../support/TextureCollection.js";import{ChangeSet as f}from"./lib/ChangeSet.js";import{Model as p}from"./parts/Model.js";import{RenderView as m}from"./parts/RenderView.js";import{TaskPriority as h,noBudget as g}from"../../support/Scheduler.js";import{Yield as _}from"../../support/Yield.js";let v=class extends t{constructor(e){super(e),this._model=new p,this._canCompact=o(!1),this._layers=[],this._asyncChangeSet=new f,this._syncChangeSet=new f,this._layerSyncSet=new Set,this._textures=new d(this,e.view.resourceController.scheduler),this._frameTask=e.view.resourceController.scheduler.registerTask(h.STAGE,this),this.addHandles(this._frameTask)}initialize(){
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{removeUnordered as n}from"../../../core/arrayUtils.js";import{toConst as r}from"../../../core/compilerUtils.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{isPromiseLike as a}from"../../../core/promiseUtils.js";import{signal as o}from"../../../core/signal.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{isIntersectionHandler as l}from"../state/helpers/SceneIntersectionHelper.js";import{debugFlags as u}from"../support/debugFlags.js";import{TextureCollection as d}from"../support/TextureCollection.js";import{ChangeSet as f}from"./lib/ChangeSet.js";import{Model as p}from"./parts/Model.js";import{RenderView as m}from"./parts/RenderView.js";import{TaskPriority as h,noBudget as g}from"../../support/Scheduler.js";import{Yield as _}from"../../support/Yield.js";let v=class extends t{constructor(e){super(e),this._model=new p,this._canCompact=o(!1),this._layers=[],this._asyncChangeSet=new f,this._syncChangeSet=new f,this._layerSyncSet=new Set,this._textures=new d(this,e.view.resourceController.scheduler),this._frameTask=e.view.resourceController.scheduler.registerTask(h.STAGE,this),this.addHandles(this._frameTask)}initialize(){this._renderView=new m({view:this.view},this)}destroy(){this.removeAllHandles(),this._textures.destroy(),this._set(`textures`,null),this._renderView=i(this._renderView),this._set(`renderView`,null),this._layers.length=0,this._model=null,this._set(`renderer`,null),this.options.context=null,this._set(`options`,null)}get viewingMode(){return this.view.state.viewingMode}get updating(){if(this.destroyed||this.destroying)return!1;let e=this.readyToRun||this.renderView.updating||this._frameTask.updating||this.textures.updating;return e&&u.UPDATING&&console.log(` Stage:`,this.readyToRun,this.renderView.updating,this._frameTask.updating,this.textures.updating),e}get localOriginFactory(){return this._model.localOriginFactory}get renderView(){return this._renderView}get renderer(){return this.renderView?.renderer}get textures(){return this._textures}addTexture(e){this._model.addTexture(e),this.renderView.requestRender()}removeTexture(e){e!=null&&!this.destroyed&&this._model.hasTexture(e)&&(this._model.removeTexture(e),this.renderView.requestRender())}addTextures(e){e!=null&&(this._model.addTextures(e),this.renderView.requestRender())}removeTextures(e){e!=null&&(this._model?.removeTextures(e),this.renderView.requestRender())}forEachTexture(e){this._model.forEachTexture(e)}getTexture(e){return this._model.getTexture(e)}addLayer(e){this._layers.includes(e)||(this._model.addLayer(e),this._layers.push(e),this._model.dirtySet.layerAdded(e),this.renderView.requestRender())}removeLayer(e){e!=null&&!this.destroyed&&this._model.hasLayer(r(e))&&(this._model.dirtySet.layerRemoved(e),this.commitLayer(e),n(this._layers,e),this._model.dirtySet.assertLayerClean(e.id),this._model.removeLayer(e),this.renderView.requestRender())}getLayer(e){return this._model.getLayer(e)}handleEvent(e,t){this.destroyed||(this._model.dirtySet[e](t),this.renderView.requestRender())}get readyToRun(){return this._model.dirtySet.dirty||!this._asyncChangeSet.empty||this._canCompact.value}runTask(e){if(this._frameTask.processQueue(e),this._commit(e),this.renderer.compact(e),this._canCompact.value=this.renderer.canCompact,!e.hasProgressed)return _}compact(e){return this._canCompact.value=!1,this.renderer.compact(e)}_commit(e){let t=this._model.dirtySet;!this._asyncChangeSet.empty&&!e.done&&(this.renderer.commit(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()),this._layers.forEach(n=>{if(e.done)return;let r=this._layerSyncSet.has(n.id)||n.updatePolicy===1,i=r?this._syncChangeSet:this._asyncChangeSet;t.commitLayer(n.id,i),this._layerSyncSet.delete(n.id),i.empty||(this.renderer.commit(i,r?g:e),this.renderView.requestRender(),e.madeProgress())}),this._syncChangeSet.empty||(this.renderer.commit(this._syncChangeSet,g),this.renderView.requestRender(),e.madeProgress()),this._layers.forEach(n=>{e.done||!this._layerSyncSet.has(n.id)&&n.updatePolicy===0&&(t.commitLayer(n.id,this._asyncChangeSet),this._asyncChangeSet.empty||(this.renderer.commit(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()))}),this._layerSyncSet.clear(),this.notifyChange(`readyToRun`)}commitSyncLayers(){let e=this._model.dirtySet;this._layers.forEach(t=>{this._layerSyncSet.has(t.id)||t.updatePolicy===1?(e.commitLayer(t.id,this._syncChangeSet),this._layerSyncSet.delete(t.id)):e.commitSyncUpdates(t.id,this._syncChangeSet)});for(let t of this._layerSyncSet)e.commitLayer(t,this._syncChangeSet);this._layerSyncSet.clear(),this._syncChangeSet.empty||(this.renderer.commit(this._syncChangeSet,g),this.renderView.requestRender())}commitLayer(e){this._model.dirtySet.commitLayer(e.id,this._syncChangeSet),this._layerSyncSet.delete(e.id),this._syncChangeSet.empty||(this.renderer.commit(this._syncChangeSet,g),this.renderView.requestRender())}schedule(e,t){return this._frameTask.schedule(e,t)}reschedule(e,t){return this._frameTask.reschedule(e,t)}scheduleGenerator(e,t){return this._frameTask.scheduleGenerator(e,t)}syncLayer(e){this._layerSyncSet.add(e),this.renderView.requestRender()}get layers(){return this._layers}addRenderPlugin(e,t){let n=this.renderer.plugins.add(e,t),r=()=>{l(e)&&this.view.sceneIntersectionHelper.addIntersectionHandler(e)};if(a(n))return n.then(r);r()}removeRenderPlugin(e){this.destroyed||(l(e)&&this.view.sceneIntersectionHelper.removeIntersectionHandler(e),this.renderer.plugins.remove(e))}get test(){}};e([s({constructOnly:!0})],v.prototype,`view`,void 0),e([s({constructOnly:!0})],v.prototype,`options`,void 0),e([s({constructOnly:!0})],v.prototype,`container`,void 0),e([s()],v.prototype,`viewingMode`,null),e([s()],v.prototype,`updating`,null),e([s()],v.prototype,`renderView`,null),e([s()],v.prototype,`renderer`,null),e([s()],v.prototype,`textures`,null),e([s()],v.prototype,`readyToRun`,null),v=e([c(`esri.views.3d.webgl-engine.Stage`)],v);export{v as Stage};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import e from"../../../core/Error.js";function t(t,n){t??=document.createElement(`canvas`);let r=t.getContext(`webgl2`,{alpha:n.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:n.stencil??!0,powerPreference:`high-performance`,preserveDrawingBuffer:n.preserveDrawingBuffer??!1});if(r==null)throw new e(`webgl:context-creation-failed`,`A WebGL2 context could not be created.`);if(r.isContextLost())throw new e(`webgl-context-lost`,`WebGL context lost during context creation`);return{canvas:t,gl:r}}export{t as createWebGLContext};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{integerArrayElementBytes as e}from"../../../../core/memoryEstimations.js";import{add as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{getContinuousIndexArray as n}from"../../../../geometry/support/Indices.js";import{NullSphere as r,Sphere as i}from"../../../../geometry/support/sphere.js";import{affectsGeometry as a}from"./affectsGeometry.js";import{BoundingInfo as o}from"./BoundingInfo.js";import{BufferGeometryBaseInstance as s}from"./BufferGeometryBaseInstance.js";import{Object3DHighlightStateID as c}from"./Object3DStateID.js";import{assert as l}from"./Util.js";class u extends s{constructor(e,t,n,r=null,i=null){super(t),this.material=e,this.localOrigin=n,this.mapPositions=r,this.baseGeometry=i,this.layerViewUid=null,this.graphicUid=null,this.castShadow=!1,this._readPrimitivePosition=null,this._boundingInfo=null,this._boundingSphere=null,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0;let a=e?.useIndexing??!1,o=t.index!=null,s=i!=null;l(!s||!a&&i.buffers.index==null&&!o,`Instancing for index materials is not supported`),l(!s||t.vertex.count===1,`Instanced BufferGeometry requires exactly one instance`),l(a===o,`Material index requirement and BufferGeometry.buffers.index must match`)}instantiate(e){return new u(e,this._buffers,this.localOrigin,this.mapPositions,this.baseGeometry)}get usedMemoryExcludingBuffers(){return this._boundingInfo?.usedMemory??0}computeBufferMemory(t){return t.arrayMemory(this._buffers.index,e,!0)+t.arrayMemory(this._buffers.storage?.texelElementBuffer)+t.arrayMemory(this.mapPositions)+t.bufferMemory(this._buffers.vertex.buffer)}get indexCount(){return this.baseGeometry?.buffers.indexCount??this._buffers.indexCount??0}get faceCount(){return this.indexCount/3}get readPrimitivePosition(){return this._readPrimitivePosition??=this.material.createPrimitivePositionReader(this.buffers,this.baseGeometry?.buffers),this._readPrimitivePosition}get boundingInfo(){return this._boundingInfo||(this._boundingInfo=this._calculateBoundingInfo(),this._boundingInfo&&this.notifyMemoryChange?.(this._boundingInfo.usedMemory)),this._boundingInfo}get boundingSphere(){let e=this.boundingInfo?.sphere;if(e==null)return r;if(this._boundingSphere==null){let n=new i;n.copyFrom(e),t(n.center,n.center,this.localOrigin.vec3),this._boundingSphere=n}return this._boundingSphere}_calculateBoundingInfo(){let e=this.indexCount;if(e===0)return null;let t=this.material.primitiveVertexCount;l(e%t===0,`Indexing error: `+e+` not divisible by `+t);let r=n(e/t);return new o(r,t,this.readPrimitivePosition,e=>this.notifyMemoryChange?.(e))}invalidateBoundingInfo(){let e=this._boundingInfo?.usedMemory??0;this._boundingInfo=null,this._boundingSphere=null,e&&this.notifyMemoryChange?.(-e)}getMutableVertexField(e,t){let n=this._buffers.vertex.getField(e,t);return n!=null&&a(e)&&this._invalidatePositionCaches(),n}getMutableStorageField(e,t){let n=this._buffers.storage?.getField(e,t);return n!=null&&a(e)&&this._invalidatePositionCaches(),n}_invalidatePositionCaches(){this._readPrimitivePosition=null,this.invalidateBoundingInfo()}computeAttachmentOrigin(e){return this.material.computeAttachmentOrigin(e,this.readPrimitivePosition,this.indexCount)?(t(e,e,this.localOrigin.vec3),!0):!1}get highlights(){return this._highlights||d}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(e){this._highlightOptionsCounts?.forEach((t,n)=>e(n))}allocateIdAndHighlight(e){let t=new c(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);let{highlightName:t}=e,n=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,n),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){let{highlightName:t}=e,n=this._highlightOptionsCounts?.get(t)??0;n<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,n-1)}}}const d=new Set;export{u as BufferGeometry};
|
|
2
|
+
import{integerArrayElementBytes as e}from"../../../../core/memoryEstimations.js";import{add as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{getContinuousIndexArray as n}from"../../../../geometry/support/Indices.js";import{NullSphere as r,Sphere as i}from"../../../../geometry/support/sphere.js";import{affectsGeometry as a}from"./affectsGeometry.js";import{BoundingInfo as o}from"./BoundingInfo.js";import{BufferGeometryBaseInstance as s}from"./BufferGeometryBaseInstance.js";import{Object3DHighlightStateID as c}from"./Object3DStateID.js";import{assert as l}from"./Util.js";class u extends s{constructor(e,t,n,r=null,i=null){super(t),this.material=e,this.localOrigin=n,this.mapPositions=r,this.baseGeometry=i,this.layerViewUid=null,this.graphicUid=null,this.castShadow=!1,this._readPrimitivePosition=null,this._boundingInfo=null,this._boundingSphere=null,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0;let a=e?.useIndexing??!1,o=t.index!=null,s=i!=null;l(!s||!a&&i.buffers.index==null&&!o,`Instancing for index materials is not supported`),l(!s||t.vertex.count===1,`Instanced BufferGeometry requires exactly one instance`),l(a===o,`Material index requirement and BufferGeometry.buffers.index must match`)}instantiate(e){return new u(e,this._buffers,this.localOrigin,this.mapPositions,this.baseGeometry)}get usedMemoryExcludingBuffers(){return this._boundingInfo?.usedMemory??0}computeBufferMemory(t){return t.arrayMemory(this._buffers.index,e,!0)+t.arrayMemory(this._buffers.storage?.texelElementBuffer)+t.arrayMemory(this.mapPositions)+t.bufferMemory(this._buffers.vertex.buffer)}get indexCount(){return this.baseGeometry?.buffers.indexCount??this._buffers.indexCount??0}get faceCount(){return this.indexCount/3}get readPrimitivePosition(){return this._readPrimitivePosition??=this.material.createPrimitivePositionReader(this.buffers,this.baseGeometry?.buffers),this._readPrimitivePosition}get boundingInfo(){return this._boundingInfo||(this._boundingInfo=this._calculateBoundingInfo(),this._boundingInfo&&this.notifyMemoryChange?.(this._boundingInfo.usedMemory)),this._boundingInfo}get boundingSphere(){let e=this.boundingInfo?.sphere;if(e==null)return r;if(this._boundingSphere==null){let n=new i;n.copyFrom(e),t(n.center,n.center,this.localOrigin.vec3),this._boundingSphere=n}return this._boundingSphere}_calculateBoundingInfo(){let e=this.indexCount;if(e===0)return null;let t=this.material.primitiveVertexCount;l(e%t===0,`Indexing error: `+e+` not divisible by `+t);let r=n(e/t);return new o(r,t,this.readPrimitivePosition,e=>this.notifyMemoryChange?.(e))}invalidateBoundingInfo(){let e=this._boundingInfo?.usedMemory??0;this._boundingInfo=null,this._boundingSphere=null,e&&this.notifyMemoryChange?.(-e)}getMutableBuffers(){return this._invalidatePositionCaches(),this._buffers}getMutableVertexField(e,t){let n=this._buffers.vertex.getField(e,t);return n!=null&&a(e)&&this._invalidatePositionCaches(),n}getMutableStorageField(e,t){let n=this._buffers.storage?.getField(e,t);return n!=null&&a(e)&&this._invalidatePositionCaches(),n}_invalidatePositionCaches(){this._readPrimitivePosition=null,this.invalidateBoundingInfo()}computeAttachmentOrigin(e){return this.material.computeAttachmentOrigin(e,this.readPrimitivePosition,this.indexCount)?(t(e,e,this.localOrigin.vec3),!0):!1}get highlights(){return this._highlights||d}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(e){this._highlightOptionsCounts?.forEach((t,n)=>e(n))}allocateIdAndHighlight(e){let t=new c(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);let{highlightName:t}=e,n=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,n),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){let{highlightName:t}=e,n=this._highlightOptionsCounts?.get(t)??0;n<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,n-1)}}}const d=new Set;export{u as BufferGeometry};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clamp as e}from"../../../../core/mathUtils.js";import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{isFloat32Array as n}from"../../../../core/typedArrayUtil.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i,copy as a,nan as o,fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as c}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as l}from"../../../../geometry/support/FloatArray.js";import{intersectsTransformedAabb as u}from"../../../../geometry/support/frustumPlanes.js";import{newContinuousIndexArray as d}from"../../../../geometry/support/Indices.js";import{createPositionReader as f}from"./PositionReader.js";import{MeshIntersectionOptions as p,intersectRayTriangles as m}from"./RayIntersections.js";import{forEachTriangleRangeScreenPolygonHit as h}from"./screenPolygonTriangleIntersections.js";const g=1e-6;class _{constructor(t,n,i){this.globalTriangleVertexIndices=t,this.numTriangles=n,this.positions=i,this._rayDirection=r(),this._callback=T,this._intersectionOptions=w,this._screenPolygonCallback=E,this._screenPolygonDisplacement=null,this._screenPolygonIntersector=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this.bspNodeTree=[],this.triangleIndexMap=d(n),this._readPosition=f(i.data,t,i.stride);let a=S(t,n,i.data,i.stride),o=e(Math.log2(n/40),2,10),s=(e,t,n)=>{let
|
|
2
|
+
import{clamp as e}from"../../../../core/mathUtils.js";import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{isFloat32Array as n}from"../../../../core/typedArrayUtil.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i,copy as a,nan as o,fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as c}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as l}from"../../../../geometry/support/FloatArray.js";import{intersectsTransformedAabb as u}from"../../../../geometry/support/frustumPlanes.js";import{newContinuousIndexArray as d}from"../../../../geometry/support/Indices.js";import{createPositionReader as f}from"./PositionReader.js";import{MeshIntersectionOptions as p,intersectRayTriangles as m}from"./RayIntersections.js";import{forEachTriangleRangeScreenPolygonHit as h}from"./screenPolygonTriangleIntersections.js";const g=1e-6;class _{constructor(t,n,i){this.globalTriangleVertexIndices=t,this.numTriangles=n,this.positions=i,this._rayDirection=r(),this._callback=T,this._intersectionOptions=w,this._screenPolygonCallback=E,this._screenPolygonDisplacement=null,this._screenPolygonIntersector=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this.bspNodeTree=[],this.triangleIndexMap=d(n),this._readPosition=f(i.data,t,i.stride);let a=S(t,n,i.data,i.stride);if(this._rootAabb=b(this.triangleIndexMap,a,0,n),n<=40)return;let o=e(Math.log2(n/40),2,10),s=(e,t,n,r)=>{let i=t-e,{axis:c,midValue:l}=x(r),u=y(this.triangleIndexMap,a,e,t,c,l),d=(e,t,r)=>{if(n>o)return;let a=t-e;if(!(a<=40)&&!(a>=.8*i))return s(e,t,n+1,r)},f=b(this.triangleIndexMap,a,e,u.next),p=b(this.triangleIndexMap,a,u.next,u.mid),m=b(this.triangleIndexMap,a,u.mid,t),h=new v(f,p,m,c,l,u.next,u.mid);return this.bspNodeTree.push(h),h.leftNode=d(e,u.next,f),h.rightNode=d(u.mid,t,m),h};s(0,n,0,this._rootAabb)}intersectRayTriangleRange(e,t){if(e>=t)return;let{data:n,stride:r}=this.positions;m(this._rayFrom,this._rayDirection,e,t,this.globalTriangleVertexIndices,n,r,this._intersectionOptions.normalRequired,this._callback,this.triangleIndexMap),_.numFacesTested+=t-e}forEachScreenPolygonHit(e,t,n,r,i){e.camera!=null&&(this._screenPolygonIntersector=e,this._screenPolygonTransformation=t,this._screenPolygonQuery=n,this._screenPolygonDisplacement=r,this._screenPolygonCallback=i,this._intersectScreenPolygonBSP(this.bspNodeTree[0],0,this.triangleIndexMap.length),this._screenPolygonCallback=E,this._screenPolygonDisplacement=null,this._screenPolygonQuery=null,this._screenPolygonTransformation=null,this._screenPolygonIntersector=null)}intersectRay(e,t,n,r){_.numFacesTested=0;let i=e,a=t,o=a[0]-i[0],s=a[1]-i[1],c=a[2]-i[2];if(o*o+s*s+c*c<g)return;this._rayFrom=i;let l=this._rayDirection;l[0]=o,l[1]=s,l[2]=c;let u=this.triangleIndexMap.length;this._callback=r,this._intersectionOptions=n;let d=this.bspNodeTree[0];d===void 0?C(this._rootAabb,i,l)&&this.intersectRayTriangleRange(0,u):this.intersectRayBSP(d,0,u),this._callback=T,this._intersectionOptions=w}intersectRayBSP(e,t,n){let r=this._rayFrom,i=this._rayDirection;this._traverseBSP(e,t,n,e=>C(e,r,i),e=>{let t=e.axis;return r[t]<e.d||i[t]<0},e=>{let t=e.axis;return r[t]>e.d||i[t]>0},(e,t)=>this.intersectRayTriangleRange(e,t))}_intersectScreenPolygonTriangleRange(e,t){if(e>=t)return;let n=this._screenPolygonIntersector,r=this._screenPolygonQuery;if(n!=null&&r!=null)for(let i of h(n,this._screenPolygonTransformation,r,e,t,this._readPosition,this._screenPolygonDisplacement,this.triangleIndexMap))this._screenPolygonCallback(i.distance,i.primitiveIndex,i.point)}_intersectScreenPolygonBSP(e,t,n){let r=this._screenPolygonIntersector,i=this._screenPolygonQuery;r?.camera!=null&&i!=null&&(e===void 0?this._nodeIntersectsScreenPolygonBroadPhase(this._rootAabb)&&this._intersectScreenPolygonTriangleRange(t,n):this._traverseBSP(e,t,n,e=>this._nodeIntersectsScreenPolygonBroadPhase(e),()=>!0,()=>!0,(e,t)=>this._intersectScreenPolygonTriangleRange(e,t)))}_traverseBSP(e,t,n,r,i,a,o){if(!r(this._rootAabb))return;let s=[{node:e,rangeStart:t,rangeEnd:n}];for(;s.length>0;){let{node:e,rangeStart:t,rangeEnd:n}=s.pop();i(e)&&this._traverseBSPRange(s,e.leftNode,e.leftAabb,t,e.midStartIndex,r,o),e.midStartIndex<e.rightStartIndex&&r(e.middleAabb)&&o(e.midStartIndex,e.rightStartIndex),a(e)&&this._traverseBSPRange(s,e.rightNode,e.rightAabb,e.rightStartIndex,n,r,o)}}_traverseBSPRange(e,t,n,r,i,a,o){r>=i||!a(n)||(t===void 0?o(r,i):e.push({node:t,rangeStart:r,rangeEnd:i}))}_nodeIntersectsScreenPolygonBroadPhase(e){let t=this._screenPolygonQuery;if(t==null)return!1;let n=this._screenPolygonDisplacement,r=n?n.applyToAabb(a(D,e)):e;return u(t.broadPhaseFrustum,r,this._screenPolygonTransformation)}static{this.numFacesTested=0}get estimatedMemoryUsage(){return t(this.triangleIndexMap)}}class v{constructor(e,t,n,r,i,a,o){this.leftAabb=e,this.middleAabb=t,this.rightAabb=n,this.axis=r,this.d=i,this.midStartIndex=a,this.rightStartIndex=o}}function y(e,t,n,r,i,a){let o=i+3,s=n,c=n,l=r;for(;c<l;){let n=e[c],r=n*6;t[r+o]<=a?(e[c]=e[s],e[s]=n,++s,++c):t[r+i]>=a?(--l,e[c]=e[l],e[l]=n):++c}return{next:s,mid:l}}function b(e,t,n,r){if(r<=n)return o;let i=e[n]*6,a=t[i++],c=t[i++],l=t[i++],u=t[i++],d=t[i++],f=t[i];for(let o=n+1;o<r;++o)i=e[o]*6,a=Math.min(a,t[i++]),c=Math.min(c,t[i++]),l=Math.min(l,t[i++]),u=Math.max(u,t[i++]),d=Math.max(d,t[i++]),f=Math.max(f,t[i]);return s(a,c,l,u,d,f)}function x(e){let t=e[3]-e[0],n=e[4]-e[1],r=e[5]-e[2],i=t>n?t>r?0:n>r?1:2:n>r?1:r>t?2:0;return{axis:i,midValue:(e[i]+e[i+3])/2}}function S(e,t,r,i){let a=n(r)?l(t*6,!0):c(t*6);for(let n=0;n<t;++n){let t=3*n,o=e[t]*i,s=e[t+1]*i,c=e[t+2]*i;for(let e=0;e<3;++e){let t=r[o+e],i=r[s+e],l=r[c+e];a[n*6+e]=Math.min(t,i,l),a[n*6+3+e]=Math.max(t,i,l)}}return a}function C(e,t,n){let r=t,i=n,a=0,o=1/0;for(let t=0;t<3;++t){{let n=e[t];if(r[t]<n){if(i[t]<=g)return!1;let e=(n-r[t])/i[t];a=Math.max(a,e)}else if(i[t]<=-1e-6){let e=(n-r[t])/i[t];o=Math.min(o,e)}if(a>o)return!1}{let n=e[t+3];if(r[t]>n){if(i[t]>=-1e-6)return!1;let e=(n-r[t])/i[t];a=Math.max(a,e)}else if(i[t]>=g){let e=(n-r[t])/i[t];o=Math.min(o,e)}if(a>o)return!1}}return!0}const w=new p,T=()=>{},E=()=>{},D=i();export{_ as TriangleIntersectionData};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y,applyTranslation as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as ee}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as te,closestLineSegmentPoint as ne,projectPoint as re,projectPointFraction as ie,create as ae}from"../../../../geometry/support/lineSegment.js";import{fromPoints as C,signedDistance as w,getNormal as oe,create as T}from"../../../../geometry/support/plane.js";import{BufferViewUint32 as E,BufferViewVec3f as se}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as ce,isColor as D,isDepth as le,isColorHighlightOLIDOrDepth as ue,is2DGeometryOutput as de}from"../core/shaderLibrary/ShaderOutput.js";import{getScalarAttributeView as fe}from"../lib/attributeViewUtils.js";import pe from"../lib/GLMaterial.js";import{LineMaterial as me}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as O}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as he,screenPolygonIntersectsBufferedSegment as ge}from"../lib/screenPolygonOverlapUtils.js";import{Hit as _e,DrapedHit as ve}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as ye}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as be,assert as k}from"../lib/Util.js";import{createVerticesView as xe}from"../lib/VerticesView.js";import{isImagePattern as Se}from"./lineStippleUtils.js";import{VisualVariablePassParameters as Ce}from"./VisualVariablePassParameters.js";import{getNumJoinSubdivisions as we,getRibbonLinePositions as A,ribbonLineVertexCount as Te,writeRibbonLineTextureBuffer as Ee,writeRibbonLineVertices as De}from"./internal/ribbonLineBufferUtils.js";import{intersectRayWithWorldSizedLineSegment as Oe,intersectScreenPolygonWithWorldSizedLineSegment as ke}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{getLayout as Ae,getTextureBufferLayout as je}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Me}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Pe}from"../../../../webscene/support/AlphaCutoff.js";class Fe extends me{constructor(e,t){super(e,Le),this.produces=new Map([[2,e=>ce(e)||D(e)&&this.parameters.renderOccluded===8],[3,e=>le(e)],[10,e=>ue(e)&&this.parameters.renderOccluded===8],[11,e=>ue(e)&&this.parameters.renderOccluded===8],[4,e=>D(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>D(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>de(e)]]),this._configuration=new Ne(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=we(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Be(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=Pe||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Pe}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped(e,n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=A(e,!!this.parameters.isClosed),u=r[0],d=r[1],f=M(c,o,s,this.parameters.usesWorldSizedWidth()),p=Number.MAX_VALUE,m=0;for(let e of ze(F,I,l,j(this.parameters,l.count))){let n=u-F[0],r=d-F[1],i=I[0]-F[0],a=I[1]-F[1],o=i*n+a*r,s=i*i+a*a,c=t(o/s,0,1),l=i*c-n,f=a*c-r,h=l*l+f*f;h<p&&(p=h,m=e)}p<f*f&&i(a.distance,a.renderDistance,a.normal,m)}intersectRay(t,n,r,i,a,o){let{options:s,camera:c}=r;if(!s.selectionMode||!t.visible||!c)return;if(!be(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let l=this._getLineSize(t);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(t,n,r,l,o):this._intersectRayWithScreenSizedLine(t,n,r,l,o)}_intersectRayWithScreenSizedLine(e,t,n,r,i){let{camera:a}=n,s=A(e,!!this.parameters.isClosed),c=V;o(c,n.point);let _=r*a.pixelRatio,v=$*a.pixelRatio,y=_/2+v;l(q[0],c[0]-y,c[1]+y,0),l(q[1],c[0]+y,c[1]+y,0),l(q[2],c[0]+y,c[1]-y,0),l(q[3],c[0]-y,c[1]-y,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(q[e],J[e]))return;C(a.eye,J[0],J[1],Y),C(a.eye,J[1],J[2],X),C(a.eye,J[2],J[3],Z),C(a.eye,J[3],J[0],Q);let b=Number.MAX_VALUE,x=0;for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count))){if(w(Y,N)<0&&w(Y,P)<0||w(X,N)<0&&w(X,P)<0||w(Z,N)<0&&w(Z,P)<0||w(Q,N)<0&&w(Q,P)<0)continue;let t=a.projectToRenderScreen(N,H),n=a.projectToRenderScreen(P,U);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(z,N,P);let e=a.frustum,n=-w(e[4],N)/d(z,oe(e[4]));if(f(z,z,n),p(N,N,z),!a.projectToRenderScreen(N,t))continue}else if(t[2]>0&&n[2]<0){u(z,P,N);let e=a.frustum,t=-w(e[4],P)/d(z,oe(e[4]));if(f(z,z,t),p(P,P,z),!a.projectToRenderScreen(P,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let i=S(t,n,G),o=te(i,c);if(!(o>=b)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(i,N,P,c,a,r,v);if(o>=e*e)continue}b=o,m(Ge,N),m(Ke,P),x=e}}if(b<y*y){let{rayBegin:e,rayEnd:t}=n,r=Number.MAX_VALUE;if(ne(S(Ge,Ke,G),S(e,t,K),B)){u(B,B,e);let n=h(B);f(B,B,1/n),r=n/g(e,t)}i(r,r,B,x)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=r/(2*s),u=1/0,d=0;for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count))){let t=Oe(N,P,l,a,o,W);if(t!=null&&t<u&&(u=t,d=e,m(B,W),t===0))break}u<1/0&&i(u,u,B,d)}intersectScreenPolygon(t,n,r,i){let{options:a}=r;if(!a.selectionMode||!t.visible)return null;if(!be(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let o=this._getLineSize(t);return this.parameters.worldSized?this._intersectWorldSizedPolygon(t,n,r,i,o):this._intersectScreenSizedPolygon(t,n,r,i,o)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=A(e,!!this.parameters.isClosed),c=$,l=c*a.pixelRatio,u=new _e(4);for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count)))for(let[t,n]of o.processLineSegment(Je,N,P)){if(!he(a,t,n,H,U))continue;let o=S(H,U,G),s=i/2+c;this.parameters.screenSizePerspective&&(_(V,H,U,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,V,a,i,l)/a.pixelRatio)),a.renderToScreen(H,Ue),a.renderToScreen(U,We),ge(r,Ue,We,s)&&(re(S(t,n,K),a.eye,L),u.updateIfCloserFromValues(g(a.eye,L),e,L,null))}return u}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=i/(2*s),u=new _e(4);for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count)))for(let[t,n]of o.processLineSegment(Je,N,P)){re(S(t,n,K),a.eye,L);let i=g(a.eye,L);u.valid&&i>=u.distance||ke(t,n,l,a,r)&&u.updateIfCloserFromValues(i,e,L,null)}return u}intersectScreenPolygonDraped(e,t,n,r,i,a){if(!n.options.selectionMode)return null;let o=this._getLineSize(e,!0),s=A(e,!!this.parameters.isClosed),c=M(o,i,a,this.parameters.usesWorldSizedWidth());for(let e of ze(F,I,s,j(this.parameters,s.count),t))if(ge(r,F,I,c))return new ve(e);return null}createPrimitivePositionReader(e){let t=e.vertex.getField(`ribbonLineVertexInfo`,E),n=e.storage.getField(`position`,se),r=O.getField(0);return(e,i)=>n.getVec(r.get(t.get(i)),e)}computeAttachmentOrigin(e,t,n){return!this.parameters.wireframe&&super.computeAttachmentOrigin(e,t,n)}createBufferWriter(){return new Re(Ae(this.parameters),je(this.parameters),this.parameters)}createGLMaterial(e){return new Ie(e)}validateParameters(e){k(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=ie(e,r);_(L,t,n,s),v(He,L,i.viewMatrix);let c=h(He),l=this.computeCameraAbsCosAngle(L,i,this._configuration.spherical);return Ve.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Ve.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(B,e):l(B,0,0,1),u(R,e,t.eye),y(R,R),Math.abs(d(B,R))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=fe(e,`sizeFeatureAttribute`).get(0);Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else if(this.parameters.hasVertexSize){let t=fe(e,`size`);t!=null&&(r*=t.get(0))}return r}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.count:n.count-1;for(let i=0;i<a;i++)n.getVec(i,e),b(e,e,r),n.getVec((i+1)%n.count,t),b(t,t,r),yield i}}class Ie extends pe{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Me,e)}}class Le extends Ce{constructor(){super(...arguments),this._width=0,this.color=ee,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Se(this.stipplePattern)&&this.stippleTexture!=null}}class Re{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=O.getField(0).max}_isClosed(e){return j(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){let t=e.get(`position`);return t.data.length/3+(this._isClosed(t.data.length/t.stride)?3:2)}elementCount(e){let t=e.get(`position`),n=t.indices.length/2+1;return Te(n,this._isClosed(t.data.length/t.stride),this._parameters)}rebaseBuffers(e,t,n,r){if(r?.buffer.copyFrom(e.storage,0,r.offset),t!=null){let r=n.from,i=e.vertex.getField(`ribbonLineVertexInfo`,E),a=t.buffer.getField(`ribbonLineVertexInfo`,E),o=O.getField(0);for(let e=0;e<i.count;e++){let n=i.get(e),s=o.get(n)+r;a.set(t.offset+e,n===0?0:o.set(n,s))}}}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=xe(t.get(`position`),3),i=t.get(`timeStamps`);i!=null&&n.buffer.layout.fields.has(`timeStamps`)&&k(i.size===4),Ee({position:r,color:t.get(`color`)?.data,size:t.get(`size`)?.data,colorFeature:t.get(`colorFeatureAttribute`)?.data,sizeFeature:t.get(`sizeFeatureAttribute`)?.data,opacityFeature:t.get(`opacityFeatureAttribute`)?.data,distancesToStart:t.get(`distanceToStart`)?.data,timeStamps:i?.data,olidColor:t.get(`olidColor`)?.data},this._isClosed(r.count),n,e)}_writeVertexBuffer(e,t,n){let r=e.get(`position`),i=r.indices,a=r.data.length/3,o=this._isClosed(r.data.length/r.stride),s=a+(o?3:2);i&&i.length!==2*(a-1)&&console.warn(`RibbonLineMaterial does not support indices`),k(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let c=n.from;k(n.numElements===s,`Expected number of elements in TextureBuffer to equal number of points`),De(a,o,this._parameters,t,c)}}function j(e,t){return e.isClosed&&t>2}function M(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*ze(e,t,n,r,i){let a=r?n.count:n.count-1,c=i?.[0]??0,l=i?.[1]??0;s(e,n.get(0,0)+c,n.get(0,1)+l);for(let r=1;r<=a;r++){let i=r%n.count;s(t,n.get(i,0)+c,n.get(i,1)+l),yield r,o(e,t)}}function Be(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}const Ve=new ye,N=x(),P=x(),F=c(),I=c(),L=x(),He=x(),R=x(),z=x(),B=x(),V=x(),H=n(),U=n(),Ue=r(),We=r(),Ge=x(),Ke=x(),W=x(),G=ae(),K=ae(),q=[n(),n(),n(),n()],J=[x(),x(),x(),x()],Y=T(),X=T(),Z=T(),Q=T(),$=4,qe={getDrapedRibbonLineMaxDistance:M},Je=[x(),x()];export{Le as Parameters,Fe as RibbonLineMaterial,qe as test};
|
|
2
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y,applyTranslation as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as ee}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as te,closestLineSegmentPoint as ne,projectPoint as re,projectPointFraction as ie,create as ae}from"../../../../geometry/support/lineSegment.js";import{fromPoints as C,signedDistance as w,getNormal as oe,create as T}from"../../../../geometry/support/plane.js";import{BufferViewUint32 as E,BufferViewVec3f as se}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as ce,isColor as D,isDepth as le,isColorHighlightOLIDOrDepth as ue,is2DGeometryOutput as de}from"../core/shaderLibrary/ShaderOutput.js";import{getScalarAttributeView as fe}from"../lib/attributeViewUtils.js";import pe from"../lib/GLMaterial.js";import{LineMaterial as me}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as O}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as he,screenPolygonIntersectsBufferedSegment as ge}from"../lib/screenPolygonOverlapUtils.js";import{Hit as _e,DrapedHit as ve}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as ye}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as be,assert as k}from"../lib/Util.js";import{createVerticesView as xe}from"../lib/VerticesView.js";import{isImagePattern as Se}from"./lineStippleUtils.js";import{VisualVariablePassParameters as Ce}from"./VisualVariablePassParameters.js";import{getNumJoinSubdivisions as we,getRibbonLinePositions as A,isClosed as j,ribbonLineVertexCount as Te,writeRibbonLineTextureBuffer as Ee,writeRibbonLineVertices as De}from"./internal/ribbonLineBufferUtils.js";import{intersectRayWithWorldSizedLineSegment as Oe,intersectScreenPolygonWithWorldSizedLineSegment as ke}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{getLayout as Ae,getTextureBufferLayout as je}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Me}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Pe}from"../../../../webscene/support/AlphaCutoff.js";class Fe extends me{constructor(e,t){super(e,Le),this.produces=new Map([[2,e=>ce(e)||D(e)&&this.parameters.renderOccluded===8],[3,e=>le(e)],[10,e=>ue(e)&&this.parameters.renderOccluded===8],[11,e=>ue(e)&&this.parameters.renderOccluded===8],[4,e=>D(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>D(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>de(e)]]),this._configuration=new Ne(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=we(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Be(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=Pe||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Pe}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped(e,n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=A(e,!!this.parameters.isClosed),u=r[0],d=r[1],f=M(c,o,s,this.parameters.usesWorldSizedWidth()),p=Number.MAX_VALUE,m=0;for(let e of ze(F,I,l,j(this.parameters,l.count))){let n=u-F[0],r=d-F[1],i=I[0]-F[0],a=I[1]-F[1],o=i*n+a*r,s=i*i+a*a,c=t(o/s,0,1),l=i*c-n,f=a*c-r,h=l*l+f*f;h<p&&(p=h,m=e)}p<f*f&&i(a.distance,a.renderDistance,a.normal,m)}intersectRay(t,n,r,i,a,o){let{options:s,camera:c}=r;if(!s.selectionMode||!t.visible||!c)return;if(!be(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let l=this._getLineSize(t);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(t,n,r,l,o):this._intersectRayWithScreenSizedLine(t,n,r,l,o)}_intersectRayWithScreenSizedLine(e,t,n,r,i){let{camera:a}=n,s=A(e,!!this.parameters.isClosed),c=V;o(c,n.point);let _=r*a.pixelRatio,v=$*a.pixelRatio,y=_/2+v;l(q[0],c[0]-y,c[1]+y,0),l(q[1],c[0]+y,c[1]+y,0),l(q[2],c[0]+y,c[1]-y,0),l(q[3],c[0]-y,c[1]-y,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(q[e],J[e]))return;C(a.eye,J[0],J[1],Y),C(a.eye,J[1],J[2],X),C(a.eye,J[2],J[3],Z),C(a.eye,J[3],J[0],Q);let b=Number.MAX_VALUE,x=0;for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count))){if(w(Y,N)<0&&w(Y,P)<0||w(X,N)<0&&w(X,P)<0||w(Z,N)<0&&w(Z,P)<0||w(Q,N)<0&&w(Q,P)<0)continue;let t=a.projectToRenderScreen(N,H),n=a.projectToRenderScreen(P,U);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(z,N,P);let e=a.frustum,n=-w(e[4],N)/d(z,oe(e[4]));if(f(z,z,n),p(N,N,z),!a.projectToRenderScreen(N,t))continue}else if(t[2]>0&&n[2]<0){u(z,P,N);let e=a.frustum,t=-w(e[4],P)/d(z,oe(e[4]));if(f(z,z,t),p(P,P,z),!a.projectToRenderScreen(P,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let i=S(t,n,G),o=te(i,c);if(!(o>=b)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(i,N,P,c,a,r,v);if(o>=e*e)continue}b=o,m(Ge,N),m(Ke,P),x=e}}if(b<y*y){let{rayBegin:e,rayEnd:t}=n,r=Number.MAX_VALUE;if(ne(S(Ge,Ke,G),S(e,t,K),B)){u(B,B,e);let n=h(B);f(B,B,1/n),r=n/g(e,t)}i(r,r,B,x)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=r/(2*s),u=1/0,d=0;for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count))){let t=Oe(N,P,l,a,o,W);if(t!=null&&t<u&&(u=t,d=e,m(B,W),t===0))break}u<1/0&&i(u,u,B,d)}intersectScreenPolygon(t,n,r,i){let{options:a}=r;if(!a.selectionMode||!t.visible)return null;if(!be(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let o=this._getLineSize(t);return this.parameters.worldSized?this._intersectWorldSizedPolygon(t,n,r,i,o):this._intersectScreenSizedPolygon(t,n,r,i,o)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=A(e,!!this.parameters.isClosed),c=$,l=c*a.pixelRatio,u=new _e(4);for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count)))for(let[t,n]of o.processLineSegment(Je,N,P)){if(!he(a,t,n,H,U))continue;let o=S(H,U,G),s=i/2+c;this.parameters.screenSizePerspective&&(_(V,H,U,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,V,a,i,l)/a.pixelRatio)),a.renderToScreen(H,Ue),a.renderToScreen(U,We),ge(r,Ue,We,s)&&(re(S(t,n,K),a.eye,L),u.updateIfCloserFromValues(g(a.eye,L),e,L,null))}return u}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=i/(2*s),u=new _e(4);for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count)))for(let[t,n]of o.processLineSegment(Je,N,P)){re(S(t,n,K),a.eye,L);let i=g(a.eye,L);u.valid&&i>=u.distance||ke(t,n,l,a,r)&&u.updateIfCloserFromValues(i,e,L,null)}return u}intersectScreenPolygonDraped(e,t,n,r,i,a){if(!n.options.selectionMode)return null;let o=this._getLineSize(e,!0),s=A(e,!!this.parameters.isClosed),c=M(o,i,a,this.parameters.usesWorldSizedWidth());for(let e of ze(F,I,s,j(this.parameters,s.count),t))if(ge(r,F,I,c))return new ve(e);return null}createPrimitivePositionReader(e){let t=e.vertex.getField(`ribbonLineVertexInfo`,E),n=e.storage.getField(`position`,se),r=O.getField(0);return(e,i)=>n.getVec(r.get(t.get(i)),e)}computeAttachmentOrigin(e,t,n){return!this.parameters.wireframe&&super.computeAttachmentOrigin(e,t,n)}createBufferWriter(){return new Re(Ae(this.parameters),je(this.parameters),this.parameters)}createGLMaterial(e){return new Ie(e)}validateParameters(e){k(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=ie(e,r);_(L,t,n,s),v(He,L,i.viewMatrix);let c=h(He),l=this.computeCameraAbsCosAngle(L,i,this._configuration.spherical);return Ve.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Ve.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(B,e):l(B,0,0,1),u(R,e,t.eye),y(R,R),Math.abs(d(B,R))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=fe(e,`sizeFeatureAttribute`).get(0);Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else if(this.parameters.hasVertexSize){let t=fe(e,`size`);t!=null&&(r*=t.get(0))}return r}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.count:n.count-1;for(let i=0;i<a;i++)n.getVec(i,e),b(e,e,r),n.getVec((i+1)%n.count,t),b(t,t,r),yield i}}class Ie extends pe{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Me,e)}}class Le extends Ce{constructor(){super(...arguments),this._width=0,this.color=ee,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Se(this.stipplePattern)&&this.stippleTexture!=null}}class Re{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=O.getField(0).max}_isClosed(e){return j(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){let t=e.get(`position`);return t.data.length/3+(this._isClosed(t.data.length/t.stride)?3:2)}elementCount(e){let t=e.get(`position`),n=t.indices.length/2+1;return Te(n,this._isClosed(t.data.length/t.stride),this._parameters)}rebaseBuffers(e,t,n,r){if(r?.buffer.copyFrom(e.storage,0,r.offset),t!=null){let r=n.from,i=e.vertex.getField(`ribbonLineVertexInfo`,E),a=t.buffer.getField(`ribbonLineVertexInfo`,E),o=O.getField(0);for(let e=0;e<i.count;e++){let n=i.get(e),s=o.get(n)+r;a.set(t.offset+e,n===0?0:o.set(n,s))}}}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=xe(t.get(`position`),3),i=t.get(`timeStamps`);i!=null&&n.buffer.layout.fields.has(`timeStamps`)&&k(i.size===4),Ee({position:r,color:t.get(`color`)?.data,size:t.get(`size`)?.data,colorFeature:t.get(`colorFeatureAttribute`)?.data,sizeFeature:t.get(`sizeFeatureAttribute`)?.data,opacityFeature:t.get(`opacityFeatureAttribute`)?.data,distancesToStart:t.get(`distanceToStart`)?.data,timeStamps:i?.data,olidColor:t.get(`olidColor`)?.data},this._isClosed(r.count),n,e)}_writeVertexBuffer(e,t,n){let r=e.get(`position`),i=r.indices,a=r.data.length/3,o=this._isClosed(r.data.length/r.stride),s=a+(o?3:2);i&&i.length!==2*(a-1)&&console.warn(`RibbonLineMaterial does not support indices`),k(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let c=n.from;k(n.numElements===s,`Expected number of elements in TextureBuffer to equal number of points`),De(a,o,this._parameters,t,c)}}function M(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*ze(e,t,n,r,i){let a=r?n.count:n.count-1,c=i?.[0]??0,l=i?.[1]??0;s(e,n.get(0,0)+c,n.get(0,1)+l);for(let r=1;r<=a;r++){let i=r%n.count;s(t,n.get(i,0)+c,n.get(i,1)+l),yield r,o(e,t)}}function Be(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}const Ve=new ye,N=x(),P=x(),F=c(),I=c(),L=x(),He=x(),R=x(),z=x(),B=x(),V=x(),H=n(),U=n(),Ue=r(),We=r(),Ge=x(),Ke=x(),W=x(),G=ae(),K=ae(),q=[n(),n(),n(),n()],J=[x(),x(),x(),x()],Y=T(),X=T(),Z=T(),Q=T(),$=4,qe={getDrapedRibbonLineMaxDistance:M},Je=[x(),x()];export{Le as Parameters,Fe as RibbonLineMaterial,qe as test};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{transformMat4 as e,distance as t,copy as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewVec3f as i,BufferViewFloat as a,BufferViewVec4Unorm8 as o,BufferViewVec4u8 as s,BufferViewVec4f16 as c,BufferViewUint32 as l}from"../../../../../geometry/support/buffer/BufferView.js";import{olidEnabled as u}from"../../effects/geometry/olidUtils.js";import{encodeRibbonLineVertexInfo as d}from"../../lib/RibbonLineVertexInfo.js";import{assert as f}from"../../lib/Util.js";import{createVerticesView as p}from"../../lib/VerticesView.js";import{n as m}from"../../../../../chunks/RibbonLine.glsl.js";function h(e,t){return(e===`round`?m:0)+ +!!t}function g(e,t,n){let r=t?e:e-2,i=h(n.join,n.stipplePattern!=null),a=(t?2:4)+r*(i*2+4)+2;return n.wireframe?2+(a-2)*4:a}function
|
|
2
|
+
import{transformMat4 as e,distance as t,copy as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewVec3f as i,BufferViewFloat as a,BufferViewVec4Unorm8 as o,BufferViewVec4u8 as s,BufferViewVec4f16 as c,BufferViewUint32 as l}from"../../../../../geometry/support/buffer/BufferView.js";import{olidEnabled as u}from"../../effects/geometry/olidUtils.js";import{encodeRibbonLineVertexInfo as d}from"../../lib/RibbonLineVertexInfo.js";import{assert as f}from"../../lib/Util.js";import{createVerticesView as p}from"../../lib/VerticesView.js";import{n as m}from"../../../../../chunks/RibbonLine.glsl.js";function h(e,t){return(e===`round`?m:0)+ +!!t}function g(e,t){return e.isClosed&&t>2}function _(e,t,n){let r=t?e:e-2,i=h(n.join,n.stipplePattern!=null),a=(t?2:4)+r*(i*2+4)+2;return n.wireframe?2+(a-2)*4:a}function v(e,t,n,r,i){let{buffer:a,offset:o}=r,s=a.getField(`ribbonLineVertexInfo`,l).typedBuffer,c=h(n.join,n.stipplePattern!=null),u=o+1,f=(e,t,n)=>{s[u++]=d(i+n+1,t,e)};t||(f(1,7,0),f(1,5,0));let p=t?e:e-1;for(let e=+!t;e<p;e++){f(0,2,e),f(0,0,e);for(let t=0;t<c;t++){let n=(t+1)/(c+1);f(n,2,e),f(n,0,e)}f(1,6,e),f(1,4,e)}f(0,t?2:3,p),f(0,+!t,p),s[o]=s[o+1],s[u]=s[u-1],u++,n.wireframe&&y(s,o,u)}function y(e,t,n){let r=n;for(let i=t;i<=n-4;i+=2)e[r++]=e[i],e[r++]=e[i+2],e[r++]=e[i+1],e[r++]=e[i+2],e[r++]=e[i+1],e[r++]=e[i+3]}function b(r,l,d,p){let m=r.position,{buffer:h,offset:g}=d,_=h.getField(`position`,i);f(_!=null,`Expected valid position field in texture buffer`);let v=h.getField(`u0`,a),y=r.distancesToStart,b=h.getField(`color`,o),S=h.getField(`size`,a),C=h.getField(`colorFeatureAttribute`,a),w=h.getField(`sizeFeatureAttribute`,a),k=h.getField(`opacityFeatureAttribute`,a),A=u()?h.getField(`olidColor`,o):null,j=A==null?null:new s(A.buffer,A.start,A.stride),M=h.getField(`timeStamps`,c),N=0;for(let i=0;i<m.count;i++){m.getVec(i,D),p!=null&&e(D,D,p),v!=null&&i>0&&(y==null?N+=t(O,D):N=y[i]??N);let a=g+i+1;if(_.setVec(a,D),v!=null&&(v.set(a,N),n(O,D)),S?.set(a,T(r.size,i,1)),b!=null){let e=r.color??E,t=Math.min(i*4,e.length-4);b.setValues(a,e[t],e[t+1],e[t+2],e[t+3])}if(C?.set(a,T(r.colorFeature,i)),k?.set(a,T(r.opacityFeature,i)),w?.set(a,T(r.sizeFeature,i)),M!=null&&r.timeStamps!=null&&M.setValues(a,r.timeStamps[i*4],r.timeStamps[i*4+1],r.timeStamps[i*4+2],r.timeStamps[i*4+3]),j!=null&&r.olidColor!=null){let e=Math.min(i*4,r.olidColor.length-4);j.setValues(a,r.olidColor[e],r.olidColor[e+1],r.olidColor[e+2],r.olidColor[e+3])}}x(h,m.count,l,g),l&&v!=null&&(m.getVec(0,D),p!=null&&e(D,D,p),v.set(g+m.count+1,y?.[m.count]??N+t(O,D)))}function x(e,t,n,r=0){let i=r+1,a=r+t;n?(e.copyItem(a,r),e.copyItem(i,a+1),e.copyItem(i+1,a+2)):(e.copyItem(i,r),e.copyItem(a,a+1))}function S(e,t){let n=e.count-(t&&e.count>4?3:2);return e.slice(1,n)}function C(e,t){if(e.type===1)return S(e.buffers.storage.getField(`position`,i),t);let n=e.attributes.get(`position`);return p(n,3)}function w(e,r){let o=e.buffers.storage,s=o.getField(`u0`,a);if(s==null)return;let c=S(o.getField(`position`,i),r),l=0;for(let e=0;e<c.count;e++)c.getVec(e,D),e>0&&(l+=t(O,D)),s.set(e+1,l),n(O,D);r&&c.count>2?(c.getVec(0,D),s.set(0,l),s.set(c.count+1,l+t(O,D)),s.set(c.count+2,s.get(2))):(s.set(0,0),s.set(c.count+1,l))}function T(e,t,n=0){return typeof e==`number`?e:e?.[e.length===1?0:t]??n}const E=[1,1,1,1],D=r(),O=r();export{x as fillRibbonLinePadding,h as getNumJoinSubdivisions,S as getRibbonLineBufferPositions,C as getRibbonLinePositions,g as isClosed,_ as ribbonLineVertexCount,w as updateRibbonLineDistances,b as writeRibbonLineTextureBuffer,v as writeRibbonLineVertices};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as n}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as r}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as a,destroyMaybe as o}from"../../../../core/maybe.js";import{when as s,initial as c,watch as l,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{addFrameTask as ee}from"../../../../core/scheduling.js";import{signal as d}from"../../../../core/signal.js";import{Milliseconds as f}from"../../../../core/time.js";import{property as p,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{isMoon as h,isMars as te}from"../../../../geometry/ellipsoidUtils.js";import{debugFlags as g}from"../../support/debugFlags.js";import{ComponentObjectCollection as _}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as v}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as y}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as b}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as x}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as S}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as C}from"../effects/clouds/CloudsComposition.js";import{Fog as w}from"../effects/fog/Fog.js";import{ObjectAndLayerID as T}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as E}from"../effects/geometry/olidUtils.js";import{RenderOccluded as D}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as O}from"../effects/globalIllumination/GlobalIllumination.js";import{Haze as k}from"../effects/haze/Haze.js";import{Highlight as A}from"../effects/highlight/Highlight.js";import{ShadowHighlight as j}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as M}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as N}from"../effects/magnifier/Magnifier.js";import{ShadowAccumulator as P}from"../effects/shadowAccumulation/ShadowAccumulator.js";import{ShadowCastRenderer as F}from"../effects/shadowAccumulation/ShadowCastRenderer.js";import{SMAA as ne}from"../effects/smaa/SMAA.js";import{SSAO as I}from"../effects/ssao/SSAO.js";import{Stars as L}from"../effects/stars/Stars.js";import{EmissionComposite as R}from"../lib/EmissionComposite.js";import{GLMaterialRepository as z}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as B}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as V}from"../lib/Renderer.js";import{RenderingContext as H}from"../lib/RenderingContext.js";import{RenderingContextOptions as U}from"../lib/RenderingContextOptions.js";import{TextureRepository as W}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as G}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as K}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as q}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as J}from"./contextCache.js";import{removeLoadedShaderModules as Y}from"./renderUtils.js";import{ScreenshotManager as X,ScreenshotContext as Z}from"./ScreenshotManager.js";import{contextCache as re}from"./testUtils.js";import{noBudget as ie}from"../../../support/Scheduler.js";import{checkWebGLError as ae}from"../../../webgl/checkWebGLError.js";const oe=has(`disable-feature:async-navigation-3d-depth-readback`);let Q=class extends t{constructor(e,t){super(e),this.olidRenderHelper=E()?new B:null,this.waterTextures=new q,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._fog=d(null),this.globalIllumination=null,this.shadowAccumulator=null,this.test=null,this._initializeContext(t);let{memoryController:n}=t.view.resourceController;this.stippleTextures=K(this._rctx,n),this.markerTextures=G(this._rctx,n),this.techniques=new y(new v(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new W(t),this.addHandles(this.textures.events.on(`changed`,e=>this.requestRender(e)));let r=new z(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new V(t,r,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([s(()=>t.view.ready,()=>this._createRenderNodes(),c),l(()=>this.waterTextures.updating,()=>this.requestRender(),c),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),u),l(()=>t.view.environment.lighting.globalIllumination,e=>this.renderer?.updateGlobalIllumination(e),u)]);let i={renderScene:(e,t,n,r)=>(this.renderer.setTime(t),this.renderer.render(e,n,r)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,n,r)=>t.options.screenshot.renderOverlay(e,n,r)};this._screenshotManager=new X(this._rctx,i,e=>t.view.overlayManager.updateOverlays(ie,e.camera,0)),this._registerFrameTask(t)}destroy(){let e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=a(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.globalIllumination=null,this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){let{view:e,viewingMode:t}=this.stage;this.shadowAccumulator=new P({view:e}),this.shadowAccumulator.accumulationRenderer=new F({view:e,data:this.shadowAccumulator}),this.renderer.setShadowAccumulator(this.shadowAccumulator),new L({view:e}),h(e.spatialReference)||(t===2?new x({view:e}):te(e.spatialReference)?new S({view:e}):(new b({view:e}),new C({view:e}),new k({view:e}),this._fog.value=new w({view:e}))),new I({view:e}),this.globalIllumination=new O({view:e});let n=new ne({view:e,isEnabled:()=>this.renderer.hasSMAA});new N({view:e}),new A({view:e,antialias:n}),new M({view:e}),new j({view:e,viewingMode:t}),new R({view:e}),new D({view:e}),E()&&new T({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulation();case 0:this._needsRender=!0}}get updating(){let e=this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating;return e&&g.UPDATING&&console.log(` RenderView:`,this._needsUpdate,this._needsWaterReflectionUpdate,this.renderer.updating,this.textures.updating,this.waterTextures.updating),e}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(n(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,n,r,i,a=i){let o=oe?this._readMainDepthSynchronously(t,n,r,i,a):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,n,r,i,a)??Number.MAX_VALUE;if(e){let i=e.pickDepth(t*r.pixelRatio,n*r.pixelRatio,r);i!=null&&o>i&&i!==r.nearFar[0]&&i!==r.nearFar[1]&&(o=i)}return o===Number.MAX_VALUE?void 0:o}whenRepresentativeDepthForArea(e,t,n,r,i,a=1){return this.renderer.navigationDepthCache.whenRepresentativeDepthForArea(e,t,n,r,i,a)}_readMainDepthSynchronously(e,t,n,r,i){let a=n.constrainWindowSize(e,t,r*n.pixelRatio,i*n.pixelRatio),o=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,o);let s=Number.MAX_VALUE;for(let e=0;e<a[2]*a[3];e++){let t=this._linearDepthFromTexture(e*4,o,n.nearFar);s>t&&t!==n.nearFar[0]&&t!==n.nearFar[1]&&(s=t)}return s}_linearDepthFromTexture(e,t,n){return r(t,e)*(n[1]-n[0])+n[0]}_ensureLinearDepthArrayBuffer(e){let t=4*e[2]*e[3];return(this._tmpDepthBuffer==null||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){Y(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){let t=e.view.state,n=!1,r=0,i=!1,a={preRender:({time:i})=>{n=this.updating,r=+!!this._needsUpdate,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;let a=f(i-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(a>this.renderer.animationTimestep||n||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){let e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),i=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();let n=new Z(t,this.renderer.fboCache,this.globalIllumination?.isAccumulating??!1);e=this.test?.time??e,this._screenshotManager.update(n,e)},finish:()=>{i&&=(this.renderer.finish(t.mode===2?r:1),!1)}};this._frameTask=ee(a)}_initializeContext(e){let{options:t}=e,n=t.canvas??document.createElement(`canvas`);n.setAttribute(`style`,`width: 100%; height:100%; display:block;`),this._canvas=n;let r={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:`high-performance`,preserveDrawingBuffer:t.preserveDrawingBuffer??!1},a=n.getContext(`webgl2`,r);if(a==null){i.getLogger(this).error(`A WebGL2 context could not be created.`);return}ae(a,!0),this._rctx=se(a,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this).error(`WebGL context has alpha channel even though no alpha channel was requested`);let{container:o}=e;!this._rctx.contextAttributes.alpha&&has(`safari`)>=11&&(o.style.backgroundColor=`black`),o.contains(n)||o.appendChild(n)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable(`textureFloatLinear`)}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new _(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){this.test?.time!=null&&e.fadeDuration!=null&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=f(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}get fog(){return n(this._fog.value)}};e([p()],Q.prototype,`updating`,null),e([p({constructOnly:!0})],Q.prototype,`view`,void 0),e([p({readOnly:!0})],Q.prototype,`componentObjectCollection`,null),e([p()],Q.prototype,`_componentObjectCollection`,void 0),e([p()],Q.prototype,`_needsUpdate`,void 0),e([p()],Q.prototype,`_needsWaterReflectionUpdate`,void 0),Q=e([m(`esri.views.3d.webgl-engine.parts.RenderView`)],Q);function se(e,t){let n=new U(t);if(re.enabled){let t=$.get(e);return t?.refCount===1?(t.configure(n),t.ref(),t):(t=new H(e,n),$.set(e,t),t.ref(),t)}return new H(e,n)}const $=J();export{Q as RenderView};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as n}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as r}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import{removeMaybe as i,destroyMaybe as a}from"../../../../core/maybe.js";import{when as o,initial as s,watch as c,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../../core/scheduling.js";import{signal as d}from"../../../../core/signal.js";import{Milliseconds as f}from"../../../../core/time.js";import{property as p,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{isMoon as ee,isMars as te}from"../../../../geometry/ellipsoidUtils.js";import{debugFlags as h}from"../../support/debugFlags.js";import{ComponentObjectCollection as g}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as _}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as v}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as y}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as b}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as x}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as S}from"../effects/clouds/CloudsComposition.js";import{Fog as C}from"../effects/fog/Fog.js";import{ObjectAndLayerID as w}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as T}from"../effects/geometry/olidUtils.js";import{RenderOccluded as E}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as D}from"../effects/globalIllumination/GlobalIllumination.js";import{Haze as O}from"../effects/haze/Haze.js";import{Highlight as k}from"../effects/highlight/Highlight.js";import{ShadowHighlight as A}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as j}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as M}from"../effects/magnifier/Magnifier.js";import{ShadowAccumulator as N}from"../effects/shadowAccumulation/ShadowAccumulator.js";import{ShadowCastRenderer as P}from"../effects/shadowAccumulation/ShadowCastRenderer.js";import{SMAA as ne}from"../effects/smaa/SMAA.js";import{SSAO as F}from"../effects/ssao/SSAO.js";import{Stars as I}from"../effects/stars/Stars.js";import{EmissionComposite as L}from"../lib/EmissionComposite.js";import{GLMaterialRepository as R}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as z}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as B}from"../lib/Renderer.js";import{RenderingContext as V}from"../lib/RenderingContext.js";import{RenderingContextOptions as H}from"../lib/RenderingContextOptions.js";import{TextureRepository as U}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as W}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as G}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as K}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as q}from"./contextCache.js";import{removeLoadedShaderModules as J}from"./renderUtils.js";import{ScreenshotManager as Y,ScreenshotContext as X}from"./ScreenshotManager.js";import{contextCache as Z}from"./testUtils.js";import{noBudget as re}from"../../../support/Scheduler.js";import{checkWebGLError as ie}from"../../../webgl/checkWebGLError.js";const ae=has(`disable-feature:async-navigation-3d-depth-readback`);let Q=class extends t{constructor(e,t){super(e),this.olidRenderHelper=T()?new z:null,this.waterTextures=new K,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._fog=d(null),this.globalIllumination=null,this.shadowAccumulator=null,this.test=null,this._initializeContext(t);let{memoryController:n}=t.view.resourceController;this.stippleTextures=G(this._rctx,n),this.markerTextures=W(this._rctx,n),this.techniques=new v(new _(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new U(t),this.addHandles(this.textures.events.on(`changed`,e=>this.requestRender(e)));let r=new R(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new B(t,r,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([o(()=>t.view.ready,()=>this._createRenderNodes(),s),c(()=>this.waterTextures.updating,()=>this.requestRender(),s),c(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),l),c(()=>t.view.environment.lighting.globalIllumination,e=>this.renderer?.updateGlobalIllumination(e),l)]);let i={renderScene:(e,t,n,r)=>(this.renderer.setTime(t),this.renderer.render(e,n,r)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,n,r)=>t.options.screenshot.renderOverlay(e,n,r)};this._screenshotManager=new Y(this._rctx,i,e=>t.view.overlayManager.updateOverlays(re,e.camera,0)),this._registerFrameTask(t)}destroy(){let e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=i(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=a(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.globalIllumination=null,this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=a(this._rctx),this.test?.destroy()}_createRenderNodes(){let{view:e,viewingMode:t}=this.stage;this.shadowAccumulator=new N({view:e}),this.shadowAccumulator.accumulationRenderer=new P({view:e,data:this.shadowAccumulator}),this.renderer.setShadowAccumulator(this.shadowAccumulator),new I({view:e}),ee(e.spatialReference)||(t===2?new b({view:e}):te(e.spatialReference)?new x({view:e}):(new y({view:e}),new S({view:e}),new O({view:e}),this._fog.value=new C({view:e}))),new F({view:e}),this.globalIllumination=new D({view:e});let n=new ne({view:e,isEnabled:()=>this.renderer.hasSMAA});new M({view:e}),new k({view:e,antialias:n}),new j({view:e}),new A({view:e,viewingMode:t}),new L({view:e}),new E({view:e}),T()&&new w({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulation();case 0:this._needsRender=!0}}get updating(){let e=this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating;return e&&h.UPDATING&&console.log(` RenderView:`,this._needsUpdate,this._needsWaterReflectionUpdate,this.renderer.updating,this.textures.updating,this.waterTextures.updating),e}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(n(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,n,r,i,a=i){let o=ae?this._readMainDepthSynchronously(t,n,r,i,a):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,n,r,i,a)??Number.MAX_VALUE;if(e){let i=e.pickDepth(t*r.pixelRatio,n*r.pixelRatio,r);i!=null&&o>i&&i!==r.nearFar[0]&&i!==r.nearFar[1]&&(o=i)}return o===Number.MAX_VALUE?void 0:o}whenRepresentativeDepthForArea(e,t,n,r,i,a=1){return this.renderer.navigationDepthCache.whenRepresentativeDepthForArea(e,t,n,r,i,a)}_readMainDepthSynchronously(e,t,n,r,i){let a=n.constrainWindowSize(e,t,r*n.pixelRatio,i*n.pixelRatio),o=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,o);let s=Number.MAX_VALUE;for(let e=0;e<a[2]*a[3];e++){let t=this._linearDepthFromTexture(e*4,o,n.nearFar);s>t&&t!==n.nearFar[0]&&t!==n.nearFar[1]&&(s=t)}return s}_linearDepthFromTexture(e,t,n){return r(t,e)*(n[1]-n[0])+n[0]}_ensureLinearDepthArrayBuffer(e){let t=4*e[2]*e[3];return(this._tmpDepthBuffer==null||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){J(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){let t=e.view.state,n=!1,r=0,i=!1,a={preRender:({time:i})=>{n=this.updating,r=+!!this._needsUpdate,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;let a=f(i-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(a>this.renderer.animationTimestep||n||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){let e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),i=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();let n=new X(t,this.renderer.fboCache,this.globalIllumination?.isAccumulating??!1);e=this.test?.time??e,this._screenshotManager.update(n,e)},finish:()=>{i&&=(this.renderer.finish(t.mode===2?r:1),!1)}};this._frameTask=u(a)}_initializeContext(e){let{options:t}=e,{canvas:n,gl:r}=t.context;n.setAttribute(`style`,`width: 100%; height:100%; display:block;`),this._canvas=n,ie(r,!0),this._rctx=oe(r,e),this._loadShaderOnlyExtensions();let{container:i}=e;!this._rctx.contextAttributes.alpha&&has(`safari`)>=11&&(i.style.backgroundColor=`black`),i.contains(n)||i.appendChild(n)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable(`textureFloatLinear`)}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new g(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){this.test?.time!=null&&e.fadeDuration!=null&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=f(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}get fog(){return n(this._fog.value)}};e([p()],Q.prototype,`updating`,null),e([p({constructOnly:!0})],Q.prototype,`view`,void 0),e([p({readOnly:!0})],Q.prototype,`componentObjectCollection`,null),e([p()],Q.prototype,`_componentObjectCollection`,void 0),e([p()],Q.prototype,`_needsUpdate`,void 0),e([p()],Q.prototype,`_needsWaterReflectionUpdate`,void 0),Q=e([m(`esri.views.3d.webgl-engine.parts.RenderView`)],Q);function oe(e,t){let n=new H(t);if(Z.enabled){let t=$.get(e);return t?.refCount===1?(t.configure(n),t.ref(),t):(t=new V(e,n),$.set(e,t),t.ref(),t)}return new V(e,n)}const $=q();export{Q as RenderView};
|
package/views/3d/webgl.d.ts
CHANGED
|
@@ -220,6 +220,7 @@ export function fromRenderCamera(view: SceneView, camera: RenderCamera): Camera;
|
|
|
220
220
|
*
|
|
221
221
|
* @param view - The view the output camera should be related to.
|
|
222
222
|
* @param camera - The input render camera.
|
|
223
|
-
* @returns The new camera using the spatial reference of the view.
|
|
223
|
+
* @returns The new camera using the spatial reference of the view. If input `camera` is `null` or the projection fails
|
|
224
|
+
* for an unexpected reason, the function will return `null`.
|
|
224
225
|
*/
|
|
225
226
|
export function toRenderCamera(view: SceneView, camera: Camera | null | undefined): RenderCamera | null | undefined;
|
package/views/3d/webgl.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../Camera.js";import{rad2deg as t,deg2rad as n}from"../../core/mathUtils.js";import{create as r}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as i,add as a}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as l}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as u}from"../../geometry/projection/projectBuffer.js";import{projectPointToVector as d}from"../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as f}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as p}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as m,viewModeDependentUtil as h}from"./support/viewingModeUtils.js";const g={OPAQUE:`opaque-color`,TRANSPARENT:`transparent-color`,COMPOSITE:`composite-color`,FINAL:`final-color`},_=[g.FINAL,g.COMPOSITE,g.OPAQUE,g.TRANSPARENT],v={ANTIALIASING:`antialiasing`,CUTFILL:`cutfill`,CUTFILL_COMPUTATION:`cutfill-computation`,FOCUSAREA:`focusarea`,FOCUSAREA_MASK:`focusarea-mask`,GAUSSIAN_SPLAT:`gaussian`,GAUSSIAN_SPLAT_DEPTH:`gaussian-depth`,GROUND_DEPTH:`ground-depth`,HIGHLIGHT:`highlight`,LASERLINES:`laserlines`,TRANSPARENT_NO_DEPTH:`transparent-no-depth`,MAGNIFIER:`magnifier`,OCCLUDED:`occluded`,OPAQUE_OCCLUSION_QUERY:`opaque-occlusion-query`,OPAQUE_ENVIRONMENT:`opaque-environment`,TRANSPARENT_ENVIRONMENT:`transparent-environment`,AMBIENT_ILLUMINATION:`ambient-illumination`,SHADOW_ACCUMULATION:`shadow-accumulation`,SHADOWMAP:`shadowmap`,SHADOW_HIGHLIGHT:`shadow-highlight`,VOXEL:`voxel`,VIEWSHED:`viewshed`,OBJECT_AND_LAYER_ID_COLOR:`olid`},y=Array.from(Object.values(v)).concat(_);function b(e,t,n,r,i,a,o){return r||=e.spatialReference,u(t,r,n,i,e.renderCoordsHelper.spatialReference,a,o)?i:null}function x(e,t,n,r,i,a,o){return a||=e.spatialReference,u(t,e.renderCoordsHelper.spatialReference,n,r,a,i,o)?r:null}function S(e,t,n,i){return i||=r(),n||=e.spatialReference,l(n,t,i,e.renderCoordsHelper.spatialReference)?i:null}function C(n,r,i){let a=n.renderSpatialReference,o=m(n,r.eye,r.viewForward,r.up,D),l=n.spatialReference;return f(r.eye,a,E,l)||(l=c.WGS84,f(r.eye,a,E,l)),i==null?i=new e(new s(E,l),o.heading,o.tilt,t(r.fov)):(i.position.x=E[0],i.position.y=E[1],i.position.z=E[2],i.position.spatialReference=l,i.heading=o.heading,i.tilt=o.tilt,i.fov=t(r.fov)),i.layout.row=r.row,i.layout.rows=r.rows,i.layout.column=r.column,i.layout.columns=r.columns,i}function w(e,t){return T(e,t,void 0)}function T(e,t,r){if(!t)return null;let s=e.renderSpatialReference,c=h(e).headingTiltToDirectionUp,l=o();if(!d(t.position,l,s))return null;let u=c(l,t.heading,t.tilt);i(u.direction,u.direction,e.state.camera.distance),a(u.direction,u.direction,l);let f=p(e,l,u.direction,u.up,r);return f.fov=n(t.fov),f.row=t.layout.row,f.rows=t.layout.rows,f.column=t.layout.column,f.columns=t.layout.columns,f}const E=o(),D={heading:0,tilt:0};export{y as AllInternalRenderNodeOutputs,_ as AllRenderNodeOutputs,v as InternalRenderCategory,g as RenderNodeOutput,C as fromRenderCamera,x as fromRenderCoordinates,S as renderCoordinateTransformAt,w as toRenderCamera,T as toRenderCameraWithScale,b as toRenderCoordinates};
|
|
2
|
+
import e from"../../Camera.js";import{rad2deg as t,deg2rad as n}from"../../core/mathUtils.js";import{create as r}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as i,add as a}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as l}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as u}from"../../geometry/projection/projectBuffer.js";import{projectPointToVector as d}from"../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as f}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as p}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as m,viewModeDependentUtil as h}from"./support/viewingModeUtils.js";const g={OPAQUE:`opaque-color`,TRANSPARENT:`transparent-color`,COMPOSITE:`composite-color`,FINAL:`final-color`},_=[g.FINAL,g.COMPOSITE,g.OPAQUE,g.TRANSPARENT],v={ANTIALIASING:`antialiasing`,CUTFILL:`cutfill`,CUTFILL_COMPUTATION:`cutfill-computation`,FOCUSAREA:`focusarea`,FOCUSAREA_MASK:`focusarea-mask`,GAUSSIAN_SPLAT:`gaussian`,GAUSSIAN_SPLAT_DEPTH:`gaussian-depth`,GROUND_DEPTH:`ground-depth`,HIGHLIGHT:`highlight`,LASERLINES:`laserlines`,TRANSPARENT_NO_DEPTH:`transparent-no-depth`,MAGNIFIER:`magnifier`,OCCLUDED:`occluded`,OPAQUE_OCCLUSION_QUERY:`opaque-occlusion-query`,OPAQUE_ENVIRONMENT:`opaque-environment`,TRANSPARENT_ENVIRONMENT:`transparent-environment`,AMBIENT_ILLUMINATION:`ambient-illumination`,SHADOW_ACCUMULATION:`shadow-accumulation`,SHADOWMAP:`shadowmap`,SHADOW_HIGHLIGHT:`shadow-highlight`,VOXEL:`voxel`,VIEWSHED:`viewshed`,OBJECT_AND_LAYER_ID_COLOR:`olid`},y=Array.from(Object.values(v)).concat(_);function b(e,t,n,r,i,a,o){return r||=e.spatialReference,u(t,r,n,i,e.renderCoordsHelper.spatialReference,a,o)?i:null}function x(e,t,n,r,i,a,o){return a||=e.spatialReference,u(t,e.renderCoordsHelper.spatialReference,n,r,a,i,o)?r:null}function S(e,t,n,i){return i||=r(),n||=e.spatialReference,l(n,t,i,e.renderCoordsHelper.spatialReference)?i:null}function C(n,r,i){let a=n.renderSpatialReference,o=m(n,r.eye,r.viewForward,r.up,D),l=n.spatialReference;return f(r.eye,a,E,l)||(l=c.WGS84,f(r.eye,a,E,l)),i==null?i=new e({position:new s({x:E[0],y:E[1],z:E[2],m:E[3],spatialReference:l}),heading:o.heading,tilt:o.tilt,fov:t(r.fov)}):(i.position.x=E[0],i.position.y=E[1],i.position.z=E[2],i.position.spatialReference=l,i.heading=o.heading,i.tilt=o.tilt,i.fov=t(r.fov)),i.layout.row=r.row,i.layout.rows=r.rows,i.layout.column=r.column,i.layout.columns=r.columns,i}function w(e,t){return T(e,t,void 0)}function T(e,t,r){if(!t)return null;let s=e.renderSpatialReference,c=h(e).headingTiltToDirectionUp,l=o();if(!d(t.position,l,s))return null;let u=c(l,t.heading,t.tilt);i(u.direction,u.direction,e.state.camera.distance),a(u.direction,u.direction,l);let f=p(e,l,u.direction,u.up,r);return f.fov=n(t.fov),f.row=t.layout.row,f.rows=t.layout.rows,f.column=t.layout.column,f.columns=t.layout.columns,f}const E=o(),D={heading:0,tilt:0};export{y as AllInternalRenderNodeOutputs,_ as AllRenderNodeOutputs,v as InternalRenderCategory,g as RenderNodeOutput,C as fromRenderCamera,x as fromRenderCoordinates,S as renderCoordinateTransformAt,w as toRenderCamera,T as toRenderCameraWithScale,b as toRenderCoordinates};
|
package/views/SceneView.d.ts
CHANGED
|
@@ -632,7 +632,13 @@ export interface SceneViewProperties extends ViewProperties, DOMContainerPropert
|
|
|
632
632
|
* // Set the view to show an extent at a -20 degree heading, disabling the
|
|
633
633
|
* // animated transition
|
|
634
634
|
* view.goTo({
|
|
635
|
-
* target: new Extent(
|
|
635
|
+
* target: new Extent({
|
|
636
|
+
* xmin: 694942,
|
|
637
|
+
* ymin: 5596444,
|
|
638
|
+
* xmax: 1284090,
|
|
639
|
+
* ymax: 6163926,
|
|
640
|
+
* spatialReference: SpatialReference.WebMercator
|
|
641
|
+
* }),
|
|
636
642
|
* heading: -20
|
|
637
643
|
* }, {
|
|
638
644
|
* animate: false
|