0024157: Parallelization of assembly part of BO
[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     EntityOwner from SelectMgr,
34     Projector from Select3D,
35     Group     from Graphic3d,
36     Structure from Graphic3d,
37     SetOfHClipPlane from Graphic3d,
38     Array1OfReal    from TColStd, 
39     Array1OfPnt2d from TColgp,
40     SensitivityMode from StdSelect,
41     Lin from gp
42
43 is
44
45     Create  returns mutable ViewerSelector3d from StdSelect;
46         ---Purpose: Constructs an empty 3D selector object.
47     Create(aProj : Projector from Select3D) returns mutable ViewerSelector3d from StdSelect;
48         ---Purpose: Constructs a 3D selector object defined by the projector aProj. 
49
50     Convert(me:mutable;aSelection:mutable Selection from SelectMgr)
51     is redefined static;
52         ---Level: Public 
53         ---Purpose: Processes the projection of the sensitive  primitives
54         --          in the active view ; to be done before the selection action...
55
56
57     Set(me:mutable; aProj: Projector from Select3D) is static;
58         ---Purpose: Sets the new projector aProj to replace the one used at construction time.
59     
60
61     SetSensitivityMode(me    : mutable;
62                        aMode : SensitivityMode from StdSelect) is static;
63         ---Purpose: Sets the selection sensitivity mode. SM_WINDOW mode
64         -- uses the specified pixel tolerance to compute the sensitivity
65         -- value, SM_VIEW mode allows to define the sensitivity manually.
66
67     SensitivityMode(me) returns SensitivityMode from StdSelect;
68         ---C++: inline
69         ---Purpose: Returns the selection sensitivity mode.
70
71     SetPixelTolerance(me         : mutable;
72                       aTolerance : Integer) is static;
73         ---Purpose: Sets the pixel tolerance aTolerance.
74
75     PixelTolerance(me) returns Integer from Standard;
76         ---C++: inline
77         ---Purpose: Returns the pixel tolerance.
78
79
80     Pick (me           : mutable;XPix,YPix:Integer;
81           aView        : View from V3d) is static;
82         ---Level: Public 
83         ---Purpose: Picks the sensitive entity at the pixel coordinates of
84         -- the mouse Xpix and Ypix.   The selector looks for touched areas and owners.
85
86
87     Pick (me:mutable;XPMin,YPMin,XPMax,YPMax:Integer;aView:View from V3d) is static;
88         ---Purpose: Picks the sensitive entity according to the minimum
89         -- and maximum pixel values XPMin, YPMin, XPMax
90         -- and YPMax   defining a 2D area for selection in the 3D view aView.
91         
92     Pick (me:mutable;Polyline:Array1OfPnt2d from TColgp;aView:View from V3d) is static;
93         ---Level: Public 
94         ---Purpose: pick action  - input pixel values for polyline selection for selection.
95
96
97
98
99     ---Category: Inquire Methods
100
101     Projector (me) returns Projector from Select3D;
102         ---Level: Public 
103         ---Purpose: Returns the current Projector.
104         ---C++: inline
105         ---C++: return const&
106
107
108
109     ---Category: Internal Methods
110     --           -----------------
111
112     UpdateProj(me   :mutable;
113                aView: View from V3d) returns Boolean is static private;
114         ---Level: Internal 
115
116
117     DisplayAreas(me   :mutable;
118                  aView: View from V3d) is static;
119         ---Purpose: Displays sensitive areas found in the view aView.
120
121     ClearAreas (me   :mutable;
122                 aView: View from V3d) is static;
123         ---Purpose: Clears the view aView of sensitive areas found in it.
124     
125     DisplaySensitive(me:mutable;aView : View from V3d) is static; 
126   
127         --- Purpose: Displays the selection aSel found in the view aView.
128         
129     ClearSensitive(me:mutable;aView:View from V3d) is static;
130
131
132
133
134     DisplaySensitive(me:mutable;
135                      aSel        : Selection from SelectMgr;
136                      aView       : View from V3d;
137                      ClearOthers : Boolean from Standard = Standard_True)
138     is static;
139     
140     DisplayAreas(me:mutable;
141                  aSel        :Selection from SelectMgr;
142                  aView       : View from V3d;
143                  ClearOthers : Boolean from Standard = Standard_True)
144     is static;
145     
146     
147     ComputeSensitivePrs(me:mutable;aSel: Selection from SelectMgr)
148     is static private;
149         ---Level: Internal 
150
151     ComputeAreasPrs(me:mutable;aSel:Selection from SelectMgr)
152      is static private;
153         ---Level: Internal 
154
155     SetClipping (me : mutable; thePlanes : SetOfHClipPlane from Graphic3d) is protected;
156     ---Level: Internal
157     ---Purpose: Set view clipping for the selector.
158     -- @param thePlanes [in] the view planes.
159
160     ComputeClipRange (me; thePlanes : SetOfHClipPlane from Graphic3d;
161                       thePickLine : Lin from gp;
162                       theDepthMin, theDepthMax : out Real from Standard)
163       is protected;
164     ---Level: Internal
165     ---Purpose: Computed depth boundaries for the passed set of clipping planes and picking line.
166     -- @param thePlanes [in] the planes.
167     -- @param thePickLine [in] the picking line.
168     -- @param theDepthMin [out] minimum depth limit.
169     -- @param theDepthMax [out] maximum depth limit.
170
171     PickingLine (me; theX, theY : Real from Standard)
172       returns Lin from gp
173       is redefined protected;
174     ---Level: Internal
175     ---Purpose: For more details please refer to base class.
176
177     DepthClipping (me; theX, theY : Real from Standard;
178                    theMin, theMax : out Real from Standard)
179       is redefined protected;
180     ---Level: Internal
181     ---Purpose: For more details please refer to base class.
182
183     DepthClipping (me; theX, theY : Real from Standard;
184                    theOwner : EntityOwner from SelectMgr;
185                    theMin, theMax : out Real from Standard)
186       is redefined protected;
187     ---Level: Internal
188     ---Purpose: For more details please refer to base class.
189
190     HasDepthClipping (me; theOwner : EntityOwner from SelectMgr)
191       returns Boolean is redefined protected;
192     ---Level: Internal
193     ---Purpose: For more details please refer to base class.
194     
195 fields
196
197     myprj         : Projector    from Select3D;
198     mycoeff       : Real from Standard[14];
199     myprevcoeff   : Real from Standard[14];
200     mycenter      : Real from Standard[2];
201     myprevcenter  : Real from Standard[2];
202     mylastzoom    : Real from Standard;
203     mysensmode    : SensitivityMode from StdSelect;
204     mypixtol      : Integer ;
205     myupdatetol   : Boolean;
206     
207     
208              --areas verification...
209
210     myareagroup : Group            from Graphic3d;
211     mysensgroup : Group            from Graphic3d;
212     mystruct: Structure        from Graphic3d;
213     myClipPlanes : SetOfHClipPlane from Graphic3d;
214
215 end ViewerSelector3d;
216
217
218