UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Body.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Core/CADEntity.h"
6#include "Geo/GeoEnum.h"
7#include "Topo/Shell.h"
11
12namespace UE::CADKernel
13{
14
15class FCADKernelArchive;
16class FDatabase;
17class FModel;
18class FShell;
19class FTopologicalFace;
20
22{
23 friend FEntity;
24
25private:
27
28 FBody() = default;
29
31 {
33 {
34 if (Shell.IsValid())
35 {
36 AddShell(Shell.ToSharedRef());
37 }
38 }
39 }
40
41public:
42
43 virtual ~FBody() override
44 {
45 FBody::Empty();
46 }
47
48 virtual void Serialize(FCADKernelArchive& Ar) override
49 {
50 FTopologicalShapeEntity::Serialize(Ar);
51 SerializeIdents(Ar, Shells);
52 }
53
54
55 virtual void SpawnIdent(FDatabase& Database) override
56 {
57 if (!FEntity::SetId(Database))
58 {
59 return;
60 }
61
62 SpawnIdentOnEntities(Shells, Database);
63 }
64
65 virtual void ResetMarkersRecursively() const override
66 {
67 ResetMarkers();
68 ResetMarkersRecursivelyOnEntities(Shells);
69 }
70
71#ifdef CADKERNEL_DEV
72 virtual FInfoEntity& GetInfo(FInfoEntity&) const override;
73#endif
74
75 virtual EEntity GetEntityType() const override
76 {
77 return EEntity::Body;
78 }
79
80 void AddShell(TSharedRef<FShell> Shell);
81
82 void RemoveEmptyShell();
83
84 virtual void Remove(const FTopologicalShapeEntity* ShellToRemove) override;
85
86 virtual void Empty() override
87 {
88 for (TSharedPtr<FShell>& Shell : Shells)
89 {
90 Shell->ResetHost();
91 }
92 Shells.Empty();
93 }
94
96 {
97 return Shells;
98 }
99
101 {
102 return Shells.Num();
103 }
104
105 bool IsEmpty() const
106 {
107 return Shells.IsEmpty();
108 }
109
110 virtual int32 FaceCount() const override
111 {
112 int32 FaceCount = 0;
113 for (const TSharedPtr<FShell>& Shell : Shells)
114 {
115 FaceCount += Shell->FaceCount();
116 }
117 return FaceCount;
118 }
119
120 virtual void GetFaces(TArray<FTopologicalFace*>& Faces) override
121 {
122 for (const TSharedPtr<FShell>& Shell : Shells)
123 {
124 Shell->GetFaces(Faces);
125 }
126 }
127
128 virtual void CompleteMetaData() override
129 {
130 CompleteMetaDataWithHostMetaData();
131 for (TSharedPtr<FShell>& Shell : Shells)
132 {
133 Shell->CompleteMetaData();
134 }
135 }
136
137 virtual void PropagateBodyOrientation() override
138 {
139 for (const TSharedPtr<FShell>& Shell : Shells)
140 {
141 Shell->PropagateBodyOrientation();
142 }
143 }
144
145 void Orient()
146 {
147 for (const TSharedPtr<FShell>& Shell : Shells)
148 {
149 Shell->Orient();
150 }
151 }
152
153#ifdef CADKERNEL_DEV
154 virtual void FillTopologyReport(FTopologyReport& Report) const override;
155#endif
156
157};
158
159}
160
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
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_REWRITE bool IsEmpty() const
Definition Array.h:1133
void Empty(SizeType Slack=0)
Definition Array.h:2273
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition Body.h:22
virtual void ResetMarkersRecursively() const override
Definition Body.h:65
virtual void CompleteMetaData() override
Definition Body.h:128
const TArray< TSharedPtr< FShell > > & GetShells() const
Definition Body.h:95
void Orient()
Definition Body.h:145
virtual EEntity GetEntityType() const override
Definition Body.h:75
bool IsEmpty() const
Definition Body.h:105
virtual void PropagateBodyOrientation() override
Definition Body.h:137
virtual void GetFaces(TArray< FTopologicalFace * > &Faces) override
Definition Body.h:120
virtual ~FBody() override
Definition Body.h:43
virtual void Empty() override
Definition Body.h:86
virtual int32 FaceCount() const override
Definition Body.h:110
int32 ShellCount() const
Definition Body.h:100
virtual void SpawnIdent(FDatabase &Database) override
Definition Body.h:55
virtual void Serialize(FCADKernelArchive &Ar) override
Definition Body.h:48
Definition CADKernelArchive.h:19
Definition Database.h:17
Definition CADEntity.h:56
Definition TopologicalShapeEntity.h:14
Definition CADEntity.cpp:23
EEntity
Definition CADEntity.h:18