HistogramToolDialog.h
1.11 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
#ifndef HISTOGRAMTOOLDIALOG_H
#define HISTOGRAMTOOLDIALOG_H
#include "ui_HistogramToolDialog.h"
#include "VolumeDataStruct.h"
#include "GlobalValues.h"
#include <QFileDialog>
#include <iostream>
using namespace std;
class HistogramToolDialog : public QDialog
{
Q_OBJECT
public:
HistogramToolDialog(QWidget *parent = 0, Qt::WFlags flags = 0)
{
ui.setupUi(this);
}
~HistogramToolDialog(){}
private:
Ui::HistogramToolDialogClass ui;
public slots:
void on_okButton_clicked()
{
}
void on_btnCreateHistogram_clicked()
{
//get the user-specified histogram margins
float minX = ui.spinMinX->value();
float maxX = ui.spinMaxX->value();
float minY = ui.spinMinY->value();
float maxY = ui.spinMaxY->value();
int bins = ui.spinBins->value();
//create the histogram and compute the exact margins
CreateHistogram(bins, minX, maxX, minY, maxY);
//display the exact margins in the labels
ui.lblDataMinX->setText(QString::number(minX));
ui.lblDataMaxX->setText(QString::number(maxX));
ui.lblDataMinY->setText(QString::number(minY));
ui.lblDataMaxY->setText(QString::number(maxY));
}
};
#endif