import { CadMaterial } from '../../../rendering'; import { ParsedMeshGeometry } from '../../../cad-parsers'; import { TreeIndexToSectorsMap } from '../utilities/TreeIndexToSectorsMap'; import { SectorRepository } from '../../../sector-loader'; import { ModelIdentifier } from '../../../data-providers'; import { Group } from 'three'; /** * Manages mesh data for CAD sectors. * This class prepares mesh data for object creation. */ export declare class CadMeshManager { private readonly _cadMaterial; private readonly _treeIndexToSectorsMap; private readonly _sectorMeshGroups; constructor(cadMaterial: CadMaterial, treeIndexToSectorsMap: TreeIndexToSectorsMap); /** * Creates meshes from parsed geometries for a given sector. * @param parsedMeshGeometries Array of parsed mesh geometries to create meshes from * @param sectorId The sector ID these meshes belong to * @returns Group containing the created meshes */ createMeshesFromParsedGeometries(parsedMeshGeometries: ParsedMeshGeometry[], sectorId: number): Group; private addTexturedMeshMaterialForSector; /** * Removes mesh group for the given sector ID. * Note: This does not dispose the underlying geometries as they may be shared with other models. * @param sectorId The sector ID whose mesh group should be removed */ private removeSectorMeshGroup; /** * Removes mesh group and dereferences the sector in the repository. * This should be called when a model stops using a sector to properly manage reference counting. * @param sectorId The sector ID whose mesh group should be removed * @param sectorRepository The sector repository to dereference from * @param modelIdentifier The model identifier for dereferencing */ removeSectorMeshGroupAndDereference(sectorId: number, sectorRepository: SectorRepository, modelIdentifier: ModelIdentifier): void; /** * Gets all currently managed sector IDs. */ getManagedSectorIds(): number[]; /** * Checks if a sector is currently managed by this mesh manager. * @param sectorId The sector ID to check * @returns True if the sector is managed, false otherwise */ hasManagedSector(sectorId: number): boolean; /** * Creates a mesh from geometry, material, and bounding box. */ private createMeshFromGeometry; /** * Updates tree index to sectors mapping from a set of tree indices. */ private updateTreeIndexToSectorsMap; private createTreeIndexSet; }