FITSHistogram::FITSHistogram(QWidget *parent) : QDialog(parent) { ui = new histogramUI(this); tab = static_cast<FITSTab *> (parent); type = FITS_AUTO; customPlot = ui->histogramPlot; customPlot->setBackground(QBrush(Qt::black)); customPlot->xAxis->setBasePen(QPen(Qt::white, 1)); customPlot->yAxis->setBasePen(QPen(Qt::white, 1)); customPlot->xAxis->setTickPen(QPen(Qt::white, 1)); customPlot->yAxis->setTickPen(QPen(Qt::white, 1)); customPlot->xAxis->setSubTickPen(QPen(Qt::white, 1)); customPlot->yAxis->setSubTickPen(QPen(Qt::white, 1)); customPlot->xAxis->setTickLabelColor(Qt::white); customPlot->yAxis->setTickLabelColor(Qt::white); customPlot->xAxis->setLabelColor(Qt::white); customPlot->yAxis->setLabelColor(Qt::white); customPlot->xAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); customPlot->yAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); customPlot->xAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); customPlot->yAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); customPlot->xAxis->grid()->setZeroLinePen(Qt::NoPen); customPlot->yAxis->grid()->setZeroLinePen(Qt::NoPen); r_graph = customPlot->addGraph(); r_graph->setBrush(QBrush(QColor(170, 40, 80))); r_graph->setPen(QPen(Qt::red)); //r_graph->setLineStyle(QCPGraph::lsImpulse); connect(ui->applyB, SIGNAL(clicked()), this, SLOT(applyScale())); connect(customPlot, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(updateValues(QMouseEvent*))); connect(ui->minEdit, SIGNAL(valueChanged(double)), this, SLOT(updateLimits(double))); connect(ui->maxEdit, SIGNAL(valueChanged(double)), this, SLOT(updateLimits(double))); connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(checkRangeLimit(QCPRange))); constructHistogram(); }
FITSHistogram::FITSHistogram(QWidget *parent) : QDialog(parent) { ui = new histogramUI(this); tab = (FITSTab *) parent; type = FITS_AUTO; napply = 0; connect(ui->applyB, SIGNAL(clicked()), this, SLOT(applyScale())); connect(ui->minOUT, SIGNAL(editingFinished()), this, SLOT(updateLowerLimit())); connect(ui->maxOUT, SIGNAL(editingFinished()), this, SLOT(updateUpperLimit())); connect(ui->minSlider, SIGNAL(valueChanged(int)), this, SLOT(minSliderUpdated(int))); connect(ui->maxSlider, SIGNAL(valueChanged(int)), this, SLOT(maxSliderUpdated(int))); ui->histFrame->init(); constructHistogram(ui->histFrame->getHistWidth(), ui->histFrame->getHistHeight()); }
void FITSHistogram::updateHistogram() { constructHistogram(ui->histFrame->maximumWidth(), ui->histFrame->maximumHeight()); //constructHistogram(histogram_width, histogram_height); }