import { CurveCollection } from "../curve/CurveCollection"; import { CurveLocationDetailPair } from "../curve/CurveLocationDetail"; import { CurvePrimitive } from "../curve/CurvePrimitive"; import { Point3d } from "../geometry3d/Point3dVector3d"; import { ClipPlane } from "./ClipPlane"; import { PolygonClipper } from "./ClipUtils"; import { ConvexClipPlaneSet } from "./ConvexClipPlaneSet"; import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray"; import { GrowableXYZArrayCache } from "../geometry3d/ReusableObjectCache"; /** * An AlternatingConvexClipTreeNode is a node in a tree structure in which * */ export declare class AlternatingCCTreeNode implements PolygonClipper { points: Point3d[]; planes: ConvexClipPlaneSet; children: AlternatingCCTreeNode[]; startIdx: number; numPoints: number; private constructor(); /** Initialize this node with index data referencing the parent polygon. */ static createWithIndices(index0: number, numPoints: number, result?: AlternatingCCTreeNode): AlternatingCCTreeNode; /** * */ static createTreeForPolygon(points: Point3d[], result?: AlternatingCCTreeNode): AlternatingCCTreeNode; /** Resets this AlternatingConvexClipTreeNode to a newly-created state */ empty(): void; /** Creates a deep copy of this node (expensive - copies Geometry, and is recursive for children array). */ clone(result?: AlternatingCCTreeNode): AlternatingCCTreeNode; /** Add a new child that has an empty plane set and given indices. */ addEmptyChild(index0: number, numPoints: number): void; /** Add a plane to the ConvexClipPlaneSet */ addPlane(plane: ClipPlane): void; /** Search with alternating in and out semantics. */ isPointOnOrInside(point: Point3d): boolean; /** Add an AlternatingConvexClipTreeNode as a child of this one -- i.e. a hole. * * The child pointer is pushed directly to the tree -- not cloned. */ captureConvexClipPlaneSetAsVoid(child: AlternatingCCTreeNode): void; /** Append start-end positions for curve intervals classified as inside or outside. */ appendCurvePrimitiveClipIntervals(curve: CurvePrimitive, insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[]): void; /** Append start-end positions for curve intervals classified as inside or outside. */ appendCurveCollectionClipIntervals(curves: CurveCollection, insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[]): void; /** * * @param xyz input polygon. This is not changed. * @param insideFragments Array to receive "inside" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared. * @param outsideFragments Array to receive "outside" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared. * @param arrayCache cache for reusable GrowableXYZArray. */ appendPolygonClip(xyz: GrowableXYZArray, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache): void; /** * */ depth(): number; } /** * Context structure for building an AlternatingConvexClipTreeNode from a polygon. * */ export declare class AlternatingCCTreeBuilder { private _points; private _stack; private constructor(); static createPointsRef(points: Point3d[], result?: AlternatingCCTreeBuilder): AlternatingCCTreeBuilder; get period(): number; indexAfter(i: number): number; indexBefore(i: number): number; pushIndex(primaryPointIndex: number): void; private static cross; cyclicStackPoint(cyclicIndex: number): Point3d; signFromStackTip(pointIndex: number, sign: number): 1 | -1; get indexOfMaxX(): number; /** Pop from the stack until the sign condition is satisfied */ extendHullChain(k: number, sign: number, pushAfterPops: boolean): void; collectHullChain(kStart: number, numK: number, sign: number): void; private buildHullTreeGo; /** * */ buildHullTree(root: AlternatingCCTreeNode): boolean; } export declare class AlternatingCCTreeNodeCurveClipper { private _curve; private _intervalStack; private _stackDepth; constructor(); private setCurveRef; private popSegmentFrame; private clearSegmentStack; private pushEmptySegmentFrame; private get _topOfStack(); private set _topOfStack(value); /** Access entry [topOfStack() - numSkip] */ private stackEntry; private isTopOfStackEmpty; private static _fractionIntervals; private appendSingleClipToStack; /** * Run one level of recursion. On return, the stack is one level deeper than at entry and the new top of the stack has clip for this node * (expensive -- must clone items of arrays during "swaps") */ private recurse; /** * Modifies the insideIntervals array given in place. * Note: curve given is passed by reference and stored. */ appendSingleClipPrimitive(root: AlternatingCCTreeNode, curve: CurvePrimitive, insideIntervals: CurveLocationDetailPair[], _outsideIntervals: CurveLocationDetailPair[]): void; /** * Modifies the insideIntervals array given in place. * Note: curve given is passed by reference and stored. */ appendCurveCollectionClip(root: AlternatingCCTreeNode, curve: CurveCollection, insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[]): void; } //# sourceMappingURL=AlternatingConvexClipTree.d.ts.map