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

#include <VertexConnectedComponents.h>

Public Member Functions

 FVertexConnectedComponents ()
 
 FVertexConnectedComponents (int32 MaxVertexID)
 
void Init (int32 MaxVertexID)
 
template<typename TriangleMeshType >
void Init (const TriangleMeshType &Mesh)
 
template<typename TriangleMeshType >
void ConnectTriangles (const TriangleMeshType &Mesh)
 
template<typename TriangleType >
void ConnectTriangles (TArrayView< const TriangleType > Triangles)
 
template<typename TriangleMeshType >
void ConnectCloseVertices (const TriangleMeshType &Mesh, double CloseVertexThreshold, int32 KeepSizeThreshold=0)
 
template<typename TriangleMeshType >
void ConnectOverlappingComponents (const TriangleMeshType &Mesh, int32 KeepSizeThreshold=0)
 
template<typename TriangleMeshType >
bool HasMultipleComponents (const TriangleMeshType &Mesh, int32 KeepSizeThreshold=0)
 
bool HasMultipleComponents (int32 MaxVID, int32 KeepSizeThreshold=0)
 
template<typename TriangleMeshType >
TMap< int32, int32MakeComponentMap (const TriangleMeshType &Mesh, int32 KeepSizeThreshold=0)
 
TMap< int32, int32MakeComponentMap (int32 MaxVID, int32 KeepSizeThreshold=0)
 
TArray< int32MakeContiguousComponentsArray (int32 MaxVID)
 
bool EnumerateContiguousComponentsFromArray (const TArray< int32 > &ContiguousComponentsArray, TFunctionRef< bool(int32, TArrayView< const int32 >)> ProcessComponentFn)
 
int32 GetComponent (int32 VertexID)
 
int32 GetComponentSize (int32 VertexID)
 
template<typename TriangleType >
int32 GetComponent (const TriangleType &Triangle)
 
void ConnectVertices (int32 VertexID0, int32 VertexID1)
 

Protected Attributes

FSizedDisjointSet DisjointSet
 

Detailed Description

Vertex-based connected components class – can work with any mesh that has vertex IDs Also supports linking spatially-close vertices in the same component

Functions templated on TemplateMeshType are designed to work with any mesh that implements the standard MeshAdapter functions (see MeshAdapter.h) Functions templated on TriangleType are designed to work with triangles with vertex IDs that can be array-accessed (i.e.: Tri[0], Tri[1], Tri[2])

Constructor & Destructor Documentation

◆ FVertexConnectedComponents() [1/2]

UE::Geometry::FVertexConnectedComponents::FVertexConnectedComponents ( )
inline

◆ FVertexConnectedComponents() [2/2]

UE::Geometry::FVertexConnectedComponents::FVertexConnectedComponents ( int32  MaxVertexID)
inline

Member Function Documentation

◆ ConnectCloseVertices()

void UE::Geometry::FVertexConnectedComponents::ConnectCloseVertices ( const TriangleMeshType Mesh,
double  CloseVertexThreshold,
int32  KeepSizeThreshold = 0 
)
inline

◆ ConnectOverlappingComponents()

void UE::Geometry::FVertexConnectedComponents::ConnectOverlappingComponents ( const TriangleMeshType Mesh,
int32  KeepSizeThreshold = 0 
)
inline

◆ ConnectTriangles() [1/2]

void UE::Geometry::FVertexConnectedComponents::ConnectTriangles ( const TriangleMeshType Mesh)
inline

◆ ConnectTriangles() [2/2]

template<typename TriangleType >
void UE::Geometry::FVertexConnectedComponents::ConnectTriangles ( TArrayView< const TriangleType Triangles)
inline

◆ ConnectVertices()

void UE::Geometry::FVertexConnectedComponents::ConnectVertices ( int32  VertexID0,
int32  VertexID1 
)
inline

◆ EnumerateContiguousComponentsFromArray()

bool UE::Geometry::FVertexConnectedComponents::EnumerateContiguousComponentsFromArray ( const TArray< int32 > &  ContiguousComponentsArray,
TFunctionRef< bool(int32, TArrayView< const int32 >)>  ProcessComponentFn 
)
inline

Apply ProcessComponentFn() to each connected component, or until the function returns false

Parameters
ContiguousComponentsArrayMust be the array returned by MakeContiguousComponentsArray()
ProcessComponentFnFunction of (ComponentID, Component Members). If the function returns false, enumeration will stop.
Returns
True if every component was processed, false if ProcessComponentFn returned false and the enumeration returned early.

◆ GetComponent() [1/2]

template<typename TriangleType >
int32 UE::Geometry::FVertexConnectedComponents::GetComponent ( const TriangleType Triangle)
inline

◆ GetComponent() [2/2]

int32 UE::Geometry::FVertexConnectedComponents::GetComponent ( int32  VertexID)
inline

◆ GetComponentSize()

int32 UE::Geometry::FVertexConnectedComponents::GetComponentSize ( int32  VertexID)
inline

◆ HasMultipleComponents() [1/2]

bool UE::Geometry::FVertexConnectedComponents::HasMultipleComponents ( const TriangleMeshType Mesh,
int32  KeepSizeThreshold = 0 
)
inline

◆ HasMultipleComponents() [2/2]

bool UE::Geometry::FVertexConnectedComponents::HasMultipleComponents ( int32  MaxVID,
int32  KeepSizeThreshold = 0 
)
inline

◆ Init() [1/2]

void UE::Geometry::FVertexConnectedComponents::Init ( const TriangleMeshType Mesh)
inline

◆ Init() [2/2]

void UE::Geometry::FVertexConnectedComponents::Init ( int32  MaxVertexID)
inline

◆ MakeComponentMap() [1/2]

TMap< int32, int32 > UE::Geometry::FVertexConnectedComponents::MakeComponentMap ( const TriangleMeshType Mesh,
int32  KeepSizeThreshold = 0 
)
inline

◆ MakeComponentMap() [2/2]

TMap< int32, int32 > UE::Geometry::FVertexConnectedComponents::MakeComponentMap ( int32  MaxVID,
int32  KeepSizeThreshold = 0 
)
inline

◆ MakeContiguousComponentsArray()

TArray< int32 > UE::Geometry::FVertexConnectedComponents::MakeContiguousComponentsArray ( int32  MaxVID)
inline

Member Data Documentation

◆ DisjointSet

FSizedDisjointSet UE::Geometry::FVertexConnectedComponents::DisjointSet
protected

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