mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
Return objects by reference instead of always cloning
This commit is contained in:
@@ -5,8 +5,21 @@
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
Point*
|
||||
Polygon::last_point()
|
||||
{
|
||||
return &(this->points.front()); // last point == first point for polygons
|
||||
}
|
||||
|
||||
SV*
|
||||
Polygon::to_SV_ref() {
|
||||
Polygon::to_SV_ref() const {
|
||||
SV* sv = newSV(0);
|
||||
sv_setref_pv( sv, "Slic3r::Polygon::Ref", (void*)this );
|
||||
return sv;
|
||||
}
|
||||
|
||||
SV*
|
||||
Polygon::to_SV_clone_ref() const {
|
||||
SV* sv = newSV(0);
|
||||
sv_setref_pv( sv, "Slic3r::Polygon", new Polygon(*this) );
|
||||
return sv;
|
||||
|
||||
Reference in New Issue
Block a user