refine the plate's sliced_result logic

1. when the plate is locked, the sliced result is kept after auto-arrange;
2. when only arrange a plate, other plates' results are not affected

Change-Id: I7566e11e9eec0c2b196a2e78d9dc306ea325e9ff
This commit is contained in:
lane.wei 2022-09-22 21:43:04 +08:00 committed by Lane.Wei
parent 8386b48554
commit 516a960f71
3 changed files with 32 additions and 17 deletions

View file

@ -412,7 +412,7 @@ void ArrangeJob::prepare()
//add the virtual object into unselect list if has
m_plater->get_partplate_list().preprocess_exclude_areas(m_unselected, MAX_NUM_PLATES);
#if SAVE_ARRANGE_POLY
if (1)
{ // subtract excluded region and get a polygon bed
@ -625,8 +625,11 @@ void ArrangeJob::finalize() {
//BBS: partplate
PartPlateList& plate_list = m_plater->get_partplate_list();
//clear all the relations before apply the arrangement results
plate_list.clear();
if (only_on_partplate) {
plate_list.clear(false, false, true, current_plate_index);
}
else
plate_list.clear(false, false, true, -1);
//BBS: adjust the bed_index, create new plates, get the max bed_index
for (ArrangePolygon& ap : m_selected) {
//if (ap.bed_idx < 0) continue; // bed_idx<0 means unarrangable
@ -709,7 +712,12 @@ void ArrangeJob::finalize() {
m_plater->get_notification_manager()->close_notification_of_type(NotificationType::ArrangeOngoing);
//BBS: reload all objects due to arrange
plate_list.rebuild_plates_after_arrangement(!only_on_partplate);
if (only_on_partplate) {
plate_list.rebuild_plates_after_arrangement(!only_on_partplate, true, current_plate_index);
}
else {
plate_list.rebuild_plates_after_arrangement(!only_on_partplate, true);
}
// BBS: update slice context and gcode result.
m_plater->update_slicing_context_to_current_partplate();