MorphoGraphX  2.0-1-227
TransferFunctionDlg.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef TRANSFERFUNCTIONDLG_HPP
12 #define TRANSFERFUNCTIONDLG_HPP
13 
14 #include <Config.hpp>
15 
16 #include <QStringList>
17 #include <QList>
18 
19 #include <ui_TransferFunctionDlg.h>
20 
21 class QAbstractButton;
22 
23 namespace mgx {
24  class mgx_EXPORT TransferFunctionDlg : public QDialog {
25  Q_OBJECT
26  public:
27  TransferFunctionDlg(QWidget* parent = 0, Qt::WindowFlags f = 0);
28 
29  const TransferFunction& transferFunction() const;
30 
31  public slots:
32  void loadSettings(bool changeFunction = true);
33  void setTransferFunction(const TransferFunction& fct);
34  void setDefaultTransferFunction(const TransferFunction& fct);
35  void setStickers(const std::vector<double>& pos);
36  void changeHistogram(const std::vector<double>& h);
37  void changeBounds(const std::pair<double, double>& bounds);
38  void apply();
39  void reset();
40  void accept();
41  void reject();
42  int exec();
43 
44  signals:
45  void changedTransferFunction(const TransferFunction& fct);
46  void appliedTransferFunction(const TransferFunction& fct);
47 
48  protected slots:
49  void changeTransferFunction(const QString& name);
50  void changeTransferFunction(const TransferFunction& fct);
51  void on_useChecks_toggled(bool on);
52  void on_useWhite_toggled(bool on);
53  void on_useBlack_toggled(bool on);
54  void on_useRGB_toggled(bool on);
55  void on_useHSV_toggled(bool on);
56  void on_useCyclicHSV_toggled(bool on);
57  void on_selectSelectionColor_clicked();
58  void on_functionList_currentIndexChanged(const QString& name);
59  void on_exportFunction_clicked();
60  void on_importFunction_clicked();
61  void on_saveFunction_clicked();
62  void on_renameFunction_clicked();
63  void on_deleteFunction_clicked();
64  void resetFunctionList();
65  void on_buttonBox_clicked(QAbstractButton* btn);
66 
67  protected:
68  QColor getColor(QWidget* w);
69  void setColor(QWidget* w, const QColor& col);
70  bool changeColor(QWidget* w);
71 
73  Ui::TransferFunctionDlg ui;
74  QStringList fct_names;
75  QList<TransferFunction> fcts;
76  };
77 }
78 #endif
mgx::TransferFunctionDlg::ui
Ui::TransferFunctionDlg ui
Definition: TransferFunctionDlg.hpp:73
mgx::TransferFunctionDlg::default_fct
TransferFunction default_fct
Definition: TransferFunctionDlg.hpp:72
mgx::TransferFunction
Definition: TransferFunction.hpp:34
mgx::TransferFunctionDlg::fcts
QList< TransferFunction > fcts
Definition: TransferFunctionDlg.hpp:75
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::TransferFunctionDlg
Definition: TransferFunctionDlg.hpp:24
mgx::TransferFunctionDlg::fct_names
QStringList fct_names
Definition: TransferFunctionDlg.hpp:74