1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- %module{Slic3r::XS};
- %{
- #include <myinit.h>
- #include "ExPolygon.hpp"
- %}
- %name{Slic3r::ExPolygon} class ExPolygon {
- ~ExPolygon();
- ExPolygon* clone()
- %code{% const char* CLASS = "Slic3r::ExPolygon"; RETVAL = new ExPolygon(*THIS); %};
- SV* arrayref()
- %code{% RETVAL = THIS->to_AV(); %};
- SV* pp()
- %code{% RETVAL = THIS->to_SV_pureperl(); %};
- Polygon* contour()
- %code{% const char* CLASS = "Slic3r::Polygon::Ref"; RETVAL = &(THIS->contour); %};
- Polygons* holes()
- %code{% RETVAL = &(THIS->holes); %};
- void scale(double factor);
- void translate(double x, double y);
- double area();
- bool is_valid();
- bool contains_line(Line* line);
- bool contains_point(Point* point);
- ExPolygons simplify(double tolerance);
- Polygons simplify_p(double tolerance);
- %{
- ExPolygon*
- ExPolygon::new(...)
- CODE:
- RETVAL = new ExPolygon ();
-
- RETVAL->contour.from_SV_check(ST(1));
- RETVAL->holes.resize(items-2);
- for (unsigned int i = 2; i < items; i++) {
- RETVAL->holes[i-2].from_SV_check(ST(i));
- }
- OUTPUT:
- RETVAL
- void
- ExPolygon::rotate(angle, center_sv)
- double angle;
- SV* center_sv;
- CODE:
- Point center;
- center.from_SV_check(center_sv);
- THIS->rotate(angle, ¢er);
- %}
- };
|