![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SparseIndexCollectionTypes.h>
Public Types | |
| enum class | EMapType : uint8 { Dense , Sparse , ScaleAndOffset } |
Public Member Functions | |
| FOptionallySparseIndexMap () | |
| FOptionallySparseIndexMap (EMapType MapType, int MaxIndex=-1) | |
| FOptionallySparseIndexMap (TArray< int > Dense, int MaxIndex=-1) | |
| FOptionallySparseIndexMap (int MaxIndex, int SubsetCountEst) | |
| void | Initialize (int MaxIndexIn, int SubsetCountEst) |
| void | InitDefaults () |
| bool | BadIndex (int Index) const |
| bool | Contains (int Index) |
| const int | operator[] (int Index) const |
| void | Unset (int Index) |
| void | Set (int Index, int Value) |
| void | SetInvalid (int Index) |
Static Public Member Functions | |
| static FOptionallySparseIndexMap | IdentityMap (int MaxIndex=-1) |
| static FOptionallySparseIndexMap | ConstantMap (int ConstantValue, int MaxIndex=-1) |
| static FOptionallySparseIndexMap | SparseIdentityMap (int MaxIndex=-1) |
Public Attributes | |
| TArray< int > | Dense |
| TMap< int, int > | Sparse |
| int | DefaultOffset = -1 |
| int | DefaultScale = 0 |
| int | MaxIndex = -1 |
| EMapType | MapType = EMapType::Sparse |
Index map that supports dense or sparse storage, or a simple formula-based map (e.g. constant, identity, shift) For dense and sparse, the formula can be used to set default values.
|
strong |
|
inline |
default constructor sets map to sparse, w/ constant -1 default value
|
inline |
construct map with explicit choice of storage type
|
inline |
construct map with dense storage copied from an existing array
|
inline |
construct map with automatically-chosen dense or sparse storage, based on max index and estimated element count
|
inline |
|
inlinestatic |
|
inline |
dense variant: returns true unless you have set index to InvalidIndex (eg via SetToInvalid) sparse variant: returns true if index is in map or default index is >= 0 scaleandoffset variant: returns true if default index is >= 0 all return false if index is out-of-bounds
|
inlinestatic |
|
inline |
|
inline |
Automatically choose sparse or dense storage based on use estimate
|
inline |
Array-style accessor to the map
|
inline |
Sets the map at a given index. Do not call if MapType is ScaleAndOffset.
|
inline |
| Index | Explicitly sets the given index to Invalid (not default). Do not call if MapType is ScaleAndOffset. |
|
inlinestatic |
|
inline |
| Index | this index will be unset in map, restoring the default mapping (Index -> Index*DefaultScale + DefaultOffset) |
| int UE::Geometry::FOptionallySparseIndexMap::DefaultOffset = -1 |
| int UE::Geometry::FOptionallySparseIndexMap::DefaultScale = 0 |
| TArray<int> UE::Geometry::FOptionallySparseIndexMap::Dense |
| EMapType UE::Geometry::FOptionallySparseIndexMap::MapType = EMapType::Sparse |
| int UE::Geometry::FOptionallySparseIndexMap::MaxIndex = -1 |
| TMap<int, int> UE::Geometry::FOptionallySparseIndexMap::Sparse |