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