diff options
author | bubnikv <bubnikv@gmail.com> | 2019-07-04 21:22:15 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2019-07-04 21:22:15 +0300 |
commit | c7cc76006706fefef52060a2165708c233dbadfd (patch) | |
tree | afa1f11f7643f12c9a1a698be34b6ab33707604c /xs | |
parent | 1070991149b5279f96fb4365094c6eec98d9243f (diff) | |
parent | f617d747293de0e0bbb500ced8c4a66cdbdadf24 (diff) |
Merge remote-tracking branch 'origin/master' into vb_undo_redo
Diffstat (limited to 'xs')
-rw-r--r-- | xs/t/19_model.t | 8 | ||||
-rw-r--r-- | xs/xsp/Config.xsp | 2 | ||||
-rw-r--r-- | xs/xsp/Model.xsp | 6 | ||||
-rw-r--r-- | xs/xsp/Print.xsp | 8 |
4 files changed, 10 insertions, 14 deletions
diff --git a/xs/t/19_model.t b/xs/t/19_model.t index d6f6d97a1..48a000e46 100644 --- a/xs/t/19_model.t +++ b/xs/t/19_model.t @@ -4,7 +4,7 @@ use strict; use warnings; use Slic3r::XS; -use Test::More tests => 4; +use Test::More tests => 3; { my $model = Slic3r::Model->new; @@ -14,9 +14,9 @@ use Test::More tests => 4; $object->origin_translation->translate(10,0,0); is_deeply \@{$object->origin_translation}, [10,0,0], 'origin_translation is modified by ref'; - my $lhr = [ [ 5, 10, 0.1 ] ]; - $object->set_layer_height_ranges($lhr); - is_deeply $object->layer_height_ranges, $lhr, 'layer_height_ranges roundtrip'; +# my $lhr = [ [ 5, 10, 0.1 ] ]; +# $object->set_layer_height_ranges($lhr); +# is_deeply $object->layer_height_ranges, $lhr, 'layer_height_ranges roundtrip'; } __END__ diff --git a/xs/xsp/Config.xsp b/xs/xsp/Config.xsp index c374880a1..f5e6ffb05 100644 --- a/xs/xsp/Config.xsp +++ b/xs/xsp/Config.xsp @@ -49,7 +49,7 @@ void erase(t_config_option_key opt_key); void normalize(); %name{setenv} void setenv_(); - double min_object_distance() %code{% RETVAL = PrintConfig::min_object_distance(THIS); %}; + double min_object_distance() %code{% PrintConfig cfg; cfg.apply(*THIS, true); RETVAL = cfg.min_object_distance(); %}; static DynamicPrintConfig* load(char *path) %code%{ auto config = new DynamicPrintConfig(); diff --git a/xs/xsp/Model.xsp b/xs/xsp/Model.xsp index 6a2cc6080..35b1c01ce 100644 --- a/xs/xsp/Model.xsp +++ b/xs/xsp/Model.xsp @@ -206,16 +206,12 @@ ModelMaterial::attributes() Ref<Model> model() %code%{ RETVAL = THIS->get_model(); %}; - t_layer_height_ranges layer_height_ranges() - %code%{ RETVAL = THIS->layer_height_ranges; %}; - void set_layer_height_ranges(t_layer_height_ranges ranges) - %code%{ THIS->layer_height_ranges = ranges; %}; - Ref<Vec3d> origin_translation() %code%{ RETVAL = &THIS->origin_translation; %}; void set_origin_translation(Vec3d* point) %code%{ THIS->origin_translation = *point; %}; + void ensure_on_bed(); bool needed_repair() const; int materials_count() const; int facets_count(); diff --git a/xs/xsp/Print.xsp b/xs/xsp/Print.xsp index c35f967f8..df5f48587 100644 --- a/xs/xsp/Print.xsp +++ b/xs/xsp/Print.xsp @@ -70,6 +70,8 @@ _constant() Print(); ~Print(); + Ref<Model> model() + %code%{ RETVAL = const_cast<Model*>(&THIS->model()); %}; Ref<StaticPrintConfig> config() %code%{ RETVAL = const_cast<GCodeConfig*>(static_cast<const GCodeConfig*>(&THIS->config())); %}; Ref<PlaceholderParser> placeholder_parser() @@ -100,7 +102,6 @@ _constant() %code%{ RETVAL = const_cast<PrintObjectPtrs*>(&THIS->objects()); %}; Ref<PrintObject> get_object(int idx) %code%{ RETVAL = THIS->objects()[idx]; %}; - void reload_object(int idx); size_t object_count() %code%{ RETVAL = THIS->objects().size(); %}; @@ -141,9 +142,8 @@ _constant() } %}; - void add_model_object(ModelObject* model_object, int idx = -1); - bool apply_config_perl_tests_only(DynamicPrintConfig* config) - %code%{ RETVAL = THIS->apply_config_perl_tests_only(*config); %}; + bool apply(Model *model, DynamicPrintConfig* config) + %code%{ RETVAL = THIS->apply(*model, *config); %}; bool has_infinite_skirt(); std::vector<unsigned int> extruders() const; int validate() %code%{ |