%module{Slic3r::XS}; %{ #include #include "Point.hpp" %} %name{Slic3r::Point} class Point { Point(unsigned long _x = 0, unsigned long _y = 0); ~Point(); Point* clone() %code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(*THIS); %}; void scale(double factor); void translate(double x, double y); SV* arrayref() %code{% RETVAL = THIS->to_SV(true); %}; unsigned long x() %code{% RETVAL = THIS->x; %}; unsigned long y() %code{% RETVAL = THIS->y; %}; %{ 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; CODE: Point point; perl2point_check(point_sv, point); RETVAL = THIS->coincides_with(&point); OUTPUT: RETVAL %} };