simpletransferfunctioneditor.h 1.47 KB
Newer Older
schultezub's avatar
schultezub committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef SIMPLETRANSFERFUNCTIONEDITOR_H__
#define SIMPLETRANSFERFUNCTIONEDITOR_H__

#include "application/gui/properties/abstracttransferfunctioneditor.h"
#include <QWidget>

class QGridLayout;
class QLabel;

namespace TUMVis {
    class ColorPickerWidget;
    class SimpleTransferFunction;

    /**
     * Editor widget for a SimpleTransferFunction.
     */
    class SimpleTransferFunctionEditor : public AbstractTransferFunctionEditor {
        Q_OBJECT;

    public:
        /**
         * Creates a new editor widget for the for the TransferFunctionProperty \a property.
         * \param   tf          The transfer function the editor shall handle.
         * \param   parent      Parent Qt widget
         */
        SimpleTransferFunctionEditor(SimpleTransferFunction* tf, QWidget* parent = 0);

        /**
         * Destructor
         */
        virtual ~SimpleTransferFunctionEditor();

    protected:
        /**
         * Gets called when the property has changed, so that widget can update its state.
         */
        virtual void updateWidgetFromProperty();

    private slots:
        void onLeftColorChanged(const QColor& color);
        void onRightColorChanged(const QColor& color);

    private:
        QGridLayout* _layout;

        QLabel* _lblColorLeft;
        QLabel* _lblColorRight;
        ColorPickerWidget* _cpwColorLeft;
        ColorPickerWidget* _cpwColorRight;
    };
}

#endif // SIMPLETRANSFERFUNCTIONEDITOR_H__