2013-07-15 20:57:22 +00:00
|
|
|
#ifndef slic3r_MultiPoint_hpp_
|
|
|
|
#define slic3r_MultiPoint_hpp_
|
|
|
|
|
2015-12-07 23:39:54 +00:00
|
|
|
#include "libslic3r.h"
|
2013-07-15 20:57:22 +00:00
|
|
|
#include <algorithm>
|
|
|
|
#include <vector>
|
2014-05-22 17:34:49 +00:00
|
|
|
#include "Line.hpp"
|
|
|
|
#include "Point.hpp"
|
2013-07-15 20:57:22 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
2014-05-22 17:34:49 +00:00
|
|
|
class BoundingBox;
|
|
|
|
|
2013-07-15 20:57:22 +00:00
|
|
|
class MultiPoint
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Points points;
|
2014-05-22 17:34:49 +00:00
|
|
|
|
|
|
|
operator Points() const;
|
2014-12-07 18:53:22 +00:00
|
|
|
MultiPoint() {};
|
|
|
|
explicit MultiPoint(const Points &_points): points(_points) {};
|
2013-07-15 20:57:22 +00:00
|
|
|
void scale(double factor);
|
|
|
|
void translate(double x, double y);
|
2014-11-09 14:27:34 +00:00
|
|
|
void translate(const Point &vector);
|
2016-04-10 17:06:46 +00:00
|
|
|
void rotate(double angle);
|
2014-04-24 11:43:24 +00:00
|
|
|
void rotate(double angle, const Point ¢er);
|
2013-07-15 20:57:22 +00:00
|
|
|
void reverse();
|
2014-04-24 14:40:10 +00:00
|
|
|
Point first_point() const;
|
|
|
|
virtual Point last_point() const = 0;
|
2013-10-27 21:57:25 +00:00
|
|
|
virtual Lines lines() const = 0;
|
|
|
|
double length() const;
|
2013-11-06 18:30:45 +00:00
|
|
|
bool is_valid() const;
|
2014-05-08 09:07:37 +00:00
|
|
|
int find_point(const Point &point) const;
|
2015-01-06 19:52:36 +00:00
|
|
|
bool has_boundary_point(const Point &point) const;
|
2015-01-19 17:53:04 +00:00
|
|
|
BoundingBox bounding_box() const;
|
2015-01-25 14:21:45 +00:00
|
|
|
void remove_duplicate_points();
|
2015-07-01 21:00:52 +00:00
|
|
|
void append(const Point &point);
|
|
|
|
void append(const Points &points);
|
|
|
|
void append(const Points::const_iterator &begin, const Points::const_iterator &end);
|
2016-03-19 14:33:58 +00:00
|
|
|
bool intersection(const Line& line, Point* intersection) const;
|
2014-05-22 17:34:49 +00:00
|
|
|
|
2013-11-22 15:01:50 +00:00
|
|
|
static Points _douglas_peucker(const Points &points, const double tolerance);
|
2013-07-15 20:57:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|