Table of Contents

Class StepColorTreeSlot

Namespace
Hi.MachiningProcs
Assembly
HiNc.dll

Internal Use Only. How a step's inspecting slot holds the outcome of a StepColorTree: the id of the leaf the step fell into in bits 63 to 32 and the leaf's shown value, a float32, in bits 31 to 0 of one double. An id below IdLimit leaves the sign and every exponent bit 0, so the packed double is finite — a subnormal or zero — whatever the value's bits, NaN included; the slot's own “no value”, NaN, is therefore never a packed outcome. Packing and unpacking move bits only: no floating-point operation runs, so no flush-to-zero or denormals-are-zero mode can change them.

public static class StepColorTreeSlot
Inheritance
StepColorTreeSlot
Inherited Members

Methods

Pack(int, float)

Packs a leaf id and the leaf's shown value into one double.

public static double Pack(int leafId, float leafValue)

Parameters

leafId int

The id of the leaf, 0 ≤ id < IdLimit.

leafValue float

The shown value; NaN for none.

Returns

double

The packed double, never NaN.

TryUnpack(double, out int, out float)

Reads a leaf id and the leaf's shown value back from a packed double.

public static bool TryUnpack(double packed, out int leafId, out float leafValue)

Parameters

packed double

The slot's value.

leafId int

The leaf id; 0 when packed is NaN.

leafValue float

The shown value, bit for bit as packed; NaN when packed is NaN.

Returns

bool

False when packed is NaN: the step fell into no leaf, the tree threw, or the slot is not filled.