UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Shell.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
5#include "Core/CADEntity.h"
6#include "Core/HaveStates.h"
9#include "Core/Types.h"
10#include "Geo/GeoEnum.h"
13
14namespace UE::CADKernel
15{
16
17class FBody;
18class FCADKernelArchive;
19class FDatabase;
20class FTopologicalFace;
21class FTopologyReport;
22struct FFaceSubset;
23
24namespace ShellTools
25{
27}
28
42
44{
45 friend class FEntity;
46
47private:
48 TArray<FOrientedFace> TopologicalFaces;
49
50 FShell() = default;
51
54 , TopologicalFaces(InTopologicalFaces)
55 {
56 if (bIsInnerShell)
57 {
58 SetInner();
59 }
60 }
61
63
65
66
67public:
68
69 virtual ~FShell() override
70 {
71 FShell::Empty();
72 }
73
74 virtual void Serialize(FCADKernelArchive& Ar) override
75 {
76 FTopologicalShapeEntity::Serialize(Ar);
77 SerializeIdents(Ar, (TArray<TOrientedEntity<FEntity>>&) TopologicalFaces);
78 }
79
80 virtual void SpawnIdent(FDatabase& Database) override
81 {
82 if (!FEntity::SetId(Database))
83 {
84 return;
85 }
86
87 SpawnIdentOnEntities((TArray<TOrientedEntity<FEntity>>&) TopologicalFaces, Database);
88 }
89
90 virtual void ResetMarkersRecursively() const override
91 {
92 ResetMarkers();
93 ResetMarkersRecursivelyOnEntities((TArray<TOrientedEntity<FEntity>>&) TopologicalFaces);
94 }
95
96 void RemoveFaces();
97
98 void RemoveDeletedOrDegeneratedFaces();
99
100 virtual void Empty() override;
101
103 void Add(TArray<FTopologicalFace*>& Faces);
104
105#ifdef CADKERNEL_DEV
106 virtual FInfoEntity& GetInfo(FInfoEntity&) const override;
107#endif
108
109 virtual EEntity GetEntityType() const override
110 {
111 return EEntity::Shell;
112 }
113
114 virtual int32 FaceCount() const override
115 {
116 return TopologicalFaces.Num();
117 }
118
120 {
121 Swap(TopologicalFaces, NewFaces);
122 NewFaces.Reset();
123 }
124
126 {
127 return TopologicalFaces;
128 }
129
131 {
132 return TopologicalFaces;
133 }
134
135 virtual void GetFaces(TArray<FTopologicalFace*>& OutFaces) override;
136
137 virtual void Merge(TSharedPtr<FShell>& Shell);
138
139 virtual void PropagateBodyOrientation() override;
140
141 virtual void CompleteMetaData() override;
142
146 virtual void UpdateShellOrientation();
147
148 void CheckTopology(TArray<FFaceSubset>& Subshells);
149
151 {
153 GetFaces(Faces);
154 ShellTools::UnlinkFromOther(Faces, OutVerticesToLink);
155 }
156
157#ifdef CADKERNEL_DEV
158 virtual void FillTopologyReport(FTopologyReport& Report) const override;
159#endif
160
164 bool IsOpenShell();
165
166 bool IsInner() const
167 {
168 return ((States & EHaveStates::IsInner) == EHaveStates::IsInner);
169 }
170
171 bool IsOuter() const
172 {
173 return ((States & EHaveStates::IsInner) != EHaveStates::IsInner);
174 }
175
176 void SetInner()
177 {
178 States |= EHaveStates::IsInner;
179 }
180
181 void SetOuter()
182 {
183 States &= ~EHaveStates::IsInner;
184 }
185
193 int32 Orient();
194
195 virtual void Remove(const FTopologicalShapeEntity*) override;
196
197};
198
199}
200
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
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition CADKernelArchive.h:19
Definition Database.h:17
Definition CADEntity.h:56
Definition Shell.h:30
FOrientedFace()
Definition Shell.h:37
FOrientedFace(TSharedPtr< FTopologicalFace > &InEntity, EOrientation InOrientation)
Definition Shell.h:32
Definition Shell.h:44
bool IsInner() const
Definition Shell.h:166
virtual void SpawnIdent(FDatabase &Database) override
Definition Shell.h:80
TArray< FOrientedFace > & GetFaces()
Definition Shell.h:130
virtual EEntity GetEntityType() const override
Definition Shell.h:109
bool IsOuter() const
Definition Shell.h:171
virtual ~FShell() override
Definition Shell.h:69
void ReplaceFaces(TArray< FOrientedFace > &NewFaces)
Definition Shell.h:119
const TArray< FOrientedFace > & GetFaces() const
Definition Shell.h:125
virtual int32 FaceCount() const override
Definition Shell.h:114
void SetInner()
Definition Shell.h:176
void UnlinkFromOther(TArray< FTopologicalVertex * > &OutVerticesToLink)
Definition Shell.h:150
virtual void ResetMarkersRecursively() const override
Definition Shell.h:90
void SetOuter()
Definition Shell.h:181
virtual void Serialize(FCADKernelArchive &Ar) override
Definition Shell.h:74
Definition TopologicalShapeEntity.h:14
Definition OrientedEntity.h:11
void UnlinkFromOther(TArray< FTopologicalFace * > &Faces, TArray< FTopologicalVertex * > &VerticesToLink)
Definition Shell.cpp:565
Definition CADEntity.cpp:23
EOrientation
Definition GeoEnum.h:82
EEntity
Definition CADEntity.h:18