UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NonManifoldMappingSupport.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3
4#pragma once
5
6#include "Containers/Array.h"
7#include "UObject/NameTypes.h"
8
9namespace UE
10{
11namespace Geometry
12{
13
14// forward
15class FDynamicMesh3;
16class FNonManifoldSourceVertexIdAttribute;
17
18
19/*
20* The FNonManifoldMappingSupport is a light-weight class that exists to interpret and manage additional DynamicMesh data stored
21* when the mesh was created from a potentially non-manifold source mesh.
22*
23* For context the FDynamicMesh3 is less accepting of non-manifold mesh features than some source mesh data-structures
24* and conversion to a DynamicMesh may require changes to the topology ( e.g. vertex splits) and in such cases
25* this class can be use to access the mapping from DynamicMesh vertices to the source mesh vertices that generated them.
26*
27* Note:
28* Since this class holds pointers to named attributes owned by the DynamicMesh, unintended behavior will result if said attributes
29* are removed from the mesh while an associated NomManifoldSupport object is in use.
30*
31* Also, any mapping information between the DynamicMesh and source data will be corrupted by topological changes
32* to the DynamicMesh (e.g. edge splits, collapses etc).
33*
34*/
36{
37public:
38
40
41
46
47 /*
48 * Return true if attribute data indicates that the source data that was converted to this DynamicMesh contained non-manifold vertices.
49 */
51
52 /*
53 * Return true if the provided DynamicMesh vertex id resulted from a non-manifold vertex in the source data.
54 * @param vid - the id of a vertex in the DynamicMesh.
55 *
56 * Note: the code assumes but does not check that vid is a valid vertex id
57 */
58 bool IsNonManifoldVertexID(const int32 vid) const
59 {
60 return !( vid == GetOriginalNonManifoldVertexID(vid) );
61 }
62
63 /*
64 * Return the vertex ID in the potentially non-manifold data used to generate this DynamicMesh associated with the provided vertex id.
65 * In the case that the source data was actually manifold the returned vertex id will be identical to the DynamicMesh vertex id.
66 * @param vid - the id of a vertex in the DynamicMesh.
67 *
68 * Note: the code assumes but does not check that vid is a valid vertex vid.
69 */
71
72
73 // --- helper functions.
74
75 /*
76 * Attaches or replaces non-manifold vertex mapping data to the provided mesh.
77 * @param VertexToNonManifoldVertexIDMap - an array that maps each DynamicMesh vertex id to the associated non-manifold vertex id.
78 * @return false on failure (no attribute will be attached to the DynamicMesh in this case)
79 *
80 * Note: Failure occurs if the DynamicMesh does not have attributes enabled or if the provided array is not long enough to provide a mapping value for each DynamicMesh vertex id.
81 */
83
84 /*
85 * Removes vertex mapping data related to the non-manifold nature of the source data the produced this DynamicMesh.
86 *
87 * Note: this will invalidate any NonManifoldMappingSupport object associated with this DynamicMesh,
88 * and subsequent use of such object will produce unexpected results.
89 */
91
92
93
94 /*
95 * Removes all mapping data related to the non-manifold nature of the source data the produced this DynamicMesh.
96 *
97 * Note, this will invalidate any NonManifoldMappingSupport object associated with this DynamicMesh,
98 * and subsequent use of such object will produce unexpected results.
99 */
104
105 /*
106 * Name used to identify vertex attribute data generated during conversion to a DynamicMesh in the case that the source was non-manifold.
107 */
109
110
111protected:
112
114 const FDynamicMesh3* DynamicMesh = nullptr;
115};
116
117
118} // namespace Geometry
119} // namespace UE
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition NameTypes.h:617
Definition Array.h:670
Definition DynamicMesh3.h:108
Definition NonManifoldMappingSupport.h:36
const FDynamicMesh3 * DynamicMesh
Definition NonManifoldMappingSupport.h:114
const FNonManifoldSourceVertexIdAttribute * NonManifoldSrcVIDsAttribute
Definition NonManifoldMappingSupport.h:113
static void RemoveAllNonManifoldMappingData(FDynamicMesh3 &MeshInOut)
Definition NonManifoldMappingSupport.h:100
GEOMETRYCORE_API bool IsNonManifoldVertexInSource() const
Definition NonManifoldMappingSupport.cpp:308
static GEOMETRYCORE_API void RemoveNonManifoldVertexMappingData(FDynamicMesh3 &MeshInOut)
Definition NonManifoldMappingSupport.cpp:352
bool IsNonManifoldVertexID(const int32 vid) const
Definition NonManifoldMappingSupport.h:58
static GEOMETRYCORE_API FName NonManifoldMeshVIDsAttrName
Definition NonManifoldMappingSupport.h:108
static GEOMETRYCORE_API bool AttachNonManifoldVertexMappingData(const TArray< int32 > &VertexToNonManifoldVertexIDMap, FDynamicMesh3 &MeshInOut)
Definition NonManifoldMappingSupport.cpp:325
GEOMETRYCORE_API int32 GetOriginalNonManifoldVertexID(const int32 vid) const
Definition NonManifoldMappingSupport.cpp:313
Definition NonManifoldMappingSupport.cpp:34
Definition AdvancedWidgetsModule.cpp:13