qcpxic.h
Go to the documentation of this file.
/**
* \file pappsomspp/widget/xicwidget/qcpxic.h
* \date 12/1/2018
* \author Olivier Langella
* \brief custom plot XIC
*/
/*******************************************************************************
* Copyright (c) 2018 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms++ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
*implementation
******************************************************************************/
#ifndef QCPXIC_H
#define QCPXIC_H
#include <qcustomplot.h>
#include "xicwidget.h"
namespace pappso
{
class QCPXic : public QCustomPlot
{
Q_OBJECT
protected:
friend class XicWidget;
QCPXic(XicWidget *parent);
~QCPXic();
protected:
void clear();
void rescale();
void addXicP(const Xic *xic_p);
void addMsMsEvent(const Xic *xic_p, pappso::pappso_double rt);
void
addXicPeakList(const Xic *xic_p,
const std::vector<pappso::TracePeakCstSPtr> &xic_peak_list);
void setName(const Xic *xic_p, const QString &name);
void drawXicPeakBorders(unsigned int i,
const Xic *xic_p,
const pappso::TracePeak *p_xic_peak);
void clearXicPeakBorders();
virtual void mouseMoveEvent(QMouseEvent *event) override;
virtual void mousePressEvent(QMouseEvent *event) override;
virtual void mouseReleaseEvent(QMouseEvent *event) override;
virtual void keyPressEvent(QKeyEvent *event) override;
virtual void keyReleaseEvent(QKeyEvent *event) override;
private:
Q_SLOT void setRtRangeChanged(QCPRange range);
pappso::pappso_double
getRetentionTimeFromSecondsToLocal(pappso::pappso_double rt) const;
pappso::pappso_double xAxisToSeconds(pappso::pappso_double rt) const;
private:
XicWidget *_parent;
QCPRange _rt_range;
QCPRange _intensity_range;
bool _click = false;
bool _mouse_move = false;
bool _control_key = false;
pappso::pappso_double _old_x;
pappso::pappso_double _old_y;
QCPItemTracer *_current_ms2_event = nullptr;
std::map<const Xic *, QCPGraph *> _map_xic_graph;
QColor _graph_color;
std::vector<QColor> _colours;
std::vector<QCPGraph *> _graph_peak_surface_list;
std::vector<QCPItemTracer *> _graph_peak_border_list;
};
} // namespace pappso
#endif // QCPXIC_H
pappso::QCPXic
Definition: qcpxic.h:41
pappso::QCPXic::_click
bool _click
Definition: qcpxic.h:80
pappso::QCPXic::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event) override
Definition: qcpxic.cpp:84
pappso::QCPXic::_mouse_move
bool _mouse_move
Definition: qcpxic.h:81
pappso::QCPXic::addMsMsEvent
void addMsMsEvent(const Xic *xic_p, pappso::pappso_double rt)
Definition: qcpxic.cpp:237
pappso::QCPXic::clearXicPeakBorders
void clearXicPeakBorders()
Definition: qcpxic.cpp:393
pappso::QCPXic::_colours
std::vector< QColor > _colours
Definition: qcpxic.h:88
pappso::QCPXic::clear
void clear()
Definition: qcpxic.cpp:263
pappso::QCPXic::_graph_peak_border_list
std::vector< QCPItemTracer * > _graph_peak_border_list
Definition: qcpxic.h:90
pappso::QCPXic::_control_key
bool _control_key
Definition: qcpxic.h:82
pappso::QCPXic::_old_y
pappso::pappso_double _old_y
Definition: qcpxic.h:84
pappso::QCPXic::_rt_range
QCPRange _rt_range
Definition: qcpxic.h:78
pappso::QCPXic::xAxisToSeconds
pappso::pappso_double xAxisToSeconds(pappso::pappso_double rt) const
Definition: qcpxic.cpp:318
pappso::QCPXic::setName
void setName(const Xic *xic_p, const QString &name)
Definition: qcpxic.cpp:255
pappso::QCPXic::_intensity_range
QCPRange _intensity_range
Definition: qcpxic.h:79
pappso::QCPXic::_old_x
pappso::pappso_double _old_x
Definition: qcpxic.h:83
pappso::QCPXic::_graph_peak_surface_list
std::vector< QCPGraph * > _graph_peak_surface_list
Definition: qcpxic.h:89
pappso::QCPXic::~QCPXic
~QCPXic()
Definition: qcpxic.cpp:80
pappso::QCPXic::_map_xic_graph
std::map< const Xic *, QCPGraph * > _map_xic_graph
Definition: qcpxic.h:86
pappso::QCPXic::setRtRangeChanged
Q_SLOT void setRtRangeChanged(QCPRange range)
Definition: qcpxic.cpp:220
pappso::QCPXic::getRetentionTimeFromSecondsToLocal
pappso::pappso_double getRetentionTimeFromSecondsToLocal(pappso::pappso_double rt) const
Definition: qcpxic.cpp:305
pappso::QCPXic::mousePressEvent
virtual void mousePressEvent(QMouseEvent *event) override
Definition: qcpxic.cpp:104
pappso::QCPXic::drawXicPeakBorders
void drawXicPeakBorders(unsigned int i, const Xic *xic_p, const pappso::TracePeak *p_xic_peak)
Definition: qcpxic.cpp:331
pappso::QCPXic::_current_ms2_event
QCPItemTracer * _current_ms2_event
Definition: qcpxic.h:85
pappso::QCPXic::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *event) override
Definition: qcpxic.cpp:140
pappso::QCPXic::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *event) override
Definition: qcpxic.cpp:94
pappso::QCPXic::addXicPeakList
void addXicPeakList(const Xic *xic_p, const std::vector< pappso::TracePeakCstSPtr > &xic_peak_list)
Definition: qcpxic.cpp:274
pappso::QCPXic::rescale
void rescale()
Definition: qcpxic.cpp:214
pappso::QCPXic::_graph_color
QColor _graph_color
Definition: qcpxic.h:87
pappso::QCPXic::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *event) override
Definition: qcpxic.cpp:123
pappso::QCPXic::addXicP
void addXicP(const Xic *xic_p)
Definition: qcpxic.cpp:183
pappso::QCPXic::QCPXic
QCPXic(XicWidget *parent)
Definition: qcpxic.cpp:38
pappso::QCPXic::_parent
XicWidget * _parent
Definition: qcpxic.h:77
pappso::TracePeak
Definition: tracepeak.h:40
pappso::XicWidget
Definition: xicwidget.h:48
pappso::Xic
Definition: xic.h:44
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:48
xicwidget.h
plot a XIC