56 this->
setData(QPointF(
id, value));
64 _text =
new QGraphicsTextItem(
this);
65 _text->setVisible(
false);
73 if(iter !=
_signaturesRef->constEnd() && !iter.value().sensorData().imageCompressed().empty())
76 iter.value().sensorData().uncompressDataConst(&image, 0, 0);
80 QPixmap scaled = QPixmap::fromImage(img).scaledToWidth(128);
81 _img =
new QGraphicsPixmapItem(scaled,
this);
82 _img->setVisible(
false);
88 _text->setPos(this->mapFromScene(4+150,0));
90 _text->setPos(this->mapFromScene(4,0));
93 _text->setPlainText(QString(
"ID = %1\nValue = %2\nWeight = %3").arg(this->
data().
x()).arg(this->
data().y()).arg(
_childCount));
97 _text->setPlainText(QString(
"ID = %1\nValue = %2").arg(this->
data().
x()).arg(this->
data().y()));
99 _text->setVisible(
true);
102 _img->setPos(this->mapFromScene(4,0));
103 _img->setVisible(
true);
108 _text->setVisible(
false);
110 _img->setVisible(
false);
121 _signaturesMapRef(signaturesMapRef)
138 ULOGGER_DEBUG(
"dataMap=%d, weightsMap=%d", dataMap.size(), weightsMap.size());
139 if(dataMap.size() > 0)
142 int margin = int((
_items.size()+1)/2) - dataMap.size();
161 QList<QGraphicsItem*>::iterator iter =
_items.begin();
162 for(QMap<int, float>::const_iterator i=dataMap.begin(); i!=dataMap.end(); ++i)
164 ((
PdfPlotItem*)*iter)->setLikelihood(i.key(), i.value(), weightsMap.value(i.key(), -1));
void setLikelihood(int id, float value, int childCount)
int removeItem(int index)
QImage uCvMat2QImage(const cv::Mat &image, bool isBgr=true, uCvQtDepthColorMap colorMap=uCvQtDepthWhiteToBlack, float depthMin=0, float depthMax=0)
void setData(const QMap< int, float > &dataMap, const QMap< int, int > &weightsMap)
QGraphicsPixmapItem * _img
virtual void showDescription(bool shown)
PdfPlotItem(float dataX, float dataY, float width, int childCount=-1)
#define ULOGGER_DEBUG(...)
void _addValue(UPlotItem *data)
QList< QGraphicsItem * > _items
virtual void showDescription(bool shown)
const QMap< int, Signature > * _signaturesRef
void setSignaturesRef(const QMap< int, Signature > *signaturesRef)
const QMap< int, Signature > * _signaturesMapRef
QGraphicsTextItem * _text
ULogger class and convenient macros.
void setData(const QPointF &data)
const QPointF & data() const
PdfPlotCurve(const QString &name, const QMap< int, Signature > *signaturesMapRef, QObject *parent=0)
void dataChanged(const UPlotCurve *)