Navigation
API > API/Plugins > API/Plugins/DynamicMesh
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).
| Name | FGroupTopology |
| Type | class |
| Header File | /Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/GroupTopology.h |
| Include Path | #include "GroupTopology.h" |
Syntax
class FGroupTopology
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FGroupTopology
(
const FDynamicMesh3* Mesh, |
GroupTopology.h | ||
FGroupTopology
(
const FDynamicMesh3* Mesh, |
GroupTopology.h | ||
FGroupTopology
(
const FGroupTopology& |
GroupTopology.h | ||
| GroupTopology.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FGroupTopology() |
GroupTopology.h |
Structs
| Name | Remarks |
|---|---|
| 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. |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Corners | TArray< FCorner > | List of Corners in the topology graph (ie these are the nodes/vertices of the graph) | GroupTopology.h | |
| Edges | TArray< FGroupEdge > | List of Edges in the topology graph (each edge connects two corners/nodes) | GroupTopology.h | |
| Groups | TArray< FGroup > | List of Groups in the topology graph (ie faces) | GroupTopology.h | |
| PRAGMA_DISABLE_DEPRECATION_WARNINGS | GroupTopology.h | |||
| ShouldAddExtraCornerAtVert | TFunction< bool(const FGroupTopology &GroupTopology, int32 Vid, const FIndex2i &AttachedGroupEdgeEids)> | 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. | GroupTopology.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CollectGroupBoundaryVertices
(
int GroupID, |
Add all the group boundary vertices of the given GroupID to the Vertices set | GroupTopology.h | |
void CollectGroupVertices
(
int GroupID, |
Add all the vertices of the given GroupID to the Vertices set | GroupTopology.h | |
void FindCornerNbrCorners
(
int CornerID, |
Add all the Corners connected to the given Corner to the EdgesOut list. | GroupTopology.h | |
void FindCornerNbrEdges
(
int CornerID, |
Add all the Edges connected to the given Corner to the EdgesOut list. | GroupTopology.h | |
void FindCornerNbrGroups
(
const TArray< int >& CornerIDs, |
Add all the groups connected to the given Corners to the GroupsOut list | GroupTopology.h | |
void FindCornerNbrGroups
(
int CornerID, |
Add all the groups connected to the given Corner to the GroupsOut list | GroupTopology.h | |
void FindEdgeNbrEdges
(
int GroupEdgeID, |
Add the edges connected to the given GroupEdgeID to the EdgesOut list. This is somewhat expensive. | GroupTopology.h | |
void FindEdgeNbrGroups
(
const TArray< int >& GroupEdgeIDs, |
Add the groups connected to all the GroupEdgeIDs to the GroupsOut list. | GroupTopology.h | |
void FindEdgeNbrGroups
(
int GroupEdgeID, |
Add the groups connected to the given GroupEdgeID to the GroupsOut list. | GroupTopology.h | |
const FGroup * FindGroupByID
(
int GroupID |
GroupTopology.h | ||
int FindGroupEdgeID
(
int MeshEdgeID |
GroupTopology.h | ||
int FindGroupEdgeID
(
FMeshTriEdgeID FMeshTriEdgeID |
GroupTopology.h | ||
void FindVertexNbrGroups
(
int VertexID, |
Add all the groups connected to the given Mesh Vertex to the GroupsOut list | GroupTopology.h | |
void FindVertexNbrGroups
(
const TArray< int >& VertexIDs, |
Add all the groups connected to the given Mesh Vertices to the GroupsOut list | GroupTopology.h | |
void ForCornerNbrEdges
(
int CornerID, |
Helper that iterates over the group edges neighboring a particular corner. | GroupTopology.h | |
void ForGroupEdges
(
int GroupID, |
Call EdgeFunc for each boundary edge of the given Group (no order defined). | GroupTopology.h | |
void ForGroupSetEdges
(
const IntIterableContainerType& GroupIDs, |
Call EdgeFunc for each boundary edge of each of the given Groups (no order defined). | GroupTopology.h | |
int32 GetCornerIDFromVertexID
(
int32 VertexID |
GroupTopology.h | ||
int GetCornerVertexID
(
int CornerID |
GroupTopology.h | ||
const TSet< int32 > & GetCurrentExtraCornerVids() |
GroupTopology.h | ||
double GetEdgeArcLength
(
int32 GroupEdgeID, |
GroupTopology.h | ||
FVector3d GetEdgeAveragePosition
(
int32 GroupEdgeID |
GroupTopology.h | ||
FVector3d GetEdgeMidpoint
(
int32 GroupEdgeID, |
GroupTopology.h | ||
const TArray< int > & GetGroupEdgeEdges
(
int GroupEdgeID |
GroupTopology.h | ||
bool GetGroupEdgeTangent
(
int GroupEdgeID, |
Calculate tangent of group edge, as direction from start to end endpoints | GroupTopology.h | |
const TArray< int > & GetGroupEdgeVertices
(
int GroupEdgeID |
GroupTopology.h | ||
const TArray< int > & GetGroupFaces
(
int GroupID |
GroupTopology.h | ||
FFrame3d GetGroupFrame
(
int32 GroupID |
GroupTopology.h | ||
virtual int GetGroupID
(
int TriangleID |
Adjacency of Per-Triangle integers are what define the triangle groups. | GroupTopology.h | |
const TArray< int > & GetGroupNbrGroups
(
int GroupID |
GroupTopology.h | ||
const TArray< int > & GetGroupTriangles
(
int GroupID |
GroupTopology.h | ||
const FDynamicMesh3 * GetMesh() |
GroupTopology.h | ||
void GetSelectedTriangles
(
const FGroupTopologySelection& Selection, |
Get the set of selected triangles for a given GroupTopologySelection | GroupTopology.h | |
FAxisAlignedBox3d GetSelectionBounds
(
const FGroupTopologySelection& Selection, |
GroupTopology.h | ||
FFrame3d GetSelectionFrame
(
const FGroupTopologySelection& Selection, |
GroupTopology.h | ||
bool IsBoundaryEdge
(
int32 GroupEdgeID |
GroupTopology.h | ||
bool IsGroupEdge
(
FMeshTriEdgeID TriEdgeID, |
GroupTopology.h | ||
bool IsIsolatedLoop
(
int32 GroupEdgeID |
GroupTopology.h | ||
bool IsSimpleGroupEdge
(
int32 GroupEdgeID |
GroupTopology.h | ||
virtual bool RebuildTopology() |
Build the group topology graph. | GroupTopology.h | |
virtual 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. | GroupTopology.h | |
void RetargetOnClonedMesh
(
const FDynamicMesh3* Mesh |
Keeps the structures of topology in place but points the mesh pointers to a new cloned mesh. | GroupTopology.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool ExtractGroupEdges
(
FGroup& Group |
Return false if we had a problem finding group boundaries | GroupTopology.h | |
int FindExistingGroupEdge
(
int GroupID, |
GroupTopology.h | ||
| Generates group edges and boundary structs for given group. Returns false if failed to find group boundaries. | GroupTopology.h | ||
void GetAllVertexGroups
(
int32 VertexID, |
GroupTopology.h | ||
virtual bool IsCornerVertex
(
int VertexID |
GroupTopology.h | ||
FIndex2i MakeEdgeGroupsPair
(
int Group1, |
GroupTopology.h | ||
FIndex2i MakeEdgeGroupsPair
(
int MeshEdgeID |
GroupTopology.h | ||
FIndex2i MakeEdgeID
(
int MeshEdgeID |
GroupTopology.h | ||
FIndex2i MakeEdgeID
(
int Group1, |
GroupTopology.h | ||
virtual 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. | GroupTopology.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool IsEdgeAngleSharp
(
const FDynamicMesh3* Mesh, |
Helper function for use with ShouldAddExtraCornerAtVert. | GroupTopology.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FGroupTopology & operator=
(
const FGroupTopology& |
GroupTopology.h |