![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SparseGrid2.h>
Public Member Functions | |
| TSparseGrid2 () | |
| ~TSparseGrid2 () | |
| TSparseGrid2 (const TSparseGrid2 &Other)=delete | |
| TSparseGrid2 & | operator= (const TSparseGrid2 &Other)=delete |
| TSparseGrid2 (TSparseGrid2 &&Other) noexcept | |
| TSparseGrid2 & | operator= (TSparseGrid2 &&Other) noexcept |
| bool | Has (const FVector2i &Index) const |
| const ElemType * | Get (const FVector2i &Index) const |
| ElemType * | Get (const FVector2i &Index, bool bAllocateIfMissing) |
| bool | Free (const FVector2i &Index) |
| void | FreeAll () |
| int | GetCount () const |
| float | GetDensity () const |
| FAxisAlignedBox2i | GetBoundsInclusive () const |
| FVector2i | GetDimensions () const |
| template<typename Func > | |
| void | AllocatedIteration (Func ElementFunc) const |
| template<typename Func > | |
| void | RangeIteration (FVector2i MinIndex, FVector2i MaxIndex, Func ElementFunc) const |
| SIZE_T | GetAllocatedSize () const |
Protected Member Functions | |
| ElemType * | Allocate (const FVector2i &index) |
Protected Attributes | |
| TMap< FVector2i, ElemType * > | Elements |
| FAxisAlignedBox2i | Bounds |
Dynamic sparse 2D grid. Useful in cases where we have grid of some type of non-trivial object and we don't want to pre-allocate full grid of them. So we allocate on-demand. This can be used to implement multi-grid schemes, eg for example the ElemType could be sub-grid of fixed dimension.
|
inline |
Create empty grid
|
inline |
Deletes all grid elements
|
delete |
|
inlinenoexcept |
|
inlineprotected |
|
inline |
Iterate over existing elements and apply ElementFunc(ElementType) to each of them
|
inline |
Delete an element in the grid
| Index | integer grid index |
|
inline |
Delete all elements in the grid
|
inline |
Get the grid element at this index
| Index | integer grid index |
|
inline |
Get the grid element at this index, and optionally allocate it if it doesn't exist
| Index | integer grid index |
| bAllocateIfMissing | if the element at this index is null, allocate a new one |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| Index | an integer grid index |
|
delete |
|
inlinenoexcept |
|
inline |
Iterate over existing allocated elements within the integer bounds defined by Min and Max (inclusive), and apply ElementFunc(ElementType) to each of them
|
protected |
accumulated bounds of all indices inserted into Elements. Not currently used internally.
|
protected |
sparse grid of allocated elements