MorphoGraphX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TransferFunctionDlg.hpp
1 #ifndef TRANSFERFUNCTIONDLG_HPP
2 #define TRANSFERFUNCTIONDLG_HPP
3 
4 #include <Config.hpp>
5 
6 #include <QStringList>
7 #include <QList>
8 
9 #include <ui_TransferFunctionDlg.h>
10 
11 class QAbstractButton;
12 
13 namespace mgx {
14 namespace gui {
15 class mgx_EXPORT TransferFunctionDlg : public QDialog {
16  Q_OBJECT
17 public:
18  TransferFunctionDlg(QWidget* parent = 0, Qt::WindowFlags f = 0);
19  virtual ~TransferFunctionDlg();
20 
21  const TransferFunction& transferFunction() const;
22 
23 public slots:
24  void loadSettings(bool changeFunction = true);
25  void saveSettings();
26  void setTransferFunction(const TransferFunction& fct);
27  void setDefaultTransferFunction(const TransferFunction& fct);
28  void setStickers(const std::vector<double>& pos);
29  void changeHistogram(const std::vector<double>& h);
30  void changeBounds(const std::pair<double, double>& bounds);
31  void apply();
32  void reset();
33  void accept();
34  void reject();
35  int exec();
36 
37 signals:
38  void changedTransferFunction(const TransferFunction& fct);
39  void appliedTransferFunction(const TransferFunction& fct);
40 
41 protected slots:
42  void changeTransferFunction(const QString& name);
43  void changeTransferFunction(const TransferFunction& fct);
44  void on_useChecks_toggled(bool on);
45  void on_useWhite_toggled(bool on);
46  void on_useBlack_toggled(bool on);
47  void on_useRGB_toggled(bool on);
48  void on_useHSV_toggled(bool on);
49  void on_useCyclicHSV_toggled(bool on);
50  void on_selectSelectionColor_clicked();
51  void on_functionList_currentIndexChanged(const QString& name);
52  void on_exportFunction_clicked();
53  void on_importFunction_clicked();
54  void on_saveFunction_clicked();
55  void on_renameFunction_clicked();
56  void on_deleteFunction_clicked();
57  void resetFunctionList();
58  void on_buttonBox_clicked(QAbstractButton* btn);
59 
60 protected:
61  QColor getColor(QWidget* w);
62  void setColor(QWidget* w, const QColor& col);
63  bool changeColor(QWidget* w);
64 
65  TransferFunction current, default_fct;
66  Ui::TransferFunctionDlg ui;
67  QStringList fct_names;
69 };
70 } // namespace gui
71 } // namespace mgx
72 #endif // TRANSFERFUNCTIONDLG_HPP
AttribBase(const QString &name) const QString & name()
Default constructor of named attribute.
Definition: Attributes.hpp:54
Definition: TransferFunctionDlg.hpp:15
Class defining a transfer function as linear interpolation between set values.
Definition: TransferFunction.hpp:23