Stacked Graphs
Geometry & Aesthetics
 All Classes Functions Variables Enumerations
graphcolorizer.h
1 #ifndef GRAPHCOLORIZER_H
2 #define GRAPHCOLORIZER_H
3 
4 #include <QObject>
5 #include "dataset.h"
6 
10 class GraphColorizer : public QObject
11 {
12  Q_OBJECT
13 
14 public:
18  enum ColoringAttribute { OnsetTime = 0, Volatility, SIZE_OF_ENUM };
19 
23  static const char* const coloringAttribute_str[ColoringAttribute::SIZE_OF_ENUM];
24 
25  GraphColorizer(QObject *parent);
26  ~GraphColorizer();
27 
33  void SetColors(QColor const beginColor, QColor const endColor);
34 
39  void Set2DColoring(bool enable);
40 
46  void Colorize(DataSet& const dataset, ColoringAttribute attr);
47 private:
48  float calculateRatio(DataSet& const dataset, DataItem& const dataitem, ColoringAttribute const attribute);
49 
50  QColor mBeginColor;
51  QColor mEndColor;
52  bool m2DColoring;
53 };
54 
55 #endif // GRAPHCOLORIZER_H
void Colorize(DataSet &const dataset, ColoringAttribute attr)
Assigns each dataitem a color value according to the set begin/end colors and coloring attribute...
Definition: graphcolorizer.cpp:34
void Set2DColoring(bool enable)
Sets a flag which enables 2D coloring: alpha value of color changes according to the layours sum valu...
Definition: graphcolorizer.cpp:29
ColoringAttribute
List of attributes which can be used to calculate an appropriate color value.
Definition: graphcolorizer.h:18
The data set.
Definition: dataset.h:85
Represents a single layer of the stacked graph.
Definition: dataset.h:23
static const char *const coloringAttribute_str[ColoringAttribute::SIZE_OF_ENUM]
String value of the attributes used to display in the GUI.
Definition: graphcolorizer.h:23
Class provides coloring for the graph layers by using linear interpolation.
Definition: graphcolorizer.h:10
void SetColors(QColor const beginColor, QColor const endColor)
Sets the colors which define the start and end color of the linearly interpolated color gradient used...
Definition: graphcolorizer.cpp:16