mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 17:58:03 -06:00
Return objects by reference instead of always cloning
This commit is contained in:
parent
1741301973
commit
c0789506e4
30 changed files with 158 additions and 54 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue