Polygon2D.h 770 Bytes
Newer Older
1 2 3 4 5
#pragma once

#include <QPolygonF>
#include <QPointF>

6 7
#include "ros_bridge/include/MessageGroups.h"
#include "ros_bridge/include/MessageBaseClass.h"
8

9 10
typedef ROSBridge::MessageBaseClass<QString> ROSMsg;
namespace MsgGroups = ROSBridge::MessageGroups;
11 12 13

class Polygon2D : public QPolygonF, public ROSMsg{
public:
14
    typedef MsgGroups::PolygonGroup Group;
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

    Polygon2D(){}
    Polygon2D(const Polygon2D &other) : QPolygonF(other) , ROSMsg(){}

    Polygon2D& operator=(const Polygon2D& other) {
        QPolygonF::operator=(other);
        return *this;
    }

    virtual Polygon2D*Clone() const { // ROSMsg
        return new Polygon2D(*this);
    }

    const Polygon2D &points() const {return *this;} // ROSMsg
    Polygon2D &points() {return *this;} // ROSMsg

};