mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 15:40:37 +08:00
Made Plater::arrange a little less noisy, noted TODO for the background process pause.
Also finished implemented bed_centerf()
This commit is contained in:
parent
66bca83b57
commit
6e9cd3bfdd
@ -373,12 +373,15 @@ void Plater::refresh_canvases() {
|
||||
}
|
||||
|
||||
void Plater::arrange() {
|
||||
// pause background process
|
||||
Slic3r::Log::info(LogChannel, L"Called arrange()");
|
||||
auto bb {Slic3r::BoundingBoxf(this->config->get<ConfigOptionPoints>("bed_shape").values)};
|
||||
bool success {this->model->arrange_objects(5, &bb)};
|
||||
// TODO pause background process
|
||||
const Slic3r::BoundingBoxf bb {Slic3r::BoundingBoxf(this->config->get<ConfigOptionPoints>("bed_shape").values)};
|
||||
bool success {this->model->arrange_objects(this->config->min_object_distance(), &bb)};
|
||||
|
||||
GetFrame()->statusbar->SetStatusText(_("Objects were arranged."));
|
||||
if (success) {
|
||||
GetFrame()->statusbar->SetStatusText(_("Objects were arranged."));
|
||||
} else {
|
||||
GetFrame()->statusbar->SetStatusText(_("Arrange failed."));
|
||||
}
|
||||
this->on_model_change(true);
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
Plater(wxWindow* parent, const wxString& title, std::shared_ptr<Settings> _settings);
|
||||
void add();
|
||||
|
||||
/// Arrange models
|
||||
/// Arrange models via a simple packing mechanism based on bounding boxes.
|
||||
void arrange();
|
||||
|
||||
/// Ask if there are any unsaved changes.
|
||||
@ -90,8 +90,9 @@ private:
|
||||
int get_object_index(size_t object_id);
|
||||
|
||||
Slic3r::Pointf bed_centerf() {
|
||||
auto bed_shape { Slic3r::Polygon::new_scale(this->config->get<ConfigOptionPoints>("bed_shape").values) };
|
||||
return Slic3r::Pointf();
|
||||
const auto& bed_shape { Slic3r::Polygon::new_scale(this->config->get<ConfigOptionPoints>("bed_shape").values) };
|
||||
const auto& bed_center {BoundingBox(bed_shape).center()};
|
||||
return Slic3r::Pointf::new_unscale(bed_center);
|
||||
}
|
||||
|
||||
/// Build thumbnails for the models
|
||||
|
Loading…
x
Reference in New Issue
Block a user