123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- %module{Slic3r::XS};
- %{
- #include <xsinit.h>
- #include "libslic3r/BoundingBox.hpp"
- #include "libslic3r/Point.hpp"
- %}
- %name{Slic3r::Geometry::BoundingBox} class BoundingBox {
- BoundingBox();
- ~BoundingBox();
- Clone<BoundingBox> clone()
- %code{% RETVAL = THIS; %};
- void merge(BoundingBox* bb) %code{% THIS->merge(*bb); %};
- void merge_point(Point* point) %code{% THIS->merge(*point); %};
- void scale(double factor);
- void translate(double x, double y);
- void offset(double delta);
- bool contains_point(Point* point) %code{% RETVAL = THIS->contains(*point); %};
- bool overlap(BoundingBox* bbox) %code{% RETVAL = THIS->overlap(*bbox); %};
- Clone<Polygon> polygon();
- Clone<Point> size();
- Clone<Point> center();
- bool empty() %code{% RETVAL = empty(*THIS); %};
- double radius();
- Clone<Point> min_point() %code{% RETVAL = THIS->min; %};
- Clone<Point> max_point() %code{% RETVAL = THIS->max; %};
- int x_min() %code{% RETVAL = THIS->min(0); %};
- int x_max() %code{% RETVAL = THIS->max(0); %};
- int y_min() %code{% RETVAL = THIS->min(1); %};
- int y_max() %code{% RETVAL = THIS->max(1); %};
- void set_x_min(double val) %code{% THIS->min(0) = val; %};
- void set_x_max(double val) %code{% THIS->max(0) = val; %};
- void set_y_min(double val) %code{% THIS->min(1) = val; %};
- void set_y_max(double val) %code{% THIS->max(1) = val; %};
- std::string serialize() %code{% char buf[2048]; sprintf(buf, "%ld,%ld;%ld,%ld", THIS->min(0), THIS->min(1), THIS->max(0), THIS->max(1)); RETVAL = buf; %};
- bool defined() %code{% RETVAL = THIS->defined; %};
- %{
- BoundingBox*
- new_from_points(CLASS, points)
- char* CLASS
- Points points
- CODE:
- RETVAL = new BoundingBox(points);
- OUTPUT:
- RETVAL
- %}
- };
- %name{Slic3r::Geometry::BoundingBoxf} class BoundingBoxf {
- BoundingBoxf();
- ~BoundingBoxf();
- Clone<BoundingBoxf> clone()
- %code{% RETVAL = THIS; %};
- void merge(BoundingBoxf* bb) %code{% THIS->merge(*bb); %};
- void merge_point(Vec2d* point) %code{% THIS->merge(*point); %};
- void scale(double factor);
- void translate(double x, double y);
- Clone<Vec2d> size();
- Clone<Vec2d> center();
- double radius();
- bool empty() %code{% RETVAL = empty(*THIS); %};
- Clone<Vec2d> min_point() %code{% RETVAL = THIS->min; %};
- Clone<Vec2d> max_point() %code{% RETVAL = THIS->max; %};
- double x_min() %code{% RETVAL = THIS->min(0); %};
- double x_max() %code{% RETVAL = THIS->max(0); %};
- double y_min() %code{% RETVAL = THIS->min(1); %};
- double y_max() %code{% RETVAL = THIS->max(1); %};
- void set_x_min(double val) %code{% THIS->min(0) = val; %};
- void set_x_max(double val) %code{% THIS->max(0) = val; %};
- void set_y_min(double val) %code{% THIS->min(1) = val; %};
- void set_y_max(double val) %code{% THIS->max(1) = val; %};
- std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf;%lf,%lf", THIS->min(0), THIS->min(1), THIS->max(0), THIS->max(1)); RETVAL = buf; %};
- bool defined() %code{% RETVAL = THIS->defined; %};
-
- %{
- BoundingBoxf*
- new_from_points(CLASS, points)
- char* CLASS
- Pointfs points
- CODE:
- RETVAL = new BoundingBoxf(points);
- OUTPUT:
- RETVAL
- %}
- };
- %name{Slic3r::Geometry::BoundingBoxf3} class BoundingBoxf3 {
- BoundingBoxf3();
- ~BoundingBoxf3();
- Clone<BoundingBoxf3> clone()
- %code{% RETVAL = THIS; %};
- void merge(BoundingBoxf3* bb) %code{% THIS->merge(*bb); %};
- void merge_point(Vec3d* point) %code{% THIS->merge(*point); %};
- void scale(double factor);
- void translate(double x, double y, double z);
- void offset(double delta);
- bool contains_point(Vec3d* point) %code{% RETVAL = THIS->contains(*point); %};
- Clone<Vec3d> size();
- Clone<Vec3d> center();
- double radius();
- bool empty() %code{% RETVAL = empty(*THIS); %};
- Clone<Vec3d> min_point() %code{% RETVAL = THIS->min; %};
- Clone<Vec3d> max_point() %code{% RETVAL = THIS->max; %};
- double x_min() %code{% RETVAL = THIS->min(0); %};
- double x_max() %code{% RETVAL = THIS->max(0); %};
- double y_min() %code{% RETVAL = THIS->min(1); %};
- double y_max() %code{% RETVAL = THIS->max(1); %};
- double z_min() %code{% RETVAL = THIS->min(2); %};
- double z_max() %code{% RETVAL = THIS->max(2); %};
- std::string serialize() %code{% char buf[2048]; sprintf(buf, "%lf,%lf,%lf;%lf,%lf,%lf", THIS->min(0), THIS->min(1), THIS->min(2), THIS->max(0), THIS->max(1), THIS->max(2)); RETVAL = buf; %};
- bool defined() %code{% RETVAL = THIS->defined; %};
- };
|