Merge remote-tracking branch 'origin/master' into vb_undo_redo

This commit is contained in:
bubnikv 2019-07-04 20:22:15 +02:00
commit c7cc760067
105 changed files with 3283 additions and 1599 deletions

View file

@ -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__

View file

@ -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();

View file

@ -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();

View file

@ -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%{