Fixed compilation issues caused by the previous commits
This commit is contained in:
parent
2caba92623
commit
ff3ae40aeb
4 changed files with 24 additions and 2 deletions
|
@ -81,7 +81,12 @@ sub export_gcode {
|
|||
$self->status_cb->(90, "Exporting G-code" . ($output_file ? " to $output_file" : ""));
|
||||
|
||||
# The following line may die for multiple reasons.
|
||||
Slic3r::GCode->new->do_export($self, $output_file, $params{gcode_preview_data});
|
||||
my $gcode = Slic3r::GCode->new;
|
||||
if (defined $params{gcode_preview_data}) {
|
||||
$gcode->do_export_w_preview($self, $output_file, $params{gcode_preview_data});
|
||||
} else {
|
||||
$gcode->do_export($self, $output_file);
|
||||
}
|
||||
|
||||
# run post-processing scripts
|
||||
if (@{$self->config->post_process}) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "Analyzer.hpp"
|
||||
#include "PreviewData.hpp"
|
||||
#include <float.h>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
@ -238,6 +239,11 @@ void GCodePreviewData::reset()
|
|||
unretraction.positions.clear();
|
||||
}
|
||||
|
||||
bool GCodePreviewData::empty() const
|
||||
{
|
||||
return extrusion.layers.empty() && travel.polylines.empty() && retraction.positions.empty() && unretraction.positions.empty();
|
||||
}
|
||||
|
||||
const GCodePreviewData::Color& GCodePreviewData::get_extrusion_role_color(ExtrusionRole role) const
|
||||
{
|
||||
return extrusion.role_colors[role];
|
||||
|
|
|
@ -183,6 +183,7 @@ public:
|
|||
|
||||
void set_default();
|
||||
void reset();
|
||||
bool empty() const;
|
||||
|
||||
const Color& get_extrusion_role_color(ExtrusionRole role) const;
|
||||
const Color& get_extrusion_height_color(float height) const;
|
||||
|
|
|
@ -18,7 +18,15 @@
|
|||
%name{Slic3r::GCode} class GCode {
|
||||
GCode();
|
||||
~GCode();
|
||||
void do_export(Print *print, const char *path, GCodePreviewData *preview_data)
|
||||
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)
|
||||
%code%{
|
||||
try {
|
||||
THIS->do_export(print, path, preview_data);
|
||||
|
@ -56,11 +64,13 @@
|
|||
GCodePreviewData();
|
||||
~GCodePreviewData();
|
||||
void reset();
|
||||
bool empty() const;
|
||||
void set_type(int type)
|
||||
%code%{
|
||||
if ((0 <= type) && (type < GCodePreviewData::Extrusion::Num_View_Types))
|
||||
THIS->extrusion.view_type = (GCodePreviewData::Extrusion::EViewType)type;
|
||||
%};
|
||||
int type() %code%{ RETVAL = (int)THIS->extrusion.view_type; %};
|
||||
void set_extrusion_flags(int flags)
|
||||
%code%{ THIS->extrusion.role_flags = (unsigned int)flags; %};
|
||||
void set_travel_visible(bool visible)
|
||||
|
|
Loading…
Reference in a new issue