diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2013-07-15 14:14:22 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2013-07-15 14:14:22 +0400 |
commit | f612d4c64e727b028e5291414b8a5b4da72e87b4 (patch) | |
tree | 285276ad332204643855028033a18e759b3fdce3 /xs/xsp/Polygon.xsp | |
parent | 8c1e1cc3ea07a0a2a8379e058a035a8b8bd0c855 (diff) |
Ported ExtrusionPath to XS. Failing test for Surface
Diffstat (limited to 'xs/xsp/Polygon.xsp')
-rw-r--r-- | xs/xsp/Polygon.xsp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/xs/xsp/Polygon.xsp b/xs/xsp/Polygon.xsp new file mode 100644 index 000000000..daffd819c --- /dev/null +++ b/xs/xsp/Polygon.xsp @@ -0,0 +1,29 @@ +%module{Slic3r::XS}; + +%{ +#include <myinit.h> +#include "Polygon.hpp" +%} + +%name{Slic3r::Polygon::XS} class Polygon { + ~Polygon(); + Polygon* clone() + %code{% const char* CLASS = "Slic3r::Polygon::XS"; RETVAL = new Polygon(*THIS); %}; + SV* arrayref() + %code{% RETVAL = polygon2perl(*THIS); %}; +%{ + +Polygon* +Polygon::new(...) + CODE: + RETVAL = new Polygon (); + // 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]); + } + OUTPUT: + RETVAL + +%} +}; |