import { WebGLRenderer } from 'three'; import { IntersectInput } from '../../../model-base'; import { CadMaterialManager } from '../../../rendering'; import { SceneHandler } from '../../../utilities'; import { CadNode } from '../wrappers/CadNode'; import { IntersectCadNodesResult } from './types'; /** * Full-frame pick cache. Renders the tree index and depth of all visible models in one pass each * and serves picks from the CPU copy until the scene is rendered again. */ export declare class CadPickCache { private static readonly REBUILD_HOLDOFF_MS; private static readonly MAX_CACHED_MODELS; private readonly _clearColor; private readonly _clearAlpha; private readonly _renderTarget; private readonly _pipelineExecutor; private readonly _depthRenderPipeline; private readonly _treeIndexRenderPipeline; private _cache; private _invalidationCount; private _lastInvalidatedAt; private _isDisposed; constructor(renderer: WebGLRenderer, materialManager: CadMaterialManager, sceneHandler: SceneHandler); /** * Marks the cache stale. Must be called whenever the camera or scene content that affects picking changes, as the * cache does not compare the camera itself. */ invalidate(): void; dispose(): void; /** * Picks from the cache, rebuilding it first when it is stale and the frame is likely to stay * unchanged. Returns undefined when the per-model path should be used instead. */ intersect(visibleCadNodes: CadNode[], input: IntersectInput, shouldRunAsync: boolean): Promise; private isUsable; /** * Renders the tree index and depth of all visible models into full-frame buffers, one pass each, * so every pixel holds the hit closest to the camera. Returns false if the result is stale. */ private build; private renderAndReadFullFrame; }