UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ThinZone2D.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Core/Chrono.h"
5#include "Core/HaveStates.h"
6#include "Core/Types.h"
7#include "Math/Point.h"
8
9#include "Mesh/MeshEnum.h"
11
12namespace UE::CADKernel
13{
15 {
16 Undefined = 0,
17 Global, // a Surface globally thin
18 PeakStart, // an extremity of a Surface that is fine
19 PeakEnd, // an extremity of a Surface that is fine
20 Butterfly, // the outer loop that is like a bow tie (Butterfly)
21 BetweenLoops, // a bow tie between two different loops
22 TooSmall // -> to delete
23 };
24
25 enum class ESide : uint8
26 {
27 First = 0,
28 Second,
29 None
30 };
31
32 class FModelMesh;
33 class FThinZone2D;
34 class FTopologicalFace;
35
37 using FAddMeshNodeFunc = TFunction<void(const int32, const FVector2d&, const double, const FEdgeSegment&, const FPairOfIndex&)>;
38
40 {
41 friend FThinZone2D;
42
43 private:
44 TArray<FEdgeSegment> Segments;
45 FThinZoneSide& FrontSide;
46
48
49 double SideLength;
50 double MediumThickness;
51 double MaxThickness;
52
53 public:
54
56
57 virtual ~FThinZoneSide() = default;
58
59 void Empty()
60 {
61 Segments.Empty();
62 }
63
64 const FEdgeSegment& GetFirst() const
65 {
66 return Segments[0];
67 }
68
69 const FEdgeSegment& GetLast() const
70 {
71 return Segments.Last();
72 }
73
79
81 {
82 return Edges;
83 }
84
86 {
87 return Edges;
88 }
89
90 void AddToEdge();
91
92 void CleanMesh();
93
95 {
96 return Segments;
97 }
98
100 {
101 return Segments;
102 }
103
105
106 double Length() const
107 {
108 return SideLength;
109 }
110
111 double GetThickness() const
112 {
113 return MediumThickness;
114 }
115
116 double GetMaxThickness() const
117 {
118 return MaxThickness;
119 }
120
121 bool IsInner() const
122 {
123 if (Segments.Num() == 0)
124 {
125 return true;
126 }
127 return Segments[0].IsInner();
128 }
129
130 bool IsClosed() const
131 {
132 if (Segments.Num() && (Segments[0].GetPrevious() == &Segments.Last()))
133 {
134 return true;
135 }
136 return false;
137 }
138
140 {
141 return FrontSide;
142 }
143
144 void CheckEdgesZoneSide();
145 void SetEdgesZoneSide(ESide Side);
146
148
150
151 private:
152 void ComputeThicknessAndLength();
153
154 };
155
157 {
158 private:
159
160 FThinZoneSide SideA;
161 FThinZoneSide SideB;
162
163 EThinZone2DType Category;
164
165 double Thickness;
166 double MaxThickness;
167
168 bool bIsSwap = false;
169
170 public:
171
177 : SideA(&SideB, InFirstSideSegments)
178 , SideB(&SideA, InSecondSideSegments)
179 , Category(EThinZone2DType::Undefined)
180 {
181 Finalize();
182 }
183
184 virtual ~FThinZone2D() = default;
185
186 void Empty()
187 {
188 SideA.Empty();
189 SideB.Empty();
190 Thickness = -1;
191 }
192
193 double GetThickness() const
194 {
195 return Thickness;
196 };
197
198 double GetMaxThickness() const
199 {
200 return MaxThickness;
201 };
202
203 const FThinZoneSide& GetSide(ESide Side) const
204 {
205 return ((Side == ESide::Second) == bIsSwap) ? SideA : SideB;
206 }
207
209 {
210 return const_cast<FThinZoneSide&> (static_cast<const FThinZone2D*>(this)->GetSide(Side));
211 }
212
214 {
215 return bIsSwap ? SideB : SideA;
216 }
217
219 {
220 return bIsSwap ? SideA : SideB;
221 }
222
224 {
225 return bIsSwap ? SideB : SideA;
226 }
227
229 {
230 return bIsSwap ? SideA : SideB;
231 }
232
234 {
235 return Category;
236 }
237
239
240 double Length() const
241 {
242 return SideA.Length() + SideB.Length();
243 }
244
245 double GetMaxSideLength() const
246 {
247 return FMath::Max(SideA.Length(), SideB.Length());
248 }
249
251 {
252 Category = InType;
253 }
254
264
270 {
271 SideA.CheckEdgesZoneSide();
272 SideB.CheckEdgesZoneSide();
273 }
274
283
284 void AddToEdge();
285
286 void Swap()
287 {
288 bIsSwap = !bIsSwap;
289 switch (Category)
290 {
292 {
294 break;
295 }
297 {
299 break;
300 }
301 default:
302 break;
303 };
304 }
305
306#ifdef CADKERNEL_DEV
307 void Display(const FString& Title, EVisuProperty VisuProperty) const;
308#endif
309
310 private:
311 void Finalize();
312 };
313
314}
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
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
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Array.h:670
Definition AndroidPlatformMisc.h:14
Definition EdgeSegment.h:22
Definition HaveStates.h:48
Definition ModelMesh.h:21
Definition ThinZone2D.h:157
FThinZoneSide & GetSecondSide()
Definition ThinZone2D.h:218
void SetEdgesZoneSide()
Definition ThinZone2D.h:278
const FThinZoneSide & GetSecondSide() const
Definition ThinZone2D.h:228
FThinZoneSide & GetSide(ESide Side)
Definition ThinZone2D.h:208
double GetMaxThickness() const
Definition ThinZone2D.h:198
void GetEdges(TArray< FTopologicalEdge * > &OutSideAEdges, TArray< FTopologicalEdge * > &OutSideBEdges) const
Definition ThinZone2D.h:259
void Swap()
Definition ThinZone2D.h:286
const FThinZoneSide & GetSide(ESide Side) const
Definition ThinZone2D.h:203
FThinZoneSide & GetFirstSide()
Definition ThinZone2D.h:213
void SetCategory(EThinZone2DType InType)
Definition ThinZone2D.h:250
double Length() const
Definition ThinZone2D.h:240
virtual ~FThinZone2D()=default
EThinZone2DType GetCategory() const
Definition ThinZone2D.h:233
void AddToEdge()
Definition ThinZone2DFinder.cpp:1724
static void SetPeakEdgesMarker(const TArray< const FTopologicalEdge * > &)
Definition ThinZone2DFinder.cpp:1685
void CheckEdgesZoneSide()
Definition ThinZone2D.h:269
void Empty()
Definition ThinZone2D.h:186
FThinZone2D(const TArray< FEdgeSegment * > &InFirstSideSegments, const TArray< FEdgeSegment * > &InSecondSideSegments)
Definition ThinZone2D.h:176
const FThinZoneSide & GetFirstSide() const
Definition ThinZone2D.h:223
double GetThickness() const
Definition ThinZone2D.h:193
double GetMaxSideLength() const
Definition ThinZone2D.h:245
Definition ThinZone2D.h:40
double GetThickness() const
Definition ThinZone2D.h:111
FThinZoneSide & GetFrontThinZoneSide()
Definition ThinZone2D.h:139
void SetEdgesZoneSide(ESide Side)
Definition ThinZone2DFinder.cpp:1656
TArray< FEdgeSegment > & GetSegments()
Definition ThinZone2D.h:99
const TArray< FEdgeSegment > & GetSegments() const
Definition ThinZone2D.h:94
virtual ~FThinZoneSide()=default
void Empty()
Definition ThinZone2D.h:59
bool IsInner() const
Definition ThinZone2D.h:121
double GetMaxThickness() const
Definition ThinZone2D.h:116
void AddToEdge()
Definition ThinZone2DFinder.cpp:1603
void CleanMesh()
Definition ThinZone2DFinder.cpp:1669
TArray< FTopologicalEdge * > & GetEdges()
Definition ThinZone2D.h:85
double Length() const
Definition ThinZone2D.h:106
const TArray< FTopologicalEdge * > & GetEdges() const
Definition ThinZone2D.h:80
const FEdgeSegment & GetLast() const
Definition ThinZone2D.h:69
int32 GetImposedPointCount()
Definition ThinZone2DFinder.cpp:1529
EMeshingState GetMeshingState() const
Definition ThinZone2DFinder.cpp:1693
void CheckEdgesZoneSide()
Definition ThinZone2DFinder.cpp:1639
const FEdgeSegment & GetFirst() const
Definition ThinZone2D.h:64
void GetExistingMeshNodes(const FTopologicalFace &Face, FModelMesh &MeshModel, FReserveContainerFunc &Reserve, FAddMeshNodeFunc &AddMeshNode, const bool bWithTolerance) const
Definition ThinZone2DFinder.cpp:1730
bool IsClosed() const
Definition ThinZone2D.h:130
void GetEdges(TArray< FTopologicalEdge * > &OutEdges) const
Definition ThinZone2DFinder.cpp:1591
Definition TopologicalFace.h:56
Definition CADEntity.cpp:23
ESide
Definition ThinZone2D.h:26
EMeshingState
Definition MeshEnum.h:25
EThinZone2DType
Definition ThinZone2D.h:15
@ Undefined
Definition GeoEnum.h:89
EVisuProperty
Definition Visu.h:15
Definition Types.h:33