anatomist  5.0.5
3D neuroimaging data viewer
wReferential.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_WREFERENTIAL_H
36 #define ANA_REFERENCE_WREFERENTIAL_H
37 
38 
39 #include <qlabel.h>
40 #include <string>
41 #include <vector>
42 
43 
44 namespace anatomist
45 {
46 
47  class Transformation;
48  class Referential;
49  struct ReferentialWindow_PrivateData;
50 }
51 
55 class ReferentialWindow : public QWidget
56 {
57  Q_OBJECT
58 
59 public:
60  ReferentialWindow( QWidget* parent = 0, const char* name = 0,
61  Qt::WindowFlags f = 0 );
62  virtual ~ReferentialWindow();
63 
65  void refresh( bool partial = false );
66 
67  anatomist::Referential* refAt( const QPoint & pos, QPoint & newpos );
68  anatomist::Transformation* transfAt( const QPoint & pos );
69  std::vector<anatomist::Transformation*> transformsAt( const QPoint & pos );
70 
71  void popupRefMenu( const QPoint & pos, anatomist::Referential* ref );
72  void popupTransfMenu(
73  const QPoint & pos,
74  const std::vector<anatomist::Transformation *> & trans );
75  void addTransformationGui( anatomist::Referential* source,
77  bool identity = false, bool merge = false );
78 
79  static QString referentialToolTipText(
80  anatomist::Referential *ref, std::list<std::string> & temp_filenames );
81  static QString transformationToolTipText(
82  anatomist::Transformation *tr, std::list<std::string> & temp_filenames );
83  static void unlinkFiles( const std::list<std::string> & temp_filenames );
84 
85 protected:
87  void openSelectBox();
89  void loadTransformation( const std::string & filename );
90  void saveTransformation( const std::string & filename );
91  virtual void closeEvent ( QCloseEvent * );
92  virtual void resizeEvent( QResizeEvent * );
93  virtual void mousePressEvent( QMouseEvent* ev );
94  virtual void mouseReleaseEvent( QMouseEvent* ev );
95  virtual void mouseMoveEvent( QMouseEvent* ev );
96  void popupRefMenu( const QPoint & pos );
97  void popupTransfMenu( const QPoint & pos );
98  void popupBackgroundMenu( const QPoint & pos );
99 
100  void deleteTransformation( anatomist::Transformation* );
101  void invertTransformation( anatomist::Transformation* );
102  void reloadTransformation( anatomist::Transformation* );
103  void saveTransformation( anatomist::Transformation* );
104  void mergeReferentials( anatomist::Transformation* );
105  virtual bool event( QEvent* );
106 
107 protected slots:
108  void deleteReferential();
109  void newReferential();
110  void loadReferential();
111  void loadNewTransformation();
112  void clearUnusedReferentials();
113  void splitReferential();
114  void seeObjectsInReferential();
115  void set3DView();
116  void view3dDeleted();
117  void refreshNow();
118  void mergeIdenticalReferentials();
119 
120 private:
121  anatomist::ReferentialWindow_PrivateData *pdat;
123 };
124 
125 
126 class ReferentialWindow_TransCallback : public QObject
127 {
128 Q_OBJECT
129 
130 public:
134 
135 public slots:
136  void deleteTransformation();
137  void invertTransformation();
138  void reloadTransformation();
139  void saveTransformation();
140  void mergeReferentials();
141 
142 private:
143  ReferentialWindow *refwin;
145 };
146 
147 
148 #endif
#define slots
Window displaying referentials and transformations between them.
Definition: wReferential.h:55
Referential: marker for transformations, with an associated color.
Definition: Referential.h:54
Transformation between two referentials.
reference_wrapper< T > ref(T &ref)