| 1 | -- Created on: 1995-04-13 |
| 2 | -- Created by: Robert COUBLANC |
| 3 | -- Copyright (c) 1995-1999 Matra Datavision |
| 4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
| 5 | -- |
| 6 | -- The content of this file is subject to the Open CASCADE Technology Public |
| 7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
| 8 | -- except in compliance with the License. Please obtain a copy of the License |
| 9 | -- at http://www.opencascade.org and read it completely before using this file. |
| 10 | -- |
| 11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
| 12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
| 13 | -- |
| 14 | -- The Original Code and all software distributed under the License is |
| 15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
| 16 | -- Initial Developer hereby disclaims all such warranties, including without |
| 17 | -- limitation, any warranties of merchantability, fitness for a particular |
| 18 | -- purpose or non-infringement. Please see the License for the specific terms |
| 19 | -- and conditions governing the rights and limitations under the License. |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | class SensitiveBox from Select3D |
| 25 | inherits SensitiveEntity from Select3D |
| 26 | |
| 27 | ---Purpose: A framework to define selection by a sensitive box. |
| 28 | |
| 29 | uses |
| 30 | Pnt from gp, |
| 31 | Pnt2d from gp, |
| 32 | Box from Bnd, |
| 33 | Box2d from Bnd, |
| 34 | Projector from Select3D, |
| 35 | Lin from gp, |
| 36 | EntityOwner from SelectBasics, |
| 37 | ListOfBox2d from SelectBasics, |
| 38 | PickArgs from SelectBasics, |
| 39 | Array1OfPnt2d from TColgp, |
| 40 | Location from TopLoc |
| 41 | |
| 42 | is |
| 43 | |
| 44 | |
| 45 | Create (OwnerId : EntityOwner from SelectBasics; |
| 46 | BoundingBox : Box from Bnd) |
| 47 | returns mutable SensitiveBox; |
| 48 | ---Purpose: Constructs a sensitive box object defined by the |
| 49 | -- owner OwnerId, and the bounding box BoundingBox. |
| 50 | Create (OwnerId : EntityOwner from SelectBasics; |
| 51 | XMin,YMin,ZMin, |
| 52 | XMax,YMax,ZMax : Real) |
| 53 | returns mutable SensitiveBox; |
| 54 | --- Purpose: Constructs a sensitive box object defined by the |
| 55 | -- owner OwnerId, and the coordinates Xmin, YMin, ZMin, XMax, YMax, ZMax. |
| 56 | -- Xmin, YMin and ZMin define the minimum point in |
| 57 | -- the front lower left hand corner of the box, |
| 58 | -- and XMax, YMax and ZMax define the maximum |
| 59 | -- point in the back upper right hand corner of the box. |
| 60 | |
| 61 | Project (me:mutable;aProjector : Projector from Select3D) |
| 62 | is redefined static; |
| 63 | ---Level: Public |
| 64 | ---Purpose: projection of the sensitive primitive in order to |
| 65 | -- get 2D boxes for the Sort Algorithm |
| 66 | |
| 67 | Areas (me:mutable ; boxes : in out ListOfBox2d from SelectBasics) |
| 68 | is redefined static; |
| 69 | ---Level: Public |
| 70 | ---Purpose: gives the 2D boxes which represent the Box in the |
| 71 | -- selection process... |
| 72 | |
| 73 | GetConnected(me:mutable;aLocation: Location from TopLoc) |
| 74 | returns SensitiveEntity from Select3D is redefined static; |
| 75 | |
| 76 | Matches (me : mutable; |
| 77 | thePickArgs : PickArgs from SelectBasics; |
| 78 | theMatchDMin, theMatchDepth : out Real from Standard) |
| 79 | returns Boolean is redefined static; |
| 80 | ---Level: Public |
| 81 | ---Purpose: Checks whether the sensitive entity matches the picking |
| 82 | -- detection area (close to the picking line). |
| 83 | -- For details please refer to base class declaration. |
| 84 | |
| 85 | Matches (me :mutable; |
| 86 | XMin,YMin,XMax,YMax : Real from Standard; |
| 87 | aTol: Real from Standard) |
| 88 | returns Boolean is redefined static; |
| 89 | |
| 90 | Matches (me :mutable; |
| 91 | Polyline:Array1OfPnt2d from TColgp; |
| 92 | aBox:Box2d from Bnd; |
| 93 | aTol: Real from Standard) |
| 94 | returns Boolean |
| 95 | is redefined virtual; |
| 96 | ---Level: Public |
| 97 | |
| 98 | |
| 99 | ComputeDepth(me;EyeLine: Lin from gp) |
| 100 | returns Real from Standard; |
| 101 | |
| 102 | Dump(me; S: in out OStream;FullDump : Boolean from Standard = Standard_True) is redefined virtual; |
| 103 | |
| 104 | Box(me) returns Box from Bnd; |
| 105 | ---Purpose: Returns the sensitive 3D box used at the time of construction. |
| 106 | ---C++: inline |
| 107 | ---C++: return const & |
| 108 | |
| 109 | |
| 110 | ProjectBox(me:mutable;aPrj: Projector from Select3D;aBox:Box from Bnd) |
| 111 | is static private; |
| 112 | |
| 113 | fields |
| 114 | |
| 115 | mybox3d : Box from Bnd; |
| 116 | mybox2d : Box2d from Bnd; |
| 117 | |
| 118 | end SensitiveBox; |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |