diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2013-07-15 22:31:43 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2013-07-15 22:31:43 +0400 |
commit | 9af2a1c007ae185ef665efe80e576b1997d2e819 (patch) | |
tree | 8317c909ec6d8334b47eccb55a86af7b0945295e /xs/xsp/ExPolygon.xsp | |
parent | d0701cdcd4b7a9677e130a3126e4575eb3b135fa (diff) |
Use XS Point everywhere
Diffstat (limited to 'xs/xsp/ExPolygon.xsp')
-rw-r--r-- | xs/xsp/ExPolygon.xsp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/xs/xsp/ExPolygon.xsp b/xs/xsp/ExPolygon.xsp index 93eef621e..27cbac901 100644 --- a/xs/xsp/ExPolygon.xsp +++ b/xs/xsp/ExPolygon.xsp @@ -6,11 +6,12 @@ %} %name{Slic3r::ExPolygon::XS} class ExPolygon { - ~ExPolygon(); ExPolygon* clone() - %code{% const char* CLASS = "Slic3r::ExPolygon::XS"; RETVAL = new ExPolygon(*THIS); %}; + %code{% const char* CLASS = "Slic3r::ExPolygon::XS"; RETVAL = new ExPolygon(*THIS); RETVAL->in_collection = false; %}; SV* arrayref() - %code{% RETVAL = expolygon2perl(*THIS); %}; + %code{% RETVAL = THIS->to_SV(true, false); %}; + SV* arrayref_pp() + %code{% RETVAL = THIS->to_SV(true, true); %}; void scale(double factor); void translate(double x, double y); %{ @@ -20,15 +21,23 @@ ExPolygon::new(...) CODE: RETVAL = new ExPolygon (); // ST(0) is class name, ST(1) is contour and others are holes - perl2polygon(ST(1), RETVAL->contour); + RETVAL->contour.from_SV_check(ST(1)); RETVAL->holes.resize(items-2); for (unsigned int i = 2; i < items; i++) { - perl2polygon(ST(i), RETVAL->holes[i-2]); + RETVAL->holes[i-2].from_SV_check(ST(i)); } OUTPUT: RETVAL void +ExPolygon::DESTROY() + CODE: + if (!THIS->in_collection) { + delete THIS; + THIS = NULL; + } + +void ExPolygon::rotate(angle, center_sv) double angle; SV* center_sv; |