anatomist  5.1.2
3D neuroimaging data viewer
wvectorfield.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_SURFACE_WVECTORFIELD_H
36 #define ANA_SURFACE_WVECTORFIELD_H
37 
39 #include <anatomist/ui/ui_vectorfield.h>
40 
41 
42 namespace anatomist
43 {
44  class AObject;
45  class VectorField;
46 }
47 
48 
49 class VectorFieldEditionWindow : public QWidget, public Ui::VectorField,
50  public anatomist::Observer
51 {
52  Q_OBJECT
53 
54 public:
55  VectorFieldEditionWindow( const std::set<anatomist::AObject *> &,
56  QWidget* parent = 0, const char *name = 0,
57  Qt::WindowFlags f = Qt::WindowFlags() );
59 
60  const std::set<anatomist::AObject*>& objects() const { return _parents; }
61 
62  void update( const anatomist::Observable* observable, void* arg );
65 
66 protected slots:
67  void chooseObject();
68  void objectsChosen( const std::set<anatomist::AObject *> & );
69 
71  void xVolumeChanged( int );
72  void yVolumeChanged( int );
73  void zVolumeChanged( int );
74  void xSpace0Changed( int );
75  void xSpace1Changed( int );
76  void xSpace2Changed( int );
77  void ySpace0Changed( int );
78  void ySpace1Changed( int );
79  void ySpace2Changed( int );
80  void zSpace0Changed( int );
81  void zSpace1Changed( int );
82  void zSpace2Changed( int );
83  void setFixedCoord( int chan, int coord, int value );
84 
85 protected:
87  void setVolume( int chan, int index );
88  void setSpaceDim( int chan, int dim, int index );
89 
90  std::set<anatomist::AObject *> _parents;
91 
92 private:
93  struct Private;
94  Private *d;
95 };
96 
97 
98 
99 namespace anatomist
100 {
101  namespace internal
102  {
103 
104  class VectorFieldCoordSpinBox : public QSpinBox
105  {
106  Q_OBJECT
107 
108  public:
109  VectorFieldCoordSpinBox( int channel, int coord, QWidget* parent = 0 )
110  : QSpinBox( parent ), channel( channel ), coord( coord )
111  {
112  connect( this, SIGNAL( valueChanged( int ) ),
113  this, SLOT( changeValue( int ) ) );
114  }
116 
117  signals:
118  void valueChanged( int, int, int );
119 
120  protected slots:
121  void changeValue( int value )
122  {
123  emit valueChanged( channel, coord, value );
124  }
125 
126  private:
127  int channel;
128  int coord;
129  };
130 
131  }
132 }
133 
134 
135 
136 #endif
137 
#define slots
#define emit
virtual void unregisterObservable(anatomist::Observable *)
Called when an observable is destroyed, only called by Observable: don't use this function directly.
void objectsChosen(const std::set< anatomist::AObject * > &)
void setVolume(int chan, int index)
void setFixedCoord(int chan, int coord, int value)
anatomist::VectorField * vectorField() const
std::set< anatomist::AObject * > _parents
Definition: wvectorfield.h:90
virtual ~VectorFieldEditionWindow()
void setSpaceDim(int chan, int dim, int index)
const std::set< anatomist::AObject * > & objects() const
Definition: wvectorfield.h:60
VectorFieldEditionWindow(const std::set< anatomist::AObject * > &, QWidget *parent=0, const char *name=0, Qt::WindowFlags f=Qt::WindowFlags())
void update(const anatomist::Observable *observable, void *arg)
This method is called whenever the observed object is changed.
This class can be subclassed to represent an object that the programmer wants to have observed.
Definition: Observable.h:68
A class can implement the Observer interface when it wants to be informed of changes in observable ob...
Definition: Observer.h:55
VectorFieldCoordSpinBox(int channel, int coord, QWidget *parent=0)
Definition: wvectorfield.h:109