2014-01-06 17:29:10 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
2015-12-07 23:39:54 +00:00
|
|
|
#include <xsinit.h>
|
2014-08-03 17:42:29 +00:00
|
|
|
#include "libslic3r/BoundingBox.hpp"
|
|
|
|
#include "libslic3r/Point.hpp"
|
2014-01-06 17:29:10 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
%name{Slic3r::Geometry::BoundingBox} class BoundingBox {
|
2014-09-21 08:51:36 +00:00
|
|
|
BoundingBox();
|
2014-01-06 17:29:10 +00:00
|
|
|
~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);
|
2016-09-30 13:23:18 +00:00
|
|
|
bool contains_point(Point* point) %code{% RETVAL = THIS->contains(*point); %};
|
|
|
|
bool overlap(BoundingBox* bbox) %code{% RETVAL = THIS->overlap(*bbox); %};
|
2015-01-19 17:53:04 +00:00
|
|
|
Clone<Polygon> polygon();
|
2014-04-27 17:18:53 +00:00
|
|
|
Clone<Point> size();
|
|
|
|
Clone<Point> center();
|
2016-10-18 14:44:05 +00:00
|
|
|
bool empty() %code{% RETVAL = empty(*THIS); %};
|
2016-09-13 11:30:00 +00:00
|
|
|
double radius();
|
2014-04-27 17:18:53 +00:00
|
|
|
Clone<Point> min_point() %code{% RETVAL = THIS->min; %};
|
|
|
|
Clone<Point> max_point() %code{% RETVAL = THIS->max; %};
|
2018-08-17 13:53:43 +00:00
|
|
|
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; %};
|
2016-11-27 15:48:48 +00:00
|
|
|
bool defined() %code{% RETVAL = THIS->defined; %};
|
|
|
|
|
2014-06-16 13:18:39 +00:00
|
|
|
%{
|
|
|
|
|
|
|
|
BoundingBox*
|
|
|
|
new_from_points(CLASS, points)
|
|
|
|
char* CLASS
|
|
|
|
Points points
|
|
|
|
CODE:
|
|
|
|
RETVAL = new BoundingBox(points);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
};
|
|
|
|
|
|
|
|
%name{Slic3r::Geometry::BoundingBoxf} class BoundingBoxf {
|
2014-09-21 08:51:36 +00:00
|
|
|
BoundingBoxf();
|
2014-06-16 13:18:39 +00:00
|
|
|
~BoundingBoxf();
|
|
|
|
Clone<BoundingBoxf> clone()
|
|
|
|
%code{% RETVAL = THIS; %};
|
|
|
|
void merge(BoundingBoxf* bb) %code{% THIS->merge(*bb); %};
|
2018-08-21 19:05:24 +00:00
|
|
|
void merge_point(Vec2d* point) %code{% THIS->merge(*point); %};
|
2014-06-16 13:18:39 +00:00
|
|
|
void scale(double factor);
|
|
|
|
void translate(double x, double y);
|
2018-08-21 19:05:24 +00:00
|
|
|
Clone<Vec2d> size();
|
|
|
|
Clone<Vec2d> center();
|
2016-09-13 11:30:00 +00:00
|
|
|
double radius();
|
2016-10-18 14:44:05 +00:00
|
|
|
bool empty() %code{% RETVAL = empty(*THIS); %};
|
2018-08-21 19:05:24 +00:00
|
|
|
Clone<Vec2d> min_point() %code{% RETVAL = THIS->min; %};
|
|
|
|
Clone<Vec2d> max_point() %code{% RETVAL = THIS->max; %};
|
2018-08-17 13:53:43 +00:00
|
|
|
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; %};
|
2016-11-27 15:48:48 +00:00
|
|
|
bool defined() %code{% RETVAL = THIS->defined; %};
|
|
|
|
|
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 {
|
2014-09-21 08:51:36 +00:00
|
|
|
BoundingBoxf3();
|
2014-01-07 11:48:09 +00:00
|
|
|
~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); %};
|
2018-08-21 15:43:05 +00:00
|
|
|
void merge_point(Vec3d* point) %code{% THIS->merge(*point); %};
|
2014-01-07 11:48:09 +00:00
|
|
|
void scale(double factor);
|
|
|
|
void translate(double x, double y, double z);
|
2017-06-08 09:02:29 +00:00
|
|
|
void offset(double delta);
|
2018-08-21 15:43:05 +00:00
|
|
|
bool contains_point(Vec3d* point) %code{% RETVAL = THIS->contains(*point); %};
|
|
|
|
Clone<Vec3d> size();
|
|
|
|
Clone<Vec3d> center();
|
2016-09-13 11:30:00 +00:00
|
|
|
double radius();
|
2016-10-18 14:44:05 +00:00
|
|
|
bool empty() %code{% RETVAL = empty(*THIS); %};
|
2018-08-21 15:43:05 +00:00
|
|
|
Clone<Vec3d> min_point() %code{% RETVAL = THIS->min; %};
|
|
|
|
Clone<Vec3d> max_point() %code{% RETVAL = THIS->max; %};
|
2018-08-17 13:53:43 +00:00
|
|
|
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; %};
|
2016-11-27 15:48:48 +00:00
|
|
|
bool defined() %code{% RETVAL = THIS->defined; %};
|
2014-01-07 11:48:09 +00:00
|
|
|
};
|