Ported some methods including add_model_object() and apply_config() to XS

This commit is contained in:
Alessandro Ranellucci 2014-11-09 12:25:59 +01:00
parent 6b4015f9ac
commit 3e4c572164
14 changed files with 312 additions and 254 deletions

View file

@ -14,12 +14,15 @@
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);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
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(DynamicPrintConfig* other)
%code{% THIS->apply(*other, true); %};
std::vector<std::string> diff(DynamicPrintConfig* other)
%code{% RETVAL = THIS->diff(*other); %};
void apply_static(FullPrintConfig* other)
%code{% THIS->apply(*other, true); %};
std::vector<std::string> get_keys()
@ -37,6 +40,7 @@
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);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
@ -58,6 +62,7 @@
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);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
@ -77,6 +82,7 @@
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);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
@ -98,6 +104,7 @@
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);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}
@ -119,6 +126,7 @@
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);
void set_ifndef(t_config_option_key opt_key, SV* value, bool deserialize = false);
std::string serialize(t_config_option_key opt_key);
double get_abs_value(t_config_option_key opt_key);
%name{get_abs_value_over}

View file

@ -56,8 +56,7 @@ _constant()
Ref<ModelObject> model_object();
Ref<PrintObjectConfig> config()
%code%{ RETVAL = &THIS->config; %};
Points copies()
%code%{ RETVAL = THIS->copies; %};
Points copies();
t_layer_height_ranges layer_height_ranges()
%code%{ RETVAL = THIS->layer_height_ranges; %};
Ref<Point3> size()
@ -75,8 +74,7 @@ _constant()
void set_shifted_copies(Points value)
%code%{ THIS->_shifted_copies = value; %};
void set_copies(Points copies)
%code%{ THIS->copies = copies; %};
void set_copies(Points copies);
void set_layer_height_ranges(t_layer_height_ranges layer_height_ranges)
%code%{ THIS->layer_height_ranges = layer_height_ranges; %};
@ -169,6 +167,9 @@ _constant()
double max_allowed_layer_height() const;
bool has_support_material() const;
void add_model_object(ModelObject* model_object, int idx = -1);
bool apply_config(DynamicPrintConfig* config)
%code%{ RETVAL = THIS->apply_config(*config); %};
void init_extruders();
%{