anatomist  5.1.2
3D neuroimaging data viewer
Referential.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_REFERENCE_REFERENTIAL_H
36 #define ANA_REFERENCE_REFERENTIAL_H
37 
38 
39 //--- header files ------------------------------------------------------------
40 
43 #include <aims/data/pheader.h>
44 #include <cartobase/uuid/uuid.h>
45 
46 
47 //--- class declarations ------------------------------------------------------
48 
49 namespace anatomist
50 {
51 
55  {
56  public:
58  Referential( const std::string & filename );
59  Referential( std::set<AObject*>& );
60  Referential( std::set<AWindow*>& );
61  Referential( const Referential& ref );
62  virtual ~Referential();
63 
65 
67  std::set<AObject*> AnaObj( void ) const { return( _anaObj ); }
69  std::set<AWindow*> AnaWin( void ) const { return( _anaWin ); }
70  AimsRGB Color() const { return( _color ); }
71  void setColor( const AimsRGB & col );
73  int index() const { return( _indCol ); }
75  void AddObject(AObject *);
77  void AddWindow(AWindow *);
82  bool destroying() const { return _destroying; }
83  carto::UUID uuid() const;
84  const aims::PythonHeader & header() const { return *_header; }
86  bool load( const std::string & filename );
87  std::string filename() const;
88  bool isDirect() const;
91  bool hidden() const;
92 
94  static Referential* referentialOfUUID( const std::string & uuid );
100  const std::string & refname );
102  static Referential* referentialOfName( const std::string & refname );
103  static void clearUnusedReferentials();
111  static bool mergeReferentials( Referential* r1, Referential *r2 );
113 
114  protected:
115  std::set<AObject*> _anaObj;
116  std::set<AWindow*> _anaWin;
119  int _indCol;
124  std::string _filename;
125  };
126 
127 }
128 
129 namespace carto
130 {
132  DECLARE_GENERIC_OBJECT_TYPE( std::set<anatomist::Referential *> )
133  DECLARE_GENERIC_OBJECT_TYPE( std::vector<anatomist::Referential *> )
134  DECLARE_GENERIC_OBJECT_TYPE( std::list<anatomist::Referential *> )
135 }
136 
137 #endif
Base Anatomist object (abstract)
Definition: Object.h:96
Abstract base class Anatomist window.
Definition: Window.h:58
Referential: marker for transformations, with an associated color.
Definition: Referential.h:55
aims::PythonHeader & header()
Definition: Referential.h:85
static bool mergeReferentials(Referential *r1, Referential *r2)
merge 2 unconnected referential or connected by identity.
AimsRGB Color() const
Definition: Referential.h:70
AimsRGB NewColor()
Retourne une nouvelle couleur.
Referential(std::set< AWindow * > &)
static void clearUnusedReferentials()
Referential(std::set< AObject * > &)
Referential(const std::string &filename)
bool hidden() const
a hidden referential does not appear in the GUI.
void AddWindow(AWindow *)
Ajoute une fenetre dans la liste des fenetres.
void setColor(const AimsRGB &col)
static Referential * referentialOfUUID(const std::string &uuid)
int index() const
Unique index, 0 is always the central referential.
Definition: Referential.h:73
Referential(const Referential &ref)
std::set< AObject * > _anaObj
Definition: Referential.h:115
const aims::PythonHeader & header() const
Definition: Referential.h:84
void RemoveWindow(AWindow *)
Enleve une fenetre de la liste des fenetres.
std::string filename() const
std::set< AWindow * > AnaWin(void) const
windows which are currently in this referential
Definition: Referential.h:69
void RemoveObject(AObject *)
Enleve un objet de la liste des objets.
std::set< AWindow * > _anaWin
Definition: Referential.h:116
void AddObject(AObject *)
Ajoute un objet dans la liste des objets.
static Referential * referentialOfName(const std::string &refname)
WARNING: a referential may not have a unique name.
carto::UUID uuid() const
static Referential * referentialOfUUID(const carto::UUID &uuid)
bool destroying() const
Definition: Referential.h:82
static Referential * acPcReferential()
bool load(const std::string &filename)
static Referential * referentialOfNameOrUUID(const AObject *obj, const std::string &refname)
tries to find a ref in the referentials property list
static Referential * mniTemplateReferential()
static void mergeIdenticalReferentials()
Referential & operator=(const Referential &)
static Referential * giftiTalairachReferential()
std::set< AObject * > AnaObj(void) const
objects which are currently in this referential
Definition: Referential.h:67
aims::PythonHeader * _header
Definition: Referential.h:121
int _indCol
color index
Definition: Referential.h:119
#define DECLARE_GENERIC_OBJECT_TYPE(T)