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_B2f_HeaderFile |
18 | #define _Bnd_B2f_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_XY.hxx> |
27 | #include <Standard_Real.hxx> |
28 | class gp_XY; |
29 | class gp_Pnt2d; |
30 | class gp_Trsf2d; |
31 | class gp_Ax2d; |
32 | |
33 | |
34 | |
35 | class Bnd_B2f |
36 | { |
37 | public: |
38 | |
39 | DEFINE_STANDARD_ALLOC |
40 | |
41 | |
42 | Bnd_B2f(); |
43 | |
44 | Bnd_B2f(const gp_XY& theCenter, const gp_XY& theHSize); |
45 | |
46 | Standard_Boolean IsVoid() const; |
47 | |
48 | void Clear(); |
49 | |
50 | Standard_EXPORT void Add (const gp_XY& thePnt); |
51 | |
52 | Standard_EXPORT void Add (const gp_Pnt2d& thePnt); |
53 | |
54 | void Add (const Bnd_B2f& theBox); |
55 | |
56 | gp_XY CornerMin() const; |
57 | |
58 | gp_XY CornerMax() const; |
59 | |
60 | Standard_Real SquareExtent() const; |
61 | |
62 | void Enlarge (const Standard_Real theDiff); |
63 | |
64 | Standard_EXPORT Standard_Boolean Limit (const Bnd_B2f& theOtherBox); |
65 | |
66 | Standard_EXPORT Bnd_B2f Transformed (const gp_Trsf2d& theTrsf) const; |
67 | |
68 | Standard_Boolean IsOut (const gp_XY& thePnt) const; |
69 | |
70 | Standard_EXPORT Standard_Boolean IsOut (const gp_XY& theCenter, const Standard_Real theRadius, const Standard_Boolean isCircleHollow = Standard_False) const; |
71 | |
72 | Standard_Boolean IsOut (const Bnd_B2f& theOtherBox) const; |
73 | |
74 | Standard_EXPORT Standard_Boolean IsOut (const Bnd_B2f& theOtherBox, const gp_Trsf2d& theTrsf) const; |
75 | |
76 | Standard_EXPORT Standard_Boolean IsOut (const gp_Ax2d& theLine) const; |
77 | |
78 | Standard_EXPORT Standard_Boolean IsOut (const gp_XY& theP0, const gp_XY& theP1) const; |
79 | |
80 | Standard_Boolean IsIn (const Bnd_B2f& theBox) const; |
81 | |
82 | Standard_EXPORT Standard_Boolean IsIn (const Bnd_B2f& theBox, const gp_Trsf2d& theTrsf) const; |
83 | |
84 | void SetCenter (const gp_XY& theCenter); |
85 | |
86 | void SetHSize (const gp_XY& theHSize); |
87 | |
88 | |
89 | |
90 | |
91 | protected: |
92 | |
93 | |
94 | |
95 | Standard_ShortReal myCenter[2]; |
96 | Standard_ShortReal myHSize[2]; |
97 | |
98 | |
99 | private: |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | }; |
106 | |
107 | #define RealType Standard_ShortReal |
108 | #define RealType_hxx <Standard_ShortReal.hxx> |
109 | #define Bnd_B2x Bnd_B2f |
110 | #define Bnd_B2x_hxx <Bnd_B2f.hxx> |
111 | |
112 | #include <Bnd_B2x.lxx> |
113 | |
114 | #undef RealType |
115 | #undef RealType_hxx |
116 | #undef Bnd_B2x |
117 | #undef Bnd_B2x_hxx |
118 | |
119 | |
120 | |
121 | |
122 | #endif // _Bnd_B2f_HeaderFile |