mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 11:53:48 +00:00
Incomplete work for porting BoundingBox to XS
This commit is contained in:
43
xs/xsp/BoundingBox.xsp
Normal file
43
xs/xsp/BoundingBox.xsp
Normal file
@@ -0,0 +1,43 @@
|
||||
%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); %};
|
||||
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*
|
||||
BoundingBox::new_from_points(CLASS, points)
|
||||
char* CLASS
|
||||
Points points
|
||||
CODE:
|
||||
RETVAL = new BoundingBox(points);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
%}
|
||||
};
|
||||
@@ -26,6 +26,12 @@
|
||||
void merge(TriangleMesh* mesh);
|
||||
ExPolygons horizontal_projection()
|
||||
%code{% THIS->horizontal_projection(RETVAL); %};
|
||||
BoundingBoxf3* bounding_box()
|
||||
%code{%
|
||||
const char* CLASS = "Slic3r::Geometry::BoundingBoxf3";
|
||||
RETVAL = new BoundingBoxf3();
|
||||
THIS->bounding_box(RETVAL);
|
||||
%};
|
||||
%{
|
||||
|
||||
SV*
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
std::vector<Points::size_type> T_STD_VECTOR_INT
|
||||
t_config_option_key T_STD_STRING
|
||||
|
||||
BoundingBox* O_OBJECT
|
||||
BoundingBoxf3* O_OBJECT
|
||||
DynamicPrintConfig* O_OBJECT
|
||||
PrintObjectConfig* O_OBJECT
|
||||
PrintRegionConfig* O_OBJECT
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
%typemap{SV*};
|
||||
%typemap{AV*};
|
||||
%typemap{Point*};
|
||||
%typemap{BoundingBox*};
|
||||
%typemap{BoundingBoxf3*};
|
||||
%typemap{DynamicPrintConfig*};
|
||||
%typemap{PrintObjectConfig*};
|
||||
%typemap{PrintRegionConfig*};
|
||||
|
||||
Reference in New Issue
Block a user