PrusaSlicer-NonPlainar/xs/src/Polyline.cpp

41 lines
693 B
C++
Raw Normal View History

#include "Polyline.hpp"
namespace Slic3r {
Point*
Polyline::last_point() const
{
return new Point(this->points.back());
}
2013-09-13 13:19:15 +00:00
Lines
Polyline::lines() const
{
2013-09-13 13:19:15 +00:00
Lines lines;
lines.reserve(this->points.size() - 1);
for (Points::const_iterator it = this->points.begin(); it != this->points.end()-1; ++it) {
lines.push_back(Line(*it, *(it + 1)));
}
2013-09-13 13:19:15 +00:00
return lines;
}
#ifdef SLIC3RXS
2013-08-29 22:06:10 +00:00
SV*
Polyline::to_SV_ref()
{
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;
}
#endif
2013-08-29 22:06:10 +00:00
}