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