2013-07-16 19:04:14 +00:00
|
|
|
#include "Polyline.hpp"
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
2013-09-02 18:22:20 +00:00
|
|
|
Point*
|
|
|
|
Polyline::last_point() const
|
|
|
|
{
|
2013-09-02 20:33:03 +00:00
|
|
|
return new Point(this->points.back());
|
2013-09-02 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2013-09-03 17:26:58 +00:00
|
|
|
void
|
|
|
|
Polyline::lines(Lines &lines) const
|
2013-07-16 19:04:14 +00:00
|
|
|
{
|
2013-09-03 17:26:58 +00:00
|
|
|
lines.clear();
|
2013-07-16 19:04:14 +00:00
|
|
|
for (int i = 0; i < this->points.size()-1; i++) {
|
|
|
|
lines.push_back(Line(this->points[i], this->points[i+1]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-29 22:06:10 +00:00
|
|
|
SV*
|
2013-09-03 17:26:58 +00:00
|
|
|
Polyline::to_SV_ref()
|
2013-09-02 18:22:20 +00:00
|
|
|
{
|
|
|
|
SV* sv = newSV(0);
|
|
|
|
sv_setref_pv( sv, "Slic3r::Polyline::Ref", (void*)this );
|
|
|
|
return sv;
|
|
|
|
}
|
|
|
|
|
|
|
|
SV*
|
|
|
|
Polyline::to_SV_clone_ref() const
|
2013-08-29 22:06:10 +00:00
|
|
|
{
|
|
|
|
SV* sv = newSV(0);
|
|
|
|
sv_setref_pv( sv, "Slic3r::Polyline", new Polyline(*this) );
|
|
|
|
return sv;
|
|
|
|
}
|
|
|
|
|
2013-07-16 19:04:14 +00:00
|
|
|
}
|