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
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.
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.
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.
21 -- Modified by rob jun 25 98 : Add Method : Reactivate projector...
25 class ViewerSelector3d from StdSelect inherits ViewerSelector from SelectMgr
27 ---Purpose: Selector Usable by Viewers from V3d
32 Selection from SelectMgr,
33 Projector from Select3D,
35 Structure from Graphic3d,
36 Array1OfReal from TColStd,
37 Array1OfPnt2d from TColgp,
38 SensitivityMode from StdSelect
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.
47 Convert(me:mutable;aSelection:mutable Selection from SelectMgr)
50 ---Purpose: Processes the projection of the sensitive primitives
51 -- in the active view ; to be done before the selection action...
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.
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.
64 SensitivityMode(me) returns SensitivityMode from StdSelect;
66 ---Purpose: Returns the selection sensitivity mode.
68 SetPixelTolerance(me : mutable;
69 aTolerance : Integer) is static;
70 ---Purpose: Sets the pixel tolerance aTolerance.
72 PixelTolerance(me) returns Integer from Standard;
74 ---Purpose: Returns the pixel tolerance.
77 Pick (me : mutable;XPix,YPix:Integer;
78 aView : View from V3d) is static;
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.
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.
89 Pick (me:mutable;Polyline:Array1OfPnt2d from TColgp;aView:View from V3d) is static;
91 ---Purpose: pick action - input pixel values for polyline selection for selection.
96 ---Category: Inquire Methods
98 Projector (me) returns Projector from Select3D;
100 ---Purpose: Returns the current Projector.
102 ---C++: return const&
106 ---Category: Internal Methods
109 ReactivateProjector(me:mutable);
111 ---Purpose: Puts back the address of the current projector in sensitive primitives...
113 UpdateProj(me :mutable;
114 aView: View from V3d) returns Boolean is static private;
118 DisplayAreas(me :mutable;
119 aView: View from V3d) is static;
120 ---Purpose: Displays sensitive areas found in the view aView.
122 ClearAreas (me :mutable;
123 aView: View from V3d) is static;
124 ---Purpose: Clears the view aView of sensitive areas found in it.
126 DisplaySensitive(me:mutable;aView : View from V3d) is static;
128 --- Purpose: Displays the selection aSel found in the view aView.
130 ClearSensitive(me:mutable;aView:View from V3d) is static;
135 DisplaySensitive(me:mutable;
136 aSel : Selection from SelectMgr;
137 aView : View from V3d;
138 ClearOthers : Boolean from Standard = Standard_True)
141 DisplayAreas(me:mutable;
142 aSel :Selection from SelectMgr;
143 aView : View from V3d;
144 ClearOthers : Boolean from Standard = Standard_True)
148 ComputeSensitivePrs(me:mutable;aSel: Selection from SelectMgr)
152 ComputeAreasPrs(me:mutable;aSel:Selection from SelectMgr)
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;
169 myupdatetol : Boolean;
172 --areas verification...
174 myareagroup : Group from Graphic3d;
175 mysensgroup : Group from Graphic3d;
176 mystruct: Structure from Graphic3d;
179 end ViewerSelector3d;