2 -- Created: Thu Sep 8 17:39:16 2005
3 -- Author: Alexander GRIGORIEV
4 -- <agv@opencascade.com>
5 ---Copyright: Open Cascade 2005
7 generic class B2x from Bnd (RealType as any)
16 Create returns B2x from Bnd;
17 ---Purpose: Empty constructor.
20 Create (theCenter: XY from gp; theHSize : XY from gp)
22 ---Purpose: Constructor.
26 returns Boolean from Standard;
27 ---Purpose: Returns True if the box is void (non-initialized).
31 ---Purpose: Reset the box data.
34 Add (me:in out; thePnt: XY from gp);
35 ---Purpose: Update the box by a point.
37 Add (me:in out; thePnt: Pnt2d from gp);
38 ---Purpose: Update the box by a point.
40 Add (me:in out; theBox: B2x from Bnd);
41 ---Purpose: Update the box by another box.
46 ---Purpose: Query a box corner: (Center - HSize). You must make sure that
47 -- the box is NOT VOID (see IsVoid()), otherwise the method returns
53 ---Purpose: Query a box corner: (Center + HSize). You must make sure that
54 -- the box is NOT VOID (see IsVoid()), otherwise the method returns
59 returns Real from Standard;
60 ---Purpose: Query the square diagonal. If the box is VOID (see method IsVoid())
61 -- then a very big real value is returned.
64 Enlarge (me:in out; theDiff: Real from Standard);
65 ---Purpose: Extend the Box by the absolute value of theDiff.
68 Limit (me:in out; theOtherBox: B2x from Bnd)
69 returns Boolean from Standard;
70 ---Purpose: Limit the Box by the internals of theOtherBox.
71 -- Returns True if the limitation takes place, otherwise False
72 -- indicating that the boxes do not intersect.
74 Transformed (me; theTrsf: Trsf2d from gp)
76 ---Purpose: Transform the bounding box with the given transformation.
77 -- The resulting box will be larger if theTrsf contains rotation.
79 IsOut (me; thePnt: XY from gp)
80 returns Boolean from Standard;
81 ---Purpose: Check the given point for the inclusion in the Box.
82 -- Returns True if the point is outside.
85 IsOut (me; theCenter : XY from gp;
86 theRadius : Real from Standard;
87 isCircleHollow: Boolean from Standard = Standard_False)
88 returns Boolean from Standard;
89 ---Purpose: Check a circle for the intersection with the current box.
90 -- Returns True if there is no intersection between boxes.
92 IsOut (me; theOtherBox: B2x from Bnd)
93 returns Boolean from Standard;
94 ---Purpose: Check the given box for the intersection with the current box.
95 -- Returns True if there is no intersection between boxes.
98 IsOut (me; theOtherBox: B2x from Bnd; theTrsf: Trsf2d from gp)
99 returns Boolean from Standard;
100 ---Purpose: Check the given box oriented by the given transformation
101 -- for the intersection with the current box.
102 -- Returns True if there is no intersection between boxes.
104 IsOut (me; theLine: Ax2d from gp)
105 returns Boolean from Standard;
106 ---Purpose: Check the given Line for the intersection with the current box.
107 -- Returns True if there is no intersection.
109 IsOut (me; theP0, theP1: XY from gp)
110 returns Boolean from Standard;
111 ---Purpose: Check the Segment defined by the couple of input points
112 -- for the intersection with the current box.
113 -- Returns True if there is no intersection.
115 IsIn (me; theBox: B2x from Bnd)
116 returns Boolean from Standard;
117 ---Purpose: Check that the box 'this' is inside the given box 'theBox'. Returns
118 -- True if 'this' box is fully inside 'theBox'.
121 IsIn (me; theBox: B2x from Bnd; theTrsf: Trsf2d from gp)
122 returns Boolean from Standard;
123 ---Purpose: Check that the box 'this' is inside the given box 'theBox'
124 -- transformed by 'theTrsf'. Returns True if 'this' box is fully
125 -- inside the transformed 'theBox'.
127 SetCenter (me: in out; theCenter: XY from gp);
128 ---Purpose: Set the Center coordinates
131 SetHSize (me: in out; theHSize: XY from gp);
132 ---Purpose: Set the HSize (half-diagonal) coordinates.
133 -- All components of theHSize must be non-negative.
139 myCenter : RealType[2] is protected;
140 myHSize : RealType[2] is protected;