2013-07-14 00:38:01 +02:00
|
|
|
#ifndef slic3r_ExPolygonCollection_hpp_
|
|
|
|
|
#define slic3r_ExPolygonCollection_hpp_
|
|
|
|
|
|
2015-12-08 00:39:54 +01:00
|
|
|
#include "libslic3r.h"
|
2013-07-14 00:38:01 +02:00
|
|
|
#include "ExPolygon.hpp"
|
2014-11-23 20:03:16 +01:00
|
|
|
#include "Line.hpp"
|
|
|
|
|
#include "Polyline.hpp"
|
2013-07-14 00:38:01 +02:00
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
2014-05-13 20:06:01 +02:00
|
|
|
class ExPolygonCollection;
|
|
|
|
|
typedef std::vector<ExPolygonCollection> ExPolygonCollections;
|
|
|
|
|
|
2013-07-14 00:38:01 +02:00
|
|
|
class ExPolygonCollection
|
|
|
|
|
{
|
|
|
|
|
public:
|
2013-08-08 02:10:34 +02:00
|
|
|
ExPolygons expolygons;
|
2014-05-13 20:06:01 +02:00
|
|
|
|
|
|
|
|
ExPolygonCollection() {};
|
2015-01-06 20:52:36 +01:00
|
|
|
ExPolygonCollection(const ExPolygon &expolygon);
|
2014-05-13 20:06:01 +02:00
|
|
|
ExPolygonCollection(const ExPolygons &expolygons) : expolygons(expolygons) {};
|
|
|
|
|
operator Points() const;
|
2013-11-21 17:53:50 +01:00
|
|
|
operator Polygons() const;
|
2014-05-13 20:06:01 +02:00
|
|
|
operator ExPolygons&();
|
2013-07-14 00:38:01 +02:00
|
|
|
void scale(double factor);
|
|
|
|
|
void translate(double x, double y);
|
2014-04-24 13:43:24 +02:00
|
|
|
void rotate(double angle, const Point ¢er);
|
2014-11-23 20:14:13 +01:00
|
|
|
template <class T> bool contains(const T &item) const;
|
2015-01-06 20:52:36 +01:00
|
|
|
bool contains_b(const Point &point) const;
|
2013-11-21 20:25:24 +01:00
|
|
|
void simplify(double tolerance);
|
2015-01-19 18:53:04 +01:00
|
|
|
Polygon convex_hull() const;
|
2015-01-06 20:52:36 +01:00
|
|
|
Lines lines() const;
|
2015-02-27 21:55:02 +01:00
|
|
|
Polygons contours() const;
|
2015-10-26 23:23:03 +01:00
|
|
|
void append(const ExPolygons &expolygons);
|
2013-07-14 00:38:01 +02:00
|
|
|
};
|
|
|
|
|
|
2016-09-13 13:30:00 +02:00
|
|
|
extern BoundingBox get_extents(const ExPolygonCollection &expolygon);
|
|
|
|
|
|
2013-07-14 00:38:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|