/**
 * @module vim-loader
 */
import * as THREE from 'three';
import { WebglMesh, Submesh } from './mesh';
import { Vim } from './vim';
import { InsertableMesh } from './progressive/insertableMesh';
import { InstancedMesh } from './progressive/instancedMesh';
import { ModelMaterial } from './materials/materials';
import { Renderer } from '../viewer/rendering/renderer';
/**
 * Interface for a renderer object, providing methods to add and remove objects from a scene, update bounding boxes, and notify scene updates.
 */
export interface IRenderer {
    add(scene: WebglScene | THREE.Object3D): any;
    remove(scene: WebglScene): any;
    updateBox(box: THREE.Box3): any;
    notifySceneUpdate(): any;
}
/**
 * Represents a scene that contains multiple meshes.
 * It tracks the global bounding box as meshes are added and maintains a mapping between g3d instance indices and meshes.
 */
export declare class WebglScene {
    private _renderer;
    private _vim;
    private _matrix;
    insertables: InsertableMesh[];
    meshes: (WebglMesh | InsertableMesh | InstancedMesh)[];
    private _boundingBox;
    private _averageBoundingBox;
    private _instanceToMeshes;
    private _material;
    constructor(matrix: THREE.Matrix4);
    setDirty(): void;
    clearUpdateFlag(): void;
    /**
     * Returns the scene bounding box. Returns undefined if scene is empty.
     */
    getBoundingBox(target?: THREE.Box3): THREE.Box3;
    /**
     * Returns the bounding box of the average center of all meshes.
     * Less precise but is more stable against outliers.
     */
    getAverageBoundingBox(): THREE.Box3;
    updateBox(box: THREE.Box3): void;
    getMemory(): number;
    /**
     * Returns the THREE.Mesh in which this instance is represented along with index
     * For merged mesh, index refers to submesh index
     * For instanced mesh, index refers to instance index.
     */
    getMeshFromInstance(instance: number): Submesh[];
    getMeshesFromInstances(instances: number[] | undefined): Submesh[];
    get renderer(): Renderer;
    set renderer(value: Renderer);
    get vim(): Vim;
    /**
     * Sets vim index for this scene and all its THREE.Meshes.
     */
    set vim(value: Vim);
    addSubmesh(submesh: Submesh): void;
    /**
     * Add an instanced mesh to the Scene and recomputes fields as needed.
     * @param mesh Is expected to have:
     * userData.instances = number[] (indices of the g3d instances that went into creating the mesh)
     * userData.boxes = THREE.Box3[] (bounding box of each instance)
     */
    addMesh(mesh: WebglMesh | InsertableMesh | InstancedMesh): this;
    /**
     * Adds the content of other Scene to this Scene and recomputes fields as needed.
     */
    merge(other: WebglScene): this;
    /**
     * Gets the current material override or undefined if none.
     */
    get material(): ModelMaterial;
    /**
     * Sets and apply a material override to the scene, set to undefined to remove override.
     */
    set material(value: ModelMaterial);
    /**
     * Unloads and disposes all meshes and leaves the scene ready to add new ones.
     */
    clear(): void;
    /**
     * Disposes of all resources.
     */
    dispose(): void;
}
