2013-07-15 20:57:22 +00:00
|
|
|
#ifndef slic3r_MultiPoint_hpp_
|
|
|
|
#define slic3r_MultiPoint_hpp_
|
|
|
|
|
2014-05-08 12:52:48 +00:00
|
|
|
#include <myinit.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;
|
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);
|
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;
|
2014-05-22 17:34:49 +00:00
|
|
|
void bounding_box(BoundingBox* bb) const;
|
|
|
|
|
2013-11-22 15:01:50 +00:00
|
|
|
static Points _douglas_peucker(const Points &points, const double tolerance);
|
2013-09-13 12:48:40 +00:00
|
|
|
|
|
|
|
#ifdef SLIC3RXS
|
|
|
|
void from_SV(SV* poly_sv);
|
|
|
|
void from_SV_check(SV* poly_sv);
|
|
|
|
SV* to_AV();
|
|
|
|
SV* to_SV_pureperl() const;
|
|
|
|
#endif
|
2013-07-15 20:57:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|