Free Electron
windowAS.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __window_windowAS_h__
8 #define __window_windowAS_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /// general selection/picking
16 class AsSelect :
17  public AccessorSet,
18  public Initialize<AsSelect>
19 {
20  public:
21  void initialize(void)
22  {
23  add(selecting, FE_USE("sel:selecting"));
24  add(marked, FE_USE("sel:marked"));
25  add(selected, FE_USE("sel:selected"));
26  }
27  /// state of selection (bits - 0: not 1: replace 2: add 4: mark only)
29  /// marked (mid selection) records
31  /// selected (post selection) records
33 };
34 
35 /// screen space selection
36 class AsSelection :
37  public AsSelect,
38  public Initialize<AsSelection>
39 {
40  public:
41  void initialize(void)
42  {
43  add(start, FE_USE("sel:start"));
44  add(end, FE_USE("sel:end"));
45  add(prev, FE_USE("sel:prev"));
46  }
47  /// 2D start point of selection box
49  /// 2D end point of selection box
51  /// 2D previous end point of selection box
53 
54 };
55 
56 /// world space selection
57 class AsPick :
58  public AsSelect,
59  public Initialize<AsPick>
60 {
61  public:
62  void initialize(void)
63  {
64  add(start, FE_USE("pick:start"));
65  add(end, FE_USE("pick:end"));
66  add(startv, FE_USE("pick:startv"));
67  add(endv, FE_USE("pick:endv"));
68  add(focus, FE_USE("pick:focus"));
69  }
70  /// 3D start point of selection
72  /// 3D direction of selection
74  /// 3D end point of selection
76  /// 3D end direction of selection
78  /// 3D point of focus
80 };
81 
82 /// color information
83 class FE_DL_EXPORT AsColor :
84  public AccessorSet,
85  public Initialize<AsColor>
86 {
87  public:
88  void initialize(void)
89  {
90  add(name, FE_USE("col:name"));
91  add(rgba, FE_USE("col:rgba"));
92  }
93  /// name
95  /// RGBA data
97 };
98 
99 /// UI selectable
101  public AccessorSet,
102  public Initialize<AsSelectable>
103 {
104  public:
105  void initialize(void)
106  {
107  add(is, FE_USE("sel:selectable"));
108  }
109  /// marker for being selected
111 };
112 
113 class AsSelParent :
114  public AccessorSet,
115  public Initialize<AsSelParent>
116 {
117  public:
118  void initialize(void)
119  {
120  add(is, FE_USE("sel:parent"));
121  add(group, FE_USE("sel:group"));
122  }
123  Accessor<void> is;
125 };
126 
127 
128 class AsSelWorldSphere :
129  public AccessorSet,
130  public Initialize<AsSelWorldSphere>
131 {
132  public:
133  void initialize(void)
134  {
135  add(is, FE_USE("sel:wld:sphere"));
136  add(location, FE_USE("spc:at"));
137  add(radius, FE_USE("bnd:radius"));
138  }
139  Accessor<void> is;
140  Accessor<SpatialVector> location;
141  Accessor<Real> radius;
142 };
143 
144 class AsSelWorldTriangle :
145  public AccessorSet,
146  public Initialize<AsSelWorldTriangle>
147 {
148  public:
149  void initialize(void)
150  {
151  add(is, FE_USE("sel:wld:tri"));
152  add(vertA, FE_USE("generic:v0"));
153  add(vertB, FE_USE("generic:v1"));
154  add(vertC, FE_USE("generic:v2"));
155  }
156  Accessor<void> is;
160 };
161 
162 class AsSelScreenTriangle :
163  public AccessorSet,
164  public Initialize<AsSelScreenTriangle>
165 {
166  public:
167  void initialize(void)
168  {
169  add(is, FE_USE("sel:scr:tri"));
170  add(vertA, FE_USE("generic:v0"));
171  add(vertB, FE_USE("generic:v1"));
172  add(vertC, FE_USE("generic:v2"));
173  }
174  Accessor<void> is;
178 };
179 
180 class AsDrawScreenTriangle :
181  public AccessorSet,
182  public Initialize<AsDrawScreenTriangle>
183 {
184  public:
185  void initialize(void)
186  {
187  add(is, FE_USE("draw:scr:tri"));
188  add(vertA, FE_USE("generic:v0"));
189  add(vertB, FE_USE("generic:v1"));
190  add(vertC, FE_USE("generic:v2"));
191  }
192  Accessor<void> is;
196 };
197 
198 
199 #if 0
200 class AsSelectableQuad :
201  public AccessorSet,
202  public Initialize<AsSelectable>
203 {
204  public:
205  void initialize(void)
206  {
207  add(vertA, FE_USE("generic:v0"));
208  add(vertB, FE_USE("generic:v1"));
209  add(vertC, FE_USE("generic:v2"));
210  add(vertD, FE_USE("generic:v3"));
211  }
212 };
213 
214 class AsSelectableRect :
215  public AccessorSet,
216  public Initialize<AsSelectable>
217 {
218  public:
219  void initialize(void)
220  {
221  add(vertLo, FE_USE("generic:v0"));
222  add(vertHi, FE_USE("generic:v1"));
223  }
224 };
225 
226 class AsSelectableExt :
227  public AccessorSet,
228  public Initialize<AsSelectable>
229 {
230  public:
231  void initialize(void)
232  {
233  add(data, FE_USE("generic:r"));
234  add(component, FE_USE("generic:c"));
235  }
236 };
237 #endif
238 
239 
240 
241 /// projected
242 class AsProjected :
243  public AccessorSet,
244  public Initialize<AsProjected>
245 {
246  public:
247  void initialize(void)
248  {
249  add(location, FE_USE("proj:location"));
250  }
251  /// marker for being selected
253 };
254 
255 
256 /// orthographic projection related
257 class AsOrtho :
258  public AccessorSet,
259  public Initialize<AsOrtho>
260 {
261  public:
262  void initialize(void)
263  {
264  add(zoom, FE_USE("ortho:zoom"));
265  add(center, FE_USE("ortho:center"));
266  }
267  /// zoom level
269  /// view center
271 };
272 
273 /// perspective projection related
275  public AccessorSet,
276  public Initialize<AsPerspective>
277 {
278  public:
279  void initialize(void)
280  {
281  add(matrix, FE_USE("persp:matrix"));
282  }
283  /// matrix (to be deprecated in favor of azimuth, incl, etc)
285 };
286 
287 
288 /** Callback signal wrapper.
289  Intended for use in dataui Handlers, following the following guidelines.
290 
291  If component is a SignalerI, then the callback signal is sent to the
292  signaler.
293 
294  Otherwise, if the component is a HandlerI, then the signal is sent directly
295  to the Handler. Note that this does not guaruntee that the HandlerI
296  has been bound to a SignalerI, so handlers that depend on being bound
297  may fail.
298  */
299 class AsCallback :
300  public AccessorSet,
301  public Initialize<AsCallback>
302 {
303  public:
304  void initialize(void)
305  {
306  add(component, FE_USE("cb:component"));
307  add(signal, FE_USE("cb:signal"));
308  }
309  /// signaler
311  /// signal
313 };
314 
315 
316 
317 } /* namespace ext */
318 } /* namespace fe */
319 
320 #endif /* __window_windowAS_h__ */
321 
UI selectable.
Definition: windowAS.h:100
Accessor< Record > signal
signal
Definition: windowAS.h:312
orthographic projection related
Definition: windowAS.h:257
Set of accessors.
Definition: AccessorSet.h:18
Accessor< Vector2 > center
view center
Definition: windowAS.h:270
Accessor< int > selecting
state of selection (bits - 0: not 1: replace 2: add 4: mark only)
Definition: windowAS.h:28
Accessor< Vector2 > start
2D start point of selection box
Definition: windowAS.h:48
Accessor< Real > zoom
zoom level
Definition: windowAS.h:268
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Accessor< Vector3 > startv
3D direction of selection
Definition: windowAS.h:73
Accessor< Vector3 > end
3D end point of selection
Definition: windowAS.h:75
world space selection
Definition: windowAS.h:57
Accessor< sp< RecordGroup > > selected
selected (post selection) records
Definition: windowAS.h:32
Accessor< Vector3 > start
3D start point of selection
Definition: windowAS.h:71
Accessor< Vector3 > endv
3D end direction of selection
Definition: windowAS.h:77
perspective projection related
Definition: windowAS.h:274
Accessor< Color > rgba
RGBA data.
Definition: windowAS.h:96
Accessor< void > is
marker for being selected
Definition: windowAS.h:110
const String & name(void) const
Return the components chosen name.
Definition: Component.h:77
Accessor< Vector3 > focus
3D point of focus
Definition: windowAS.h:79
general selection/picking
Definition: windowAS.h:16
color information
Definition: windowAS.h:83
Accessor< sp< RecordGroup > > marked
marked (mid selection) records
Definition: windowAS.h:30
Accessor< SpatialVector > location
marker for being selected
Definition: windowAS.h:252
Callback signal wrapper.
Definition: windowAS.h:299
Accessor< SpatialTransform > matrix
matrix (to be deprecated in favor of azimuth, incl, etc)
Definition: windowAS.h:284
Accessor< Vector2 > prev
2D previous end point of selection box
Definition: windowAS.h:52
Accessor< String > name
name
Definition: windowAS.h:94
Accessor< sp< Component > > component
signaler
Definition: windowAS.h:310
projected
Definition: windowAS.h:242
screen space selection
Definition: windowAS.h:36
Accessor< Vector2 > end
2D end point of selection box
Definition: windowAS.h:50