Singleton constructor. Returns the already-active instance if one exists.
Tool activation button.
Backup of the original Cesium shadow map.
Required/precondition states.
States that are deactivated when this state activates.
Event handler for settings-update.
Name/identifier for the state.
States that should be restored when this state ends.
Max distance input (linked to viewshed shader).
Toggle input for shadow display.
Enters viewshed mode: loads GLSL shader, configures the viewshed tool, disables selection, adjusts layers, sets up UI/listeners/shadow maps, and shows window.
Removes post-processing and closes window, restoring cursor and interaction.
Detaches slider value change handler from the viewshed tool.
Handles full teardown of viewshed mode: restores opacity, cleans up shadow/post-processing, event handlers, and disables window.
ViewshedState – App UI state for interactive viewshed/visibility analysis using custom shader post-processing.
Enforces singleton behavior (only one active state at a time) and handles shader loading, event listeners, slider/button controls, layer opacity, shadow map configuration, and state entry/exit logic. Integrates with application-wide settings updates and provides dynamic distance and height offset adjustment for the analysis.
Param: button
The UI button tied to the viewshed tool.
Static
instance - Singleton instance.
Example