anatomist 6.0.4
3D neuroimaging data viewer
qwObjPalette.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_COLOR_QWOBJPALETTE_H
36#define ANAQT_COLOR_QWOBJPALETTE_H
37
38
40#include <cartobase/smart/rcptr.h>
41#include <qwidget.h>
42#include <qaction.h>
43
44class QListWidgetItem;
45
46namespace anatomist
47{
48 class AObjectPalette;
49 class APalette;
51}
52
53
54class QAPaletteWin : public QWidget, public anatomist::APaletteWin
55{
56 Q_OBJECT
57
58public:
59 QAPaletteWin( const std::set<anatomist::AObject *> & obj );
60 virtual ~QAPaletteWin();
61
62 virtual void update( const anatomist::Observable* obs, void* arg );
63
65 createPalWin( const std::set<anatomist::AObject* > & obj );
72
73signals:
74
75protected slots:
76 void palette1Changed( const std::string & );
77 void palette2Changed( const std::string & );
78 void responsiveToggled( bool val );
80 void dimChanged( int );
81 void mixMethodChanged( int );
83 void enablePalette2( bool );
84 void mixFactorChanged( int );
94 void objectsChosen( const std::set<anatomist::AObject *> & );
95 void extensionActionTriggered( QAction* action );
96 void zeroCentered1Changed( int state );
97 void zeroCentered2Changed( int state );
98 void palette1RangeChanged( double, double );
99 void palette2RangeChanged( double, double );
100 void cleatMin1();
101 void cleatMax1();
102 void cleatMin2();
103 void cleatMax2();
104 void min1Changed( double );
105 void max1Changed( double );
106 void min2Changed( double );
107 void max2Changed( double );
108
109protected:
110 struct DimBox;
111
112 virtual void closeEvent( QCloseEvent* );
114
116
120 virtual QWidget* makeDimBox( const QString & title, QWidget* parent,
121 DimBox* dbox, bool secondary );
122 virtual void setValues( DimBox* dimBox, double min, double max,
123 double objMin, double objMax, bool zeroCentered,
124 bool setBounds = false );
125 virtual void setValues1( bool setBounds = false );
126 virtual void setValues2( bool setBounds = false );
127 virtual void updateObjects();
128 virtual void updateObjPal();
133
134private:
135 struct Private;
136 Private *d;
137};
138
139
140namespace anatomist
141{
142
143 class APaletteExtensionAction : public QAction
144 {
145 Q_OBJECT
146
147 public:
148 friend class ::QAPaletteWin;
149
150 APaletteExtensionAction( QObject* parent );
151 APaletteExtensionAction( const QString & text, QObject * parent );
152 APaletteExtensionAction( const QIcon & icon, const QString & text,
153 QObject * parent );
155
156 virtual void extensionTriggered(
157 const std::set<anatomist::AObject *> & ) = 0;
158 };
159
160
161 namespace internal
162 {
163
164 // static class
165 class PaletteWinExtensionActions : public QObject
166 {
167 Q_OBJECT
168
169 public:
170 virtual ~PaletteWinExtensionActions() { _instance() = 0; }
171
172 static PaletteWinExtensionActions *instance();
173
174 private:
175 PaletteWinExtensionActions( QObject * parent ) : QObject( parent ) {}
176 static PaletteWinExtensionActions *& _instance();
177 };
178
179 }
180
181}
182
183#endif
#define slots
void min1Changed(double)
void resetValues2()
void max2EditChanged()
virtual ~QAPaletteWin()
void fillPalette1()
void fillPalette1DMappingMethods()
void palette2RangeChanged(double, double)
void runCommand()
void palette2Changed(const std::string &)
void cleatMin1()
void zeroCentered1Changed(int state)
void cleatMin2()
anatomist::AObjectPalette * objPalette()
void mixFactorChanged(int)
virtual QWidget * makeDimBox(const QString &title, QWidget *parent, DimBox *dbox, bool secondary)
void max1EditChanged()
void min2EditChanged()
virtual void setValues(DimBox *dimBox, double min, double max, double objMin, double objMax, bool zeroCentered, bool setBounds=false)
void max1Changed(double)
virtual void setValues1(bool setBounds=false)
void updateClicked()
void chooseObject()
void resetBounds1()
void enablePalette2(bool)
void fillToolBar()
virtual void closeEvent(QCloseEvent *)
void responsiveToggled(bool val)
void zeroCentered2Changed(int state)
void min2Changed(double)
void palette1DMappingMethodChanged(int)
QAPaletteWin(const std::set< anatomist::AObject * > &obj)
void resetBounds2()
void max2Changed(double)
virtual void unregisterObservable(anatomist::Observable *)
Called when an observable is destroyed, only called by Observable: don't use this function directly.
void palette1RangeChanged(double, double)
void fillPalette2()
void objectsChosen(const std::set< anatomist::AObject * > &)
void palette1Changed(const std::string &)
void extensionActionTriggered(QAction *action)
void fillMixMethods()
virtual void updateObjPal()
void resetValues1()
static anatomist::APaletteWin * createPalWin(const std::set< anatomist::AObject * > &obj)
void cleatMax1()
void updateInterface()
void dimChanged(int)
virtual void update(const anatomist::Observable *obs, void *arg)
This method is called whenever the observed object is changed.
void mixMethodChanged(int)
virtual void updateObjects()
void cleatMax2()
static void addExtensionAction(anatomist::APaletteExtensionAction *action)
Actions can be added here, they will show on a toolbar.
virtual void setValues2(bool setBounds=false)
void min1EditChanged()
APaletteExtensionAction(const QIcon &icon, const QString &text, QObject *parent)
virtual void extensionTriggered(const std::set< anatomist::AObject * > &)=0
APaletteExtensionAction(QObject *parent)
APaletteExtensionAction(const QString &text, QObject *parent)
Object color palette window.
Definition wObjPalette.h:49
This class can be subclassed to represent an object that the programmer wants to have observed.
Definition Observable.h:68
static PaletteWinExtensionActions * instance()
T min(const Volume< T > &vol)
T max(const Volume< T > &vol)