import type { BimProductMeshPreMerge } from './BimProductMesh';
import type { CullOnCameraMovePredicate } from './CullOnCameraMovePredicate';
import { IntVector3Map } from './IntVector3Map';
import { MergeId, MergeIdBuilderAlgorithm } from './MergeId';
/**
 * AABB type configurations for categorizing meshes by size.
 * - `large`: Default type for meshes exceeding {@link small.maxLength}, no distance-based culling.
 * - `small`: For meshes smaller than {@link small.maxLength}, enables distance-based culling at 15 units.
 */
declare const aabbTypes: {
    large: {
        id: number;
        k: number;
        suffix: string;
        distance: number;
    };
    small: {
        id: number;
        k: number;
        suffix: string;
        maxLength: number;
        distance: number;
    };
};
/**
 * Extended MergeId interface with additional properties for cube cell merging.
 */
interface CubeCellMergeId extends MergeId {
    /** Composite mesh type: `opacityId | (aabbTypeId << 1) | (cullOnCameraMoveId << 2)`. Range: 0-7. */
    readonly meshType: number;
    /** Opacity flag: 0 = opaque, 1 = transparent. */
    readonly opacityId: number;
    /** Cull-on-camera-move flag: 0 = no culling, 1 = cull when camera moves. */
    readonly cullOnCameraMoveId: number;
    /** Power-of-2 side length of the grid cell in world units. */
    readonly pow2SideLen: number;
    /** AABB type configuration (large or small) determining culling behavior. */
    readonly aabbType: typeof aabbTypes.large | typeof aabbTypes.small;
    /** Hierarchy level: 0 = smallest cells ({@link minAABBSideLen}), higher = larger cells (2^level × minAABBSideLen). */
    readonly level: number;
}
/**
 * Tuple of 8 maps, one for each mesh type combination.
 * Mesh type is a 3-bit value: `opacityId | (aabbTypeId << 1) | (cullOnCameraMoveId << 2)`.
 * Each map stores level → spatial map of {@link CubeCellMergeId} instances.
 */
type MergeMapsByMeshType = [
    Map<number, IntVector3Map<CubeCellMergeId>>,
    Map<number, IntVector3Map<CubeCellMergeId>>,
    Map<number, IntVector3Map<CubeCellMergeId>>,
    Map<number, IntVector3Map<CubeCellMergeId>>,
    Map<number, IntVector3Map<CubeCellMergeId>>,
    Map<number, IntVector3Map<CubeCellMergeId>>,
    Map<number, IntVector3Map<CubeCellMergeId>>,
    Map<number, IntVector3Map<CubeCellMergeId>>
];
/**
 * Manages the creation and hierarchical merging of {@link CubeCellMergeId} instances.
 *
 * Meshes are spatially hashed into grid cells based on their AABB. Small cells with
 * insufficient geometry are progressively merged into larger parent cells to optimize
 * rendering by reducing draw calls while maintaining spatial locality.
 */
export declare class CubeCellMergeIdAlgorithm implements MergeIdBuilderAlgorithm {
    readonly prefix: string;
    /** Minimum index count required per cube to avoid merging.*/
    private readonly _minIndiceCountRequiredPerCube;
    /** Maps organized by mesh type (8 combinations of opacity, AABB type, and cull-on-move). */
    private _mergeIdMapsByMeshType;
    /** Maps level number to the set of {@link CubeCellMergeId} instances at that level. */
    private _mergeIdsByLevel;
    /**
     * Creates a new MergeIdMap instance.
     * @param prefix - Prefix string used when generating merge ID strings.
     * @param minIndiceCountRequiredPerCube - Minimum index count required per cube to avoid merging. Defaults to 128k indices.
     */
    constructor(prefix: string, minIndiceCountRequiredPerCube?: number);
    /**
     * Adds a mesh to the appropriate {@link MergeId} based on its spatial location and properties.
     *
     * The mesh's AABB is calculated in world space and assigned to a grid cell. The cell size
     * is the smallest power-of-2 that can contain the mesh's AABB (minimum {@link minAABBSideLen}).
     *
     * @param mesh - The product mesh to add.
     * @param cullOnCameraMovePredicate - Predicate to determine if the mesh should be culled on camera move.
     * @returns The {@link MergeId} that the mesh was assigned to.
     */
    add(mesh: BimProductMeshPreMerge, cullOnCameraMovePredicate: CullOnCameraMovePredicate): MergeId;
    /**
     * Gets an existing {@link CubeCellMergeId} or creates a new one for the given parameters.
     *
     * @param cubeCellId - The grid cell coordinates (not world space).
     * @param opacityId - 0 for opaque, 1 for transparent.
     * @param cullOnCameraMoveId - 0 for no culling, 1 for cull on camera move.
     * @param aabbType - The AABB type configuration (large or small).
     * @param pow2SideLen - The power-of-2 side length of the grid cell.
     * @param dst - The destination map structure to store/retrieve the MergeId.
     * @returns The existing or newly created {@link CubeCellMergeId}.
     */
    private getOrAddMergeId;
    /**
     * Builds the final list of {@link MergeId} instances by hierarchically merging small cubes into larger ones.
     *
     * Processing starts at level 0 (smallest cubes) and progresses to larger levels. MergeIds with
     * insufficient indices are merged into their parent cube at the next level. This continues until
     * either only one MergeId remains (nothing to merge with) or all MergeIds have sufficient indices.
     *
     * @returns Array of {@link MergeId} instances that have at least one assigned mesh.
     */
    build(): MergeId[];
    getOrAddParentCubeCell(mergeId: CubeCellMergeId, dst: MergeMapsByMeshType): CubeCellMergeId;
    /**
     * Transfer all ifcProductMeshes from one mergeId to another. Moving a ifc prdoduct mesh also means updating its mergeId reference
     * as it now belongs to a different mergeId.
     * @param mergeId {@link CubeCellMergeId} to move ifcProductMeshes from.
     * @param parentMergeId {@link CubeCellMergeId} to move ifcProductMeshes to.
     */
    private moveIfcProductMeshesTo;
    /**
     * Check if merging is complete at the given level.
     *
     * Two mergeIds can be merged if they:
     * 1. Are both merge candidates (indiceCount < threshold)
     * 2. Have the same meshType (items of different mesh types cannot merge together)
     *
     * @param level Current level being processed.
     * @param maxLevel Max level encountered at start of build.
     * @param mergeIdsOnLevel mergeIds present on {@link level}.
     * @returns `true` if merging is complete. Otherwise `false`.
     */
    private isMergingComplete;
    /**
     * Determine if the given mergeId is a candidate for merging into a larger cube.
     * @param mergeId {@link CubeCellMergeId} to evaluate.
     * @returns `true` if the mergeId is a candidate for merging. Otherwise `false`.
     */
    private isMergeCandidate;
    /**
     * Creates a new Set instance for storing {@link CubeCellMergeId} instances.
     * @returns A new Set instance for {@link CubeCellMergeId} objects.
     */
    static createMergeIdSet(): Set<CubeCellMergeId>;
}
export {};
//# sourceMappingURL=CubeCellMergeIdAlgorithm.d.ts.map