| 1 | -- File: Bnd_B3x.cdl |
| 2 | -- Created: Thu Sep 8 18:12:21 2005 |
| 3 | -- Author: Alexander GRIGORIEV |
| 4 | -- <agv@opencascade.com> |
| 5 | ---Copyright: Open Cascade 2005 |
| 6 | |
| 7 | generic class B3x from Bnd (RealType as any) |
| 8 | |
| 9 | uses XYZ from gp, |
| 10 | Pnt from gp, |
| 11 | Ax1 from gp, |
| 12 | Ax3 from gp, |
| 13 | Trsf from gp |
| 14 | |
| 15 | is |
| 16 | |
| 17 | Create returns B3x from Bnd; |
| 18 | ---Purpose: Empty constructor. |
| 19 | ---C++: inline |
| 20 | |
| 21 | Create (theCenter: XYZ from gp; theHSize : XYZ from gp) |
| 22 | returns B3x from Bnd; |
| 23 | ---Purpose: Constructor. |
| 24 | ---C++: inline |
| 25 | |
| 26 | IsVoid (me) |
| 27 | returns Boolean from Standard; |
| 28 | ---Purpose: Returns True if the box is void (non-initialized). |
| 29 | ---C++: inline |
| 30 | |
| 31 | Clear (me:in out); |
| 32 | ---Purpose: Reset the box data. |
| 33 | ---C++: inline |
| 34 | |
| 35 | Add (me:in out; thePnt: XYZ from gp); |
| 36 | ---Purpose: Update the box by a point. |
| 37 | |
| 38 | Add (me: in out; thePnt: Pnt from gp); |
| 39 | ---Purpose: Update the box by a point. |
| 40 | ---C++: inline |
| 41 | |
| 42 | Add (me:in out; theBox: B3x from Bnd); |
| 43 | ---Purpose: Update the box by another box. |
| 44 | ---C++: inline |
| 45 | |
| 46 | CornerMin (me) |
| 47 | returns XYZ from gp; |
| 48 | ---Purpose: Query the lower corner: (Center - HSize). You must make sure that |
| 49 | -- the box is NOT VOID (see IsVoid()), otherwise the method returns |
| 50 | -- irrelevant result. |
| 51 | ---C++: inline |
| 52 | |
| 53 | CornerMax (me) |
| 54 | returns XYZ from gp; |
| 55 | ---Purpose: Query the upper corner: (Center + HSize). You must make sure that |
| 56 | -- the box is NOT VOID (see IsVoid()), otherwise the method returns |
| 57 | -- irrelevant result. |
| 58 | ---C++: inline |
| 59 | |
| 60 | SquareExtent(me) |
| 61 | returns Real from Standard; |
| 62 | ---Purpose: Query the square diagonal. If the box is VOID (see method IsVoid()) |
| 63 | -- then a very big real value is returned. |
| 64 | ---C++: inline |
| 65 | |
| 66 | Enlarge (me:in out; theDiff: Real from Standard); |
| 67 | ---Purpose: Extend the Box by the absolute value of theDiff. |
| 68 | ---C++: inline |
| 69 | |
| 70 | Limit (me:in out; theOtherBox: B3x from Bnd) |
| 71 | returns Boolean from Standard; |
| 72 | ---Purpose: Limit the Box by the internals of theOtherBox. |
| 73 | -- Returns True if the limitation takes place, otherwise False |
| 74 | -- indicating that the boxes do not intersect. |
| 75 | |
| 76 | Transformed (me; theTrsf: Trsf from gp) |
| 77 | returns B3x from Bnd; |
| 78 | ---Purpose: Transform the bounding box with the given transformation. |
| 79 | -- The resulting box will be larger if theTrsf contains rotation. |
| 80 | |
| 81 | IsOut (me; thePnt: XYZ from gp) |
| 82 | returns Boolean from Standard; |
| 83 | ---Purpose: Check the given point for the inclusion in the Box. |
| 84 | -- Returns True if the point is outside. |
| 85 | ---C++: inline |
| 86 | |
| 87 | IsOut (me; theCenter : XYZ from gp; |
| 88 | theRadius : Real from Standard; |
| 89 | isSphereHollow: Boolean from Standard = Standard_False) |
| 90 | returns Boolean from Standard; |
| 91 | ---Purpose: Check a sphere for the intersection with the current box. |
| 92 | -- Returns True if there is no intersection between boxes. If the |
| 93 | -- parameter 'IsSphereHollow' is True, then the intersection is not |
| 94 | -- reported for a box that is completely inside the sphere (otherwise |
| 95 | -- this method would report an intersection). |
| 96 | |
| 97 | IsOut (me; theOtherBox: B3x from Bnd) |
| 98 | returns Boolean from Standard; |
| 99 | ---Purpose: Check the given box for the intersection with the current box. |
| 100 | -- Returns True if there is no intersection between boxes. |
| 101 | ---C++: inline |
| 102 | |
| 103 | IsOut (me; theOtherBox: B3x from Bnd; theTrsf: Trsf from gp) |
| 104 | returns Boolean from Standard; |
| 105 | ---Purpose: Check the given box oriented by the given transformation |
| 106 | -- for the intersection with the current box. |
| 107 | -- Returns True if there is no intersection between boxes. |
| 108 | |
| 109 | IsOut (me; theLine : Ax1 from gp; |
| 110 | isRay : Boolean from Standard = Standard_False; |
| 111 | theOverthickness : Real from Standard = 0.0) |
| 112 | returns Boolean from Standard; |
| 113 | ---Purpose: Check the given Line for the intersection with the current box. |
| 114 | -- Returns True if there is no intersection. |
| 115 | -- isRay==True means intersection check with the positive half-line |
| 116 | -- theOverthickness is the addition to the size of the current box |
| 117 | -- (may be negative). If positive, it can be treated as the thickness |
| 118 | -- of the line 'theLine' or the radius of the cylinder along 'theLine' |
| 119 | |
| 120 | IsOut (me; thePlane: Ax3 from gp) |
| 121 | returns Boolean from Standard; |
| 122 | ---Purpose: Check the given Plane for the intersection with the current box. |
| 123 | -- Returns True if there is no intersection. |
| 124 | |
| 125 | IsIn (me; theBox: B3x from Bnd) |
| 126 | returns Boolean from Standard; |
| 127 | ---Purpose: Check that the box 'this' is inside the given box 'theBox'. Returns |
| 128 | -- True if 'this' box is fully inside 'theBox'. |
| 129 | ---C++: inline |
| 130 | |
| 131 | IsIn (me; theBox: B3x from Bnd; theTrsf: Trsf from gp) |
| 132 | returns Boolean from Standard; |
| 133 | ---Purpose: Check that the box 'this' is inside the given box 'theBox' |
| 134 | -- transformed by 'theTrsf'. Returns True if 'this' box is fully |
| 135 | -- inside the transformed 'theBox'. |
| 136 | |
| 137 | SetCenter (me: in out; theCenter: XYZ from gp); |
| 138 | ---Purpose: Set the Center coordinates |
| 139 | ---C++: inline |
| 140 | |
| 141 | SetHSize (me: in out; theHSize: XYZ from gp); |
| 142 | ---Purpose: Set the HSize (half-diagonal) coordinates. |
| 143 | -- All components of theHSize must be non-negative. |
| 144 | ---C++: inline |
| 145 | |
| 146 | fields |
| 147 | |
| 148 | myCenter : RealType[3] is protected; |
| 149 | myHSize : RealType[3] is protected; |
| 150 | |
| 151 | end B3x from Bnd; |