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.
Parameters:
| region (BoundingBox) | Region to cover. |
| cellSize (double) | Width and height of cells. |
Returns: Bucket list.
Create
#Create a bucket grid inside a boundingbox.
Parameters:
| region (BoundingBox) | Region to cover. |
| cellWidth (double) | Width of cells. |
| cellHeight (double) | Height of cells. |
Returns: Bucket list.
Create
#Create a bucket grid inside a boundingbox.
Parameters:
| region (BoundingBox) | Region to cover. |
| cellCount (int) | Number of horizontal and vertical cells. |
Returns: Bucket list.
Create
#Create a bucket grid inside a boundingbox.
Parameters:
| region (BoundingBox) | Region to cover. |
| horizontalCount (int) | Number of horizontal cells. |
| verticalCount (int) | Number of vertical cells. |
Returns: Bucket list.
Create
#Create a bucket grid inside a boundingbox.
Create
#Create a bucket grid inside a boundingbox.
EnumerateAroundCell
#public IEnumerable<T> EnumerateAroundCell(int column, int row, Buckets2D<bool> filter, CircleMask mask)
Enumerate over all eight cells surrounding a given cell, but omitting the non-existent ones.
Parameters:
| column (int) | Column index. |
| row (int) | Row index. |
| filter (Buckets2D<bool>) | A bucket list of true/false filter values (false=skip). |
| mask (CircleMask) | Integer circle mask. |
EnumerateAroundCell
#Enumerate over all eight cells surrounding a given cell, but omitting the non-existent ones.
EnumerateAroundCell
#Enumerate over all eight cells surrounding a given cell, but omitting the non-existent ones.
FindCellIndex
#Find the (column, row) index pair of the cell which contains the given point. The index pair is always valid.
IsValidIndex
#Gets whether a [column,row] index pair is within the bucket domain.
SetAll
#public void SetAll(T instance)
Assign a value to all cells in this array.
Parameters:
| instance (T) | Value to assign. |
ToNestedArray
#public T[][] ToNestedArray()
Gets a nested array copy of this bucket list. The secondary arrays represent the individual rows.