47 #ifndef _MIRA_POLYGON_H_ 48 #define _MIRA_POLYGON_H_ 50 #include <serialization/adapters/std/vector> 52 #include <boost/geometry/geometries/register/ring.hpp> 98 template<
typename Po
intType>
99 inline boost::geometry::model::ring<PointType>
createTriangle(
const PointType& p1,
103 boost::geometry::model::ring<PointType> triangle;
104 triangle.push_back(p1);
105 triangle.push_back(p2);
106 triangle.push_back(p3);
107 triangle.push_back(p1);
114 template<
typename LineType>
115 inline boost::geometry::model::ring<typename LineType::PointType>
polygonFromLine(
const LineType& line)
117 typedef typename LineType::PointType PointType;
118 boost::geometry::model::ring<PointType> poly;
119 poly.push_back(line.first);
120 poly.push_back(line.second);
128 typedef boost::geometry::model::ring<Point2i>
Polygon2i;
131 typedef boost::geometry::model::ring<Point2f>
Polygon2f;
134 typedef boost::geometry::model::ring<Point2d>
Polygon2d;
140 typedef boost::geometry::model::ring<Point3i>
Polygon3i;
143 typedef boost::geometry::model::ring<Point3f>
Polygon3f;
146 typedef boost::geometry::model::ring<Point3d>
Polygon3d;
151 template<
typename Reflector,
typename Po
intType>
152 void reflect(Reflector& r, boost::geometry::model::ring<PointType>& p)
154 r.template reflectBase<std::vector<PointType>>(p);
157 template<
typename Po
intType>
Definition: SyncTimedRead.h:62
boost::geometry::model::ring< Point3i > Polygon3i
A 3D polygon with integer precision.
Definition: Polygon.h:140
boost::geometry::model::ring< Point3f > Polygon3f
A 3D polygon with 32 bit floating precision.
Definition: Polygon.h:143
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
Class for 2D, 3D and N-dimensional points.
boost::geometry::model::ring< Point3d > Polygon3d
A 3D polygon with 64 bit floating precision.
Definition: Polygon.h:146
boost::geometry::model::ring< Point2i > Polygon2i
A 2D polygon with integer precision.
Definition: Polygon.h:128
boost::geometry::model::ring< PointType > createTriangle(const PointType &p1, const PointType &p2, const PointType &p3)
The polygon is essentially a sequence of points with an edge also connecting the first and last point...
Definition: Polygon.h:99
void reflect(Reflector &r, LogRecord &record)
Non-intrusive reflector for LogRecord.
Definition: LoggingCore.h:137
boost::geometry::model::ring< Point2d > Polygon2d
A 2D polygon with 64 bit floating precision.
Definition: Polygon.h:134
boost::geometry::model::ring< Point2f > Polygon2f
A 2D polygon with 32 bit floating precision.
Definition: Polygon.h:131
Type trait that indicates whether a type is a collection.
Definition: IsCollection.h:63
boost::geometry::model::ring< typename LineType::PointType > polygonFromLine(const LineType &line)
Converts a line into a polygon.
Definition: Polygon.h:115