@arcgis/core 4.28.0-next.20230919 → 4.28.0-next.20230921
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/Color.js +1 -1
- package/WebScene.js +1 -1
- package/arcade/ArcadeDate.js +1 -1
- package/arcade/executionError.js +1 -1
- package/arcade/featureset/support/errorsupport.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/06621efb2573fad23b45.js +1 -0
- package/assets/esri/core/workers/chunks/072b4e041b8630c513a0.js +1 -0
- package/assets/esri/core/workers/chunks/101f776316a85b708927.js +1 -0
- package/assets/esri/core/workers/chunks/107546ef77a45d31c7ac.js +1 -0
- package/assets/esri/core/workers/chunks/10fd951bd296b2beeeba.js +1 -0
- package/assets/esri/core/workers/chunks/114269dda1d296893908.js +1 -0
- package/assets/esri/core/workers/chunks/126df6237fc80608344e.js +1 -0
- package/assets/esri/core/workers/chunks/134524cf6b1ebf208338.js +1 -0
- package/assets/esri/core/workers/chunks/17a36704e63ca1b34c5d.js +1 -0
- package/assets/esri/core/workers/chunks/1c83f47d446f2bca1721.js +1 -0
- package/assets/esri/core/workers/chunks/{09d395a9786607294689.js → 1c8469fbde39d85ee622.js} +1 -1
- package/assets/esri/core/workers/chunks/1cbaba30f55f00f7498b.js +1 -0
- package/assets/esri/core/workers/chunks/21a9c8aa2a9e9990df41.js +1 -0
- package/assets/esri/core/workers/chunks/{506874f562ce11f8914a.js → 243a4eed107d363dfad8.js} +1 -1
- package/assets/esri/core/workers/chunks/24629402c647ef6b5f6b.js +1 -0
- package/assets/esri/core/workers/chunks/2a1c1be9c202462cf54d.js +1 -0
- package/assets/esri/core/workers/chunks/2bb69d76a13564e8e455.js +1 -0
- package/assets/esri/core/workers/chunks/2d0d03cbea83c868edba.js +1 -0
- package/assets/esri/core/workers/chunks/2e130cb2f1038055c07b.js +1 -0
- package/assets/esri/core/workers/chunks/32ba4eba730e9232d964.js +1 -0
- package/assets/esri/core/workers/chunks/{b428fcb53ecc82b49e66.js → 332689bf60d246485993.js} +1 -1
- package/assets/esri/core/workers/chunks/3619e04cbb6691549014.js +1 -0
- package/assets/esri/core/workers/chunks/37116fb4c68cf3c3890a.js +1 -0
- package/assets/esri/core/workers/chunks/{3a7ad0d24264e2bc2e87.js → 3ca759f72d3bb29e9ea9.js} +22 -22
- package/assets/esri/core/workers/chunks/3dbfb4f370a874393822.js +1 -0
- package/assets/esri/core/workers/chunks/3f4e9b1663ec521bfe00.js +1 -0
- package/assets/esri/core/workers/chunks/406db5c90271a3a203d4.js +1 -0
- package/assets/esri/core/workers/chunks/4339ce8aaf87fabb80cc.js +1 -0
- package/assets/esri/core/workers/chunks/4369a6c1e0a82ab4db6a.js +1 -0
- package/assets/esri/core/workers/chunks/43ba2bacd0f7d19915f7.js +1 -0
- package/assets/esri/core/workers/chunks/44b8e75593b7df1843e1.js +1 -0
- package/assets/esri/core/workers/chunks/467a821d05df8ec0dc1c.js +1 -0
- package/assets/esri/core/workers/chunks/47be4c75dd6372b96fe4.js +1 -0
- package/assets/esri/core/workers/chunks/53097659f31750c03a6d.js +1 -0
- package/assets/esri/core/workers/chunks/{c1141056581af072aee9.js → 580039dd491854ca325c.js} +1 -1
- package/assets/esri/core/workers/chunks/59c00d6fba0fd1c03d01.js +1 -0
- package/assets/esri/core/workers/chunks/5a5720caa64a46daadf9.js +1 -0
- package/assets/esri/core/workers/chunks/5edb99b58549cd66b394.js +1 -0
- package/assets/esri/core/workers/chunks/6203ddf6caad3d356327.js +1 -0
- package/assets/esri/core/workers/chunks/652749dc847fcb887234.js +1 -0
- package/assets/esri/core/workers/chunks/6c495077cc79e1898927.js +1 -0
- package/assets/esri/core/workers/chunks/{e5c3beebd507e1dda35f.js → 749fc49246093d693227.js} +1 -1
- package/assets/esri/core/workers/chunks/74d3ecb1a06d9f81e2c5.js +1 -0
- package/assets/esri/core/workers/chunks/77c15b1c2729c780f75a.js +1 -0
- package/assets/esri/core/workers/chunks/7ea33aa455c5143affb1.js +1 -0
- package/assets/esri/core/workers/chunks/7ed70c96fbfe00792e7c.js +1 -0
- package/assets/esri/core/workers/chunks/8ab832468300cc4feb5a.js +1 -0
- package/assets/esri/core/workers/chunks/90771b0de3e520a1df9a.js +1 -0
- package/assets/esri/core/workers/chunks/94188fe381239d48a975.js +1 -0
- package/assets/esri/core/workers/chunks/a277c980ba8704939688.js +1 -0
- package/assets/esri/core/workers/chunks/b1746c022fe6edaeda55.js +1 -0
- package/assets/esri/core/workers/chunks/b449d6bd5851187d419f.js +1 -0
- package/assets/esri/core/workers/chunks/bbc0dcd316c5598bc9ad.js +1 -0
- package/assets/esri/core/workers/chunks/bc1dc6383e60e7e61d50.js +1 -0
- package/assets/esri/core/workers/chunks/bc6323bdc98013da6fe5.js +1 -0
- package/assets/esri/core/workers/chunks/bde89b2684b6185992ef.js +1 -0
- package/assets/esri/core/workers/chunks/c4bb67150ccd01ea6014.js +1 -0
- package/assets/esri/core/workers/chunks/{727548fffd4e270617d3.js → c6ea5aac232d1eca04dd.js} +1 -1
- package/assets/esri/core/workers/chunks/c8438c2d9ac48afe4033.js +1 -0
- package/assets/esri/core/workers/chunks/c9dfb145f0c1d93e0fbd.js +1 -0
- package/assets/esri/core/workers/chunks/cad260881653567bc8f9.js +1 -0
- package/assets/esri/core/workers/chunks/cec607d0138351a4952e.js +1 -0
- package/assets/esri/core/workers/chunks/d24afa6d8fd0061d9f00.js +1 -0
- package/assets/esri/core/workers/chunks/{f147269d85adfb4588ed.js → d9061beaa43065316062.js} +1 -1
- package/assets/esri/core/workers/chunks/dd7508d4016715371e0c.js +1 -0
- package/assets/esri/core/workers/chunks/dff1c3c38dda2bd1a9d6.js +1 -0
- package/assets/esri/core/workers/chunks/e55f7fc7eff0074ce0fc.js +1 -0
- package/assets/esri/core/workers/chunks/eb01f4cdb9b918cc61e7.js +1 -0
- package/assets/esri/core/workers/chunks/ec8258c9dc1491e97fc8.js +1 -0
- package/assets/esri/core/workers/chunks/ed1fbc1bc8d50453e2f5.js +1 -0
- package/assets/esri/core/workers/chunks/eeac53da496de4cd4182.js +1 -0
- package/assets/esri/core/workers/chunks/eef27d305023034084a4.js +1 -0
- package/assets/esri/core/workers/chunks/f38c54ada9e7012a2960.js +1 -0
- package/assets/esri/core/workers/chunks/f508ccfde6425dabe9ac.js +1 -0
- package/assets/esri/core/workers/chunks/f5e0ff5292b9fd18fc92.js +1 -0
- package/assets/esri/core/workers/chunks/f5eb8b5021620be7538e.js +1 -0
- package/assets/esri/images/portal/onlinemedialayer16.png +0 -0
- package/assets/esri/themes/base/widgets/_FeatureForm.scss +2 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_en.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nb.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ar.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bg.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bs.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ca.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_da.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_de.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_en.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_es.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_et.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fi.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_he.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hu.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_id.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_it.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ja.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ko.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lt.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nb.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-BR.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-PT.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ro.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ru.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sk.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sv.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_th.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_tr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_uk.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_vi.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-CN.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-HK.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-TW.json +1 -1
- package/chunks/LaserlinePath.glsl.js +5 -1
- package/core/HandleOwner.js +1 -1
- package/core/MemCache.js +1 -1
- package/core/date.js +5 -0
- package/core/sql.js +1 -1
- package/core/string.js +1 -1
- package/interfaces.d.ts +60 -43
- package/intl/date.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/WFSLayer.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/WFSSourceWorker.js +1 -1
- package/layers/graphics/sources/csv/csv.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/{views/interactive/tooltip/tooltipInfoUnion.js → layers/graphics/sources/support/QueryEngineBuildLayer.js} +1 -0
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/mixins/SceneService.js +1 -1
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/save/utils.js +1 -1
- package/layers/support/editableLayers.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/labelFormatUtils.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/layers/support/rasterFunctionUtils.js +1 -1
- package/layers/support/rasterFunctions/creators/createBandIndexFunctions.js +1 -1
- package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
- package/layers/support/rasterFunctions/creators/createLocalFunctions.js +1 -1
- package/networks/support/utils.js +1 -1
- package/package.json +1 -1
- package/portal/PortalItem.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/rest/geometryService/cut.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/versionManagement/deleteVersion.js +1 -1
- package/rest/versionManagement/gdbVersion/alterVersion.js +1 -1
- package/rest/versionManagement/gdbVersion/post.js +1 -1
- package/rest/versionManagement/gdbVersion/reconcile.js +1 -1
- package/rest/versionManagement/gdbVersion/serverVersionUtils.js +5 -0
- package/support/revision.js +1 -1
- package/time/timeZoneUtils.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/WGLMeshFactory.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
- package/views/2d/layers/features/sources/DataTileSource.js +1 -1
- package/views/2d/layers/features/sources/StreamSource.js +1 -1
- package/views/2d/layers/features/support/whereUtils.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/LocalAtmosphere.js +1 -1
- package/views/3d/externalRenderers/StageRenderer.js +1 -1
- package/views/3d/interactive/manipulatorUtils.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/layers/support/overlayImageUtils.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/support/StreamDataLoader.js +1 -1
- package/views/3d/support/dito.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js +10 -12
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl.js +8 -21
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/Attribute.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/support/HighlightHelper.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/layerUtils.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/keybindings.js +1 -1
- package/views/interactive/tooltip/SketchTooltipInfo.js +1 -1
- package/views/interactive/tooltip/TooltipContentWithHelpMessage.js +1 -1
- package/views/interactive/tooltip/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/TranslateTooltipInfos.js +1 -1
- package/views/interactive/tooltip/content/Fields.js +5 -0
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/webdoc/saveAPIKeyUtils.js +5 -0
- package/webdoc/webdocSaveUtils.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/EditableInput.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/support/ResultAreaHandler.js +1 -1
- package/widgets/UtilityNetworkTrace/support/UtilityHelper.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/globalCss.js +1 -1
- package/assets/esri/core/workers/chunks/0274b84548cb048562e4.js +0 -1
- package/assets/esri/core/workers/chunks/034accc7cab6c88a3b31.js +0 -1
- package/assets/esri/core/workers/chunks/0839b45999fcb556e460.js +0 -1
- package/assets/esri/core/workers/chunks/09589852b129bfb5624f.js +0 -1
- package/assets/esri/core/workers/chunks/132e9e6147304ffd128d.js +0 -1
- package/assets/esri/core/workers/chunks/1790ca4193d730f5f206.js +0 -1
- package/assets/esri/core/workers/chunks/1a449168d30a688e6128.js +0 -1
- package/assets/esri/core/workers/chunks/1c94624fd001c803a814.js +0 -1
- package/assets/esri/core/workers/chunks/25ab3bec45de900be36e.js +0 -1
- package/assets/esri/core/workers/chunks/273167b2dd46e58b8739.js +0 -1
- package/assets/esri/core/workers/chunks/2c5eb8aaad696fa16744.js +0 -1
- package/assets/esri/core/workers/chunks/353bad8530710a284592.js +0 -1
- package/assets/esri/core/workers/chunks/357d452b8522185cc433.js +0 -1
- package/assets/esri/core/workers/chunks/3c2be3d204e6bf87266a.js +0 -1
- package/assets/esri/core/workers/chunks/3c2c64832fb498bbaa83.js +0 -1
- package/assets/esri/core/workers/chunks/3c4d59018ce8502c65e7.js +0 -1
- package/assets/esri/core/workers/chunks/43eff89599f36d83924b.js +0 -1
- package/assets/esri/core/workers/chunks/4632ada4af99cab70a61.js +0 -1
- package/assets/esri/core/workers/chunks/481eab7879ed5d8a1f67.js +0 -1
- package/assets/esri/core/workers/chunks/4b3a5cc435435c81e6a5.js +0 -1
- package/assets/esri/core/workers/chunks/4f34fd8c2bb769541e9c.js +0 -1
- package/assets/esri/core/workers/chunks/4f5a0bc7411c0db33662.js +0 -1
- package/assets/esri/core/workers/chunks/56a4cea67cc579bf7547.js +0 -1
- package/assets/esri/core/workers/chunks/56afd89d08c874f620a1.js +0 -1
- package/assets/esri/core/workers/chunks/5b08d578521562b166e3.js +0 -1
- package/assets/esri/core/workers/chunks/5f938d6da9fd3f3edc74.js +0 -1
- package/assets/esri/core/workers/chunks/6108d72faf48a592c8ba.js +0 -1
- package/assets/esri/core/workers/chunks/656a8be4ce1bec721366.js +0 -1
- package/assets/esri/core/workers/chunks/7531ebc60e9ae61220e0.js +0 -1
- package/assets/esri/core/workers/chunks/77923afde29ae1ff10ca.js +0 -1
- package/assets/esri/core/workers/chunks/79683324be49aab79dd8.js +0 -1
- package/assets/esri/core/workers/chunks/7cdb4416afd5922cf5f3.js +0 -1
- package/assets/esri/core/workers/chunks/7e87bc83a0a2715e3016.js +0 -1
- package/assets/esri/core/workers/chunks/7f680cf24dd97d61bcd2.js +0 -1
- package/assets/esri/core/workers/chunks/7f797fed73cf7b48a686.js +0 -1
- package/assets/esri/core/workers/chunks/861609ebd3a77b787b0f.js +0 -1
- package/assets/esri/core/workers/chunks/869c3927f1e246cd1e42.js +0 -1
- package/assets/esri/core/workers/chunks/95371c0f5464f5daae9f.js +0 -1
- package/assets/esri/core/workers/chunks/962b99fd273709c726d3.js +0 -1
- package/assets/esri/core/workers/chunks/98fbcbb2115376d7ff62.js +0 -1
- package/assets/esri/core/workers/chunks/9abcd1d11bfd92f872ab.js +0 -1
- package/assets/esri/core/workers/chunks/9b54b5bdb6367c36f6e9.js +0 -1
- package/assets/esri/core/workers/chunks/9dab9f6c07ececa7f851.js +0 -1
- package/assets/esri/core/workers/chunks/9ff6ce486898713af7e2.js +0 -1
- package/assets/esri/core/workers/chunks/a98a435d4dbea73f7517.js +0 -1
- package/assets/esri/core/workers/chunks/b05bb6e784e5453696be.js +0 -1
- package/assets/esri/core/workers/chunks/b51d0ec283f61f638a48.js +0 -1
- package/assets/esri/core/workers/chunks/b5ee6c0c07fa50410370.js +0 -1
- package/assets/esri/core/workers/chunks/b9cf8f02974aeb3ce208.js +0 -1
- package/assets/esri/core/workers/chunks/bdf13091bd0e1ab0db7e.js +0 -1
- package/assets/esri/core/workers/chunks/bef1a1218a94ab6e2b51.js +0 -1
- package/assets/esri/core/workers/chunks/c22c2b15fe5f2c97a2ae.js +0 -1
- package/assets/esri/core/workers/chunks/c880d2f0ff06b3bf731f.js +0 -1
- package/assets/esri/core/workers/chunks/c88869d2a647c22dc3e6.js +0 -1
- package/assets/esri/core/workers/chunks/cc96be71fee49f07dcd4.js +0 -1
- package/assets/esri/core/workers/chunks/e4237360eef474d1f0ac.js +0 -1
- package/assets/esri/core/workers/chunks/e54ae2a4281dd58e0707.js +0 -1
- package/assets/esri/core/workers/chunks/e977e721f6f50e3c5f13.js +0 -1
- package/assets/esri/core/workers/chunks/ed31cf6688c0f7dac1f9.js +0 -1
- package/assets/esri/core/workers/chunks/f07a0ea10428adecea1a.js +0 -1
- package/assets/esri/core/workers/chunks/f1eab5c67ed808c18f86.js +0 -1
- package/assets/esri/core/workers/chunks/f2e7142a8db164940544.js +0 -1
- package/assets/esri/core/workers/chunks/f939b4166f76975f5da0.js +0 -1
- package/assets/esri/core/workers/chunks/ff4f4107a866e4a68386.js +0 -1
- package/layers/ogc/dateUtils.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{f as e}from"../../../../chunks/vec2f32.js";import{newLayout as t}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as i}from"../core/shaderLibrary/hud/HUD.glsl.js";import s from"../lib/GLMaterial.js";import{Material as n,MaterialParameters as a}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{writePosition as
|
|
5
|
+
import{f as e}from"../../../../chunks/vec2f32.js";import{newLayout as t}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as i}from"../core/shaderLibrary/hud/HUD.glsl.js";import s from"../lib/GLMaterial.js";import{Material as n,MaterialParameters as a}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{writePosition as l,writeNormal as c,writeBufferVec4 as f}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";class m extends n{get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}constructor(e){super(e,new g),this._configuration=new d,this._uniqueMaterialIdentifier=m.uniqueMaterialIdentifier(this.parameters)}getPassParameters(){return this.parameters}getConfiguration(e,t){const r=t?.slot!==o.LINE_CALLOUTS;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.depthHudEnabled=r,this._configuration.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?i.Screen:i.World,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration}intersect(){}produces(e,t){if(t===r.Color)switch(e){case o.LINE_CALLOUTS:case o.LINE_CALLOUTS_HUD_DEPTH:return!0}return!1}createGLMaterial(e){return new p(e)}createBufferWriter(){return new b}validateParameters(e){const t=m.uniqueMaterialIdentifier(e);t!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=t)}static uniqueMaterialIdentifier(e){return JSON.stringify({horizontalScreenOffset:e.horizontalScreenOffset??0,centerOffsetUnits:e.centerOffsetUnits||"world"})}}class p extends s{beginSlot(e){return this.ensureTechnique(h,e)}}class g extends a{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=[0,0,0,1],this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.depthHUDAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}const O=t().vec3f(u.POSITION).vec3f(u.NORMAL).vec2f(u.UV0).vec4f(u.AUXPOS1),S=[e(0,0),e(1,0),e(0,1),e(1,0),e(1,1),e(0,1)];class b{constructor(){this.vertexBufferLayout=O}elementCount(e){return 6*e.attributes.get(u.POSITION).indices.length}write(e,t,r,i,s){l(r.attributes.get(u.POSITION),e,i.position,s,6),c(r.attributes.get(u.NORMAL),t,i.normal,s,6),f(r.attributes.get(u.AUXPOS1),i.auxpos1,s,6);for(let n=0;n<S.length;++n)i.uv0.setVec(s+n,S[n])}}export{m as LineCalloutMaterial,g as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{s as
|
|
5
|
+
import{s as t,G as e,e as r}from"../../../../chunks/vec3.js";import{c as a}from"../../../../chunks/vec3f64.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as o}from"../lib/GLTextureMaterial.js";import{Material as n,RenderOccludedFlag as h}from"../lib/Material.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as l,LineMarkerTechnique as m}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d,LineMarkerSpace as T,LineMarkerAnchor as _}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as f}from"../shaders/RibbonLineTechniqueConfiguration.js";class A extends n{constructor(t){super(t,new v),this._vertexAttributeLocations=l,this._configuration=new d,this._layout=this.createLayout()}getConfiguration(t,e){return this._configuration.output=t,this._configuration.space=e.slot===c.DRAPED_MATERIAL?T.Draped:this.parameters.worldSpace?T.World:T.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==f.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===h.OccludeAndTransparentStencil,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration.multipassEnabled=e.multipassEnabled,this._configuration.cullAboveGround=e.multipassTerrain.cullAboveGround,this._configuration}intersect(){}createLayout(){const t=i().vec3f(u.POSITION).vec2f(u.UV0).vec3f(u.AUXPOS1);return this.parameters.worldSpace&&t.vec3f(u.NORMAL),this.parameters.vvSize?t.f32(u.SIZEFEATUREATTRIBUTE):t.f32(u.SIZE),this.parameters.vvColor?t.f32(u.COLORFEATUREATTRIBUTE):t.vec4f(u.COLOR),this.parameters.vvOpacity&&t.f32(u.OPACITYFEATUREATTRIBUTE),t}createBufferWriter(){return new O(this._layout,this.parameters)}produces(t,e){if(e===s.Color||e===s.Alpha||e===s.Highlight||e===s.Depth){if(t===c.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===h.OccludeAndTransparentStencil)return t===c.OPAQUE_MATERIAL||t===c.OCCLUDER_MATERIAL||t===c.TRANSPARENT_OCCLUDER_MATERIAL;if(e===s.Color||e===s.Alpha){return t===(this.parameters.writeDepth?c.TRANSPARENT_MATERIAL:c.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return t===c.OPAQUE_MATERIAL}return!1}createGLMaterial(t){return new E(t)}}class E extends o{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextureRepository.release(this._markerPrimitive),this._markerPrimitive=null}_updateParameters(t){const e=this._material.parameters.markerPrimitive;return e!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextureRepository.swap(e,this._markerPrimitive)}),this._markerPrimitive=e),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(m,t)}_updateOccludeeState(t){t.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:t.hasOccludees})}beginSlot(t){return this._output!==s.Color&&this._output!==s.Alpha||this._updateOccludeeState(t),this._updateParameters(t)}}class v extends p{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=f.BUTT,this.anchor=_.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.hasOccludees=!1,this.markerTexture=null}}class O{constructor(t,e){this.vertexBufferLayout=t,this._parameters=e}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(a,i,s,o,n){const h=s.attributes.get(u.POSITION).data,c=h.length/3;let p=[1,0,0];const l=s.attributes.get(u.NORMAL);this._parameters.worldSpace&&null!=l&&(p=l.data);let m=1,d=0;this._parameters.vvSize?d=s.attributes.get(u.SIZEFEATUREATTRIBUTE).data[0]:s.attributes.has(u.SIZE)&&(m=s.attributes.get(u.SIZE).data[0]);let T=[1,1,1,1],_=0;this._parameters.vvColor?_=s.attributes.get(u.COLORFEATUREATTRIBUTE).data[0]:s.attributes.has(u.COLOR)&&(T=s.attributes.get(u.COLOR).data);let f=0;this._parameters.vvOpacity&&(f=s.attributes.get(u.OPACITYFEATUREATTRIBUTE).data[0]);const A=new Float32Array(o.buffer);let E=n*(this.vertexBufferLayout.stride/4);const v=(t,e,r,a)=>{if(A[E++]=t[0],A[E++]=t[1],A[E++]=t[2],A[E++]=r[0],A[E++]=r[1],A[E++]=e[0],A[E++]=e[1],A[E++]=e[2],this._parameters.worldSpace&&(A[E++]=p[0],A[E++]=p[1],A[E++]=p[2]),this._parameters.vvSize?A[E++]=d:A[E++]=m,this._parameters.vvColor)A[E++]=_;else{const t=Math.min(4*a,T.length-4);A[E++]=T[t],A[E++]=T[t+1],A[E++]=T[t+2],A[E++]=T[t+3]}this._parameters.vvOpacity&&(A[E++]=f)};let O;!function(t){t[t.ASCENDING=1]="ASCENDING",t[t.DESCENDING=-1]="DESCENDING"}(O||(O={}));const g=(i,s)=>{const o=t(S,h[3*i],h[3*i+1],h[3*i+2]),n=R;let u=i+s;do{t(n,h[3*u],h[3*u+1],h[3*u+2]),u+=s}while(e(o,n)&&u>=0&&u<c);a&&(r(o,o,a),r(n,n,a)),v(o,n,[-1,-1],i),v(o,n,[1,-1],i),v(o,n,[1,1],i),v(o,n,[-1,-1],i),v(o,n,[1,1],i),v(o,n,[-1,1],i)},I=this._parameters.placement;"begin"!==I&&"begin-end"!==I||g(0,O.ASCENDING),"end"!==I&&"begin-end"!==I||g(c-1,O.DESCENDING)}}const S=a(),R=a();export{A as LineMarkerMaterial,v as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{s as t,n as e,f as r,b as s,o,e as n}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import f from"../lib/GLMaterial.js";import{Material as p,MaterialParameters as l}from"../lib/Material.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{MeasurementArrowTechniqueConfiguration as d,MeasurementArrowTechnique as g}from"../shaders/MeasurementArrowTechnique.js";class O extends p{constructor(t){super(t,new
|
|
5
|
+
import{s as t,n as e,f as r,b as s,o,e as n}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import f from"../lib/GLMaterial.js";import{Material as p,MaterialParameters as l}from"../lib/Material.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{MeasurementArrowTechniqueConfiguration as d,MeasurementArrowTechnique as g}from"../shaders/MeasurementArrowTechnique.js";class O extends p{constructor(t){super(t,new b),this._configuration=new d}getConfiguration(t,e){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration}intersect(){}produces(t,e){if(e===u.Color||e===u.Alpha){return t===(this._transparent?h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:h.OPAQUE_MATERIAL)}return!1}createGLMaterial(t){return new A(t)}createBufferWriter(){return new y}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class A extends f{beginSlot(t){return this.ensureTechnique(g,t)}}class b extends l{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const T=c().vec3f(m.POSITION).vec3f(m.NORMAL).vec2f(m.UV0).f32(m.AUXPOS1),_=i(),v=i(),I=i(),L=i(),j=i();class y{constructor(){this.vertexBufferLayout=T}elementCount(t){return 2*(t.attributes.get(m.POSITION).indices.length/2+1)}write(i,a,c,u,f){const{data:p,indices:l}=c.attributes.get(m.POSITION),h=c.attributes.get(m.NORMAL).data,d=p.length/3;l&&l.length!==2*(d-1)&&console.warn("MeasurementArrowMaterial does not support indices");const g=_,O=v,A=I,b=L,T=j,y=u.position,E=u.normal,M=u.uv0;let S=0;for(let m=0;m<d;++m){const c=3*m;if(t(g,p[c],p[c+1],p[c+2]),m<d-1){const o=3*(m+1);t(O,p[o],p[o+1],p[o+2]),t(T,h[o],h[o+1],h[o+2]),e(T,T),r(A,O,g),e(A,A),s(b,T,A),e(b,b)}const u=o(g,O);i&&a&&(n(g,g,i),n(O,O,i),n(b,b,a));const l=f+2*m,_=l+1;y.setVec(l,g),y.setVec(_,g),E.setVec(l,b),E.setVec(_,b),M.set(l,0,S),M.set(l,1,-1),M.set(_,0,S),M.set(_,1,1),m<d-1&&(S+=u)}const w=u.auxpos1;for(let t=0;t<2*d;++t)w.set(f+t,S)}}export{O as MeasurementArrowMaterial,b as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{j as s}from"../../../../chunks/vec2.js";import{s as o,f as i,j as a,i as n,g as c,c as u,l,o as m}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{O as h}from"../../../../chunks/vec4f64.js";import{PlaneIndex as p}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as g,fromPoints as j,closestLineSegmentPoint as A}from"../../../../geometry/support/lineSegment.js";import{create as b,fromPoints as O,signedDistance as S,normal as _}from"../../../../geometry/support/plane.js";import{ShaderOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import R from"../lib/GLMaterial.js";import{Material as
|
|
5
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{j as s}from"../../../../chunks/vec2.js";import{s as o,f as i,j as a,i as n,g as c,c as u,l,o as m}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{O as h}from"../../../../chunks/vec4f64.js";import{PlaneIndex as p}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as g,fromPoints as j,closestLineSegmentPoint as A}from"../../../../geometry/support/lineSegment.js";import{create as b,fromPoints as O,signedDistance as S,normal as _}from"../../../../geometry/support/plane.js";import{ShaderOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import R from"../lib/GLMaterial.js";import{Material as y,MaterialParameters as E}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as T}from"../lib/Util.js";import{VertexAttribute as M}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as v}from"./DefaultBufferWriter.js";import{PositionColorLayout as x,PositionLayout as C}from"./DefaultLayouts.js";import{NativeLineTechnique as P}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as w}from"../shaders/NativeLineTechniqueConfiguration.js";class I extends y{constructor(e){super(e,new U),this._configuration=new w}getConfiguration(e){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration}intersect(t,r,f,h,d,b){if(!f.options.selectionMode||!t.visible)return;if(!T(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const L=t.attributes.get(M.POSITION).data,R=f.camera,y=Z;s(y,f.point);const E=2;o(z[0],y[0]-E,y[1]+E,0),o(z[1],y[0]+E,y[1]+E,0),o(z[2],y[0]+E,y[1]-E,0),o(z[3],y[0]-E,y[1]-E,0);for(let e=0;e<4;e++)if(!R.unprojectFromRenderScreen(z[e],J[e]))return;O(R.eye,J[0],J[1],K),O(R.eye,J[1],J[2],Y),O(R.eye,J[2],J[3],$),O(R.eye,J[3],J[0],ee);let N=Number.MAX_VALUE,v=0;for(let e=0;e<L.length-5;e+=3){if(D[0]=L[e]+r[12],D[1]=L[e+1]+r[13],D[2]=L[e+2]+r[14],k[0]=L[e+3]+r[12],k[1]=L[e+4]+r[13],k[2]=L[e+5]+r[14],S(K,D)<0&&S(K,k)<0||S(Y,D)<0&&S(Y,k)<0||S($,D)<0&&S($,k)<0||S(ee,D)<0&&S(ee,k)<0)continue;if(R.projectToRenderScreen(D,W),R.projectToRenderScreen(k,X),W[2]<0&&X[2]>0){i(q,D,k);const e=R.frustum,t=-S(e[p.NEAR],D)/a(q,_(e[p.NEAR]));n(q,q,t),c(D,D,q),R.projectToRenderScreen(D,W)}else if(W[2]>0&&X[2]<0){i(q,k,D);const e=R.frustum,t=-S(e[p.NEAR],k)/a(q,_(e[p.NEAR]));n(q,q,t),c(k,k,q),R.projectToRenderScreen(k,X)}else if(W[2]<0&&X[2]<0)continue;W[2]=0,X[2]=0;const t=g(j(W,X,H),y);t<N&&(N=t,u(G,D),u(F,k),v=e/3)}const x=f.rayBegin,C=f.rayEnd;if(N<E*E){let e=Number.MAX_VALUE;if(A(j(G,F,H),j(x,C,Q),B)){i(B,B,x);const t=l(B);n(B,B,1/t),e=t/m(x,C)}b(e,B,v,!1)}}intersectDraped(e,r,s,o,i,a){if(!s.options.selectionMode)return;const n=e.attributes.get(M.POSITION).data,c=e.attributes.get(M.SIZE),u=c?c.data[0]:0,l=o[0],m=o[1],f=((u+1)/2+4)*e.screenToWorldRatio;let h=Number.MAX_VALUE,p=0;for(let d=0;d<n.length-5;d+=3){const e=n[d],r=n[d+1],s=l-e,o=m-r,i=n[d+3]-e,a=n[d+4]-r,c=t((i*s+a*o)/(i*i+a*a),0,1),u=i*c-s,f=a*c-o,g=u*u+f*f;g<h&&(h=g,p=d/3)}h<f*f&&i(a.dist,a.normal,p,!1)}produces(e,t){return!(t!==L.Color&&t!==L.Highlight&&t!==L.ObjectAndLayerIdColor||e!==N.OPAQUE_MATERIAL&&e!==N.DRAPED_MATERIAL)}createGLMaterial(e){return new V(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?x:C;return new v(e)}}class V extends R{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output===L.Color&&this._updateOccludeeState(e),this.ensureTechnique(P,e)}}class U extends E{constructor(){super(...arguments),this.color=h,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1,this.hasOccludees=!1}}const D=f(),k=f(),q=f(),B=f(),W=r(),X=r(),G=f(),F=f(),H=d(),Q=d(),Z=f(),z=[r(),r(),r(),r()],J=[f(),f(),f(),f()],K=b(),Y=b(),$=b(),ee=b();export{I as NativeLineMaterial,U as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{f as t}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f as e,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as a}from"../lib/basicInterfaces.js";import o from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as n}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{assert as u}from"../lib/Util.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as c}from"./DefaultBufferWriter.js";import{Style as p}from"./PatternStyle.js";import{TriangleMaterial as f}from"./TriangleMaterial.js";import{VisualVariablePassParameters as m}from"./VisualVariablePassParameters.js";import{writeDefaultAttribute as d,writeBufferVec4 as g}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocations as _,PatternTechniqueConfiguration as A,PatternTechnique as T}from"../shaders/PatternTechnique.js";class b extends f{constructor(t){super(t,new P),this.supportsEdges=!0,this._vertexAttributeLocations=_,this._configuration=new A}getConfiguration(t,e){return this._configuration.output=t,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.style=this.parameters.style,this._configuration.patternSpacing=this.parameters.patternSpacing,this._configuration.lineWidth=this.parameters.lineWidth,this._configuration.draped=this.parameters.draped,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration.enableOffset=e.camera.relativeElevation<n,this._configuration.multipassEnabled=e.multipassEnabled,this._configuration.cullAboveGround=e.multipassTerrain.cullAboveGround,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}produces(t,e){if(e===s.Color||e===s.Alpha||e===s.Highlight||e===s.Depth&&this.parameters.writeLinearDepth){if(t===h.DRAPED_MATERIAL)return!0;if(e===s.Highlight)return t===h.OPAQUE_MATERIAL;return t===(this.parameters.writeDepth?h.TRANSPARENT_MATERIAL:h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return!1}createGLMaterial(t){return new E(t)}createBufferWriter(){const t=i().vec3f(l.POSITION).vec4f(l.UVMAPSPACE);return this.parameters.draped||t.mat3f(l.BOUNDINGRECT),this.parameters.vvColor?t.f32(l.COLORFEATUREATTRIBUTE):t.vec4u8(l.COLOR),new O(t)}}class E extends o{_updateParameters(t){return this.ensureTechnique(T,t)}_updateOccludeeState(t){t.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:t.hasOccludees})}beginSlot(t){return this._output!==s.Color&&this._output!==s.Alpha||this._updateOccludeeState(t),this._updateParameters(t)}}class O extends c{write(t,i,s,a,o){for(const n of this.vertexBufferLayout.fields.keys()){const h=s.
|
|
5
|
+
import{f as t}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f as e,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as a}from"../lib/basicInterfaces.js";import o from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as n}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{assert as u}from"../lib/Util.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as c}from"./DefaultBufferWriter.js";import{Style as p}from"./PatternStyle.js";import{TriangleMaterial as f}from"./TriangleMaterial.js";import{VisualVariablePassParameters as m}from"./VisualVariablePassParameters.js";import{writeDefaultAttribute as d,writeBufferVec4 as g}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocations as _,PatternTechniqueConfiguration as A,PatternTechnique as T}from"../shaders/PatternTechnique.js";class b extends f{constructor(t){super(t,new P),this.supportsEdges=!0,this._vertexAttributeLocations=_,this._configuration=new A}getConfiguration(t,e){return this._configuration.output=t,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.style=this.parameters.style,this._configuration.patternSpacing=this.parameters.patternSpacing,this._configuration.lineWidth=this.parameters.lineWidth,this._configuration.draped=this.parameters.draped,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration.enableOffset=e.camera.relativeElevation<n,this._configuration.multipassEnabled=e.multipassEnabled,this._configuration.cullAboveGround=e.multipassTerrain.cullAboveGround,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}produces(t,e){if(e===s.Color||e===s.Alpha||e===s.Highlight||e===s.Depth&&this.parameters.writeLinearDepth){if(t===h.DRAPED_MATERIAL)return!0;if(e===s.Highlight)return t===h.OPAQUE_MATERIAL;return t===(this.parameters.writeDepth?h.TRANSPARENT_MATERIAL:h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return!1}createGLMaterial(t){return new E(t)}createBufferWriter(){const t=i().vec3f(l.POSITION).vec4f(l.UVMAPSPACE);return this.parameters.draped||t.mat3f(l.BOUNDINGRECT),this.parameters.vvColor?t.f32(l.COLORFEATUREATTRIBUTE):t.vec4u8(l.COLOR),new O(t)}}class E extends o{_updateParameters(t){return this.ensureTechnique(T,t)}_updateOccludeeState(t){t.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:t.hasOccludees})}beginSlot(t){return this._output!==s.Color&&this._output!==s.Alpha||this._updateOccludeeState(t),this._updateParameters(t)}}class O extends c{write(t,i,s,a,o){for(const n of this.vertexBufferLayout.fields.keys()){const h=s.attributes.get(n),c=h?.indices;if(h&&c)switch(n){case l.UVMAPSPACE:{u(4===h.size);const t=a.getField(n,r);t&&g(h,t,o);break}case l.BOUNDINGRECT:{u(9===h.size);const r=a.getField(n,e);r&&this.writeBoundingRect(h,t,r,o);break}default:d(n,h,t,i,a,o)}}}writeBoundingRect(t,e,r,i){const{data:s,indices:a}=t,o=e,n=r.typedBuffer,h=r.typedBufferStride,u=a.length;i*=h;for(let l=0;l<u;++l){const t=9*a[l],e=s[t],r=s[t+1],u=s[t+2];n[i]=o[0]*e+o[4]*r+o[8]*u+o[12],n[i+1]=o[1]*e+o[5]*r+o[9]*u+o[13],n[i+2]=o[2]*e+o[6]*r+o[10]*u+o[14];for(let a=3;a<9;++a)n[i+a]=s[t+a];i+=h}}}class P extends m{constructor(){super(...arguments),this.color=t(1,1,1,1),this.writeDepth=!0,this.writeLinearDepth=!1,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=a.None,this.hasOccludees=!1,this.style=p.Cross,this.patternSpacing=10,this.lineWidth=1,this.draped=!0}}export{P as Parameters,b as PatternMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{j as s}from"../../../../chunks/vec2.js";import{s as i,f as a,j as n,i as o,g as l,c as u,l as c,o as h,e as p}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{O as m}from"../../../../chunks/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as A,fromPoints as _,closestLineSegmentPoint as E}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as I,signedDistance as g,normal as S}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as O}from"../core/shaderLibrary/ShaderOutput.js";import b from"../lib/GLMaterial.js";import{Material as P,RenderOccludedFlag as L}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as C}from"../lib/Util.js";import{VertexAttribute as y}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as j}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as U}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as x}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as D,RibbonLineTechnique as F}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as w,CapType as B}from"../shaders/RibbonLineTechniqueConfiguration.js";var J;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(J||(J={}));class M extends P{constructor(e){super(e,new z),this._configuration=new w,this._vertexAttributeLocations=D}isClosed(e,t){return V(this.parameters,e,t)}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===N.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==O.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&W(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===L.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,s,i,a,n){if(!s.options.selectionMode)return;const o=e.vertexAttributes.get(y.POSITION).data,l=e.vertexAttributes.get(y.SIZE);let u=this.parameters.width;if(this.parameters.vvSize){const r=e.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0];u*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(u*=l.data[0]);const c=i[0],h=i[1],p=(u/2+4)*e.screenToWorldRatio;let f=Number.MAX_VALUE,m=0;for(let T=0;T<o.length-5;T+=3){const e=o[T],r=o[T+1],s=c-e,i=h-r,a=o[T+3]-e,n=o[T+4]-r,l=t((a*s+n*i)/(a*a+n*n),0,1),u=a*l-s,p=n*l-i,d=u*u+p*p;d<f&&(f=d,m=T/3)}f<p*p&&a(n.dist,n.normal,m,!1)}intersect(r,p,f,m,d,R){if(!f.options.selectionMode||!r.visible)return;if(!C(p))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const v=r.vertexAttributes,O=v.get(y.POSITION).data;let b=this.parameters.width;if(this.parameters.vvSize){const e=v.get(y.SIZEFEATUREATTRIBUTE).data[0];b*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else v.has(y.SIZE)&&(b*=v.get(y.SIZE).data[0]);const P=f.camera,L=K;s(L,f.point);const N=b*P.pixelRatio/2+4*P.pixelRatio;i(le[0],L[0]-N,L[1]+N,0),i(le[1],L[0]+N,L[1]+N,0),i(le[2],L[0]+N,L[1]-N,0),i(le[3],L[0]-N,L[1]-N,0);for(let e=0;e<4;e++)if(!P.unprojectFromRenderScreen(le[e],ue[e]))return;I(P.eye,ue[0],ue[1],ce),I(P.eye,ue[1],ue[2],he),I(P.eye,ue[2],ue[3],pe),I(P.eye,ue[3],ue[0],fe);let j=Number.MAX_VALUE,U=0;const x=Z(this.parameters,v,r.indices)?O.length-2:O.length-5;for(let e=0;e<x;e+=3){Y[0]=O[e]+p[12],Y[1]=O[e+1]+p[13],Y[2]=O[e+2]+p[14];const t=(e+3)%O.length;if(X[0]=O[t]+p[12],X[1]=O[t+1]+p[13],X[2]=O[t+2]+p[14],g(ce,Y)<0&&g(ce,X)<0||g(he,Y)<0&&g(he,X)<0||g(pe,Y)<0&&g(pe,X)<0||g(fe,Y)<0&&g(fe,X)<0)continue;if(P.projectToRenderScreen(Y,$),P.projectToRenderScreen(X,ee),$[2]<0&&ee[2]>0){a(q,Y,X);const e=P.frustum,t=-g(e[T.NEAR],Y)/n(q,S(e[T.NEAR]));o(q,q,t),l(Y,Y,q),P.projectToRenderScreen(Y,$)}else if($[2]>0&&ee[2]<0){a(q,X,Y);const e=P.frustum,t=-g(e[T.NEAR],X)/n(q,S(e[T.NEAR]));o(q,q,t),l(X,X,q),P.projectToRenderScreen(X,ee)}else if($[2]<0&&ee[2]<0)continue;$[2]=0,ee[2]=0;const r=A(_($,ee,se),L);r<j&&(j=r,u(te,Y),u(re,X),U=e/3)}const D=f.rayBegin,F=f.rayEnd;if(j<N*N){let e=Number.MAX_VALUE;if(E(_(te,re,se),_(D,F,ie),Q)){a(Q,Q,D);const t=c(Q);o(Q,Q,1/t),e=t/h(D,F)}R(e,Q,U,!1)}}get _layout(){const e=v().vec3f(y.POSITION).f32(y.SUBDIVISIONFACTOR).vec2f(y.UV0).vec3f(y.AUXPOS1).vec3f(y.AUXPOS2);return this.parameters.vvSize?e.f32(y.SIZEFEATUREATTRIBUTE):e.f32(y.SIZE),this.parameters.vvColor?e.f32(y.COLORFEATUREATTRIBUTE):e.vec4f(y.COLOR),this.parameters.vvOpacity&&e.f32(y.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(y.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new H(this._layout,this.parameters)}produces(e,t){if(t===O.Color||t===O.Alpha||t===O.Highlight||t===O.Depth||t===O.ObjectAndLayerIdColor){if(e===N.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===L.OccludeAndTransparentStencil)return e===N.OPAQUE_MATERIAL||e===N.OCCLUDER_MATERIAL||e===N.TRANSPARENT_OCCLUDER_MATERIAL;if(t===O.Color||t===O.Alpha){return e===(this.parameters.writeDepth?N.TRANSPARENT_MATERIAL:N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===N.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new G(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class G extends b{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==O.Color&&this._output!==O.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextureRepository.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.ensureTechnique(F,e)}}class z extends j{constructor(){super(...arguments),this.width=0,this.color=m,this.join="miter",this.cap=B.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,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.hasOccludees=!1,this.wireframe=!1}}class H{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t,this.numJoinSubdivisions=0;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=x+r}}_isClosed(e){return Z(this._parameters,e.vertexAttributes,e.indices)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.indices.get(y.POSITION).length/2+1,s=this._isClosed(e);let i=s?2:2*t;return i+=((s?r:r-1)-(s?0:1))*(2*this.numJoinSubdivisions+4),i+=2,this._parameters.wireframe&&(i=2+4*(i-2)),i}write(e,t,r,s,a){const n=ae,o=ne,l=oe,c=r.vertexAttributes.get(y.POSITION).data,f=r.indices&&r.indices.get(y.POSITION),m=r.vertexAttributes.get(y.DISTANCETOSTART)?.data;f&&f.length!==2*(c.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let T=1,d=0;const A=this.vertexBufferLayout.fields.has(y.SIZEFEATUREATTRIBUTE);A?d=r.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.SIZE)&&(T=r.vertexAttributes.get(y.SIZE).data[0]);let _=[1,1,1,1],E=0;const R=this.vertexBufferLayout.fields.has(y.COLORFEATUREATTRIBUTE);R?E=r.vertexAttributes.get(y.COLORFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.COLOR)&&(_=r.vertexAttributes.get(y.COLOR).data);const I=has("enable-feature:objectAndLayerId-rendering")?r.objectAndLayerIdColor:null;let g=0;const S=this.vertexBufferLayout.fields.has(y.OPACITYFEATUREATTRIBUTE);S&&(g=r.vertexAttributes.get(y.OPACITYFEATUREATTRIBUTE).data[0]);const v=c.length/3,O=new Float32Array(s.buffer),b=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(s.buffer):null,P=this.vertexBufferLayout.stride/4;let L=a*P;const N=L;let C=0;const j=m?(e,t,r)=>C=m[r]:(e,t,r)=>C+=h(e,t),U=has("enable-feature:objectAndLayerId-rendering"),x=(e,t,r,s,i,a,n)=>{if(O[L++]=t[0],O[L++]=t[1],O[L++]=t[2],O[L++]=s,O[L++]=n,O[L++]=i,O[L++]=e[0],O[L++]=e[1],O[L++]=e[2],O[L++]=r[0],O[L++]=r[1],O[L++]=r[2],O[L++]=A?d:T,R)O[L++]=E;else{const e=Math.min(4*a,_.length-4);O[L++]=_[e],O[L++]=_[e+1],O[L++]=_[e+2],O[L++]=_[e+3]}S&&(O[L++]=g),U&&(null!=I&&(b[4*L]=I[0],b[4*L+1]=I[1],b[4*L+2]=I[2],b[4*L+3]=I[3]),L++)};L+=P,i(o,c[0],c[1],c[2]),e&&p(o,o,e);const D=this._isClosed(r);if(D){const t=c.length-3;i(n,c[t],c[t+1],c[t+2]),e&&p(n,n,e)}else i(l,c[3],c[4],c[5]),e&&p(l,l,e),x(o,o,l,1,J.LEFT_CAP_START,0,0),x(o,o,l,1,J.RIGHT_CAP_START,0,0),u(n,o),u(o,l);const F=D?0:1,w=D?v:v-1;for(let h=F;h<w;h++){const t=(h+1)%v*3;i(l,c[t],c[t+1],c[t+2]),e&&p(l,l,e),j(n,o,h),x(n,o,l,0,J.LEFT_JOIN_END,h,C),x(n,o,l,0,J.RIGHT_JOIN_END,h,C);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);x(n,o,l,t,J.LEFT_JOIN_END,h,C),x(n,o,l,t,J.RIGHT_JOIN_END,h,C)}x(n,o,l,1,J.LEFT_JOIN_START,h,C),x(n,o,l,1,J.RIGHT_JOIN_START,h,C),u(n,o),u(o,l)}D?(i(l,c[3],c[4],c[5]),e&&p(l,l,e),C=j(n,o,w),x(n,o,l,0,J.LEFT_JOIN_END,F,C),x(n,o,l,0,J.RIGHT_JOIN_END,F,C)):(C=j(n,o,w),x(n,o,o,0,J.LEFT_CAP_END,w,C),x(n,o,o,0,J.RIGHT_CAP_END,w,C)),k(O,N+P,O,N,P);L=k(O,L-P,O,L,P),this._parameters.wireframe&&this._addWireframeVertices(s,N,L,P)}_addWireframeVertices(e,t,r,s){const i=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=k(a,e,i,n,s);for(let l=0;l<a.length-1;l+=2*s)o(l),o(l+2*s),o(l+1*s),o(l+2*s),o(l+1*s),o(l+3*s)}}function k(e,t,r,s,i){for(let a=0;a<i;a++)r[s++]=e[t++];return s}function Z(e,t,r){return V(e,t.get(y.POSITION).data,r?r.get(y.POSITION):null)}function V(e,t,r){return!!e.isClosed&&(r?r.length>2:t.length>6)}function W(e){return e.anchor===U.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const Y=f(),X=f(),q=f(),Q=f(),K=f(),$=r(),ee=r(),te=f(),re=f(),se=d(),ie=d(),ae=f(),ne=f(),oe=f(),le=[r(),r(),r(),r()],ue=[f(),f(),f(),f()],ce=R(),he=R(),pe=R(),fe=R();export{z as Parameters,M as RibbonLineMaterial};
|
|
5
|
+
import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{j as s}from"../../../../chunks/vec2.js";import{s as i,f as a,j as n,i as o,g as l,c as u,l as c,o as h,e as p}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{O as m}from"../../../../chunks/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as _,fromPoints as E,closestLineSegmentPoint as A}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as I,signedDistance as S,normal as g}from"../../../../geometry/support/plane.js";import{newLayout as O}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as b}from"../core/shaderLibrary/ShaderOutput.js";import v from"../lib/GLMaterial.js";import{Material as L,RenderOccludedFlag as P}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as C}from"../lib/Util.js";import{VertexAttribute as y}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as j}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as U}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as D}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as F,RibbonLineTechnique as w}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as B,CapType as J}from"../shaders/RibbonLineTechniqueConfiguration.js";var M;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(M||(M={}));class x extends L{constructor(e){super(e,new z),this._configuration=new B,this._vertexAttributeLocations=F}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===N.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==b.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&V(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===P.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,s,i,a,n){if(!s.options.selectionMode)return;const o=e.attributes.get(y.POSITION).data,l=e.attributes.get(y.SIZE);let u=this.parameters.width;if(this.parameters.vvSize){const r=e.attributes.get(y.SIZEFEATUREATTRIBUTE).data[0];u*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(u*=l.data[0]);const c=i[0],h=i[1],p=(u/2+4)*e.screenToWorldRatio;let f=Number.MAX_VALUE,m=0;for(let T=0;T<o.length-5;T+=3){const e=o[T],r=o[T+1],s=c-e,i=h-r,a=o[T+3]-e,n=o[T+4]-r,l=t((a*s+n*i)/(a*a+n*n),0,1),u=a*l-s,p=n*l-i,d=u*u+p*p;d<f&&(f=d,m=T/3)}f<p*p&&a(n.dist,n.normal,m,!1)}intersect(r,p,f,m,d,R){if(!f.options.selectionMode||!r.visible)return;if(!C(p))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const O=r.attributes,b=O.get(y.POSITION).data;let v=this.parameters.width;if(this.parameters.vvSize){const e=O.get(y.SIZEFEATUREATTRIBUTE).data[0];v*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else O.has(y.SIZE)&&(v*=O.get(y.SIZE).data[0]);const L=f.camera,P=Q;s(P,f.point);const N=v*L.pixelRatio/2+4*L.pixelRatio;i(oe[0],P[0]-N,P[1]+N,0),i(oe[1],P[0]+N,P[1]+N,0),i(oe[2],P[0]+N,P[1]-N,0),i(oe[3],P[0]-N,P[1]-N,0);for(let e=0;e<4;e++)if(!L.unprojectFromRenderScreen(oe[e],le[e]))return;I(L.eye,le[0],le[1],ue),I(L.eye,le[1],le[2],ce),I(L.eye,le[2],le[3],he),I(L.eye,le[3],le[0],pe);let j=Number.MAX_VALUE,U=0;const D=Z(this.parameters,O)?b.length-2:b.length-5;for(let e=0;e<D;e+=3){W[0]=b[e]+p[12],W[1]=b[e+1]+p[13],W[2]=b[e+2]+p[14];const t=(e+3)%b.length;if(Y[0]=b[t]+p[12],Y[1]=b[t+1]+p[13],Y[2]=b[t+2]+p[14],S(ue,W)<0&&S(ue,Y)<0||S(ce,W)<0&&S(ce,Y)<0||S(he,W)<0&&S(he,Y)<0||S(pe,W)<0&&S(pe,Y)<0)continue;if(L.projectToRenderScreen(W,K),L.projectToRenderScreen(Y,$),K[2]<0&&$[2]>0){a(X,W,Y);const e=L.frustum,t=-S(e[T.NEAR],W)/n(X,g(e[T.NEAR]));o(X,X,t),l(W,W,X),L.projectToRenderScreen(W,K)}else if(K[2]>0&&$[2]<0){a(X,Y,W);const e=L.frustum,t=-S(e[T.NEAR],Y)/n(X,g(e[T.NEAR]));o(X,X,t),l(Y,Y,X),L.projectToRenderScreen(Y,$)}else if(K[2]<0&&$[2]<0)continue;K[2]=0,$[2]=0;const r=_(E(K,$,re),P);r<j&&(j=r,u(ee,W),u(te,Y),U=e/3)}const F=f.rayBegin,w=f.rayEnd;if(j<N*N){let e=Number.MAX_VALUE;if(A(E(ee,te,re),E(F,w,se),q)){a(q,q,F);const t=c(q);o(q,q,1/t),e=t/h(F,w)}R(e,q,U,!1)}}get _layout(){const e=O().vec3f(y.POSITION).f32(y.SUBDIVISIONFACTOR).vec2f(y.UV0).vec3f(y.AUXPOS1).vec3f(y.AUXPOS2);return this.parameters.vvSize?e.f32(y.SIZEFEATUREATTRIBUTE):e.f32(y.SIZE),this.parameters.vvColor?e.f32(y.COLORFEATUREATTRIBUTE):e.vec4f(y.COLOR),this.parameters.vvOpacity&&e.f32(y.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(y.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new H(this._layout,this.parameters)}produces(e,t){if(t===b.Color||t===b.Alpha||t===b.Highlight||t===b.Depth||t===b.ObjectAndLayerIdColor){if(e===N.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===P.OccludeAndTransparentStencil)return e===N.OPAQUE_MATERIAL||e===N.OCCLUDER_MATERIAL||e===N.TRANSPARENT_OCCLUDER_MATERIAL;if(t===b.Color||t===b.Alpha){return e===(this.parameters.writeDepth?N.TRANSPARENT_MATERIAL:N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===N.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new G(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class G extends v{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==b.Color&&this._output!==b.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextureRepository.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.ensureTechnique(w,e)}}class z extends j{constructor(){super(...arguments),this.width=0,this.color=m,this.join="miter",this.cap=J.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,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.hasOccludees=!1,this.wireframe=!1}}class H{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t,this.numJoinSubdivisions=0;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=D+r}}_isClosed(e){return Z(this._parameters,e.attributes)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.attributes.get(y.POSITION).indices.length/2+1,s=this._isClosed(e);let i=s?2:2*t;return i+=((s?r:r-1)-(s?0:1))*(2*this.numJoinSubdivisions+4),i+=2,this._parameters.wireframe&&(i=2+4*(i-2)),i}write(e,t,r,s,a){const n=ie,o=ae,l=ne,c=r.attributes.get(y.POSITION),f=c.indices,m=c.data.length/3,T=r.attributes.get(y.DISTANCETOSTART)?.data;f&&f.length!==2*(m-1)&&console.warn("RibbonLineMaterial does not support indices");let d=1,_=0;const E=this.vertexBufferLayout.fields.has(y.SIZEFEATUREATTRIBUTE);E?_=r.attributes.get(y.SIZEFEATUREATTRIBUTE).data[0]:r.attributes.has(y.SIZE)&&(d=r.attributes.get(y.SIZE).data[0]);let A=[1,1,1,1],R=0;const I=this.vertexBufferLayout.fields.has(y.COLORFEATUREATTRIBUTE);I?R=r.attributes.get(y.COLORFEATUREATTRIBUTE).data[0]:r.attributes.has(y.COLOR)&&(A=r.attributes.get(y.COLOR).data);const S=has("enable-feature:objectAndLayerId-rendering")?r.objectAndLayerIdColor:null;let g=0;const O=this.vertexBufferLayout.fields.has(y.OPACITYFEATUREATTRIBUTE);O&&(g=r.attributes.get(y.OPACITYFEATUREATTRIBUTE).data[0]);const b=new Float32Array(s.buffer),v=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(s.buffer):null,L=this.vertexBufferLayout.stride/4;let P=a*L;const N=P;let C=0;const j=T?(e,t,r)=>C=T[r]:(e,t,r)=>C+=h(e,t),U=has("enable-feature:objectAndLayerId-rendering"),D=(e,t,r,s,i,a,n)=>{if(b[P++]=t[0],b[P++]=t[1],b[P++]=t[2],b[P++]=s,b[P++]=n,b[P++]=i,b[P++]=e[0],b[P++]=e[1],b[P++]=e[2],b[P++]=r[0],b[P++]=r[1],b[P++]=r[2],b[P++]=E?_:d,I)b[P++]=R;else{const e=Math.min(4*a,A.length-4);b[P++]=A[e],b[P++]=A[e+1],b[P++]=A[e+2],b[P++]=A[e+3]}O&&(b[P++]=g),U&&(null!=S&&(v[4*P]=S[0],v[4*P+1]=S[1],v[4*P+2]=S[2],v[4*P+3]=S[3]),P++)};P+=L,i(o,c.data[0],c.data[1],c.data[2]),e&&p(o,o,e);const F=this._isClosed(r);if(F){const t=c.data.length-3;i(n,c.data[t],c.data[t+1],c.data[t+2]),e&&p(n,n,e)}else i(l,c.data[3],c.data[4],c.data[5]),e&&p(l,l,e),D(o,o,l,1,M.LEFT_CAP_START,0,0),D(o,o,l,1,M.RIGHT_CAP_START,0,0),u(n,o),u(o,l);const w=F?0:1,B=F?m:m-1;for(let h=w;h<B;h++){const t=(h+1)%m*3;i(l,c.data[t],c.data[t+1],c.data[t+2]),e&&p(l,l,e),j(n,o,h),D(n,o,l,0,M.LEFT_JOIN_END,h,C),D(n,o,l,0,M.RIGHT_JOIN_END,h,C);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);D(n,o,l,t,M.LEFT_JOIN_END,h,C),D(n,o,l,t,M.RIGHT_JOIN_END,h,C)}D(n,o,l,1,M.LEFT_JOIN_START,h,C),D(n,o,l,1,M.RIGHT_JOIN_START,h,C),u(n,o),u(o,l)}F?(i(l,c.data[3],c.data[4],c.data[5]),e&&p(l,l,e),C=j(n,o,B),D(n,o,l,0,M.LEFT_JOIN_END,w,C),D(n,o,l,0,M.RIGHT_JOIN_END,w,C)):(C=j(n,o,B),D(n,o,o,0,M.LEFT_CAP_END,B,C),D(n,o,o,0,M.RIGHT_CAP_END,B,C)),k(b,N+L,b,N,L);P=k(b,P-L,b,P,L),this._parameters.wireframe&&this._addWireframeVertices(s,N,P,L)}_addWireframeVertices(e,t,r,s){const i=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=k(a,e,i,n,s);for(let l=0;l<a.length-1;l+=2*s)o(l),o(l+2*s),o(l+1*s),o(l+2*s),o(l+1*s),o(l+3*s)}}function k(e,t,r,s,i){for(let a=0;a<i;a++)r[s++]=e[t++];return s}function Z(e,t){if(!e.isClosed)return!1;return t.get(y.POSITION).indices.length>2}function V(e){return e.anchor===U.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const W=f(),Y=f(),X=f(),q=f(),Q=f(),K=r(),$=r(),ee=f(),te=f(),re=d(),se=d(),ie=f(),ae=f(),ne=f(),oe=[r(),r(),r(),r()],le=[f(),f(),f(),f()],ue=R(),ce=R(),he=R(),pe=R();export{z as Parameters,x as RibbonLineMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{n as e,s as t,i as r,g as i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{center as n,scale as o}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as h}from"../lib/basicInterfaces.js";import p from"../lib/GLMaterial.js";import{Material as f,MaterialParameters as m}from"../lib/Material.js";import{RenderSlot as d}from"../lib/RenderSlot.js";import{assert as b}from"../lib/Util.js";import{VertexAttribute as
|
|
5
|
+
import{n as e,s as t,i as r,g as i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{center as n,scale as o}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as h}from"../lib/basicInterfaces.js";import p from"../lib/GLMaterial.js";import{Material as f,MaterialParameters as m}from"../lib/Material.js";import{RenderSlot as d}from"../lib/RenderSlot.js";import{assert as b}from"../lib/Util.js";import{VertexAttribute as S}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as E,writePosition as g}from"./internal/bufferWriterUtils.js";import{intersectTriangleGeometry as T}from"./internal/MaterialUtil.js";import{ShadedColorMaterialTechniqueConfiguration as A,vertexAttributeLocations as _,ShadedColorMaterialTechnique as F}from"../shaders/ShadedColorMaterialTechnique.js";class j extends f{constructor(e){super(e,new v),this.supportsEdges=!0,this._configuration=new A,this._vertexAttributeLocations=_}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this._isTransparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,s,a,c,l,u){if(this.parameters.screenSizeEnabled){const s=e.attributes.get(S.OFFSET),h={applyToVertex:(e,n,o,c)=>{const l=t(z,s.data[3*c],s.data[3*c+1],s.data[3*c+2]),u=t(L,e,n,o);return r(l,l,this.parameters.screenSizeScale*a.camera.computeScreenPixelSizeAt(l)),i(u,u,l),[u[0],u[1],u[2]]},applyToAabb:e=>{const t=n(e,z);return o(e,this.parameters.screenSizeScale*a.camera.computeScreenPixelSizeAt(t))}};T(e,a,c,l,h,u)}else T(e,a,c,l,void 0,u)}produces(e,t){if(t===u.Highlight)return e===d.OPAQUE_MATERIAL;if(t===u.Color||t===u.Alpha||t===u.ObjectAndLayerIdColor){let t=d.OPAQUE_MATERIAL;return this._isTransparent&&(t=this.parameters.writeDepth?d.TRANSPARENT_MATERIAL:d.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===t||e===d.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new O(e)}createBufferWriter(){return new w(this.parameters.screenSizeEnabled)}get _isTransparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}}class O extends p{beginSlot(e){return this.ensureTechnique(F,e)}}class v extends m{constructor(){super(...arguments),this.color=a(1,1,1,1),this.shadingTint=a(0,0,0,.25),this.shadingDirection=e(s(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=h.None,this.screenSizeEnabled=!1,this.shadingEnabled=!0}}class w{constructor(e){this.screenSizeEnabled=e;const t=l().vec3f(S.POSITION).vec3f(S.NORMAL);this.screenSizeEnabled&&t.vec3f(S.OFFSET),this.vertexBufferLayout=t}elementCount(e){return e.attributes.get(S.POSITION).indices.length}write(e,t,r,i,s){if(E(r,this.vertexBufferLayout,e,t,i,s),this.screenSizeEnabled){if(!r.attributes.has(S.OFFSET))throw new Error(`${S.OFFSET} vertex attribute required for screenSizeEnabled ShadedColorMaterial`);{const e=r.attributes.get(S.OFFSET);b(3===e.size);const a=i.getField(S.OFFSET,c);if(!a)throw new Error("unable to acquire view for "+S.OFFSET);g(e,t,a,s)}}}}const z=s(),L=s();export{j as ShadedColorMaterial,v as ShadedColorMaterialParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{update as t}from"../../../../../core/arrayUtils.js";import{clamp as n}from"../../../../../core/mathUtils.js";import{s as e,b as o,n as i}from"../../../../../chunks/vec3.js";import{c as r}from"../../../../../chunks/vec3f64.js";import{create as s,setMin as c,setMax as l}from"../../../../../geometry/support/aaBoundingBox.js";import{ContentObjectType as f}from"../../lib/ContentObjectType.js";import{scale as u}from"../../lib/screenSizePerspectiveUtils.js";import{assert as a}from"../../lib/Util.js";import{VertexAttribute as m}from"../../lib/VertexAttribute.js";const p=s();function h(t,n,e,o,i,r){if(t.visible)if(t.boundingInfo){a(t.type===f.Mesh);const s=n.tolerance;
|
|
5
|
+
import{update as t}from"../../../../../core/arrayUtils.js";import{clamp as n}from"../../../../../core/mathUtils.js";import{s as e,b as o,n as i}from"../../../../../chunks/vec3.js";import{c as r}from"../../../../../chunks/vec3f64.js";import{create as s,setMin as c,setMax as l}from"../../../../../geometry/support/aaBoundingBox.js";import{ContentObjectType as f}from"../../lib/ContentObjectType.js";import{scale as u}from"../../lib/screenSizePerspectiveUtils.js";import{assert as a}from"../../lib/Util.js";import{VertexAttribute as m}from"../../lib/VertexAttribute.js";const p=s();function h(t,n,e,o,i,r){if(t.visible)if(t.boundingInfo){a(t.type===f.Mesh);const s=n.tolerance;d(t.boundingInfo,e,o,s,i,r)}else{const n=t.attributes.get(m.POSITION),s=n.indices;M(e,o,0,s.length/3,s,n,void 0,i,r)}}const b=r();function d(t,n,e,o,i,r){if(null==t)return;const s=T(n,e,b);if(c(p,t.bbMin),l(p,t.bbMax),null!=i&&i.applyToAabb(p),I(p,n,s,o)){const{primitiveIndices:s,position:c}=t,l=s?s.length:c.indices.length/3;if(l>P){const s=t.getChildren();if(void 0!==s){for(const t of s)d(t,n,e,o,i,r);return}}M(n,e,0,l,c.indices,c,s,i,r)}}const x=r();function M(t,n,e,o,i,r,s,c,l){if(s)return g(t,n,e,o,i,r,s,c,l);const{data:f,stride:u}=r,a=t[0],m=t[1],p=t[2],h=n[0]-a,b=n[1]-m,d=n[2]-p;for(let M=e,g=3*e;M<o;++M){let t=u*i[g++],n=f[t++],e=f[t++],o=f[t];t=u*i[g++];let r=f[t++],s=f[t++],y=f[t];t=u*i[g++];let j=f[t++],T=f[t++],I=f[t];null!=c&&([n,e,o]=c.applyToVertex(n,e,o,M),[r,s,y]=c.applyToVertex(r,s,y,M),[j,T,I]=c.applyToVertex(j,T,I,M));const V=r-n,L=s-e,N=y-o,O=j-n,A=T-e,E=I-o,P=b*E-A*d,S=d*O-E*h,U=h*A-O*b,W=V*P+L*S+N*U;if(Math.abs(W)<=Number.EPSILON)continue;const k=a-n,B=m-e,C=p-o,z=k*P+B*S+C*U;if(W>0){if(z<0||z>W)continue}else if(z>0||z<W)continue;const H=B*N-L*C,R=C*V-N*k,Y=k*L-V*B,q=h*H+b*R+d*Y;if(W>0){if(q<0||z+q>W)continue}else if(q>0||z+q<W)continue;const w=(O*H+A*R+E*Y)/W;if(w>=0){l(w,v(V,L,N,O,A,E,x),M,!1)}}}function g(t,n,e,o,i,r,s,c,l){const{data:f,stride:u}=r,a=t[0],m=t[1],p=t[2],h=n[0]-a,b=n[1]-m,d=n[2]-p;for(let M=e;M<o;++M){const t=s[M];let n=3*t,e=u*i[n++],o=f[e++],r=f[e++],g=f[e];e=u*i[n++];let y=f[e++],j=f[e++],T=f[e];e=u*i[n];let I=f[e++],V=f[e++],L=f[e];null!=c&&([o,r,g]=c.applyToVertex(o,r,g,M),[y,j,T]=c.applyToVertex(y,j,T,M),[I,V,L]=c.applyToVertex(I,V,L,M));const N=y-o,O=j-r,A=T-g,E=I-o,P=V-r,S=L-g,U=b*S-P*d,W=d*E-S*h,k=h*P-E*b,B=N*U+O*W+A*k;if(Math.abs(B)<=Number.EPSILON)continue;const C=a-o,z=m-r,H=p-g,R=C*U+z*W+H*k;if(B>0){if(R<0||R>B)continue}else if(R>0||R<B)continue;const Y=z*A-O*H,q=H*N-A*C,w=C*O-N*z,D=h*Y+b*q+d*w;if(B>0){if(D<0||R+D>B)continue}else if(D>0||R+D<B)continue;const F=(E*Y+P*q+S*w)/B;if(F>=0){l(F,v(N,O,A,E,P,S,x),t,!1)}}}const y=r(),j=r();function v(t,n,r,s,c,l,f){return e(y,t,n,r),e(j,s,c,l),o(f,y,j),i(f,f),f}function T(t,n,o){return e(o,1/(n[0]-t[0]),1/(n[1]-t[1]),1/(n[2]-t[2]))}function I(t,n,e,o){return V(t,n,e,o,1/0)}function V(t,n,e,o,i){const r=(t[0]-o-n[0])*e[0],s=(t[3]+o-n[0])*e[0];let c=Math.min(r,s),l=Math.max(r,s);const f=(t[1]-o-n[1])*e[1],u=(t[4]+o-n[1])*e[1];if(l=Math.min(l,Math.max(f,u)),l<0)return!1;if(c=Math.max(c,Math.min(f,u)),c>l)return!1;const a=(t[2]-o-n[2])*e[2],m=(t[5]+o-n[2])*e[2];return l=Math.min(l,Math.max(a,m)),!(l<0)&&(c=Math.max(c,Math.min(a,m)),!(c>l)&&c<i)}function L(t,e,o,i,r){let s=(o.screenLength||0)*t.pixelRatio;null!=r&&(s=u(s,i,e,r));const c=s*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return n(c*e,o.minWorldLength||0,null!=o.maxWorldLength?o.maxWorldLength:1/0)}function N(t,n){const e=n?N(n):{};for(const o in t){let n=t[o];n&&n.forEach&&(n=A(n)),null==n&&o in e||(e[o]=n)}return e}function O(n,e){let o=!1;for(const i in e){const r=e[i];void 0!==r&&(Array.isArray(r)?null===n[i]?(n[i]=r.slice(),o=!0):t(n[i],r)&&(o=!0):n[i]!==r&&(o=!0,n[i]=r))}return o}function A(t){const n=[];return t.forEach((t=>n.push(t))),n}const E={multiply:1,ignore:2,replace:3,tint:4},P=1e3;export{E as colorMixModes,T as computeInvDir,v as computeNormal,N as copyParameters,I as intersectAabbInvDir,V as intersectAabbInvDirBefore,h as intersectTriangleGeometry,M as intersectTriangles,O as updateParameters,L as verticalOffsetAtDistance};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{y as e,z as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4u8 as f,BufferViewVec4f as o,BufferViewFloat as r,BufferViewVec2f as
|
|
5
|
+
import{y as e,z as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4u8 as f,BufferViewVec4f as o,BufferViewFloat as r,BufferViewVec2f as i,BufferViewVec2i16 as s,BufferViewVec3f as n}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as c}from"../../lib/Util.js";import{VertexAttribute as l}from"../../lib/VertexAttribute.js";function d(e,t,f,o=1){const{data:r,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===o)for(let l=0;l<c;++l)s[f]=r[i[l]],f+=n;else for(let l=0;l<c;++l){const e=r[i[l]];for(let t=0;t<o;t++)s[f]=e,f+=n}}function u(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,s=t.typedBufferStride,n=r.length;f*=s;for(let c=0;c<n;++c){const e=2*r[c];i[f]=o[e],i[f+1]=o[e+1],f+=s}}function a(e,t,f,o){const{data:r,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,null==o||1===o)for(let l=0;l<c;++l){const e=3*i[l];s[f]=r[e],s[f+1]=r[e+1],s[f+2]=r[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<o;++t)s[f]=r[e],s[f+1]=r[e+1],s[f+2]=r[e+2],f+=n}}function p(e,t,f,o=1){const{data:r,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===o)for(let l=0;l<c;++l){const e=4*i[l];s[f]=r[e],s[f+1]=r[e+1],s[f+2]=r[e+2],s[f+3]=r[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<o;++t)s[f]=r[e],s[f+1]=r[e+1],s[f+2]=r[e+2],s[f+3]=r[e+3],f+=n}}function y(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride;t*=r;for(let i=0;i<f;++i)o[t]=0,o[t+1]=0,o[t+2]=0,o[t+3]=0,t+=r}function B(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,s=t.typedBufferStride,n=r.length;f*=s;for(let c=0;c<n;++c){const e=9*r[c];for(let t=0;t<9;++t)i[f+t]=o[e+t];f+=s}}function g(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,s=t.typedBufferStride,n=r.length;f*=s;for(let c=0;c<n;++c){const e=16*r[c];for(let t=0;t<16;++t)i[f+t]=o[e+t];f+=s}}function b(t,f,o,r,i=1){if(!f)return void a(t,o,r,i);const{data:s,indices:n}=t,c=o.typedBuffer,l=o.typedBufferStride,d=n.length,u=f[0],p=f[1],y=f[2],B=f[4],g=f[5],b=f[6],O=f[8],h=f[9],S=f[10],N=f[12],R=f[13],E=f[14];r*=l;let A=0,L=0,z=0;const F=e(f)?e=>{A=s[e]+N,L=s[e+1]+R,z=s[e+2]+E}:e=>{const t=s[e],f=s[e+1],o=s[e+2];A=u*t+B*f+O*o+N,L=p*t+g*f+h*o+R,z=y*t+b*f+S*o+E};if(1===i)for(let e=0;e<d;++e)F(3*n[e]),c[r]=A,c[r+1]=L,c[r+2]=z,r+=l;else for(let e=0;e<d;++e){F(3*n[e]);for(let e=0;e<i;++e)c[r]=A,c[r+1]=L,c[r+2]=z,r+=l}}function O(f,o,r,i,s=1){if(!o)return void a(f,r,i,s);const{data:n,indices:c}=f,l=o,d=r.typedBuffer,u=r.typedBufferStride,p=c.length,y=l[0],B=l[1],g=l[2],b=l[4],O=l[5],h=l[6],S=l[8],N=l[9],R=l[10],E=!t(l),A=1e-6,L=1-A;i*=u;let z=0,F=0,I=0;const T=e(l)?e=>{z=n[e],F=n[e+1],I=n[e+2]}:e=>{const t=n[e],f=n[e+1],o=n[e+2];z=y*t+b*f+S*o,F=B*t+O*f+N*o,I=g*t+h*f+R*o};if(1===s)if(E)for(let e=0;e<p;++e){T(3*c[e]);const t=z*z+F*F+I*I;if(t<L&&t>A){const e=1/Math.sqrt(t);d[i]=z*e,d[i+1]=F*e,d[i+2]=I*e}else d[i]=z,d[i+1]=F,d[i+2]=I;i+=u}else for(let e=0;e<p;++e)T(3*c[e]),d[i]=z,d[i+1]=F,d[i+2]=I,i+=u;else for(let e=0;e<p;++e){if(T(3*c[e]),E){const e=z*z+F*F+I*I;if(e<L&&e>A){const t=1/Math.sqrt(e);z*=t,F*=t,I*=t}}for(let e=0;e<s;++e)d[i]=z,d[i+1]=F,d[i+2]=I,i+=u}}function h(e,f,o,r,i=1){if(!f)return void p(e,o,r,i);const{data:s,indices:n}=e,c=f,l=o.typedBuffer,d=o.typedBufferStride,u=n.length,a=c[0],y=c[1],B=c[2],g=c[4],b=c[5],O=c[6],h=c[8],S=c[9],N=c[10],R=!t(c),E=1e-6,A=1-E;if(r*=d,1===i)for(let t=0;t<u;++t){const e=4*n[t],f=s[e],o=s[e+1],i=s[e+2],c=s[e+3];let u=a*f+g*o+h*i,p=y*f+b*o+S*i,L=B*f+O*o+N*i;if(R){const e=u*u+p*p+L*L;if(e<A&&e>E){const t=1/Math.sqrt(e);u*=t,p*=t,L*=t}}l[r]=u,l[r+1]=p,l[r+2]=L,l[r+3]=c,r+=d}else for(let t=0;t<u;++t){const e=4*n[t],f=s[e],o=s[e+1],c=s[e+2],u=s[e+3];let p=a*f+g*o+h*c,L=y*f+b*o+S*c,z=B*f+O*o+N*c;if(R){const e=p*p+L*L+z*z;if(e<A&&e>E){const t=1/Math.sqrt(e);p*=t,L*=t,z*=t}}for(let t=0;t<i;++t)l[r]=p,l[r+1]=L,l[r+2]=z,l[r+3]=u,r+=d}}function S(e,t,f,o,r=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(o*=c,t!==i.length||4!==t)if(1!==r)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<r;++t)n[o]=i[e],n[o+1]=i[e+1],n[o+2]=i[e+2],n[o+3]=255,o+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<r;++t)n[o]=i[e],n[o+1]=i[e+1],n[o+2]=i[e+2],n[o+3]=i[e+3],o+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[o]=i[t],n[o+1]=i[t+1],n[o+2]=i[t+2],n[o+3]=i[t+3],o+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[o]=i[t],n[o+1]=i[t+1],n[o+2]=i[t+2],n[o+3]=255,o+=c}}else{n[o]=i[0],n[o+1]=i[1],n[o+2]=i[2],n[o+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[o/=4];o+=t;const d=l*r;for(let f=1;f<d;++f)e[o]=s,o+=t}}function N(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,s=t.typedBufferStride,n=r.length,c=o[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function R(e,t,f,o,r=1){const i=t.typedBuffer,s=t.typedBufferStride;if(o*=s,1===r)for(let n=0;n<f;++n)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=s;else for(let n=0;n<f;++n)for(let t=0;t<r;++t)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=s}function E(e,t,o,r,i,s){for(const n of t.fields.keys()){const t=e.attributes.get(n),c=t?.indices;if(t&&c)A(n,t,o,r,i,s);else if(n===l.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(l.POSITION)?.indices;if(t){const o=t.length,r=i.getField(n,f);R(e.objectAndLayerIdColor,r,o,s)}}}}function A(e,t,d,a,y,B){switch(e){case l.POSITION:{c(3===t.size);const f=y.getField(e,n);c(!!f,`No buffer view for ${e}`),f&&b(t,d,f,B);break}case l.NORMAL:{c(3===t.size);const f=y.getField(e,n);c(!!f,`No buffer view for ${e}`),f&&O(t,a,f,B);break}case l.NORMALCOMPRESSED:{c(2===t.size);const f=y.getField(e,s);c(!!f,`No buffer view for ${e}`),f&&u(t,f,B);break}case l.UV0:{c(2===t.size);const f=y.getField(e,i);c(!!f,`No buffer view for ${e}`),f&&u(t,f,B);break}case l.COLOR:case l.SYMBOLCOLOR:{const o=y.getField(e,f);c(!!o,`No buffer view for ${e}`),c(3===t.size||4===t.size),!o||3!==t.size&&4!==t.size||S(t,t.size,o,B);break}case l.COLORFEATUREATTRIBUTE:{const f=y.getField(e,r);c(!!f,`No buffer view for ${e}`),c(1===t.size),f&&1===t.size&&N(t,f,B);break}case l.TANGENT:{c(4===t.size);const f=y.getField(e,o);c(!!f,`No buffer view for ${e}`),f&&h(t,a,f,B);break}case l.PROFILERIGHT:case l.PROFILEUP:case l.PROFILEVERTEXANDNORMAL:case l.FEATUREVALUE:{c(4===t.size);const f=y.getField(e,o);c(!!f,`No buffer view for ${e}`),f&&p(t,f,B)}}}export{d as writeBufferFloat,B as writeBufferMat3f,g as writeBufferMat4f,u as writeBufferVec2,a as writeBufferVec3,p as writeBufferVec4,y as writeBufferVec4Zeros,S as writeColor,N as writeColorFeatureAttribute,A as writeDefaultAttribute,E as writeDefaultAttributes,O as writeNormal,R as writeObjectAndLayerIdColor,b as writePosition,h as writeTangent};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import{someMap as s}from"../../../../../core/MapUtils.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as a}from"../../../../../core/maybe.js";import{NestedMap as o}from"../../../../../core/NestedMap.js";import n from"../../../../../core/PooledArray.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{m as h,i as c,t as f}from"../../../../../chunks/mat4.js";import{a as m}from"../../../../../chunks/mat4f64.js";import{glLayout as d}from"../../../support/buffer/glUtil.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncPrepareRenderPlugin as p}from"../../effects/RenderPlugin.js";import{GLMaterials as y}from"../../lib/GLMaterials.js";import{RenderOccludedFlag as _}from"../../lib/Material.js";import{DirtyState as b}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as v}from"../../lib/RenderSlot.js";import{assert as w,setMatrixTranslation3 as C}from"../../lib/Util.js";import{DrawParameters as O}from"../DrawParameters.js";import{WaterMaterial as E}from"../WaterMaterial.js";import{BufferRange as A,mergeAdjacentRanges as B}from"./BufferRange.js";import{Instance as M}from"./Instance.js";import{PerBufferData as D,hasVao as H}from"./PerBufferData.js";import{PerOriginData as j}from"./PerOriginData.js";import{VaoCache as R}from"./VaoCache.js";let S=class extends p{constructor(e){super(e),this._vaoCache=null,this._glMaterials=null,this._bufferWriter=null,this._dataByOrigin=new Map,this._hasHighlights=!1,this._hasOccludees=!1,this.priority=0,this.produces=new Map}dispose(){this._glMaterials=a(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=a(this._vaoCache)}initializeRenderContext(e,t){const{rctx:r}=e.renderContext;this._glMaterials=new y(this.material,t??e.materialRepository),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=new R(r,this.material.vertexAttributeLocations,d(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get isEmpty(){return 0===this._dataByOrigin.size}get hasHighlights(){return this._hasHighlights}get hasOccludees(){return this._hasOccludees}get hasWater(){return!this.isEmpty&&this.material instanceof E}get isDecoration(){return this.material.parameters.isDecoration}get rendersOccluded(){return!this.isEmpty&&this.material.parameters.renderOccluded!==_.Occlude}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.vao.memoryUsage),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((t=>e(t.geometry)))))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter;if(null===t)return;const r=t.vertexBufferLayout.stride/4;for(const s of e){const e=s.renderGeometry,i=this._dataByOrigin.get(e.localOrigin.id),a=i?.findBuffer(e.id);if(null==a)return;const o=a.instances.get(e.id);if(s.updateType&(b.GEOMETRY|b.TRANSFORMATION)){const s=F(t.elementCount(o.geometry.geometry)*r),i=t.vertexBufferLayout.createView(s.buffer);this._writeGeometry(e,i,0),a.vao.vertexBuffers.geometry.setSubData(s,o.from*r,0,o.numElements*r)}s.updateType&(b.HIGHLIGHT|b.OCCLUDEE|b.VISIBILITY)&&(a.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new o;for(const s of e){const e=s.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new x(e.vec3),r.set(e.id,null,t)),t.changes.push(s)}for(const s of t){const e=s.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),i=t?.findBuffer(s.id);if(null==i)continue;let a=r.get(e.id,i);null==a&&(a=new x(e.vec3),r.set(e.id,i,a)),a.changes.push(s)}return r}_addAndRemoveGeometries(e,r){if(null===this._bufferWriter||null===this._vaoCache)return;const{_bufferWriter:s,_dataByOrigin:i}=this,a=s.vertexBufferLayout.stride/4,o=this._computeDeltas(e,r);o.forEach(((e,r)=>{const n=e.get(null),l=null!=n?n.changes:[];o.delete(r,null);let u=i.get(r);if(e.forEach(((e,n)=>{if(o.delete(r,n),null==n)return void w(!1,"No VAO for removed geometries");if(n.instances.size===e.changes.length)return this._vaoCache.deleteVao(n.vao),t(u.buffers,n),void(0===u.buffers.length&&0===l.length&&i.delete(r));const h=n.numElements,c=n.vao.byteSize/4,f=l.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),m=e.changes.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),d=Math.min((h+f-m)*a,N),g=d>c;d>P&&d<c/2?(e.changes.forEach((({id:e})=>n.deleteInstance(e))),n.instances.forEach((({geometry:e})=>l.push(e))),this._vaoCache.deleteVao(n.vao),t(u.buffers,n)):g?this._applyAndRebuild(n,l,e):this._applyRemoves(n,e)})),l.length>0)for(null==u&&(u=new j(n.origin),i.set(r,u)),u.buffers.forEach((e=>this._applyAdds(e,l)));l.length>0;)u.buffers.push(this._applyAndRebuild(new D,l,null))}))}_updateDrawCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.drawCommandsDirty&&(e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,s(e.instances,(t=>(e.updateDrawState(t),e.hasHiddenInstances&&e.hasHighlights&&e.hasOccludees))),e.updateDrawCommands(this._bufferWriter.vertexBufferLayout.stride)),this._hasHighlights=this._hasHighlights||e.hasHighlights,this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(null!=r)for(const m of r.changes)e.deleteInstance(m.id);const s=this._bufferWriter,i=s.vertexBufferLayout.stride,a=i/4,o=Math.floor(N/a);let n=e.numElements;for(;t.length>0;){const r=t.pop(),i=s.elementCount(r.geometry);if(n+i>o&&n>0){t.push(r);break}n+=i;const a=new M(r,0,0);w(null==e.instances.get(r.id)),e.addInstance(r.id,a)}const l=n*a,u=F(l),h=s.vertexBufferLayout.createView(u.buffer);let c=0;e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,h,c);const i=c;c+=s.elementCount(t.geometry.geometry),e.updateInstance(r,i,c),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(q(l)),e.vao.vertexBuffers.geometry.setSubData(u,0,0,c*a),e.holes.clear();const f=e.holes.pushNew();return f.from=c,f.to=Math.floor(e.vao.byteSize/i),e.updateDrawCommands(i),e}_applyRemoves(e,t){if(0===t.changes.length||null===this._bufferWriter)return;for(const o of t.changes){const t=o.id,r=e.instances.get(t);if(!r)continue;e.deleteInstance(t);const s=G.back();if(s){if(s.to===r.from){s.to=r.to;continue}if(s.from===r.to){s.from=r.from;continue}}const i=G.pushNew();i.from=r.from,i.to=r.to}B(G);const r=this._bufferWriter.vertexBufferLayout.stride/4,s=G.reduce(((e,t)=>Math.max(e,t.numElements)),0)*r,i=F(s);i.fill(0,0,s);const a=e.vao.vertexBuffers.geometry;G.forAll((e=>a.setSubData(i,e.from*r,0,e.numElements*r))),e.holes.pushArray(G.data,G.length),G.forAll(((e,t)=>G.data[t]=null)),G.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null===this._bufferWriter)return;if(!H(e))return void this._applyAndRebuild(e,t,null);const s=this._bufferWriter,i=s.vertexBufferLayout.stride/4,a=e.numElements,o=t.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),n=Math.min((a+o)*i,N),l=4*n;if(e.vao.byteSize<q(N-P)&&l>e.vao.byteSize)return void this._applyAndRebuild(e,t,null);B(e.holes);const u=new Array;for(const r of t){const t=s.elementCount(r.geometry),i=L(e.holes,t);u.push(i)}const h=e.vao.vertexBuffers.geometry;let c=0,f=0,m=0;const d=F(n),g=s.vertexBufferLayout.createView(d.buffer);t.forEach(((t,r)=>{const a=u[r];if(null==a)return;if(!(m===a)){const e=m-f;e>0&&h.setSubData(d,f*i,0,e*i),f=a,c=0}const o=s.elementCount(t.geometry);this._writeGeometry(t,g,c),c+=o,m=a+o;const n=new M(t,a,a+o);w(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0}));const p=m-f;p>0&&h.setSubData(d,f*i,0,p*i),r(t,((e,t)=>null==u[t]))}_writeGeometry(e,t,r){if(null===this._bufferWriter)return;const s=e.localOrigin.vec3;C(I,-s[0],-s[1],-s[2]);const i=h(T,I,e.transformation);c(W,i),f(W,W),this._bufferWriter.write(i,W,e.geometry,t,r)}updateAnimation(e){return this.material.update(e)}prepareTechnique(e){if(!this.material.shouldRender(e))return null;const{output:t,bindParameters:r}=e;if(!this.material.produces(r.slot,t))return null;const s=t===g.Highlight||t===g.ShadowHighlight;if(s&&!this._hasHighlights)return null;const i=t===g.ShadowExcludeHighlight,a=!(s||i);for(const o of this._dataByOrigin.values())for(const n of o.buffers){if(s&&!n.hasHighlights)continue;const o=(s?n.drawCommandsHighlight:i&&n.needsMultipleCommands()?n.drawCommandsShadowHighlightRest:n.drawCommandsDefault)||null,l=a&&n.drawCommandsOccludees||null;if(o?.length||l?.length){const s=this._glMaterials.load(e.rctx,r.slot,t),i=null!=s?s.beginSlot(r):null;if(null!=i)return i}}return null}render(e,t){const{output:r,bindParameters:s}=e,i=r===g.Highlight||r===g.ShadowHighlight,a=r===g.ShadowExcludeHighlight,o=!(i||a),n=e.rctx,l=e.bindParameters.slot===v.OCCLUDER_MATERIAL,u=e.bindParameters.slot===v.TRANSPARENT_OCCLUDER_MATERIAL;n.runAppleAmdDriverHelper(),n.bindTechnique(t,this.material.parameters,s);for(const h of this._dataByOrigin.values())for(const e of h.buffers){if(i&&!e.hasHighlights)continue;const r=(i?e.drawCommandsHighlight:a&&e.needsMultipleCommands()?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault)||null,c=o&&e.drawCommandsOccludees||null;if(r?.length||c?.length){t.program.bindDraw(new O(h.origin),s,this.material.parameters),t.ensureAttributeLocations(e.vao),n.bindVAO(e.vao),r?.length&&(n.setPipelineState(t.getPipeline(!1,l,u)),r.forAll((e=>n.drawArrays(t.primitiveType,e.first,e.count)))),c?.length&&(n.setPipelineState(t.getPipeline(!0,l,u)),c.forAll((e=>n.drawArrays(t.primitiveType,e.first,e.count))))}}}get test(){return{material:this.material,glMaterials:this._glMaterials,dataByOrigin:this._dataByOrigin}}};e([l({constructOnly:!0})],S.prototype,"material",void 0),S=e([u("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],S);class x{constructor(e){this.origin=e,this.changes=new Array}}function L(e,t){let r;if(!e.some((e=>!(e.numElements<t)&&(r=e,!0))))return null;const s=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),s}const I=m(),T=m(),W=m(),G=new n({allocator:e=>e||new A,deallocator:null}),P=65536,V=4*P,U=1024,z=16777216,N=z/4;let k=new Float32Array(P);function F(e){return k.length<e&&(k=new Float32Array(e)),k}function q(e){const t=4*e;return t<=U?U:t<V?i(t):Math.max(Math.min(Math.ceil(1.5*t/V)*V,z),t)}export{S as MergedRenderer};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import{someMap as s}from"../../../../../core/MapUtils.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as a}from"../../../../../core/maybe.js";import{NestedMap as o}from"../../../../../core/NestedMap.js";import n from"../../../../../core/PooledArray.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{m as h,i as c,t as f}from"../../../../../chunks/mat4.js";import{a as m}from"../../../../../chunks/mat4f64.js";import{glLayout as d}from"../../../support/buffer/glUtil.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncPrepareRenderPlugin as p}from"../../effects/RenderPlugin.js";import{GLMaterials as y}from"../../lib/GLMaterials.js";import{RenderOccludedFlag as _}from"../../lib/Material.js";import{DirtyState as b}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as v}from"../../lib/RenderSlot.js";import{assert as w,setMatrixTranslation3 as C}from"../../lib/Util.js";import{DrawParameters as O}from"../DrawParameters.js";import{WaterMaterial as E}from"../WaterMaterial.js";import{BufferRange as A,mergeAdjacentRanges as B}from"./BufferRange.js";import{Instance as M}from"./Instance.js";import{PerBufferData as D,hasVao as H}from"./PerBufferData.js";import{PerOriginData as j}from"./PerOriginData.js";import{VaoCache as R}from"./VaoCache.js";let S=class extends p{constructor(e){super(e),this._vaoCache=null,this._glMaterials=null,this._bufferWriter=null,this._dataByOrigin=new Map,this._hasHighlights=!1,this._hasOccludees=!1,this.priority=0,this.produces=new Map}dispose(){this._glMaterials=a(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=a(this._vaoCache)}initializeRenderContext(e,t){const{rctx:r}=e.renderContext;this._glMaterials=new y(this.material,t??e.materialRepository),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=new R(r,this.material.vertexAttributeLocations,d(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get isEmpty(){return 0===this._dataByOrigin.size}get hasHighlights(){return this._hasHighlights}get hasOccludees(){return this._hasOccludees}get hasWater(){return!this.isEmpty&&this.material instanceof E}get isDecoration(){return this.material.parameters.isDecoration}get rendersOccluded(){return!this.isEmpty&&this.material.parameters.renderOccluded!==_.Occlude}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.vao.memoryUsage),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((t=>e(t.geometry)))))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter;if(null===t)return;const r=t.vertexBufferLayout.stride/4;for(const s of e){const e=s.renderGeometry,i=this._dataByOrigin.get(e.localOrigin.id),a=i?.findBuffer(e.id);if(null==a)return;const o=a.instances.get(e.id);if(s.updateType&(b.GEOMETRY|b.TRANSFORMATION)){const s=F(t.elementCount(o.geometry.geometry)*r),i=t.vertexBufferLayout.createView(s.buffer);this._writeGeometry(e,i,0),a.vao.vertexBuffers.geometry.setSubData(s,o.from*r,0,o.numElements*r)}s.updateType&(b.HIGHLIGHT|b.OCCLUDEE|b.VISIBILITY)&&(a.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new o;for(const s of e){const e=s.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new x(e.vec3),r.set(e.id,null,t)),t.changes.push(s)}for(const s of t){const e=s.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),i=t?.findBuffer(s.id);if(null==i)continue;let a=r.get(e.id,i);null==a&&(a=new x(e.vec3),r.set(e.id,i,a)),a.changes.push(s)}return r}_addAndRemoveGeometries(e,r){if(null===this._bufferWriter||null===this._vaoCache)return;const{_bufferWriter:s,_dataByOrigin:i}=this,a=s.vertexBufferLayout.stride/4,o=this._computeDeltas(e,r);o.forEach(((e,r)=>{const n=e.get(null),l=null!=n?n.changes:[];o.delete(r,null);let u=i.get(r);if(e.forEach(((e,n)=>{if(o.delete(r,n),null==n)return void w(!1,"No VAO for removed geometries");if(n.instances.size===e.changes.length)return this._vaoCache.deleteVao(n.vao),t(u.buffers,n),void(0===u.buffers.length&&0===l.length&&i.delete(r));const h=n.numElements,c=n.vao.byteSize/4,f=l.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),m=e.changes.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),d=Math.min((h+f-m)*a,N),g=d>c;d>P&&d<c/2?(e.changes.forEach((({id:e})=>n.deleteInstance(e))),n.instances.forEach((({geometry:e})=>l.push(e))),this._vaoCache.deleteVao(n.vao),t(u.buffers,n)):g?this._applyAndRebuild(n,l,e):this._applyRemoves(n,e)})),l.length>0)for(null==u&&(u=new j(n.origin),i.set(r,u)),u.buffers.forEach((e=>this._applyAdds(e,l)));l.length>0;)u.buffers.push(this._applyAndRebuild(new D,l,null))}))}_updateDrawCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.drawCommandsDirty&&(e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,s(e.instances,(t=>(e.updateDrawState(t),e.hasHiddenInstances&&e.hasHighlights&&e.hasOccludees))),e.updateDrawCommands(this._bufferWriter.vertexBufferLayout.stride)),this._hasHighlights=this._hasHighlights||e.hasHighlights,this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(null!=r)for(const m of r.changes)e.deleteInstance(m.id);const s=this._bufferWriter,i=s.vertexBufferLayout.stride,a=i/4,o=Math.floor(N/a);let n=e.numElements;for(;t.length>0;){const r=t.pop(),i=s.elementCount(r.geometry);if(n+i>o&&n>0){t.push(r);break}n+=i;const a=new M(r,0,0);w(null==e.instances.get(r.id)),e.addInstance(r.id,a)}const l=n*a,u=F(l),h=s.vertexBufferLayout.createView(u.buffer);let c=0;e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,h,c);const i=c;c+=s.elementCount(t.geometry.geometry),e.updateInstance(r,i,c),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(q(l)),e.vao.vertexBuffers.geometry.setSubData(u,0,0,c*a),e.holes.clear();const f=e.holes.pushNew();return f.from=c,f.to=Math.floor(e.vao.byteSize/i),e.updateDrawCommands(i),e}_applyRemoves(e,t){if(0===t.changes.length||null===this._bufferWriter)return;for(const o of t.changes){const t=o.id,r=e.instances.get(t);if(!r)continue;e.deleteInstance(t);const s=G.back();if(s){if(s.to===r.from){s.to=r.to;continue}if(s.from===r.to){s.from=r.from;continue}}const i=G.pushNew();i.from=r.from,i.to=r.to}B(G);const r=this._bufferWriter.vertexBufferLayout.stride/4,s=G.reduce(((e,t)=>Math.max(e,t.numElements)),0)*r,i=F(s);i.fill(0,0,s);const a=e.vao.vertexBuffers.geometry;G.forAll((e=>a.setSubData(i,e.from*r,0,e.numElements*r))),e.holes.pushArray(G.data,G.length),G.forAll(((e,t)=>G.data[t]=null)),G.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null===this._bufferWriter)return;if(!H(e))return void this._applyAndRebuild(e,t,null);const s=this._bufferWriter,i=s.vertexBufferLayout.stride/4,a=e.numElements,o=t.reduce(((e,t)=>e+s.elementCount(t.geometry)),0),n=Math.min((a+o)*i,N),l=4*n;if(e.vao.byteSize<q(N-P)&&l>e.vao.byteSize)return void this._applyAndRebuild(e,t,null);B(e.holes);const u=new Array;for(const r of t){const t=s.elementCount(r.geometry),i=L(e.holes,t);u.push(i)}const h=e.vao.vertexBuffers.geometry;let c=0,f=0,m=0;const d=F(n),g=s.vertexBufferLayout.createView(d.buffer);t.forEach(((t,r)=>{const a=u[r];if(null==a)return;if(!(m===a)){const e=m-f;e>0&&h.setSubData(d,f*i,0,e*i),f=a,c=0}const o=s.elementCount(t.geometry);this._writeGeometry(t,g,c),c+=o,m=a+o;const n=new M(t,a,a+o);w(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0}));const p=m-f;p>0&&h.setSubData(d,f*i,0,p*i),r(t,((e,t)=>null==u[t]))}_writeGeometry(e,t,r){if(null===this._bufferWriter)return;const s=e.localOrigin.vec3;C(I,-s[0],-s[1],-s[2]);const i=h(T,I,e.transformation);c(W,i),f(W,W),this._bufferWriter.write(i,W,e.geometry,t,r)}updateAnimation(e){return this.material.update(e)}prepareTechnique(e){if(!this.material.shouldRender(e))return null;const{output:t,bindParameters:r}=e;if(!this.material.produces(r.slot,t))return null;const s=t===g.Highlight||t===g.ShadowHighlight;if(s&&!this._hasHighlights)return null;const i=t===g.ShadowExcludeHighlight,a=!(s||i);for(const o of this._dataByOrigin.values())for(const n of o.buffers){if(s&&!n.hasHighlights)continue;const o=(s?n.drawCommandsHighlight:i&&n.needsMultipleCommands()?n.drawCommandsShadowHighlightRest:n.drawCommandsDefault)||null,l=a&&n.drawCommandsOccludees||null;if(o?.length||l?.length){const s=this._glMaterials.load(e.rctx,r.slot,t),i=null!=s?s.beginSlot(r):null;if(null!=i)return i}}return null}renderNode(e,t){const{output:r,bindParameters:s}=e,i=r===g.Highlight||r===g.ShadowHighlight,a=r===g.ShadowExcludeHighlight,o=!(i||a),n=e.rctx,l=e.bindParameters.slot===v.OCCLUDER_MATERIAL,u=e.bindParameters.slot===v.TRANSPARENT_OCCLUDER_MATERIAL;n.runAppleAmdDriverHelper(),n.bindTechnique(t,this.material.parameters,s);for(const h of this._dataByOrigin.values())for(const e of h.buffers){if(i&&!e.hasHighlights)continue;const r=(i?e.drawCommandsHighlight:a&&e.needsMultipleCommands()?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault)||null,c=o&&e.drawCommandsOccludees||null;if(r?.length||c?.length){t.program.bindDraw(new O(h.origin),s,this.material.parameters),t.ensureAttributeLocations(e.vao),n.bindVAO(e.vao),r?.length&&(n.setPipelineState(t.getPipeline(!1,l,u)),r.forAll((e=>n.drawArrays(t.primitiveType,e.first,e.count)))),c?.length&&(n.setPipelineState(t.getPipeline(!0,l,u)),c.forAll((e=>n.drawArrays(t.primitiveType,e.first,e.count))))}}}get test(){return{material:this.material,glMaterials:this._glMaterials,dataByOrigin:this._dataByOrigin}}};e([l({constructOnly:!0})],S.prototype,"material",void 0),S=e([u("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],S);class x{constructor(e){this.origin=e,this.changes=new Array}}function L(e,t){let r;if(!e.some((e=>!(e.numElements<t)&&(r=e,!0))))return null;const s=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),s}const I=m(),T=m(),W=m(),G=new n({allocator:e=>e||new A,deallocator:null}),P=65536,V=4*P,U=1024,z=16777216,N=z/4;let k=new Float32Array(P);function F(e){return k.length<e&&(k=new Float32Array(e)),k}function q(e){const t=4*e;return t<=U?U:t<V?i(t):Math.max(Math.min(Math.ceil(1.5*t/V)*V,z),t)}export{S as MergedRenderer};
|
package/views/View.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Map.js";import i from"../TimeExtent.js";import r from"../core/Accessor.js";import{createTask as a}from"../core/asyncUtils.js";import s from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import n from"../core/Error.js";import l from"../core/Evented.js";import p from"../core/Handles.js";import{makeHandle as d}from"../core/handleUtils.js";import h from"../core/Loadable.js";import y from"../core/Logger.js";import{destroyMaybe as u,abortMaybe as c}from"../core/maybe.js";import{EsriPromiseMixin as m}from"../core/Promise.js";import{after as g}from"../core/promiseUtils.js";import{watch as f,whenOnce as w,when as v,sync as V}from"../core/reactiveUtils.js";import{property as M}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as _}from"../core/support/OwningCollection.js";import{UpdatingHandles as j}from"../core/support/UpdatingHandles.js";import S from"../geometry/Extent.js";import F from"../geometry/HeightModelInfo.js";import L from"../geometry/SpatialReference.js";import{equals as O}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as T}from"../support/AnalysesCollection.js";import{GraphicsCollection as E}from"../support/GraphicsCollection.js";import{SYSTEM as b,UNKNOWN as k}from"../time/timeZoneUtils.js";import{BasemapView as x}from"./BasemapView.js";import C from"./LayerViewManager.js";import Z from"./Magnifier.js";import I from"./Theme.js";import{ToolViewManager as D}from"./ToolViewManager.js";import H from"./input/Input.js";import{ViewEvents as U}from"./input/ViewEvents.js";import P from"./navigation/Navigation.js";import{DefaultsFromMap as q}from"./support/DefaultsFromMap.js";var A;let z=A=class extends(l.EventedMixin(m(r))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.handles=new p,this.updatingHandles=new j,this.allLayerViews=new o({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:N}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new E,this.analyses=new T,this.typeSpecificPreconditionsReady=!0,this.layerViews=new s,this.magnifier=new Z,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new H,this.navigation=new P,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new U(this),this.persistableViewModels=new s,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this.theme=null,this.handles.add(f((()=>this.preconditionsReady),(e=>{e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,A.views.add(this)):(this._lockedSpatialReference=null,A.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?(this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown()):e&&!this.ready&&(this._startup(),null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach())}),V))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then((()=>(this._isValid=!0,w((()=>this.ready)))))),this.basemapView=new x({view:this}),this.layerViewManager=new C({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new D({view:this}),this._setupSpatialReferenceLogger(),this.addHandles([f((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),{sync:!0,initial:!0}),f((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),{sync:!0}),f((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let e=null;this.addHandles([f((()=>this.defaultsFromMap?.ready),(t=>{const i=this.map?.allLayers.length>0;if(t&&!this.spatialReference&&i){if(null!=e)return;const t=d((()=>e=c(e)));e=a((async t=>{try{await g(this.spatialReferenceWarningDelay,null,t)}catch{return}finally{e=null}y.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})),this.addHandles(t,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")}),{sync:!0})])}destroy(){this.destroyed||(A.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=u(this.graphics),this.analyses=u(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),u(this.analysisViewManager),this.toolViewManager=u(this.toolViewManager),this.layerViewManager=u(this.layerViewManager),this.basemapView=u(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach((e=>e.destroy())),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=u(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return y.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new q({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||h.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(y.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),h.isLoadable(e)&&e.load().catch((()=>{})),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get spatialReference(){let e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;return e&&this.defaultsFromMap?.required?.heightModelInfo&&(e=e.clone(),e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),e}set spatialReference(e){const t=!O(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??b}set timeZone(e){Intl.supportedValuesOf("timeZone").includes(e)||e===b||e===k?this._userTimeZone=e:y.getLogger(this).error("#timeZone",`the parsed value '${e}' is not a valid IANA time zone or the keywords '${b}' and '${k}'`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new I}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}importLayerView(e){throw new n("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport({spatialReference:e})}when(e,t){return this.isResolved()&&!this.ready&&y.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(v((()=>this.destroyed||!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};z.views=new s,e([M()],z.prototype,"_userSpatialReference",void 0),e([M()],z.prototype,"activeTool",null),e([M({readOnly:!0})],z.prototype,"allLayerViews",void 0),e([M()],z.prototype,"groundView",void 0),e([M()],z.prototype,"animation",null),e([M()],z.prototype,"basemapView",void 0),e([M()],z.prototype,"center",null),e([M({readOnly:!0})],z.prototype,"_defaultsFromMapSettings",null),e([M()],z.prototype,"defaultsFromMap",null),e([M()],z.prototype,"fatalError",void 0),e([M({type:S})],z.prototype,"extent",null),e([M(_(E,"graphics"))],z.prototype,"graphics",void 0),e([M(_(T,"analyses"))],z.prototype,"analyses",void 0),e([M({readOnly:!0,type:F})],z.prototype,"heightModelInfo",null),e([M({readOnly:!0})],z.prototype,"interacting",null),e([M({readOnly:!0})],z.prototype,"navigating",null),e([M({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],z.prototype,"preconditionsReady",null),e([M({readOnly:!0})],z.prototype,"typeSpecificPreconditionsReady",void 0),e([M({type:s,readOnly:!0})],z.prototype,"layerViews",void 0),e([M()],z.prototype,"resolution",null),e([M({type:Z})],z.prototype,"magnifier",void 0),e([M({value:null,type:t})],z.prototype,"map",null),e([M()],z.prototype,"padding",void 0),e([M({readOnly:!0})],z.prototype,"ready",void 0),e([M({type:L})],z.prototype,"spatialReference",null),e([M()],z.prototype,"spatialReferenceWarningDelay",void 0),e([M()],z.prototype,"stationary",null),e([M({readOnly:!0})],z.prototype,"supportsGround",void 0),e([M({type:i})],z.prototype,"timeExtent",void 0),e([M({nonNullable:!0})],z.prototype,"timeZone",null),e([M()],z.prototype,"tools",null),e([M()],z.prototype,"toolViewManager",void 0),e([M({readOnly:!0})],z.prototype,"type",void 0),e([M({type:Number})],z.prototype,"scale",void 0),e([M({readOnly:!0})],z.prototype,"updating",void 0),e([M({readOnly:!0})],z.prototype,"initialExtentRequired",void 0),e([M({readOnly:!0})],z.prototype,"initialExtent",null),e([M()],z.prototype,"cursor",null),e([M({readOnly:!0})],z.prototype,"input",void 0),e([M({type:P,nonNullable:!0})],z.prototype,"navigation",void 0),e([M()],z.prototype,"layerViewManager",void 0),e([M()],z.prototype,"analysisViewManager",void 0),e([M()],z.prototype,"width",void 0),e([M()],z.prototype,"height",void 0),e([M({readOnly:!0})],z.prototype,"resizing",void 0),e([M({value:null,readOnly:!0})],z.prototype,"size",null),e([M({readOnly:!0})],z.prototype,"suspended",void 0),e([M({readOnly:!0})],z.prototype,"viewEvents",void 0),e([M({readOnly:!0})],z.prototype,"persistableViewModels",void 0),e([M()],z.prototype,"_isValid",void 0),e([M()],z.prototype,"_readyCycleForced",void 0),e([M()],z.prototype,"_lockedSpatialReference",void 0),e([M()],z.prototype,"_userTimeZone",void 0),e([M()],z.prototype,"_lockedTimeZone",void 0),e([M({type:I})],z.prototype,"theme",void 0),e([M({readOnly:!0,type:I})],z.prototype,"effectiveTheme",null),z=A=e([R("esri.views.View")],z);const W=z;function N(e){return e.layerViews}export{W as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Map.js";import i from"../TimeExtent.js";import r from"../core/Accessor.js";import{createTask as a}from"../core/asyncUtils.js";import s from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import n from"../core/Error.js";import l from"../core/Evented.js";import p from"../core/Handles.js";import{makeHandle as d}from"../core/handleUtils.js";import h from"../core/Loadable.js";import y from"../core/Logger.js";import{destroyMaybe as u,abortMaybe as c}from"../core/maybe.js";import{EsriPromiseMixin as m}from"../core/Promise.js";import{after as g}from"../core/promiseUtils.js";import{watch as f,whenOnce as w,when as v,sync as V}from"../core/reactiveUtils.js";import{property as M}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as _}from"../core/support/OwningCollection.js";import{UpdatingHandles as j}from"../core/support/UpdatingHandles.js";import S from"../geometry/Extent.js";import F from"../geometry/HeightModelInfo.js";import L from"../geometry/SpatialReference.js";import{equals as O}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as T}from"../support/AnalysesCollection.js";import{GraphicsCollection as E}from"../support/GraphicsCollection.js";import{system as b,unknown as k}from"../time/timeZoneUtils.js";import{BasemapView as x}from"./BasemapView.js";import C from"./LayerViewManager.js";import Z from"./Magnifier.js";import I from"./Theme.js";import{ToolViewManager as D}from"./ToolViewManager.js";import H from"./input/Input.js";import{ViewEvents as U}from"./input/ViewEvents.js";import P from"./navigation/Navigation.js";import{DefaultsFromMap as q}from"./support/DefaultsFromMap.js";var A;let z=A=class extends(l.EventedMixin(m(r))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.handles=new p,this.updatingHandles=new j,this.allLayerViews=new o({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:N}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new E,this.analyses=new T,this.typeSpecificPreconditionsReady=!0,this.layerViews=new s,this.magnifier=new Z,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new H,this.navigation=new P,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new U(this),this.persistableViewModels=new s,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this.theme=null,this.handles.add(f((()=>this.preconditionsReady),(e=>{e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,A.views.add(this)):(this._lockedSpatialReference=null,A.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?(this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown()):e&&!this.ready&&(this._startup(),null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach())}),V))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then((()=>(this._isValid=!0,w((()=>this.ready)))))),this.basemapView=new x({view:this}),this.layerViewManager=new C({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new D({view:this}),this._setupSpatialReferenceLogger(),this.addHandles([f((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),{sync:!0,initial:!0}),f((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),{sync:!0}),f((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let e=null;this.addHandles([f((()=>this.defaultsFromMap?.ready),(t=>{const i=this.map?.allLayers.length>0;if(t&&!this.spatialReference&&i){if(null!=e)return;const t=d((()=>e=c(e)));e=a((async t=>{try{await g(this.spatialReferenceWarningDelay,null,t)}catch{return}finally{e=null}y.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")})),this.addHandles(t,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")}),{sync:!0})])}destroy(){this.destroyed||(A.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=u(this.graphics),this.analyses=u(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),u(this.analysisViewManager),this.toolViewManager=u(this.toolViewManager),this.layerViewManager=u(this.layerViewManager),this.basemapView=u(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach((e=>e.destroy())),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=u(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return y.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new q({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||h.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(y.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),h.isLoadable(e)&&e.load().catch((()=>{})),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get spatialReference(){let e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;return e&&this.defaultsFromMap?.required?.heightModelInfo&&(e=e.clone(),e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),e}set spatialReference(e){const t=!O(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??b}set timeZone(e){Intl.supportedValuesOf("timeZone").includes(e)||e===b||e===k?this._userTimeZone=e:y.getLogger(this).error("#timeZone",`the parsed value '${e}' is not a valid IANA time zone or the keywords '${b}' and '${k}'`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new I}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}importLayerView(e){throw new n("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport({spatialReference:e})}when(e,t){return this.isResolved()&&!this.ready&&y.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(v((()=>this.destroyed||!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};z.views=new s,e([M()],z.prototype,"_userSpatialReference",void 0),e([M()],z.prototype,"activeTool",null),e([M({readOnly:!0})],z.prototype,"allLayerViews",void 0),e([M()],z.prototype,"groundView",void 0),e([M()],z.prototype,"animation",null),e([M()],z.prototype,"basemapView",void 0),e([M()],z.prototype,"center",null),e([M({readOnly:!0})],z.prototype,"_defaultsFromMapSettings",null),e([M()],z.prototype,"defaultsFromMap",null),e([M()],z.prototype,"fatalError",void 0),e([M({type:S})],z.prototype,"extent",null),e([M(_(E,"graphics"))],z.prototype,"graphics",void 0),e([M(_(T,"analyses"))],z.prototype,"analyses",void 0),e([M({readOnly:!0,type:F})],z.prototype,"heightModelInfo",null),e([M({readOnly:!0})],z.prototype,"interacting",null),e([M({readOnly:!0})],z.prototype,"navigating",null),e([M({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],z.prototype,"preconditionsReady",null),e([M({readOnly:!0})],z.prototype,"typeSpecificPreconditionsReady",void 0),e([M({type:s,readOnly:!0})],z.prototype,"layerViews",void 0),e([M()],z.prototype,"resolution",null),e([M({type:Z})],z.prototype,"magnifier",void 0),e([M({value:null,type:t})],z.prototype,"map",null),e([M()],z.prototype,"padding",void 0),e([M({readOnly:!0})],z.prototype,"ready",void 0),e([M({type:L})],z.prototype,"spatialReference",null),e([M()],z.prototype,"spatialReferenceWarningDelay",void 0),e([M()],z.prototype,"stationary",null),e([M({readOnly:!0})],z.prototype,"supportsGround",void 0),e([M({type:i})],z.prototype,"timeExtent",void 0),e([M({nonNullable:!0})],z.prototype,"timeZone",null),e([M()],z.prototype,"tools",null),e([M()],z.prototype,"toolViewManager",void 0),e([M({readOnly:!0})],z.prototype,"type",void 0),e([M({type:Number})],z.prototype,"scale",void 0),e([M({readOnly:!0})],z.prototype,"updating",void 0),e([M({readOnly:!0})],z.prototype,"initialExtentRequired",void 0),e([M({readOnly:!0})],z.prototype,"initialExtent",null),e([M()],z.prototype,"cursor",null),e([M({readOnly:!0})],z.prototype,"input",void 0),e([M({type:P,nonNullable:!0})],z.prototype,"navigation",void 0),e([M()],z.prototype,"layerViewManager",void 0),e([M()],z.prototype,"analysisViewManager",void 0),e([M()],z.prototype,"width",void 0),e([M()],z.prototype,"height",void 0),e([M({readOnly:!0})],z.prototype,"resizing",void 0),e([M({value:null,readOnly:!0})],z.prototype,"size",null),e([M({readOnly:!0})],z.prototype,"suspended",void 0),e([M({readOnly:!0})],z.prototype,"viewEvents",void 0),e([M({readOnly:!0})],z.prototype,"persistableViewModels",void 0),e([M()],z.prototype,"_isValid",void 0),e([M()],z.prototype,"_readyCycleForced",void 0),e([M()],z.prototype,"_lockedSpatialReference",void 0),e([M()],z.prototype,"_userTimeZone",void 0),e([M()],z.prototype,"_lockedTimeZone",void 0),e([M({type:I})],z.prototype,"theme",void 0),e([M({readOnly:!0,type:I})],z.prototype,"effectiveTheme",null),z=A=e([R("esri.views.View")],z);const W=z;function N(e){return e.layerViews}export{W as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import o from"../../core/Evented.js";import{makeHandle as i}from"../../core/handleUtils.js";import{destroyMaybe as r}from"../../core/maybe.js";import{createLength as n,zeroMeters as l,zeroSquareMeters as a,zeroDegrees as s}from"../../core/quantityUtils.js";import{watch as p,syncAndInitial as c}from"../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as h}from"../../core/unitUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import m from"../../layers/GraphicsLayer.js";import{getConvertedElevation as y}from"../../support/elevationInfoUtils.js";import{createSquare as g,createRectangle as v,createCircle as f,createEllipse as _,createPolygon as w,createPolyline as O,createMultipoint as G}from"./support/createUtils.js";import{getDrawHelpMessage as x}from"./support/helpMessageUtils.js";import{createViewAlignedCoordinateSystem as T}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as V}from"../interactive/InteractiveToolBase.js";import b from"../interactive/sketch/SketchLabelOptions.js";import I from"../interactive/sketch/SketchTooltipOptions.js";import{intersectAll as S,getDistanceConstraint as j,getOrientationConstraint as C,getElevationConstraint as U}from"../interactive/tooltip/constraintUtils.js";import{DrawPointTooltipInfo as k,DrawPolylineTooltipInfo as M,DrawPolygonTooltipInfo as z,DrawMeshTooltipInfo as P,DrawRectangleTooltipInfo as D,DrawCircleTooltipInfo as E}from"../interactive/tooltip/DrawTooltipInfos.js";import{Tooltip as H}from"../interactive/tooltip/Tooltip.js";import{orientationBetweenPoints as A}from"../support/angularMeasurementUtils.js";import{autoAreaByElevationMode as R}from"../support/automaticAreaMeasurementUtils.js";import{autoLengthByElevationMode as L,autoDirectDistanceByElevationModeBetweenPoints as Z,autoHorizontalDistanceByElevationModeBetweenPoints as N}from"../support/automaticLengthMeasurementUtils.js";import{autorun as q}from"../../core/accessorSupport/trackingUtils.js";class B{constructor(){this.regularVertices=null,this.activeVertex=null,this.full=null,this.outline=null,this.circle=null,this.rectangle=null}}let F=class extends(o.EventedMixin(V)){constructor(e){super(e),this._graphic=null,this._createOperationGeometry=null,this.defaultZ=0,this.geometryType=null,this.hasZ=!0,this.labelOptions=new b,this.geometryToPlace=null,this.mode=null,this.snappingManager=null,this.snapToScene=!1,this.tooltip=null,this.tooltipOptions=new I}initialize(){this.internalGraphicsLayer=new m({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer),this.drawOperation=this.makeDrawOperation();const e=this.tooltipOptions,t=this.view.type;this.tooltipInfos={point:new k({tooltipOptions:e,viewType:t}),polyline:new M({tooltipOptions:e,viewType:t}),polygon:new z({tooltipOptions:e,viewType:t}),mesh:new P({tooltipOptions:e,viewType:t}),rectangle:new D({tooltipOptions:e}),circle:new E({tooltipOptions:e})},this.addHandles([this.drawOperation.on("vertex-add",(e=>this.onVertexAdd(e))),this.drawOperation.on("vertex-remove",(e=>this.onVertexRemove(e))),this.drawOperation.on("vertex-update",(e=>this.onVertexUpdate(e))),this.drawOperation.on("cursor-update",(e=>this.onCursorUpdate(e))),this.drawOperation.on("complete",(e=>this.onComplete(e))),p((()=>this.tooltipOptions.enabled),(e=>{this.tooltip=e?new H({view:this.view,info:this._tooltipInfo}):r(this.tooltip)}),c),q((()=>this._updateTooltipInfo()))]),this.finishToolCreation()}destroy(){this.drawOperation=r(this.drawOperation),this.tooltip=r(this.tooltip),this._destroyAllVisualisations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=r(this.internalGraphicsLayer),this._set("view",null)}get _defaultElevation(){return n(this.defaultZ,"meters")}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),null!=this._graphic&&(this._graphic.symbol=e)}get updating(){return this.drawOperation?.updating??!1}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){const t=this._tooltipInfo;if("key-down"===e.type&&"Tab"===e.key&&t&&this.tooltipOptions.inputEnabled)return t.enterInputMode(),void e.stopPropagation();this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}_destroyAllVisualisations(){this.removeHandles(K.outline),this.removeHandles(K.regularVertices),this.removeHandles(K.activeVertex),this.removeHandles(J)}_createOrUpdateGraphic(e){if(null!=this._graphic)return this.updateGraphicGeometry(this._graphic,e),this._graphic;const o=this._graphic=new t({...this.graphicProperties,symbol:this.graphicSymbol});return this.updateGraphicGeometry(o,e),this.internalGraphicsLayer.add(o),this.addHandles(this.initializeGraphic(o)),this.notifyChange("graphic"),this.addHandles(i((()=>{this.internalGraphicsLayer.remove(o),r(o),this._graphic===o&&(this._graphic=null)})),J),o}updateGraphicGeometry(e,t){e.geometry=t}_getCreateOperationGeometry(e={operationComplete:!1}){const{drawOperation:t}=this;if(null==t||0===t.numVertices)return null;const{coordinateHelper:o,view:i}=t,r=t.stagedVertex,n=t.committedVertices,l=n.slice(),a=null!=r;a&&l.push(o.pointToArray(r));const s=a?o.pointToArray(r):n.splice(-1)[0],p=l.length,c=i.spatialReference,h="3d"===i.type&&"global"===i.viewingMode,u=new B;switch(this.geometryType){case"point":case"mesh":u.regularVertices=n,u.activeVertex=s,u.full=o.arrayToPoint(l[0]);break;case"multipoint":u.regularVertices=n,u.activeVertex=s,p>0&&(u.full=G(l,c));break;case"polyline":u.regularVertices=n,u.activeVertex=s,p>0&&(u.full=O([l],c,h));break;case"polygon":u.regularVertices=n,u.activeVertex=s,p>0&&(u.full=w([l],c,h,!0));break;case"circle":if(p>0){const t=T(i,l[0]);if(1===p&&e.operationComplete){const e=l[0],o=t.makeMapPoint(e[0]+W*i.resolution,e[1]);u.circle=f([e,o],t,!0),u.full=null!=u.circle?u.circle.geometry:null}else 2===p&&(this.forceUniformSize?(u.circle=f(l,t,this.centered),u.full=null!=u.circle?u.circle.geometry:null):(u.rectangle=_(l,t,this.centered),u.full=u.rectangle.geometry))}break;case"rectangle":if(p>0){const t=T(i,l[0]);if(1===p&&e.operationComplete){const e=l[0],o=t.makeMapPoint(e[0]+W*i.resolution,e[1]);u.rectangle=g([e,o],t,!0),u.full=u.rectangle.geometry}else 2===p&&(u.rectangle=this.forceUniformSize?g(l,t,this.centered):v(l,t,this.centered),u.full=u.rectangle.geometry)}break;default:return null}switch(this.geometryType){case"point":case"multipoint":break;case"polyline":u.outline=p>1?O([l],c,h):null;break;case"polygon":u.outline=p>1?w([l],c,h):null;break;case"circle":case"rectangle":u.outline="polygon"===u.full?.type?w(u.full.rings,c,h):null}return u}initializeGraphic(e){return i()}onComplete(e){this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const e=this._getCreateOperationGeometry({operationComplete:!0});null!=e&&(t=this._createOrUpdateGraphic(e.full).clone())}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}onVertexAdd(e){this._updateGraphic(),this._clearConstraints(),this.emit("vertex-add",e)}onVertexRemove(e){this._updateGraphic(),this._clearConstraints(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,null!=e?(null!=e.outline?this.addHandles(this.onOutlineChanged(e.outline),K.outline):this.removeHandles(K.outline),null!=e.regularVertices?this.addHandles(this.onRegularVerticesChanged(e.regularVertices),K.regularVertices):this.removeHandles(K.regularVertices),null!=e.activeVertex?this.addHandles(this.onActiveVertexChanged(e.activeVertex),K.activeVertex):this.removeHandles(K.activeVertex),null!=e.full?this._createOrUpdateGraphic(e.full):this.removeHandles(J)):this._destroyAllVisualisations()}get _tooltipInfo(){const{drawOperation:e,graphic:t,view:o}=this;if(!e)return null;const i=this.tooltipInfos,r=t?.geometry?.type;switch(this.geometryType){case"point":return"2d"===o.type&&0===this.defaultZ?null:"point"===r?i.point:null;case"polyline":return"polyline"===r?i.polyline:null;case"polygon":return"polygon"===r?i.polygon:null;case"rectangle":return"polygon"===r?i.rectangle:null;case"circle":return"polygon"===r?i.circle:null;case"mesh":return"mesh"===r?i.mesh:null;default:return null}}_updateTooltipInfo(){const{_tooltipInfo:e,tooltip:t}=this;if(e&&t){switch(e.type){case"draw-point":this._updateDrawPointTooltipInfo(e);break;case"draw-polyline":this._updateDrawPolylineTooltipInfo(e);break;case"draw-polygon":this._updateDrawPolygonTooltipInfo(e);break;case"draw-rectangle":this._updateDrawRectangleTooltipInfo(e);break;case"draw-circle":this._updateDrawCircleTooltipInfo(e);break;case"draw-mesh":this.updateDrawMeshTooltipInfo(e)}t.info=e}}_updateDrawPointTooltipInfo(e){e.tooltipOptions=this.tooltipOptions,e.viewType=this.view.type,e.helpMessage=x("point",this.graphic?.geometry),this.updateElevation(e.elevation)}_updateDrawPolylineTooltipInfo(e){const t=this._createOperationGeometry,o=null!=t?t.full:null;if("polyline"!==o?.type)return;const{drawOperation:i,tooltipOptions:r,view:n}=this,{lastVertex:a,stagedVertex:s}=i;this._updatePolylineOrPolygonCommon(e,s);const p=L(o,this._elevationMode);e.totalLength.actual=p??l,e.totalLength.hidden=null==length||!a,e.tooltipOptions=r,e.viewType=n.type,e.helpMessage=x("polyline",o),this.updateElevation(e.elevation)}_updateDrawPolygonTooltipInfo(e){const t=this._createOperationGeometry,o=null!=t?t.full:null;if("polygon"!==o?.type)return;const{drawOperation:i,tooltipOptions:r,view:n}=this,{lastVertex:l}=i;let s=i.stagedVertex;"polygon"===o?.type&&l&&!s&&(s=o.getPoint(0,o.rings[0].length-1)),this._updatePolylineOrPolygonCommon(e,s);const p=R(o,this._elevationMode);e.area.actual=p??a,e.area.hidden=null==p&&!l,e.tooltipOptions=r,e.viewType=n.type,e.helpMessage=x("polygon",o),this.updateElevation(e.elevation)}_updatePolylineOrPolygonCommon(e,t){const{view:o,drawOperation:i}=this,{elevationInfo:r,lastVertex:n}=i;if(!n||!t)return e.distance.hidden=!0,e.orientation.hidden=!0,void(i.constraint=void 0);const a=Z(n,t,this._elevationMode);e.distance.actual=a??l,e.distance.hidden=!1;const p=A(n,t);e.orientation.actual=p??s,e.orientation.hidden=!1,i.constraint=S([j(n,e.distance.committed,o,r),C(n,e.orientation.committed,o,r),U(e.elevation.committed,n.spatialReference)])}updateDrawMeshTooltipInfo(e){}_updateDrawRectangleTooltipInfo(e){e.tooltipOptions=this.tooltipOptions,e.xSize=this._xSize??l,e.ySize=this._ySize??l,e.area=this._fullGeometryArea??a}_updateDrawCircleTooltipInfo(e){const{forceUniformSize:t}=this;e.tooltipOptions=this.tooltipOptions,e.radius=t?this._circleRadius??l:null,e.xSize=t?null:this._xSize??l,e.ySize=t?null:this._ySize??l,e.area=this._fullGeometryArea??a}get _circleRadius(){const e=this._createOperationGeometry;return null!=e&&null!=e.circle&&null!=e.circle.center&&null!=e.circle.edge?N(e.circle.center,e.circle.edge,this._elevationMode):null}get _xSize(){const e=this._createOperationGeometry?.rectangle?.midpoints;return null!=e?N(e.left,e.right,this._elevationMode):null}get _ySize(){const e=this._createOperationGeometry?.rectangle?.midpoints;return null!=e?N(e.top,e.bottom,this._elevationMode):null}get _fullGeometryArea(){const e=this._createOperationGeometry?.full;return"polygon"!==e?.type?null:R(e,this._elevationMode)}updateElevation(e){e.actual=this._vertexTooltipElevation}get _vertexTooltipElevation(){const{tooltipOptions:e,view:t,drawOperation:o}=this;if(null==o)return this._defaultElevation;const i=o.stagedVertex??o.lastVertex;if(null==i||"2d"===t.type)return this._defaultElevation;const r={mode:e.elevation.mode,offset:0},l=(y(t,i,o.elevationInfo,r)??0)*h(i.spatialReference);return n(l,"meters")}get _elevationMode(){return this.drawOperation.isDraped?"on-the-ground":"absolute-height"}_clearConstraints(){for(const[,e]of Object.entries(this.tooltipInfos))e.unlockAllFields()}};e([u()],F.prototype,"_createOperationGeometry",void 0),e([u()],F.prototype,"_defaultElevation",null),e([u({value:!0})],F.prototype,"centered",null),e([u({nonNullable:!0})],F.prototype,"defaultZ",void 0),e([u()],F.prototype,"drawOperation",void 0),e([u({value:!0})],F.prototype,"enabled",null),e([u({value:!0})],F.prototype,"forceUniformSize",null),e([u({constructOnly:!0})],F.prototype,"geometryType",void 0),e([u()],F.prototype,"graphic",null),e([u({constructOnly:!0})],F.prototype,"graphicProperties",void 0),e([u()],F.prototype,"graphicSymbol",null),e([u({constructOnly:!0})],F.prototype,"hasZ",void 0),e([u({constructOnly:!0,type:b})],F.prototype,"labelOptions",void 0),e([u({constructOnly:!0})],F.prototype,"geometryToPlace",void 0),e([u({constructOnly:!0})],F.prototype,"mode",void 0),e([u()],F.prototype,"snappingManager",void 0),e([u()],F.prototype,"snapToScene",void 0),e([u()],F.prototype,"tooltip",void 0),e([u()],F.prototype,"tooltipInfos",void 0),e([u({constructOnly:!0,type:I})],F.prototype,"tooltipOptions",void 0),e([u({readOnly:!0})],F.prototype,"type",void 0),e([u({readOnly:!0})],F.prototype,"updating",null),e([u({constructOnly:!0,nonNullable:!0})],F.prototype,"view",void 0),e([u()],F.prototype,"_tooltipInfo",null),e([u()],F.prototype,"_circleRadius",null),e([u()],F.prototype,"_xSize",null),e([u()],F.prototype,"_ySize",null),e([u()],F.prototype,"_fullGeometryArea",null),e([u()],F.prototype,"_vertexTooltipElevation",null),e([u()],F.prototype,"_elevationMode",null),F=e([d("esri.views.draw.DrawGraphicTool")],F);const J="create-operation-graphic",K={outline:"outline-visual",regularVertices:"regular-vertices-visual",activeVertex:"active-vertex-visual"};function Q(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const W=48;export{B as CreateOperationGeometry,F as DrawGraphicTool,Q as geometryTypeToDrawOperationGeometryType};
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import i from"../../core/Evented.js";import{makeHandle as o}from"../../core/handleUtils.js";import{destroyMaybe as r}from"../../core/maybe.js";import{memoize as n}from"../../core/memoize.js";import{createLength as l,zeroMeters as a,zeroSquareMeters as s,zeroDegrees as p}from"../../core/quantityUtils.js";import{watch as c,syncAndInitial as h}from"../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as u}from"../../core/unitUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import y from"../../layers/GraphicsLayer.js";import{getConvertedElevation as g}from"../../support/elevationInfoUtils.js";import{createSquare as v,createRectangle as f,createCircle as _,createEllipse as w,createPolygon as O,createPolyline as x,createMultipoint as G}from"./support/createUtils.js";import{getDrawHelpMessage as V}from"./support/helpMessageUtils.js";import{createViewAlignedCoordinateSystem as T}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as b}from"../interactive/InteractiveToolBase.js";import{tooltipKeys as C}from"../interactive/keybindings.js";import I from"../interactive/sketch/SketchLabelOptions.js";import j from"../interactive/sketch/SketchTooltipOptions.js";import{intersectAll as S,getDistanceConstraint as U,getOrientationConstraint as k,getElevationConstraint as M}from"../interactive/tooltip/constraintUtils.js";import{DrawPointTooltipInfo as P,DrawPolylineTooltipInfo as z,DrawPolygonTooltipInfo as D,DrawMeshTooltipInfo as E,DrawRectangleTooltipInfo as H,DrawCircleTooltipInfo as A}from"../interactive/tooltip/DrawTooltipInfos.js";import{Tooltip as R}from"../interactive/tooltip/Tooltip.js";import{orientationBetweenPoints as L}from"../support/angularMeasurementUtils.js";import{autoAreaByElevationMode as Z}from"../support/automaticAreaMeasurementUtils.js";import{autoLengthByElevationMode as F,autoDirectDistanceByElevationModeBetweenPoints as N,autoHorizontalDistanceByElevationModeBetweenPoints as q}from"../support/automaticLengthMeasurementUtils.js";import{autorun as B}from"../../core/accessorSupport/trackingUtils.js";class J{constructor(){this.regularVertices=null,this.activeVertex=null,this.full=null,this.outline=null,this.circle=null,this.rectangle=null}}let K=class extends(i.EventedMixin(b)){constructor(t){super(t),this._graphic=null,this._createOperationGeometry=null,this.defaultZ=0,this.geometryType=null,this.hasZ=!0,this.labelOptions=new I,this.geometryToPlace=null,this.mode=null,this.snappingManager=null,this.snapToScene=!1,this.tooltip=null,this.tooltipOptions=new j,this._getPointConstraint=n((t=>t)),this._getPolylineOrPolygonConstraint=n(((t,e,i)=>S([t,e,i]))),this._getDistanceConstraint=n(U),this._getOrientationConstraint=n(k),this._getElevationConstraint=n(M)}initialize(){this.internalGraphicsLayer=new y({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer),this.drawOperation=this.makeDrawOperation();const t=this.tooltipOptions,e=this.view.type;this.tooltipInfos={point:new P({tooltipOptions:t,viewType:e}),polyline:new z({tooltipOptions:t,viewType:e}),polygon:new D({tooltipOptions:t,viewType:e}),mesh:new E({tooltipOptions:t,viewType:e}),rectangle:new H({tooltipOptions:t}),circle:new A({tooltipOptions:t})},this.addHandles([this.drawOperation.on("vertex-add",(t=>this.onVertexAdd(t))),this.drawOperation.on("vertex-remove",(t=>this.onVertexRemove(t))),this.drawOperation.on("vertex-update",(t=>this.onVertexUpdate(t))),this.drawOperation.on("cursor-update",(t=>this.onCursorUpdate(t))),this.drawOperation.on("complete",(t=>this.onComplete(t))),c((()=>this.tooltipOptions.enabled),(t=>{this.tooltip=t?new R({view:this.view,info:this._tooltipInfo}):r(this.tooltip)}),h),B((()=>this._updateTooltipInfo()))]),this.finishToolCreation()}destroy(){this.drawOperation=r(this.drawOperation),this.tooltip=r(this.tooltip),this._destroyAllVisualisations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=r(this.internalGraphicsLayer),this._set("view",null)}get _defaultElevation(){return l(this.defaultZ,"meters")}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(t){this._set("centered",t),this._updateGraphic()}set enabled(t){this.drawOperation.interactive=t,this._set("enabled",t)}set forceUniformSize(t){this._set("forceUniformSize",t),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(t){this._set("graphicSymbol",t),null!=this._graphic&&(this._graphic.symbol=t)}get updating(){return this.drawOperation?.updating??!1}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(t){const e=this._tooltipInfo;if("key-down"===t.type&&t.key===C.enterInputMode&&null!=e&&e.editableFields.length>0&&this.tooltipOptions.inputEnabled)return e.enterInputMode(),void t.stopPropagation();this.drawOperation.onInputEvent(t)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}_destroyAllVisualisations(){this.removeHandles(W.outline),this.removeHandles(W.regularVertices),this.removeHandles(W.activeVertex),this.removeHandles(Q)}_createOrUpdateGraphic(t){if(null!=this._graphic)return this.updateGraphicGeometry(this._graphic,t),this._graphic;const i=this._graphic=new e({...this.graphicProperties,symbol:this.graphicSymbol});return this.updateGraphicGeometry(i,t),this.internalGraphicsLayer.add(i),this.addHandles(this.initializeGraphic(i)),this.notifyChange("graphic"),this.addHandles(o((()=>{this.internalGraphicsLayer.remove(i),r(i),this._graphic===i&&(this._graphic=null)})),Q),i}updateGraphicGeometry(t,e){t.geometry=e}_getCreateOperationGeometry(t={operationComplete:!1}){const{drawOperation:e}=this;if(null==e||0===e.numVertices)return null;const{coordinateHelper:i,view:o}=e,r=e.stagedVertex,n=e.committedVertices,l=n.slice(),a=null!=r;a&&l.push(i.pointToArray(r));const s=a?i.pointToArray(r):n.splice(-1)[0],p=l.length,c=o.spatialReference,h="3d"===o.type&&"global"===o.viewingMode,u=new J;switch(this.geometryType){case"point":case"mesh":u.regularVertices=n,u.activeVertex=s,u.full=i.arrayToPoint(l[0]);break;case"multipoint":u.regularVertices=n,u.activeVertex=s,p>0&&(u.full=G(l,c));break;case"polyline":u.regularVertices=n,u.activeVertex=s,p>0&&(u.full=x([l],c,h));break;case"polygon":u.regularVertices=n,u.activeVertex=s,p>0&&(u.full=O([l],c,h,!0));break;case"circle":if(p>0){const e=T(o,l[0]);if(1===p&&t.operationComplete){const t=l[0],i=e.makeMapPoint(t[0]+Y*o.resolution,t[1]);u.circle=_([t,i],e,!0),u.full=null!=u.circle?u.circle.geometry:null}else 2===p&&(this.forceUniformSize?(u.circle=_(l,e,this.centered),u.full=null!=u.circle?u.circle.geometry:null):(u.rectangle=w(l,e,this.centered),u.full=u.rectangle.geometry))}break;case"rectangle":if(p>0){const e=T(o,l[0]);if(1===p&&t.operationComplete){const t=l[0],i=e.makeMapPoint(t[0]+Y*o.resolution,t[1]);u.rectangle=v([t,i],e,!0),u.full=u.rectangle.geometry}else 2===p&&(u.rectangle=this.forceUniformSize?v(l,e,this.centered):f(l,e,this.centered),u.full=u.rectangle.geometry)}break;default:return null}switch(this.geometryType){case"point":case"multipoint":break;case"polyline":u.outline=p>1?x([l],c,h):null;break;case"polygon":u.outline=p>1?O([l],c,h):null;break;case"circle":case"rectangle":u.outline="polygon"===u.full?.type?O(u.full.rings,c,h):null}return u}initializeGraphic(t){return o()}onComplete(t){this._updateGraphic();let e=null;if(this.drawOperation.isCompleted){const t=this._getCreateOperationGeometry({operationComplete:!0});null!=t&&(e=this._createOrUpdateGraphic(t.full).clone())}this._createOperationGeometry=null,this.emit("complete",{graphic:e,...t})}onCursorUpdate(t){this._updateGraphic(),this.emit("cursor-update",t)}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}onVertexAdd(t){this._updateGraphic(),this._clearConstraints(),this.emit("vertex-add",t)}onVertexRemove(t){this._updateGraphic(),this._clearConstraints(),this.emit("vertex-remove",t)}onVertexUpdate(t){this._updateGraphic(),this.emit("vertex-update",t)}_updateGraphic(){const t=this._getCreateOperationGeometry();this._createOperationGeometry=t,null!=t?(null!=t.outline?this.addHandles(this.onOutlineChanged(t.outline),W.outline):this.removeHandles(W.outline),null!=t.regularVertices?this.addHandles(this.onRegularVerticesChanged(t.regularVertices),W.regularVertices):this.removeHandles(W.regularVertices),null!=t.activeVertex?this.addHandles(this.onActiveVertexChanged(t.activeVertex),W.activeVertex):this.removeHandles(W.activeVertex),null!=t.full?this._createOrUpdateGraphic(t.full):this.removeHandles(Q)):this._destroyAllVisualisations()}get _tooltipInfo(){const{drawOperation:t,graphic:e,view:i}=this;if(!t)return null;const o=this.tooltipInfos,r=e?.geometry?.type;switch(this.geometryType){case"point":return"2d"===i.type&&0===this.defaultZ?null:"point"===r?o.point:null;case"polyline":return"polyline"===r?o.polyline:null;case"polygon":return"polygon"===r?o.polygon:null;case"rectangle":return"polygon"===r?o.rectangle:null;case"circle":return"polygon"===r?o.circle:null;case"mesh":return"mesh"===r?o.mesh:null;default:return null}}_updateTooltipInfo(){const{_tooltipInfo:t,tooltip:e}=this;if(t&&e){switch(t.type){case"draw-point":this._updateDrawPointTooltipInfo(t);break;case"draw-polyline":this._updateDrawPolylineTooltipInfo(t);break;case"draw-polygon":this._updateDrawPolygonTooltipInfo(t);break;case"draw-rectangle":this._updateDrawRectangleTooltipInfo(t);break;case"draw-circle":this._updateDrawCircleTooltipInfo(t);break;case"draw-mesh":this.updateDrawMeshTooltipInfo(t)}e.info=t}}_updateDrawPointTooltipInfo(t){const{drawOperation:e,graphic:i,view:o,tooltipOptions:r}=this,{elevationInfo:n,stagedVertex:l}=e;if(t.tooltipOptions=r,t.viewType=o.type,t.helpMessage=V("point",i?.geometry),this.updateElevation(t.elevation),!l)return void(e.constraint=void 0);const a=e.coordinateHelper.spatialReference;e.constraint=this._getPointConstraint(this._getElevationConstraint(t.elevation.committed,a,o,n))}_updateDrawPolylineTooltipInfo(t){const e=this._createOperationGeometry,i=null!=e?e.full:null;if("polyline"!==i?.type)return;const{drawOperation:o,tooltipOptions:r,view:n}=this,{lastVertex:l,stagedVertex:s}=o;this._updatePolylineOrPolygonCommon(t,s);const p=F(i,this._elevationMode);t.totalLength.actual=p??a,t.totalLength.hidden=null==length||!l,t.tooltipOptions=r,t.viewType=n.type,t.helpMessage=V("polyline",i),this.updateElevation(t.elevation)}_updateDrawPolygonTooltipInfo(t){const e=this._createOperationGeometry,i=null!=e?e.full:null;if("polygon"!==i?.type)return;const{drawOperation:o,tooltipOptions:r,view:n}=this,{lastVertex:l}=o;let a=o.stagedVertex;"polygon"===i?.type&&l&&!a&&(a=i.getPoint(0,i.rings[0].length-1)),this._updatePolylineOrPolygonCommon(t,a);const p=Z(i,this._elevationMode);t.area.actual=p??s,t.area.hidden=null==p&&!l,t.tooltipOptions=r,t.viewType=n.type,t.helpMessage=V("polygon",i),this.updateElevation(t.elevation)}_updatePolylineOrPolygonCommon(t,e){const{view:i,drawOperation:o}=this,{elevationInfo:r,lastVertex:n}=o;if(!n||!e)return t.distance.hidden=!0,t.orientation.hidden=!0,void(o.constraint=void 0);const l=N(n,e,this._elevationMode);t.distance.actual=l??a,t.distance.hidden=!1;const s=L(n,e);t.orientation.actual=s??p,t.orientation.hidden=!1;const c=o.coordinateHelper.spatialReference;o.constraint=this._getPolylineOrPolygonConstraint(this._getDistanceConstraint(n,t.distance.committed,i,r),this._getOrientationConstraint(n,t.orientation.committed,i,r),this._getElevationConstraint(t.elevation.committed,c,i,r))}updateDrawMeshTooltipInfo(t){}_updateDrawRectangleTooltipInfo(t){t.tooltipOptions=this.tooltipOptions,t.xSize=this._xSize??a,t.ySize=this._ySize??a,t.area=this._fullGeometryArea??s}_updateDrawCircleTooltipInfo(t){const{forceUniformSize:e}=this;t.tooltipOptions=this.tooltipOptions,t.radius=e?this._circleRadius??a:null,t.xSize=e?null:this._xSize??a,t.ySize=e?null:this._ySize??a,t.area=this._fullGeometryArea??s}get _circleRadius(){const t=this._createOperationGeometry;return null!=t&&null!=t.circle&&null!=t.circle.center&&null!=t.circle.edge?q(t.circle.center,t.circle.edge,this._elevationMode):null}get _xSize(){const t=this._createOperationGeometry?.rectangle?.midpoints;return null!=t?q(t.left,t.right,this._elevationMode):null}get _ySize(){const t=this._createOperationGeometry?.rectangle?.midpoints;return null!=t?q(t.top,t.bottom,this._elevationMode):null}get _fullGeometryArea(){const t=this._createOperationGeometry?.full;return"polygon"!==t?.type?null:Z(t,this._elevationMode)}updateElevation(t){t.actual=this._vertexTooltipElevation}get _vertexTooltipElevation(){const{tooltipOptions:t,view:e,drawOperation:i}=this;if(null==i)return this._defaultElevation;const o=i.stagedVertex??i.lastVertex;if(null==o||"2d"===e.type)return this._defaultElevation;const r={mode:t.elevation.mode,offset:0},n=(g(e,o,i.elevationInfo,r)??0)*u(o.spatialReference);return l(n,"meters")}get _elevationMode(){return this.drawOperation.isDraped?"on-the-ground":"absolute-height"}_clearConstraints(){for(const[,t]of Object.entries(this.tooltipInfos))t.unlockAllFields()}};t([d()],K.prototype,"_createOperationGeometry",void 0),t([d()],K.prototype,"_defaultElevation",null),t([d({value:!0})],K.prototype,"centered",null),t([d({nonNullable:!0})],K.prototype,"defaultZ",void 0),t([d()],K.prototype,"drawOperation",void 0),t([d({value:!0})],K.prototype,"enabled",null),t([d({value:!0})],K.prototype,"forceUniformSize",null),t([d({constructOnly:!0})],K.prototype,"geometryType",void 0),t([d()],K.prototype,"graphic",null),t([d({constructOnly:!0})],K.prototype,"graphicProperties",void 0),t([d()],K.prototype,"graphicSymbol",null),t([d({constructOnly:!0})],K.prototype,"hasZ",void 0),t([d({constructOnly:!0,type:I})],K.prototype,"labelOptions",void 0),t([d({constructOnly:!0})],K.prototype,"geometryToPlace",void 0),t([d({constructOnly:!0})],K.prototype,"mode",void 0),t([d()],K.prototype,"snappingManager",void 0),t([d()],K.prototype,"snapToScene",void 0),t([d()],K.prototype,"tooltip",void 0),t([d()],K.prototype,"tooltipInfos",void 0),t([d({constructOnly:!0,type:j})],K.prototype,"tooltipOptions",void 0),t([d({readOnly:!0})],K.prototype,"type",void 0),t([d({readOnly:!0})],K.prototype,"updating",null),t([d({constructOnly:!0,nonNullable:!0})],K.prototype,"view",void 0),t([d()],K.prototype,"_tooltipInfo",null),t([d()],K.prototype,"_circleRadius",null),t([d()],K.prototype,"_xSize",null),t([d()],K.prototype,"_ySize",null),t([d()],K.prototype,"_fullGeometryArea",null),t([d()],K.prototype,"_vertexTooltipElevation",null),t([d()],K.prototype,"_elevationMode",null),K=t([m("esri.views.draw.DrawGraphicTool")],K);const Q="create-operation-graphic",W={outline:"outline-visual",regularVertices:"regular-vertices-visual",activeVertex:"active-vertex-visual"};function X(t){switch(t){case"point":case"polyline":case"polygon":case"multipoint":return t;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const Y=48;export{J as CreateOperationGeometry,K as DrawGraphicTool,X as geometryTypeToDrawOperationGeometryType};
|