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