PrusaSlicer-NonPlainar/xs/xsp/Flow.xsp

61 lines
1.4 KiB
Plaintext
Raw Normal View History

2014-01-05 12:16:13 +00:00
%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "libslic3r/Flow.hpp"
2014-01-05 12:16:13 +00:00
%}
%name{Slic3r::Flow} class Flow {
~Flow();
%name{_new} Flow(float width, float height, float nozzle_diameter);
Clone<Flow> clone()
%code{% RETVAL = THIS; %};
2014-01-05 12:16:13 +00:00
2021-03-08 13:29:23 +00:00
float width();
float height();
float nozzle_diameter();
bool bridge();
float spacing();
int scaled_width();
int scaled_spacing();
double mm3_per_mm();
2014-01-05 12:16:13 +00:00
%{
Flow*
2021-03-08 13:29:23 +00:00
_new_from_width(CLASS, role, width, nozzle_diameter, height)
2014-01-05 12:16:13 +00:00
char* CLASS;
FlowRole role;
std::string width;
float nozzle_diameter;
float height;
CODE:
ConfigOptionFloatOrPercent optwidth;
optwidth.deserialize(width);
2021-03-08 13:29:23 +00:00
RETVAL = new Flow(Flow::new_from_config_width(role, optwidth, nozzle_diameter, height));
2014-01-05 12:16:13 +00:00
OUTPUT:
RETVAL
%}
};
%package{Slic3r::Flow};
%{
IV
_constant()
ALIAS:
FLOW_ROLE_EXTERNAL_PERIMETER = frExternalPerimeter
2014-01-05 12:16:13 +00:00
FLOW_ROLE_PERIMETER = frPerimeter
FLOW_ROLE_INFILL = frInfill
FLOW_ROLE_SOLID_INFILL = frSolidInfill
FLOW_ROLE_TOP_SOLID_INFILL = frTopSolidInfill
FLOW_ROLE_SUPPORT_MATERIAL = frSupportMaterial
FLOW_ROLE_SUPPORT_MATERIAL_INTERFACE = frSupportMaterialInterface
PROTOTYPE:
CODE:
RETVAL = ix;
OUTPUT: RETVAL
%}