-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHistogram.h
More file actions
111 lines (95 loc) · 3.05 KB
/
Copy pathHistogram.h
File metadata and controls
111 lines (95 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
* @file Histogram.h
* @author Dan R. Lipsa
* @date 22 July 2010
* @brief A histogram GUI that allows selection of bins.
* @ingroup view
*/
#ifndef __HISTOGRAM_H__
#define __HISTOGRAM_H__
#include "Enums.h"
class HistogramItem;
class HistogramSettings;
/**
* @brief A histogram GUI that allows selection of bins.
*/
class Histogram : public QwtPlot
{
public:
enum SelectionTool
{
NONE,
BRUSH,
ERASER
};
public:
Histogram (QWidget* parent = 0);
bool AreAllItemsSelected () const;
void GetSelectedIntervals(vector<QwtDoubleInterval>* intervals) const;
void GetSelectedBins (BinRegions* intervals, bool selected = true) const;
void SetSelectedBinsNoSignal (const BinRegions& bins);
void SetColorCoded (bool colorCoded);
void SetColorTransferFunction (const QwtDoubleInterval& interval,
const QwtLinearColorMap& colorMap);
void SetDisplayColorBar (bool displayColorBar = true);
void SetYAxisLogScale (bool logYAxis);
bool IsYAxisLogScale () const;
void SetYAxisMaxValue (double axisMaxValue);
double GetYAxisMaxValue () const;
size_t GetYAxisMaxValueData () const;
double GetYAxisMinValue () const;
void SetXAxisLogScale (bool logYAxis);
void SetXAxisMaxValue (double value);
double GetXAxisMaxValue () const;
void SetXAxisMinValue (double value);
double GetXAxisMinValue () const;
void SetDataKeepBinSelection (
const QwtIntervalData& intervalData, double maxValue,
const char* axisTitle, const BinRegions& selectedBins);
void SetDataAllBinsSelected (
const QwtIntervalData& intervalData, double maxValue,
const char* axisTitle);
bool HasData () const;
void SetAllItemsSelection (bool selected);
void SetItemsSelectionHigh (bool selected, double value);
void SetItemsSelectionLow (bool selected, double value);
void SetSelectionTool (SelectionTool selectionTool);
bool IsGridEnabled () const;
void SetDefaultFont ();
virtual QSize sizeHint () const;
void SetSizeHint (const QSize& sizeHint)
{
m_sizeHint = sizeHint;
}
Q_SIGNALS:
void SelectionChanged ();
public Q_SLOTS:
void SelectionPointMoved (const QPoint& pos);
void SelectionPointAppended (const QPoint& pos);
void PolygonSelected (const QwtPolygon& poly);
void HistogramSettingsDialog ();
void SetGridEnabled (bool enabled);
private:
size_t getBin (double value);
void setData (const QwtIntervalData& intervalData, double maxValue,
const vector< pair<size_t, size_t> >* selectedBins = 0);
void alignScales();
void setAxisTitleDefaultFont (int axisId, const char* s = 0);
void setAxisDefaultFont (int axisId);
private:
Q_OBJECT
QwtPlotGrid m_grid;
boost::shared_ptr<HistogramItem> m_histogramItem;
QwtPlotPicker m_plotPicker;
size_t m_beginBinSelection;
SelectionTool m_selectionTool;
bool m_displayColorBar;
boost::shared_ptr<HistogramSettings> m_histogramHeight;
QSize m_sizeHint;
private:
const static QSize SIZE_HINT;
};
#endif //__HISTOGRAM_H__
// Local Variables:
// mode: c++
// End: