mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-31 20:51:12 -06:00
Use Pointf for origin_translation and pass const refs whenever possible
This commit is contained in:
parent
54a199919b
commit
13af16ea24
7 changed files with 80 additions and 89 deletions
|
|
@ -471,8 +471,8 @@ sub reset {
|
|||
my $self = shift;
|
||||
|
||||
@{$self->{objects}} = ();
|
||||
$self->{model}->delete_all_objects;
|
||||
$self->{print}->delete_all_objects;
|
||||
$self->{model}->clear_objects;
|
||||
$self->{print}->clear_objects;
|
||||
$self->{list}->DeleteAllItems;
|
||||
$self->object_list_changed;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ sub add_object {
|
|||
$args{input_file},
|
||||
$args{config} // Slic3r::Config->new,
|
||||
$args{layer_height_ranges} // [],
|
||||
$args{origin_translation} // Slic3r::Point->new,
|
||||
$args{origin_translation} // Slic3r::Pointf->new,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ sub apply_config {
|
|||
# the current subdivision of regions does not make sense anymore.
|
||||
# we need to remove all objects and re-add them
|
||||
my @models_objects = map [$_->model, $_->model_object], @{$self->objects};
|
||||
$self->delete_all_objects;
|
||||
$self->clear_objects;
|
||||
$self->add_model_object(@$_) for @models_objects;
|
||||
}
|
||||
}
|
||||
|
|
@ -202,7 +202,7 @@ sub delete_object {
|
|||
$self->_state->invalidate(STEP_BRIM);
|
||||
}
|
||||
|
||||
sub delete_all_objects {
|
||||
sub clear_objects {
|
||||
my ($self) = @_;
|
||||
|
||||
@{$self->objects} = ();
|
||||
|
|
@ -222,7 +222,7 @@ sub reload_object {
|
|||
# This should also check whether object volumes (parts) have changed.
|
||||
|
||||
my @models_objects = map [$_->model, $_->model_object], @{$self->objects};
|
||||
$self->delete_all_objects;
|
||||
$self->clear_objects;
|
||||
$self->add_model_object(@$_) for @models_objects;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ sub set_model {
|
|||
my ($self, $model) = @_;
|
||||
|
||||
# make method idempotent so that the object is reusable
|
||||
$self->_print->delete_all_objects;
|
||||
$self->_print->clear_objects;
|
||||
|
||||
# make sure all objects have at least one defined instance
|
||||
my $need_arrange = $model->add_default_instances;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue