Navigation
API > API/Plugins > API/Plugins/DynamicMesh
Inheritance Hierarchy
References
| Module | DynamicMesh |
| Header | /Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/GroupTopology.h |
| Include | #include "GroupTopology.h" |
Syntax
class FGroupTopology
Remarks
Given a per-triangle integer ("group"), FGroupTopology extracts a group-level topological graph from an input Mesh. The graph consists of three elements: Corners: there is a corner at each vertex where 3 or more groups meet (ie 3 or more groups in one-ring) Edges: a group edge is a list of one or more connected edges that have the same pair of different groups on either side Group: a group is a set of connected faces with the same GroupID
By default, the triangle group attribute of the input Mesh is used. You can override GetGroupID to provide your own grouping.
Various query functions are provided to allow group topology to be interrogated. Note that when functions refer to "CornerID", and "GroupEdgeID", these are simply indices into the internal Corners and Edges arrays. However references to "GroupID" refer to the actual group IDs in FDynamicMesh (not an index into Groups).
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< FCorner > | Corners | List of Corners in the topology graph (ie these are the nodes/vertices of the graph) | |
| TSet< int32 > | CurrentExtraCornerVids | ||
| TArray< FGroupEdge > | Edges | List of Edges in the topology graph (each edge connects two corners/nodes) | |
| TArray< int > | EmptyArray | ||
| TArray< int > | GroupIDToGroupIndexMap | ||
| const FDynamicMeshPolygroupAttribute * | GroupLayer | ||
| TArray< FGroup > | Groups | List of Groups in the topology graph (ie faces) | |
| const FDynamicMesh3 * | Mesh | ||
| PRAGMA_DISABLE_DEPRECATION_WARNINGS | |||
| TFunction< bool(const FGroupTopology &GroupTopology, int32 Vid, const FIndex2i &AttachedGroupEdgeEid... | ShouldAddExtraCornerAtVert | Optional function that will add extra corners (in addition to the ones that are always placed at junctures of three or more group edges) during RebuildTopology whenever the function returns true for a vertex that is part of a group edge. | |
| TMap< int32, int32 > | VertexIDToCornerIDMap |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FGroupTopology
(
const FGroupTopology& |
|||
FGroupTopology
(
const FDynamicMesh3* Mesh, |
|||
FGroupTopology
(
const FDynamicMesh3* Mesh, |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | CollectGroupBoundaryVertices
(
int GroupID, |
Add all the group boundary vertices of the given GroupID to the Vertices set | |
| void | CollectGroupVertices
(
int GroupID, |
Add all the vertices of the given GroupID to the Vertices set | |
| void | FindCornerNbrCorners
(
int CornerID, |
Add all the Corners connected to the given Corner to the EdgesOut list. | |
| void | FindCornerNbrEdges
(
int CornerID, |
Add all the Edges connected to the given Corner to the EdgesOut list. | |
| void | FindCornerNbrGroups
(
const TArray< int >& CornerIDs, |
Add all the groups connected to the given Corners to the GroupsOut list | |
| void | FindCornerNbrGroups
(
int CornerID, |
Add all the groups connected to the given Corner to the GroupsOut list | |
| void | FindEdgeNbrEdges
(
int GroupEdgeID, |
Add the edges connected to the given GroupEdgeID to the EdgesOut list. This is somewhat expensive. | |
| void | FindEdgeNbrGroups
(
const TArray< int >& GroupEdgeIDs, |
Add the groups connected to all the GroupEdgeIDs to the GroupsOut list. | |
| void | FindEdgeNbrGroups
(
int GroupEdgeID, |
Add the groups connected to the given GroupEdgeID to the GroupsOut list. | |
| const FGroup * | FindGroupByID
(
int GroupID |
||
| int | FindGroupEdgeID
(
int MeshEdgeID |
||
| int | FindGroupEdgeID
(
FMeshTriEdgeID FMeshTriEdgeID |
||
| void | FindVertexNbrGroups
(
int VertexID, |
Add all the groups connected to the given Mesh Vertex to the GroupsOut list | |
| void | FindVertexNbrGroups
(
const TArray< int >& VertexIDs, |
Add all the groups connected to the given Mesh Vertices to the GroupsOut list | |
| void | ForGroupEdges
(
int GroupID, |
Call EdgeFunc for each boundary edge of the given Group (no order defined). | |
| void | ForGroupSetEdges
(
const IntIterableContainerType& GroupIDs, |
Call EdgeFunc for each boundary edge of each of the given Groups (no order defined). | |
| bool | GenerateBoundaryAndGroupEdges
(
FGroup& Group, |
Generates group edges and boundary structs for given group. Returns false if failed to find group boundaries. | |
| void | GetAllVertexGroups
(
int32 VertexID, |
||
| int32 | GetCornerIDFromVertexID
(
int32 VertexID |
||
| int | GetCornerVertexID
(
int CornerID |
||
| const TSet< int32 > & | |||
| double | GetEdgeArcLength
(
int32 GroupEdgeID, |
||
| FVector3d | GetEdgeMidpoint
(
int32 GroupEdgeID, |
||
| const TArray< int > & | GetGroupEdgeEdges
(
int GroupEdgeID |
||
| bool | GetGroupEdgeTangent
(
int GroupEdgeID, |
Calculate tangent of group edge, as direction from start to end endpoints | |
| const TArray< int > & | GetGroupEdgeVertices
(
int GroupEdgeID |
||
| const TArray< int > & | GetGroupFaces
(
int GroupID |
||
| FFrame3d | GetGroupFrame
(
int32 GroupID |
||
| int | GetGroupID
(
int TriangleID |
Adjacency of Per-Triangle integers are what define the triangle groups. | |
| const TArray< int > & | GetGroupNbrGroups
(
int GroupID |
||
| const TArray< int > & | GetGroupTriangles
(
int GroupID |
||
| const FDynamicMesh3 * | GetMesh () |
||
| void | GetSelectedTriangles
(
const FGroupTopologySelection& Selection, |
Get the set of selected triangles for a given GroupTopologySelection | |
| FAxisAlignedBox3d | GetSelectionBounds
(
const FGroupTopologySelection& Selection, |
||
| FFrame3d | GetSelectionFrame
(
const FGroupTopologySelection& Selection, |
||
| bool | IsBoundaryEdge
(
int32 GroupEdgeID |
||
| bool | IsEdgeAngleSharp
(
const FDynamicMesh3* Mesh, |
Helper function for use with ShouldAddExtraCornerAtVert. | |
| bool | IsGroupEdge
(
FMeshTriEdgeID TriEdgeID, |
||
| bool | IsIsolatedLoop
(
int32 GroupEdgeID |
||
| bool | IsSimpleGroupEdge
(
int32 GroupEdgeID |
||
| FIndex2i | MakeEdgeGroupsPair
(
int MeshEdgeID |
||
| FIndex2i | MakeEdgeGroupsPair
(
int Group1, |
||
| bool | Build the group topology graph. | ||
| bool | RebuildTopologyWithSpecificExtraCorners
(
const TSet< int32 >& ExtraCornerVids |
Rebuilds the topology graph while ignoring ShouldAddExtraCornerAtVert and only determining whether an extra corner should be forced by seeing whether the vertex is in the provided set. | |
| void | RetargetOnClonedMesh
(
const FDynamicMesh3* Mesh |
Keeps the structures of topology in place but points the mesh pointers to a new cloned mesh. | |
| bool | ShouldVertBeCorner
(
int VertexID, |
Return true if the given vertex should be a corner based on the number of adjoining group edges or based on ShouldAddExtraCornerAtVert, if provided. |
Operators
| Type | Name | Description | |
|---|---|---|---|
| FGroupTopology & | operator=
(
const FGroupTopology& |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FCorner | FCorner is a "corner" in the group topology, IE a vertex where 3+ groups meet. | ||
| FGroup | FGroup is a set of connected triangles with the same GroupID | ||
| FGroupBoundary | A Group is bounded by closed loops of FGroupEdge elements. | ||
| FGroupEdge | FGroupEdge is a sequence of group-boundary-edges where the two groups on either side of each edge are the same. |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| TBitArray | CornerVerticesFlags | Use VertexIDToCornerIDMap instead. |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | ExtractGroupEdges
(
FGroup& Group |
Use GenerateBoundaryAndGroupEdges instead. | |
| int | FindExistingGroupEdge
(
int GroupID, |
Group edges cannot be uniquely identified by a group pair. | |
| bool | IsCornerVertex
(
int VertexID |
Use ShouldVertBeCorner instead. | |
| FIndex2i | MakeEdgeID
(
int MeshEdgeID |
Use MakeEdgeGroupsPair instead. The returned pair cannot uniquely identify a group edge. | |
| FIndex2i | MakeEdgeID
(
int Group1, |
Use MakeEdgeGroupsPair instead. The returned pair cannot uniquely identify a group edge. |