anatomist 6.0.4
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
45class ControlWindow;
46
47
48namespace anatomist
49{
50
51 class AObject;
52 class MObject;
53 class PaletteList;
54 class Transformation;
55 class AWindow;
56 class Referential;
58 class CommandWriter;
59
60 namespace internal
61 {
62 class AnatomistPrivate;
63 }
64
72 {
73
74 public:
75 enum Cursor
76 {
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
92 const PaletteList & palettes() const;
93
94 virtual void Refresh();
95
98
99 virtual void createControlWindow();
102 QWidget* getQWidgetAncestor() const;
103
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 );
116
122 int destroyObject( AObject*, bool verbose = true );
126 std::set<AObject *> destroyObjects( const std::set<AObject* > &,
127 bool verbose = true );
128 bool hasObject( const AObject* obj ) const;
130 void mapObject( AObject* obj );
132 void unmapObject( AObject* obj );
133
134 virtual void UpdateInterface();
135
137 std::string makeObjectName( const std::string & name );
138 std::set<AObject* > getObjects() const;
139 std::set<AWindow*> getWindows() const;
140 const std::set<Referential*> & getReferentials() const;
143 const Referential* );
145 const Referential* ) const;
146
147 std::list<AObject *> loadObject( const std::string & filename,
148 const std::string & objname = "",
150
151 void registerObject( AObject* obj, int inctrl=1 );
158 void releaseObject( AObject* obj );
160 void takeObjectRef( AObject* obj );
162 void registerSubObject( MObject* parent, AObject* obj );
172 void releaseWindow( AWindow* win );
174 void takeWindowRef( AWindow* obj );
175 void registerObjectName( const std::string& name, AObject* obj );
176 void unregisterObjectName( const std::string& name );
177
178 bool initialized() const;
179
183
185 void setCursor( Cursor c );
186
187 const std::string & objectsFileFilter() const;
188 void addObjectsFileFilter( const std::string & filter );
189
190 virtual bool glMakeCurrent();
192 std::string language() const;
200 int userLevel() const;
201 void setUserLevel( int );
202 void setLastPosition( const Point3df & pos, Referential * fromref = 0 );
203 void setLastPosition( const std::vector<float> & pos,
204 Referential * fromref = 0 );
205 Point3df lastPosition( const Referential* toref = 0 ) const;
206 std::vector<float> lastFullPosition( const Referential* toref = 0 ) const;
208 bool destroying() const;
212 void lockObjects( bool locked=true );
214 bool exitOnQuit() const;
215 void setExitOnQuit( bool x );
216 QWidget* defaultWindowsBlock() const;
217 void setDefaultWindowsBlock( QWidget* wid );
218
219 private:
220 // friend ~ReferentialWindow would be enough but needs to include its .h
221 friend class ::ReferentialWindow;
222 friend class anatomist::internal::AnatomistPrivate;
223 struct Anatomist_privateData;
224
225 void unregisterReferentialWindow();
226
227 Anatomist_privateData *_privData;
228 };
229
230}
231
232
235
236
237#endif
anatomist::Anatomist *ANATOMIST_API theAnatomist
Pointer to the Anatomist application.
#define ANATOMIST_API
The ControlWindow class is the Anatomist control window.
Definition wControl.h:61
Window displaying referentials and transformations between them.
Base Anatomist object (abstract)
Definition Object.h:97
Abstract base class Anatomist window.
Definition Window.h:59
The Anatomist class holds information about all data handled by Anatomist: the objects,...
Definition Anatomist.h:72
int groupWindows(std::set< AWindow * > &winL, int groupnum=-1)
Links the given windows, and returns the new group number.
void unregisterObjectName(const std::string &name)
void registerReferential(Referential *ref)
Point3df lastPosition(const Referential *toref=0) const
void registerSubObject(MObject *parent, AObject *obj)
void setDefaultWindowsBlock(QWidget *wid)
const CommandWriter & historyWriter() const
std::set< AWindow * > getWindowsInGroup(int group)
Retruns the set of windows in a given group.
virtual bool glMakeCurrent()
bool hasReferential(const Referential *)
const PaletteList & palettes() const
std::string makeObjectName(const std::string &name)
Builds a unique object name.
Referential * centralReferential() const
const std::set< Referential * > & getReferentials() const
void registerObject(AObject *obj, int inctrl=1)
void NotifyWindowChange(AWindow *win)
bool hasObject(const AObject *obj) const
void NotifyMapWindow(AWindow *)
Transformation * getTransformation(const Referential *, const Referential *)
void unmapObject(AObject *obj)
Makes an object unvisible (ie not seen in control window(s))
void lockObjects(bool locked=true)
lock / unlock the objects list mutex, used in threaded load operations
void NotifyObjectChange(AObject *obj)
QWidget * defaultWindowsBlock() const
virtual void Refresh()
std::string language() const
int userLevel() const
The user level drives the GUI to show or hide some features for simplicity or richness.
PaletteList & palettes()
bool destroying() const
returns true if the Anatomist application is currently being destroyed
void registerObjectName(const std::string &name, AObject *obj)
void releaseWindow(AWindow *win)
releases the reference counter kept in Anatomist application for the given window,...
friend class ::ReferentialWindow
Definition Anatomist.h:221
static std::string versionString()
full version ("1.30.3" or "1.31beta")
void unregisterObject(AObject *obj)
void takeObjectRef(AObject *obj)
change object reference type to WeakShared (standard in anatomist)
std::set< AObject * > destroyObjects(const std::set< AObject * > &, bool verbose=true)
Destroys an object if possible.
void setCursor(Cursor c)
Sets the shape of the mouse cursor on every window.
void takeWindowRef(AWindow *obj)
change window reference type to WeakShared (standard in anatomist)
void registerWindow(AWindow *win)
void addObjectsFileFilter(const std::string &filter)
void ungroupWindows(int group)
Unlinks the windows with the given group number.
virtual void createControlWindow()
bool hasWindow(const AWindow *win) const
virtual void initialize()
bool exitOnQuit() const
if true, closing the control window will abruptly exit the program.
void updateFileDialogObjectsFilter()
setup/update extensions list for readable files
QWidget * getQWidgetAncestor() const
Gets an empty QWidget that is created in Anatomist application to become a default parent for all Ana...
const Transformation * getTransformation(const Referential *, const Referential *) const
std::list< AObject * > loadObject(const std::string &filename, const std::string &objname="", carto::Object options=carto::none())
void releaseObject(AObject *obj)
releases the reference counter kept in Anatomist application for the given object,...
std::vector< float > lastFullPosition(const Referential *toref=0) const
CommandWriter & historyWriter()
void mapObject(AObject *obj)
Makes an object visible (ie seen in control window(s))
std::set< AObject * > getObjects() const
void setLastPosition(const Point3df &pos, Referential *fromref=0)
ControlWindow * getControlWindow() const
int destroyObject(AObject *, bool verbose=true)
Destroys an object if possible.
void unregisterWindow(AWindow *win)
const std::string & objectsFileFilter() const
static std::string libraryVersionString()
shorter version matching the library number (2 numbers: "1.31")
void unregisterReferential(Referential *ref)
Anatomist(int argc, const char **argv, const std::string &documentation)
void setExitOnQuit(bool x)
virtual void UpdateInterface()
void NotifyUnmapWindow(AWindow *)
virtual void createReferentialWindow()
Create the referential window and update it.
GlobalConfiguration * config()
void setLastPosition(const std::vector< float > &pos, Referential *fromref=0)
ReferentialWindow * getReferentialWindow() const
std::set< AWindow * > getWindows() const
bool initialized() const
CommandWriter is a helper class logging commands into a history file.
Definition Writer.h:62
This class stores global configuration settings, read by default from $HOME/.anatomist/config/setting...
Multi-object : base abstract class for objects that contain others.
Definition MObject.h:235
Referential: marker for transformations, with an associated color.
Definition Referential.h:56
Transformation between two referentials.
Object none()
AimsVector< float, 3 > Point3df