anatomist 6.0.4
3D neuroimaging data viewer
control3D.h
Go to the documentation of this file.
1/* This software and supporting documentation are distributed by
2 * Institut Federatif de Recherche 49
3 * CEA/NeuroSpin, Batiment 145,
4 * 91191 Gif-sur-Yvette cedex
5 * France
6 *
7 * This software is governed by the CeCILL-B license under
8 * French law and abiding by the rules of distribution of free software.
9 * You can use, modify and/or redistribute the software under the
10 * terms of the CeCILL-B license as circulated by CEA, CNRS
11 * and INRIA at the following URL "http://www.cecill.info".
12 *
13 * As a counterpart to the access to the source code and rights to copy,
14 * modify and redistribute granted by the license, users are provided only
15 * with a limited warranty and the software's author, the holder of the
16 * economic rights, and the successive licensors have only limited
17 * liability.
18 *
19 * In this respect, the user's attention is drawn to the risks associated
20 * with loading, using, modifying and/or developing or reproducing the
21 * software by the user in light of its specific status of free software,
22 * that may mean that it is complicated to manipulate, and that also
23 * therefore means that it is reserved for developers and experienced
24 * professionals having in-depth computer knowledge. Users are therefore
25 * encouraged to load and test the software's suitability as regards their
26 * requirements in conditions enabling the security of their systems and/or
27 * data to be ensured and, more generally, to use and operate it in the
28 * same conditions as regards security.
29 *
30 * The fact that you are presently reading this means that you have had
31 * knowledge of the CeCILL-B license and that you accept its terms.
32 */
33
34
35#ifndef ANATOMIST_WINDOW3D_CONTROL3D_H
36#define ANATOMIST_WINDOW3D_CONTROL3D_H
37
38
41#include <qglobal.h>
42
43class AWindow3D;
44class PinchGesture;
45class PanGesture;
46
47namespace anatomist
48{
49
50 class Control3D : public Control
51 {
52 public:
53 static Control * creator( ) ;
54
55 Control3D( int priority = 100,
56 const std::string & name = QT_TRANSLATE_NOOP( "ControlledWindow",
57 "Default 3D control" ) );
58 Control3D( const Control3D & c );
59 virtual ~Control3D();
60
61 virtual std::string description() const;
62
63 virtual void eventAutoSubscription( ActionPool * actionPool );
64 virtual void doAlsoOnDeselect( ActionPool * actionPool );
65
66 protected:
67
68 private:
69 };
70
71 class Select3DControl : public Control
72 {
73 public:
74 static Control * creator( ) ;
75 Select3DControl( const std::string & name = "Selection 3D" );
78
79 virtual std::string description() const;
80
81 virtual void eventAutoSubscription( ActionPool * actionPool );
82 virtual void doAlsoOnSelect( ActionPool * actionPool );
83 virtual void doAlsoOnDeselect( ActionPool * actionPool );
84 };
85
86
87 class FlightControl : public Control
88 {
89 public:
90 static Control * creator( ) ;
93 virtual ~FlightControl();
94
95 virtual std::string description() const;
96
97 virtual void eventAutoSubscription( ActionPool * actionPool );
98 virtual void doAlsoOnDeselect( ActionPool * actionPool );
99 };
100
101
102 class ObliqueControl : public Control
103 {
104 public:
105 static Control * creator();
106 ObliqueControl( const std::string & name = "ObliqueControl" );
109
110 virtual std::string description() const;
111
112 virtual void eventAutoSubscription( ActionPool * actionPool );
113 };
114
115
117 {
118 public:
119 static Control * creator();
123
124 virtual std::string description() const;
125
126 virtual void eventAutoSubscription( ActionPool * actionPool );
127 virtual void doAlsoOnSelect( ActionPool * actionPool );
128 virtual void doAlsoOnDeselect( ActionPool * actionPool );
129 };
130
131
132 class CutControl : public Control
133 {
134 public:
135 static Control * creator();
137 CutControl( const CutControl & c );
138 virtual ~CutControl();
139
140 virtual std::string description() const;
141
142 virtual void eventAutoSubscription( ActionPool * actionPool );
143 };
144
145
146 class WindowActions : public Action
147 {
148 public:
149 static Action * creator() ;
152 virtual ~WindowActions();
153
154 virtual std::string name() const;
155
156 void close();
159 void focusView();
163
164 QWidget* actionView( QWidget* parent );
165 bool viewableAction() const;
166 };
167
168
169 class LinkAction : public Action
170 {
171 public:
172 static Action * creator() ;
174 LinkAction( const LinkAction & a );
175 virtual ~LinkAction();
176
177 virtual std::string name() const;
178
179 void execLink( int x, int y, int globalX, int globalY );
180 void endLink( int x, int y, int globalX, int globalY );
181
182 QWidget* actionView( QWidget* parent );
183 bool viewableAction() const;
184
185 protected:
186 private:
187 };
188
189
190 class MenuAction : public Action
191 {
192 public:
193 static Action * creator() ;
194
196 MenuAction( const MenuAction & a );
197 virtual ~MenuAction();
198
199 virtual std::string name() const;
200
201 void execMenu( int x, int y, int globalX, int globalY );
202
203 QWidget* actionView( QWidget* parent );
204 bool viewableAction() const;
205 };
206
207
208 class SelectAction : public Action
209 {
210 public:
211 static Action * creator() ;
212
215 virtual ~SelectAction();
216
217 virtual std::string name() const;
218
219 void select( int modifier, int x, int y );
220 void execSelect( int x, int y, int globalX, int globalY );
221 void execSelectAdding( int x, int y, int globalX, int globalY );
222 void execSelectToggling( int x, int y, int globalX, int globalY );
223
228
229 QWidget* actionView( QWidget* parent );
230 bool viewableAction() const;
231 };
232
233
234 class Zoom3DAction : public Action
235 {
236 public:
237 static Action * creator() ;
238
241 virtual ~Zoom3DAction();
242
243 virtual std::string name() const;
244
245 void beginZoom( int x, int y, int globalX, int globalY );
246 void moveZoom( int x, int y, int globalX, int globalY );
247 void endZoom( int x, int y, int globalX, int globalY );
254 void zoomWheel( int, int, int, int, int );
255 void zoom( int distance );
256
257 QWidget* actionView( QWidget* parent );
258 bool viewableAction() const;
259
260 private:
261 int _beginpos;
262 float _orgzoom;
263 };
264
265
267 {
268 public:
269 static Action * creator() ;
270
274
275 virtual std::string name() const;
276
277 void beginTranslate( int x, int y, int globalX, int globalY );
278 void moveTranslate( int x, int y, int globalX, int globalY );
279 void endTranslate( int x, int y, int globalX, int globalY );
281
282 QWidget* actionView( QWidget* parent );
283 bool viewableAction() const;
284
285 private:
286 bool _started;
287 int _beginx;
288 int _beginy;
289 };
290
291
292 class Sync3DAction : public Action
293 {
294 public:
295 static Action * creator() ;
296
299 virtual ~Sync3DAction();
300
301 virtual std::string name() const;
302
303 void execSync();
305
306 QWidget* actionView( QWidget* parent );
307 bool viewableAction() const;
308 };
309
310
311 class MovieAction : public QObject, public Action
312 {
313 Q_OBJECT
314
315 public:
324
326 virtual ~MovieAction() ;
327
328 virtual std::string name() const { return "MovieAction" ; }
329
330 static Action * creator() ;
331
332 void sliceOn() ;
333 void timeOn() ;
334 void nextMode();
337
338 void startOrStop() ;
339 bool isRunning() const { return myIsRunning; }
340
341 private slots:
342 void timeout() ;
343
344 private:
345 bool mySliceAndNotTime;
346 bool myIsRunning;
347 RunMode myRunMode;
348 bool myForward;
349 QTimer * myTimer;
350 int myTimeInterval;
351 } ;
352
353
354 class SliceAction : public Action
355 {
356 public:
358 virtual ~SliceAction();
359
360 virtual std::string name() const { return "SliceAction" ; }
361 static Action * creator() ;
362
363 void nextSlice();
365 void nextTime();
369 };
370
371
373 {
374 public:
377
378 virtual std::string name() const { return "DragObjectAction" ; }
379 static Action * creator() ;
380
381 void dragAll( int x, int y, int globalX, int globalY );
382 void dragSelected( int x, int y, int globalX, int globalY );
383 };
384
385
387 {
388 public:
391
392 virtual std::string name() const { return "SortMeshesPolygonsAction"; }
393 static Action * creator();
394
395 void sort();
398 };
399
400
402 {
403 public:
406
407 virtual std::string name() const { return "ObjectStatAction"; }
408 static Action * creator();
409
411 };
412
413
414 class PinchZoomAction : public Action
415 {
416 public:
419
420 virtual std::string name() const { return "PinchZoomAction"; }
421 static Action* creator();
422
423 void pinchStart( QPinchGesture *gesture );
424 void pinchMove( QPinchGesture *gesture );
425 void pinchStop( QPinchGesture *gesture );
426
427 private:
428 struct Private;
429 Private *d;
430 };
431
432
434 {
435 public:
438
439 virtual std::string name() const { return "TouchRotateAction"; }
440 static Action* creator();
441
442 void touchStart( QTouchEvent *event );
443 void touchMove( QTouchEvent *event );
444 void touchStop( QTouchEvent *event );
445
446 private:
447 struct Private;
448 Private *d;
449 };
450
451}
452
453
454#endif
#define slots
3D window, OpenGL rendering
Definition window3D.h:75
static Control * creator()
virtual void eventAutoSubscription(ActionPool *actionPool)
virtual std::string description() const
Control3D(const Control3D &c)
virtual void doAlsoOnDeselect(ActionPool *actionPool)
Control3D(int priority=100, const std::string &name=QT_TRANSLATE_NOOP("ControlledWindow", "Default 3D control"))
const std::string & name() const
Definition control.h:108
Control(int priority, std::string name)
virtual void eventAutoSubscription(ActionPool *actionPool)
virtual std::string description() const
CutControl(const CutControl &c)
static Control * creator()
static Action * creator()
virtual std::string name() const
Definition control3D.h:378
void dragSelected(int x, int y, int globalX, int globalY)
void dragAll(int x, int y, int globalX, int globalY)
static Control * creator()
virtual void doAlsoOnDeselect(ActionPool *actionPool)
virtual std::string description() const
virtual void eventAutoSubscription(ActionPool *actionPool)
FlightControl(const FlightControl &c)
void execLink(int x, int y, int globalX, int globalY)
bool viewableAction() const
void endLink(int x, int y, int globalX, int globalY)
static Action * creator()
QWidget * actionView(QWidget *parent)
LinkAction(const LinkAction &a)
virtual std::string name() const
virtual std::string name() const
MenuAction(const MenuAction &a)
static Action * creator()
bool viewableAction() const
void execMenu(int x, int y, int globalX, int globalY)
QWidget * actionView(QWidget *parent)
static Action * creator()
bool isRunning() const
Definition control3D.h:339
virtual std::string name() const
Definition control3D.h:328
virtual std::string name() const
Definition control3D.h:407
static Action * creator()
ObliqueControl(const std::string &name="ObliqueControl")
ObliqueControl(const ObliqueControl &c)
static Control * creator()
virtual std::string description() const
virtual void eventAutoSubscription(ActionPool *actionPool)
void pinchStart(QPinchGesture *gesture)
virtual std::string name() const
Definition control3D.h:420
void pinchMove(QPinchGesture *gesture)
static Action * creator()
void pinchStop(QPinchGesture *gesture)
static Control * creator()
virtual void eventAutoSubscription(ActionPool *actionPool)
Select3DControl(const std::string &name="Selection 3D")
virtual std::string description() const
virtual void doAlsoOnSelect(ActionPool *actionPool)
virtual void doAlsoOnDeselect(ActionPool *actionPool)
Select3DControl(const Select3DControl &c)
void toggleSelectAll()
key action for select all / unselect all objects
bool viewableAction() const
void execSelectToggling(int x, int y, int globalX, int globalY)
void select(int modifier, int x, int y)
virtual std::string name() const
void execSelect(int x, int y, int globalX, int globalY)
QWidget * actionView(QWidget *parent)
static Action * creator()
void execSelectAdding(int x, int y, int globalX, int globalY)
SelectAction(const SelectAction &a)
virtual std::string name() const
Definition control3D.h:360
static Action * creator()
virtual std::string name() const
Definition control3D.h:392
Sync3DAction(const Sync3DAction &a)
QWidget * actionView(QWidget *parent)
static Action * creator()
virtual std::string name() const
bool viewableAction() const
void touchStop(QTouchEvent *event)
static Action * creator()
void touchMove(QTouchEvent *event)
virtual std::string name() const
Definition control3D.h:439
void touchStart(QTouchEvent *event)
virtual void eventAutoSubscription(ActionPool *actionPool)
virtual void doAlsoOnDeselect(ActionPool *actionPool)
virtual void doAlsoOnSelect(ActionPool *actionPool)
static Control * creator()
TransformControl(const TransformControl &c)
virtual std::string description() const
void beginTranslate(int x, int y, int globalX, int globalY)
void endTranslate(int x, int y, int globalX, int globalY)
virtual std::string name() const
Translate3DAction(const Translate3DAction &a)
static Action * creator()
QWidget * actionView(QWidget *parent)
void moveTranslate(int x, int y, int globalX, int globalY)
QWidget * actionView(QWidget *parent)
bool viewableAction() const
WindowActions(const WindowActions &a)
static Action * creator()
virtual std::string name() const
QWidget * actionView(QWidget *parent)
void zoomOutOnce()
zomms a fixed amount (ie 10%) on a key event
virtual std::string name() const
void zoomWheel(int, int, int, int, int)
zoom for a wheel event
Zoom3DAction(const Zoom3DAction &a)
static Action * creator()
void endZoom(int x, int y, int globalX, int globalY)
void zoom(int distance)
void zoomInOnce()
zomms a fixed amount (ie 10%) on a key event
void beginZoom(int x, int y, int globalX, int globalY)
bool viewableAction() const
void moveZoom(int x, int y, int globalX, int globalY)