FLImaging 6.5.8.1
FLGeometry3DBoundingBox.h
1#pragma once
2
4namespace FLImaging
5{
7 namespace Foundation
8 {
9 template <typename Ty>
10 class FL_EXPORT CFLPoint3;
11
12 template <typename Ty>
13 class FL_EXPORT CFLGeometry3DDirection;
14
15 template <typename Ty>
16 class FL_EXPORT CMatrixFor3DTransform;
17
18 template <typename Ty>
19 class FL_EXPORT CFLGeometry3DLine;
20
21 template <typename Ty>
22 class FL_EXPORT CFLGeometry3DPlane;
23
29 template <typename Ty>
30 class FL_EXPORT CFLGeometry3DBoundingBox : public Base::CFLBase
31 {
32 public:
37 CFLGeometry3DBoundingBox();
38
46 CFLGeometry3DBoundingBox(const CFLPoint3<Ty>& flp3Min, const CFLPoint3<Ty>& flp3Max);
47
52 void SetWhole();
53
58 void SetVoid();
59
66 void Set(const CFLPoint3<Ty>& flp3Point);
67
76 void Set(const CFLPoint3<Ty>& flp3Point, const CFLGeometry3DDirection<Ty>& dir);
77
88 void Update(const Ty f64MinX, const Ty f64MinY, const Ty f64MinZ, const Ty f64MaxX, const Ty f64MaxY, const Ty f64MaxZ);
89
97 void Update(const Ty f64X, const Ty f64Y, const Ty f64Z);
98
104 Ty GetGap() const;
105
111 void SetGap(const Ty f64Tolerance);
112
118 void Enlarge(const Ty f64Tolerance);
119
132 const CResult Get(Ty& f64MinX, Ty& f64MinY, Ty& f64MinZ, Ty& f64MaxX, Ty& f64MaxY, Ty& f64MaxZ) const;
133
142 const CResult GetCornerMin(CFLPoint3<Ty>& flp3CornerMin) const;
143
152 const CResult GetCornerMax(CFLPoint3<Ty>& flp3CornerMax) const;
153
158 void OpenXmin();
159
164 void OpenXmax();
165
170 void OpenYmin();
171
176 void OpenYmax();
177
182 void OpenZmin();
183
188 void OpenZmax();
189
195 bool IsOpen() const;
196
202 bool IsOpenXmin() const;
203
209 bool IsOpenXmax() const;
210
216 bool IsOpenYmin() const;
217
223 bool IsOpenYmax() const;
224
230 bool IsOpenZmin() const;
231
237 bool IsOpenZmax() const;
238
244 bool IsWhole() const;
245
251 bool IsVoid() const;
252
259 bool IsXThin(const Ty f64Tolerance) const;
260
267 bool IsYThin(const Ty f64Tolerance) const;
268
275 bool IsZThin(const Ty f64Tolerance) const;
276
283 bool IsThin(const Ty f64Tolerance) const;
284
293 const CResult Transform(const CMatrixFor3DTransform<Ty>& trsf);
294
302 CFLGeometry3DBoundingBox<Ty> GetTransformed(const CMatrixFor3DTransform<Ty>& trsf) const;
303
309 void Add(const CFLGeometry3DBoundingBox<Ty>& rhs);
310
317 void Add(const CFLPoint3<Ty>& flp3Point);
318
327 void Add(const CFLPoint3<Ty>& flp3Point, const CFLGeometry3DDirection<Ty>& dir);
328
335 void Add(const CFLGeometry3DDirection<Ty>& dir);
336
344 bool IsOut(const CFLPoint3<Ty>& flp3Point) const;
345
353 // 어떤 라인 `line3D`가 이 객체의 바깥에 존재하면 `true` 를 리턴합니다.
354 bool IsOut(const CFLGeometry3DLine<Ty>& line3D) const;
355
363 // 어떤 평면 `plane3D`가 이 객체의 바깥에 존재하면 `true` 를 리턴합니다.
364 bool IsOut(const CFLGeometry3DPlane<Ty>& plane3D) const;
365
372 // 어떤 바운딩 박스 `boundingBox`가 이 객체의 바깥에 존재하면 `true` 를 리턴합니다.
373 bool IsOut(const CFLGeometry3DBoundingBox<Ty>& boundingBox) const;
374
383 // 변환 행렬 `trsf` 로 변환된 바운딩 박스 `boundingBox` 가 이 객체의 바깥에 존재하면 `true` 를 리턴합니다.
384 bool IsOut(const CFLGeometry3DBoundingBox<Ty>& boundingBox, const CMatrixFor3DTransform<Ty>& trsf) const;
385
395 bool IsOut(const CMatrixFor3DTransform<Ty>& trsfForThis, const CFLGeometry3DBoundingBox<Ty>& boundingBox, const CMatrixFor3DTransform<Ty>& trsfForOther) const;
396
407 bool IsOut(const CFLPoint3<Ty>& flp3Point1, const CFLPoint3<Ty>& flp3Point2, const CFLGeometry3DDirection<Ty>& dir) const;
408
416 Ty GetDistance(const CFLGeometry3DBoundingBox<Ty>& rhs) const;
417
424 Ty GetSquareExtent() const;
425
431 CFLGeometry3DBoundingBox<Ty> GetFinitePart() const;
432
438 bool HasFinitePart() const;
439
440 SupportToDuplicateObject(CFLGeometry3DBoundingBox<Ty>, *this);
441 DeclareGetClassType();
442
443 protected:
444 Ty m_tMinX;
445 Ty m_tMaxX;
446 Ty m_tMinY;
447 Ty m_tMaxY;
448 Ty m_tMinZ;
449 Ty m_tMaxZ;
450 Ty m_tGap;
451 int32_t m_i32Flags;
452 };
453 }
454}