sec_interp.gui.dialog_preview_manager module
Preview management module for SecInterp main dialog.
This module handles preview generation, rendering, and updates, separating preview logic from the main dialog class. Async callbacks and the render pipeline live in dedicated mixins.
- class sec_interp.gui.dialog_preview_manager.PreviewManager(dialog: Any, preview_service: IPreviewService | None = None, cache: PreviewCache | None = None, ve_service: VerticalExaggerationService | None = None)
Bases:
TranslatableMixin,PreviewCallbacksMixin,PreviewRenderMixinManages preview generation and rendering for the dialog.
This class encapsulates all preview-related logic, including data generation, rendering, and updates based on user interactions.
- __init__(dialog: Any, preview_service: IPreviewService | None = None, cache: PreviewCache | None = None, ve_service: VerticalExaggerationService | None = None) None
Initialize preview manager with specialized components.
- cleanup() None
Clean up resources and stop background tasks.
- generate_preview() tuple[bool, str]
Generate complete preview with all available data layers.
- is_preview_current() bool
Check whether the last successful preview matches the current inputs.
Fail-closed: without a successful generation (or on any assembly failure) the dependent buttons stay disabled. Assembly is side-effect free (no validation dialogs, no notification wiring, no geometry reads).
- set_interpretations_cleared_handler(handler: Callable[[], None]) None
Register the callback invoked when section geometry changes.
- Parameters:
handler – Callable that clears persisted interpretations.