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,14 +5,14 @@
|
||||
#include "Polyline.hpp"
|
||||
%}
|
||||
|
||||
%name{Slic3r::Polyline::XS} class Polyline {
|
||||
%name{Slic3r::Polyline} class Polyline {
|
||||
~Polyline();
|
||||
Polyline* clone()
|
||||
%code{% const char* CLASS = "Slic3r::Polyline::XS"; RETVAL = new Polyline(*THIS); %};
|
||||
%code{% const char* CLASS = "Slic3r::Polyline"; RETVAL = new Polyline(*THIS); %};
|
||||
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 pop_back()
|
||||
%code{% THIS->points.pop_back(); %};
|
||||
void reverse();
|
||||
@@ -25,7 +25,7 @@ Polyline::new(...)
|
||||
// ST(0) is class name, ST(1) is first point
|
||||
RETVAL->points.resize(items-1);
|
||||
for (unsigned int i = 1; i < items; i++) {
|
||||
perl2point(ST(i), RETVAL->points[i-1]);
|
||||
RETVAL->points[i-1].from_SV_check( ST(i) );
|
||||
}
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
@@ -35,11 +35,7 @@ Polyline::append(...)
|
||||
CODE:
|
||||
for (unsigned int i = 1; i < items; i++) {
|
||||
Point p;
|
||||
if (sv_isobject(ST(i)) && (SvTYPE(SvRV(ST(i))) == SVt_PVMG)) {
|
||||
p = *(Point*)SvIV((SV*)SvRV( ST(i) ));
|
||||
} else {
|
||||
perl2point(ST(i), p);
|
||||
}
|
||||
p.from_SV_check( ST(1) );
|
||||
THIS->points.push_back(p);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user