mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-28 15:45:30 +00:00
XS interface completed, including new Line class
This commit is contained in:
@@ -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, ¢er);
|
||||
|
||||
%}
|
||||
};
|
||||
|
||||
%package{Slic3r::ExPolygon::XS};
|
||||
|
||||
%{
|
||||
PROTOTYPES: DISABLE
|
||||
|
||||
std::string
|
||||
hello_world()
|
||||
CODE:
|
||||
RETVAL = "Hello world!";
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
%}
|
||||
|
||||
Reference in New Issue
Block a user