UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize > Class Template Reference

#include <DynamicMeshOverlay.h>

+ Inheritance diagram for UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >:

Public Types

typedef FRefCountVector::IndexEnumerable element_iterator
 

Public Member Functions

 TDynamicMeshOverlay ()
 
 TDynamicMeshOverlay (FDynamicMesh3 *ParentMeshIn)
 
const FDynamicMesh3GetParentMesh () const
 
FDynamicMesh3GetParentMesh ()
 
void Copy (const TDynamicMeshOverlay< RealType, ElementSize > &Copy)
 
void CompactCopy (const FCompactMaps &CompactMaps, const TDynamicMeshOverlay< RealType, ElementSize > &Copy)
 
void CompactInPlace (const FCompactMaps &CompactMaps)
 
void Append (const TDynamicMeshOverlay &ToAppend, const FDynamicMesh3::FAppendInfo &AppendInfo)
 
void AppendDefaulted (const FDynamicMesh3::FAppendInfo &AppendInfo)
 
void ClearElements ()
 
template<typename EnumerableIntType >
void ClearElements (const EnumerableIntType &Triangles)
 
int ElementCount () const
 
int MaxElementID () const
 
bool IsElement (int vID) const
 
bool IsCompact () const
 
element_iterator ElementIndicesItr () const
 
int AppendElement (RealType ConstantValue)
 
int AppendElement (const RealType *Value)
 
void SetParentVertex (int ElementIndex, int ParentVertexIndex)
 
void InitializeTriangles (int MaxTriangleID)
 
EMeshResult SetTriangle (int TriangleID, const FIndex3i &TriElements, bool bAllowElementFreeing=true)
 
void FreeUnusedElements (const TSet< int > *ElementsToCheck=nullptr)
 
void UnsetTriangle (int TriangleID, bool bAllowElementFreeing=true)
 
bool IsSetTriangle (int TID) const
 
void CreateFromPredicate (TFunctionRef< bool(int ParentVertexIdx, int TriIDA, int TriIDB)> TrisCanShareVertexPredicate, RealType InitElementValue)
 
void CreatePerVertex (RealType InitElementValue)
 
void SplitVerticesWithPredicate (TFunctionRef< bool(int ElementIdx, int TriID)> ShouldSplitOutVertex, TFunctionRef< void(int ElementIdx, int TriID, RealType *FillVect)> GetNewElementValue)
 
bool MergeElement (int SourceElementID, int TargetElementID)
 
int SplitElement (int ElementID, const TArrayView< const int > &TrianglesToUpdate)
 
int SplitElementWithNewParent (int ElementID, int SplitParentVertexID, const TArrayView< const int > &TrianglesToUpdate)
 
void SplitBowtiesAtVertex (int32 Vid, TArray< int32 > *NewElementIDs=nullptr)
 
void SplitBowties (bool bParallel=true)
 
void BeginUnsafeElementsInsert ()
 
void EndUnsafeElementsInsert ()
 
EMeshResult InsertElement (int ElementID, const RealType *Value, bool bUnsafe=false)
 
void GetElement (int ElementID, RealType *Data) const
 
template<typename AsType >
void GetElement (int ElementID, AsType &Data) const
 
template<typename AsType >
void GetElementAtVertex (int TriangleID, int VertexID, AsType &Data) const
 
int GetParentVertex (int ElementID) const
 
FIndex3i GetTriangle (int TriangleID) const
 
bool GetTriangleIfValid (int TriangleID, FIndex3i &TriangleOut) const
 
void SetElement (int ElementID, const RealType *Data)
 
template<typename AsType >
void SetElement (int ElementID, const AsType &Data)
 
bool TriangleHasElement (int TriangleID, int ElementID) const
 
bool IsSeamEdge (int EdgeID, bool *bIsNonIntersectingOut=nullptr) const
 
bool IsSeamEndEdge (int EdgeID) const
 
bool IsSeamVertex (int VertexID, bool bBoundaryIsSeam=true) const
 
bool IsSeamIntersectionVertex (int32 VertexID) const
 
bool IsBowtieInOverlay (int32 VertexID) const
 
bool AreTrianglesConnected (int TriangleID0, int TriangleID1) const
 
void GetVertexElements (int VertexID, TArray< int > &OutElements) const
 
int CountVertexElements (int VertexID, bool bBruteForce=false) const
 
void GetElementTriangles (int ElementID, TArray< int > &OutTriangles) const
 
int GetElementIDAtVertex (int TriangleID, int VertexID) const
 
bool HasInteriorSeamEdges () const
 
template<typename AsType >
void GetTriBaryInterpolate (int32 TriangleID, const AsType *BaryCoords, AsType *DataOut) const
 
bool CheckValidity (bool bAllowNonManifoldVertices=true, EValidityCheckFailMode FailMode=EValidityCheckFailMode::Check) const
 
bool IsSameAs (const TDynamicMeshOverlay< RealType, ElementSize > &Other, bool bIgnoreDataLayout) const
 
void Serialize (FArchive &Ar, const FCompactMaps *CompactMaps, bool bUseCompression)
 
SIZE_T GetByteCount () const
 
void InitializeNewTriangle (int TriangleID)
 
void OnRemoveTriangle (int TriangleID)
 
void OnReverseTriOrientation (int TriangleID)
 
void OnSplitEdge (const DynamicMeshInfo::FEdgeSplitInfo &SplitInfo)
 
void OnFlipEdge (const DynamicMeshInfo::FEdgeFlipInfo &FlipInfo)
 
void OnCollapseEdge (const DynamicMeshInfo::FEdgeCollapseInfo &CollapseInfo)
 
void OnPokeTriangle (const DynamicMeshInfo::FPokeTriangleInfo &PokeInfo)
 
void OnMergeEdges (const DynamicMeshInfo::FMergeEdgesInfo &MergeInfo)
 
void OnMergeVertices (const DynamicMeshInfo::FMergeVerticesInfo &MergeInfo)
 
void OnSplitVertex (const DynamicMeshInfo::FVertexSplitInfo &SplitInfo, const TArrayView< const int > &TrianglesToUpdate)
 

Protected Member Functions

void SetElementFromLerp (int SetElement, int ElementA, int ElementB, double Alpha)
 
void SetElementFromBary (int SetElement, int ElementA, int ElementB, int ElementC, const FVector3d &BaryCoords)
 
void InternalSetTriangle (int TriangleID, const FIndex3i &TriElements, bool bUpdateRefCounts, bool bAllowElementFreeing=true)
 

Protected Attributes

FDynamicMesh3ParentMesh
 
FRefCountVector ElementsRefCounts
 
TDynamicVector< RealType > Elements
 
TDynamicVector< int > ParentVertices
 
TDynamicVector< int > ElementTriangles
 

Friends

class FDynamicMesh3
 
class FDynamicMeshAttributeSet
 
FArchiveoperator<< (FArchive &Ar, TDynamicMeshOverlay< RealType, ElementSize > &Overlay)
 

Detailed Description

template<typename RealType, int ElementSize>
class UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >

TDynamicMeshOverlay is an add-on to a FDynamicMesh3 that allows for per-triangle storage of an "element" (eg like a per-triangle UV or normal). However the elements can be shared between triangles at shared vertices because the elements are stored in a separate indexable list.

Each element has one vertex in the parent mesh as its parent, whereas each vertex may be the parent of multiple elements in cases where neighboring triangles are not sharing a single element for that vertex. This means that there may be "seam" boundary edges in the overlay topology that are not mesh boundary edges in the associated/parent mesh, but the overlay topology will not connect triangles that were not connected in the parent mesh or create any topologically degenerate triangles, since the parent vids of the elements of a triangle will have to match up to the vids of the triangle.

A "seam" edge is one where at least one of the elements of the triangles on either side of the edge is not shared between the two triangles.

The FDynamicMesh3 mesh topology operations (eg split/flip/collapse edge, poke face, etc) can be mirrored to the overlay via OnSplitEdge(), etc.

Note that although this is a template, many of the functions are defined in the .cpp file. As a result you need to explicitly instantiate and export the instance of the template that you wish to use in the block at the top of DynamicMeshOverlay.cpp

Member Typedef Documentation

◆ element_iterator

template<typename RealType , int ElementSize>
typedef FRefCountVector::IndexEnumerable UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::element_iterator

Constructor & Destructor Documentation

◆ TDynamicMeshOverlay() [1/2]

template<typename RealType , int ElementSize>
UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::TDynamicMeshOverlay ( )
inline

Create an empty overlay

◆ TDynamicMeshOverlay() [2/2]

template<typename RealType , int ElementSize>
UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::TDynamicMeshOverlay ( FDynamicMesh3 ParentMeshIn)
inline

Create an overlay for the given parent mesh

Member Function Documentation

◆ Append()

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::Append ( const TDynamicMeshOverlay< RealType, ElementSize > &  ToAppend,
const FDynamicMesh3::FAppendInfo AppendInfo 
)
inline

◆ AppendDefaulted()

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::AppendDefaulted ( const FDynamicMesh3::FAppendInfo AppendInfo)
inline

◆ AppendElement() [1/2]

template<typename RealType , int ElementSize>
int TDynamicMeshOverlay::AppendElement ( const RealType *  Value)

Allocate a new element with the given value

◆ AppendElement() [2/2]

template<typename RealType , int ElementSize>
int TDynamicMeshOverlay::AppendElement ( RealType  ConstantValue)

Allocate a new element with the given constant value

◆ AreTrianglesConnected()

template<typename RealType , int ElementSize>
bool TDynamicMeshOverlay::AreTrianglesConnected ( int  TriangleID0,
int  TriangleID1 
) const
Returns
true if the two triangles are connected, ie shared edge exists and is not a seam edge

◆ BeginUnsafeElementsInsert()

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::BeginUnsafeElementsInsert ( )
inline

Call this before a set of unsafe InsertVertex() calls

◆ CheckValidity()

template<typename RealType , int ElementSize>
bool TDynamicMeshOverlay::CheckValidity ( bool  bAllowNonManifoldVertices = true,
EValidityCheckFailMode  FailMode = EValidityCheckFailMode::Check 
) const

Checks that the overlay mesh is well-formed, ie all internal data structures are consistent

◆ ClearElements() [1/2]

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::ClearElements ( )

Discard all elements.

◆ ClearElements() [2/2]

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::ClearElements ( const EnumerableIntType Triangles)
inline

Discard elements for given triangles.

◆ CompactCopy()

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::CompactCopy ( const FCompactMaps CompactMaps,
const TDynamicMeshOverlay< RealType, ElementSize > &  Copy 
)
inline

Copy the Copy overlay to a compact rep, also updating parent references based on the CompactMaps

◆ CompactInPlace()

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::CompactInPlace ( const FCompactMaps CompactMaps)
inline

Compact overlay and update links to parent based on CompactMaps

◆ Copy()

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::Copy ( const TDynamicMeshOverlay< RealType, ElementSize > &  Copy)
inline

Set this overlay to contain the same arrays as the copy overlay

◆ CountVertexElements()

template<typename RealType , int ElementSize>
int TDynamicMeshOverlay::CountVertexElements ( int  VertexID,
bool  bBruteForce = false 
) const

Count the number of unique elements for a given parent-mesh vertex

◆ CreateFromPredicate()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::CreateFromPredicate ( TFunctionRef< bool(int ParentVertexIdx, int TriIDA, int TriIDB)>  TrisCanShareVertexPredicate,
RealType  InitElementValue 
)

Build overlay topology from a predicate function, e.g. to build topology for sharp normals

Parameters
TrisCanShareVertexPredicateIndicator function returns true if the given vertex can be shared for the given pair of triangles Note if a vertex can be shared between tris A and B, and B and C, it will be shared between all three
InitElementValueInitial element value, copied into all created elements

◆ CreatePerVertex()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::CreatePerVertex ( RealType  InitElementValue)

Build overlay topology with one element per vertex. Note: Faster-but-equivalent-to calling CreateFromPredicate() with a CanShareVertex predicate that always returns true

◆ ElementCount()

template<typename RealType , int ElementSize>
int UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::ElementCount ( ) const
inline
Returns
the number of in-use Elements in the overlay

◆ ElementIndicesItr()

template<typename RealType , int ElementSize>
element_iterator UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::ElementIndicesItr ( ) const
inline
Returns
enumerator for valid element indices suitable for use with range-based for

◆ EndUnsafeElementsInsert()

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::EndUnsafeElementsInsert ( )
inline

Call after a set of unsafe InsertVertex() calls to rebuild free list

◆ FreeUnusedElements()

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::FreeUnusedElements ( const TSet< int > *  ElementsToCheck = nullptr)

Goes through elements and frees any whose reference counts indicate that they are not being used. This is usually not necessary since most operations that remove references will go ahead and do this, but it may be used, for instance, after SetTriangle is called with bAllowElementFreeing set to false.

Parameters
ElementsToCheckIf provided, only these element ID's will be checked.

◆ GetByteCount()

template<typename RealType , int ElementSize>
SIZE_T UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::GetByteCount ( ) const
inline

◆ GetElement() [1/2]

template<typename RealType , int ElementSize>
template<typename AsType >
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::GetElement ( int  ElementID,
AsType &  Data 
) const
inline

Get the element at a given index

◆ GetElement() [2/2]

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::GetElement ( int  ElementID,
RealType *  Data 
) const
inline

Get the element at a given index

◆ GetElementAtVertex()

template<typename RealType , int ElementSize>
template<typename AsType >
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::GetElementAtVertex ( int  TriangleID,
int  VertexID,
AsType &  Data 
) const
inline

Get the Element value associated with a vertex of a triangle.

Parameters
TriangleIDID of a triangle containing the Element
VertexIDID of the Element's parent vertex
DataValue contained at the Element

◆ GetElementIDAtVertex()

template<typename RealType , int ElementSize>
int TDynamicMeshOverlay::GetElementIDAtVertex ( int  TriangleID,
int  VertexID 
) const

Find the element ID at a vertex of a triangle.

Returns
Returns the element ID or FDynamicMesh3::InvalidID if the vertex is not a parent of any element contained in the triangle.

◆ GetElementTriangles()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::GetElementTriangles ( int  ElementID,
TArray< int > &  OutTriangles 
) const

find the triangles connected to an element

◆ GetParentMesh() [1/2]

template<typename RealType , int ElementSize>
FDynamicMesh3 * UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::GetParentMesh ( )
inline
Returns
the parent mesh for this overlay

◆ GetParentMesh() [2/2]

template<typename RealType , int ElementSize>
const FDynamicMesh3 * UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::GetParentMesh ( ) const
inline
Returns
the parent mesh for this overlay

◆ GetParentVertex()

template<typename RealType , int ElementSize>
int UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::GetParentVertex ( int  ElementID) const
inline

Get the parent vertex id for the element at a given index

◆ GetTriangle()

template<typename RealType , int ElementSize>
FIndex3i UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::GetTriangle ( int  TriangleID) const
inline

Get the element index tuple for a triangle

◆ GetTriangleIfValid()

template<typename RealType , int ElementSize>
bool UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::GetTriangleIfValid ( int  TriangleID,
FIndex3i TriangleOut 
) const
inline

If the triangle is set to valid element indices, return the indices in TriangleOut and return true, otherwise return false

◆ GetTriBaryInterpolate()

template<typename RealType , int ElementSize>
template<typename AsType >
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::GetTriBaryInterpolate ( int32  TriangleID,
const AsType *  BaryCoords,
AsType *  DataOut 
) const
inline

Compute interpolated parameter value inside triangle using barycentric coordinates

Parameters
TriangleIDindex of triangle
BaryCoords3 barycentric coordinates inside triangle
DataOutresulting interpolated overlay parameter value (of size ElementSize)

◆ GetVertexElements()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::GetVertexElements ( int  VertexID,
TArray< int > &  OutElements 
) const

find the elements associated with a given parent-mesh vertex

◆ HasInteriorSeamEdges()

template<typename RealType , int ElementSize>
bool TDynamicMeshOverlay::HasInteriorSeamEdges ( ) const
Returns
true if overlay has any interior seam edges. This requires an O(N) search unless it early-outs.

◆ InitializeNewTriangle()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::InitializeNewTriangle ( int  TriangleID)

Set a triangle's element indices to InvalidID

◆ InitializeTriangles()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::InitializeTriangles ( int  MaxTriangleID)

Initialize the triangle list to the given size, and set all triangles to InvalidID

◆ InsertElement()

template<typename RealType , int ElementSize>
EMeshResult TDynamicMeshOverlay::InsertElement ( int  ElementID,
const RealType *  Value,
bool  bUnsafe = false 
)

Insert element at given index, assuming it is unused. If bUnsafe, we use fast id allocation that does not update free list. You should only be using this between BeginUnsafeElementsInsert() / EndUnsafeElementsInsert() calls

◆ InternalSetTriangle()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::InternalSetTriangle ( int  TriangleID,
const FIndex3i TriElements,
bool  bUpdateRefCounts,
bool  bAllowElementFreeing = true 
)
protected

updates the triangles array and optionally the element reference counts

◆ IsBowtieInOverlay()

template<typename RealType , int ElementSize>
bool TDynamicMeshOverlay::IsBowtieInOverlay ( int32  VertexID) const

Determines whether the base-mesh vertex has "bowtie" topology in the Overlay. Bowtie topology means that one or more elements at the vertex are shared across disconnected UV-components.

Returns
true if the base-mesh vertex has "bowtie" topology in the overlay

◆ IsCompact()

template<typename RealType , int ElementSize>
bool UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::IsCompact ( ) const
inline
Returns
true if the elements are compact

◆ IsElement()

template<typename RealType , int ElementSize>
bool UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::IsElement ( int  vID) const
inline
Returns
true if this element index is in use

◆ IsSameAs()

template<typename RealType , int ElementSize>
bool TDynamicMeshOverlay::IsSameAs ( const TDynamicMeshOverlay< RealType, ElementSize > &  Other,
bool  bIgnoreDataLayout 
) const

Returns true if this overlay is the same as Other.

◆ IsSeamEdge()

template<typename RealType , int ElementSize>
bool TDynamicMeshOverlay::IsSeamEdge ( int  EdgeID,
bool bIsNonIntersectingOut = nullptr 
) const

Returns true if the parent-mesh edge is a "Seam" in this overlay.
If present, bIsNonIntersectingOut will be true only if this is a seam edge that does not intersect with another seam or the end of the seam.

◆ IsSeamEndEdge()

template<typename RealType , int ElementSize>
bool TDynamicMeshOverlay::IsSeamEndEdge ( int  EdgeID) const

Returns true if the parent-mesh edge is a "Seam End" in this overlay, meaning the adjacent element triangles share one element, not two

◆ IsSeamIntersectionVertex()

template<typename RealType , int ElementSize>
bool TDynamicMeshOverlay::IsSeamIntersectionVertex ( int32  VertexID) const

Returns true if the parent-mesh vertex is at a seam 'intersection' – i.e., the end of a seam, or the intersection w/ another seam.

◆ IsSeamVertex()

template<typename RealType , int ElementSize>
bool TDynamicMeshOverlay::IsSeamVertex ( int  VertexID,
bool  bBoundaryIsSeam = true 
) const

Returns true if the parent-mesh vertex is connected to any seam edges

◆ IsSetTriangle()

template<typename RealType , int ElementSize>
bool UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::IsSetTriangle ( int  TID) const
inline
Returns
true if this triangle was set

◆ MaxElementID()

template<typename RealType , int ElementSize>
int UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::MaxElementID ( ) const
inline
Returns
the maximum element index in the overlay. This may be larger than the count if Elements have been deleted.

◆ MergeElement()

template<typename RealType , int ElementSize>
bool TDynamicMeshOverlay::MergeElement ( int  SourceElementID,
int  TargetElementID 
)

Collapse SourceElementID into TargetElementID, resulting in connecting any containing triangles and reducing the total elements in the overlay.

Parameters
SourceElementIDthe element to merge away
TargetElementIDthe element to merge into
Returns
If the operation completed successfully, returns true

◆ OnCollapseEdge()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::OnCollapseEdge ( const DynamicMeshInfo::FEdgeCollapseInfo CollapseInfo)

Update the overlay to reflect an edge collapse in the parent mesh

◆ OnFlipEdge()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::OnFlipEdge ( const DynamicMeshInfo::FEdgeFlipInfo FlipInfo)

Update the overlay to reflect an edge flip in the parent mesh

◆ OnMergeEdges()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::OnMergeEdges ( const DynamicMeshInfo::FMergeEdgesInfo MergeInfo)

Update the overlay to reflect an edge merge in the parent mesh

◆ OnMergeVertices()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::OnMergeVertices ( const DynamicMeshInfo::FMergeVerticesInfo MergeInfo)

Update the overlay to reflect a vertex merge in the parent mesh

◆ OnPokeTriangle()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::OnPokeTriangle ( const DynamicMeshInfo::FPokeTriangleInfo PokeInfo)

Update the overlay to reflect a face poke in the parent mesh

◆ OnRemoveTriangle()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::OnRemoveTriangle ( int  TriangleID)

Remove a triangle from the overlay

◆ OnReverseTriOrientation()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::OnReverseTriOrientation ( int  TriangleID)

Reverse the orientation of a triangle's elements

◆ OnSplitEdge()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::OnSplitEdge ( const DynamicMeshInfo::FEdgeSplitInfo SplitInfo)

Update the overlay to reflect an edge split in the parent mesh

◆ OnSplitVertex()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::OnSplitVertex ( const DynamicMeshInfo::FVertexSplitInfo SplitInfo,
const TArrayView< const int > &  TrianglesToUpdate 
)

Update the overlay to reflect a vertex split in the parent mesh

◆ Serialize()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::Serialize ( FArchive Ar,
const FCompactMaps CompactMaps,
bool  bUseCompression 
)

Serialize to and from an archive.

Parameters
ArArchive to serialize with.
CompactMapsIf this is not a null pointer, the mesh serialization compacted the vertex and/or triangle data using the provided mapping.
bUseCompressionUse compression for serializing bulk data.

◆ SetElement() [1/2]

template<typename RealType , int ElementSize>
template<typename AsType >
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::SetElement ( int  ElementID,
const AsType &  Data 
)
inline

Set the element at a given index

◆ SetElement() [2/2]

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::SetElement ( int  ElementID,
const RealType *  Data 
)
inline

Set the element at a given index

◆ SetElementFromBary()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::SetElementFromBary ( int  SetElement,
int  ElementA,
int  ElementB,
int  ElementC,
const FVector3d BaryCoords 
)
protected

Set the value at an Element to be a barycentric interpolation of three other Elements

◆ SetElementFromLerp()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::SetElementFromLerp ( int  SetElement,
int  ElementA,
int  ElementB,
double  Alpha 
)
protected

Set the value at an Element to be a linear interpolation of two other Elements

◆ SetParentVertex()

template<typename RealType , int ElementSize>
void UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::SetParentVertex ( int  ElementIndex,
int  ParentVertexIndex 
)
inline

◆ SetTriangle()

template<typename RealType , int ElementSize>
EMeshResult TDynamicMeshOverlay::SetTriangle ( int  TriangleID,
const FIndex3i TriElements,
bool  bAllowElementFreeing = true 
)

Set the triangle to the given Element index tuple, and increment element reference counts

Parameters
bAllowElementFreeingIf true, then any elements that were only referenced by this triangle become immediately unallocated if the triangle no longer references them. This can be set to false when remeshing across existing elements to avoid them being freed while temporarily unreferenced, but then it should eventually be followed by a call to FreeUnusedElements().

◆ SplitBowties()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::SplitBowties ( bool  bParallel = true)

Refine an existing overlay topology by splitting any bowties

Parameters
bParallelWhether to run bowtie detection in parallel

◆ SplitBowtiesAtVertex()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::SplitBowtiesAtVertex ( int32  Vid,
TArray< int32 > *  NewElementIDs = nullptr 
)

Split any bowties at given vertex.

Parameters
NewElementIDsIf not null, newly created element IDs are placed here. Note that this array is intentionally not cleared before appending to it.

◆ SplitElement()

template<typename RealType , int ElementSize>
int TDynamicMeshOverlay::SplitElement ( int  ElementID,
const TArrayView< const int > &  TrianglesToUpdate 
)

Create a new copy of ElementID, and update connected triangles in the TrianglesToUpdate array to reference the copy of ElementID where they used to reference ElementID (Note: This just calls "SplitElementWithNewParent" with the existing element's parent id.)

Parameters
ElementIDthe element to copy
TrianglesToUpdatethe triangles that should now reference the new element
Returns
the ID of the newly created element

◆ SplitElementWithNewParent()

template<typename RealType , int ElementSize>
int TDynamicMeshOverlay::SplitElementWithNewParent ( int  ElementID,
int  SplitParentVertexID,
const TArrayView< const int > &  TrianglesToUpdate 
)

Create a new copy of ElementID, and update connected triangles in the TrianglesToUpdate array to reference the copy of ElementID where they used to reference ElementID. The new element will have the given parent vertex ID. Deletes any elements that are no longer used after the triangles are changed.

Parameters
ElementIDthe element to copy
SplitParentVertexIDthe new parent vertex for copied elements
TrianglesToUpdatethe triangles that should now reference the new element. Note: this is allowed to include triangles that do not have the element at all; sometimes you may want to do so to avoid creating a new array for each call.
Returns
the ID of the newly created element

◆ SplitVerticesWithPredicate()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::SplitVerticesWithPredicate ( TFunctionRef< bool(int ElementIdx, int TriID)>  ShouldSplitOutVertex,
TFunctionRef< void(int ElementIdx, int TriID, RealType *FillVect)>  GetNewElementValue 
)

Refine an existing overlay topology. For any element on a given triangle, if the predicate returns true, it gets topologically split out so it isn't shared by any other triangle. Used for creating sharp vertices in the normals overlay.

Parameters
ShouldSplitOutVertexpredicate returns true of the element should be split out and not shared w/ any other triangle
GetNewElementValuefunction to assign a new value to any element that is split out

◆ TriangleHasElement()

template<typename RealType , int ElementSize>
bool UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::TriangleHasElement ( int  TriangleID,
int  ElementID 
) const
inline
Returns
true if triangle contains element

◆ UnsetTriangle()

template<typename RealType , int ElementSize>
void TDynamicMeshOverlay::UnsetTriangle ( int  TriangleID,
bool  bAllowElementFreeing = true 
)

Set the triangle to have InvalidID element IDs, decrementing element reference counts if needed.

Parameters
bAllowElementFreeingIf true, then any elements that were only referenced by this triangle become immediately unallocated. This can be set to false as part of a remeshing, but then it should eventually be followed by a call to FreeUnusedElements().

Friends And Related Symbol Documentation

◆ FDynamicMesh3

template<typename RealType , int ElementSize>
friend class FDynamicMesh3
friend

◆ FDynamicMeshAttributeSet

template<typename RealType , int ElementSize>
friend class FDynamicMeshAttributeSet
friend

◆ operator<<

template<typename RealType , int ElementSize>
FArchive & operator<< ( FArchive Ar,
TDynamicMeshOverlay< RealType, ElementSize > &  Overlay 
)
friend

Serialization operator for FDynamicMeshOverlay.

Parameters
ArArchive to serialize with.
OverlayMesh overlay to serialize.
Returns
Passing down serializing archive.

Member Data Documentation

◆ Elements

template<typename RealType , int ElementSize>
TDynamicVector<RealType> UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::Elements
protected

List of element values

◆ ElementsRefCounts

template<typename RealType , int ElementSize>
FRefCountVector UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::ElementsRefCounts
protected

Reference counts of element indices. Iterate over this to find out which elements are valid.

◆ ElementTriangles

template<typename RealType , int ElementSize>
TDynamicVector<int> UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::ElementTriangles
protected

List of triangle element-index triplets [Elem0 Elem1 Elem2]

◆ ParentMesh

template<typename RealType , int ElementSize>
FDynamicMesh3* UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::ParentMesh
protected

The parent mesh this overlay belongs to

◆ ParentVertices

template<typename RealType , int ElementSize>
TDynamicVector<int> UE::Geometry::TDynamicMeshOverlay< RealType, ElementSize >::ParentVertices
protected

List of parent vertex indices, one per element


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