UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Display.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Core/System.h"
5#include "Core/Types.h"
6#include "Geo/GeoEnum.h"
7#include "Math/Point.h"
8#include "UI/Visu.h"
9
10#ifdef CADKERNEL_DEV
11#include "UI/DefineForDebug.h"
12#endif
13
14class FString;
15
16namespace UE::CADKernel
17{
18
19class FAABB2D;
20class FAABB;
21class FBody;
22class FCurve;
23class FEdgeMesh;
24class FEdgeMesh;
25class FEntity;
26class FFaceMesh;
27class FFaceMesh;
28class FGroup;
29class FMesh;
30class FModel;
31class FModelMesh;
32class FRestrictionCurve;
33class FShell;
34class FSurface;
35class FTopologicalEdge;
36class FTopologicalFace;
37class FTopologicalLoop;
38class FTopologicalVertex;
39class FVertexMesh;
40class FVertexMesh;
41struct FLinearBoundary;
42
43#ifdef CADKERNEL_DEBUG
44void Wait(bool bMakeWait = true);
45void Open3DDebugSession(FString name, const TArray<FIdent>& idList = TArray<FIdent>());
46inline void Open3DDebugSession(bool bIsDisplayed, FString name, const TArray<FIdent>& idList = TArray<FIdent>())
47{
48 if (bIsDisplayed)
49 {
51 }
52};
53void Close3DDebugSession(bool bIsDisplayed = true);
54#else
55inline void Wait(bool bMakeWait = true) {};
56inline void Open3DDebugSession(bool bIsDisplayed, FString name, const TArray<FIdent>& idList = TArray<FIdent>()) {};
57inline void Open3DDebugSession(FString name, const TArray<FIdent>& idList = TArray<FIdent>()) {};
58inline void Close3DDebugSession(bool bIsDisplayed = true) {};
59#endif
60
62{
63private:
64 bool bDisplay = true;
65
66public:
68 {
69#ifdef CADKERNEL_DEBUG
71#endif
72 }
73
75 : bDisplay(bInDisplay)
76 {
77#ifdef CADKERNEL_DEBUG
78 if (bDisplay)
79 {
81 }
82#endif
83 }
84
86 {
87#ifdef CADKERNEL_DEBUG
88 if (bDisplay)
89 {
91 }
92#endif
93 }
94};
95
98
100{
101public:
103 {
104#ifdef CADKERNEL_DEBUG
105 Open3DDebugSegment(Ident);
106#endif
107 }
108
110 {
111#ifdef CADKERNEL_DEBUG
113#endif
114 }
115};
116
118
119template<typename TPoint>
121{
122#ifdef CADKERNEL_DEBUG
124#endif
125}
126
131
132template<typename TPoint>
134{
135#ifdef CADKERNEL_DEBUG
137#endif
138}
139
141
143
144template<typename TPoint>
145void DisplayPoint(const TPoint& Point, FIdent Ident)
146{
147#ifdef CADKERNEL_DEBUG
148 F3DDebugSegment G(Ident);
150#endif
151}
152
153template<typename TPoint>
155{
156#ifdef CADKERNEL_DEBUG
158#endif
159}
160
161template<typename TPoint>
163{
164#ifdef CADKERNEL_DEBUG
165 F3DDebugSegment G(Ident);
167#endif
168}
169
170static void DisplayPoint2DWithScale(const FVector2d& Point, EVisuProperty Property = EVisuProperty::BluePoint)
171{
172#ifdef CADKERNEL_DEBUG
174#endif
175}
176
177static void DisplayPoint2DWithScale(const FVector2d& Point, EVisuProperty Property, FIdent Ident)
178{
179#ifdef CADKERNEL_DEBUG
180 F3DDebugSegment G(Ident);
182#endif
183}
184
185template<typename TPoint>
186void DisplayPoints(FString Message, const TArray<TPoint>& Points, EVisuProperty Property = EVisuProperty::BluePoint, bool bDisplay = true)
187{
188#ifdef CADKERNEL_DEBUG
189 if (!bDisplay)
190 {
191 return;
192 }
193
194 Open3DDebugSession(Message);
195 for (int32 Index = 0; Index < Points.Num(); ++Index)
196 {
197 DisplayPoint(Points[Index], Property);
198 }
200#endif
201}
202
203CADKERNEL_API void DisplayProductTree(const FEntity& RootId);
204CADKERNEL_API void DisplayProductTree(const FModel& Model);
205CADKERNEL_API void DisplayProductTree(const FBody& Body);
206CADKERNEL_API void DisplayProductTree(const FShell& Shell);
207
208CADKERNEL_API void DisplayAABB(const FAABB& aabb, FIdent Ident = 0);
209CADKERNEL_API void DisplayAABB2D(const FAABB2D& aabb, FIdent Ident = 0);
210
211CADKERNEL_API void DisplayEntity(const FEntity& Entity);
212CADKERNEL_API void DisplayEntity2D(const FEntity& Entity);
213
214CADKERNEL_API void DisplayLoop(const FTopologicalFace& Entity);
215CADKERNEL_API void DisplayIsoCurve(const FSurface& CarrierSurface, double Coordinate, EIso Type);
216
217CADKERNEL_API void Display(const FPlane& plane, FIdent Ident = 0);
218
219CADKERNEL_API void Display(const FCurve& Curve);
220CADKERNEL_API void Display(const FSurface& CarrierSurface);
221
222CADKERNEL_API void Display(const FGroup& Group);
223CADKERNEL_API void Display(const FModel& Model);
224CADKERNEL_API void Display(const FBody& Body);
225CADKERNEL_API void Display(const FShell& Shell);
227CADKERNEL_API void Display(const FTopologicalFace& Face);
228CADKERNEL_API void Display(const FTopologicalLoop& Loop);
230
232CADKERNEL_API void Display2D(const FTopologicalFace& Face);
233CADKERNEL_API void Display2D(const FTopologicalLoop& Loop);
234CADKERNEL_API void Display2D(const FSurface& CarrierSurface);
235
237CADKERNEL_API void Display2DWithScale(const FTopologicalFace& Face);
238CADKERNEL_API void Display2DWithScale(const FTopologicalLoop& Loop);
239CADKERNEL_API void Display2DWithScale(const FSurface& CarrierSurface);
240
244
248
250
253
254template<typename TPoint>
255void DisplaySegment(const TPoint& Point1, const TPoint& Point2, FIdent Ident = 0, EVisuProperty Property = EVisuProperty::BlueCurve, bool bWithOrientation = false)
256{
257#ifdef CADKERNEL_DEBUG
258 F3DDebugSegment G(Ident);
260 {
261 DrawSegmentOrientation(Point1, Point2, Property);
262 }
263 DrawSegment(Point1, Point2, Property);
264 #endif
265};
266
267template<typename TPoint>
269{
270#ifdef CADKERNEL_DEBUG
271 F3DDebugSegment G(Ident);
273 {
275 }
276 DrawSegment(Point1 * DisplayScale, Point2 * DisplayScale, Property);
277#endif
278};
279
280template<typename TPoint>
282{
283#ifdef CADKERNEL_DEBUG
285 Draw(Points, Property);
287#endif
288}
289
290static void DisplayPolylineWithScale(const TArray<FVector2d>& Points, EVisuProperty Property)
291{
292#ifdef CADKERNEL_DEBUG
295 {
297 }
298
302#endif
303}
304
305template<typename TPoint>
307{
308#ifdef CADKERNEL_DEBUG
310 for (int32 Index = 1; Index < Points.Num(); ++Index)
311 {
312 DisplaySegment(Points[Index - 1], Points[Index], Index, Property, true);
313 }
315#endif
316}
317
318CADKERNEL_API void DrawQuadripode(double Height, double Base, FVector& Centre, FVector& Direction, EVisuProperty Property);
319
321CADKERNEL_API void Draw(const FTopologicalFace& Face);
322CADKERNEL_API void Draw2D(const FTopologicalFace& Face);
324CADKERNEL_API void Draw(const FShell& Shell);
325
329
330template<typename TPoint>
332{
333#ifdef CADKERNEL_DEBUG
334 TArray<FVector> Points;
335 Points.Add(Point1);
336 Points.Add(Point2);
337 Draw(Points, Property);
338#endif
339}
340
341template<typename TPoint>
343{
344#ifdef CADKERNEL_DEBUG
345 double Length = Point1.Distance(Point2);
346 double Height = Length / 10.0;
347 double Base = Height / 2;
348
349 FVector Middle = (Point1 + Point2) / 2.;
350 FVector Tangent = Point2 - Point1;
351 DrawQuadripode(Height, Base, Middle, Tangent, Property);
352#endif
353}
354
355CADKERNEL_API void DrawIsoCurves(const FTopologicalFace& Face);
356
357
358} // namespace UE::CADKernel
359
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
uint32 FIdent
Definition Types.h:27
DIRECTLINK_API Display
Definition DirectLinkLog.h:8
@ Vertex
Definition MetalRHIPrivate.h:223
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
Definition SharedPointer.h:692
Definition Display.h:100
~F3DDebugSegment()
Definition Display.h:109
F3DDebugSegment(FIdent Ident)
Definition Display.h:102
Definition Display.h:62
~F3DDebugSession()
Definition Display.h:85
F3DDebugSession(FString Name, const TArray< FIdent > &Idents=TArray< FIdent >())
Definition Display.h:67
F3DDebugSession(bool bInDisplay, FString Name, const TArray< FIdent > &Idents=TArray< FIdent >())
Definition Display.h:74
Definition Body.h:22
Definition Curve.h:21
Definition EdgeMesh.h:12
Definition FaceMesh.h:16
Definition ModelMesh.h:21
Definition Model.h:22
Definition RestrictionCurve.h:33
Definition Shell.h:44
Definition Surface.h:27
FVisu * GetVisu() const
Definition System.h:61
static FSystem & Get()
Definition System.h:140
Definition TopologicalFace.h:56
Definition VertexMesh.h:11
virtual void DrawPolyline(const TArray< FVector > &Points, EVisuProperty InProperty=EVisuProperty::BlueCurve)
Definition Visu.h:163
virtual void DrawPoint(const FVector &Point, EVisuProperty InProperty=EVisuProperty::BluePoint)
Definition Visu.h:154
Definition CADEntity.cpp:23
void DisplayPoints(FString Message, const TArray< TPoint > &Points, EVisuProperty Property=EVisuProperty::BluePoint, bool bDisplay=true)
Definition Display.h:186
void Close3DDebugSegment()
Definition Display.cpp:67
void DisplayProductTree(const FModel &Model)
Definition Display.cpp:992
void DisplayAABB(const FAABB &Aabb, FIdent Ident)
Definition Display.cpp:426
void DisplayEdgeCriteriaGrid(int32 EdgeId, const TArray< FVector > &Points3D)
Definition Display.cpp:404
void Draw2D(const FCurve &Curve, const FLinearBoundary &Boundary, EVisuProperty Property)
Definition Display.cpp:129
CADKERNEL_API void Draw2DWithScale(const FTopologicalFace &Face)
void DisplayMesh(const FModel &Model)
Definition Display.cpp:1086
void DisplayAABB2D(const FAABB2D &aabb, FIdent Ident)
Definition Display.cpp:477
void DrawPoint(const TPoint &InPoint, EVisuProperty Property=EVisuProperty::BluePoint)
Definition Display.h:120
void Open3DDebugSegment(FIdent Ident)
Definition Display.cpp:60
void DisplaySegment(const FVector &Point1, const FVector &Point2, FIdent Ident, EVisuProperty Property)
Definition Display.cpp:1268
void DrawElement(int32 Dimension, TArray< FVector > &Points, EVisuProperty Property)
Definition Display.cpp:81
void DrawMesh(const FMesh &Mesh)
Definition Display.cpp:88
void DisplayOrientedPolyline(const TArray< TPoint > &Points, EVisuProperty Property)
Definition Display.h:306
void Wait(bool bMakeWait=true)
Definition Display.h:55
void Open3DDebugSession(bool bIsDisplayed, FString name, const TArray< FIdent > &idList=TArray< FIdent >())
Definition Display.h:56
void DisplayPoint(const TPoint &Point, FIdent Ident)
Definition Display.h:145
void DrawSegmentOrientation(const TPoint &Point1, const TPoint &Point2, EVisuProperty Property=EVisuProperty::Element)
Definition Display.h:342
void DisplayEntity2D(const FEntity &Entity)
Definition Display.cpp:312
void Close3DDebugSession(bool bIsDisplayed=true)
Definition Display.h:58
void DisplaySegmentWithScale(const TPoint &Point1, const TPoint &Point2, FIdent Ident=0, EVisuProperty Property=EVisuProperty::BlueCurve, bool bWithOrientation=false)
Definition Display.h:268
void DrawIsoCurves(const FTopologicalFace &Face)
Definition Display.cpp:872
void DisplayIsoCurve(const FSurface &Surface, double Coordinate, EIso IsoType)
Definition Display.cpp:629
void FlushVisu()
Definition Display.cpp:74
EIso
Definition GeoEnum.h:66
void Display2DWithScale(const FTopologicalFace &Face)
Definition Display.cpp:775
void DisplayPolyline(const TArray< TPoint > &Points, EVisuProperty Property)
Definition Display.h:281
EVisuProperty
Definition Visu.h:15
@ Element
Definition Visu.h:18
@ BluePoint
Definition Visu.h:30
@ Curve
Definition Visu.h:19
@ BlueCurve
Definition Visu.h:31
@ Point
Definition Visu.h:17
void DrawQuadripode(double Height, double Base, FVector &Center, FVector &InDirection, EVisuProperty Property)
Definition Display.cpp:218
void DisplayEntity(const FEntity &Entity)
Definition Display.cpp:257
void DisplayLoop(const FTopologicalFace &Surface)
Definition Display.cpp:1288
void DisplayControlPolygon(const FCurve &Curve)
Definition Display.cpp:647
void Draw(const FLinearBoundary &Boundary, const FRestrictionCurve &Curve, EVisuProperty Property)
Definition Display.cpp:95
void Display2D(const FSurface &Surface)
Definition Display.cpp:599
void DrawSegment(const TPoint &Point1, const TPoint &Point2, EVisuProperty Property=EVisuProperty::Element)
Definition Display.h:331
U16 Index
Definition radfft.cpp:71
Definition Boundary.h:18