mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-07 02:39:07 +08:00
Fixed compilation issues caused by the previous commits
This commit is contained in:
parent
2caba92623
commit
ff3ae40aeb
@ -81,7 +81,12 @@ sub export_gcode {
|
|||||||
$self->status_cb->(90, "Exporting G-code" . ($output_file ? " to $output_file" : ""));
|
$self->status_cb->(90, "Exporting G-code" . ($output_file ? " to $output_file" : ""));
|
||||||
|
|
||||||
# The following line may die for multiple reasons.
|
# 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
|
# run post-processing scripts
|
||||||
if (@{$self->config->post_process}) {
|
if (@{$self->config->post_process}) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "Analyzer.hpp"
|
#include "Analyzer.hpp"
|
||||||
#include "PreviewData.hpp"
|
#include "PreviewData.hpp"
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
@ -238,6 +239,11 @@ void GCodePreviewData::reset()
|
|||||||
unretraction.positions.clear();
|
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
|
const GCodePreviewData::Color& GCodePreviewData::get_extrusion_role_color(ExtrusionRole role) const
|
||||||
{
|
{
|
||||||
return extrusion.role_colors[role];
|
return extrusion.role_colors[role];
|
||||||
|
@ -183,6 +183,7 @@ public:
|
|||||||
|
|
||||||
void set_default();
|
void set_default();
|
||||||
void reset();
|
void reset();
|
||||||
|
bool empty() const;
|
||||||
|
|
||||||
const Color& get_extrusion_role_color(ExtrusionRole role) const;
|
const Color& get_extrusion_role_color(ExtrusionRole role) const;
|
||||||
const Color& get_extrusion_height_color(float height) const;
|
const Color& get_extrusion_height_color(float height) const;
|
||||||
|
@ -18,7 +18,15 @@
|
|||||||
%name{Slic3r::GCode} class GCode {
|
%name{Slic3r::GCode} class GCode {
|
||||||
GCode();
|
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%{
|
%code%{
|
||||||
try {
|
try {
|
||||||
THIS->do_export(print, path, preview_data);
|
THIS->do_export(print, path, preview_data);
|
||||||
@ -56,11 +64,13 @@
|
|||||||
GCodePreviewData();
|
GCodePreviewData();
|
||||||
~GCodePreviewData();
|
~GCodePreviewData();
|
||||||
void reset();
|
void reset();
|
||||||
|
bool empty() const;
|
||||||
void set_type(int type)
|
void set_type(int type)
|
||||||
%code%{
|
%code%{
|
||||||
if ((0 <= type) && (type < GCodePreviewData::Extrusion::Num_View_Types))
|
if ((0 <= type) && (type < GCodePreviewData::Extrusion::Num_View_Types))
|
||||||
THIS->extrusion.view_type = (GCodePreviewData::Extrusion::EViewType)type;
|
THIS->extrusion.view_type = (GCodePreviewData::Extrusion::EViewType)type;
|
||||||
%};
|
%};
|
||||||
|
int type() %code%{ RETVAL = (int)THIS->extrusion.view_type; %};
|
||||||
void set_extrusion_flags(int flags)
|
void set_extrusion_flags(int flags)
|
||||||
%code%{ THIS->extrusion.role_flags = (unsigned int)flags; %};
|
%code%{ THIS->extrusion.role_flags = (unsigned int)flags; %};
|
||||||
void set_travel_visible(bool visible)
|
void set_travel_visible(bool visible)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user