Refactoring: moved some low-level G-code generation methods to the new Slic3r::GCode::Base class

This commit is contained in:
Alessandro Ranellucci 2014-10-18 17:41:21 +02:00
parent d0a81dca28
commit e521475b7e
10 changed files with 315 additions and 192 deletions

View file

@ -28,6 +28,27 @@
void normalize();
};
%name{Slic3r::Config::GCode} class GCodeConfig {
GCodeConfig();
~GCodeConfig();
bool has(t_config_option_key opt_key);
SV* as_hash();
SV* get(t_config_option_key opt_key);
SV* get_at(t_config_option_key opt_key, int i);
bool set(t_config_option_key opt_key, SV* value);
bool set_deserialize(t_config_option_key opt_key, SV* str);
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
double get_abs_value(t_config_option_key opt_key, double ratio_over);
void apply_print_config(PrintConfig* other)
%code{% THIS->apply(*other, true); %};
void apply_dynamic(DynamicPrintConfig* other)
%code{% THIS->apply(*other, true); %};
std::vector<std::string> get_keys()
%code{% THIS->keys(&RETVAL); %};
};
%name{Slic3r::Config::Print} class PrintConfig {
PrintConfig();
~PrintConfig();
@ -112,7 +133,6 @@
%code{% THIS->apply(*other, true); %};
std::vector<std::string> get_keys()
%code{% THIS->keys(&RETVAL); %};
std::string get_extrusion_axis();
};
%package{Slic3r::Config};

View file

@ -6,7 +6,9 @@
%}
%name{Slic3r::Extruder} class Extruder {
Extruder(int id, PrintConfig *config);
// We don't need a Perl constructor with PrintConfig at the moment
//Extruder(int id, PrintConfig *config);
Extruder(int id, FullPrintConfig *config);
~Extruder();
void reset();
double extrude(double dE);

View file

@ -29,6 +29,9 @@ Ref<PrintObjectConfig> O_OBJECT_SLIC3R_T
PrintRegionConfig* O_OBJECT_SLIC3R
Ref<PrintRegionConfig> O_OBJECT_SLIC3R_T
GCodeConfig* O_OBJECT_SLIC3R
Ref<GCodeConfig> O_OBJECT_SLIC3R_T
PrintConfig* O_OBJECT_SLIC3R
Ref<PrintConfig> O_OBJECT_SLIC3R_T

View file

@ -40,6 +40,8 @@
%typemap{Ref<PrintObjectConfig>}{simple};
%typemap{PrintRegionConfig*};
%typemap{Ref<PrintRegionConfig>}{simple};
%typemap{GCodeConfig*};
%typemap{Ref<GCodeConfig>}{simple};
%typemap{PrintConfig*};
%typemap{Ref<PrintConfig>}{simple};
%typemap{FullPrintConfig*};