Navigation
API > API/Runtime > API/Runtime/GeometryCore
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.
| Name | FOptionallySparseIndexMap |
| Type | struct |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Util/SparseIndexCollectionTypes.h |
| Include Path | #include "Util/SparseIndexCollectionTypes.h" |
Syntax
struct FOptionallySparseIndexMap
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Default constructor sets map to sparse, w/ constant -1 default value | Util/SparseIndexCollectionTypes.h | ||
FOptionallySparseIndexMap
(
EMapType MapType, |
Construct map with explicit choice of storage type | Util/SparseIndexCollectionTypes.h | |
FOptionallySparseIndexMap
(
TArray< int > Dense, |
Construct map with dense storage copied from an existing array | Util/SparseIndexCollectionTypes.h | |
FOptionallySparseIndexMap
(
int MaxIndex, |
Construct map with automatically-chosen dense or sparse storage, based on max index and estimated element count | Util/SparseIndexCollectionTypes.h |
Enums
Public
| Name | Remarks |
|---|---|
| EMapType | Different kinds of storage that could be used for the map |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DefaultOffset | int | Mapping to assign defaults for indices that are not explicitly assigned; computed as Index*DefaultScale + DefaultOffset | Util/SparseIndexCollectionTypes.h | |
| DefaultScale | int | Util/SparseIndexCollectionTypes.h | ||
| Dense | TArray< int > | Storage used when map is dense | Util/SparseIndexCollectionTypes.h | |
| MapType | EMapType | Choice of storage backing the map | Util/SparseIndexCollectionTypes.h | |
| MaxIndex | int | Max index in map; -1 will leave the map unbounded (invalid for Dense maps) | Util/SparseIndexCollectionTypes.h | |
| Sparse | TMap< int, int > | Storage used when map is sparse | Util/SparseIndexCollectionTypes.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool BadIndex
(
int Index |
Util/SparseIndexCollectionTypes.h | ||
bool Contains
(
int Index |
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 | Util/SparseIndexCollectionTypes.h | |
void InitDefaults() |
Initialize default values for dense map (sparse defaults are computed on the fly) | Util/SparseIndexCollectionTypes.h | |
void Initialize
(
int MaxIndexIn, |
Automatically choose sparse or dense storage based on use estimate | Util/SparseIndexCollectionTypes.h | |
void Set
(
int Index, |
Sets the map at a given index. Do not call if MapType is ScaleAndOffset. | Util/SparseIndexCollectionTypes.h | |
void SetInvalid
(
int Index |
Util/SparseIndexCollectionTypes.h | ||
void Unset
(
int Index |
Util/SparseIndexCollectionTypes.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FOptionallySparseIndexMap ConstantMap
(
int ConstantValue, |
Util/SparseIndexCollectionTypes.h | ||
static FOptionallySparseIndexMap IdentityMap
(
int MaxIndex |
Util/SparseIndexCollectionTypes.h | ||
static FOptionallySparseIndexMap SparseIdentityMap
(
int MaxIndex |
Util/SparseIndexCollectionTypes.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const int operator[]
(
int Index |
Array-style accessor to the map | Util/SparseIndexCollectionTypes.h |