You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
829 B
25 lines
829 B
#ifndef COLORATTRIBUTER_H
|
|
#define COLORATTRIBUTER_H
|
|
|
|
#include <QObject>
|
|
#include <QVector>
|
|
#include <QColor>
|
|
#include <QString>
|
|
|
|
class ColorAttributer : public QObject
|
|
{
|
|
Q_OBJECT
|
|
protected:
|
|
std::map<float, QColor> myColors;
|
|
QString myName;
|
|
public:
|
|
float minValue, maxValue;
|
|
//ColorAttributer(QString name, const float& minValue = -3000000.0f, const float& maxValue = -1000000.0f) : minValue(minValue), maxValue(maxValue), myName(name) {}
|
|
ColorAttributer(QString name, const float& minValue = 0.0f, const float& maxValue = 1.0f) : minValue(minValue), maxValue(maxValue), myName(name) {}
|
|
Q_INVOKABLE inline QString getName() const {return myName;}
|
|
Q_INVOKABLE void addColor(const float& value, const QColor& color);
|
|
Q_INVOKABLE QColor encode(const float& value);
|
|
};
|
|
|
|
#endif // COLORATTRIBUTER_H
|