anatomist  5.1.2
3D neuroimaging data viewer
hierarchy.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 ANAQT_HIERARCHY_HIERARCHY_H
36 #define ANAQT_HIERARCHY_HIERARCHY_H
37 
38 
42 #include <graph/tree/tree.h>
43 
44 
45 namespace anatomist
46 {
47  class AGraph;
48 
51  class Hierarchy : public AObject, public AttributedAObject
52  {
53  public:
54  Hierarchy( Tree* tr );
56  virtual ~Hierarchy();
57 
58  carto::rc_ptr<Tree> tree() { return( _tree ); };
59 
60  static std::list<AObject*> loadHierarchy( const std::string & filename,
61  std::vector<std::pair<AObject *, bool> > &,
62  carto::Object options );
63 
65  virtual bool Is2DObject() { return( false ); }
67  virtual bool Is3DObject() { return( false ); }
68  static int classType() { return( _classType ); }
69  virtual Tree* optionTree() const;
70 
72  virtual bool save( const std::string & filename );
73  virtual void internalUpdate();
74 
75  Tree* findNamedNode( const std::string & name,
76  const std::list<Tree*>** parents = 0 ) const;
77 
78  static void namesUnder( Tree* tr, std::set<std::string> & names );
84  const AGraph **ag = 0 );
85 
86  protected:
88  static Tree *_optionTree;
89 
90  private:
91  struct Private;
92  struct PrivateStatic;
93  Private *d;
94  static PrivateStatic *staticStruct();
95  void slotPropertyChanged( const carto::Object& sender,
96  const std::string& propertyName,
97  const carto::Object& oldValue );
98 
100  static int registerClass();
101  static int _classType;
103  static carto::SyntaxSet *_syntax;
104  };
105 
106 }
107 
108 
109 #endif
AGraph object class.
Definition: Graph.h:57
Base Anatomist object (abstract)
Definition: Object.h:96
ParentList & parents()
List of multi-objects containing this one.
Definition: Object.h:263
std::string name() const
Name shown in control window.
Definition: Object.h:165
Nomenclature hierarchy object.
Definition: hierarchy.h:52
carto::rc_ptr< Tree > _tree
Definition: hierarchy.h:87
virtual bool Is3DObject()
... neither a 3D...
Definition: hierarchy.h:67
Tree * findNamedNode(const std::string &name, const std::list< Tree * > **parents=0) const
virtual bool save(const std::string &filename)
virtual bool Is2DObject()
not a 2D object
Definition: hierarchy.h:65
virtual Tree * optionTree() const
Menu tree for new options, see object/optionMatcher.h.
static void namesUnder(Tree *tr, std::set< std::string > &names)
static std::list< AObject * > loadHierarchy(const std::string &filename, std::vector< std::pair< AObject *, bool > > &, carto::Object options)
Hierarchy(carto::rc_ptr< Tree > tr)
static Hierarchy * findMatchingNomenclature(const AObject *obj, const AGraph **ag=0)
finds a Hierarchy matching for edition of the given object (which should be a graph or graph element)
static Tree * _optionTree
Definition: hierarchy.h:88
carto::rc_ptr< Tree > tree()
Definition: hierarchy.h:58
virtual void internalUpdate()
Updates the state of the object.
static int classType()
Definition: hierarchy.h:68
virtual carto::GenericObject * attributed()
Attributed objects wrapper.
Definition: pythonAObject.h:46
std::map< std::string, Syntax > SyntaxSet