2013-07-15 20:57:22 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
|
|
|
#include <myinit.h>
|
|
|
|
#include "Line.hpp"
|
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::Line} class Line {
|
|
|
|
~Line();
|
|
|
|
Line* clone()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Line"; RETVAL = new Line(*THIS); %};
|
|
|
|
SV* arrayref()
|
|
|
|
%code{% RETVAL = THIS->to_SV(); %};
|
|
|
|
SV* pp()
|
|
|
|
%code{% RETVAL = THIS->to_SV_pureperl(); %};
|
2013-07-16 07:49:34 +00:00
|
|
|
Point* a()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(THIS->a); %};
|
|
|
|
Point* b()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(THIS->b); %};
|
2013-07-15 20:57:22 +00:00
|
|
|
void reverse();
|
|
|
|
%{
|
|
|
|
|
|
|
|
Line*
|
|
|
|
Line::new(...)
|
|
|
|
CODE:
|
|
|
|
RETVAL = new Line ();
|
|
|
|
// ST(0) is class name, ST(1) and ST(2) are endpoints
|
|
|
|
RETVAL->a.from_SV_check( ST(1) );
|
|
|
|
RETVAL->b.from_SV_check( ST(2) );
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
};
|