XS interface completed, including new Line class

This commit is contained in:
Alessandro Ranellucci 2013-07-15 22:57:22 +02:00
parent 9af2a1c007
commit ab6b3d41a7
33 changed files with 435 additions and 257 deletions

View file

@ -5,13 +5,13 @@
#include "ExPolygon.hpp"
%}
%name{Slic3r::ExPolygon::XS} class ExPolygon {
%name{Slic3r::ExPolygon} class ExPolygon {
ExPolygon* clone()
%code{% const char* CLASS = "Slic3r::ExPolygon::XS"; RETVAL = new ExPolygon(*THIS); RETVAL->in_collection = false; %};
%code{% const char* CLASS = "Slic3r::ExPolygon"; RETVAL = new ExPolygon(*THIS); RETVAL->in_collection = false; %};
SV* arrayref()
%code{% RETVAL = THIS->to_SV(true, false); %};
SV* arrayref_pp()
%code{% RETVAL = THIS->to_SV(true, true); %};
%code{% RETVAL = THIS->to_SV(); %};
SV* pp()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
void scale(double factor);
void translate(double x, double y);
%{
@ -42,29 +42,9 @@ ExPolygon::rotate(angle, center_sv)
double angle;
SV* center_sv;
CODE:
Point* center;
if (sv_isobject(center_sv) && (SvTYPE(SvRV(center_sv)) == SVt_PVMG)) {
center = (Point*)SvIV((SV*)SvRV( center_sv ));
THIS->rotate(angle, center);
} else {
center = new Point;
perl2point(center_sv, *center);
THIS->rotate(angle, center);
delete center;
}
Point center;
center.from_SV_check(center_sv);
THIS->rotate(angle, &center);
%}
};
%package{Slic3r::ExPolygon::XS};
%{
PROTOTYPES: DISABLE
std::string
hello_world()
CODE:
RETVAL = "Hello world!";
OUTPUT:
RETVAL
%}