mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-26 02:01:12 -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
|
|
@ -2,6 +2,18 @@
|
|||
|
||||
namespace Slic3r {
|
||||
|
||||
Point*
|
||||
Polyline::last_point()
|
||||
{
|
||||
return &(this->points.back());
|
||||
}
|
||||
|
||||
const Point*
|
||||
Polyline::last_point() const
|
||||
{
|
||||
return &(this->points.back());
|
||||
}
|
||||
|
||||
Lines
|
||||
Polyline::lines()
|
||||
{
|
||||
|
|
@ -14,6 +26,14 @@ Polyline::lines()
|
|||
|
||||
SV*
|
||||
Polyline::to_SV_ref() const
|
||||
{
|
||||
SV* sv = newSV(0);
|
||||
sv_setref_pv( sv, "Slic3r::Polyline::Ref", (void*)this );
|
||||
return sv;
|
||||
}
|
||||
|
||||
SV*
|
||||
Polyline::to_SV_clone_ref() const
|
||||
{
|
||||
SV* sv = newSV(0);
|
||||
sv_setref_pv( sv, "Slic3r::Polyline", new Polyline(*this) );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue