1 -- File: Select3D_SensitiveSegment.cdl
2 -- Created: Tue Jan 24 13:49:15 1995
5 ---Copyright: Matra Datavision 1995
8 class SensitiveSegment from Select3D
9 inherits SensitiveEntity from Select3D
11 ---Purpose: A framework to define sensitive zones along a segment
12 -- One gives the 3D start and end point;
13 -- the maximum number of 2D boxes given
14 -- by this entity may be set by the user
15 -- if the projected segment is
16 -- vertical or horizontal, one needs only 1 box.
17 -- for a pi/4 angle -> MaxNumber 2D boxes
22 Projector from Select3D,
24 EntityOwner from SelectBasics,
25 ListOfBox2d from SelectBasics,
26 Array1OfPnt2d from TColgp,
36 Create (OwnerId : EntityOwner from SelectBasics;
37 FirstP,LastP : Pnt from gp;
38 MaxRect : Integer = 1)
39 returns mutable SensitiveSegment;
40 ---Purpose: Constructs the sensitive segment object defined by
41 -- the owner OwnerId, the points FirstP, LastP and the
42 -- maximum number of sensitive bounding boxes MaxRect.
44 Set (me:mutable; MaxRect : Integer) is static;
45 ---Purpose: Sets the maximum number of sensitive rectangles MaxRect.
50 StartPoint (me : mutable ; aPt : Pnt from gp) is static;
52 ---Purpose: changes the start Point of the Segment;
57 EndPoint (me : mutable ; aPt : Pnt from gp) is static;
59 ---Purpose: changes the end point of the segment
63 StartPoint (me) returns Pnt from gp is static;
65 ---Purpose: gives the 3D start Point of the Segment
69 EndPoint(me) returns Pnt from gp is static;
71 ---Purpose: gives the 3D End Point of the Segment
74 StartPoint2d (me) returns Pnt2d from gp is static;
76 ---Purpose: gives the 3D start Point of the Segment
80 EndPoint2d(me) returns Pnt2d from gp is static;
82 ---Purpose: gives the 3D End Point of the Segment
85 Project (me:mutable;aProjector : Projector from Select3D)
88 ---Purpose: projection of the sensitive primitive in order to
89 -- get 2D boxes for the Sort Algorithm
92 Areas (me:mutable ; boxes : in out ListOfBox2d from SelectBasics)
95 ---Purpose: gives the 2D boxes which represent the segment in the
96 -- selection process...
98 GetConnected(me:mutable;aLocation: Location from TopLoc)
99 returns SensitiveEntity from Select3D is redefined static;
102 X,Y : Real from Standard;
103 aTol: Real from Standard;
104 DMin: out Real from Standard)
108 ---Purpose: projection of the sensitive primitive in order to
109 -- get 2D boxes for the Sort Algorithm
111 Matches (me :mutable;
112 XMin,YMin,XMax,YMax : Real from Standard;
113 aTol: Real from Standard)
117 Matches (me :mutable;
118 Polyline:Array1OfPnt2d from TColgp;
120 aTol: Real from Standard)
122 is redefined virtual;
126 ComputeDepth(me;EyeLine: Lin from gp)
127 returns Real from Standard is redefined static;
129 MaxBoxes(me) returns Integer is redefined static;
131 ---Purpose:returns <mymaxrect>
134 Dump(me; S: in out OStream;FullDump : Boolean from Standard = Standard_True) is redefined virtual;
139 mystart : Pnt from Select3D;
140 myend : Pnt from Select3D;
142 myprojstart : Pnt2d from Select3D; -- computed at convert time
143 myprojend : Pnt2d from Select3D; -- computed at convert time
145 end SensitiveSegment;