mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-20 23:31:13 -06:00
Many changes and fixes to remove leaks and return objects by reference
This commit is contained in:
parent
275422fac7
commit
a49dc603cc
27 changed files with 67 additions and 46 deletions
|
@ -15,11 +15,11 @@
|
|||
%code{% THIS->polyline.points.pop_back(); %};
|
||||
void reverse();
|
||||
Lines lines()
|
||||
%code{% RETVAL = THIS->polyline.lines(); %};
|
||||
%code{% RETVAL = Lines(); THIS->polyline.lines(RETVAL); %};
|
||||
Point* first_point()
|
||||
%code{% const char* CLASS = "Slic3r::Point::Ref"; RETVAL = THIS->first_point(); %};
|
||||
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->first_point(); %};
|
||||
Point* last_point()
|
||||
%code{% const char* CLASS = "Slic3r::Point::Ref"; RETVAL = THIS->last_point(); %};
|
||||
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->last_point(); %};
|
||||
%{
|
||||
|
||||
ExtrusionPath*
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
bool make_clockwise();
|
||||
bool is_valid();
|
||||
Point* first_point()
|
||||
%code{% const char* CLASS = "Slic3r::Point::Ref"; RETVAL = THIS->first_point(); %};
|
||||
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->first_point(); %};
|
||||
%{
|
||||
|
||||
Polygon*
|
||||
|
|
|
@ -18,11 +18,12 @@
|
|||
void pop_back()
|
||||
%code{% THIS->points.pop_back(); %};
|
||||
void reverse();
|
||||
Lines lines();
|
||||
Lines lines()
|
||||
%code{% RETVAL = Lines(); THIS->lines(RETVAL); %};
|
||||
Point* first_point()
|
||||
%code{% const char* CLASS = "Slic3r::Point::Ref"; RETVAL = THIS->first_point(); %};
|
||||
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->first_point(); %};
|
||||
Point* last_point()
|
||||
%code{% const char* CLASS = "Slic3r::Point::Ref"; RETVAL = THIS->last_point(); %};
|
||||
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = THIS->last_point(); %};
|
||||
%{
|
||||
|
||||
Polyline*
|
||||
|
|
|
@ -48,9 +48,10 @@ OUTPUT
|
|||
T_ARRAYREF
|
||||
AV* av = newAV();
|
||||
$arg = newRV_noinc((SV*)av);
|
||||
sv_2mortal($arg);
|
||||
av_extend(av, $var.size()-1);
|
||||
int i = 0;
|
||||
for (${type}::iterator it = $var.begin(); it != $var.end(); ++it) {
|
||||
for (${type}::const_iterator it = $var.begin(); it != $var.end(); ++it) {
|
||||
av_store(av, i++, (*it).to_SV_clone_ref());
|
||||
}
|
||||
$var.clear();
|
||||
|
@ -58,6 +59,7 @@ T_ARRAYREF
|
|||
T_ARRAYREF_POLYGONS_PTR
|
||||
AV* av = newAV();
|
||||
$arg = newRV_noinc((SV*)av);
|
||||
sv_2mortal($arg);
|
||||
av_extend(av, $var->size()-1);
|
||||
int i = 0;
|
||||
for (Polygons::iterator it = $var->begin(); it != $var->end(); ++it) {
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
%typemap{Polygons};
|
||||
%typemap{ExPolygons};
|
||||
%typemap{Polygons*};
|
||||
%typemap{Lines*};
|
||||
|
||||
%typemap{SurfaceType}{parsed}{
|
||||
%cpp_type{SurfaceType};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue