Merge branch 'gcode-refactoring'

This commit is contained in:
Alessandro Ranellucci 2014-10-21 20:20:28 +02:00
commit f82e92f498
20 changed files with 747 additions and 363 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,10 +6,14 @@
%}
%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);
double retract(double length, double restart_extra);
double unretract();
int id() const
%code%{ RETVAL = THIS->id; %};

View file

@ -110,4 +110,10 @@ Point::coincides_with(point_sv)
%code{% RETVAL = THIS->y; %};
double z()
%code{% RETVAL = THIS->z; %};
void set_x(double val)
%code{% THIS->x = val; %};
void set_y(double val)
%code{% THIS->y = val; %};
void set_z(double val)
%code{% THIS->z = val; %};
};

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*};