UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ThinZone2DFinder.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/Factory.h"
7#include "Core/Types.h"
8#include "Math/Point.h"
9
13
14#ifdef CADKERNEL_DEBUG
15#include "UI/DefineForDebug.h"
16#endif
17
18namespace UE::CADKernel
19{
20 class FTopologicalLoop;
21 class FTopologicalEdge;
22 class FGrid;
23 class FThinZone2D;
24 class FThinZone2DFinder;
25
34
36 {
37 friend class FThinZone2D;
38
39 public:
41
42 protected:
45
48
50
53
54 double ExternalLoopLength = 0.0;
55
57
58 public:
59
61 : Grid(InGrid)
62 , Face(InFace)
64 {
65#ifdef DEBUG_CADKERNEL
66 bDisplay = Grid.bDisplay;
67#endif
68 }
69
71
76
77
78 private:
79
80 void SetTolerance(double InFinderTolerance)
81 {
84 }
85
89 bool BuildLoopSegments();
90
91 void FindCloseSegments();
92
96 void FindCloseSegments(const TArray<FEdgeSegment*>& Segments, const TArray<const TArray<FEdgeSegment*>*>& OppositeSides);
97
102 void LinkCloseSegments();
103
115 void ImproveThinSide();
116
128 bool CheckIfCloseSideOfThinSideIsNotDegenerated(TArray<FEdgeSegment*>& Side);
129 void CheckIfCloseSideOfThinSidesAreNotDegenerated();
130
142 void SplitThinSide();
143
144 void BuildThinZone();
145 void BuildThinZone(const TArray<FEdgeSegment*>& FirstSide, const TArray<FEdgeSegment*>& SecondSide);
147
148 // ======================================================================================================================================================================================================================
149 // Display Methodes ================================================================================================================================================================================================
150 // ======================================================================================================================================================================================================================
151#ifdef CADKERNEL_DEV
152 bool bDisplay = false;
154 void DisplayLoopSegments();
156#endif
157 };
158
159#ifdef CADKERNEL_DEBUG
160namespace ThinZone
161{
162static bool bDisplay = false;
165void DisplayEdgeSegment(const FEdgeSegment* EdgeSegment, EVisuProperty Color);
166void DisplayEdgeSegment(const FEdgeSegment* EdgeSegment, EVisuProperty Color, int32 Index);
168void DisplayThinZoneSides(const TArray<TArray<FEdgeSegment*>>& ThinZoneSides);
169void DisplayThinZoneSides2(const TArray<TArray<FEdgeSegment*>>& ThinZoneSides);
170void DisplayThinZoneSide2(const TArray<FEdgeSegment*>& Side, int32 Index, bool bSplitBySide = false, bool bSplitBySegment = false);
173void DisplayThinZoneSide(const FThinZoneSide& Side, int32 Index, EVisuProperty Color, bool bSplitBySegment = false);
174void DisplayThinZones(const TArray<FThinZone2D>& ThinZones);
175}
176#endif
177
178}
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 Array.h:670
Definition GridBase.h:73
Definition ThinZone2DFinder.h:36
bool SearchThinZones(double InFinderTolerance)
Definition ThinZone2DFinder.cpp:1262
double ExternalLoopLength
Definition ThinZone2DFinder.h:54
const FTopologicalFace & Face
Definition ThinZone2DFinder.h:44
TArray< FThinZone2D > & GetThinZones()
Definition ThinZone2DFinder.h:72
FThinZoneChronos Chronos
Definition ThinZone2DFinder.h:40
TArray< FEdgeSegment * > LoopSegments
Definition ThinZone2DFinder.h:51
TFactory< FEdgeSegment > SegmentFatory
Definition ThinZone2DFinder.h:56
FThinZone2DFinder(const FGridBase &InGrid, const FTopologicalFace &InFace)
Definition ThinZone2DFinder.h:60
double FinderTolerance
Definition ThinZone2DFinder.h:46
TArray< FThinZone2D > ThinZones
Definition ThinZone2DFinder.h:49
double SquareFinderTolerance
Definition ThinZone2DFinder.h:47
const FGridBase & Grid
Definition ThinZone2DFinder.h:43
TArray< TArray< FEdgeSegment * > > ThinZoneSides
Definition ThinZone2DFinder.h:52
Definition ThinZone2D.h:157
Definition TopologicalFace.h:56
Definition Factory.h:18
Definition CADEntity.cpp:23
uint64 FDuration
Definition Chrono.h:27
EVisuProperty
Definition Visu.h:15
U16 Index
Definition radfft.cpp:71
static constexpr UE_FORCEINLINE_HINT T Square(const T A)
Definition UnrealMathUtility.h:578
Definition ThinZone2DFinder.h:27
FDuration BuildThinZoneTime
Definition ThinZone2DFinder.h:32
FDuration FindCloseSegmentTime
Definition ThinZone2DFinder.h:30
FDuration LinkCloseSegmentTime
Definition ThinZone2DFinder.h:31
FDuration BuildLoopSegmentsTime
Definition ThinZone2DFinder.h:28
FDuration DisplayBoundarySegmentTime
Definition ThinZone2DFinder.h:29