ClipperPool

clipper.ClipperPool (Class)

Object pooling manager for Clipper2.

Use trackObjects() before clipper operations and recycleObjects() after to reuse allocated objects and reduce GC pressure.

Example:

ClipperPool.trackObjects();
var result = Clipper.inflatePaths(paths, 10, JoinType.Miter, EndType.Polygon);
// Copy needed data from result
ClipperPool.recycleObjects();

Static Members

trackObjects(): Void

Start tracking all created objects for later recycling. Call this before performing clipper operations.


recycleObjects(): Void

Recycle all tracked objects back to their pools. Call this after you've copied the needed data from clipper results. Objects become invalid after this call.


clearPools(): Void

Clear all pools and tracking state. Useful for testing or when you want to release pooled memory.


getPoint64PoolSize(): Int
Returns
Int

getPointDPoolSize(): Int
Returns
Int

getOutPtPoolSize(): Int
Returns
Int

getActivePoolSize(): Int
Returns
Int

getVertexPoolSize(): Int
Returns
Int

getLocalMinimaPoolSize(): Int
Returns
Int

getIntersectNodePoolSize(): Int
Returns
Int

getHorzSegmentPoolSize(): Int
Returns
Int

getHorzJoinPoolSize(): Int
Returns
Int

getOutRecPoolSize(): Int
Returns
Int

isTracking(): Bool
Returns
Bool

acquirePoint64Impl(): Null<Point64Impl>
Returns
Null<Point64Impl>

acquirePointDImpl(): Null<PointDImpl>
Returns
Null<PointDImpl>

acquireOutPt(): Null<OutPt>
Returns
Null<OutPt>

acquireActive(): Null<Active>
Returns
Null<Active>

acquireVertex(): Null<Vertex>
Returns
Null<Vertex>

acquireLocalMinima(): Null<LocalMinima>
Returns
Null<LocalMinima>

acquireIntersectNode(): Null<IntersectNode>
Returns
Null<IntersectNode>

acquireHorzSegment(): Null<HorzSegment>
Returns
Null<HorzSegment>

acquireHorzJoin(): Null<HorzJoin>
Returns
Null<HorzJoin>

acquireOutRec(): Null<OutRec>
Returns
Null<OutRec>

trackPoint64(impl: Point64Impl): Void
Name Type
impl Point64Impl

trackPointD(impl: PointDImpl): Void
Name Type
impl PointDImpl

trackOutPt(op: OutPt): Void
Name Type
op OutPt

trackActive(a: Active): Void
Name Type
a Active

trackVertex(v: Vertex): Void
Name Type
v Vertex

trackLocalMinima(lm: LocalMinima): Void
Name Type
lm LocalMinima

trackIntersectNode(node: IntersectNode): Void
Name Type
node IntersectNode

trackHorzSegment(hs: HorzSegment): Void
Name Type
hs HorzSegment

trackHorzJoin(hj: HorzJoin): Void
Name Type
hj HorzJoin

trackOutRec(or: OutRec): Void
Name Type
or OutRec

Private Members

point64Pool: Array<Point64Impl>

pointDPool: Array<PointDImpl>

outPtPool: Array<OutPt>

activePool: Array<Active>

vertexPool: Array<Vertex>

localMinimaPool: Array<LocalMinima>

intersectNodePool: Array<IntersectNode>

horzSegmentPool: Array<HorzSegment>

horzJoinPool: Array<HorzJoin>

outRecPool: Array<OutRec>

trackingEnabled: Bool

trackedPoint64: Array<Point64Impl>

trackedPointD: Array<PointDImpl>

trackedOutPt: Array<OutPt>

trackedActive: Array<Active>

trackedVertex: Array<Vertex>

trackedLocalMinima: Array<LocalMinima>

trackedIntersectNode: Array<IntersectNode>

trackedHorzSegment: Array<HorzSegment>

trackedHorzJoin: Array<HorzJoin>

trackedOutRec: Array<OutRec>