2013-07-14 13:53:53 +00:00
|
|
|
#ifndef slic3r_Polygon_hpp_
|
|
|
|
#define slic3r_Polygon_hpp_
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
#include "EXTERN.h"
|
|
|
|
#include "perl.h"
|
|
|
|
#include "XSUB.h"
|
|
|
|
#include "ppport.h"
|
|
|
|
}
|
|
|
|
|
2013-07-15 18:31:43 +00:00
|
|
|
#include <vector>
|
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:
|
|
|
|
Lines lines();
|
|
|
|
};
|
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
|
|
|
|
2013-07-15 21:28:23 +00:00
|
|
|
Lines
|
|
|
|
Polygon::lines()
|
|
|
|
{
|
|
|
|
Lines lines;
|
|
|
|
for (int i = 0; i < this->points.size()-1; i++) {
|
|
|
|
lines.push_back(Line(this->points[i], this->points[i+1]));
|
|
|
|
}
|
|
|
|
lines.push_back(Line(this->points.back(), this->points.front()));
|
|
|
|
return lines;
|
|
|
|
}
|
|
|
|
|
2013-07-14 13:53:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|