Table of Contents

Class CubeTree

Namespace
Hi.Cbtr
Assembly
HiCbtr.dll

Cube-based data structure. CubeTree has high performance for free-form geometry manipulation include volume removal and addition.

public class CubeTree : IDisposable, IDisplayee, ICollidee, ICollidable, IExpandToBox3d, IGetCollidable
Inheritance
CubeTree
Implements
Inherited Members
Extension Methods

Constructors

CubeTree(NativeStl, double, CancellationToken, IProgress<IProgressFraction>)

public CubeTree(NativeStl stl, double preferredGridWidth, CancellationToken token, IProgress<IProgressFraction> progress)

Parameters

stl NativeStl

Triangle Grid. The triangles must be manifold geometry.

preferredGridWidth double

The expected resolution.

token CancellationToken

Cancellation token for the operation

progress IProgress<IProgressFraction>

Progress reporter for the operation

Remarks

The applied resolution is equal or smaller than the expected resolution. The applied resolution is c*(2^i). Where c is a constant; i is a integer to make the closest value of the formula. Errors relative to the input geometry are distributed at sharp edges and curved surfaces.

CubeTree(Stl, double, CancellationToken, IProgress<IProgressFraction>)

Can be initialized with Stl or NativeStl objects; using NativeStl is faster. The input triangle mesh must be manifold geometry, i.e., triangle vertices are aligned with other triangles' vertices, and the geometry must be closed.

public CubeTree(Stl stl, double expectedResolution, CancellationToken token, IProgress<IProgressFraction> progress)

Parameters

stl Stl
expectedResolution double

Sets the preferred resolution. The actual resolution will be equal to or smaller than the specified value, approximately spaced by powers of 2. Errors relative to the input geometry are distributed at sharp edges and curved surfaces.

token CancellationToken

Cancellation token for the operation

progress IProgress<IProgressFraction>

Progress reporter for the operation

CubeTree(string)

Initializes a new instance of the CubeTree class from a file. The file is read whatever its resolution: the licence's resolution cap (Hi.Licenses.LicenseCaps) limits the machining on the tree, not the file – a tree finer than the cap allows runs its cuts at its own width, which no cut refines; ReferenceSize_mm is what the cap is relative to.

public CubeTree(string file)

Parameters

file string

The path to the cube tree file.

CubeTree(string, ReadOnlySpan<nint>, IReadOnlyList<CbtrPickable>, CbtrPickable, out CubeTreeRebindStats)

Initializes a new instance of the CubeTree class from a file with its nodes' attachments rebound (the NC play result review): a node whose attachment pointer, as the file holds it, equals nodeAttachKeys[i] carries nodeAttachments[i]; a node whose non-null pointer no key names carries unknown; a node whose pointer is null carries none, as it did when the file was written (UpdateAttach(CbtrPickable) reaches it only through unattached ancestors: in a stock a play wrote, the root carries one and such a walk binds nothing). Every pickable the nodes carry has its native node map filled with its nodes before this returns, as a pickable a cut attached has, so that the render barrier (DetachUnderWriteGate(IReadOnlyCollection<CbtrPickable>)), the pickable's disposal and IsAttached see these nodes. A pair whose key is Zero or whose pickable is null or disposed is skipped; a key given twice keeps its first pickable. The file is read whatever its resolution, as CubeTree(string) reads it; an unreadable file reads as the empty tree. The caller owns the pickables and keeps them alive while the tree carries them (a strip position until its strip is cleared).

public CubeTree(string file, ReadOnlySpan<nint> nodeAttachKeys, IReadOnlyList<CbtrPickable> nodeAttachments, CbtrPickable unknown, out CubeTreeRebindStats stats)

Parameters

file string

The path to the cube tree file.

nodeAttachKeys ReadOnlySpan<nint>

The attachment pointer values the file holds, one a pickable: what NativeAttachmentHandle read when the file was written.

nodeAttachments IReadOnlyList<CbtrPickable>

The pickables to bind, one a key, in the same order.

unknown CbtrPickable

The pickable for a node whose non-null pointer no key names (the plain stock); not null, not disposed.

stats CubeTreeRebindStats

What the rebind did to the nodes (also RebindStats).

Exceptions

ArgumentNullException

nodeAttachments or unknown is null.

ArgumentException

The keys and the pickables differ in number, or unknown is disposed.

Fields

KeyDll

Key dll path.

public const string KeyDll = "hi-key.dll"

Field Value

string

defaultPreferredGridWidth

The default grid_width for the constructor.

public const double defaultPreferredGridWidth = 0.0625

Field Value

double

Properties

CubetreePtr

Private element.

public nint CubetreePtr { get; }

Property Value

nint

DispCacheMb

Display cache size in Mb. The cahce cost from graphic card and RAM.

public static long DispCacheMb { get; set; }

Property Value

long

IsDisposed

Gets a value indicating whether this tree has been disposed. All native-backed members become no-ops afterwards (value getters return neutral defaults). While a Dispose() on another thread is deleting the native tree, the members already answer their neutral defaults and this still reads false until that delete returns: the native gate refuses first, the managed mirror is written after.

public bool IsDisposed { get; }

Property Value

bool

NativeGateLiveCount

Internal Use Only. The native gates alive in this process (one per CubeTree whose holder the GC has not reclaimed yet): the facts' seam for the gate's lifetime.

public static int NativeGateLiveCount { get; }

Property Value

int

NativeGateOwnerCount

Internal Use Only. The owner references this tree's native gate holds (1: this object's holder; a disposed tree keeps its gate until the GC reclaims the holder); -1 without a gate.

public int NativeGateOwnerCount { get; }

Property Value

int

NativeGateWritersWaiting

Internal Use Only. The writers waiting on this tree's native gate (a Dispose() or a detach held back by a reader inside); -1 without a gate. The facts' seam: a fact that holds the read side goes on only once the writer it started is counted, so what it then observes is ordered by the gate, not by timing.

public int NativeGateWritersWaiting { get; }

Property Value

int

RebindStats

What the rebind did to the nodes when this tree was read with rebound attachments (CubeTree(string, ReadOnlySpan<nint>, IReadOnlyList<CbtrPickable>, CbtrPickable, out CubeTreeRebindStats)); null for a tree made any other way.

public CubeTreeRebindStats? RebindStats { get; }

Property Value

CubeTreeRebindStats?

ReferenceSize_mm

The reference size of this tree in mm: the longest side of the bounding box of the geometry it was built from (its trailer's for a tree read from a file, or the occupied extent of a file written before the trailer existed), the size the licence's resolution cap is relative to (Hi.Licenses.LicenseCaps: the cube width may not go under reference / N). 0 when unknown, and when the tree is disposed.

public double ReferenceSize_mm { get; }

Property Value

double

Resolution

Get initialized resolution.

public double Resolution { get; }

Property Value

double

TotalCacheMb

Cache size used by CubeTree. Sum of TrisCacheMb and DispCacheMb. TotalCacheMb Setter distributes (2/5 of the setting value) for DispCacheMb.

public static long TotalCacheMb { get; set; }

Property Value

long

TrisCacheMb

Triangles cache size in Mb. The cache costs from RAM.

public static long TrisCacheMb { get; set; }

Property Value

long

Methods

Add(CachedTris, double, bool, bool)

Boolean-union counterpart of Substract(CachedTris, double, bool, bool). Using BufferedTris is more efficient than NativeStl. If the resolution of the addition region differs from the body's resolution, the lower resolution is applied to that region.

public UnmanagedAddition Add(CachedTris adderBufferedTris, double preferredCubeWidth, bool isBuildContactContours = false, bool isAggressiveAdd = false)

Parameters

adderBufferedTris CachedTris

Addition geometry

preferredCubeWidth double

The preferred cube width for the operation.

isBuildContactContours bool

If true, the returned Addition contains contour groups of the newly created surface, which can be used for further analysis.

isAggressiveAdd bool

If true, uses aggressive adding mode.

Returns

UnmanagedAddition

Add(GeomBoolCache, bool, bool)

Adds (boolean union) a geometry to the cube tree using a geometry boolean cache.

public UnmanagedAddition Add(GeomBoolCache geomBoolCache, bool isBuildContactContours = false, bool isAggressiveAdd = false)

Parameters

geomBoolCache GeomBoolCache

The geometry boolean cache containing the geometry to add.

isBuildContactContours bool

If true, the returned Addition will contain the contours of the newly created surface.

isAggressiveAdd bool

If true, uses aggressive adding mode.

Returns

UnmanagedAddition

The result of the addition operation.

Add(NativeStl, double, bool, bool)

Boolean-union counterpart of Substract(NativeStl, double, bool, bool). Same functionality as Add(CachedTris,...). Less efficient due to the additional step of converting to CachedTris.

public UnmanagedAddition Add(NativeStl adderStl, double preferredCubeWidth = 0, bool isBuildContactContours = false, bool isAggressiveAdd = false)

Parameters

adderStl NativeStl
preferredCubeWidth double
isBuildContactContours bool
isAggressiveAdd bool

Returns

UnmanagedAddition

CleanCache()

Call Hi.Cbtr.CubeTree.CleanTrisCache() and Hi.Cbtr.CubeTree.CleanDispCache_().

public static void CleanCache()

CleanDispCachee()

Clean display cache of this.

public void CleanDispCachee()

ContainsInfEdgeCuts()

Checks if any existing node in the cube tree contains inf or -inf in its edge_cuts array.

public bool ContainsInfEdgeCuts()

Returns

bool

true if any node contains inf or -inf in edge_cuts, false otherwise.

DetachAttachments()

Detach-ALL: nulls every node's attachment WITHOUT erasing nodes from those attachments' node maps — a fast reset of all colouring for when the attached attachments are about to be disposed (their own disposal clears their maps). Runs under the write gate so it also acts as a render barrier (in-flight renders drain, new renders read null), letting the detached attachments be freed in the background with no render holding a stale pointer. The caller MUST dispose the detached attachments. Must NOT be called while holding a tree's read gate (LockRecursionException).

public void DetachAttachments()

Exceptions

LockRecursionException

Called from a thread inside a cube tree's frame.

DetachUnderWriteGate(IReadOnlyCollection<CbtrPickable>)

Targeted detach: under the write gate (render barrier), nulls node->attachment for ONLY the given attachments' nodes (idempotent ==this guard; never touches other attachments). After this returns, dispose them in the background — the barrier guarantees no render still holds a stale pointer. The caller owns the attachments and disposes none of them before this returns: their native pointers are read before the barrier's wait, which may last a whole Diff compare. Must NOT be called while holding a tree's read gate (LockRecursionException).

public void DetachUnderWriteGate(IReadOnlyCollection<CbtrPickable> attachments)

Parameters

attachments IReadOnlyCollection<CbtrPickable>

Exceptions

LockRecursionException

Called from a thread inside a cube tree's frame.

Diff(NativeStl, double, RangeColorRule, IProgress<IMessage>)

Compares the cube tree with an ideal geometry and returns difference attachments.

public ConcurrentBag<DiffAttachment> Diff(NativeStl idealGeom, double diffRadius, RangeColorRule diffRangeColorRule, IProgress<IMessage> messageProgress = null)

Parameters

idealGeom NativeStl

The ideal geometry to compare with.

diffRadius double

The radius for difference detection.

diffRangeColorRule RangeColorRule

The color rule for visualizing differences.

messageProgress IProgress<IMessage>

Progress reporter for the operation.

Returns

ConcurrentBag<DiffAttachment>

A collection of difference attachments.

Diff(NativeStl, double, RangeColorRule, IProgress<IMessage>, out DiffStats)

Compares the cube tree with an ideal geometry and returns difference attachments, one per surface leaf. Both sides are measured on the leaf's own wires: the target is intersected with the same cube edges the leaf carries its cuts on, so a sharp edge that both sides share reads zero, the sign comes from the leaf's corner states (residual positive, over-cut negative) and never from the target's winding, and a leaf none of whose wires meets the target within the detection radius (normal-projected, the axial search capped at four radii) reads NaN. Coarse leaves stay coarse where the target inside them is one plane and are expanded on demand elsewhere; the tree is not meshed to its bottom first.

public ConcurrentBag<DiffAttachment> Diff(NativeStl idealGeom, double diffRadius, RangeColorRule diffRangeColorRule, IProgress<IMessage> messageProgress, out CubeTree.DiffStats stats)

Parameters

idealGeom NativeStl

The ideal geometry to compare with.

diffRadius double

The radius for difference detection.

diffRangeColorRule RangeColorRule

The color rule for visualizing differences.

messageProgress IProgress<IMessage>

Progress reporter for the operation; receives Diff–Unlicensed when the AdvancedPhysics feature is missing and Diff–TargetNotClosed when the target has open or non-manifold edges (a topological census: a T-junction counts as open; the counts are in stats).

stats CubeTree.DiffStats

The counters of the run.

Returns

ConcurrentBag<DiffAttachment>

A collection of difference attachments; empty when the tree is disposed or the feature is not licensed.

Diff(NativeStl, double, RangeColorRule, CancellationToken, IProgress<IMessage>, out DiffStats)

Diff(NativeStl, double, RangeColorRule, IProgress<IMessage>, out DiffStats) that token can stop: the compare checks it on every node it enters, so a cancellation (the player's Stop or Reset, a project close) ends it within one node per worker instead of after every remaining leaf. A stopped compare sets Stopped and hands back what it had attached before the stop — the leaves compared so far, each with its DiffAttachment; the others keep the attachment they had, none where the caller retired it — and the caller decides what that partial result is.

public ConcurrentBag<DiffAttachment> Diff(NativeStl idealGeom, double diffRadius, RangeColorRule diffRangeColorRule, CancellationToken token, IProgress<IMessage> messageProgress, out CubeTree.DiffStats stats)

Parameters

idealGeom NativeStl

The ideal geometry to compare with.

diffRadius double

The radius for difference detection.

diffRangeColorRule RangeColorRule

The color rule for visualizing differences.

token CancellationToken

Stops the compare.

messageProgress IProgress<IMessage>

Progress reporter for the operation (see the overload without a token).

stats CubeTree.DiffStats

The counters of the run; for a stopped one, of the part compared.

Returns

ConcurrentBag<DiffAttachment>

A collection of difference attachments; empty when the tree is disposed or the feature is not licensed.

Display(Bind)

Display function called in DispEngine rendering loop.

public void Display(Bind bind)

Parameters

bind Bind

Bind with DispEngine. See Bind.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Exceptions

LockRecursionException

Called from a thread inside a cube tree's frame (a gated member below on the stack holds the read side the delete would wait for).

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

DisposeBackground()

Frees the native cube tree on a background task. Disposals are serialized: if a previous background disposal has not finished, this one waits for it. Returns the task representing this disposal (see WaitForPendingDisposals() to drain).

public Task DisposeBackground()

Returns

Task

DisposeBackground(IReadOnlyCollection<IDisposable>)

Enqueues disposal of objects retired alongside a tree (typically its attachments) on the SAME serialized chain as DisposeBackground(), so there is a single drain point (DrainAndCloseBackgroundDisposals() at application end, WaitForPendingDisposals() for a snapshot). Disposing a CbtrPickable now clears its (possibly huge) attached node map — O(nodes) — which must not run on the hot path. Enqueue the owning tree's DisposeBackground() first so the gated tree teardown (which waits out in-flight renders) runs before its attachments are freed.

public static Task DisposeBackground(IReadOnlyCollection<IDisposable> disposables)

Parameters

disposables IReadOnlyCollection<IDisposable>

Returns

Task

DrainAndCloseBackgroundDisposals()

DrainBackgroundDisposals(), then closes the chain: every DisposeBackground() from here on frees inline on its caller. Call it once at application end, before the native library is torn down – after it, no disposal can be left running on a thread nobody waits for.

public static void DrainAndCloseBackgroundDisposals()

DrainBackgroundDisposals()

Blocks until the background disposal chain is empty – including entries queued by other threads while it was waiting, which a single WaitForPendingDisposals() snapshot does not cover. A drain that can return with work still queued is not a drain; the callers that queue at shutdown are stopped by the host before this runs (see DrainAndCloseBackgroundDisposals()).

public static void DrainBackgroundDisposals()

ExpandToBox3d(ref box3d_t)

Expands the destination box. This function is usually used to compute the bounding box of elements. box3d_t is a value type, so the destination is passed by reference (the C++ expand_to_box3d(box3&) shape); an implementation writes dst = dst.Expanded(...) or forwards ref dst to its parts.

public void ExpandToBox3d(ref box3d_t dst)

Parameters

dst box3d_t

Destination box, expanded in place

~CubeTree()

dtor

protected ~CubeTree()

GetCollidable()

Gets the collidable object.

public ICollidable GetCollidable()

Returns

ICollidable

The collidable object (this instance).

GetCollidee()

Get ICollidee.

public ICollidee GetCollidee()

Returns

ICollidee

ICollidee

GetInfEdgeCutsInfo()

Gets info for all nodes that contain inf or -inf in their edge_cuts array. Each node's box is grouped with its corresponding inf edge indices. This is useful for identifying and visualizing non-manifold geometry issues in the cube tree.

public List<CubeTree.InfNodeInfo> GetInfEdgeCutsInfo()

Returns

List<CubeTree.InfNodeInfo>

A list of node info, each containing a box and its inf edge indices.

GetRgbTrisNativeArray(double)

Get triangles in type of double array. The returned triangles is non-manifold. It may not be closed model and the apexes of triangle grid may not be overlapped.

public double[] GetRgbTrisNativeArray(double resolution = 0)

Parameters

resolution double

The preferred resolution. The real resolution may be smaller or equal the prefered resolution. The real resolution is discrete. The resolution value is at 2^i. The geometric error mainly locate at corner.

Returns

double[]

rgb traingle grid. In sequence of r,g,b,n.x,n.y,n.z,p0.x,p0.y,p0.z,p1.x,p1.y,p1.z,p2.x,p2.y,p2.z, repetitively. A triangle take 15 double.

GetTris(double)

Get triangles. The returned triangles is non-manifold. It may not be closed model and the apexes of triangle grid may not be overlapped.

public List<tri3d_t> GetTris(double resolution = 0)

Parameters

resolution double

Sets the preferred resolution. The actual resolution will be equal to or smaller than the specified value, approximately spaced by powers of 2. Errors relative to the input geometry are distributed at sharp edges and curved surfaces. A larger resolution results in fewer triangles and faster computation.

Returns

List<tri3d_t>

Triangle mesh

LicenseText()

Internal Use Only (play-core migration P17). The cube-tree licence's text (Cbtr_ToString): what the UnauthorizedAccessException of a refused cut carries, read by the machining pipeline's pump when a record faults with the geometry step's status 1 – at pump time, as the shell read it on the worker before.

public static string LicenseText()

Returns

string

NewWithDefectInfos(NativeStl, double, CancellationToken, IProgress<IMessage>, Action<DefectNodeInfo>)

Creates a new CubeTree and collects defect node infos during construction. Each defect node is also handed to onDefect the moment the build finds it, on the calling thread, so a caller can report defects while a long build is still running; the returned list holds all of them in that order. onDefect runs inside a native callback and must not throw.

public static (CubeTree cubeTree, List<CubeTree.DefectNodeInfo> defectInfos) NewWithDefectInfos(NativeStl stl, double preferredGridWidth, CancellationToken token, IProgress<IMessage> messageProgress, Action<CubeTree.DefectNodeInfo> onDefect = null)

Parameters

stl NativeStl
preferredGridWidth double
token CancellationToken
messageProgress IProgress<IMessage>
onDefect Action<CubeTree.DefectNodeInfo>

Returns

(CubeTree cubeTree, List<CubeTree.DefectNodeInfo> defectInfos)

NewWithDefectInfos(Stl, double, CancellationToken, IProgress<IMessage>, Action<DefectNodeInfo>)

Creates a new CubeTree and collects defect node infos during construction. Each defect node is also handed to onDefect the moment the build finds it, on the calling thread, so a caller can report defects while a long build is still running; the returned list holds all of them in that order. onDefect runs inside a native callback and must not throw.

public static (CubeTree cubeTree, List<CubeTree.DefectNodeInfo> defectInfos) NewWithDefectInfos(Stl stl, double preferredGridWidth, CancellationToken token, IProgress<IMessage> messageProgress, Action<CubeTree.DefectNodeInfo> onDefect = null)

Parameters

stl Stl
preferredGridWidth double
token CancellationToken
messageProgress IProgress<IMessage>
onDefect Action<CubeTree.DefectNodeInfo>

Returns

(CubeTree cubeTree, List<CubeTree.DefectNodeInfo> defectInfos)

RebuildAttach(CbtrPickable)

Every node in CubeTree can contain one CbtrPickable object. This function put or replace the contained data of all nodes to src. Using UpdateAttach(CbtrPickable) will place nodes that have not yet stored data (CbtrPickable is null) into src.

public void RebuildAttach(CbtrPickable src)

Parameters

src CbtrPickable

RemoveFlyPiece()

Removes disconnected pieces (fly pieces) from the cube tree.

public void RemoveFlyPiece()

Substract(CachedTris, double, bool, bool)

Using BufferedTris is more efficient than NativeStl. If the resolution of the subtraction region differs from the body's resolution, the lower resolution is applied to that region.

public UnmanagedSubstraction Substract(CachedTris cutterBufferedTris, double preferredCubeWidth, bool isBuildContactContours = false, bool isAggressiveCut = false)

Parameters

cutterBufferedTris CachedTris

Subtraction geometry

preferredCubeWidth double

The preferred cube width for the operation.

isBuildContactContours bool

If true, the returned Substraction contains contour groups at the intersection of the subtraction geometry and the workpiece geometry, which can be used for further analysis.

isAggressiveCut bool

If true, uses aggressive cutting mode.

Returns

UnmanagedSubstraction

Substract(GeomBoolCache, bool, bool)

Subtracts a geometry from the cube tree using a geometry boolean cache.

public UnmanagedSubstraction Substract(GeomBoolCache geomBoolCache, bool isBuildContactContours = false, bool isAggressiveCut = false)

Parameters

geomBoolCache GeomBoolCache

The geometry boolean cache containing the geometry to subtract.

isBuildContactContours bool

If true, the returned Substraction will contain contact contours.

isAggressiveCut bool

If true, uses aggressive cutting mode.

Returns

UnmanagedSubstraction

The result of the subtraction operation.

Substract(InitStickConvex, mat4d_t, double, bool, bool)

Subtracts a stick convex geometry from the cube tree.

public UnmanagedSubstraction Substract(InitStickConvex initStickConvex, mat4d_t mat, double preferredCubeWidth, bool isBuildContactContours = false, bool isAggressiveCut = false)

Parameters

initStickConvex InitStickConvex

The stick convex geometry to subtract: a share the caller still holds (see InitStickConvex), which keeps the native convex alive across the native call whatever the profile that built it does meanwhile.

mat mat4d_t

The transformation matrix to apply to the stick convex.

preferredCubeWidth double

The preferred cube width for the operation.

isBuildContactContours bool

If true, the returned Substraction will contain contact contours.

isAggressiveCut bool

If true, uses aggressive cutting mode.

Returns

UnmanagedSubstraction

The result of the subtraction operation.

Exceptions

ObjectDisposedException

initStickConvex is a share that was already given back (its pointer reads Zero): nothing is handed to the native side.

Substract(NativeStl, double, bool, bool)

Same functionality as Substract(BufferedTris,...). Less efficient due to the additional step of converting to CachedTris.

public UnmanagedSubstraction Substract(NativeStl cutterStl, double preferredCubeWidth = 0, bool isBuildContactContours = false, bool isAggressiveCut = false)

Parameters

cutterStl NativeStl
preferredCubeWidth double
isBuildContactContours bool
isAggressiveCut bool

Returns

UnmanagedSubstraction

TestDiff(out CubeTree, out NativeStl)

Tests the difference calculation between a cube tree and an ideal geometry.

public static void TestDiff(out CubeTree cubeTree_, out NativeStl idealGeom_)

Parameters

cubeTree_ CubeTree

The resulting cube tree.

idealGeom_ NativeStl

The ideal geometry used for comparison.

TestIO()

Tests the input/output operations for a cube tree.

public static CubeTree TestIO()

Returns

CubeTree

The cube tree created or loaded during the test.

TestSimpleRemove(out CubeTree)

Tests the simple removal operation on a cube tree.

public static void TestSimpleRemove(out CubeTree cubeTree_)

Parameters

cubeTree_ CubeTree

The resulting cube tree after the removal operation.

ThrowIfInsideATreeFrame(string)

The write side is taken by a thread that holds no tree frame: a frame below holds the read side the write would wait for (what the ReaderWriterLockSlim refused with this exception for the same tree; the native gate would deadlock). The depth is per thread, so a write on another tree from inside a frame, which the old lock allowed, refuses too (no member nests across trees, and a cross-tree writer cycle is an exception rather than a deadlock). Internal Use Only outside HiCbtr: the native machining pipeline's shell (play-core migration P17) asks it before every call that waits on the pool's subtraction worker, which enters the tree's gate (P16-12: the core cannot read this depth).

public static void ThrowIfInsideATreeFrame(string operation)

Parameters

operation string

UpdateAttach(CbtrPickable)

Every node in CubeTree can contain one CbtrPickable object. This function put src to the nodes that contain null.

public void UpdateAttach(CbtrPickable src)

Parameters

src CbtrPickable

WaitForPendingDisposals()

A task that completes when every background disposal queued SO FAR has finished - a snapshot: anything queued after the call is not covered. Application end must use DrainAndCloseBackgroundDisposals() instead.

public static Task WaitForPendingDisposals()

Returns

Task

WriteFile(string)

Writes the cube tree to a file.

public void WriteFile(string file)

Parameters

file string

The path where the cube tree will be written.