import { WebGLCapabilities } from 'three'; import LineBatch from './LineBatch.js'; import Materials from '../materials/Materials.js'; import { NodeRenderView } from '../tree/NodeRenderView.js'; import { type Batch, type BatchUpdateRange, GeometryType } from './Batch.js'; import { Material, WebGLRenderer } from 'three'; import { RenderTree } from '../tree/RenderTree.js'; import TextBatch from './TextBatch.js'; import { SpeckleType } from '../loaders/GeometryConverter.js'; import { WorldTree } from '../../index.js'; import { MeshBatch } from './MeshBatch.js'; import { PointBatch } from './PointBatch.js'; import { ObjectVisibility } from '../pipeline/Passes/GPass.js'; type BatchTypeMap = { [GeometryType.MESH]: MeshBatch; [GeometryType.LINE]: LineBatch; [GeometryType.POINT]: PointBatch; [GeometryType.POINT_CLOUD]: PointBatch; [GeometryType.TEXT]: TextBatch; }; export default class Batcher { private caps; private maxBatchObjects; private maxBatchVertices; private minInstancedBatchVertices; private maxBatchTextObjects; materials: Materials; batches: { [id: string]: Batch; }; constructor(caps: WebGLCapabilities); makeBatches(worldTree: WorldTree, renderTree: RenderTree, speckleType: SpeckleType[], batchType?: GeometryType): AsyncGenerator; private splitBatch; private getMaxObjectCount; private buildInstancedBatch; private buildBatch; update(deltaTime: number): void; render(renderer: WebGLRenderer): void; saveVisiblity(): Record; applyVisibility(ranges: Record): void; getVisibility(objectVisibility: ObjectVisibility): Record; getTransparent(): Record; getStencil(): Record; getOpaque(): Record; getDepth(): Record; overrideMaterial(ranges: Record, material: Material): void; overrideBatchMaterial(ranges: Record, material: Material): void; restoreMaterial(ranges: Record): void; restoreBatchMaterial(ranges: Record): void; purgeBatches(subtreeId: string): void; getBatches(subtreeId?: string, geometryType?: K): BatchTypeMap[K][]; getBatches(subtreeId?: string, geometryType?: Array): BatchTypeMap[K][]; private isBatchType; getBatch(rv: NodeRenderView): Batch | undefined; getRenderView(batchId: string, index: number): NodeRenderView | null; getRenderViewMaterial(batchId: string, index: number): Material | null; resetBatchesDrawRanges(): void; /** * Used for debuggin only */ isolateBatch(batchId: string): void; } export {};