Loading...
Searching...
No Matches
xicwidget.h
Go to the documentation of this file.
/**
* \file pappsomspp/widget/xicwidget/xicwidget.h
* \date 12/1/2018
* \author Olivier Langella
* \brief plot a 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
******************************************************************************/
#pragma once
#include <QWidget>
#include "pappsomspp/core/xic/xic.h"
#include "pappsomspp/core/processing/detection/tracepeak.h"
#include "pappsomspp/gui/graphicdevicewidget.h"
#include <qcustomplot.h>
namespace pappso
{
class QCPXic;
typedef std::vector<std::pair<XicCstSPtr, TracePeakCstSPtr>> XicXicPeakPairList;
class PMSPP_LIB_DECL XicWidget : public GraphicDeviceWidget
{
Q_OBJECT
public:
XicWidget(QWidget *parent = 0);
~XicWidget();
QCPGraph *addXicSp(XicCstSPtr xic_sp);
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);
const QString &getName(const Xic *xic_p) const;
void clear();
void plot();
void rescale();
void toQPaintDevice(QPaintDevice *device, const QSize &size) override;
void setRetentionTimeInSeconds();
void setRetentionTimeInMinutes();
void drawXicPeakBorders(pappso::TracePeakCstSPtr xic_peak);
void clearXicPeakBorders();
/** @brief get the plots axis and rescale one axis with the given range
*/
QCPAxis *getRtAxisP();
QCPAxis *getIntensityAxisP();
void rescaleOneRange(QString axis_name, QCPRange new_range);
signals:
/** @brief announce the current retention time (under mouse) in seconds
*/
void rtChanged(double rt) const;
void xicPeakListChanged(pappso::XicXicPeakPairList xic_peak_list) const;
/** @brief announce mouse position on click (rt in seconds, intensity)
*/
void clicked(double rt, double intensity) const;
/** @brief get the new Range when its change
*/
void operateNewRange(QCPRange new_range);
protected:
friend class QCPXic;
void rtChangeEvent(pappso::pappso_double rt) const;
void xicClickEvent(pappso::pappso_double rt,
pappso::pappso_double intensity) const;
void replotAll();
XicCstSPtr getXicCstSPtr(const Xic *xic_p) const;
protected:
bool _rt_in_seconds = true;
private:
std::map<const Xic *, QString> _map_xic_name;
std::map<const Xic *, pappso::pappso_double> _map_xic_msms_event;
std::vector<XicCstSPtr> _xic_sp_list;
XicXicPeakPairList _xic_peak_sp_list;
QCPXic *_qcp_xic;
};
} // namespace pappso
GraphicDeviceWidget::GraphicDeviceWidget
GraphicDeviceWidget(QWidget *parent)
Definition graphicdevicewidget.cpp:35
pappso::QCPXic
Definition qcpxic.h:41
pappso::XicWidget::QCPXic
friend class QCPXic
Definition xicwidget.h:89
pappso::XicWidget::rescale
void rescale()
Definition xicwidget.cpp:95
pappso::XicWidget::toQPaintDevice
void toQPaintDevice(QPaintDevice *device, const QSize &size) override
Definition xicwidget.cpp:183
pappso::XicWidget::addXicPeakList
void addXicPeakList(const Xic *xic_p, const std::vector< pappso::TracePeakCstSPtr > &xic_peak_list)
Definition xicwidget.cpp:153
pappso::XicWidget::rtChanged
void rtChanged(double rt) const
announce the current retention time (under mouse) in seconds
pappso::XicWidget::getIntensityAxisP
QCPAxis * getIntensityAxisP()
Definition xicwidget.cpp:109
pappso::XicWidget::_xic_sp_list
std::vector< XicCstSPtr > _xic_sp_list
Definition xicwidget.h:102
pappso::XicWidget::clearXicPeakBorders
void clearXicPeakBorders()
Definition xicwidget.cpp:279
pappso::XicWidget::operateNewRange
void operateNewRange(QCPRange new_range)
get the new Range when its change
pappso::XicWidget::getXicCstSPtr
XicCstSPtr getXicCstSPtr(const Xic *xic_p) const
Definition xicwidget.cpp:139
pappso::XicWidget::plot
void plot()
Definition xicwidget.cpp:90
pappso::XicWidget::_xic_peak_sp_list
XicXicPeakPairList _xic_peak_sp_list
Definition xicwidget.h:103
pappso::XicWidget::_map_xic_name
std::map< const Xic *, QString > _map_xic_name
Definition xicwidget.h:100
pappso::XicWidget::replotAll
void replotAll()
Definition xicwidget.cpp:212
pappso::XicWidget::XicWidget
XicWidget(QWidget *parent=0)
Definition xicwidget.cpp:41
pappso::XicWidget::setRetentionTimeInMinutes
void setRetentionTimeInMinutes()
Definition xicwidget.cpp:204
pappso::XicWidget::getName
const QString & getName(const Xic *xic_p) const
Definition xicwidget.cpp:74
pappso::XicWidget::rtChangeEvent
void rtChangeEvent(pappso::pappso_double rt) const
Definition xicwidget.cpp:164
pappso::XicWidget::addXicSp
QCPGraph * addXicSp(XicCstSPtr xic_sp)
Definition xicwidget.cpp:67
pappso::XicWidget::_rt_in_seconds
bool _rt_in_seconds
Definition xicwidget.h:97
pappso::XicWidget::_map_xic_msms_event
std::map< const Xic *, pappso::pappso_double > _map_xic_msms_event
Definition xicwidget.h:101
pappso::XicWidget::getRtAxisP
QCPAxis * getRtAxisP()
get the plots axis and rescale one axis with the given range
Definition xicwidget.cpp:103
pappso::XicWidget::xicPeakListChanged
void xicPeakListChanged(pappso::XicXicPeakPairList xic_peak_list) const
pappso::XicWidget::addMsMsEvent
void addMsMsEvent(const Xic *xic_p, pappso::pappso_double rt)
Definition xicwidget.cpp:60
pappso::XicWidget::setName
void setName(const Xic *xic_p, const QString &name)
Definition xicwidget.cpp:81
pappso::XicWidget::clicked
void clicked(double rt, double intensity) const
announce mouse position on click (rt in seconds, intensity)
pappso::XicWidget::rescaleOneRange
void rescaleOneRange(QString axis_name, QCPRange new_range)
Definition xicwidget.cpp:115
pappso::XicWidget::drawXicPeakBorders
void drawXicPeakBorders(pappso::TracePeakCstSPtr xic_peak)
Definition xicwidget.cpp:249
pappso::XicWidget::xicClickEvent
void xicClickEvent(pappso::pappso_double rt, pappso::pappso_double intensity) const
Definition xicwidget.cpp:242
pappso::XicWidget::clear
void clear()
Definition xicwidget.cpp:129
pappso::XicWidget::_qcp_xic
QCPXic * _qcp_xic
Definition xicwidget.h:104
pappso::XicWidget::setRetentionTimeInSeconds
void setRetentionTimeInSeconds()
Definition xicwidget.cpp:197
pappso::Xic
Definition xic.h:44
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
graphicdevicewidget.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::XicCstSPtr
std::shared_ptr< const Xic > XicCstSPtr
Definition xic.h:38
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition types.h:60
pappso::XicXicPeakPairList
std::vector< std::pair< XicCstSPtr, TracePeakCstSPtr > > XicXicPeakPairList
Definition xicwidget.h:45
pappso::TracePeakCstSPtr
std::shared_ptr< const TracePeak > TracePeakCstSPtr
Definition tracepeak.h:35
tracepeak.h
xic.h