UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ModelMeshAnalyzer.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Core/HaveStates.h"
5#include "Core/Types.h"
6#include "UI/Visu.h"
7
8#include "Math/Point.h"
9
10namespace UE::CADKernel
11{
12
13class FModelMesh;
14class FFaceMesh;
15
16namespace Analyzer
17{
18
19struct FEdge;
20
22{
27
28
31 {
32 for (int32 Index = 0; Index < 3; ++Index)
33 {
35 }
36 for (int32 Index = 0; Index < 3; ++Index)
37 {
39 }
40 for (int32 Index = 0; Index < 3; ++Index)
41 {
43 }
44 }
45
46 FVector ComputeNormal(const TArray<FVector>& NodeCoordinates) const;
47};
48
49struct FEdge : public FHaveStates
50{
51 static const int32 MaxTraingleStoredCount = 2;
53 FTriangle* Triangles[MaxTraingleStoredCount]; // n first adjacent triangles
55
57 {
59 VertexIndices[1] = Index1;
60 }
61
70
75};
76
77}
78
80{
81 const FModelMesh& ModelMesh;
82
83 TArray<FVector> NodeCoordinates;
86 TArray<TArray<Analyzer::FEdge*>> VertexToEdges; // Vertex to border or non manifold edges
87
88public:
90 : ModelMesh(InModelMesh)
91 {
92 }
93
94 void BuildMesh();
95
96 void ComputeBorderCount(int32& OutBorderCount, int32& OutNonManifoldCount) const;
97 void ComputeMeshGapCount(int32& OutCycleCount, int32& OutChainCount) const;
98 double ComputeMaxAngle() const;
99 bool CheckOrientation() const;
100
101 void Display();
102
103private:
104 void DisplayTriangle(const Analyzer::FTriangle& Triangle);
105 void DisplayEdge(const Analyzer::FEdge& Edge, EVisuProperty Property);
106
107};
108
109}
110
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
DIRECTLINK_API Display
Definition DirectLinkLog.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Array.h:670
Definition FaceMesh.h:16
Definition HaveStates.h:48
Definition ModelMeshAnalyzer.h:80
FModelMeshAnalyzer(const FModelMesh &InModelMesh)
Definition ModelMeshAnalyzer.h:89
Definition ModelMesh.h:21
Definition CADEntity.cpp:23
EVisuProperty
Definition Visu.h:15
U16 Index
Definition radfft.cpp:71
Definition ModelMeshAnalyzer.h:50
FTriangle * Triangles[MaxTraingleStoredCount]
Definition ModelMeshAnalyzer.h:53
uint32 OtherVertexIndex(uint32 Index) const
Definition ModelMeshAnalyzer.h:71
uint32 VertexIndices[2]
Definition ModelMeshAnalyzer.h:52
void AddTriangle(FTriangle &Triangle)
Definition ModelMeshAnalyzer.h:62
static const int32 MaxTraingleStoredCount
Definition ModelMeshAnalyzer.h:51
uint32 TriangleCount
Definition ModelMeshAnalyzer.h:54
FEdge(uint32 Index0, uint32 Index1)
Definition ModelMeshAnalyzer.h:56
Definition ModelMeshAnalyzer.h:22
FVector3f Normals[3]
Definition ModelMeshAnalyzer.h:24
FTriangle(uint32 *InVertices, FEdge **InEdges, FVector3f *InNormals, const FFaceMesh *InFaceMesh)
Definition ModelMeshAnalyzer.h:29
const FFaceMesh * FaceMesh
Definition ModelMeshAnalyzer.h:26
FVector ComputeNormal(const TArray< FVector > &NodeCoordinates) const
Definition ModelMeshAnalyzer.cpp:263
FEdge * Edges[3]
Definition ModelMeshAnalyzer.h:25
uint32 Vertices[3]
Definition ModelMeshAnalyzer.h:23