Buckets2D<T>
ReferencesRepresents a two-dimensional array of rectangular spatial buckets. The buckets are anchored at an origin point (lower left corner of the region).
Type parameters:
| T |
Properties
EnumerateHorizontal
#Enumerate over all items starting at [0,0] and completing row=0 from left to right before switching to the row above. This is the most natural way to iterate over a bucket list.
EnumerateVertical
#Enumerate over all items starting at[0, 0] and completing column=0 from bottom to top before switching to the column to the right.
Indexers
Methods
CellCorners
#Gets the physical corners of a cell within the bucket space.
CellEvaluate
#Evaluate a point in cell coordinates.
Create
#Create a bucket grid inside a boundingbox.
Returns: Bucket list.
Create
#Create a bucket grid inside a boundingbox.
Returns: Bucket list.
Create
#Create a bucket grid inside a boundingbox.
Returns: Bucket list.
Create
#Create a bucket grid inside a boundingbox.
public static Buckets2D<T> Create()
region,
Region to cover.
horizontalCount,
Number of horizontal cells.
verticalCount
Number of vertical cells.
Returns: Bucket list.
EnumerateAroundCell
#Enumerate over all eight cells surrounding a given cell, but omitting the non-existent ones.
public IEnumerable<T> EnumerateAroundCell()
column,
Column index.
row,
Row index.
filter,
A bucket list of true/false filter values (false=skip).
mask
Integer circle mask.
EnumerateAroundCell
#Enumerate over all eight cells surrounding a given cell, but omitting the non-existent ones.
public IEnumerable<T> EnumerateAroundCell()
column,
Column index.
row,
Row index.
filter
A bucket list of true/false filter values (false=skip).
EnumerateAroundCell
#Enumerate over all eight cells surrounding a given cell, but omitting the non-existent ones.
EnumerateSubset
#Enumerate over all valid, filtered cells in some subdomain.
EnumerateSubset
#Enumerate over all valid cells in some subdomain.
public IEnumerable<T> EnumerateSubset()
column0,
Inclusive first column index.
column1,
Exclusive last column index.
row0,
Inclusive first row index.
row1
Exclusive last row index.
FindCellIndex
#Find the (column, row) index pair of the cell which contains the given point. The index pair is always valid.
Returns: True if the locus was within the found cell, false if it way beyond the bucket region.
IsValidIndex
#Gets whether a [column,row] index pair is within the bucket domain.
ToNestedArray
#Gets a nested array copy of this bucket list. The secondary arrays represent the individual rows.
public T[][] ToNestedArray()