2014-01-06 17:29:10 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
|
|
|
#include <myinit.h>
|
|
|
|
#include "BoundingBox.hpp"
|
|
|
|
#include "Point.hpp"
|
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::Geometry::BoundingBox} class BoundingBox {
|
|
|
|
~BoundingBox();
|
2014-04-27 17:18:53 +00:00
|
|
|
Clone<BoundingBox> clone()
|
|
|
|
%code{% RETVAL = THIS; %};
|
2014-01-06 17:29:10 +00:00
|
|
|
void merge(BoundingBox* bb) %code{% THIS->merge(*bb); %};
|
2014-01-07 11:48:09 +00:00
|
|
|
void merge_point(Point* point) %code{% THIS->merge(*point); %};
|
2014-01-06 17:29:10 +00:00
|
|
|
void scale(double factor);
|
|
|
|
void translate(double x, double y);
|
2014-07-24 16:32:07 +00:00
|
|
|
void offset(double delta);
|
2014-01-06 17:29:10 +00:00
|
|
|
Polygon* polygon()
|
2014-04-27 17:18:53 +00:00
|
|
|
%code{% RETVAL = new Polygon(); THIS->polygon(RETVAL); %};
|
|
|
|
Clone<Point> size();
|
|
|
|
Clone<Point> center();
|
|
|
|
Clone<Point> min_point() %code{% RETVAL = THIS->min; %};
|
|
|
|
Clone<Point> max_point() %code{% RETVAL = THIS->max; %};
|
2014-06-16 13:18:39 +00:00
|
|
|
long x_min() %code{% RETVAL = THIS->min.x; %};
|
|
|
|
long x_max() %code{% RETVAL = THIS->max.x; %};
|
|
|
|
long y_min() %code{% RETVAL = THIS->min.y; %};
|
|
|
|
long y_max() %code{% RETVAL = THIS->max.y; %};
|
|
|
|
|
|
|
|
%{
|
|
|
|
|
|
|
|
BoundingBox*
|
|
|
|
new_from_points(CLASS, points)
|
|
|
|
char* CLASS
|
|
|
|
Points points
|
|
|
|
CODE:
|
|
|
|
RETVAL = new BoundingBox(points);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
};
|
|
|
|
|
|
|
|
%name{Slic3r::Geometry::BoundingBoxf} class BoundingBoxf {
|
|
|
|
~BoundingBoxf();
|
|
|
|
Clone<BoundingBoxf> clone()
|
|
|
|
%code{% RETVAL = THIS; %};
|
|
|
|
void merge(BoundingBoxf* bb) %code{% THIS->merge(*bb); %};
|
|
|
|
void merge_point(Pointf* point) %code{% THIS->merge(*point); %};
|
|
|
|
void scale(double factor);
|
|
|
|
void translate(double x, double y);
|
|
|
|
Clone<Pointf> size();
|
|
|
|
Clone<Pointf> center();
|
|
|
|
Clone<Pointf> min_point() %code{% RETVAL = THIS->min; %};
|
|
|
|
Clone<Pointf> max_point() %code{% RETVAL = THIS->max; %};
|
2014-01-06 17:29:10 +00:00
|
|
|
double x_min() %code{% RETVAL = THIS->min.x; %};
|
|
|
|
double x_max() %code{% RETVAL = THIS->max.x; %};
|
|
|
|
double y_min() %code{% RETVAL = THIS->min.y; %};
|
|
|
|
double y_max() %code{% RETVAL = THIS->max.y; %};
|
2014-08-02 22:20:55 +00:00
|
|
|
void set_x_min(double val) %code{% THIS->min.x = val; %};
|
|
|
|
void set_x_max(double val) %code{% THIS->max.x = val; %};
|
|
|
|
void set_y_min(double val) %code{% THIS->min.y = val; %};
|
|
|
|
void set_y_max(double val) %code{% THIS->max.y = val; %};
|
2014-01-06 17:29:10 +00:00
|
|
|
|
|
|
|
%{
|
|
|
|
|
2014-06-16 13:18:39 +00:00
|
|
|
BoundingBoxf*
|
2014-01-07 11:48:09 +00:00
|
|
|
new_from_points(CLASS, points)
|
2014-01-06 17:29:10 +00:00
|
|
|
char* CLASS
|
2014-06-16 13:18:39 +00:00
|
|
|
Pointfs points
|
2014-01-06 17:29:10 +00:00
|
|
|
CODE:
|
2014-06-16 13:18:39 +00:00
|
|
|
RETVAL = new BoundingBoxf(points);
|
2014-01-06 17:29:10 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
};
|
2014-01-07 11:48:09 +00:00
|
|
|
|
|
|
|
%name{Slic3r::Geometry::BoundingBoxf3} class BoundingBoxf3 {
|
|
|
|
~BoundingBoxf3();
|
2014-04-27 17:18:53 +00:00
|
|
|
Clone<BoundingBoxf3> clone()
|
|
|
|
%code{% RETVAL = THIS; %};
|
2014-01-07 11:48:09 +00:00
|
|
|
void merge(BoundingBoxf3* bb) %code{% THIS->merge(*bb); %};
|
|
|
|
void scale(double factor);
|
|
|
|
void translate(double x, double y, double z);
|
2014-04-27 17:18:53 +00:00
|
|
|
Clone<Pointf3> size();
|
|
|
|
Clone<Pointf3> center();
|
2014-01-07 11:48:09 +00:00
|
|
|
double x_min() %code{% RETVAL = THIS->min.x; %};
|
|
|
|
double x_max() %code{% RETVAL = THIS->max.x; %};
|
|
|
|
double y_min() %code{% RETVAL = THIS->min.y; %};
|
|
|
|
double y_max() %code{% RETVAL = THIS->max.y; %};
|
|
|
|
double z_min() %code{% RETVAL = THIS->min.z; %};
|
|
|
|
double z_max() %code{% RETVAL = THIS->max.z; %};
|
|
|
|
};
|