UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::FUniqueIndexSet Class Reference

#include <UniqueIndexSet.h>

Public Member Functions

GEOMETRYCORE_API ~FUniqueIndexSet ()
 
void Initialize (int32 MaxIndexIn, int32 MaxValuesHint=0)
 
const int32 Num () const
 
const TArray< int32 > & Indices () const
 
bool Add (int32 Index)
 
bool Contains (int32 Index) const
 
template<typename ArrayType >
void Collect (ArrayType &Storage) const
 
TArray< int32 > && TakeValues ()
 
void SwapValuesWith (TArray< int32 > &OtherArray)
 
TArray< int32 >::RangedForConstIteratorType begin () const
 
TArray< int32 >::RangedForConstIteratorType end () const
 

Protected Attributes

int32 MaxIndex
 
TArray< int32Values
 
int64Bits = nullptr
 
int32 NumWords = 0
 

Detailed Description

FUniqueIndexSet is used to construct a list of unique elements of integers in range [0, MaxValue]. General usage is for things like converting a vertex set to the set of connected one-ring triangles. The approach is to have a bit-array for set membership, and then accumulate unique entries in a TArray.

This is faster for construction than a TSet, but does require allocating and/or clearing the bit-array. Still generally quite a bit more efficient, particularly for large sets.

Constructor & Destructor Documentation

◆ ~FUniqueIndexSet()

FUniqueIndexSet::~FUniqueIndexSet ( )

Member Function Documentation

◆ Add()

bool UE::Geometry::FUniqueIndexSet::Add ( int32  Index)
inline

Add Index to the set

◆ begin()

TArray< int32 >::RangedForConstIteratorType UE::Geometry::FUniqueIndexSet::begin ( ) const
inline

◆ Collect()

template<typename ArrayType >
void UE::Geometry::FUniqueIndexSet::Collect ( ArrayType &  Storage) const
inline

Add the members of the current index set to an object that supports .Reserve(int) and .Add(int)

◆ Contains()

bool UE::Geometry::FUniqueIndexSet::Contains ( int32  Index) const
inline
Returns
true if Index is in the current set

◆ end()

TArray< int32 >::RangedForConstIteratorType UE::Geometry::FUniqueIndexSet::end ( ) const
inline

◆ Indices()

const TArray< int32 > & UE::Geometry::FUniqueIndexSet::Indices ( ) const
inline
Returns
array of unique indices

◆ Initialize()

void UE::Geometry::FUniqueIndexSet::Initialize ( int32  MaxIndexIn,
int32  MaxValuesHint = 0 
)
inline

Initialize the set with maximum index.

Parameters
MaxValuesHintif non-zero, we pre-allocate this much memory for the index array

◆ Num()

const int32 UE::Geometry::FUniqueIndexSet::Num ( ) const
inline
Returns
number of indices in set

◆ SwapValuesWith()

void UE::Geometry::FUniqueIndexSet::SwapValuesWith ( TArray< int32 > &  OtherArray)
inline

Swap the internal TArray with another TArray. After calling this, the set is invalid and needs to be Initialize()'d again

◆ TakeValues()

TArray< int32 > && UE::Geometry::FUniqueIndexSet::TakeValues ( )
inline
Returns
the internal TArray. After calling this, the set is invalid and needs to be Initialize()'d again

Member Data Documentation

◆ Bits

int64* UE::Geometry::FUniqueIndexSet::Bits = nullptr
protected

◆ MaxIndex

int32 UE::Geometry::FUniqueIndexSet::MaxIndex
protected

◆ NumWords

int32 UE::Geometry::FUniqueIndexSet::NumWords = 0
protected

◆ Values

TArray<int32> UE::Geometry::FUniqueIndexSet::Values
protected

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