3D-City Model
    Preparing search index...

    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.

    The UI button tied to the viewshed tool.

    instance - Singleton instance.

    const state = new ViewshedState(document.getElementById('visibility-btn'));
    await state.apply(app);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    button: undefined | HTMLButtonElement

    Tool activation button.

    defaultShadowMap: any

    Backup of the original Cesium shadow map.

    dependentStates: string[]

    Required/precondition states.

    exclusiveStates: string[]

    States that are deactivated when this state activates.

    handle: undefined | (() => void)

    Event handler for settings-update.

    name: string

    Name/identifier for the state.

    restoreStates: string[]

    States that should be restored when this state ends.

    slider: undefined | null | HTMLElement

    Max distance input (linked to viewshed shader).

    toggle: undefined | null | HTMLElement

    Toggle input for shadow display.

    Methods

    • Enters viewshed mode: loads GLSL shader, configures the viewshed tool, disables selection, adjusts layers, sets up UI/listeners/shadow maps, and shows window.

      Parameters

      • app: any

      Returns Promise<void>

    • Detaches slider value change handler from the viewshed tool.

      Parameters

      • app: any

      Returns void

    • Handles full teardown of viewshed mode: restores opacity, cleans up shadow/post-processing, event handlers, and disables window.

      Parameters

      • app: any

      Returns void