Skip to content
GenericPolygon.h 890 B
Newer Older
#pragma once

#include <QPolygonF>
#include <QPointF>

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

template <class PointType = QPointF, template <class, class...> class ContainerType = QVector>
class GenericPolygon{ //
Valentin Platzgummer's avatar
Valentin Platzgummer committed
    typedef ros_bridge::messages::geometry_msgs::polygon::GenericPolygon<PointType, ContainerType> Polygon;
    GenericPolygon(){}
    GenericPolygon(const GenericPolygon &other) : _polygon(other._polygon){}
    GenericPolygon& operator=(const GenericPolygon& other) {
        this->_polygon = other._polygon;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
    const Polygon &polygon() const {return _polygon;}
          Polygon &polygon()       {return _polygon;}
  const ContainerType<PointType> &path() const {return _polygon.points();}
        ContainerType<PointType> &path()       {return _polygon.points();}

private:
Valentin Platzgummer's avatar
Valentin Platzgummer committed
    Polygon _polygon;