1 -- Created on: 2005-09-08
2 -- Created by: Alexander GRIGORIEV
3 -- Copyright (c) 2005-2014 OPEN CASCADE SAS
5 -- This file is part of Open CASCADE Technology software library.
7 -- This library is free software; you can redistribute it and/or modify it under
8 -- the terms of the GNU Lesser General Public License version 2.1 as published
9 -- by the Free Software Foundation, with special exception defined in the file
10 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 -- distribution for complete text of the license and disclaimer of any warranty.
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
16 generic class B3x from Bnd (RealType as any)
26 Create returns B3x from Bnd;
27 ---Purpose: Empty constructor.
30 Create (theCenter: XYZ from gp; theHSize : XYZ from gp)
32 ---Purpose: Constructor.
36 returns Boolean from Standard;
37 ---Purpose: Returns True if the box is void (non-initialized).
41 ---Purpose: Reset the box data.
44 Add (me:in out; thePnt: XYZ from gp);
45 ---Purpose: Update the box by a point.
47 Add (me: in out; thePnt: Pnt from gp);
48 ---Purpose: Update the box by a point.
51 Add (me:in out; theBox: B3x from Bnd);
52 ---Purpose: Update the box by another box.
57 ---Purpose: Query the lower corner: (Center - HSize). You must make sure that
58 -- the box is NOT VOID (see IsVoid()), otherwise the method returns
64 ---Purpose: Query the upper corner: (Center + HSize). You must make sure that
65 -- the box is NOT VOID (see IsVoid()), otherwise the method returns
70 returns Real from Standard;
71 ---Purpose: Query the square diagonal. If the box is VOID (see method IsVoid())
72 -- then a very big real value is returned.
75 Enlarge (me:in out; theDiff: Real from Standard);
76 ---Purpose: Extend the Box by the absolute value of theDiff.
79 Limit (me:in out; theOtherBox: B3x from Bnd)
80 returns Boolean from Standard;
81 ---Purpose: Limit the Box by the internals of theOtherBox.
82 -- Returns True if the limitation takes place, otherwise False
83 -- indicating that the boxes do not intersect.
85 Transformed (me; theTrsf: Trsf from gp)
87 ---Purpose: Transform the bounding box with the given transformation.
88 -- The resulting box will be larger if theTrsf contains rotation.
90 IsOut (me; thePnt: XYZ from gp)
91 returns Boolean from Standard;
92 ---Purpose: Check the given point for the inclusion in the Box.
93 -- Returns True if the point is outside.
96 IsOut (me; theCenter : XYZ from gp;
97 theRadius : Real from Standard;
98 isSphereHollow: Boolean from Standard = Standard_False)
99 returns Boolean from Standard;
100 ---Purpose: Check a sphere for the intersection with the current box.
101 -- Returns True if there is no intersection between boxes. If the
102 -- parameter 'IsSphereHollow' is True, then the intersection is not
103 -- reported for a box that is completely inside the sphere (otherwise
104 -- this method would report an intersection).
106 IsOut (me; theOtherBox: B3x from Bnd)
107 returns Boolean from Standard;
108 ---Purpose: Check the given box for the intersection with the current box.
109 -- Returns True if there is no intersection between boxes.
112 IsOut (me; theOtherBox: B3x from Bnd; theTrsf: Trsf from gp)
113 returns Boolean from Standard;
114 ---Purpose: Check the given box oriented by the given transformation
115 -- for the intersection with the current box.
116 -- Returns True if there is no intersection between boxes.
118 IsOut (me; theLine : Ax1 from gp;
119 isRay : Boolean from Standard = Standard_False;
120 theOverthickness : Real from Standard = 0.0)
121 returns Boolean from Standard;
122 ---Purpose: Check the given Line for the intersection with the current box.
123 -- Returns True if there is no intersection.
124 -- isRay==True means intersection check with the positive half-line
125 -- theOverthickness is the addition to the size of the current box
126 -- (may be negative). If positive, it can be treated as the thickness
127 -- of the line 'theLine' or the radius of the cylinder along 'theLine'
129 IsOut (me; thePlane: Ax3 from gp)
130 returns Boolean from Standard;
131 ---Purpose: Check the given Plane for the intersection with the current box.
132 -- Returns True if there is no intersection.
134 IsIn (me; theBox: B3x from Bnd)
135 returns Boolean from Standard;
136 ---Purpose: Check that the box 'this' is inside the given box 'theBox'. Returns
137 -- True if 'this' box is fully inside 'theBox'.
140 IsIn (me; theBox: B3x from Bnd; theTrsf: Trsf from gp)
141 returns Boolean from Standard;
142 ---Purpose: Check that the box 'this' is inside the given box 'theBox'
143 -- transformed by 'theTrsf'. Returns True if 'this' box is fully
144 -- inside the transformed 'theBox'.
146 SetCenter (me: in out; theCenter: XYZ from gp);
147 ---Purpose: Set the Center coordinates
150 SetHSize (me: in out; theHSize: XYZ from gp);
151 ---Purpose: Set the HSize (half-diagonal) coordinates.
152 -- All components of theHSize must be non-negative.
157 myCenter : RealType[3] is protected;
158 myHSize : RealType[3] is protected;