import type ShadowCastAnalysis from "../../../analysis/ShadowCastAnalysis.js"; import type AnalysisView3D from "./AnalysisView3D.js"; import type { ScreenPoint } from "../../../core/types.js"; /** * Represents the analysis view of a [ShadowCastAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/) after it has been added to * [SceneView.analyses](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#analyses). * * The ShadowCastAnalysisView3D is responsible for rendering a [ShadowCastAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/) * using custom visualizations. The [getDurationAtScreen()](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ShadowCastAnalysisView3D/#getDurationAtScreen) method * on the analysis view provides developers with the ability to obtain the specific shadow or sunlight duration at a * certain [point](https://developers.arcgis.com/javascript/latest/references/core/core/types/#ScreenPoint) on the screen or to [disable](#interactive) the tooltip attached to the cursor. * * This analysis view controls the shadow or sunlight overlay produced by [ShadowCastAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/). It does * not control the scene's illumination. To change the scene lighting itself, use [SunLighting](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunLighting/). * * The view for an analysis can be retrieved using [SceneView.whenAnalysisView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenAnalysisView) * similar to how layer views are retrieved for layers using [SceneView.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenLayerView). * ```js * // retrieve analysis view for analysis * const analysis = new ShadowCastAnalysis(); * view.analyses.add(analysis); // add to the scene view * const analysisView = await view.whenAnalysisView(analysis); * ``` * * @since 5.0 * @see [ShadowCastAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/) * @see [DiscreteOptions](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCast/DiscreteOptions/) * @see [MinDurationOptions](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCast/MinDurationOptions/) * @see [TotalDurationOptions](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCast/TotalDurationOptions/) * @see [SunLighting](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunLighting/) * @see [Sample - Shadow Cast analysis object](https://developers.arcgis.com/javascript/latest/sample-code/analysis-shadow-cast/) * @see [Sample - Sunlight analysis](https://developers.arcgis.com/javascript/latest/sample-code/analysis-sunlight/) * @see [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/) * @see [Shadow Cast component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-shadow-cast/) */ export default abstract class ShadowCastAnalysisView3D extends AnalysisView3D { /** * The shadow cast analysis associated with the analysis view. * * @since 5.0 */ get analysis(): ShadowCastAnalysis; /** * Displays the shadow or sunlight tooltip attached to the cursor. Set to `false` to disable it. * * @default true * @since 5.0 */ accessor interactive: boolean; /** * The analysis view type. * * @since 5.0 */ get type(): "shadow-cast-view-3d"; /** * Whether the analysis is currently being updated. * * @since 5.0 */ get updating(): boolean; /** * When `true`, the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ShadowCastAnalysisView3D/#analysis) is visualized in the view. * * Only one [ShadowCastAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/) at a time can be visible in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). * When a shadow cast analysis is made visible by setting this property to `true`, all other shadow cast analysis * views are automatically hidden. * * @since 5.0 */ accessor visible: boolean; /** * Returns the duration (in milliseconds) for a certain point on the screen based on the current analysis settings. * By default, this method returns the time spent in shadow. When * [ShadowCastAnalysis.visualizeSunlight](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#visualizeSunlight) is `true`, this method returns the time spent in sunlight. * * @param point - The point on the screen for which the shadow or sunlight duration is calculated. * @returns A promise that resolves to the duration (in milliseconds) spent in shadow or sunlight for the given * screen point. Returns `-1` when the point is outside the [ShadowCastAnalysis.geometry](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#geometry) project * area. * @since 5.0 * @example * ```js * // use getDurationAtScreen method from the analysis view once available * const analysisView = await view.whenAnalysisView(analysis); * * // get shadow or sunlight duration at the pointer location * view.on("pointer-move", async (event) => { * // duration in milliseconds * const duration = await analysisView.getDurationAtScreen({ x: event.x, y: event.y }); * // ... do something with the duration * }); * ``` */ getDurationAtScreen(point: ScreenPoint): Promise; }