import { Node, PointOctant, PointOctree } from 'sparse-octree'; import { Matrix4, Box3, Vector3 } from 'three'; import { Overlay3DIcon } from './Overlay3DIcon'; import { DefaultOverlay3DContentType } from './OverlayCollection'; export declare class IconOctree extends PointOctree> { private readonly _nodeCenters; private readonly _distanceBoxChecker; static getMinimalOctreeBoundsFromIcons(icons: Overlay3DIcon[]): Box3; constructor(icons: Overlay3DIcon[], bounds: Box3, maxLeafSize: number); getNodeIcon(node: Node): Overlay3DIcon | undefined; /** * Get all icons from a node's subtree recursively * @param node - The octree node to get icons from * @returns Array of Overlay3DIcons contained in the node's subtree */ getAllIconsFromNode(node: Node): Overlay3DIcon[]; /** * Check if a node or any of its descendants exists in the given set * @param node - The octree node to check * @param nodeSet - Set of nodes to check against * @returns True if the node or any descendant is in the set, false otherwise */ hasDescendantInSet(node: Node, nodeSet: Set): boolean; /** * Get LOD nodes based on projected screen area. * Nodes with projected area above the threshold are expanded, * while those below are selected as LOD representatives. * @param areaThreshold - Screen area threshold (0 to 1) for LOD selection * @param projection - View projection matrix * @param minimumLevel - Minimum octree level to expand to (default: 0) * @returns Set of PointOctant nodes selected for LOD based on screen area */ getLODByScreenArea(areaThreshold: number, projection: Matrix4, minimumLevel?: number): Set>; /** * Get LOD nodes based purely on camera distance. * This provides consistent behavior regardless of view angle. * @param cameraPosition - Camera position in model space * @param distanceThreshold - Distance from camera within which all icons are shown (no clustering) * @param clusteringLevel - The octree level at which to cluster far icons (higher = finer clusters) * @returns Set of PointOctant nodes selected for LOD based on distance */ getLODByDistance(cameraPosition: Vector3 | undefined, distanceThreshold: number, clusteringLevel?: number): Set>; /** * Get LOD nodes based on camera distance with enhanced clustering for pure cluster visualization. * Uses node size awareness and max depth control for better cluster granularity. * @param cameraPosition - Camera position for distance calculation * @param distanceThreshold - Distance threshold for "close" icons * @param maxOctreeDepth - Maximum octree depth to expand to (controls cluster granularity) * @returns Set of PointOctant nodes selected for LOD based on camera distance */ getLODByDistanceWithClustering(cameraPosition: Vector3 | undefined, distanceThreshold: number, maxOctreeDepth?: number): Set>; /** * Get all icons from a node's subtree that are within the given distance from a point. * Also returns the representative icon if no close icons are found (for clustering). * @param node - The octree node to get icons from * @param cameraPosition - Camera position for distance calculation * @param distanceThreshold - Distance threshold for "close" icons * @returns Object containing close icons and whether to show representative */ getIconsFromClusteredNode(node: Node, cameraPosition: Vector3, distanceThreshold: number): Overlay3DIcon[]; /** * Check if any icon in the node's subtree is within the given distance from a point * @param node - The octree node to check * @param point - The point to measure distance from * @param distance - Distance threshold * @returns True if any icon is within distance, false otherwise */ private isNodeWithinDistance; private populateNodeCenters; private filterEmptyLeaves; private hasChildren; private isEmptyLeaf; private hasData; private isPointOctant; private getClosestToAverageIcon; traverseLevelsBottomUp(func: (nodes: Node[]) => void): void; }