Fixed conflicts after merge with master

This commit is contained in:
enricoturri1966 2021-10-14 10:57:08 +02:00
commit fe1c5f34a0
39 changed files with 650 additions and 255 deletions
src/slic3r/GUI

View file

@ -13,6 +13,7 @@
#include "DoubleSlider.hpp"
#include "Plater.hpp"
#include "MainFrame.hpp"
#include "format.hpp"
#include <wx/listbook.h>
#include <wx/notebook.h>
@ -708,7 +709,6 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
if (m_layers_slider->IsNewPrint())
{
const Print& print = wxGetApp().plater()->fff_print();
double delta_area = scale_(scale_(25)); // equal to 25 mm2
//bool is_possible_auto_color_change = false;
for (auto object : print.objects()) {
@ -729,7 +729,7 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
int i, min_solid_height = int(0.25 * num_layers);
for (i = 1; i <= min_solid_height; ++ i) {
double cur_area = area(object->get_layer(i)->lslices);
if (cur_area != bottom_area && fabs(cur_area - bottom_area) > scale_(scale_(1))) {
if (!DoubleSlider::equivalent_areas(bottom_area, cur_area)) {
// but due to the elephant foot compensation, the first layer may be slightly smaller than the others
if (i == 1 && fabs(cur_area - bottom_area) / bottom_area < 0.1) {
// So, let process this case and use second layer as a bottom
@ -742,33 +742,23 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
if (i < min_solid_height)
continue;
// bottom layer have to be a biggest, so control relation between bottom layer and object size
double prev_area = area(object->get_layer(i)->lslices);
for ( i++; i < num_layers; i++) {
double cur_area = area(object->get_layer(i)->lslices);
if (cur_area > prev_area && prev_area - cur_area > scale_(scale_(1)))
break;
prev_area = cur_area;
}
if (i < num_layers)
continue;
double top_area = area(object->get_layer(int(object->layers().size()) - 1)->lslices);
if( bottom_area - top_area > delta_area) {
NotificationManager *notif_mngr = wxGetApp().plater()->get_notification_manager();
if (DoubleSlider::check_color_change(object, i, num_layers, true, [this, object](Layer*) {
NotificationManager* notif_mngr = wxGetApp().plater()->get_notification_manager();
notif_mngr->push_notification(
NotificationType::SignDetected, NotificationManager::NotificationLevel::PrintInfoNotificationLevel,
_u8L("NOTE:") + "\n" + _u8L("Sliced object looks like the sign") + "\n",
_u8L("Apply auto color change to print"),
_u8L("NOTE:") + "\n" +
format(_u8L("Sliced object \"%1%\" looks like a logo or a sign"), object->model_object()->name) + "\n",
_u8L("Apply automatic color change"),
[this](wxEvtHandler*) {
m_layers_slider->auto_color_change();
return true;
});
notif_mngr->apply_in_preview();
return true;
}) )
// first object with color chnages is found
break;
}
}
}