2015-07-01 18:14:05 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
2015-12-07 23:39:54 +00:00
|
|
|
#include <xsinit.h>
|
2015-07-01 18:14:05 +00:00
|
|
|
#include "libslic3r/GCode.hpp"
|
2016-12-21 22:09:58 +00:00
|
|
|
#include "libslic3r/GCode/CoolingBuffer.hpp"
|
2018-02-14 19:35:59 +00:00
|
|
|
#include "libslic3r/GCode/PreviewData.hpp"
|
2015-07-01 18:14:05 +00:00
|
|
|
%}
|
|
|
|
|
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();
|
2017-06-23 08:13:09 +00:00
|
|
|
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();
|
2018-02-14 20:57:46 +00:00
|
|
|
void do_export(Print *print, const char *path)
|
|
|
|
%code%{
|
|
|
|
try {
|
|
|
|
THIS->do_export(print, path);
|
|
|
|
} catch (std::exception& e) {
|
|
|
|
croak(e.what());
|
|
|
|
}
|
|
|
|
%};
|
|
|
|
void do_export_w_preview(Print *print, const char *path, GCodePreviewData *preview_data)
|
2017-12-05 14:54:24 +00:00
|
|
|
%code%{
|
|
|
|
try {
|
2018-02-14 19:35:59 +00:00
|
|
|
THIS->do_export(print, path, preview_data);
|
2017-12-05 14:54:24 +00:00
|
|
|
} catch (std::exception& e) {
|
|
|
|
croak(e.what());
|
|
|
|
}
|
|
|
|
%};
|
2016-09-12 14:25:15 +00:00
|
|
|
|
2017-05-03 16:28:22 +00:00
|
|
|
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()
|
2015-07-01 21:00:52 +00:00
|
|
|
%code{% RETVAL = &(THIS->last_pos()); %};
|
2017-05-03 16:28:22 +00:00
|
|
|
|
|
|
|
unsigned int layer_count() const;
|
|
|
|
void set_layer_count(unsigned int value);
|
2017-06-30 17:07:14 +00:00
|
|
|
void set_extruders(std::vector<unsigned int> extruders)
|
|
|
|
%code{% THIS->writer().set_extruders(extruders); THIS->writer().set_extruder(0); %};
|
2017-05-03 16:28:22 +00:00
|
|
|
|
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()");
|
|
|
|
}
|
|
|
|
%};
|
2015-07-02 18:24:16 +00:00
|
|
|
|
2017-05-03 16:28:22 +00:00
|
|
|
Ref<StaticPrintConfig> config()
|
2017-10-17 16:49:07 +00:00
|
|
|
%code{% RETVAL = const_cast<StaticPrintConfig*>(static_cast<const StaticPrintConfig*>(static_cast<const PrintObjectConfig*>(&THIS->config()))); %};
|
2015-07-01 19:47:17 +00:00
|
|
|
};
|
2018-02-14 19:35:59 +00:00
|
|
|
|
|
|
|
%name{Slic3r::GCode::PreviewData} class GCodePreviewData {
|
|
|
|
GCodePreviewData();
|
|
|
|
~GCodePreviewData();
|
|
|
|
void reset();
|
2018-02-14 20:57:46 +00:00
|
|
|
bool empty() const;
|
2018-02-14 19:35:59 +00:00
|
|
|
void set_type(int type)
|
|
|
|
%code%{
|
|
|
|
if ((0 <= type) && (type < GCodePreviewData::Extrusion::Num_View_Types))
|
|
|
|
THIS->extrusion.view_type = (GCodePreviewData::Extrusion::EViewType)type;
|
|
|
|
%};
|
2018-02-14 20:57:46 +00:00
|
|
|
int type() %code%{ RETVAL = (int)THIS->extrusion.view_type; %};
|
2018-02-14 19:35:59 +00:00
|
|
|
void set_extrusion_flags(int flags)
|
|
|
|
%code%{ THIS->extrusion.role_flags = (unsigned int)flags; %};
|
|
|
|
void set_travel_visible(bool visible)
|
|
|
|
%code%{ THIS->travel.is_visible = visible; %};
|
|
|
|
void set_retractions_visible(bool visible)
|
|
|
|
%code%{ THIS->retraction.is_visible = visible; %};
|
|
|
|
void set_unretractions_visible(bool visible)
|
|
|
|
%code%{ THIS->unretraction.is_visible = visible; %};
|
|
|
|
void set_shells_visible(bool visible)
|
|
|
|
%code%{ THIS->shell.is_visible = visible; %};
|
|
|
|
void set_extrusion_paths_colors(std::vector<std::string> colors);
|
|
|
|
};
|