Navigation
API > API/Runtime > API/Runtime/GeometryCore
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])
| Name | FVertexConnectedComponents |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/VertexConnectedComponents.h |
| Include Path | #include "VertexConnectedComponents.h" |
Syntax
class FVertexConnectedComponents
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| VertexConnectedComponents.h | |||
FVertexConnectedComponents
(
int32 MaxVertexID |
VertexConnectedComponents.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ConnectCloseFilteredVertices
(
const TriangleMeshType& Mesh, |
Connect a filtered subset of vertices that are closer than a threshold distance in space | VertexConnectedComponents.h | |
void ConnectCloseVertices
(
const TriangleMeshType& Mesh, |
Connect vertices that are closer than a threshold distance in space | VertexConnectedComponents.h | |
void ConnectOverlappingComponents
(
const TriangleMeshType& Mesh, |
TODO: support more overlap strategies, currently just uses AABB Note this merges components based on overlap of their bounding boxes as computed before any merges; multiple passes may merge additional components | VertexConnectedComponents.h | |
void ConnectTriangles
(
const TriangleMeshType& Mesh |
VertexConnectedComponents.h | ||
void ConnectTriangles
(
TArrayView< const TriangleType > Triangles |
VertexConnectedComponents.h | ||
void ConnectVertices
(
int32 VertexID0, |
VertexConnectedComponents.h | ||
void ConnectVerticesToNearestDifferentComponent
(
const TMeshAABBTree3< TriangleMeshType >& MeshSpatial, |
Union (filtered) vertices to nearest different component w/in threshold distance Intended to be called after ConnectTriangles and other local Connect methods, to merge nearby-but-disconnected components. | VertexConnectedComponents.h | |
bool EnumerateContiguousComponentsFromArray
(
const TArray< int32 >& ContiguousComponentsArray, |
Apply ProcessComponentFn() to each connected component, or until the function returns false | VertexConnectedComponents.h | |
int32 GetComponent
(
int32 VertexID |
Note: May not be thread-safe to make multiple GetComponent() calls in parallel, as it will also collapse the underlying disjoint set paths. | VertexConnectedComponents.h | |
int32 GetComponent
(
const TriangleType& Triangle |
Note: May not be thread-safe to make multiple GetComponent() calls in parallel, as it will also collapse the underlying disjoint set paths. | VertexConnectedComponents.h | |
int32 GetComponentSize
(
int32 VertexID |
VertexConnectedComponents.h | ||
int32 GetComponentThreadsafe
(
int32 VertexID |
Note: Should be safe to make mulitple GetComponentThreadsafe() calls in parallel, as it does not modify the underlying data. | VertexConnectedComponents.h | |
bool HasMultipleComponents
(
const TriangleMeshType& Mesh, |
VertexConnectedComponents.h | ||
bool HasMultipleComponents
(
int32 MaxVID, |
VertexConnectedComponents.h | ||
void Init
(
int32 MaxVertexID |
VertexConnectedComponents.h | ||
void Init
(
const TriangleMeshType& Mesh |
VertexConnectedComponents.h | ||
TMap< int32, int32 > MakeComponentMap
(
const TriangleMeshType& Mesh, |
Map arbitrary set IDs to indices from 0 to k-1 (if there are k components) | VertexConnectedComponents.h | |
TMap< int32, int32 > MakeComponentMap
(
int32 MaxVID, |
VertexConnectedComponents.h | ||
TArray< int32 > MakeContiguousComponentsArray
(
int32 MaxVID |
Return an ordering of the vertex indices so that each connected component is in a contiguous block. | VertexConnectedComponents.h |