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

Search Results for

    Edit this page

    Method SetChannel

    | Edit this page View Source

    SetChannel(ChannelGrid, string, OccupancyGrid)

    Populates a specified channel of an existing ChannelGrid with occupancy data from a given OccupancyGrid. If the channel does not exist, it will be created.

    Declaration
    public static void SetChannel(this ChannelGrid channelGrid, string channelName, OccupancyGrid occupancyGrid)
    Parameters
    Type Name Description
    ChannelGrid channelGrid

    The ChannelGrid that will be modified by this operation.

    string channelName

    Name of the channel

    OccupancyGrid occupancyGrid

    The OccupancyGrid that contains the occupancy data to be transferred to the specified channel of the ChannelGrid.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the specified channel already exists in the ChannelGrid but has a different type than Occupancy.

    | Edit this page View Source

    SetChannel(ChannelGrid, string, DistanceGrid)

    Populates a specified channel of an existing ChannelGrid with distance data from a given DistanceGrid. If the channel does not exist, it will be created.

    Declaration
    public static void SetChannel(this ChannelGrid channelGrid, string channelName, DistanceGrid distanceGrid)
    Parameters
    Type Name Description
    ChannelGrid channelGrid

    The ChannelGrid that will be modified by this operation.

    string channelName

    Name of the channel

    DistanceGrid distanceGrid

    The DistanceGrid that contains the distance data to be transferred to the specified channel of the ChannelGrid.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the specified channel already exists in the ChannelGrid but has a different type than float.

    | Edit this page View Source

    SetChannel<T>(ChannelGrid, string, T)

    Sets the custom typed value in a specified channel of an existing ChannelGrid. If the channel does not exist, it will be created with the type of T.

    Declaration
    public static void SetChannel<T>(this ChannelGrid channelGrid, string channelName, T value) where T : unmanaged
    Parameters
    Type Name Description
    ChannelGrid channelGrid

    The ChannelGrid that will be modified by this operation.

    string channelName

    Name of the channel to set.

    T value

    The value to set in the specified channel. This value will be wrapped in a zero-allocation span and passed to the channel's SetValue method.

    Type Parameters
    Name Description
    T

    The type of the value to set in the channel. This must be an unmanaged type to ensure that it can be safely wrapped in a span and passed to the channel's SetValue method.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the specified channel already exists in the ChannelGrid but has a different type than T.

    | Edit this page View Source

    SetChannel<T>(ChannelGrid, string, DataGrid<T>)

    Sets the DataGrid<T> values in a specified channel of an existing ChannelGrid.

    Declaration
    public static void SetChannel<T>(this ChannelGrid channelGrid, string channelName, DataGrid<T> dataGrid) where T : unmanaged
    Parameters
    Type Name Description
    ChannelGrid channelGrid

    The ChannelGrid that will be modified by this operation.

    string channelName

    Name of the channel to set.

    DataGrid<T> dataGrid

    The DataGrid containing the values to set in the specified channel. The length of the data in this grid must match the voxel count of the ChannelGrid's metadata.

    Type Parameters
    Name Description
    T

    The type of the values in the DataGrid to set in the channel. This must be an unmanaged type to ensure that it can be safely wrapped in a span and passed to the channel's SetValue method.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if the voxel count of the provided DataGrid does not match the voxel count defined in the ChannelGrid's metadata.

    InvalidOperationException

    Thrown if the specified channel already exists in the ChannelGrid but has a different type than T.