2013-07-14 13:53:53 +00:00
|
|
|
#ifndef slic3r_Polygon_hpp_
|
|
|
|
#define slic3r_Polygon_hpp_
|
|
|
|
|
2013-07-16 19:04:14 +00:00
|
|
|
#include <myinit.h>
|
2013-07-15 18:31:43 +00:00
|
|
|
#include <vector>
|
2013-07-16 19:04:14 +00:00
|
|
|
#include "Line.hpp"
|
|
|
|
#include "MultiPoint.hpp"
|
2013-07-14 14:09:54 +00:00
|
|
|
#include "Polyline.hpp"
|
2013-07-14 13:53:53 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
2013-07-15 21:28:23 +00:00
|
|
|
class Polygon : public MultiPoint {
|
|
|
|
public:
|
2013-09-02 20:33:03 +00:00
|
|
|
Point* last_point() const;
|
2013-09-03 17:26:58 +00:00
|
|
|
Lines lines() const;
|
2013-09-13 13:19:15 +00:00
|
|
|
Polyline* split_at(const Point* point) const;
|
|
|
|
Polyline* split_at_index(int index) const;
|
|
|
|
Polyline* split_at_first_point() const;
|
2013-11-11 19:59:58 +00:00
|
|
|
Points equally_spaced_points(double distance) const;
|
2013-08-26 20:50:26 +00:00
|
|
|
double area() const;
|
|
|
|
bool is_counter_clockwise() const;
|
2013-08-26 23:26:44 +00:00
|
|
|
bool is_clockwise() const;
|
2013-07-16 19:09:29 +00:00
|
|
|
bool make_counter_clockwise();
|
|
|
|
bool make_clockwise();
|
2013-08-26 21:27:51 +00:00
|
|
|
bool is_valid() const;
|
2013-11-21 15:21:42 +00:00
|
|
|
bool contains_point(const Point* point) const;
|
2013-09-13 12:48:40 +00:00
|
|
|
|
|
|
|
#ifdef SLIC3RXS
|
|
|
|
SV* to_SV_ref();
|
|
|
|
SV* to_SV_clone_ref() const;
|
|
|
|
#endif
|
2013-07-15 21:28:23 +00:00
|
|
|
};
|
2013-07-15 14:21:09 +00:00
|
|
|
|
2013-07-15 18:31:43 +00:00
|
|
|
typedef std::vector<Polygon> Polygons;
|
2013-07-14 13:53:53 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|