anatomist  5.0.5
3D neuroimaging data viewer
wControl.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 ANA_CONTROL_WCONTROL_H
36 #define ANA_CONTROL_WCONTROL_H
37 
38 
40 #include <qmainwindow.h>
41 #include <string>
42 #include <map>
43 #include <set>
44 
45 namespace anatomist
46 {
47  class AWindow;
48  class AObject;
49  class MObject;
50  class AControlMenuHandler;
51  class Referential;
52 }
53 
54 
60 class ControlWindow : public QMainWindow
61 {
62  Q_OBJECT
63 
64 public:
65  ControlWindow();
66  virtual ~ControlWindow();
67 
68  void registerWindow( anatomist::AWindow *win );
69  void unregisterWindow( anatomist::AWindow *win );
70  void NotifyWindowChange( anatomist::AWindow* win );
71  void registerObject( anatomist::AObject *obj );
72  void unregisterObject( anatomist::AObject *obj );
73  void registerSubObject( anatomist::MObject* parent,
74  anatomist::AObject* obj );
75  void NotifyObjectChange( anatomist::AObject* obj );
76 
77  std::set<anatomist::AObject *> selectedObjects();
78  std::set<anatomist::AWindow*> selectedWindows();
79  std::set<int> SelectedWinGroups() const;
80  void SelectObject( anatomist::AObject *obj );
81  void UnselectAllObjects();
82  void UnselectAllWindows();
83  void SelectWindow( anatomist::AWindow *win );
84  void ResizeWindow( anatomist::AWindow *win );
85  void BuildObjectMenu();
86  void UpdateToggleMenus();
87  void UpdateObjectMenu();
88  void UpdateWindowMenu();
91  bool ViewingRefColors() const;
92  void ToggleRefColorsView();
93  void enableRefWinMenu( bool );
94  void enableLoadRefMenu( bool );
95  void enablePreferencesMenu( bool );
96  void enableFusionMenu( bool );
97  void enableGroupMenu( bool );
98  bool logoEnabled() const;
99  void loadObject( const std::string& filter, const std::string& caption );
100  anatomist::Referential* defaultObjectsReferential() const;
101  anatomist::Referential* defaultWindowsReferential() const;
102  void setDefaultObjectsReferential( anatomist::Referential* );
103  void setDefaultWindowsReferential( anatomist::Referential* );
105  void enableClose( bool );
106  bool closeEnabled() const;
107  void setWindowTypeVisible( int type, bool visible=true );
108  bool hasObject( anatomist::AObject * obj ) const;
109 
110  static ControlWindow* theControlWindow() { return( _theControlWindow ); }
111 
112 public slots:
113  void UpdateMenus() { UpdateToggleMenus(); BuildObjectMenu(); }
114  void loadObject();
115  void saveSettings();
116  void saveWindowsConfig();
117  void replayScenario();
119  void openWindow( int type );
120  void openWindow( QAction* ac );
122  void dropOnWindowIcon( int type, QDropEvent* ev );
123  void dragEnterOnWindowIcon( int type, QDragEnterEvent* ev );
124  void dragMoveOnWindowIcon( int type, QDragMoveEvent* ev );
125  void openAxial();
126  void openSagittal();
127  void openCoronal();
128  void openOblique();
129  void open3D();
130  void openBrowser();
131  void openRefWin();
132  void iconifyWindows();
133  void restoreWindows();
134  void closeWindows();
135  void linkWindows();
136  void addObjectsInWindows();
137  void removeObjects();
138  void deleteObjects();
139  void reload();
140  void groupObjects();
142  void chooseWinReferential();
143  void chooseReferential();
144  void openConstraintEditor();
145  void fusionObjects();
146  void openPreferencesWin();
147  void viewRefColors();
148  void about();
149  void help();
150  void graphParams();
151  void quit();
152  void languageEnglish();
153  void languageFrench();
154  void enableLogo( bool );
155  void objectTreeClick();
156  void objectTreeDblClick();
157  void windowTreeClick();
158  void windowTreeDblClick( anatomist::AWindow * );
159  void reloadPalettes();
160  void modulesList();
161  void aimsInfo();
162  void openThreeViews();
163  void openBlockView();
165  void clearAll();
166 
167 protected:
168  void closeEvent(QCloseEvent *event);
169  virtual void createMenu();
170  virtual void createIcons();
171  virtual void drawContents();
172  virtual void createTitle();
173  void setLanguage( const std::string & poFilename );
174 
176 
177  static std::string _baseTitle;
179 
180 protected slots:
181  void objectTreeRightClick( anatomist::AObject*, const QPoint & );
182 
183 private:
184  struct Private;
185  Private *d;
186 };
187 
188 
189 #endif
anatomist::AControlMenuHandler * _menu
Definition: wControl.h:175
void UpdateMenus()
Definition: wControl.h:113
Base Anatomist object (abstract)
Definition: Object.h:95
Multi-object : base abstract class for objects that contain others.
Definition: MObject.h:234
Abstract base class Anatomist window.
Definition: Window.h:57
#define slots
anatomist::AControlMenuHandler * menuHandler()
Definition: wControl.h:89
static ControlWindow * _theControlWindow
Definition: wControl.h:178
static ControlWindow * theControlWindow()
Definition: wControl.h:110
The ControlWindow class is the Anatomist control window.
Definition: wControl.h:60
Referential: marker for transformations, with an associated color.
Definition: Referential.h:54
static std::string _baseTitle
Definition: wControl.h:177