ZLab.Discrete ZLab.Discrete
ZLab.Discrete ZLab.Discrete
Developed by Zeke Zhang

Search Results for

    Edit this page

    Class OccupancyGrid

    A 3D spatial grid representing discrete voxel states (Outside, Inside, Boundary).

    Inheritance
    object
    LicensedBase
    GridBase
    OccupancyGrid
    Implements
    IGrid<Occupancy>
    IGridMeta
    Inherited Members
    GridBase.Meta
    GridBase.Bounds
    GridBase.UpdateMeta(GridMeta)
    GridBase.TryGetLinearIndex((int x, int y, int z), out int)
    GridBase.Contains((int x, int y, int z))
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: ZLab.Discrete.Grids
    Assembly: ZLab.Discrete.dll
    Syntax
    public sealed class OccupancyGrid : GridBase, IGrid<Occupancy>, IGridMeta

    Constructors

    Name Description
    OccupancyGrid(Vector3, BBox)

    Initializes an occupancy grid covering the specified bounds.

    OccupancyGrid(Vector3, BBox, int)

    Initializes an occupancy grid covering the specified bounds, with padding.

    OccupancyGrid(GridMeta)

    Initializes an empty occupancy grid with given metadata.

    OccupancyGrid(GridMeta, Occupancy[])

    Initializes an occupancy grid from an existing flat array.

    OccupancyGrid(Occupancy[], Vector3[], GridMeta)

    Initializes an occupancy grid from parallel occupancy and position arrays.

    Methods

    Name Description
    Clone()

    Deep clone of this grid.

    CountState()

    Count total number of voxels in the grid.

    CountState(Occupancy)

    Count voxels in a given Occupancy state.

    Fill(Occupancy)

    Fill the entire grid with a given occupancy value.

    FromBinary1Bit(ReadOnlySpan<ulong>, GridMeta)

    Create an occupancy grid from a packed ternary mask (2 bits per voxel).

    FromTernary2Bit(ReadOnlySpan<ulong>, GridMeta)

    Create an occupancy grid from a packed ternary mask (2 bits per voxel).

    GetArrayUnsafe()

    Get internal occupancy array.

    GetBuffer()

    Get a writable span over the internal occupancy buffer.

    GetMaskBinary(bool, bool)

    Export occupancy as a binary mask.

    GetMaskTernary(bool)

    Export occupancy as a ternary mask.

    GetMaskTernary(Span<byte>, bool)

    Export occupancy as a ternary mask into a provided span.

    GetReadOnlyBuffer()

    Get a read-only span over the internal occupancy buffer.

    GetReadOnlyMemory()

    Get a read-only memory over the internal occupancy buffer.

    GetValue((int x, int y, int z))

    Get occupancy value at given grid index.

    PackBinary1Bit(bool, bool)

    Export occupancy as a packed binary mask (1 bit per voxel).

    PackTernary2Bit(bool)

    Export occupancy as a packed ternary mask (2 bits per voxel).

    SetValue(ReadOnlySpan<Occupancy>)

    Set occupancy values from an existing flat array (row-major order).

    SetValue((int x, int y, int z), Occupancy)

    Set occupancy value at given grid index.

    ToString()

    String representation of the grid.

    TransformWorld(Vector3)

    Translates the grid by a world-space vector. Internally shifts content by the nearest integer voxel offset.

    TransformWorld(Vector3, Vector3)

    Translates the grid so that origin moves to target. Equivalent to TransformWorld(target - origin).

    Extension Methods

    GridEnumeratorExtension.ForEachVoxelParallel<T>(IGrid<T>, Action<Vector3, T>, int?)
    GridEnumeratorExtension.ForEachVoxel<T>(IGrid<T>, Action<Vector3, T>)
    GridSerializer.SerializeBinary(IGrid<Occupancy>)
    GridSerializer.SerializeBinary2Bit(IGrid<Occupancy>)
    GridSerializer.SerializeBinary<T>(IGrid<T>)
    GridSerializer.SerializeDataOnly<T>(IGrid<T>)
    GridSerializer.SerializeJson<T>(IGrid<T>)
    GridSerializer.SerializeMetadataOnly<T>(IGrid<T>)
    ChannelGridConversionExtensions.ToChannelGrid(OccupancyGrid, string)