Adopt XS containers everywhere (incomplete work)

This commit is contained in:
Alessandro Ranellucci 2013-07-16 09:49:34 +02:00
parent 339ba9e5c3
commit 9b582a11ff
30 changed files with 130 additions and 311 deletions

View file

@ -11,10 +11,6 @@
%code{% RETVAL = THIS->polygon.to_SV(); %};
SV* pp()
%code{% RETVAL = THIS->polygon.to_SV_pureperl(); %};
Polygon* as_polygon()
%code{% const char* CLASS = "Slic3r::Polygon"; RETVAL = new Polygon(THIS->polygon); %};
void set_polygon(SV* polygon_sv)
%code{% THIS->polygon.from_SV_check(polygon_sv); %};
ExtrusionPath* split_at_index(int index)
%code{% const char* CLASS = "Slic3r::ExtrusionPath"; RETVAL = THIS->split_at_index(index); %};
ExtrusionPath* split_at_first_point()
@ -37,6 +33,18 @@ _new(CLASS, polygon_sv, role, height, flow_spacing)
OUTPUT:
RETVAL
Polygon*
ExtrusionLoop::polygon(...)
PREINIT:
const char* CLASS = "Slic3r::Polygon";
CODE:
if (items > 1) {
THIS->polygon.from_SV_check( ST(1) );
}
RETVAL = new Polygon(THIS->polygon);
OUTPUT:
RETVAL
ExtrusionRole
ExtrusionLoop::role(...)
CODE:

View file

@ -11,10 +11,6 @@
%code{% RETVAL = THIS->polyline.to_SV(); %};
SV* pp()
%code{% RETVAL = THIS->polyline.to_SV_pureperl(); %};
Polyline* as_polyline()
%code{% const char* CLASS = "Slic3r::Polyline"; RETVAL = new Polyline(THIS->polyline); %};
void set_polyline(SV* polyline_sv)
%code{% THIS->polyline.from_SV_check(polyline_sv); %};
void pop_back()
%code{% THIS->polyline.points.pop_back(); %};
void reverse();
@ -36,6 +32,18 @@ _new(CLASS, polyline_sv, role, height, flow_spacing)
OUTPUT:
RETVAL
Polyline*
ExtrusionPath::polyline(...)
PREINIT:
const char* CLASS = "Slic3r::Polyline";
CODE:
if (items > 1) {
THIS->polyline.from_SV_check( ST(1) );
}
RETVAL = new Polyline(THIS->polyline);
OUTPUT:
RETVAL
ExtrusionRole
ExtrusionPath::role(...)
CODE:

View file

@ -13,6 +13,10 @@
%code{% RETVAL = THIS->to_SV(); %};
SV* pp()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
Point* a()
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(THIS->a); %};
Point* b()
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(THIS->b); %};
void reverse();
%{

View file

@ -34,5 +34,14 @@ Polygon::new(...)
OUTPUT:
RETVAL
void
Polygon::rotate(angle, center_sv)
double angle;
SV* center_sv;
CODE:
Point center;
center.from_SV_check(center_sv);
THIS->rotate(angle, &center);
%}
};

View file

@ -13,6 +13,8 @@
%code{% RETVAL = THIS->to_SV(); %};
SV* pp()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
void scale(double factor);
void translate(double x, double y);
void pop_back()
%code{% THIS->points.pop_back(); %};
void reverse();
@ -40,5 +42,14 @@ Polyline::append(...)
THIS->points.push_back(p);
}
void
Polyline::rotate(angle, center_sv)
double angle;
SV* center_sv;
CODE:
Point center;
center.from_SV_check(center_sv);
THIS->rotate(angle, &center);
%}
};