2013-07-06 13:26:32 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
|
|
|
#include <myinit.h>
|
|
|
|
#include "Point.hpp"
|
|
|
|
%}
|
|
|
|
|
2013-07-15 18:31:43 +00:00
|
|
|
%name{Slic3r::Point} class Point {
|
2013-07-06 14:33:49 +00:00
|
|
|
Point(unsigned long _x = 0, unsigned long _y = 0);
|
2013-07-07 14:51:02 +00:00
|
|
|
~Point();
|
2013-07-15 14:04:49 +00:00
|
|
|
Point* clone()
|
2013-07-15 18:31:43 +00:00
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(*THIS); %};
|
2013-07-15 14:04:49 +00:00
|
|
|
void scale(double factor);
|
|
|
|
void translate(double x, double y);
|
|
|
|
SV* arrayref()
|
2013-07-15 18:31:43 +00:00
|
|
|
%code{% RETVAL = THIS->to_SV(true); %};
|
|
|
|
unsigned long x()
|
|
|
|
%code{% RETVAL = THIS->x; %};
|
|
|
|
unsigned long y()
|
|
|
|
%code{% RETVAL = THIS->y; %};
|
2013-07-15 14:04:49 +00:00
|
|
|
|
2013-07-06 14:39:22 +00:00
|
|
|
%{
|
|
|
|
|
2013-07-15 14:04:49 +00:00
|
|
|
void
|
|
|
|
Point::rotate(angle, center_sv)
|
|
|
|
double angle;
|
|
|
|
SV* center_sv;
|
|
|
|
CODE:
|
|
|
|
Point center;
|
|
|
|
perl2point_check(center_sv, center);
|
|
|
|
THIS->rotate(angle, ¢er);
|
|
|
|
|
|
|
|
bool
|
|
|
|
Point::coincides_with(point_sv)
|
|
|
|
SV* point_sv;
|
2013-07-06 14:39:22 +00:00
|
|
|
CODE:
|
2013-07-15 14:04:49 +00:00
|
|
|
Point point;
|
|
|
|
perl2point_check(point_sv, point);
|
|
|
|
RETVAL = THIS->coincides_with(&point);
|
2013-07-06 14:39:22 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
%}
|
2013-07-15 14:04:49 +00:00
|
|
|
|
2013-07-06 13:26:32 +00:00
|
|
|
};
|