42cf5bc1 |
1 | // Created on: 1991-01-08 |
2 | // Created by: Didier Piffault |
3 | // Copyright (c) 1991-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Bnd_B3f_HeaderFile |
18 | #define _Bnd_B3f_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_ShortReal.hxx> |
25 | #include <Standard_Boolean.hxx> |
26 | #include <gp_XYZ.hxx> |
27 | #include <Standard_Real.hxx> |
28 | class gp_XYZ; |
29 | class gp_Pnt; |
30 | class gp_Trsf; |
31 | class gp_Ax1; |
32 | class gp_Ax3; |
33 | |
34 | |
35 | |
36 | class Bnd_B3f |
37 | { |
38 | public: |
39 | |
40 | DEFINE_STANDARD_ALLOC |
41 | |
42 | |
43 | Bnd_B3f(); |
44 | |
45 | Bnd_B3f(const gp_XYZ& theCenter, const gp_XYZ& theHSize); |
46 | |
47 | Standard_Boolean IsVoid() const; |
48 | |
49 | void Clear(); |
50 | |
51 | Standard_EXPORT void Add (const gp_XYZ& thePnt); |
52 | |
53 | void Add (const gp_Pnt& thePnt); |
54 | |
55 | void Add (const Bnd_B3f& theBox); |
56 | |
57 | gp_XYZ CornerMin() const; |
58 | |
59 | gp_XYZ CornerMax() const; |
60 | |
61 | Standard_Real SquareExtent() const; |
62 | |
63 | void Enlarge (const Standard_Real theDiff); |
64 | |
65 | Standard_EXPORT Standard_Boolean Limit (const Bnd_B3f& theOtherBox); |
66 | |
67 | Standard_EXPORT Bnd_B3f Transformed (const gp_Trsf& theTrsf) const; |
68 | |
69 | Standard_Boolean IsOut (const gp_XYZ& thePnt) const; |
70 | |
71 | Standard_EXPORT Standard_Boolean IsOut (const gp_XYZ& theCenter, const Standard_Real theRadius, const Standard_Boolean isSphereHollow = Standard_False) const; |
72 | |
73 | Standard_Boolean IsOut (const Bnd_B3f& theOtherBox) const; |
74 | |
75 | Standard_EXPORT Standard_Boolean IsOut (const Bnd_B3f& theOtherBox, const gp_Trsf& theTrsf) const; |
76 | |
77 | Standard_EXPORT Standard_Boolean IsOut (const gp_Ax1& theLine, const Standard_Boolean isRay = Standard_False, const Standard_Real theOverthickness = 0.0) const; |
78 | |
79 | Standard_EXPORT Standard_Boolean IsOut (const gp_Ax3& thePlane) const; |
80 | |
81 | Standard_Boolean IsIn (const Bnd_B3f& theBox) const; |
82 | |
83 | Standard_EXPORT Standard_Boolean IsIn (const Bnd_B3f& theBox, const gp_Trsf& theTrsf) const; |
84 | |
85 | void SetCenter (const gp_XYZ& theCenter); |
86 | |
87 | void SetHSize (const gp_XYZ& theHSize); |
88 | |
89 | |
90 | |
91 | |
92 | protected: |
93 | |
94 | |
95 | |
96 | Standard_ShortReal myCenter[3]; |
97 | Standard_ShortReal myHSize[3]; |
98 | |
99 | |
100 | private: |
101 | |
102 | |
103 | |
104 | |
105 | |
106 | }; |
107 | |
108 | #define RealType Standard_ShortReal |
109 | #define RealType_hxx <Standard_ShortReal.hxx> |
110 | #define Bnd_B3x Bnd_B3f |
111 | #define Bnd_B3x_hxx <Bnd_B3f.hxx> |
112 | |
113 | #include <Bnd_B3x.lxx> |
114 | |
115 | #undef RealType |
116 | #undef RealType_hxx |
117 | #undef Bnd_B3x |
118 | #undef Bnd_B3x_hxx |
119 | |
120 | |
121 | |
122 | |
123 | #endif // _Bnd_B3f_HeaderFile |