8#include <boost/polygon/polygon.hpp>
12namespace boost {
namespace polygon {
15 struct geometry_concept<QPoint> {
16 typedef point_concept
type;
20 struct point_traits<QPoint> {
24 orientation_2d orient) {
25 if(orient == HORIZONTAL)
32 struct point_mutable_traits<QPoint> {
33 static inline void set(QPoint& point, orientation_2d orient,
int value) {
34 if(orient == HORIZONTAL)
39 static inline QPoint
construct(
int x_value,
int y_value) {
41 retval.rx() = x_value;
42 retval.ry() = y_value;
49 struct geometry_concept<QPolygon>{
typedef polygon_concept
type; };
52 struct polygon_traits<QPolygon> {
65 static inline std::size_t
size(
const QPolygon& t) {
69 static inline winding_direction
winding(
const QPolygon& t) {
71 return unknown_winding;
76 struct polygon_mutable_traits<QPolygon> {
77 template <
typename iT>
79 iT input_begin, iT input_end) {
82 for(iT iter = input_begin; iter != input_end; iter++) {
83 t.push_back(QPoint(iter->x(), iter->y()));
98 polygonSet.push_back(polygon);
99 boost::polygon::resize(polygonSet, offset, rounded, circleSegments);
100 return polygonSet[0];
106 Q_FOREACH(QPolygon polygon, polygons) {
107 polygonSet.push_back(polygon);
109 boost::polygon::resize(polygonSet, offset, rounded, circleSegments);
112 for (
int i=0; i < int(polygonSet.size()); i++) {
113 finalPolygons.append(polygonSet.at(i));
115 return finalPolygons;
float value(const T *src, size_t ch)
std::vector< QPolygon > PolygonSet
static QPolygon offsetPolygon(const QPolygon &polygon, int offset, bool rounded=true, int circleSegments=16)
offsetPolygon This offsets a single polygon, using the winding/nonzero fill-rule to determine inside ...
static QList< QPolygon > offsetPolygons(const QList< QPolygon > polygons, int offset, bool rounded=true, int circleSegments=16)
static void set(QPoint &point, orientation_2d orient, int value)
static QPoint construct(int x_value, int y_value)
static coordinate_type get(const QPoint &point, orientation_2d orient)
static QPolygon & set_points(QPolygon &t, iT input_begin, iT input_end)
static std::size_t size(const QPolygon &t)
QPolygon::const_iterator iterator_type
static iterator_type begin_points(const QPolygon &t)
static iterator_type end_points(const QPolygon &t)
static winding_direction winding(const QPolygon &t)