b311480e |
1 | -- Created on: 1995-01-24 |
2 | -- Created by: Mister rmi |
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 | |
7fd59977 |
21 | |
22 | |
23 | class SensitiveSegment from Select3D |
24 | inherits SensitiveEntity from Select3D |
25 | |
26 | ---Purpose: A framework to define sensitive zones along a segment |
27 | -- One gives the 3D start and end point; |
28 | -- the maximum number of 2D boxes given |
29 | -- by this entity may be set by the user |
30 | -- if the projected segment is |
31 | -- vertical or horizontal, one needs only 1 box. |
32 | -- for a pi/4 angle -> MaxNumber 2D boxes |
33 | |
34 | uses |
35 | Pnt from gp, |
36 | Pnt2d from gp, |
37 | Projector from Select3D, |
38 | Lin from gp, |
39 | EntityOwner from SelectBasics, |
40 | ListOfBox2d from SelectBasics, |
41 | Array1OfPnt2d from TColgp, |
42 | Box2d from Bnd, |
43 | Location from TopLoc, |
44 | Pnt from Select3D, |
45 | Pnt2d from Select3D |
46 | |
47 | |
48 | is |
49 | |
50 | |
51 | Create (OwnerId : EntityOwner from SelectBasics; |
52 | FirstP,LastP : Pnt from gp; |
53 | MaxRect : Integer = 1) |
54 | returns mutable SensitiveSegment; |
55 | ---Purpose: Constructs the sensitive segment object defined by |
56 | -- the owner OwnerId, the points FirstP, LastP and the |
57 | -- maximum number of sensitive bounding boxes MaxRect. |
58 | |
59 | Set (me:mutable; MaxRect : Integer) is static; |
60 | ---Purpose: Sets the maximum number of sensitive rectangles MaxRect. |
61 | ---C++: inline |
62 | |
63 | |
64 | |
65 | StartPoint (me : mutable ; aPt : Pnt from gp) is static; |
66 | ---Level: Public |
67 | ---Purpose: changes the start Point of the Segment; |
68 | ---C++: inline |
69 | |
70 | |
71 | |
72 | EndPoint (me : mutable ; aPt : Pnt from gp) is static; |
73 | ---Level: Public |
74 | ---Purpose: changes the end point of the segment |
75 | ---C++: inline |
76 | |
77 | |
78 | StartPoint (me) returns Pnt from gp is static; |
79 | ---Level: Public |
80 | ---Purpose: gives the 3D start Point of the Segment |
81 | ---C++: inline |
82 | |
83 | |
84 | EndPoint(me) returns Pnt from gp is static; |
85 | ---Level: Public |
86 | ---Purpose: gives the 3D End Point of the Segment |
87 | ---C++: inline |
88 | |
89 | StartPoint2d (me) returns Pnt2d from gp is static; |
90 | ---Level: Public |
91 | ---Purpose: gives the 3D start Point of the Segment |
92 | ---C++: inline |
93 | |
94 | |
95 | EndPoint2d(me) returns Pnt2d from gp is static; |
96 | ---Level: Public |
97 | ---Purpose: gives the 3D End Point of the Segment |
98 | ---C++: inline |
99 | |
100 | Project (me:mutable;aProjector : Projector from Select3D) |
101 | is redefined virtual; |
102 | ---Level: Public |
103 | ---Purpose: projection of the sensitive primitive in order to |
104 | -- get 2D boxes for the Sort Algorithm |
105 | |
106 | |
107 | Areas (me:mutable ; boxes : in out ListOfBox2d from SelectBasics) |
108 | is redefined static; |
109 | ---Level: Public |
110 | ---Purpose: gives the 2D boxes which represent the segment in the |
111 | -- selection process... |
112 | |
113 | GetConnected(me:mutable;aLocation: Location from TopLoc) |
114 | returns SensitiveEntity from Select3D is redefined static; |
115 | |
116 | Matches(me :mutable; |
117 | X,Y : Real from Standard; |
118 | aTol: Real from Standard; |
119 | DMin: out Real from Standard) |
120 | returns Boolean |
121 | is redefined static; |
122 | ---Level: Public |
123 | ---Purpose: projection of the sensitive primitive in order to |
124 | -- get 2D boxes for the Sort Algorithm |
125 | |
126 | Matches (me :mutable; |
127 | XMin,YMin,XMax,YMax : Real from Standard; |
128 | aTol: Real from Standard) |
129 | returns Boolean |
130 | is static; |
131 | |
132 | Matches (me :mutable; |
133 | Polyline:Array1OfPnt2d from TColgp; |
134 | aBox:Box2d from Bnd; |
135 | aTol: Real from Standard) |
136 | returns Boolean |
137 | is redefined virtual; |
138 | ---Level: Public |
139 | |
140 | |
141 | ComputeDepth(me;EyeLine: Lin from gp) |
142 | returns Real from Standard is redefined static; |
143 | |
144 | MaxBoxes(me) returns Integer is redefined static; |
145 | ---Level: Public |
146 | ---Purpose:returns <mymaxrect> |
147 | ---C++: inline |
148 | |
149 | Dump(me; S: in out OStream;FullDump : Boolean from Standard = Standard_True) is redefined virtual; |
150 | |
151 | fields |
152 | |
153 | mymaxrect : Integer; |
154 | mystart : Pnt from Select3D; |
155 | myend : Pnt from Select3D; |
156 | |
157 | myprojstart : Pnt2d from Select3D; -- computed at convert time |
158 | myprojend : Pnt2d from Select3D; -- computed at convert time |
159 | |
160 | end SensitiveSegment; |
161 | |
162 | |
163 | |
164 | |
165 | |
166 | |
167 | |
168 | |