Commit b5e88007 authored by Olivier Langella's avatar Olivier Langella
Browse files

using direct pointer to data, but that does not help to clear data

parent 24428dec
......@@ -81,6 +81,8 @@ void PlotAligned::viewAlignedMS2Peaks(const MonitorAlignmentPlot * monitorAlignm
return;
qDebug() << "View Ms2 point";
//delete _p_curve_ms2;
//_p_curve_ms2 = new QwtPlotCurve("Common identification");
//QwtPlotCurve * curve = new QwtPlotCurve("Common identification");
_p_curve_ms2->setStyle(QwtPlotCurve::Dots);
_p_curve_ms2->setRenderHint(QwtPlotItem::RenderAntialiased);
......@@ -90,22 +92,32 @@ void PlotAligned::viewAlignedMS2Peaks(const MonitorAlignmentPlot * monitorAlignm
const std::map<mcq_double,mcq_double>& mapDeltaPeaks = monitorAlignment->getMs2CommonPeak();
// QVector<QPointF> *data = static_cast<QVector<QPointF> *>(_p_curve_ms2->data());
//_p_msms_data->clear();
_msms_data.resize(0);
//_msms_data.clear();
QVector< double > x;
QVector< double > y;
_p_msms_data = new QwtPointArrayData(x,y);
_p_curve_ms2->setData(_p_msms_data);
replot();
//unsigned int plotsize(mapDeltaPeaks.size());
//mcq_double x1[plotsize], y1[plotsize];
std::map<mcq_double,mcq_double>::const_iterator it;
//int i = 0;
for (it = mapDeltaPeaks.begin(); it != mapDeltaPeaks.end(); ++it) {
QPointF one_point;
one_point.setX(it->first);
one_point.setY(it->second);
_msms_data.push_back(one_point);
x.push_back(it->first);
y.push_back(it->second);
//one_point.setX(it->first);
//one_point.setY(it->second);
//_msms_data.push_back(one_point);
//y1[i] = it->second;
//x1[i] = it->first;
//i++;
}
_p_curve_ms2->setSamples(_msms_data);
_p_msms_data = new QwtPointArrayData(x,y);
_p_curve_ms2->setData(_p_msms_data);
_p_curve_ms2->attach(this);
this->replot();
......@@ -125,16 +137,21 @@ void PlotAligned::clear() {
_p_curve_ms2->setData(_msms_data);
replot();
}*/
_p_curve_ms2->setSamples(QVector<QPointF>());
//_p_curve_ms2->setSamples(QVector<QPointF>());
_p_curve_deltart->setSamples(QVector<QPointF>());
_p_curve_ms2->detach();
//_p_curve_ms2->detach();
_p_curve_deltart->detach();
setAxisAutoScale(QwtPlot::xBottom);
setAxisAutoScale(QwtPlot::yLeft);
this->setTitle("");
_msms_data.resize(0);
//_msms_data.clear();
QVector< double > x;
QVector< double > y;
_p_msms_data = new QwtPointArrayData(x,y);
_p_curve_ms2->setData(_p_msms_data);
replot();
initZoomer();
......
......@@ -35,6 +35,7 @@
#include <qwt_plot.h>
#include <qwt_plot_zoomer.h>
#include <qwt_plot_curve.h>
#include <qwt_point_data.h>
#include "../treatment/treatment_box_xic_extract.h"
#include "../treatment/treatment_box_xic_detect.h"
#include "../treatment/treatment_box_xic_filter.h"
......@@ -71,7 +72,7 @@ private:
QwtPlotCurve * _p_curve_deltart;
QwtPlotCurve * _p_curve_ms2;
QVector<QPointF> _msms_data;
QwtPointArrayData * _p_msms_data;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment