UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ > Class Template Reference

#include <BlockedDenseGrid3.h>

+ Inheritance diagram for UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >:

Public Types

typedef TBasicBlockedDenseGrid3< ElemType, BlockSize_BlockedDenseGridType
 
typedef TBlockedGrid3Layout< BlockSize_BlockedGrid3LayoutType
 
typedef TBlockData3< ElemType, BlockSize_BlockData3Type
 
- Public Types inherited from UE::Geometry::TBasicBlockedDenseGrid3< ElemType, BlockSize_ >
typedef TBlockedGrid3Layout< BlockSize_BlockedGrid3LayoutType
 
typedef TBlockData3< ElemType, BlockSize_BlockData3Type
 
- Public Types inherited from UE::Geometry::TBlockedGrid3Layout< BlockSize_ >
typedef TBlockData3Layout< BlockSize_FBlockData3Layout
 

Public Member Functions

 TBlockedGrid3 ()
 
 TBlockedGrid3 (int32 DimI, int32 DimJ, int32 DimK, ElemType InitialValue)
 
template<typename CriticalSectionProviderType >
void SetValueWithLock (int32 I, int32 J, int32 K, ElemType NewValue, CriticalSectionProviderType &CriticalSectionProvider)
 
template<typename CriticalSectionProviderType >
void SetValueWithLock (const FVector3i &CellIJK, ElemType NewValue, CriticalSectionProviderType CriticalSectionProvider)
 
template<typename ProcessFunc , typename CriticalSectionProviderType >
void ProcessValueWithLock (int32 I, int32 J, int32 K, ProcessFunc Func, CriticalSectionProviderType CriticalSectionProvider)
 
template<typename ProcessFunc , typename CriticalSectionProviderType >
void ProcessValueWithLock (const FVector3i &CellIJK, ProcessFunc Func, CriticalSectionProviderType CriticalSectionProvider)
 
int32 GetNumBlocks () const
 
TArray< const BlockData3Type * > GetAllocatedConstBlocks () const
 
TArray< BlockData3Type * > GetAllocatedBlocks ()
 
TArray< const BlockData3Type * > GetAllocatedBlocks () const
 
bool IsBlockAllocated (const FVector3i &BlockIJK) const
 
BlockData3TypeTouchBlockData (const FVector3i &BlockIJK)
 
TUniquePtr< BlockData3Type > & GetBlockData (const FVector3i &BlockIJK)
 
const TUniquePtr< BlockData3Type > & GetBlockData (const FVector3i &BlockIJK) const
 
TUniquePtr< BlockData3Type > & GetBlockData (int32 BlockIndex)
 
const TUniquePtr< BlockData3Type > & GetBlockData (int32 BlockIndex) const
 
ElemType GetBlockDefaultValue (const FVector3i &BlockIJK) const
 
void SetBlockDefaultValue (const FVector3i &BlockIJK, const ElemType &Value, bool bPruneBlock=true)
 
template<typename ProcessFunc >
void ProcessBlockDefaultValue (const FVector3i &BlockIJK, ProcessFunc Func, bool bPruneBlock=true)
 
- Public Member Functions inherited from UE::Geometry::TBasicBlockedDenseGrid3< ElemType, BlockSize_ >
 TBasicBlockedDenseGrid3 ()
 
 TBasicBlockedDenseGrid3 (int32 DimI, int32 DimJ, int32 DimK, ElemType InitialValue)
 
void Resize (int32 DimI, int32 DimJ, int32 DimK)
 
void Reset ()
 
void Reset (int32 DimI, int32 DimJ, int32 DimK, ElemType InitialValue)
 
ElemType GetValue (int32 I, int32 J, int32 K) const
 
ElemType GetValue (const FVector3i &CellIJK) const
 
void SetValue (int32 I, int32 J, int32 K, ElemType NewValue)
 
void SetValue (const FVector3i &CellIJK, ElemType NewValue)
 
template<typename ProcessFunc >
void ProcessValue (int32 I, int32 J, int32 K, ProcessFunc Func)
 
template<typename ProcessFunc >
void ProcessValue (const FVector3i &CellIJK, ProcessFunc Func)
 
template<typename OtherElemType >
bool PreAllocateFromSourceGrid (const TBasicBlockedDenseGrid3< OtherElemType, BlockSize > &SourceGrid)
 
int32 GetNumBlocks () const
 
- Public Member Functions inherited from UE::Geometry::TBlockedGrid3Layout< BlockSize_ >
 TBlockedGrid3Layout ()
 
 TBlockedGrid3Layout (int32 DimI, int32 DimJ, int32 DimK)
 
 TBlockedGrid3Layout (FVector3i Dims)
 
void Resize (int32 DimI, int32 DimJ, int32 DimK)
 
const FVector3iGetDimensions () const
 
const FVector3iGetBlockDimensions () const
 
FAxisAlignedBox3i Bounds () const
 
FAxisAlignedBox3i BoundsInclusive () const
 
int64 Size () const
 
bool IsValidIJK (const FVector3i &IJK) const
 
bool IsValidBlockIJK (const FVector3i &BlockIJK)
 
int32 IJKtoBlockIndex (const FVector3i &IJK) const
 
void GetBlockAndLocalIndex (const FVector3i &IJK, int32 &BlockIndexOut, int32 &LocalIndexOut) const
 
void GetBlockAndLocalIndex (int32 I, int32 J, int32 K, int32 &BlockIndexOut, int32 &LocalIndexOut) const
 
FVector3i BlockIndexToBlockIJK (const int32 BlockIndex) const
 
int32 BlockIJKToBlockIndex (const FVector3i &BlockIJK) const
 

Static Public Attributes

static constexpr int32 BlockSize = BlockSize_
 
static constexpr int32 BlockElemCount = BlockSize * BlockSize * BlockSize
 
- Static Public Attributes inherited from UE::Geometry::TBasicBlockedDenseGrid3< ElemType, BlockSize_ >
static constexpr int32 BlockSize = BlockSize_
 
static constexpr int32 BlockElemCount = BlockSize * BlockSize * BlockSize
 
- Static Public Attributes inherited from UE::Geometry::TBlockedGrid3Layout< BlockSize_ >
static constexpr int32 BlockSize = BlockSize_
 
static constexpr int32 BlockElemCount = BlockSize * BlockSize * BlockSize
 

Protected Types

typedef TBasicBlockedDenseGrid3< ElemType, BlockSize_ >::FBlock3 FBlock3
 

Protected Member Functions

template<typename FuncType >
void WriteBlockDefaultValue (const int32 BlockIndex, FuncType Func, bool bDeallocateBock=true)
 
template<typename FuncType >
void WriteBlockDefaultValue (const FVector3i &BlockIJK, FuncType Func, bool bDeallocateBock=true)
 
template<typename FuncType >
void WriteBlockDefaultValueWithLock (const int32 BlockIndex, FuncType Func, FCriticalSection *CriticalSection, bool bDeallocateBock=true)
 
ElemType ReadBlockDefaultValue (const int32 &BlockIndex) const
 
ElemType ReadBlockDefaultValue (const FVector3i &BlockIJK) const
 
- Protected Member Functions inherited from UE::Geometry::TBasicBlockedDenseGrid3< ElemType, BlockSize_ >
FBlock3GetBlock (int32 Index)
 
const FBlock3GetBlock (int32 Index) const
 
bool IsBlockAllocated (const FBlock3 &Block) const
 
bool IsBlockAllocated (const int32 BlockIndex) const
 
BlockData3TypeTouchBlockData (const int32 BlockIndex)
 
template<typename FuncType >
void WriteValue (const int32 &BlockIndex, const int32 &LocalIndex, FuncType Func)
 
template<typename FuncType >
void WriteValue (int32 I, int32 J, int32 K, FuncType Func)
 
template<typename FuncType >
void WriteValueWithLock (const int32 &BlockIndex, const int32 &LocalIndex, FuncType Func, FCriticalSection *CriticalSection)
 
ElemType ReadValue (const int32 &BlockIndex, const int32 &LocalIndex) const
 
ElemType ReadValue (int32 I, int32 J, int32 K) const
 
ElemType ReadValueWithLock (const int32 &BlockIndex, const int32 &LocalIndex, FCriticalSection *CriticalSection)
 
template<typename OtherGridType >
bool AllocateTopologyUnionImpl (const OtherGridType &OtherGrid)
 

Additional Inherited Members

- Protected Attributes inherited from UE::Geometry::TBasicBlockedDenseGrid3< ElemType, BlockSize_ >
ElemType DefaultValue = (ElemType)0
 
TArray< FBlock3Blocks
 
- Protected Attributes inherited from UE::Geometry::TBlockedGrid3Layout< BlockSize_ >
FVector3i BlockDimensions
 
FVector3i Dimensions
 

Detailed Description

template<typename ElemType, int32 BlockSize_>
class UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >

TBlockedGrid3 represents a 3D uniform grid.

The grid is allocated in BlockSize^3 blocks on-demand (BlockSize is a compile-time constant) allowing very large grids to be used without having to pre-allocate all the memory, eg for sparse/narrow-band use cases.

Block-level default values are returned when querying a grid cell in an unallocated block.,

Block-level access is provided to facilitate parallel algorithms. Additionally, 'Set' methods are provided that utilize critical sections provided by the caller.

Member Typedef Documentation

◆ BlockData3Type

template<typename ElemType , int32 BlockSize_>
typedef TBlockData3<ElemType, BlockSize_> UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::BlockData3Type

◆ BlockedDenseGridType

template<typename ElemType , int32 BlockSize_>
typedef TBasicBlockedDenseGrid3<ElemType, BlockSize_> UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::BlockedDenseGridType

◆ BlockedGrid3LayoutType

template<typename ElemType , int32 BlockSize_>
typedef TBlockedGrid3Layout<BlockSize_> UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::BlockedGrid3LayoutType

◆ FBlock3

template<typename ElemType , int32 BlockSize_>
typedef TBasicBlockedDenseGrid3<ElemType,BlockSize_>::FBlock3 UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::FBlock3
protected

Constructor & Destructor Documentation

◆ TBlockedGrid3() [1/2]

template<typename ElemType , int32 BlockSize_>
UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::TBlockedGrid3 ( )
inline

Create empty grid

◆ TBlockedGrid3() [2/2]

template<typename ElemType , int32 BlockSize_>
UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::TBlockedGrid3 ( int32  DimI,
int32  DimJ,
int32  DimK,
ElemType  InitialValue 
)
inline

Create grid with specified domain.

Member Function Documentation

◆ GetAllocatedBlocks() [1/2]

template<typename ElemType , int32 BlockSize_>
TArray< BlockData3Type * > UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::GetAllocatedBlocks ( )
inline
Returns
array of pointers to the allocated blocks. Note: the grid owns the blocks, so the calling code should not delete them.

◆ GetAllocatedBlocks() [2/2]

template<typename ElemType , int32 BlockSize_>
TArray< const BlockData3Type * > UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::GetAllocatedBlocks ( ) const
inline
Returns
array of pointers to the allocated blocks. Note: the grid owns the blocks, so the calling code should not delete them.

◆ GetAllocatedConstBlocks()

template<typename ElemType , int32 BlockSize_>
TArray< const BlockData3Type * > UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::GetAllocatedConstBlocks ( ) const
inline
Returns
array of pointers to the allocated blocks. Note: the grid owns the blocks, so the calling code should not delete them.

◆ GetBlockData() [1/4]

template<typename ElemType , int32 BlockSize_>
TUniquePtr< BlockData3Type > & UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::GetBlockData ( const FVector3i BlockIJK)
inline
Returns
reference to a unique pointer that points to a block that may or may not be allocated
Parameters
BlockIJK- the lattice address of the block in terms of block units ( e.g. the location in a grid of blocks).

◆ GetBlockData() [2/4]

template<typename ElemType , int32 BlockSize_>
const TUniquePtr< BlockData3Type > & UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::GetBlockData ( const FVector3i BlockIJK) const
inline
Returns
reference to a unique pointer that points to a block that may or may not be allocated
Parameters
BlockIJK- the lattice address of the block in terms of block units ( e.g. the location in a grid of blocks).

◆ GetBlockData() [3/4]

template<typename ElemType , int32 BlockSize_>
TUniquePtr< BlockData3Type > & UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::GetBlockData ( int32  BlockIndex)
inline
Returns
reference to a unique pointer that points to a block that may or may not be allocated
Parameters
BlockIndex- the index of the block in an internal linearization of the blocks. Note: BlockIJK and BlockIndex can be converted by means of BlockIJKToBlockIndex() and BlockIndexToBlockIJK()

◆ GetBlockData() [4/4]

template<typename ElemType , int32 BlockSize_>
const TUniquePtr< BlockData3Type > & UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::GetBlockData ( int32  BlockIndex) const
inline
Returns
reference to a unique pointer that points to a block that may or may not be allocated
Parameters
BlockIndex- the index of the block in an internal linearization of the blocks. Note: BlockIJK and BlockIndex can be converted by means of BlockIJKToBlockIndex() and BlockIndexToBlockIJK()

◆ GetBlockDefaultValue()

template<typename ElemType , int32 BlockSize_>
ElemType UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::GetBlockDefaultValue ( const FVector3i BlockIJK) const
inline
Returns
the default value for the specified block.
Parameters
BlockIJK- the lattice address of the block in terms of block units ( e.g. the location in a grid of blocks).

◆ GetNumBlocks()

template<typename ElemType , int32 BlockSize_>
int32 UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::GetNumBlocks ( ) const
inline
Returns
the total number of block units that covers the spatial dimensions of the grid.

◆ IsBlockAllocated()

template<typename ElemType , int32 BlockSize_>
bool UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::IsBlockAllocated ( const FVector3i BlockIJK) const
inline
Returns
true if the specified block has been allocated.
Parameters
BlockIJK- the lattice address of the block in terms of block units ( e.g. the location in a grid of blocks).

◆ ProcessBlockDefaultValue()

template<typename ElemType , int32 BlockSize_>
template<typename ProcessFunc >
void UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::ProcessBlockDefaultValue ( const FVector3i BlockIJK,
ProcessFunc  Func,
bool  bPruneBlock = true 
)
inline

Update the default value for the specified block using a functor

Parameters
BlockIJK- the lattice address of the block in terms of block units ( e.g. the location in a grid of blocks).
Func- Func(ElemType& value){..} is called on the default value.
bPruneBlock- if true, any internal block allocation will be freed and the resulting deallocated block will just hold a single default value. if false, the allocation of the block will no change.

◆ ProcessValueWithLock() [1/2]

template<typename ElemType , int32 BlockSize_>
void UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::ProcessValueWithLock ( const FVector3i CellIJK,
ProcessFunc  Func,
CriticalSectionProviderType  CriticalSectionProvider 
)
inline

Call an external lambda with a reference to the grid value at CellIJK. Called as Func(ElemType&), so the caller can both read and write the grid cell

note: if doing pure reads prefer the GetValue() methods because the ProcessValue method will allocate the underlying data block.

◆ ProcessValueWithLock() [2/2]

template<typename ElemType , int32 BlockSize_>
void UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::ProcessValueWithLock ( int32  I,
int32  J,
int32  K,
ProcessFunc  Func,
CriticalSectionProviderType  CriticalSectionProvider 
)
inline

Call an external lambda with a reference to the grid value at (I,J,K). Called as Func(ElemType&), so the caller can both read and write the grid cell

note: if doing pure reads prefer the GetValue() methods because the ProcessValue method will allocate the underlying data block.

◆ ReadBlockDefaultValue() [1/2]

template<typename ElemType , int32 BlockSize_>
ElemType UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::ReadBlockDefaultValue ( const FVector3i BlockIJK) const
inlineprotected

◆ ReadBlockDefaultValue() [2/2]

template<typename ElemType , int32 BlockSize_>
ElemType UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::ReadBlockDefaultValue ( const int32 BlockIndex) const
inlineprotected

◆ SetBlockDefaultValue()

template<typename ElemType , int32 BlockSize_>
void UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::SetBlockDefaultValue ( const FVector3i BlockIJK,
const ElemType &  Value,
bool  bPruneBlock = true 
)
inline

Update the default value for the specified block.

Parameters
BlockIJK- the lattice address of the block in terms of block units ( e.g. the location in a grid of blocks).
Value- the new default value for this block
bPruneBlock- if true, any internal block allocation will be freed and the resulting deallocated block will just hold a single default value. if false, the allocation of the block will no change.

◆ SetValueWithLock() [1/2]

template<typename ElemType , int32 BlockSize_>
void UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::SetValueWithLock ( const FVector3i CellIJK,
ElemType  NewValue,
CriticalSectionProviderType  CriticalSectionProvider 
)
inline

Set the grid value at CellIJK, with user supplied locking in the form of a function of the form

FCriticalSection& CriticalSectionProvider(id)

that provides a critical section for each block id.

◆ SetValueWithLock() [2/2]

template<typename ElemType , int32 BlockSize_>
void UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::SetValueWithLock ( int32  I,
int32  J,
int32  K,
ElemType  NewValue,
CriticalSectionProviderType CriticalSectionProvider 
)
inline

Set the grid value at (I,J,K), with user supplied locking in the form of a function of the form

FCriticalSection& CriticalSectionProvider(id)

that provides a critical section for each block id.

◆ TouchBlockData()

template<typename ElemType , int32 BlockSize_>
BlockData3Type & UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::TouchBlockData ( const FVector3i BlockIJK)
inline
Returns
a references to the specified block, this will allocate the block if it doesn't already exists.
Parameters
BlockIJK- the lattice address of the block in terms of block units ( e.g. the location in a grid of blocks).

◆ WriteBlockDefaultValue() [1/2]

template<typename ElemType , int32 BlockSize_>
template<typename FuncType >
void UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::WriteBlockDefaultValue ( const FVector3i BlockIJK,
FuncType  Func,
bool  bDeallocateBock = true 
)
inlineprotected

◆ WriteBlockDefaultValue() [2/2]

template<typename ElemType , int32 BlockSize_>
template<typename FuncType >
void UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::WriteBlockDefaultValue ( const int32  BlockIndex,
FuncType  Func,
bool  bDeallocateBock = true 
)
inlineprotected

◆ WriteBlockDefaultValueWithLock()

template<typename ElemType , int32 BlockSize_>
template<typename FuncType >
void UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::WriteBlockDefaultValueWithLock ( const int32  BlockIndex,
FuncType  Func,
FCriticalSection CriticalSection,
bool  bDeallocateBock = true 
)
inlineprotected

Member Data Documentation

◆ BlockElemCount

template<typename ElemType , int32 BlockSize_>
constexpr int32 UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::BlockElemCount = BlockSize * BlockSize * BlockSize
staticconstexpr

◆ BlockSize

template<typename ElemType , int32 BlockSize_>
constexpr int32 UE::Geometry::TBlockedGrid3< ElemType, BlockSize_ >::BlockSize = BlockSize_
staticconstexpr

The documentation for this class was generated from the following file: