40 qDebug() <<
"QCPSpectrum::QCPSpectrum begin";
42 setFocusPolicy(Qt::ClickFocus);
53 QCPMarginGroup *group =
new QCPMarginGroup(
this);
54 this->axisRect()->setMarginGroup(QCP::msLeft | QCP::msRight, group);
58 _p_peak_bars->setWidthType(QCPBars::WidthType::wtAbsolute);
72 SIGNAL(rangeChanged(QCPRange)),
77 std::vector<PeptideIon> all_ion_list = {
92 qDebug() <<
"SpectrumWidget::setVisibleMassDelta 5";
96 QCPBars *p_peak_bars =
new QCPBars(xAxis, yAxis);
97 p_peak_bars->setWidthType(QCPBars::WidthType::wtAbsolute);
102 p_peak_bars->setVisible(
true);
104 std::pair<PeptideIon, QCPBars *>(ion_type, p_peak_bars));
106 qDebug() <<
"SpectrumWidget::setVisibleMassDelta visible ?";
107 setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
117 this->plotLayout()->setRowSpacing(0);
121 this->setAutoAddPlottableToLegend(
false);
126 QCPScatterStyle(QCPScatterStyle::ssDisc, 4.0));
138 SIGNAL(rangeChanged(QCPRange)),
146 qDebug() <<
"QCPSpectrum::QCPSpectrum end";
159 if((spectrum !=
nullptr) && (spectrum->size() != 0))
169 _mz_range.lower = spectrum->front().x - 1;
170 _mz_range.upper = spectrum->back().x + 1;
215 qDebug() <<
"QCPSpectrum::setMzRangeChanged _mz_range.lower"
229 xAxis->setRange(range);
240 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
241 _p_peak_bars->setData(QVector<double>(), QVector<double>());
242 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
244 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
247 pair_ion_bar.second->setData(QVector<double>(), QVector<double>());
261 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
267 if(event->key() == Qt::Key_Control)
271 qDebug() <<
"QCPSpectrum::keyPressEvent end";
277 if(event->key() == Qt::Key_Control)
281 qDebug() <<
"QCPSpectrum::keyReleaseEvent end";
287 qDebug() <<
"QCPSpectrum::mousePressEvent begin "
288 << xAxis->pixelToCoord(event->x()) <<
" "
289 << yAxis->pixelToCoord(event->y());
292 _old_y = yAxis->pixelToCoord(event->y());
295 qDebug() <<
"QCPSpectrum::mousePressEvent end";
300 qDebug() <<
"QCPSpectrum::mouseReleaseEvent begin "
301 << xAxis->pixelToCoord(event->x()) <<
" "
302 << yAxis->pixelToCoord(event->y());
304 qDebug() <<
"QCPSpectrum::mouseReleaseEvent end";
312 qDebug() <<
"QCPSpectrum::mouseMoveEvent begin "
313 << xAxis->pixelToCoord(event->x()) <<
" "
314 << yAxis->pixelToCoord(event->y());
324 this->yAxis->scaleRange(
_old_y /
y, 0);
329 this->xAxis->moveRange(xAxis->pixelToCoord(
_old_x) -
330 xAxis->pixelToCoord(event->x()));
335 qDebug() <<
"QCPSpectrum::mouseMoveEvent end";
342 xAxis->pixelToCoord(10) - xAxis->pixelToCoord(5);
353 qDebug() <<
"QCPSpectrum::getNearestPeakBetween begin " <<
mz <<
" "
356 p_peak_match =
nullptr;
362 if((peak.x > min) && (peak.x <
max))
364 if(p_peak_match ==
nullptr)
366 p_peak_match = &peak;
370 if(fabs(
mz - peak.x) < fabs(
mz - p_peak_match->
x))
372 p_peak_match = &peak;
378 qDebug() <<
"QCPSpectrum::getNearestPeakBetween end";
411 const std::vector<pappso::PeptideNaturalIsotopeAverageSp> &isotope_mass_list,
415 ((
pappso_double)1.0 / isotope_mass_list.at(0).get()->getIntensityRatio()) *
420 peptide.get()->getIntensityRatio() *