b311480e |
1 | -- Created on: 1995-03-15 |
2 | -- Created by: Robert COUBLANC |
3 | -- Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | -- by the Free Software Foundation, with special exception defined in the file |
11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
b311480e |
16 | |
197ac94e |
17 | -- Modified by rob jun 25 98 : Add Method : Reactivate projector... |
7fd59977 |
18 | |
19 | class ViewerSelector3d from StdSelect inherits ViewerSelector from SelectMgr |
20 | |
197ac94e |
21 | ---Purpose: Selector Usable by Viewers from V3d |
ff8178ef |
22 | -- Accepts Only Sensitive Entities inheriting Select3D entities... |
7fd59977 |
23 | |
24 | uses |
51b10cd4 |
25 | View from V3d, |
26 | Selection from SelectMgr, |
27 | EntityOwner from SelectMgr, |
28 | Projector from Select3D, |
29 | Group from Graphic3d, |
30 | Structure from Graphic3d, |
31 | SequenceOfHClipPlane from Graphic3d, |
32 | Array1OfReal from TColStd, |
33 | Array1OfPnt2d from TColgp, |
34 | SensitivityMode from StdSelect, |
197ac94e |
35 | Lin from gp, |
36 | Pnt from gp, |
37 | Dir from gp, |
38 | XYZ from gp |
7fd59977 |
39 | |
40 | is |
41 | |
6e33d3ce |
42 | Create returns ViewerSelector3d from StdSelect; |
197ac94e |
43 | ---Purpose: Constructs an empty 3D selector object. |
7fd59977 |
44 | |
6e33d3ce |
45 | Create (theProj : Projector from Select3D) returns ViewerSelector3d from StdSelect; |
197ac94e |
46 | ---Purpose: Constructs a 3D selector object defined by the projector <theProj>. |
47 | |
6e33d3ce |
48 | Convert (me : mutable; theSel : Selection from SelectMgr) |
7fd59977 |
49 | is redefined static; |
197ac94e |
50 | ---Level: Public |
51 | ---Purpose: Processes the projection of the sensitive primitives |
52 | -- in the active view ; to be done before the selection action... |
7fd59977 |
53 | |
197ac94e |
54 | Set (me : mutable; theProj : Projector from Select3D) is static; |
55 | ---Purpose: Sets the new projector <theProj> to replace the one used at construction time. |
7fd59977 |
56 | |
197ac94e |
57 | SetSensitivityMode (me : mutable; |
58 | theMode : SensitivityMode from StdSelect) is static; |
3c982548 |
59 | ---Purpose: Sets the selection sensitivity mode. SM_WINDOW mode |
60 | -- uses the specified pixel tolerance to compute the sensitivity |
61 | -- value, SM_VIEW mode allows to define the sensitivity manually. |
62 | |
197ac94e |
63 | SensitivityMode (me) returns SensitivityMode from StdSelect; |
3c982548 |
64 | ---C++: inline |
65 | ---Purpose: Returns the selection sensitivity mode. |
66 | |
197ac94e |
67 | SetPixelTolerance (me : mutable; |
68 | theTolerance : Integer) is static; |
69 | ---Purpose: Sets the pixel tolerance <theTolerance>. |
3c982548 |
70 | |
197ac94e |
71 | PixelTolerance (me) returns Integer from Standard; |
3c982548 |
72 | ---C++: inline |
73 | ---Purpose: Returns the pixel tolerance. |
74 | |
197ac94e |
75 | Pick (me : mutable; theXPix, theYPix : Integer; |
76 | theView : View from V3d) is static; |
77 | ---Level: Public |
78 | ---Purpose: Picks the sensitive entity at the pixel coordinates of |
79 | -- the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners. |
7fd59977 |
80 | |
197ac94e |
81 | Pick (me : mutable; theXPMin, theYPMin, theXPMax, theYPMax : Integer; theView : View from V3d) is static; |
82 | ---Purpose: Picks the sensitive entity according to the minimum |
83 | -- and maximum pixel values <theXPMin>, <theYPMin>, <theXPMax> |
84 | -- and <theYPMax> defining a 2D area for selection in the 3D view aView. |
7fd59977 |
85 | |
197ac94e |
86 | Pick (me : mutable; thePolyline : Array1OfPnt2d from TColgp; theView : View from V3d) is static; |
87 | ---Level: Public |
88 | ---Purpose: pick action - input pixel values for polyline selection for selection. |
7fd59977 |
89 | |
90 | ---Category: Inquire Methods |
91 | |
92 | Projector (me) returns Projector from Select3D; |
197ac94e |
93 | ---Level: Public |
94 | ---Purpose: Returns the current Projector. |
95 | ---C++: inline |
96 | ---C++: return const& |
7fd59977 |
97 | |
98 | ---Category: Internal Methods |
99 | -- ----------------- |
100 | |
197ac94e |
101 | UpdateProj (me : mutable; |
102 | theView : View from V3d) returns Boolean is static private; |
103 | ---Level: Internal |
7fd59977 |
104 | |
197ac94e |
105 | DisplayAreas (me : mutable; |
106 | theView : View from V3d) is static; |
107 | ---Purpose: Displays sensitive areas found in the view <theView>. |
7fd59977 |
108 | |
197ac94e |
109 | ClearAreas (me : mutable; |
110 | theView : View from V3d) is static; |
111 | ---Purpose: Clears the view aView of sensitive areas found in it. |
7fd59977 |
112 | |
197ac94e |
113 | DisplaySensitive (me : mutable; theView : View from V3d) is static; |
114 | --- Purpose: Displays sensitives in view <theView>. |
7fd59977 |
115 | |
197ac94e |
116 | ClearSensitive (me : mutable; theView : View from V3d) is static; |
7fd59977 |
117 | |
197ac94e |
118 | DisplaySensitive (me : mutable; |
119 | theSel : Selection from SelectMgr; |
120 | theView : View from V3d; |
121 | theToClearOthers : Boolean from Standard = Standard_True) |
7fd59977 |
122 | is static; |
197ac94e |
123 | |
124 | DisplayAreas (me : mutable; |
125 | theSel : Selection from SelectMgr; |
126 | theView : View from V3d; |
127 | theToClearOthers : Boolean from Standard = Standard_True) |
7fd59977 |
128 | is static; |
197ac94e |
129 | |
130 | ComputeSensitivePrs (me : mutable; theSel: Selection from SelectMgr) |
7fd59977 |
131 | is static private; |
197ac94e |
132 | ---Level: Internal |
7fd59977 |
133 | |
197ac94e |
134 | ComputeAreasPrs (me : mutable; theSel : Selection from SelectMgr) |
135 | is static private; |
136 | ---Level: Internal |
7fd59977 |
137 | |
51b10cd4 |
138 | SetClipping (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d) is protected; |
4269bd1b |
139 | ---Level: Internal |
140 | ---Purpose: Set view clipping for the selector. |
141 | -- @param thePlanes [in] the view planes. |
142 | |
51b10cd4 |
143 | ComputeClipRange (me; thePlanes : SequenceOfHClipPlane from Graphic3d; |
4269bd1b |
144 | thePickLine : Lin from gp; |
145 | theDepthMin, theDepthMax : out Real from Standard) |
146 | is protected; |
147 | ---Level: Internal |
148 | ---Purpose: Computed depth boundaries for the passed set of clipping planes and picking line. |
149 | -- @param thePlanes [in] the planes. |
150 | -- @param thePickLine [in] the picking line. |
151 | -- @param theDepthMin [out] minimum depth limit. |
152 | -- @param theDepthMax [out] maximum depth limit. |
153 | |
154 | PickingLine (me; theX, theY : Real from Standard) |
155 | returns Lin from gp |
156 | is redefined protected; |
157 | ---Level: Internal |
158 | ---Purpose: For more details please refer to base class. |
159 | |
160 | DepthClipping (me; theX, theY : Real from Standard; |
161 | theMin, theMax : out Real from Standard) |
162 | is redefined protected; |
163 | ---Level: Internal |
164 | ---Purpose: For more details please refer to base class. |
165 | |
166 | DepthClipping (me; theX, theY : Real from Standard; |
167 | theOwner : EntityOwner from SelectMgr; |
168 | theMin, theMax : out Real from Standard) |
169 | is redefined protected; |
170 | ---Level: Internal |
171 | ---Purpose: For more details please refer to base class. |
172 | |
173 | HasDepthClipping (me; theOwner : EntityOwner from SelectMgr) |
174 | returns Boolean is redefined protected; |
175 | ---Level: Internal |
176 | ---Purpose: For more details please refer to base class. |
177 | |
7fd59977 |
178 | fields |
179 | |
197ac94e |
180 | myProjector : Projector from Select3D; |
181 | myPrevAt : Real from Standard[3]; |
182 | myPrevUp : Real from Standard[3]; |
183 | myPrevProj : Real from Standard[3]; |
184 | myPrevAxialScale : Real from Standard[3]; |
185 | myPrevFOV : Real from Standard; |
186 | myPrevScale : Real from Standard; |
187 | myPrevOrthographic : Boolean from Standard; |
188 | mySensMode : SensitivityMode from StdSelect; |
189 | myPixelTolerance : Integer from Standard; |
190 | myToUpdateTolerance : Boolean from Standard; |
191 | |
192 | --areas verification... |
7fd59977 |
193 | |
51b10cd4 |
194 | myareagroup : Group from Graphic3d; |
195 | mysensgroup : Group from Graphic3d; |
196 | mystruct : Structure from Graphic3d; |
197 | myClipPlanes : SequenceOfHClipPlane from Graphic3d; |
7fd59977 |
198 | |
7fd59977 |
199 | end ViewerSelector3d; |