Fixed conflicts after cherry-picking 844e99f84e

This commit is contained in:
Enrico Turri 2019-05-22 14:42:38 +02:00
parent 9f3a05eef3
commit c92940c985
6 changed files with 118 additions and 9 deletions

View file

@ -1302,7 +1302,10 @@ struct Plater::priv
void sla_optimize_rotation();
void split_object();
void split_volume();
bool background_processing_enabled() const { return this->get_config("background_processing") == "1"; }
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
void scale_selection_to_fit_print_volume();
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
bool background_processing_enabled() const { return this->get_config("background_processing") == "1"; }
void update_print_volume_state();
void schedule_background_process();
// Update background processing thread from the current config and Model.
@ -2364,6 +2367,13 @@ void Plater::priv::split_volume()
wxGetApp().obj_list()->split();
}
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
void Plater::priv::scale_selection_to_fit_print_volume()
{
this->view3D->get_canvas3d()->get_selection().scale_to_fit_print_volume(*config);
}
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
void Plater::priv::schedule_background_process()
{
delayed_error_message.clear();
@ -3026,6 +3036,11 @@ bool Plater::priv::init_common_menu(wxMenu* menu, const bool is_part/* = false*/
sidebar->obj_list()->append_menu_item_fix_through_netfabb(menu);
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
append_menu_item(menu, wxID_ANY, _(L("Scale to print volume")), _(L("Scale the selected object to fit the print volume")),
[this](wxCommandEvent&) { scale_selection_to_fit_print_volume(); }, "", menu);
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
wxMenu* mirror_menu = new wxMenu();
if (mirror_menu == nullptr)
return false;
@ -3465,6 +3480,13 @@ bool Plater::is_selection_empty() const
return p->get_selection().is_empty() || p->get_selection().is_wipe_tower();
}
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
void Plater::scale_selection_to_fit_print_volume()
{
p->scale_selection_to_fit_print_volume();
}
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
void Plater::cut(size_t obj_idx, size_t instance_idx, coordf_t z, bool keep_upper, bool keep_lower, bool rotate_lower)
{
wxCHECK_RET(obj_idx < p->model.objects.size(), "obj_idx out of bounds");