import { BufferGeometry, type Object3D, Points } from "three";
import { type SunLightConfiguration, type ViralViewerState } from "../..";
import type { ViralViewerApi } from "../../viral-viewer-api";
import { DayNightSimulator } from "./day-night-simulator";
export declare class ViralVisibilityManager {
    private viralViewerApi;
    private static readonly _tempBox3A;
    private static readonly _tempVec3A;
    private static readonly _tempVec3B;
    private static readonly _tempSphereA;
    private static readonly _tempBox3B;
    private static readonly _tempCorners;
    private static readonly _tempBox3C;
    private static readonly _tempVec3C;
    dayNightSimulator: DayNightSimulator;
    /** Whether selection outline is enabled (default: true) */
    private _selectionOutlineEnabled;
    private _aoAllowed;
    private _shadowAllowed;
    private _edgeAllowed;
    private _groundShadowAllowed;
    private _currentIsolatingElements;
    private _currentHidingElements;
    constructor(viralViewerApi: ViralViewerApi);
    get aoAllowed(): boolean;
    set aoAllowed(value: boolean);
    get shadowAllowed(): boolean;
    set shadowAllowed(value: boolean);
    get edgeAllowed(): boolean;
    set edgeAllowed(value: boolean);
    get groundShadowAllowed(): boolean;
    set groundShadowAllowed(value: boolean);
    /**
     * show all elements and reset back to normal visualization
     */
    showAll2(): void;
    /**
     * Hide all elements (sets all meshes invisible)
     */
    hideAllElements(): void;
    /**
     *
     * @param elements default will get selected elements or we can input specific elements
     */
    hide2(elements?: {
        modelId: string;
        elementId: string;
    }[]): void;
    /**
     *
     * @param elements default will get selected elements or we can input specific elements
     * @param ghostColor optional ghost color to use for this isolate operation
     */
    isolate2(elements?: {
        modelId: string;
        elementId: string;
    }[], ghostColor?: {
        r: number;
        g: number;
        b: number;
    }): void;
    /**
     *
     * @param elements default will get selected elements
     */
    zoomTo(elements?: {
        modelId: string;
        elementId: string;
    }[]): void;
    /**
     * Changes the color of multiple elements in the merged mesh.
     * Works with RGBA color buffer (preserves existing alpha values)
     * @param elements - An array of elements, each containing `modelId` and `elementId`.
     * @param color - The new RGB color to apply
     * @param isTemporary - Override for temporary, if element has temporary color it will turn back this color, otherwise will turn back to original - default is false
     */
    changeColor(elements: {
        modelId: string;
        elementId: string;
    }[], color: {
        r: number;
        g: number;
        b: number;
    }, isTemporary?: boolean): void;
    /**
     * except elements from reverse to original color, using for compare model, group elements,...
     */
    exceptElements: {
        elements: {
            modelId: string;
            elementId: string;
        }[];
        color: {
            r: number;
            g: number;
            b: number;
        };
    }[];
    /**
     * Select elements (replaces current selection)
     */
    selectElements(elements: {
        modelId: string;
        elementId: string;
    }[]): void;
    /**
     * Add elements to current selection (multi-select with Shift)
     */
    addToSelection(elements: {
        modelId: string;
        elementId: string;
    }[]): void;
    /**
     * Unselect all elements
     */
    unselectElements(): void;
    selectAllElements(): void;
    isolateModelId: string;
    isolateModel(isolateModelIds?: string[]): void;
    enableSun(): void;
    disableSun(): void;
    enableShadow(): void;
    disableShadow(): void;
    bypassShadow(): void;
    resumeShadow(): void;
    sunConfiguration: SunLightConfiguration;
    private _adjustLightForMesh;
    private _updateDirectLights;
    private _updateLightShadowCamera;
    enableEdge(): void;
    disableEdge(): void;
    /**
     * Enable screen-space edge detection (Speckle-style)
     *
     * This is much more efficient than geometry-based edges because:
     * - No edge geometry is generated (constant GPU memory)
     * - Cost is fixed regardless of model complexity (~2-3ms per frame)
     * - Instanced meshes don't explode into per-instance edges
     * - Edges are detected on-the-fly using depth/normal/ID discontinuities
     *
     * @param mode - 'shaded' (subtle edges) or 'pen' (technical drawing style)
     */
    enableScreenSpaceEdge(mode?: "shaded" | "pen"): void;
    /**
     * Disable screen-space edge detection
     */
    disableScreenSpaceEdge(): void;
    /**
     * 🔧 FAST: Bypass screen-space edges during camera movement
     * Much faster than disable - skips geometry render but keeps pass in pipeline
     */
    bypassScreenSpaceEdge(): void;
    /**
     * 🔧 FAST: Resume screen-space edges after camera stops
     */
    resumeScreenSpaceEdge(): void;
    /**
     * 🔧 FAST: Bypass selection outline during camera movement
     * Much faster than disable - skips mask render but keeps pass in pipeline
     */
    bypassSelectionOutline(): void;
    /**
     * 🔧 FAST: Resume selection outline after camera stops
     */
    resumeSelectionOutline(): void;
    /**
     * Configure screen-space edge detection
     */
    configureScreenSpaceEdge(options: {
        color?: number;
        opacity?: number;
        thickness?: number;
        depthEdges?: boolean;
        normalEdges?: boolean;
        objectIdEdges?: boolean;
    }): void;
    enableAmbientOcclusion(): void;
    disableAmbientOcclusion(): void;
    enableAmbientOcclusionScreenSpaceRadius(): void;
    disableAmbientOcclusionScreenSpaceRadius(): void;
    private _ground;
    enableGroundShadow(mesh?: Object3D): void;
    disableGroundShadow(): void;
    enableOutline(): void;
    disableOutline(): void;
    /**
     * add element to outline effect
     * @param elements
     */
    addToOutline(elements?: {
        modelId: string;
        elementId: string;
    }[]): void;
    /**
     * Update selection outline pass with current selection
     * Uses merged geometry for efficient rendering
     */
    updateSelectionOutline(): void;
    /**
     * Notify the outline pass whether there is an active selection.
     * The GPU reads selection state directly from vertex colors — no CPU work needed.
     */
    private notifySelectionOutline;
    /**
     * Enable selection outline effect
     */
    enableSelectionOutline(): void;
    /**
     * Disable selection outline effect
     */
    disableSelectionOutline(): void;
    /**
     * Set whether selection outline mode is enabled
     * @param enabled - true to enable outline on selection, false to disable
     */
    setSelectionOutlineMode(enabled: boolean): void;
    /**
     * Get whether selection outline mode is enabled
     */
    get selectionOutlineEnabled(): boolean;
    /** Whether alpha selection outline is enabled (default: false, as it requires opt-in) */
    private _alphaSelectionOutlineEnabled;
    /**
     * Update alpha selection outline state
     * This is MUCH faster than updateSelectionOutline() - no geometry copying needed
     */
    updateAlphaSelectionOutline(): void;
    /**
     * Enable alpha selection outline effect
     * This is the FAST outline mode - constant cost regardless of selection size
     */
    enableAlphaSelectionOutline(): void;
    /**
     * Disable alpha selection outline effect
     */
    disableAlphaSelectionOutline(): void;
    /**
     * Set whether alpha selection outline mode is enabled
     * This is the recommended mode for large selections (1000+ elements)
     * @param enabled - true to enable, false to disable
     */
    setAlphaSelectionOutlineMode(enabled: boolean): void;
    /**
     * Get whether alpha selection outline mode is enabled
     */
    get alphaSelectionOutlineEnabled(): boolean;
    /**
     * Bypass alpha selection outline (fast, for camera movement)
     */
    bypassAlphaSelectionOutline(): void;
    /**
     * Resume alpha selection outline after bypass
     */
    resumeAlphaSelectionOutline(): void;
    enableNight(): void;
    disableNight(): void;
    enableSectionBox(): void;
    disableSectionBox(): void;
    showSectionBox(): void;
    hideSectionBox(): void;
    resetSectionBox(): void;
    enableElevationSection(options?: {
        elevation?: number;
        thickness?: number;
        direction?: "top-down" | "bottom-up";
    }): void;
    disableElevationSection(): void;
    setElevation(elevation: number): void;
    setElevationThickness(thickness: number): void;
    setElevationDirection(direction: "top-down" | "bottom-up"): void;
    /**
     *
     * @param opacity from 0 to 1
     */
    opacity: number;
    setOpacity(opacity?: number): void;
    private _fog;
    enableFog(): void;
    disableFog(): void;
    rainGeometry: BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>;
    rain: Points | null;
    private _isGeneratedRain;
    enableRain(): void;
    disableRain(): void;
    /**
     * increase resolution to n, use for upscale resolution for anti alias
     * @param numberOfSampling number of scaling, default is 2
     */
    enableSampling(numberOfSampling?: number): void;
    disableSampling(): void;
    private _patchedMaterials;
    private _patchMaterial;
    enableMovementMaterial(): void;
    disableMovementMaterial(): void;
    private _lambertMaterialCache;
    private _getLambertMaterial;
    enableAdaptiveMaterial(): void;
    disableAdaptiveMaterial(): void;
    private ghostMode;
    /** Default ghost color (optional - if not set, uses desaturation) */
    private _ghostColor?;
    setGhostMode(value: boolean): void;
    /**
     * Set the default ghost color used by isolate2 and other ghost operations
     * @param color - Color {r, g, b} with values 0-1 (e.g., {r: 1, g: 1, b: 1} for white)
     *               Pass undefined to use default desaturation
     */
    setGhostColor(color?: {
        r: number;
        g: number;
        b: number;
    }): void;
    /**
     * Get the current ghost color
     */
    getGhostColor(): {
        r: number;
        g: number;
        b: number;
    } | undefined;
    /**
     * Set opacity for specific elements
     * @param elements - Elements to set opacity for
     * @param opacity - Opacity value (0-1)
     */
    setElementOpacity(elements: {
        modelId: string;
        elementId: string;
    }[], opacity: number): void;
    /**
     * Set elements to "ghost" mode (semi-transparent)
     * @param elements - Elements to ghost
     * @param ghostOpacity - Opacity for ghosted elements (default 0.1)
     * @param ghostColor - Optional custom color for ghosted elements (e.g., {r: 1, g: 1, b: 1} for white)
     */
    setElementGhost(elements: {
        modelId: string;
        elementId: string;
    }[], ghostOpacity?: number, ghostColor?: {
        r: number;
        g: number;
        b: number;
    }): void;
    /**
     * Ghost all elements EXCEPT the specified ones (highlight effect)
     * @param elements - Elements to keep fully opaque
     * @param ghostOpacity - Opacity for all other elements (default 0.1)
     * @param ghostColor - Optional custom color for ghosted elements (e.g., {r: 1, g: 1, b: 1} for white)
     */
    ghostExcept(elements: {
        modelId: string;
        elementId: string;
    }[], ghostOpacity?: number, ghostColor?: {
        r: number;
        g: number;
        b: number;
    }): void;
    /**
     * Reset all elements to full opacity
     */
    resetElementOpacity(): void;
    generateLOD(): void;
    private _batchColors;
    private _originalBatchMaterials;
    private _batchVisualizationEnabled;
    /**
     * Generate a random but distinct color for each material ID
     */
    private _generateDistinctColor;
    /**
     * Show batches with distinct colors based on their globalMaterialId
     * Each batch with the same globalMaterialId will have the same random color
     */
    showBatches(): void;
    /**
     * Hide batches and restore original materials
     */
    hideBatches(): void;
    /**
     * Check if batch visualization is currently enabled
     */
    isBatchVisualizationEnabled(): boolean;
    showHidePercentage: number;
    showHideByPercentage(value?: number): void;
    randomColor: number;
    changeRandomColor(value?: number): void;
    /**
     * Isolate elements by level - shows only elements on the specified level
     */
    isolateLevel(modelId: number, levelId: number): {
        modelId: string;
        elementId: string;
    }[];
    getState(): ViralViewerState | null;
    restoreState(state: ViralViewerState, enableTransition?: boolean): void;
}
