Newer
Older
#pragma once
#include <QPolygonF>
#include <QPointF>
#include "ros_bridge/include/MessageGroups.h"
#include "ros_bridge/include/MessageBaseClass.h"
#include "ros_bridge/include/JsonMethodes.h"
namespace MsgGroupsNS = ROSBridge::MessageGroups;
namespace PolyStampedNS = ROSBridge::JsonMethodes::PolygonStamped;
typedef ROSBridge::MessageBaseClass<QString> ROSMsg;
template <class PointType = QPointF, template <class, class...> class ContainerType = QVector>
class Polygon2DTemplate : public ROSMsg{ //
typedef ROSBridge::JsonMethodes::Polygon::Polygon<PointType, ContainerType> Poly;
typedef MsgGroupsNS::PolygonStampedGroup Group; // has no header
Polygon2DTemplate(){}
Polygon2DTemplate(const Polygon2DTemplate &other) : ROSMsg(), _polygon(other._polygon){}
Polygon2DTemplate& operator=(const Polygon2DTemplate& other) {
this->_polygon = other._polygon;
const Poly &polygon() const {return _polygon;}
Poly &polygon() {return _polygon;}
const ContainerType<PointType> &path() const {return _polygon.points();}
ContainerType<PointType> &path() {return _polygon.points();}
virtual Polygon2DTemplate*Clone() const { // ROSMsg
return new Polygon2DTemplate(*this);
}
private:
Poly _polygon;
typedef Polygon2DTemplate<> Polygon2D;