Removed the GCodePreviewData from the Print class, it does not belong here,

as the GCode is generated outside of the Print class.
Exported the GCodePreviewData as GCode::PreviewData to Perl.
When exporting the G-code with a command line Slic3r,
the GCodeAnalyzer is now supressed for performance reasons.
Removed obsolete Perl module Slic3r::GUI::Plater::3DToolpaths.
This commit is contained in:
bubnikv 2018-02-14 20:35:59 +01:00
parent 3a6436f6f0
commit b1f5e7e8fa
20 changed files with 166 additions and 401 deletions

View file

@ -4,6 +4,7 @@
#include <xsinit.h>
#include "libslic3r/GCode.hpp"
#include "libslic3r/GCode/CoolingBuffer.hpp"
#include "libslic3r/GCode/PreviewData.hpp"
%}
%name{Slic3r::GCode::CoolingBuffer} class CoolingBuffer {
@ -17,10 +18,10 @@
%name{Slic3r::GCode} class GCode {
GCode();
~GCode();
void do_export(Print *print, const char *path)
void do_export(Print *print, const char *path, GCodePreviewData *preview_data)
%code%{
try {
THIS->do_export(print, path);
THIS->do_export(print, path, preview_data);
} catch (std::exception& e) {
croak(e.what());
}
@ -50,3 +51,25 @@
Ref<StaticPrintConfig> config()
%code{% RETVAL = const_cast<StaticPrintConfig*>(static_cast<const StaticPrintConfig*>(static_cast<const PrintObjectConfig*>(&THIS->config()))); %};
};
%name{Slic3r::GCode::PreviewData} class GCodePreviewData {
GCodePreviewData();
~GCodePreviewData();
void reset();
void set_type(int type)
%code%{
if ((0 <= type) && (type < GCodePreviewData::Extrusion::Num_View_Types))
THIS->extrusion.view_type = (GCodePreviewData::Extrusion::EViewType)type;
%};
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);
};