0023012: Detection gives incorrect results
[occt.git] / src / StdSelect / StdSelect_ViewerSelector3d.cdl
1 -- Created on: 1995-03-15
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 -- Modified by rob jun 25 98 : Add Method : Reactivate projector...             
22
23
24
25 class ViewerSelector3d from StdSelect inherits ViewerSelector from SelectMgr
26
27         ---Purpose: Selector Usable by Viewers from V3d 
28         --          
29
30 uses
31     View      from V3d,
32     Selection from SelectMgr,
33     Projector from Select3D,
34     Group     from Graphic3d,
35     Structure from Graphic3d,
36     Array1OfReal    from TColStd, 
37     Array1OfPnt2d from TColgp,
38     SensitivityMode from StdSelect
39
40 is
41
42     Create  returns mutable ViewerSelector3d from StdSelect;
43         ---Purpose: Constructs an empty 3D selector object.
44     Create(aProj : Projector from Select3D) returns mutable ViewerSelector3d from StdSelect;
45         ---Purpose: Constructs a 3D selector object defined by the projector aProj. 
46
47     Convert(me:mutable;aSelection:mutable Selection from SelectMgr)
48     is redefined static;
49         ---Level: Public 
50         ---Purpose: Processes the projection of the sensitive  primitives
51         --          in the active view ; to be done before the selection action...
52
53
54     Set(me:mutable; aProj: Projector from Select3D) is static;
55         ---Purpose: Sets the new projector aProj to replace the one used at construction time.
56     
57
58     SetSensitivityMode(me    : mutable;
59                        aMode : SensitivityMode from StdSelect) is static;
60         ---Purpose: Sets the selection sensitivity mode. SM_WINDOW mode
61         -- uses the specified pixel tolerance to compute the sensitivity
62         -- value, SM_VIEW mode allows to define the sensitivity manually.
63
64     SensitivityMode(me) returns SensitivityMode from StdSelect;
65         ---C++: inline
66         ---Purpose: Returns the selection sensitivity mode.
67
68     SetPixelTolerance(me         : mutable;
69                       aTolerance : Integer) is static;
70         ---Purpose: Sets the pixel tolerance aTolerance.
71
72     PixelTolerance(me) returns Integer from Standard;
73         ---C++: inline
74         ---Purpose: Returns the pixel tolerance.
75
76
77     Pick (me           : mutable;XPix,YPix:Integer;
78           aView        : View from V3d) is static;
79         ---Level: Public 
80         ---Purpose: Picks the sensitive entity at the pixel coordinates of
81         -- the mouse Xpix and Ypix.   The selector looks for touched areas and owners.
82
83
84     Pick (me:mutable;XPMin,YPMin,XPMax,YPMax:Integer;aView:View from V3d) is static;
85         ---Purpose: Picks the sensitive entity according to the minimum
86         -- and maximum pixel values XPMin, YPMin, XPMax
87         -- and YPMax   defining a 2D area for selection in the 3D view aView.
88         
89     Pick (me:mutable;Polyline:Array1OfPnt2d from TColgp;aView:View from V3d) is static;
90         ---Level: Public 
91         ---Purpose: pick action  - input pixel values for polyline selection for selection.
92
93
94
95
96     ---Category: Inquire Methods
97
98     Projector (me) returns Projector from Select3D;
99         ---Level: Public 
100         ---Purpose: Returns the current Projector.
101         ---C++: inline
102         ---C++: return const&
103
104
105
106     ---Category: Internal Methods
107     --           -----------------
108
109     ReactivateProjector(me:mutable);
110         ---Level: Internal 
111         ---Purpose: Puts back the address of the current projector in sensitive primitives...
112
113     UpdateProj(me   :mutable;
114                aView: View from V3d) returns Boolean is static private;
115         ---Level: Internal 
116
117
118     DisplayAreas(me   :mutable;
119                  aView: View from V3d) is static;
120         ---Purpose: Displays sensitive areas found in the view aView.
121
122     ClearAreas (me   :mutable;
123                 aView: View from V3d) is static;
124         ---Purpose: Clears the view aView of sensitive areas found in it.
125     
126     DisplaySensitive(me:mutable;aView : View from V3d) is static; 
127   
128         --- Purpose: Displays the selection aSel found in the view aView.
129         
130     ClearSensitive(me:mutable;aView:View from V3d) is static;
131
132
133
134
135     DisplaySensitive(me:mutable;
136                      aSel        : Selection from SelectMgr;
137                      aView       : View from V3d;
138                      ClearOthers : Boolean from Standard = Standard_True)
139     is static;
140     
141     DisplayAreas(me:mutable;
142                  aSel        :Selection from SelectMgr;
143                  aView       : View from V3d;
144                  ClearOthers : Boolean from Standard = Standard_True)
145     is static;
146     
147     
148     ComputeSensitivePrs(me:mutable;aSel: Selection from SelectMgr)
149     is static private;
150         ---Level: Internal 
151
152     ComputeAreasPrs(me:mutable;aSel:Selection from SelectMgr)
153      is static private;
154         ---Level: Internal 
155
156         
157
158
159 fields
160
161     myprj         : Projector    from Select3D;
162     mycoeff       : Real from Standard[14];
163     myprevcoeff   : Real from Standard[14];
164     mycenter      : Real from Standard[2];
165     myprevcenter  : Real from Standard[2];
166     mylastzoom    : Real from Standard;
167     mysensmode    : SensitivityMode from StdSelect;
168     mypixtol      : Integer ;
169     myupdatetol   : Boolean;
170     
171     
172              --areas verification...
173
174     myareagroup : Group            from Graphic3d;
175     mysensgroup : Group            from Graphic3d;
176     mystruct: Structure        from Graphic3d;
177
178     
179 end ViewerSelector3d;
180
181
182