mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 15:51:10 -06:00
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:
parent
3a6436f6f0
commit
b1f5e7e8fa
20 changed files with 166 additions and 401 deletions
|
@ -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);
|
||||
};
|
||||
|
|
|
@ -195,12 +195,13 @@ _load_wipe_tower_toolpaths(print, volumes, tool_colors, use_VBOs)
|
|||
_3DScene::_load_wipe_tower_toolpaths(print, volumes, tool_colors, use_VBOs != 0);
|
||||
|
||||
void
|
||||
load_gcode_preview(print, volumes, str_tool_colors, use_VBOs)
|
||||
load_gcode_preview(print, preview_data, volumes, str_tool_colors, use_VBOs)
|
||||
Print *print;
|
||||
GCodePreviewData *preview_data;
|
||||
GLVolumeCollection *volumes;
|
||||
std::vector<std::string> str_tool_colors;
|
||||
int use_VBOs;
|
||||
CODE:
|
||||
_3DScene::load_gcode_preview(print, volumes, str_tool_colors, use_VBOs != 0);
|
||||
_3DScene::load_gcode_preview(print, preview_data, volumes, str_tool_colors, use_VBOs != 0);
|
||||
|
||||
%}
|
||||
|
|
|
@ -165,15 +165,6 @@ _constant()
|
|||
size_t object_count()
|
||||
%code%{ RETVAL = THIS->objects.size(); %};
|
||||
|
||||
void clear_gcode_preview_data();
|
||||
void set_gcode_preview_type(unsigned char type);
|
||||
void set_gcode_preview_extrusion_flags(unsigned int flags);
|
||||
void set_gcode_preview_travel_visible(bool visible);
|
||||
void set_gcode_preview_retractions_visible(bool visible);
|
||||
void set_gcode_preview_unretractions_visible(bool visible);
|
||||
void set_gcode_preview_shells_visible(bool visible);
|
||||
void set_gcode_extrusion_paths_colors(std::vector<std::string> colors);
|
||||
|
||||
PrintRegionPtrs* regions()
|
||||
%code%{ RETVAL = &THIS->regions; %};
|
||||
Ref<PrintRegion> get_region(int idx);
|
||||
|
|
|
@ -191,6 +191,10 @@ GCode* O_OBJECT_SLIC3R
|
|||
Ref<GCode> O_OBJECT_SLIC3R_T
|
||||
Clone<GCode> O_OBJECT_SLIC3R_T
|
||||
|
||||
GCodePreviewData* O_OBJECT_SLIC3R
|
||||
Ref<GCodePreviewData> O_OBJECT_SLIC3R_T
|
||||
Clone<GCodePreviewData> O_OBJECT_SLIC3R_T
|
||||
|
||||
MotionPlanner* O_OBJECT_SLIC3R
|
||||
Ref<MotionPlanner> O_OBJECT_SLIC3R_T
|
||||
Clone<MotionPlanner> O_OBJECT_SLIC3R_T
|
||||
|
|
|
@ -155,6 +155,9 @@
|
|||
%typemap{Ref<GCode>}{simple};
|
||||
%typemap{Clone<GCode>}{simple};
|
||||
|
||||
%typemap{GCodePreviewData*};
|
||||
%typemap{Ref<GCodePreviewData>}{simple};
|
||||
%typemap{Clone<GCodePreviewData>}{simple};
|
||||
|
||||
%typemap{Points};
|
||||
%typemap{Pointfs};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue