anatomist  5.0.5
3D neuroimaging data viewer
Anatomist.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_APPLICATION_ANATOMIST
36 #define ANATOMIST_APPLICATION_ANATOMIST
37 
39 #include <aims/getopt/getopt2.h>
40 #include <qwidget.h>
41 #include <set>
42 #include <map>
43 
44 class ReferentialWindow;
45 class ControlWindow;
46 
47 
48 namespace anatomist
49 {
50 
51  class AObject;
52  class MObject;
53  class PaletteList;
54  class Transformation;
55  class AWindow;
56  class Referential;
57  class GlobalConfiguration;
58  class CommandWriter;
59 
60  namespace internal
61  {
62  class AnatomistPrivate;
63  }
64 
72  {
73 
74  public:
75  enum Cursor
76  {
78  Working
79  };
80 
81  Anatomist( int argc, const char **argv,
82  const std::string &documentation );
83  virtual ~Anatomist();
84 
85  virtual void initialize();
87  static std::string versionString();
89  static std::string libraryVersionString();
90 
91  PaletteList & palettes();
92  const PaletteList & palettes() const;
93 
94  virtual void Refresh();
95 
96  void NotifyMapWindow( AWindow* );
97  void NotifyUnmapWindow( AWindow* );
98 
99  virtual void createControlWindow();
100  ControlWindow* getControlWindow() const;
102  QWidget* getQWidgetAncestor() const;
103 
105  virtual void createReferentialWindow();
106  ReferentialWindow* getReferentialWindow() const;
107 
108  bool hasWindow( const AWindow* win ) const;
110  int groupWindows( std::set<AWindow*> & winL, int groupnum = -1 );
112  void ungroupWindows( int group );
114  std::set<AWindow*> getWindowsInGroup( int group );
115  void NotifyWindowChange( AWindow* win );
116 
122  int destroyObject( AObject* );
123  bool hasObject( const AObject* obj ) const;
125  void mapObject( AObject* obj );
127  void unmapObject( AObject* obj );
128 
129  virtual void UpdateInterface();
130 
132  std::string makeObjectName( const std::string & name );
133  std::set<AObject* > getObjects() const;
134  std::set<AWindow*> getWindows() const;
135  const std::set<Referential*> & getReferentials() const;
136  bool hasReferential( const Referential * );
137  Transformation* getTransformation( const Referential*,
138  const Referential* );
139  const Transformation* getTransformation( const Referential*,
140  const Referential* ) const;
141 
142  std::list<AObject *> loadObject( const std::string & filename,
143  const std::string & objname = "",
144  carto::Object options = carto::none() );
145 
146  void registerObject( AObject* obj, int inctrl=1 );
147  void unregisterObject( AObject* obj );
153  void releaseObject( AObject* obj );
155  void takeObjectRef( AObject* obj );
156  void NotifyObjectChange( AObject* obj );
157  void registerSubObject( MObject* parent, AObject* obj );
158  void registerReferential( Referential* ref );
159  void unregisterReferential( Referential* ref );
160  void registerWindow( AWindow* win );
161  void unregisterWindow( AWindow* win );
167  void releaseWindow( AWindow* win );
169  void takeWindowRef( AWindow* obj );
170  void registerObjectName( const std::string& name, AObject* obj );
171  void unregisterObjectName( const std::string& name );
172 
173  bool initialized() const;
174 
175  const CommandWriter & historyWriter() const;
176  CommandWriter & historyWriter();
177  GlobalConfiguration* config();
178 
180  void setCursor( Cursor c );
181 
182  const std::string & objectsFileFilter() const;
183  void addObjectsFileFilter( const std::string & filter );
184 
185  virtual bool glMakeCurrent();
186  Referential* centralReferential() const;
187  std::string language() const;
195  int userLevel() const;
196  void setUserLevel( int );
197  void setLastPosition( const Point3df & pos, Referential * fromref = 0 );
198  void setLastPosition( const std::vector<float> & pos,
199  Referential * fromref = 0 );
200  Point3df lastPosition( const Referential* toref = 0 ) const;
201  std::vector<float> lastFullPosition( const Referential* toref = 0 ) const;
203  bool destroying() const;
205  void updateFileDialogObjectsFilter();
207  void lockObjects( bool locked=true );
208 
209  private:
210  // friend ~ReferentialWindow would be enough but needs to include its .h
211  friend class ::ReferentialWindow;
212  friend class anatomist::internal::AnatomistPrivate;
213  struct Anatomist_privateData;
214 
215  void unregisterReferentialWindow();
216 
217  Anatomist_privateData *_privData;
218  };
219 
220 }
221 
222 
225 
226 
227 #endif
The Anatomist class holds information about all data handled by Anatomist: the objects, the windows, and other application-wide lists.
Definition: Anatomist.h:71
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
This class stores global configuration settings, read by default from $HOME/.anatomist/config/setting...
Definition: globalConfig.h:52
CommandWriter is a helper class logging commands into a history file.
Definition: Writer.h:61
anatomist::Anatomist *ANATOMIST_API theAnatomist
Pointer to the Anatomist application.
Window displaying referentials and transformations between them.
Definition: wReferential.h:55
#define ANATOMIST_API
The ControlWindow class is the Anatomist control window.
Definition: wControl.h:60
Object none()
Referential: marker for transformations, with an associated color.
Definition: Referential.h:54
Transformation between two referentials.