#include <QGraphicsEllipseItem>
#include <QGraphicsScene>
{
("Name", "Point")
("Category", "Geometry")
("Description", "Visualizes a point."))
public:
Point2Visualization() :
mRoot(NULL),
mEllipse(NULL)
{
mPointChannel.setDataChangedCallback(boost::bind(&Point2Visualization::dataChanged, this, _1));
}
virtual ~Point2Visualization()
{
delete mEllipse;
}
template <typename Reflector>
{
channelProperty(r, "Point", mPointChannel, "The point channel to visualize");
}
{
mEllipse = new QGraphicsEllipseItem();
mEllipse->setRect(-0.05, -0.05, 0.1, 0.1);
sceneManager->addItem(mEllipse);
}
virtual DataConnection getDataConnection()
{
return DataConnection(mPointChannel);
}
{
mFrameID =
read->frameID;
mDataTimestamp =
read->timestamp;
}
protected:
{
if (!mPointChannel.isValid())
return;
mFrameID, mDataTimestamp,
getSite()->getFixedFrame());
}
protected:
QGraphicsItem* mRoot;
QGraphicsEllipseItem* mEllipse;
std::string mFrameID;
};