Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
AmplitudePalette.h
Go to the documentation of this file.
1#pragma once
2
3#include <QColor>
4#include <gii/gen/Variable.h>
6#include <gii/qt/Macros.h>
7#include <misc/qt/Macros.h>
9
10namespace sf
11{
12
14 : public PaletteInterface
16{
17 Q_OBJECT
21 Q_PROPERTY(QColor colorFrom READ getColorFrom WRITE setColorFrom)
22 Q_PROPERTY(QColor colorTo READ getColorTo WRITE setColorTo)
23 Q_PROPERTY(QColor colorCalib READ getColorCalib WRITE setColorCalib)
24 Q_PROPERTY(QColor colorOver READ getColorOver WRITE setColorOver)
28 // Alias of the 'calibLevel' property.
29 // Q_PROPERTY(int calibIndex READ getCalibIndex WRITE setCalibIndex STORED false)
30 Q_PROPERTY(double calibLevel READ getCalibLevel WRITE setCalibLevel)
31 Q_PROPERTY(double sizeCalib READ getSizeCalib WRITE setSizeCalib)
35 Q_PROPERTY(sf::gii::IdType idCalibMin READ getIdCalibMin WRITE setIdCalibMin)
36 Q_PROPERTY(sf::gii::IdType idCalibMax READ getIdCalibMax WRITE setIdCalibMax)
37 Q_PROPERTY(sf::gii::IdType idCalibPos READ getIdCalibPos WRITE setIdCalibPos)
38
39 public:
43 explicit AmplitudePalette(const Parameters&);
44
49
50 /*
51 * @brief Overridden from base class.
52 */
53 [[nodiscard]] ColorTable getColorTable() const override;
54
55 /*
56 * @brief Overridden from base class.
57 */
58 [[nodiscard]] qreal getCurveLevel(qreal x) const override;
59
63 [[nodiscard]] double getCalibLevel() const;
64
68 void setCalibLevel(double value);
69
70 SF_DECL_PROP_GRS(QColor, ColorFrom)
71
72 SF_DECL_PROP_GRS(QColor, ColorTo)
73
74 SF_DECL_PROP_GRS(QColor, ColorOver)
75
76 SF_DECL_PROP_GRS(QColor, ColorCalib)
77
78 SF_DECL_PROP_GS(double, SizeCalib)
79
80 SF_DECL_INFO_ID(IdCalibMin)
81
82 SF_DECL_INFO_ID(IdCalibMax)
83
84 SF_DECL_INFO_ID(IdCalibPos)
85
86 private:
90 void variableEventHandler(VariableTypes::EEvent event, const Variable& caller, Variable& link, bool same_inst) override;
91
95 void notify(void*) const;
99 Variable _vCalibMin, _vCalibMax, _vCalibPos;
103 Parameters::Callback _callback;
107 QColor _colorFrom{Qt::black};
111 QColor _colorTo{Qt::green};
115 QColor _colorCalib{Qt::blue};
119 QColor _colorOver{Qt::red};
123 Value::flt_type _sizeCalib{0.02};
127 double _calibLevel{0.7};
128};
129
130}// namespace sf
Definition AmplitudePalette.h:16
ColorTable getColorTable() const override
Gets the color table of the implementation.
QColor colorCalib
Definition AmplitudePalette.h:23
sf::gii::IdType idCalibPos
Definition AmplitudePalette.h:37
QColor colorTo
Definition AmplitudePalette.h:22
QColor colorOver
Definition AmplitudePalette.h:24
qreal getCurveLevel(qreal x) const override
Gets calculated level for color shifts.
double sizeCalib
Definition AmplitudePalette.h:31
void addPropertyPages(PropertySheetDialog *sheet) override
Overridden from base class.
sf::gii::IdType idCalibMin
Definition AmplitudePalette.h:35
double calibLevel
Definition AmplitudePalette.h:30
sf::gii::IdType idCalibMax
Definition AmplitudePalette.h:36
void setCalibLevel(double value)
Property setter.
double getCalibLevel() const
Property getter.
QColor colorFrom
Definition AmplitudePalette.h:21
Base class for the interface.
Definition PaletteInterface.h:20
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:14
double flt_type
Type used internally for storing floating point value.
Definition Value.h:28
Base class used for giving a Variable instance access to a member functions of a derived class....
Definition VariableHandler.h:14
This base class contains all local types of used in the Variable class. Multiple inheritance makes th...
Definition VariableTypes.h:26
EEvent
Events send to the handler set with sf::Variable::setHandler.
Definition VariableTypes.h:130
Class for creating and referencing global or local created parameters or settings called variables....
Definition Variable.h:16
#define SF_DECL_INFO_ID(Name)
Declaration of ID handling functions for Information ID properties.
Definition gii/qt/Macros.h:10
#define SF_DECL_PROP_GRS(Type, Name)
Declares unreferenced getter and referenced setter for a property.
Definition misc/qt/Macros.h:17
#define SF_DECL_PROP_GS(Type, Name)
Declares unreferenced getter and unreferenced setter for a property.
Definition misc/qt/Macros.h:8
Definition Application.h:10
QList< QRgb > ColorTable
Definition ColorTable.h:11
Structure passed as a constructor argument.
Definition PaletteInterface.h:28