Files
OrcaSlicer-bambulab/xs/xsp/ExPolygon.xsp
T

46 lines
903 B
Plaintext
Raw Normal View History

2013-07-06 16:33:49 +02:00
%module{Slic3r::XS};
%{
#include <myinit.h>
#include "ExPolygon.hpp"
%}
%name{Slic3r::ExPolygon::XS} class ExPolygon {
%name{_clone} ExPolygon(ExPolygon& self);
2013-07-07 16:51:02 +02:00
~ExPolygon();
2013-07-14 00:38:01 +02:00
SV* arrayref()
%code{% RETVAL = expolygon2perl(*THIS); %};
2013-07-11 14:08:11 +02:00
void scale(double factor);
2013-07-11 18:55:51 +02:00
void translate(double x, double y);
void _rotate(double angle, Point* center);
2013-07-06 16:33:49 +02:00
%{
ExPolygon*
ExPolygon::new(...)
CODE:
RETVAL = new ExPolygon ();
// ST(0) is class name, ST(1) is contour and others are holes
2013-07-07 16:51:02 +02:00
perl2polygon(ST(1), RETVAL->contour);
RETVAL->holes.resize(items-2);
2013-07-06 16:33:49 +02:00
for (unsigned int i = 2; i < items; i++) {
2013-07-07 16:51:02 +02:00
perl2polygon(ST(i), RETVAL->holes[i-2]);
2013-07-06 16:33:49 +02:00
}
OUTPUT:
RETVAL
%}
};
%package{Slic3r::ExPolygon::XS};
%{
PROTOTYPES: DISABLE
std::string
hello_world()
CODE:
RETVAL = "Hello world!";
OUTPUT:
RETVAL
%}