PrusaSlicer-NonPlainar/xs/xsp/GCode.xsp

46 lines
1.5 KiB
Plaintext
Raw Normal View History

%module{Slic3r::XS};
%{
#include <xsinit.h>
#include "libslic3r/GCode.hpp"
2016-12-21 22:09:58 +00:00
#include "libslic3r/GCode/CoolingBuffer.hpp"
%}
2016-12-21 22:09:58 +00:00
%name{Slic3r::GCode::CoolingBuffer} class CoolingBuffer {
CoolingBuffer(GCode* gcode)
%code{% RETVAL = new CoolingBuffer(*gcode); %};
~CoolingBuffer();
Ref<GCode> gcodegen();
std::string process_layer(std::string gcode, size_t layer_id);
2016-12-21 22:09:58 +00:00
};
2015-07-01 19:47:17 +00:00
%name{Slic3r::GCode} class GCode {
GCode();
~GCode();
std::string do_export(Print *print, const char *path);
Ref<Pointf> origin()
%code{% RETVAL = &(THIS->origin()); %};
void set_origin(Pointf* pointf)
%code{% THIS->set_origin(*pointf); %};
2015-07-01 19:47:17 +00:00
Ref<Point> last_pos()
%code{% RETVAL = &(THIS->last_pos()); %};
unsigned int layer_count() const;
void set_layer_count(unsigned int value);
void set_extruders(std::vector<unsigned int> extruders)
%code{% THIS->writer().set_extruders(extruders); THIS->writer().set_extruder(0); %};
2015-12-16 11:33:19 +00:00
void apply_print_config(StaticPrintConfig* print_config)
%code{%
if (const PrintConfig* config = dynamic_cast<PrintConfig*>(print_config)) {
THIS->apply_print_config(*config);
} else {
CONFESS("A PrintConfig object was not supplied to apply_print_config()");
}
%};
Ref<StaticPrintConfig> config()
2017-10-17 16:41:54 +00:00
%code{% RETVAL = const_cast<StaticPrintConfig*>(static_cast<const PrintObjectConfig*>(&THIS->config())); %};
2015-07-01 19:47:17 +00:00
};