Loading...
Searching...
No Matches
pappso::XicWidget Class Reference

`#include <xicwidget.h>`

Inheritance diagram for pappso::XicWidget:

## Signals

void | rtChanged (double rt) const
| announce the current retention time (under mouse) in seconds
void | xicPeakListChanged (pappso::XicXicPeakPairList xic_peak_list) const
void | clicked (double rt, double intensity) const
| announce mouse position on click (rt in seconds, intensity)
void | operateNewRange (QCPRange new_range)
| get the new Range when its change

## Public Member Functions

| 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 ()
QCPAxis * | getRtAxisP ()
| get the plots axis and rescale one axis with the given range
QCPAxis * | getIntensityAxisP ()
void | rescaleOneRange (QString axis_name, QCPRange new_range)
Public Member Functions inherited from GraphicDeviceWidget
| GraphicDeviceWidget (QWidget *parent)
virtual | ~GraphicDeviceWidget ()
virtual void | toSvgFile (const QString &filename, const QString &title, const QString &description, const QSize &size) final

## Protected Member Functions

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 Attributes

bool | _rt_in_seconds = true

## Private Attributes

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

## Friends

class | QCPXic

## Detailed Description

Definition at line 47 of file xicwidget.h.

## Constructor & Destructor Documentation

## XicWidget()

XicWidget::XicWidget | ( | QWidget * | parent = 0 | ) |

Definition at line 41 of file xicwidget.cpp.

: GraphicDeviceWidget(parent)
{
qDebug() << "XicWidget::XicWidget begin";
this->setLayout(new QHBoxLayout(this));
setMinimumSize(200, 160);
this->layout()->setContentsMargins(0, 0, 0, 0);
_qcp_xic = new QCPXic(this);
this->layout()->addWidget(_qcp_xic);
qDebug() << "XicWidget::XicWidget end";
}
GraphicDeviceWidget::GraphicDeviceWidget
GraphicDeviceWidget(QWidget *parent)
Definition graphicdevicewidget.cpp:35
pappso::XicWidget::QCPXic
friend class QCPXic
Definition xicwidget.h:89
pappso::XicWidget::_qcp_xic
QCPXic * _qcp_xic
Definition xicwidget.h:104

References GraphicDeviceWidget::GraphicDeviceWidget(), _qcp_xic, and QCPXic.

## ~XicWidget()

XicWidget::~XicWidget | ( |  | ) |

Definition at line 55 of file xicwidget.cpp.

{
}

## Member Function Documentation

## addMsMsEvent()

void XicWidget::addMsMsEvent | ( | const Xic * | xic_p,
|  | pappso::pappso_double | rt )

Definition at line 60 of file xicwidget.cpp.

{
XicCstSPtr xic_sp = getXicCstSPtr(xic_p);
_qcp_xic->addMsMsEvent(xic_p, rt);
_map_xic_msms_event[xic_p] = rt;
}
pappso::XicWidget::getXicCstSPtr
XicCstSPtr getXicCstSPtr(const Xic *xic_p) const
Definition xicwidget.cpp:139
pappso::XicWidget::_map_xic_msms_event
std::map< const Xic *, pappso::pappso_double > _map_xic_msms_event
Definition xicwidget.h:101
pappso::Enums::DataKind::rt
@ rt
Retention time.
Definition types.h:251
pappso::XicCstSPtr
std::shared_ptr< const Xic > XicCstSPtr
Definition xic.h:38

References _map_xic_msms_event, _qcp_xic, and getXicCstSPtr().

## addXicPeakList()

void XicWidget::addXicPeakList | ( | const Xic * | xic_p,
|  | const std::vector< pappso::TracePeakCstSPtr > & | xic_peak_list )

Definition at line 153 of file xicwidget.cpp.

{
XicCstSPtr xic_sp = getXicCstSPtr(xic_p);
_qcp_xic->addXicPeakList(xic_p, xic_peak_list);
for(const pappso::TracePeakCstSPtr &xic_peak : xic_peak_list)
{
_xic_peak_sp_list.push_back(std::pair<XicCstSPtr, TracePeakCstSPtr>(xic_sp, xic_peak));
}
}
pappso::XicWidget::_xic_peak_sp_list
XicXicPeakPairList _xic_peak_sp_list
Definition xicwidget.h:103
pappso::TracePeakCstSPtr
std::shared_ptr< const TracePeak > TracePeakCstSPtr
Definition tracepeak.h:35

References _qcp_xic, _xic_peak_sp_list, and getXicCstSPtr().

## addXicSp()

QCPGraph * XicWidget::addXicSp | ( | XicCstSPtr | xic_sp | ) |

Definition at line 67 of file xicwidget.cpp.

{
_xic_sp_list.push_back(xic_sp);
return _qcp_xic->addXicP(xic_sp.get());
}
pappso::XicWidget::_xic_sp_list
std::vector< XicCstSPtr > _xic_sp_list
Definition xicwidget.h:102

References _qcp_xic, and _xic_sp_list.

## clear()

void XicWidget::clear | ( |  | ) |

Definition at line 129 of file xicwidget.cpp.

{
_map_xic_name.clear();
_xic_sp_list.clear();
_xic_peak_sp_list.clear();
_qcp_xic->clear();
_map_xic_msms_event.clear();
}
pappso::XicWidget::_map_xic_name
std::map< const Xic *, QString > _map_xic_name
Definition xicwidget.h:100

References _map_xic_msms_event, _map_xic_name, _qcp_xic, _xic_peak_sp_list, and _xic_sp_list.

## clearXicPeakBorders()

void XicWidget::clearXicPeakBorders | ( |  | ) |

Definition at line 279 of file xicwidget.cpp.

{
_qcp_xic->clearXicPeakBorders();
}

References _qcp_xic.

## clicked

void pappso::XicWidget::clicked | ( | double | rt,
|  | double | intensity ) const

signal

announce mouse position on click (rt in seconds, intensity)

Referenced by xicClickEvent().

## drawXicPeakBorders()

void XicWidget::drawXicPeakBorders | ( | pappso::TracePeakCstSPtr | xic_peak | ) |

Definition at line 249 of file xicwidget.cpp.

{
XicCstSPtr xic_sp;
for(std::pair<XicCstSPtr, TracePeakCstSPtr> pair_xic_peak : _xic_peak_sp_list)
{
if(pair_xic_peak.second.get() == xic_peak.get())
{
xic_sp = pair_xic_peak.first;
break;
}
}
if(xic_sp.get() != nullptr)
{
unsigned int i = 0;
for(XicCstSPtr xic_in_list : _xic_sp_list)
{
if(xic_in_list.get() == xic_sp.get())
{
break;
}
i++;
}
_qcp_xic->drawXicPeakBorders(i, xic_sp.get(), xic_peak.get());
}
}

References _qcp_xic, _xic_peak_sp_list, and _xic_sp_list.

## getIntensityAxisP()

QCPAxis * XicWidget::getIntensityAxisP | ( |  | ) |

Definition at line 109 of file xicwidget.cpp.

{
return _qcp_xic->yAxis;
}

References _qcp_xic.

## getName()

const QString & XicWidget::getName | ( | const Xic * | xic_p | ) | const

Definition at line 74 of file xicwidget.cpp.

{
XicCstSPtr xic_sp = getXicCstSPtr(xic_p);
return _map_xic_name.at(xic_p);
}

References _map_xic_name, and getXicCstSPtr().

## getRtAxisP()

QCPAxis * XicWidget::getRtAxisP | ( |  | ) |

get the plots axis and rescale one axis with the given range

Definition at line 103 of file xicwidget.cpp.

{
return _qcp_xic->xAxis;
}

References _qcp_xic.

## getXicCstSPtr()

XicCstSPtr XicWidget::getXicCstSPtr | ( | const Xic * | xic_p | ) | const

protected

Definition at line 139 of file xicwidget.cpp.

{
std::vector<XicCstSPtr>::const_iterator it =
std::find_if(_xic_sp_list.begin(), _xic_sp_list.end(), [xic_p](XicCstSPtr xic_sp) {
return xic_sp.get() == xic_p;
});
if(it == _xic_sp_list.end())
{
throw pappso::ExceptionNotFound(tr("ERROR : xic pointer not found"));
}
return *it;
}

References _xic_sp_list.

Referenced by addMsMsEvent(), addXicPeakList(), getName(), QCPXic, and setName().

## operateNewRange

void pappso::XicWidget::operateNewRange | ( | QCPRange | new_range | ) |

signal

get the new Range when its change

## plot()

void XicWidget::plot | ( |  | ) |

Definition at line 90 of file xicwidget.cpp.

{
_qcp_xic->replot();
}

References _qcp_xic.

## replotAll()

void XicWidget::replotAll | ( |  | ) |

protected

Definition at line 212 of file xicwidget.cpp.

{
_qcp_xic->clear();
for(XicCstSPtr xic_sp : _xic_sp_list)
{
_qcp_xic->addXicP(xic_sp.get());
std::vector<TracePeakCstSPtr> xic_peak_list;
for(auto xic_map_peak_list : _xic_peak_sp_list)
{
if(xic_map_peak_list.first.get() == xic_sp.get())
xic_peak_list.push_back(xic_map_peak_list.second);
}
_qcp_xic->addXicPeakList(xic_sp.get(), xic_peak_list);
}
for(auto xic_name : _map_xic_name)
{
setName(xic_name.first, xic_name.second);
}
for(auto xic_msms : _map_xic_msms_event)
{
_qcp_xic->addMsMsEvent(xic_msms.first, xic_msms.second);
}
rescale();
_qcp_xic->replot();
}
pappso::XicWidget::rescale
void rescale()
Definition xicwidget.cpp:95
pappso::XicWidget::setName
void setName(const Xic *xic_p, const QString &name)
Definition xicwidget.cpp:81

References _map_xic_msms_event, _map_xic_name, _qcp_xic, _xic_peak_sp_list, _xic_sp_list, rescale(), and setName().

Referenced by QCPXic, setRetentionTimeInMinutes(), and setRetentionTimeInSeconds().

## rescale()

void XicWidget::rescale | ( |  | ) |

Definition at line 95 of file xicwidget.cpp.

{
_qcp_xic->xAxis->rescale(true);
_qcp_xic->yAxis->rescale(true);
_qcp_xic->rescale();
}

References _qcp_xic.

Referenced by replotAll().

## rescaleOneRange()

void XicWidget::rescaleOneRange | ( | QString | axis_name,
|  | QCPRange | new_range )

Definition at line 115 of file xicwidget.cpp.

{
if(axis_name == "xAxis")
{
_qcp_xic->xAxis->setRange(new_range);
}
else // axis_name == "yAxis"
{
_qcp_xic->yAxis->setRange(new_range);
}
_qcp_xic->replot();
}

References _qcp_xic.

## rtChanged

void pappso::XicWidget::rtChanged | ( | double | rt | ) | const

signal

announce the current retention time (under mouse) in seconds

Referenced by rtChangeEvent().

## rtChangeEvent()

void XicWidget::rtChangeEvent | ( | pappso::pappso_double | rt | ) | const

protected

Definition at line 164 of file xicwidget.cpp.

{
emit rtChanged(rt);
std::vector<std::pair<XicCstSPtr, TracePeakCstSPtr>> over_xic_peak_list;
for(std::pair<XicCstSPtr, TracePeakCstSPtr> pair_xic_peak : _xic_peak_sp_list)
{
if(pair_xic_peak.second.get()->containsRt(rt))
{
over_xic_peak_list.push_back(pair_xic_peak);
}
}
// if (over_xic_peak_list.size() > 0) {
emit xicPeakListChanged(over_xic_peak_list);
//}
}
pappso::XicWidget::rtChanged
void rtChanged(double rt) const
announce the current retention time (under mouse) in seconds
pappso::XicWidget::xicPeakListChanged
void xicPeakListChanged(pappso::XicXicPeakPairList xic_peak_list) const

References _xic_peak_sp_list, rtChanged(), and xicPeakListChanged().

Referenced by QCPXic.

## setName()

void XicWidget::setName | ( | const Xic * | xic_p,
|  | const QString & | name )

Definition at line 81 of file xicwidget.cpp.

{
XicCstSPtr xic_sp = getXicCstSPtr(xic_p);
_qcp_xic->legend->setVisible(true);
_qcp_xic->setName(xic_p, name);
_map_xic_name[xic_p] = name;
}

References _map_xic_name, _qcp_xic, and getXicCstSPtr().

Referenced by replotAll().

## setRetentionTimeInMinutes()

void XicWidget::setRetentionTimeInMinutes | ( |  | ) |

Definition at line 204 of file xicwidget.cpp.

{
_rt_in_seconds = false;
_qcp_xic->xAxis->setLabel("retention time (min)");
replotAll();
}
pappso::XicWidget::replotAll
void replotAll()
Definition xicwidget.cpp:212
pappso::XicWidget::_rt_in_seconds
bool _rt_in_seconds
Definition xicwidget.h:97

References _qcp_xic, _rt_in_seconds, and replotAll().

## setRetentionTimeInSeconds()

void XicWidget::setRetentionTimeInSeconds | ( |  | ) |

Definition at line 197 of file xicwidget.cpp.

{
_rt_in_seconds = true;
_qcp_xic->xAxis->setLabel("retention time (sec)");
replotAll();
}

References _qcp_xic, _rt_in_seconds, and replotAll().

## toQPaintDevice()

void XicWidget::toQPaintDevice | ( | QPaintDevice * | device,
|  | const QSize & | size )

override virtual

Implements GraphicDeviceWidget.

Definition at line 183 of file xicwidget.cpp.

{
if(_qcp_xic != nullptr)
{
QCPPainter painter;
painter.begin(device);
_qcp_xic->toPainter(&painter, size.width(), size.height());
painter.end();
}
}

References _qcp_xic.

## xicClickEvent()

void XicWidget::xicClickEvent | ( | pappso::pappso_double | rt,
|  | pappso::pappso_double | intensity ) const

protected

Definition at line 242 of file xicwidget.cpp.

{
emit clicked(rt, intensity);
}
pappso::XicWidget::clicked
void clicked(double rt, double intensity) const
announce mouse position on click (rt in seconds, intensity)

References clicked().

Referenced by QCPXic.

## xicPeakListChanged

void pappso::XicWidget::xicPeakListChanged | ( | pappso::XicXicPeakPairList | xic_peak_list | ) | const

signal

Referenced by rtChangeEvent().

## Friends And Related Symbol Documentation

## QCPXic

friend class QCPXic

friend

Definition at line 89 of file xicwidget.h.

References getXicCstSPtr(), QCPXic, replotAll(), rtChangeEvent(), and xicClickEvent().

Referenced by XicWidget(), and QCPXic.

## Member Data Documentation

## _map_xic_msms_event

std::map<const Xic *, pappso::pappso_double> pappso::XicWidget::_map_xic_msms_event

private

Definition at line 101 of file xicwidget.h.

Referenced by addMsMsEvent(), clear(), and replotAll().

## _map_xic_name

std::map<const Xic *, QString> pappso::XicWidget::_map_xic_name

private

Definition at line 100 of file xicwidget.h.

Referenced by clear(), getName(), replotAll(), and setName().

## _qcp_xic

QCPXic* pappso::XicWidget::_qcp_xic

private

Definition at line 104 of file xicwidget.h.

Referenced by XicWidget(), addMsMsEvent(), addXicPeakList(), addXicSp(), clear(), clearXicPeakBorders(), drawXicPeakBorders(), getIntensityAxisP(), getRtAxisP(), plot(), replotAll(), rescale(), rescaleOneRange(), setName(), setRetentionTimeInMinutes(), setRetentionTimeInSeconds(), and toQPaintDevice().

## _rt_in_seconds

bool pappso::XicWidget::_rt_in_seconds = true

protected

Definition at line 97 of file xicwidget.h.

Referenced by setRetentionTimeInMinutes(), and setRetentionTimeInSeconds().

## _xic_peak_sp_list

XicXicPeakPairList pappso::XicWidget::_xic_peak_sp_list

private

Definition at line 103 of file xicwidget.h.

Referenced by addXicPeakList(), clear(), drawXicPeakBorders(), replotAll(), and rtChangeEvent().

## _xic_sp_list

std::vector<XicCstSPtr> pappso::XicWidget::_xic_sp_list

private

Definition at line 102 of file xicwidget.h.

Referenced by addXicSp(), clear(), drawXicPeakBorders(), getXicCstSPtr(), and replotAll().

The documentation for this class was generated from the following files:

- pappsomspp/gui/xicwidget/xicwidget.h
- pappsomspp/gui/xicwidget/xicwidget.cpp