mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-21 07:52:32 +00:00
Plate controls
This commit is contained in:
+20
-11
@@ -12610,17 +12610,8 @@ void Plater::priv::on_action_add(SimpleEvent&)
|
||||
//BBS: add plate from toolbar
|
||||
void Plater::priv::on_action_add_plate(SimpleEvent&)
|
||||
{
|
||||
if (q != nullptr) {
|
||||
take_snapshot("add partplate");
|
||||
this->partplate_list.create_plate();
|
||||
int new_plate = this->partplate_list.get_plate_count() - 1;
|
||||
this->partplate_list.select_plate(new_plate);
|
||||
update();
|
||||
|
||||
// BBS set default view
|
||||
//q->get_camera().select_view("topfront");
|
||||
q->get_camera().requires_zoom_to_plate = REQUIRES_ZOOM_TO_ALL_PLATE;
|
||||
}
|
||||
if (q != nullptr)
|
||||
q->add_plate();
|
||||
}
|
||||
|
||||
//BBS: remove plate from toolbar
|
||||
@@ -21492,6 +21483,24 @@ int Plater::select_plate_by_hover_id(int hover_id, bool right_click, bool isModi
|
||||
return ret;
|
||||
}
|
||||
|
||||
//BBS: add an empty plate and switch to it (mirrors the toolbar's Add Plate).
|
||||
int Plater::add_plate()
|
||||
{
|
||||
if (!p->can_add_plate())
|
||||
return -1;
|
||||
take_snapshot("add partplate");
|
||||
int new_plate = p->partplate_list.create_plate();
|
||||
if (new_plate < 0)
|
||||
return new_plate;
|
||||
p->partplate_list.select_plate(new_plate);
|
||||
update();
|
||||
|
||||
// BBS set default view
|
||||
//get_camera().select_view("topfront");
|
||||
p->camera.requires_zoom_to_plate = REQUIRES_ZOOM_TO_ALL_PLATE;
|
||||
return new_plate;
|
||||
}
|
||||
|
||||
int Plater::duplicate_plate(int plate_index)
|
||||
{
|
||||
int index = plate_index, ret;
|
||||
|
||||
Reference in New Issue
Block a user