More integration of Slic3r::Point::XS

This commit is contained in:
Alessandro Ranellucci 2013-07-15 16:04:49 +02:00
parent 159a009f96
commit c9749ca3b3
9 changed files with 80 additions and 17 deletions

View file

@ -8,16 +8,36 @@
%name{Slic3r::Point::XS} class Point {
Point(unsigned long _x = 0, unsigned long _y = 0);
~Point();
Point* clone()
%code{% const char* CLASS = "Slic3r::Point::XS"; RETVAL = new Point(*THIS); %};
void scale(double factor);
void translate(double x, double y);
SV* arrayref()
%code{% RETVAL = point2perl(*THIS); %};
%{
SV*
Point::arrayref()
void
Point::rotate(angle, center_sv)
double angle;
SV* center_sv;
CODE:
RETVAL = point2perl(*THIS);
Point center;
perl2point_check(center_sv, center);
THIS->rotate(angle, &center);
bool
Point::coincides_with(point_sv)
SV* point_sv;
CODE:
Point point;
perl2point_check(point_sv, point);
RETVAL = THIS->coincides_with(&point);
OUTPUT:
RETVAL
%}
};
%package{Slic3r::Point::XS};