2013-07-14 14:09:54 +00:00
|
|
|
#ifndef slic3r_Polyline_hpp_
|
|
|
|
#define slic3r_Polyline_hpp_
|
|
|
|
|
2015-12-07 23:39:54 +00:00
|
|
|
#include "libslic3r.h"
|
2013-07-15 20:57:22 +00:00
|
|
|
#include "Line.hpp"
|
|
|
|
#include "MultiPoint.hpp"
|
2014-11-15 22:06:15 +00:00
|
|
|
#include <string>
|
2016-03-19 14:33:58 +00:00
|
|
|
#include <vector>
|
2013-07-14 14:09:54 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
2013-11-21 16:53:50 +00:00
|
|
|
class Polyline;
|
2016-03-19 14:33:58 +00:00
|
|
|
class ThickPolyline;
|
2013-11-21 16:53:50 +00:00
|
|
|
typedef std::vector<Polyline> Polylines;
|
2016-03-19 14:33:58 +00:00
|
|
|
typedef std::vector<ThickPolyline> ThickPolylines;
|
2013-11-21 16:53:50 +00:00
|
|
|
|
2013-07-15 20:57:22 +00:00
|
|
|
class Polyline : public MultiPoint {
|
2013-07-14 14:09:54 +00:00
|
|
|
public:
|
2013-11-21 16:53:50 +00:00
|
|
|
operator Polylines() const;
|
2014-11-15 21:41:22 +00:00
|
|
|
operator Line() const;
|
2014-04-24 14:40:10 +00:00
|
|
|
Point last_point() const;
|
|
|
|
Point leftmost_point() const;
|
2016-03-19 14:33:58 +00:00
|
|
|
virtual Lines lines() const;
|
2013-10-27 21:57:25 +00:00
|
|
|
void clip_end(double distance);
|
2013-11-06 18:30:45 +00:00
|
|
|
void clip_start(double distance);
|
2014-03-15 15:53:20 +00:00
|
|
|
void extend_end(double distance);
|
|
|
|
void extend_start(double distance);
|
2015-01-19 17:53:04 +00:00
|
|
|
Points equally_spaced_points(double distance) const;
|
2013-11-22 01:16:10 +00:00
|
|
|
void simplify(double tolerance);
|
2015-01-06 19:52:36 +00:00
|
|
|
template <class T> void simplify_by_visibility(const T &area);
|
2014-05-22 10:28:12 +00:00
|
|
|
void split_at(const Point &point, Polyline* p1, Polyline* p2) const;
|
2014-11-15 22:06:15 +00:00
|
|
|
bool is_straight() const;
|
|
|
|
std::string wkt() const;
|
2013-07-14 14:09:54 +00:00
|
|
|
};
|
|
|
|
|
2016-03-19 14:33:58 +00:00
|
|
|
class ThickPolyline : public Polyline {
|
|
|
|
public:
|
|
|
|
std::vector<coordf_t> width;
|
|
|
|
std::vector<bool> endpoints;
|
|
|
|
ThickLines thicklines() const;
|
|
|
|
};
|
|
|
|
|
2013-07-14 14:09:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|