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 EntityOwner from SelectMgr,
34 Projector from Select3D,
36 Structure from Graphic3d,
37 SetOfHClipPlane from Graphic3d,
38 Array1OfReal from TColStd,
39 Array1OfPnt2d from TColgp,
40 SensitivityMode from StdSelect,
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.
50 Convert(me:mutable;aSelection:mutable Selection from SelectMgr)
53 ---Purpose: Processes the projection of the sensitive primitives
54 -- in the active view ; to be done before the selection action...
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.
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.
67 SensitivityMode(me) returns SensitivityMode from StdSelect;
69 ---Purpose: Returns the selection sensitivity mode.
71 SetPixelTolerance(me : mutable;
72 aTolerance : Integer) is static;
73 ---Purpose: Sets the pixel tolerance aTolerance.
75 PixelTolerance(me) returns Integer from Standard;
77 ---Purpose: Returns the pixel tolerance.
80 Pick (me : mutable;XPix,YPix:Integer;
81 aView : View from V3d) is static;
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.
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.
92 Pick (me:mutable;Polyline:Array1OfPnt2d from TColgp;aView:View from V3d) is static;
94 ---Purpose: pick action - input pixel values for polyline selection for selection.
99 ---Category: Inquire Methods
101 Projector (me) returns Projector from Select3D;
103 ---Purpose: Returns the current Projector.
105 ---C++: return const&
109 ---Category: Internal Methods
112 UpdateProj(me :mutable;
113 aView: View from V3d) returns Boolean is static private;
117 DisplayAreas(me :mutable;
118 aView: View from V3d) is static;
119 ---Purpose: Displays sensitive areas found in the view aView.
121 ClearAreas (me :mutable;
122 aView: View from V3d) is static;
123 ---Purpose: Clears the view aView of sensitive areas found in it.
125 DisplaySensitive(me:mutable;aView : View from V3d) is static;
127 --- Purpose: Displays the selection aSel found in the view aView.
129 ClearSensitive(me:mutable;aView:View from V3d) is static;
134 DisplaySensitive(me:mutable;
135 aSel : Selection from SelectMgr;
136 aView : View from V3d;
137 ClearOthers : Boolean from Standard = Standard_True)
140 DisplayAreas(me:mutable;
141 aSel :Selection from SelectMgr;
142 aView : View from V3d;
143 ClearOthers : Boolean from Standard = Standard_True)
147 ComputeSensitivePrs(me:mutable;aSel: Selection from SelectMgr)
151 ComputeAreasPrs(me:mutable;aSel:Selection from SelectMgr)
155 SetClipping (me : mutable; thePlanes : SetOfHClipPlane from Graphic3d) is protected;
157 ---Purpose: Set view clipping for the selector.
158 -- @param thePlanes [in] the view planes.
160 ComputeClipRange (me; thePlanes : SetOfHClipPlane from Graphic3d;
161 thePickLine : Lin from gp;
162 theDepthMin, theDepthMax : out Real from Standard)
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.
171 PickingLine (me; theX, theY : Real from Standard)
173 is redefined protected;
175 ---Purpose: For more details please refer to base class.
177 DepthClipping (me; theX, theY : Real from Standard;
178 theMin, theMax : out Real from Standard)
179 is redefined protected;
181 ---Purpose: For more details please refer to base class.
183 DepthClipping (me; theX, theY : Real from Standard;
184 theOwner : EntityOwner from SelectMgr;
185 theMin, theMax : out Real from Standard)
186 is redefined protected;
188 ---Purpose: For more details please refer to base class.
190 HasDepthClipping (me; theOwner : EntityOwner from SelectMgr)
191 returns Boolean is redefined protected;
193 ---Purpose: For more details please refer to base class.
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;
205 myupdatetol : Boolean;
208 --areas verification...
210 myareagroup : Group from Graphic3d;
211 mysensgroup : Group from Graphic3d;
212 mystruct: Structure from Graphic3d;
213 myClipPlanes : SetOfHClipPlane from Graphic3d;
215 end ViewerSelector3d;