anatomist 6.0.4
3D neuroimaging data viewer
wMaterial.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_COLOR_WMATERIAL_H
36#define ANA_COLOR_WMATERIAL_H
37
40#include <qslider.h>
41#include <set>
42
43
44namespace anatomist
45{
46 class AObject;
47}
48
49
52class MaterialWindow : public QWidget, public anatomist::Observer
53{
54 Q_OBJECT
55
56public:
57 MaterialWindow( const std::set<anatomist::AObject *> &, QWidget* parent = 0,
58 const char *name = 0, Qt::WindowFlags f = Qt::WindowFlags() );
59 virtual ~MaterialWindow();
60
61 const std::set<anatomist::AObject*>& objects() const { return _parents; }
62 const anatomist::Material& getMaterial() const { return _material; }
63
64 void update( const anatomist::Observable* observable, void* arg );
67 void runCommand();
68
69public slots:
71 void enableTab( int );
72 void enableAutoUpdate( bool );
73
74protected slots:
75 void valueChanged( int panel, int color, int value );
76 void shininessChanged( int value );
78 void objectsChosen( const std::set<anatomist::AObject *> & );
79
80protected:
84 QWidget* buildRgbaBox( QWidget* parent, int num );
86 void updatePanel( unsigned panel );
87
88 std::set<anatomist::AObject *> _parents;
90
91private:
92 struct Private;
93 Private *_privdata;
94};
95
96
101class QANumSlider : public QSlider
102{
103 Q_OBJECT
104
105public:
106 QANumSlider( int num1, int num2, int minValue, int maxValue, int pageStep,
107 int value, Qt::Orientation, QWidget * parent,
108 const char * name=0 );
109 virtual ~QANumSlider() {}
110
111 int _num1;
112 int _num2;
113
114signals:
115 void valueChanged( int num1, int num2, int value );
116
117protected slots:
118 void transformChange( int );
119};
120
121
122#endif
#define slots
MaterialWindow(const std::set< anatomist::AObject * > &, QWidget *parent=0, const char *name=0, Qt::WindowFlags f=Qt::WindowFlags())
anatomist::Material _material
Definition wMaterial.h:89
void chooseObject()
void shininessChanged(int value)
void drawContents()
QWidget * buildRgbaBox(QWidget *parent, int num)
internal: draws a RGBA widgets group
void updateObjects()
void valueChanged(int panel, int color, int value)
void objectsChosen(const std::set< anatomist::AObject * > &)
std::set< anatomist::AObject * > _parents
Definition wMaterial.h:88
void update(const anatomist::Observable *observable, void *arg)
This method is called whenever the observed object is changed.
virtual void unregisterObservable(anatomist::Observable *)
Called when an observable is destroyed, only called by Observable: don't use this function directly.
virtual ~MaterialWindow()
const anatomist::Material & getMaterial() const
Definition wMaterial.h:62
void updateInterface()
void updatePanel(unsigned panel)
internal: updates the sliders / labels positions for one RGBA box
void enableTab(int)
called by the QTabBar change
void enableAutoUpdate(bool)
const std::set< anatomist::AObject * > & objects() const
Definition wMaterial.h:61
virtual ~QANumSlider()
Definition wMaterial.h:109
void valueChanged(int num1, int num2, int value)
QANumSlider(int num1, int num2, int minValue, int maxValue, int pageStep, int value, Qt::Orientation, QWidget *parent, const char *name=0)
void transformChange(int)
Base Anatomist object (abstract)
Definition Object.h:97
This class has to be rewritten, it's really really a shame.......
Definition Material.h:48
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