Stacked Graphs
Geometry & Aesthetics
 All Classes Functions Variables Enumerations
graphsorter.h
1 #ifndef GRAPHSORTER_H
2 #define GRAPHSORTER_H
3 
4 #include "namedobject.h"
5 #include "dataset.h"
6 
10 class GraphSorter : public QObject, public INamedObject
11 {
12  Q_OBJECT
13  Q_INTERFACES(INamedObject)
14 public:
18  enum SortingAttribute { OnsetTimeASC = 0, OnsetTimeDESC, VolatilityASC, VolatilityDESC, SIZE_OF_ENUM };
19 
23  static const char* const sortingAttribute_str[SortingAttribute::SIZE_OF_ENUM];
24 
25  GraphSorter(QObject *parent);
26  ~GraphSorter();
27 
33  void Sort(DataSet& data, const SortingAttribute attribute);
34 private:
35  virtual void orderLayers(DataSet& data) = 0;
36 
37  bool comparator (DataItem a, DataItem b, const SortingAttribute sortAttr);
38 };
39 
40 #endif // GRAPHSORTER_H
void Sort(DataSet &data, const SortingAttribute attribute)
Sorts the dataset in a preprocessing step according to its dataitems sorting attribute value...
Definition: graphsorter.cpp:22
SortingAttribute
List of attributes used to sort the dataset.
Definition: graphsorter.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 sortingAttribute_str[SortingAttribute::SIZE_OF_ENUM]
String value of the sorting attributes used to display in the GUI.
Definition: graphsorter.h:23
Derived classes provide sorting functionality for the graph layers, usign different algorithms...
Definition: graphsorter.h:10
Interface for objects which have a name.
Definition: namedobject.h:9