mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-10-05 23:36:32 +08:00
more work on arrange()
This commit is contained in:
parent
eadac30476
commit
b16e2570f3
@ -374,14 +374,18 @@ void Plater::refresh_canvases() {
|
|||||||
|
|
||||||
void Plater::arrange() {
|
void Plater::arrange() {
|
||||||
// pause background process
|
// pause background process
|
||||||
|
Slic3r::Log::info(LogChannel, L"Called arrange()");
|
||||||
auto bb {Slic3r::BoundingBoxf(this->config->get<ConfigOptionPoints>("bed_shape").values)};
|
auto bb {Slic3r::BoundingBoxf(this->config->get<ConfigOptionPoints>("bed_shape").values)};
|
||||||
bool success {this->model->arrange_objects(this->config->min_object_distance(), &bb)};
|
bool success {this->model->arrange_objects(5, &bb)};
|
||||||
|
|
||||||
GetFrame()->statusbar->SetStatusText(_("Objects were arranged."));
|
GetFrame()->statusbar->SetStatusText(_("Objects were arranged."));
|
||||||
this->on_model_change(true);
|
this->on_model_change(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plater::on_model_change(bool force_autocenter) {
|
void Plater::on_model_change(bool force_autocenter) {
|
||||||
|
if (force_autocenter || settings->autocenter) {
|
||||||
|
this->model->center_instances_around_point(this->bed_centerf());
|
||||||
|
}
|
||||||
this->refresh_canvases();
|
this->refresh_canvases();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,9 @@ public:
|
|||||||
Plater(wxWindow* parent, const wxString& title, std::shared_ptr<Settings> _settings);
|
Plater(wxWindow* parent, const wxString& title, std::shared_ptr<Settings> _settings);
|
||||||
void add();
|
void add();
|
||||||
|
|
||||||
|
/// Arrange models
|
||||||
|
void arrange();
|
||||||
|
|
||||||
/// Ask if there are any unsaved changes.
|
/// Ask if there are any unsaved changes.
|
||||||
bool prompt_unsaved_changes() { return true; }
|
bool prompt_unsaved_changes() { return true; }
|
||||||
private:
|
private:
|
||||||
@ -96,8 +99,6 @@ private:
|
|||||||
void on_thumbnail_made(size_t idx);
|
void on_thumbnail_made(size_t idx);
|
||||||
void refresh_canvases();
|
void refresh_canvases();
|
||||||
|
|
||||||
/// Arrange models
|
|
||||||
void arrange();
|
|
||||||
|
|
||||||
/// Run everything that needs to happen when models change.
|
/// Run everything that needs to happen when models change.
|
||||||
/// Includes updating canvases, reloading menus, etc.
|
/// Includes updating canvases, reloading menus, etc.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user