anatomist  5.1.2
3D neuroimaging data viewer
graphParams.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_CONTROL_GRAPHPARAMS_H
36 #define ANATOMIST_CONTROL_GRAPHPARAMS_H
37 
38 
40 #include <qwidget.h>
41 #include <string>
42 #include <vector>
43 
44 class Tree;
45 class QGraphParam;
46 
47 namespace anatomist
48 {
49  class AGraph;
50  class AGraphObject;
51  class Material;
52  class Hierarchy;
53 
55  {
56  public:
59 
61 
62  void updateGraphs() const;
66  static bool recolorLabelledGraph( AGraph* ag, AGraphObject* go,
67  Material & mat );
68  static bool nomenclatureColorForLabel( const std::string & label,
69  const Hierarchy *hie,
70  Material & mat );
72  static Tree* findTreeWith( const Tree* tr, const std::string & attribute,
73  const std::string & value,
74  std::vector<Tree *> & parents );
76  int selectRenderModeFromString( const std::string & );
77 
79  std::string attribute;
80  bool toolTips;
81  int saveMode;
86  std::vector<std::string> selectRenderModes;
88 
89  private:
90  friend class AGraph;
91  friend class ::QGraphParam;
92  static GraphParams*& _graphParams();
93  void allowRescanHierarchies( bool x );
94  bool rescanhierarchies;
95  };
96 
97 }
98 
99 
101 class QGraphParam : public QWidget
102 {
103  Q_OBJECT
104 
105 public:
106  QGraphParam( QWidget* parent = theAnatomist->getQWidgetAncestor(), const char* name = 0 );
107  virtual ~QGraphParam();
108 
110  static QGraphParam* theGP();
111 
112  void refreshGraphs() const;
113  void update();
115  const std::string & nomenclatureAttrib() const;
116 
118  static void setLabelColorsActivated( bool state );
119  static bool labelColorsActivated();
121  static void setColorsAttribute( const std::string & attr );
122  static std::string colorsAttribute();
123  static bool toolTipsInstalled();
124  static int savingMode();
125  static bool saveOnlyModified();
126  static bool autoSaveDirectory();
127 
128 protected slots:
129  void btnClicked( int btn );
130  void colorClicked( bool onoff );
131  void attribActivated( const QString & str );
132  void installToolTips( bool onoff );
133  void unselectOnBackgroung( bool onoff );
134  void invSelColorClicked( bool onoff );
136  void loadRelationsChanged( bool );
137  void saveModifChanged( bool );
138  void autoDirChanged( bool );
139  void saveModeSelected( int );
141 
142 private:
143  static QGraphParam* & _qGraphParam();
144 
145  struct Private;
146 
147  Private *d;
148 };
149 
150 
151 
152 #endif
anatomist::Anatomist *ANATOMIST_API theAnatomist
Pointer to the Anatomist application.
#define slots
Graph static parameters control window.
Definition: graphParams.h:102
void loadRelationsChanged(bool)
void unselectOnBackgroung(bool onoff)
void selColorClicked()
static void setLabelColorsActivated(bool state)
Silent change - doesn't update the window interface.
static int savingMode()
void setSelectionRenderingMode(int)
static QGraphParam * theGP()
Access the singleton.
static bool labelColorsActivated()
void colorClicked(bool onoff)
static std::string colorsAttribute()
void saveModeSelected(int)
void invSelColorClicked(bool onoff)
static void setColorsAttribute(const std::string &attr)
Silent change - doesn't update the window interface.
const std::string & nomenclatureAttrib() const
Attribute for nomenclature selection / colors.
void btnClicked(int btn)
static bool autoSaveDirectory()
void autoDirChanged(bool)
virtual ~QGraphParam()
void refreshGraphs() const
void installToolTips(bool onoff)
void attribActivated(const QString &str)
void update()
static bool saveOnlyModified()
static bool toolTipsInstalled()
QGraphParam(QWidget *parent=theAnatomist->getQWidgetAncestor(), const char *name=0)
void saveModifChanged(bool)
Anatomist graph object: a list that manages destruction of its sub-elements.
Definition: GraphObject.h:53
AGraph object class.
Definition: Graph.h:57
QWidget * getQWidgetAncestor() const
Gets an empty QWidget that is created in Anatomist application to become a default parent for all Ana...
void updateGraphs() const
int selectRenderModeFromString(const std::string &)
std::vector< std::string > selectRenderModes
Definition: graphParams.h:86
static bool nomenclatureColorForLabel(const std::string &label, const Hierarchy *hie, Material &mat)
static GraphParams * graphParams()
static Tree * findTreeWith(const Tree *tr, const std::string &attribute, const std::string &value, std::vector< Tree * > &parents)
This function should be part of the Tree class (in graph library).
static bool recolorLabelledGraph(AGraph *ag, AGraphObject *go, Material &mat)
Function used by the AGraph coloring function when in labels color mode.
std::string attribute
Definition: graphParams.h:79
Nomenclature hierarchy object.
Definition: hierarchy.h:52
This class has to be rewritten, it's really really a shame.......
Definition: Material.h:48