/** @packageDocumentation * @module RangeSearch */ import { CurveLocationDetail, CurveLocationDetailPair } from "../../curve/CurveLocationDetail"; import { XAndY, XYAndZ } from "../../geometry3d/XYZProps"; /** * Handler class for searching a range tree containing unordered Point3d data. * * Facilitates multiple searches for closest point and close approach calculations. * @public */ export declare class Point3dArrayRangeTreeContext { /** Array of points being searched, indexed by the range tree */ points: XYAndZ[]; /** Diagnostic: number of range tests returned true */ numRangeTestTrue: number; /** Diagnostic: number of range tests returned false */ numRangeTestFalse: number; /** Diagnostic: number of point distance tests */ numPointTest: number; /** Diagnostic: number of searches */ numSearch: number; /** Whether to compute xy-distances, ignoring z-coordinates of points. */ xyOnly?: boolean; /** range tree, whose appData are indices into the points array */ private _rangeTreeRoot; /** Constructor: capture inputs, initialize debug counters */ private constructor(); /** * Create a range tree context with given points: * * initialize with single-point ranges * * appData are point indices * @param points reference captured * @param maxChildPerNode maximum children per range tree node (default 4) * @param maxAppDataPerLeaf maximum point indices per leaf node (default 4) * @param xyOnly whether to compute xy-distances, ignoring z-coordinates of points */ static createCapture(points: XYAndZ[], maxChildPerNode?: number, maxAppDataPerLeaf?: number, xyOnly?: boolean): Point3dArrayRangeTreeContext | undefined; /** * Search the range tree for closest point(s) to spacePoint. * @param spacePoint point to test * @param maxDist collect points at no more than this distance from spacePoint. If undefined, return only the closest point. * @return closest point detail(s) with following fields set: * * detail.point = the closest point * * detail.fraction = the index of the closest point in the points array * * detail.a = distance from spacePoint to closest point */ searchForClosestPoint(spacePoint: XAndY | XYAndZ, maxDist?: number): CurveLocationDetail | CurveLocationDetail[] | undefined; /** * Search the range trees for closest approach(es) between the point arrays. * @param contextA first point array context * @param contextB second point array context * @param maxDist collect close approaches separated by no more than this distance. If undefined, return only the closest approach. * @return closest approach detail pair(s), one per context, each with the following fields set: * * detail.point = the point at closest approach * * detail.fraction = the index of detail.point in the points array * * detail.a = the closest approach distance */ static searchForClosestApproach(contextA: Point3dArrayRangeTreeContext, contextB: Point3dArrayRangeTreeContext, maxDist?: number): CurveLocationDetailPair | CurveLocationDetailPair[] | undefined; } //# sourceMappingURL=Point3dArrayRangeTreeContext.d.ts.map