1 -- Created on: 2005-09-08
2 -- Created by: Alexander GRIGORIEV
3 -- Copyright (c) 2005-2012 OPEN CASCADE SAS
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
21 generic class B3x from Bnd (RealType as any)
31 Create returns B3x from Bnd;
32 ---Purpose: Empty constructor.
35 Create (theCenter: XYZ from gp; theHSize : XYZ from gp)
37 ---Purpose: Constructor.
41 returns Boolean from Standard;
42 ---Purpose: Returns True if the box is void (non-initialized).
46 ---Purpose: Reset the box data.
49 Add (me:in out; thePnt: XYZ from gp);
50 ---Purpose: Update the box by a point.
52 Add (me: in out; thePnt: Pnt from gp);
53 ---Purpose: Update the box by a point.
56 Add (me:in out; theBox: B3x from Bnd);
57 ---Purpose: Update the box by another box.
62 ---Purpose: Query the lower corner: (Center - HSize). You must make sure that
63 -- the box is NOT VOID (see IsVoid()), otherwise the method returns
69 ---Purpose: Query the upper corner: (Center + HSize). You must make sure that
70 -- the box is NOT VOID (see IsVoid()), otherwise the method returns
75 returns Real from Standard;
76 ---Purpose: Query the square diagonal. If the box is VOID (see method IsVoid())
77 -- then a very big real value is returned.
80 Enlarge (me:in out; theDiff: Real from Standard);
81 ---Purpose: Extend the Box by the absolute value of theDiff.
84 Limit (me:in out; theOtherBox: B3x from Bnd)
85 returns Boolean from Standard;
86 ---Purpose: Limit the Box by the internals of theOtherBox.
87 -- Returns True if the limitation takes place, otherwise False
88 -- indicating that the boxes do not intersect.
90 Transformed (me; theTrsf: Trsf from gp)
92 ---Purpose: Transform the bounding box with the given transformation.
93 -- The resulting box will be larger if theTrsf contains rotation.
95 IsOut (me; thePnt: XYZ from gp)
96 returns Boolean from Standard;
97 ---Purpose: Check the given point for the inclusion in the Box.
98 -- Returns True if the point is outside.
101 IsOut (me; theCenter : XYZ from gp;
102 theRadius : Real from Standard;
103 isSphereHollow: Boolean from Standard = Standard_False)
104 returns Boolean from Standard;
105 ---Purpose: Check a sphere for the intersection with the current box.
106 -- Returns True if there is no intersection between boxes. If the
107 -- parameter 'IsSphereHollow' is True, then the intersection is not
108 -- reported for a box that is completely inside the sphere (otherwise
109 -- this method would report an intersection).
111 IsOut (me; theOtherBox: B3x from Bnd)
112 returns Boolean from Standard;
113 ---Purpose: Check the given box for the intersection with the current box.
114 -- Returns True if there is no intersection between boxes.
117 IsOut (me; theOtherBox: B3x from Bnd; theTrsf: Trsf from gp)
118 returns Boolean from Standard;
119 ---Purpose: Check the given box oriented by the given transformation
120 -- for the intersection with the current box.
121 -- Returns True if there is no intersection between boxes.
123 IsOut (me; theLine : Ax1 from gp;
124 isRay : Boolean from Standard = Standard_False;
125 theOverthickness : Real from Standard = 0.0)
126 returns Boolean from Standard;
127 ---Purpose: Check the given Line for the intersection with the current box.
128 -- Returns True if there is no intersection.
129 -- isRay==True means intersection check with the positive half-line
130 -- theOverthickness is the addition to the size of the current box
131 -- (may be negative). If positive, it can be treated as the thickness
132 -- of the line 'theLine' or the radius of the cylinder along 'theLine'
134 IsOut (me; thePlane: Ax3 from gp)
135 returns Boolean from Standard;
136 ---Purpose: Check the given Plane for the intersection with the current box.
137 -- Returns True if there is no intersection.
139 IsIn (me; theBox: B3x from Bnd)
140 returns Boolean from Standard;
141 ---Purpose: Check that the box 'this' is inside the given box 'theBox'. Returns
142 -- True if 'this' box is fully inside 'theBox'.
145 IsIn (me; theBox: B3x from Bnd; theTrsf: Trsf from gp)
146 returns Boolean from Standard;
147 ---Purpose: Check that the box 'this' is inside the given box 'theBox'
148 -- transformed by 'theTrsf'. Returns True if 'this' box is fully
149 -- inside the transformed 'theBox'.
151 SetCenter (me: in out; theCenter: XYZ from gp);
152 ---Purpose: Set the Center coordinates
155 SetHSize (me: in out; theHSize: XYZ from gp);
156 ---Purpose: Set the HSize (half-diagonal) coordinates.
157 -- All components of theHSize must be non-negative.
162 myCenter : RealType[3] is protected;
163 myHSize : RealType[3] is protected;