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();
|
|
|
|
BoundingBox* clone()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Geometry::BoundingBox"; RETVAL = new BoundingBox(*THIS); %};
|
|
|
|
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);
|
|
|
|
Polygon* polygon()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Polygon"; RETVAL = new Polygon(); THIS->polygon(RETVAL); %};
|
|
|
|
Point* size()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(THIS->size()); %};
|
|
|
|
Point* center()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(THIS->center()); %};
|
|
|
|
Point* min_point()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(THIS->min); %};
|
|
|
|
Point* max_point()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(THIS->max); %};
|
|
|
|
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; %};
|
|
|
|
|
|
|
|
%{
|
|
|
|
|
|
|
|
BoundingBox*
|
2014-01-07 11:48:09 +00:00
|
|
|
new_from_points(CLASS, points)
|
2014-01-06 17:29:10 +00:00
|
|
|
char* CLASS
|
|
|
|
Points points
|
|
|
|
CODE:
|
|
|
|
RETVAL = new BoundingBox(points);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
%}
|
|
|
|
};
|
2014-01-07 11:48:09 +00:00
|
|
|
|
|
|
|
%name{Slic3r::Geometry::BoundingBoxf3} class BoundingBoxf3 {
|
|
|
|
~BoundingBoxf3();
|
|
|
|
BoundingBoxf3* clone()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Geometry::BoundingBoxf3"; RETVAL = new BoundingBoxf3(*THIS); %};
|
|
|
|
void merge(BoundingBoxf3* bb) %code{% THIS->merge(*bb); %};
|
|
|
|
void scale(double factor);
|
|
|
|
void translate(double x, double y, double z);
|
|
|
|
Pointf3* size()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Pointf3"; RETVAL = new Pointf3(THIS->size()); %};
|
|
|
|
Pointf3* center()
|
|
|
|
%code{% const char* CLASS = "Slic3r::Pointf3"; RETVAL = new Pointf3(THIS->center()); %};
|
|
|
|
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; %};
|
|
|
|
};
|