diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2015-05-18 18:33:50 -0300 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2015-05-21 18:09:02 -0300 |
commit | a96f9f1a2688c215c478cfbee5748b4bb2043a43 (patch) | |
tree | 0f46c89bc7eaa08994faa1095b480baaa1f64c72 /colorscale.h | |
parent | 54571b4a4dcc076923325ee09ad348f389fc25a5 (diff) |
Updated UI.
- Removed unnecessary UI elements from QML file;
- Added the ColorScale class and implemented glyph color mapping from class
labels;
- Mark geometry nodes of individual glyphs as dirty when updating the scene
graph.
Diffstat (limited to 'colorscale.h')
-rw-r--r-- | colorscale.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/colorscale.h b/colorscale.h new file mode 100644 index 0000000..6e1212d --- /dev/null +++ b/colorscale.h @@ -0,0 +1,24 @@ +#ifndef COLORSCALE_H +#define COLORSCALE_H + +#include <initializer_list> +#include <QColor> +#include <QList> + +class ColorScale +{ +public: + ColorScale(const QColor &firstColor, const QColor &lastColor); + ColorScale(std::initializer_list<QColor> colors); + ColorScale(const QList<QColor> &colors); + ~ColorScale(); + + void setExtents(qreal min, qreal max); + QColor color(qreal t) const; + +private: + qreal m_min, m_max; + QList<QColor> m_colors; +}; + +#endif // COLORSCALE_H |