mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-04 20:50:38 +08:00
Stubbed out Plater::arrange() and on_model_change()
This commit is contained in:
parent
f4a90f6742
commit
1cd7e878b0
@ -7,6 +7,7 @@
|
|||||||
#include "ProgressStatusBar.hpp"
|
#include "ProgressStatusBar.hpp"
|
||||||
#include "Log.hpp"
|
#include "Log.hpp"
|
||||||
#include "MainFrame.hpp"
|
#include "MainFrame.hpp"
|
||||||
|
#include "BoundingBox.hpp"
|
||||||
|
|
||||||
namespace Slic3r { namespace GUI {
|
namespace Slic3r { namespace GUI {
|
||||||
|
|
||||||
@ -312,6 +313,7 @@ std::vector<int> Plater::load_model_objects(ModelObjectPtrs model_objects) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const auto& i : obj_idx) { this->make_thumbnail(i); }
|
for (const auto& i : obj_idx) { this->make_thumbnail(i); }
|
||||||
|
if (need_arrange) this->arrange();
|
||||||
return obj_idx;
|
return obj_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,5 +372,18 @@ void Plater::refresh_canvases() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Plater::arrange() {
|
||||||
|
// pause background process
|
||||||
|
auto 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."));
|
||||||
|
this->on_model_change(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Plater::on_model_change(bool force_autocenter) {
|
||||||
|
this->refresh_canvases();
|
||||||
|
}
|
||||||
|
|
||||||
}} // Namespace Slic3r::GUI
|
}} // Namespace Slic3r::GUI
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ private:
|
|||||||
std::shared_ptr<Slic3r::Config> config { Slic3r::Config::new_from_defaults(
|
std::shared_ptr<Slic3r::Config> config { Slic3r::Config::new_from_defaults(
|
||||||
{"bed_shape", "complete_objects", "extruder_clearance_radius", "skirts", "skirt_distance",
|
{"bed_shape", "complete_objects", "extruder_clearance_radius", "skirts", "skirt_distance",
|
||||||
"brim_width", "serial_port", "serial_speed", "host_type", "print_host", "octoprint_apikey",
|
"brim_width", "serial_port", "serial_speed", "host_type", "print_host", "octoprint_apikey",
|
||||||
"shortcuts", "filament_colour"})};
|
"shortcuts", "filament_colour", "duplicate_distance"})};
|
||||||
|
|
||||||
bool processed {false};
|
bool processed {false};
|
||||||
|
|
||||||
@ -95,6 +95,13 @@ private:
|
|||||||
/// Complete thumbnail transformation and refresh canvases
|
/// Complete thumbnail transformation and refresh canvases
|
||||||
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.
|
||||||
|
/// Includes updating canvases, reloading menus, etc.
|
||||||
|
void on_model_change(bool force_autocenter = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user