GenericPolygon.h 890 Bytes
Newer Older
1 2 3 4 5
#pragma once

#include <QPolygonF>
#include <QPointF>

Valentin Platzgummer's avatar
Valentin Platzgummer committed
6
#include "ros_bridge/include/messages/geometry_msgs/polygon_stamped.h"
7 8

template <class PointType = QPointF, template <class, class...> class ContainerType = QVector>
9
class GenericPolygon{ //
Valentin Platzgummer's avatar
Valentin Platzgummer committed
10
    typedef ros_bridge::messages::geometry_msgs::polygon::GenericPolygon<PointType, ContainerType> Polygon;
11
public:
12 13
    GenericPolygon(){}
    GenericPolygon(const GenericPolygon &other) : _polygon(other._polygon){}
14

15
    GenericPolygon& operator=(const GenericPolygon& other) {
16
        this->_polygon = other._polygon;
17 18 19
        return *this;
    }

Valentin Platzgummer's avatar
Valentin Platzgummer committed
20 21
    const Polygon &polygon() const {return _polygon;}
          Polygon &polygon()       {return _polygon;}
22

23 24 25 26
  const ContainerType<PointType> &path() const {return _polygon.points();}
        ContainerType<PointType> &path()       {return _polygon.points();}

private:
Valentin Platzgummer's avatar
Valentin Platzgummer committed
27
    Polygon _polygon;
28 29

};