Qt5: fixed crash in PdfPlotCurve::setData()
This commit is contained in:
parent
55b47aa95d
commit
8b711782fd
@ -1425,6 +1425,7 @@ void MainWindow::update(const cv::Mat & image)
|
|||||||
|
|
||||||
|
|
||||||
//update likelihood plot
|
//update likelihood plot
|
||||||
|
UDEBUG("Set likelihood score curve values (%d)", scores.size());
|
||||||
likelihoodCurve_->setData(scores, QMap<int, int>());
|
likelihoodCurve_->setData(scores, QMap<int, int>());
|
||||||
QMap<int, int> inlierScores;
|
QMap<int, int> inlierScores;
|
||||||
for(QMap<int, int>::iterator iter=scores.begin(); iter!=scores.end(); ++iter)
|
for(QMap<int, int>::iterator iter=scores.begin(); iter!=scores.end(); ++iter)
|
||||||
@ -1444,6 +1445,7 @@ void MainWindow::update(const cv::Mat & image)
|
|||||||
}
|
}
|
||||||
inlierScores.insert(iter.key(), maxValue);
|
inlierScores.insert(iter.key(), maxValue);
|
||||||
}
|
}
|
||||||
|
UDEBUG("Set inliers score curve values (%d)", inlierScores.size());
|
||||||
inliersCurve_->setData(inlierScores, QMap<int, int>());
|
inliersCurve_->setData(inlierScores, QMap<int, int>());
|
||||||
if(ui_->likelihoodPlot->isVisible())
|
if(ui_->likelihoodPlot->isVisible())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,8 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PdfPlot.h"
|
#include "PdfPlot.h"
|
||||||
|
#include "find_object/utilite/ULogger.h"
|
||||||
#define ULOGGER_DEBUG(A, ...)
|
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
@ -145,15 +144,14 @@ void PdfPlotCurve::setData(const QMap<int, int> & dataMap, const QMap<int, int>
|
|||||||
|
|
||||||
// update values
|
// update values
|
||||||
QList<QGraphicsItem*>::iterator iter = _items.begin();
|
QList<QGraphicsItem*>::iterator iter = _items.begin();
|
||||||
QMap<int, int>::const_iterator j=weightsMap.begin();
|
for(QMap<int, int>::const_iterator i=dataMap.begin(); i!=dataMap.end(); ++i)
|
||||||
for(QMap<int, int>::const_iterator i=dataMap.begin(); i!=dataMap.end(); ++i, ++j)
|
|
||||||
{
|
{
|
||||||
((PdfPlotItem*)*iter)->setLikelihood(i.key(), i.value(), j!=weightsMap.end()?j.value():-1);
|
UASSERT(iter!= _items.end());
|
||||||
|
((PdfPlotItem*)*iter)->setLikelihood(i.key(), i.value(), weightsMap.value(i.key(),-1));
|
||||||
//2 times...
|
//2 times...
|
||||||
++iter;
|
++iter;
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//reset minMax, this will force the plot to update the axes
|
//reset minMax, this will force the plot to update the axes
|
||||||
this->updateMinMax();
|
this->updateMinMax();
|
||||||
Q_EMIT dataChanged(this);
|
Q_EMIT dataChanged(this);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user