anatomist  5.1.2
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 = Qt::WindowFlags() );
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 );
73  const QPoint & pos,
74  const std::vector<anatomist::Transformation *> & trans );
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  void loadTransformationGraph( const std::string & filename );
92  void saveTransformationGraph( const std::string & filename );
93  virtual void closeEvent ( QCloseEvent * );
94  virtual void resizeEvent( QResizeEvent * );
95  virtual void mousePressEvent( QMouseEvent* ev );
96  virtual void mouseReleaseEvent( QMouseEvent* ev );
97  virtual void mouseMoveEvent( QMouseEvent* ev );
98  void popupRefMenu( const QPoint & pos );
99  void popupTransfMenu( const QPoint & pos );
100  void popupBackgroundMenu( const QPoint & pos );
101 
107  virtual bool event( QEvent* );
108 
109 protected slots:
119  void set3DView();
121  void refreshNow();
123 
124 private:
125  anatomist::ReferentialWindow_PrivateData *pdat;
127 };
128 
129 
130 class ReferentialWindow_TransCallback : public QObject
131 {
132 Q_OBJECT
133 
134 public:
138 
139 public slots:
145 
146 private:
147  ReferentialWindow *refwin;
149 };
150 
151 
152 #endif
#define slots
ReferentialWindow_TransCallback(ReferentialWindow *rw, anatomist::Transformation *t)
Window displaying referentials and transformations between them.
Definition: wReferential.h:56
void saveTransformation(anatomist::Transformation *)
void popupRefMenu(const QPoint &pos, anatomist::Referential *ref)
static void unlinkFiles(const std::list< std::string > &temp_filenames)
void deleteReferential()
virtual void resizeEvent(QResizeEvent *)
void clearUnusedReferentials()
void popupTransfMenu(const QPoint &pos)
void mergeReferentials(anatomist::Transformation *)
virtual bool event(QEvent *)
virtual void mousePressEvent(QMouseEvent *ev)
void popupRefMenu(const QPoint &pos)
static QString transformationToolTipText(anatomist::Transformation *tr, std::list< std::string > &temp_filenames)
void popupTransfMenu(const QPoint &pos, const std::vector< anatomist::Transformation * > &trans)
void popupBackgroundMenu(const QPoint &pos)
void loadTransformationGraph()
anatomist::Transformation * transfAt(const QPoint &pos)
void loadNewTransformation()
void loadTransformationGraph(const std::string &filename)
virtual ~ReferentialWindow()
virtual void mouseMoveEvent(QMouseEvent *ev)
void invertTransformation(anatomist::Transformation *)
void seeObjectsInReferential()
ReferentialWindow(QWidget *parent=0, const char *name=0, Qt::WindowFlags f=Qt::WindowFlags())
void mergeIdenticalReferentials()
void loadTransformation(const std::string &filename)
loads a new transformation, should be in a separate IO class...
anatomist::Referential * refAt(const QPoint &pos, QPoint &newpos)
void addTransformationGui(anatomist::Referential *source, anatomist::Referential *dest, bool identity=false, bool merge=false)
void refresh(bool partial=false)
updates contents (new referentials or transformations...)
std::vector< anatomist::Transformation * > transformsAt(const QPoint &pos)
void openSelectBox()
opens the file selection dialog to choose a transformation
void saveTransformation(const std::string &filename)
void saveTransformationGraph(const std::string &filename)
void saveTransformationGraph()
void reloadTransformation(anatomist::Transformation *)
virtual void closeEvent(QCloseEvent *)
static QString referentialToolTipText(anatomist::Referential *ref, std::list< std::string > &temp_filenames)
virtual void mouseReleaseEvent(QMouseEvent *ev)
void deleteTransformation(anatomist::Transformation *)
Referential: marker for transformations, with an associated color.
Definition: Referential.h:55
Transformation between two referentials.