mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-13 03:31:52 +08:00
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sinking_objects_collision
This commit is contained in:
commit
efb08cf55a
@ -397,22 +397,6 @@ void PrintObject::generate_support_material()
|
|||||||
if (layer->empty())
|
if (layer->empty())
|
||||||
throw Slic3r::SlicingError("Levitating objects cannot be printed without supports.");
|
throw Slic3r::SlicingError("Levitating objects cannot be printed without supports.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Do we have custom support data that would not be used?
|
|
||||||
// Notify the user in that case.
|
|
||||||
if (! this->has_support()) {
|
|
||||||
for (const ModelVolume* mv : this->model_object()->volumes) {
|
|
||||||
bool has_enforcers = mv->is_support_enforcer() ||
|
|
||||||
(mv->is_model_part() && mv->supported_facets.has_facets(*mv, EnforcerBlockerType::ENFORCER));
|
|
||||||
if (has_enforcers) {
|
|
||||||
this->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL,
|
|
||||||
L("An object has custom support enforcers which will not be used "
|
|
||||||
"because supports are off. Consider turning them on.") + "\n" +
|
|
||||||
(L("Object name")) + ": " + this->model_object()->name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this->set_done(posSupportMaterial);
|
this->set_done(posSupportMaterial);
|
||||||
}
|
}
|
||||||
|
@ -43,10 +43,10 @@ const NotificationManager::NotificationData NotificationManager::basic_notificat
|
|||||||
},
|
},
|
||||||
{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotificationLevel, 20, _u8L("New version is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr) {
|
{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotificationLevel, 20, _u8L("New version is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr) {
|
||||||
wxGetApp().open_browser_with_warning_dialog("https://github.com/prusa3d/PrusaSlicer/releases"); return true; }},
|
wxGetApp().open_browser_with_warning_dialog("https://github.com/prusa3d/PrusaSlicer/releases"); return true; }},
|
||||||
{NotificationType::EmptyColorChangeCode, NotificationLevel::RegularNotificationLevel, 10,
|
{NotificationType::EmptyColorChangeCode, NotificationLevel::ObjectInfoNotificationLevel, 10,
|
||||||
_u8L("You have just added a G-code for color change, but its value is empty.\n"
|
_u8L("You have just added a G-code for color change, but its value is empty.\n"
|
||||||
"To export the G-code correctly, check the \"Color Change G-code\" in \"Printer Settings > Custom G-code\"") },
|
"To export the G-code correctly, check the \"Color Change G-code\" in \"Printer Settings > Custom G-code\"") },
|
||||||
{NotificationType::EmptyAutoColorChange, NotificationLevel::RegularNotificationLevel, 10,
|
{NotificationType::EmptyAutoColorChange, NotificationLevel::ObjectInfoNotificationLevel, 10,
|
||||||
_u8L("No color change event was added to the print. The print does not look like a sign.") },
|
_u8L("No color change event was added to the print. The print does not look like a sign.") },
|
||||||
{NotificationType::DesktopIntegrationSuccess, NotificationLevel::RegularNotificationLevel, 10,
|
{NotificationType::DesktopIntegrationSuccess, NotificationLevel::RegularNotificationLevel, 10,
|
||||||
_u8L("Desktop integration was successful.") },
|
_u8L("Desktop integration was successful.") },
|
||||||
@ -373,7 +373,7 @@ void NotificationManager::PopNotification::init()
|
|||||||
void NotificationManager::PopNotification::set_next_window_size(ImGuiWrapper& imgui)
|
void NotificationManager::PopNotification::set_next_window_size(ImGuiWrapper& imgui)
|
||||||
{
|
{
|
||||||
m_window_height = m_multiline ?
|
m_window_height = m_multiline ?
|
||||||
m_lines_count * m_line_height :
|
std::max(m_lines_count, (size_t)2) * m_line_height :
|
||||||
2 * m_line_height;
|
2 * m_line_height;
|
||||||
m_window_height += 1 * m_line_height; // top and bottom
|
m_window_height += 1 * m_line_height; // top and bottom
|
||||||
}
|
}
|
||||||
@ -1055,6 +1055,8 @@ void NotificationManager::UpdatedItemsInfoNotification::add_type(InfoItemType ty
|
|||||||
|
|
||||||
std::string text;
|
std::string text;
|
||||||
for (it = m_types_and_counts.begin(); it != m_types_and_counts.end(); ++it) {
|
for (it = m_types_and_counts.begin(); it != m_types_and_counts.end(); ++it) {
|
||||||
|
if ((*it).second == 0)
|
||||||
|
continue;
|
||||||
text += std::to_string((*it).second);
|
text += std::to_string((*it).second);
|
||||||
text += _L_PLURAL(" Object was loaded with "," Objects were loaded with ", (*it).second).ToUTF8().data();
|
text += _L_PLURAL(" Object was loaded with "," Objects were loaded with ", (*it).second).ToUTF8().data();
|
||||||
switch ((*it).first) {
|
switch ((*it).first) {
|
||||||
@ -1066,6 +1068,7 @@ void NotificationManager::UpdatedItemsInfoNotification::add_type(InfoItemType ty
|
|||||||
default: BOOST_LOG_TRIVIAL(error) << "Unknown InfoItemType: " << (*it).second; break;
|
default: BOOST_LOG_TRIVIAL(error) << "Unknown InfoItemType: " << (*it).second; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_state = EState::Unknown;
|
||||||
NotificationData data { get_data().type, get_data().level , get_data().duration, text };
|
NotificationData data { get_data().type, get_data().level , get_data().duration, text };
|
||||||
update(data);
|
update(data);
|
||||||
}
|
}
|
||||||
@ -1489,17 +1492,7 @@ void NotificationManager::push_notification(NotificationType type,
|
|||||||
std::function<bool(wxEvtHandler*)> callback,
|
std::function<bool(wxEvtHandler*)> callback,
|
||||||
int timestamp)
|
int timestamp)
|
||||||
{
|
{
|
||||||
int duration = 0;
|
int duration = get_standart_duration(level);
|
||||||
switch (level) {
|
|
||||||
case NotificationLevel::RegularNotificationLevel: duration = 10; break;
|
|
||||||
case NotificationLevel::ErrorNotificationLevel: break;
|
|
||||||
case NotificationLevel::WarningNotificationLevel: break;
|
|
||||||
case NotificationLevel::ImportantNotificationLevel: break;
|
|
||||||
case NotificationLevel::ProgressBarNotificationLevel: break;
|
|
||||||
default:
|
|
||||||
assert(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
push_notification_data({ type, level, duration, text, hypertext, callback }, timestamp);
|
push_notification_data({ type, level, duration, text, hypertext, callback }, timestamp);
|
||||||
}
|
}
|
||||||
void NotificationManager::push_validate_error_notification(const std::string& text)
|
void NotificationManager::push_validate_error_notification(const std::string& text)
|
||||||
@ -1518,7 +1511,7 @@ void NotificationManager::push_slicing_warning_notification(const std::string& t
|
|||||||
{
|
{
|
||||||
NotificationData data { NotificationType::SlicingWarning, NotificationLevel::WarningNotificationLevel, 0, _u8L("WARNING:") + "\n" + text };
|
NotificationData data { NotificationType::SlicingWarning, NotificationLevel::WarningNotificationLevel, 0, _u8L("WARNING:") + "\n" + text };
|
||||||
|
|
||||||
auto notification = std::make_unique<NotificationManager::SlicingWarningNotification>(data, m_id_provider, m_evt_handler);
|
auto notification = std::make_unique<NotificationManager::ObjectIDNotification>(data, m_id_provider, m_evt_handler);
|
||||||
notification->object_id = oid;
|
notification->object_id = oid;
|
||||||
notification->warning_step = warning_step;
|
notification->warning_step = warning_step;
|
||||||
if (push_notification_data(std::move(notification), 0)) {
|
if (push_notification_data(std::move(notification), 0)) {
|
||||||
@ -1609,12 +1602,11 @@ void NotificationManager::close_slicing_error_notification(const std::string& te
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void NotificationManager::push_object_warning_notification(const std::string& text, ObjectID object_id, const std::string& hypertext/* = ""*/, std::function<bool(wxEvtHandler*)> callback/* = std::function<bool(wxEvtHandler*)>()*/)
|
void NotificationManager::push_simplify_suggestion_notification(const std::string& text, ObjectID object_id, const std::string& hypertext/* = ""*/, std::function<bool(wxEvtHandler*)> callback/* = std::function<bool(wxEvtHandler*)>()*/)
|
||||||
{
|
{
|
||||||
NotificationData data{ NotificationType::ObjectWarning, NotificationLevel::WarningNotificationLevel, 0, text, hypertext, callback };
|
NotificationData data{ NotificationType::SimplifySuggestion, NotificationLevel::ObjectInfoNotificationLevel, 10, text, hypertext, callback };
|
||||||
auto notification = std::make_unique<NotificationManager::SlicingWarningNotification>(data, m_id_provider, m_evt_handler);
|
auto notification = std::make_unique<NotificationManager::ObjectIDNotification>(data, m_id_provider, m_evt_handler);
|
||||||
notification->object_id = object_id;
|
notification->object_id = object_id;
|
||||||
notification->warning_step = 0;
|
|
||||||
push_notification_data(std::move(notification), 0);
|
push_notification_data(std::move(notification), 0);
|
||||||
}
|
}
|
||||||
void NotificationManager::close_notification_of_type(const NotificationType type)
|
void NotificationManager::close_notification_of_type(const NotificationType type)
|
||||||
@ -1630,19 +1622,20 @@ void NotificationManager::remove_slicing_warnings_of_released_objects(const std:
|
|||||||
for (std::unique_ptr<PopNotification> ¬ification : m_pop_notifications)
|
for (std::unique_ptr<PopNotification> ¬ification : m_pop_notifications)
|
||||||
if (notification->get_type() == NotificationType::SlicingWarning) {
|
if (notification->get_type() == NotificationType::SlicingWarning) {
|
||||||
if (! std::binary_search(living_oids.begin(), living_oids.end(),
|
if (! std::binary_search(living_oids.begin(), living_oids.end(),
|
||||||
static_cast<SlicingWarningNotification*>(notification.get())->object_id))
|
static_cast<ObjectIDNotification*>(notification.get())->object_id))
|
||||||
notification->close();
|
notification->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void NotificationManager::remove_object_warnings_of_released_objects(const std::vector<ObjectID>& living_oids)
|
void NotificationManager::remove_simplify_suggestion_of_released_objects(const std::vector<ObjectID>& living_oids)
|
||||||
{
|
{
|
||||||
for (std::unique_ptr<PopNotification>& notification : m_pop_notifications)
|
for (std::unique_ptr<PopNotification>& notification : m_pop_notifications)
|
||||||
if (notification->get_type() == NotificationType::ObjectWarning) {
|
if (notification->get_type() == NotificationType::SimplifySuggestion) {
|
||||||
if (!std::binary_search(living_oids.begin(), living_oids.end(),
|
if (!std::binary_search(living_oids.begin(), living_oids.end(),
|
||||||
static_cast<SlicingWarningNotification*>(notification.get())->object_id))
|
static_cast<ObjectIDNotification*>(notification.get())->object_id))
|
||||||
notification->close();
|
notification->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotificationManager::push_exporting_finished_notification(const std::string& path, const std::string& dir_path, bool on_removable)
|
void NotificationManager::push_exporting_finished_notification(const std::string& path, const std::string& dir_path, bool on_removable)
|
||||||
{
|
{
|
||||||
close_notification_of_type(NotificationType::ExportFinished);
|
close_notification_of_type(NotificationType::ExportFinished);
|
||||||
@ -1921,7 +1914,7 @@ void NotificationManager::push_updated_item_info_notification(InfoItemType type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationData data{ NotificationType::UpdatedItemsInfo, NotificationLevel::RegularNotificationLevel, 5, "" };
|
NotificationData data{ NotificationType::UpdatedItemsInfo, NotificationLevel::ObjectInfoNotificationLevel, 10, "" };
|
||||||
auto notification = std::make_unique<NotificationManager::UpdatedItemsInfoNotification>(data, m_id_provider, m_evt_handler, type);
|
auto notification = std::make_unique<NotificationManager::UpdatedItemsInfoNotification>(data, m_id_provider, m_evt_handler, type);
|
||||||
if (push_notification_data(std::move(notification), 0)) {
|
if (push_notification_data(std::move(notification), 0)) {
|
||||||
(dynamic_cast<UpdatedItemsInfoNotification*>(m_pop_notifications.back().get()))->add_type(type);
|
(dynamic_cast<UpdatedItemsInfoNotification*>(m_pop_notifications.back().get()))->add_type(type);
|
||||||
@ -2084,8 +2077,8 @@ bool NotificationManager::activate_existing(const NotificationManager::PopNotifi
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (new_type == NotificationType::SlicingWarning) {
|
} else if (new_type == NotificationType::SlicingWarning) {
|
||||||
auto w1 = dynamic_cast<const SlicingWarningNotification*>(notification);
|
auto w1 = dynamic_cast<const ObjectIDNotification*>(notification);
|
||||||
auto w2 = dynamic_cast<const SlicingWarningNotification*>(it->get());
|
auto w2 = dynamic_cast<const ObjectIDNotification*>(it->get());
|
||||||
if (w1 != nullptr && w2 != nullptr) {
|
if (w1 != nullptr && w2 != nullptr) {
|
||||||
if (!(*it)->compare_text(new_text) || w1->object_id != w2->object_id) {
|
if (!(*it)->compare_text(new_text) || w1->object_id != w2->object_id) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -71,9 +71,6 @@ enum class NotificationType
|
|||||||
PlaterError,
|
PlaterError,
|
||||||
// Object fully outside the print volume, or extrusion outside the print volume. Slicing is not disabled.
|
// Object fully outside the print volume, or extrusion outside the print volume. Slicing is not disabled.
|
||||||
PlaterWarning,
|
PlaterWarning,
|
||||||
// Warning connected to single object id, appears at loading object, disapears at deletition.
|
|
||||||
// Example: advice to simplify object with big amount of triangles.
|
|
||||||
ObjectWarning,
|
|
||||||
// Progress bar instead of text.
|
// Progress bar instead of text.
|
||||||
ProgressBar,
|
ProgressBar,
|
||||||
// Progress bar with info from Print Host Upload Queue dialog.
|
// Progress bar with info from Print Host Upload Queue dialog.
|
||||||
@ -105,7 +102,10 @@ enum class NotificationType
|
|||||||
// Might contain logo taken from gizmos
|
// Might contain logo taken from gizmos
|
||||||
UpdatedItemsInfo,
|
UpdatedItemsInfo,
|
||||||
// Progress bar notification with methods to replace ProgressIndicator class.
|
// Progress bar notification with methods to replace ProgressIndicator class.
|
||||||
ProgressIndicator
|
ProgressIndicator,
|
||||||
|
// Give user advice to simplify object with big amount of triangles
|
||||||
|
// Contains ObjectID for closing when object is deleted
|
||||||
|
SimplifySuggestion
|
||||||
};
|
};
|
||||||
|
|
||||||
class NotificationManager
|
class NotificationManager
|
||||||
@ -121,6 +121,8 @@ public:
|
|||||||
HintNotificationLevel,
|
HintNotificationLevel,
|
||||||
// "Good to know" notification, usually but not always with a quick fade-out.
|
// "Good to know" notification, usually but not always with a quick fade-out.
|
||||||
RegularNotificationLevel,
|
RegularNotificationLevel,
|
||||||
|
// Regular level notifiaction containing info about objects or print. Has Icon.
|
||||||
|
ObjectInfoNotificationLevel,
|
||||||
// Information notification without a fade-out or with a longer fade-out.
|
// Information notification without a fade-out or with a longer fade-out.
|
||||||
ImportantNotificationLevel,
|
ImportantNotificationLevel,
|
||||||
// Warning, no fade-out.
|
// Warning, no fade-out.
|
||||||
@ -167,11 +169,11 @@ public:
|
|||||||
void close_plater_error_notification(const std::string& text);
|
void close_plater_error_notification(const std::string& text);
|
||||||
void close_plater_warning_notification(const std::string& text);
|
void close_plater_warning_notification(const std::string& text);
|
||||||
// Object warning with ObjectID, closes when object is deleted. ID used is of object not print like in slicing warning.
|
// Object warning with ObjectID, closes when object is deleted. ID used is of object not print like in slicing warning.
|
||||||
void push_object_warning_notification(const std::string& text, ObjectID object_id, const std::string& hypertext = "",
|
void push_simplify_suggestion_notification(const std::string& text, ObjectID object_id, const std::string& hypertext = "",
|
||||||
std::function<bool(wxEvtHandler*)> callback = std::function<bool(wxEvtHandler*)>());
|
std::function<bool(wxEvtHandler*)> callback = std::function<bool(wxEvtHandler*)>());
|
||||||
// Close object warnings, whose ObjectID is not in the list.
|
// Close object warnings, whose ObjectID is not in the list.
|
||||||
// living_oids is expected to be sorted.
|
// living_oids is expected to be sorted.
|
||||||
void remove_object_warnings_of_released_objects(const std::vector<ObjectID>& living_oids);
|
void remove_simplify_suggestion_of_released_objects(const std::vector<ObjectID>& living_oids);
|
||||||
// Called when the side bar changes its visibility, as the "slicing complete" notification supplements
|
// Called when the side bar changes its visibility, as the "slicing complete" notification supplements
|
||||||
// the "slicing info" normally shown at the side bar.
|
// the "slicing info" normally shown at the side bar.
|
||||||
void set_sidebar_collapsed(bool collapsed);
|
void set_sidebar_collapsed(bool collapsed);
|
||||||
@ -212,6 +214,7 @@ public:
|
|||||||
bool is_hint_notification_open();
|
bool is_hint_notification_open();
|
||||||
// Forces Hints to reload its content when next hint should be showed
|
// Forces Hints to reload its content when next hint should be showed
|
||||||
void deactivate_loaded_hints();
|
void deactivate_loaded_hints();
|
||||||
|
// Adds counter to existing UpdatedItemsInfo notification or opens new one
|
||||||
void push_updated_item_info_notification(InfoItemType type);
|
void push_updated_item_info_notification(InfoItemType type);
|
||||||
// Close old notification ExportFinished.
|
// Close old notification ExportFinished.
|
||||||
void new_export_began(bool on_removable);
|
void new_export_began(bool on_removable);
|
||||||
@ -394,12 +397,14 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SlicingWarningNotification : public PopNotification
|
class ObjectIDNotification : public PopNotification
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SlicingWarningNotification(const NotificationData& n, NotificationIDProvider& id_provider, wxEvtHandler* evt_handler) : PopNotification(n, id_provider, evt_handler) {}
|
ObjectIDNotification(const NotificationData& n, NotificationIDProvider& id_provider, wxEvtHandler* evt_handler)
|
||||||
|
: PopNotification(n, id_provider, evt_handler)
|
||||||
|
{}
|
||||||
ObjectID object_id;
|
ObjectID object_id;
|
||||||
int warning_step;
|
int warning_step { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
class PlaterWarningNotification : public PopNotification
|
class PlaterWarningNotification : public PopNotification
|
||||||
@ -649,6 +654,11 @@ private:
|
|||||||
}
|
}
|
||||||
void count_spaces() override;
|
void count_spaces() override;
|
||||||
void add_type(InfoItemType type);
|
void add_type(InfoItemType type);
|
||||||
|
void close() override{
|
||||||
|
for (auto& tac : m_types_and_counts)
|
||||||
|
tac.second = 0;
|
||||||
|
PopNotification::close();
|
||||||
|
}
|
||||||
protected:
|
protected:
|
||||||
void render_left_sign(ImGuiWrapper& imgui) override;
|
void render_left_sign(ImGuiWrapper& imgui) override;
|
||||||
std::vector<std::pair<InfoItemType, size_t>> m_types_and_counts;
|
std::vector<std::pair<InfoItemType, size_t>> m_types_and_counts;
|
||||||
@ -691,7 +701,20 @@ private:
|
|||||||
void sort_notifications();
|
void sort_notifications();
|
||||||
// If there is some error notification active, then the "Export G-code" notification after the slicing is finished is suppressed.
|
// If there is some error notification active, then the "Export G-code" notification after the slicing is finished is suppressed.
|
||||||
bool has_slicing_error_notification();
|
bool has_slicing_error_notification();
|
||||||
|
size_t get_standart_duration(NotificationLevel level)
|
||||||
|
{
|
||||||
|
switch (level) {
|
||||||
|
case NotificationLevel::RegularNotificationLevel: return 20;
|
||||||
|
case NotificationLevel::ErrorNotificationLevel: return 0;
|
||||||
|
case NotificationLevel::WarningNotificationLevel: return 0;
|
||||||
|
case NotificationLevel::ImportantNotificationLevel: return 0;
|
||||||
|
case NotificationLevel::ProgressBarNotificationLevel: return 2;
|
||||||
|
case NotificationLevel::HintNotificationLevel: return 300;
|
||||||
|
case NotificationLevel::ObjectInfoNotificationLevel: return 20;
|
||||||
|
default: return 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// set by init(), until false notifications are only added not updated and frame is not requested after push
|
// set by init(), until false notifications are only added not updated and frame is not requested after push
|
||||||
bool m_initialized{ false };
|
bool m_initialized{ false };
|
||||||
// Target for wxWidgets events sent by clicking on the hyperlink available at some notifications.
|
// Target for wxWidgets events sent by clicking on the hyperlink available at some notifications.
|
||||||
@ -715,7 +738,7 @@ private:
|
|||||||
NotificationType::PlaterWarning,
|
NotificationType::PlaterWarning,
|
||||||
NotificationType::ProgressBar,
|
NotificationType::ProgressBar,
|
||||||
NotificationType::PrintHostUpload,
|
NotificationType::PrintHostUpload,
|
||||||
NotificationType::ObjectWarning
|
NotificationType::SimplifySuggestion
|
||||||
};
|
};
|
||||||
//prepared (basic) notifications
|
//prepared (basic) notifications
|
||||||
static const NotificationData basic_notifications[];
|
static const NotificationData basic_notifications[];
|
||||||
|
@ -2600,6 +2600,7 @@ std::vector<size_t> Plater::priv::load_model_objects(const ModelObjectPtrs& mode
|
|||||||
// so 3D-scene should be updated before object additing to the ObjectList
|
// so 3D-scene should be updated before object additing to the ObjectList
|
||||||
this->view3D->reload_scene(false, (unsigned int)UpdateParams::FORCE_FULL_SCREEN_REFRESH);
|
this->view3D->reload_scene(false, (unsigned int)UpdateParams::FORCE_FULL_SCREEN_REFRESH);
|
||||||
|
|
||||||
|
notification_manager->close_notification_of_type(NotificationType::UpdatedItemsInfo);
|
||||||
for (const size_t idx : obj_idxs) {
|
for (const size_t idx : obj_idxs) {
|
||||||
wxGetApp().obj_list()->add_object_to_list(idx);
|
wxGetApp().obj_list()->add_object_to_list(idx);
|
||||||
}
|
}
|
||||||
@ -3718,8 +3719,8 @@ void Plater::priv::create_simplify_notification(const std::vector<size_t>& obj_i
|
|||||||
"amount of triangles.");
|
"amount of triangles.");
|
||||||
t.replace(t.find("@object_name"), sizeof("@object_name") - 1,
|
t.replace(t.find("@object_name"), sizeof("@object_name") - 1,
|
||||||
model.objects[object_id]->name);
|
model.objects[object_id]->name);
|
||||||
std::stringstream text;
|
//std::stringstream text;
|
||||||
text << _u8L("WARNING:") << "\n" << t << "\n";
|
//text << t << "\n";
|
||||||
std::string hypertext = _u8L("Simplify model");
|
std::string hypertext = _u8L("Simplify model");
|
||||||
|
|
||||||
std::function<bool(wxEvtHandler *)> open_simplify = [object_id](wxEvtHandler *) {
|
std::function<bool(wxEvtHandler *)> open_simplify = [object_id](wxEvtHandler *) {
|
||||||
@ -3734,7 +3735,10 @@ void Plater::priv::create_simplify_notification(const std::vector<size_t>& obj_i
|
|||||||
manager.open_gizmo(GLGizmosManager::EType::Simplify);
|
manager.open_gizmo(GLGizmosManager::EType::Simplify);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
notification_manager->push_object_warning_notification(text.str(), model.objects[object_id]->id(), hypertext, open_simplify);
|
notification_manager->push_simplify_suggestion_notification(t,
|
||||||
|
model.objects[object_id]->id(),
|
||||||
|
hypertext,
|
||||||
|
open_simplify);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4007,7 +4011,7 @@ void Plater::priv::actualize_object_warnings(const PrintBase& print)
|
|||||||
ids.push_back(object->id());
|
ids.push_back(object->id());
|
||||||
}
|
}
|
||||||
std::sort(ids.begin(), ids.end());
|
std::sort(ids.begin(), ids.end());
|
||||||
notification_manager->remove_object_warnings_of_released_objects(ids);
|
notification_manager->remove_simplify_suggestion_of_released_objects(ids);
|
||||||
}
|
}
|
||||||
void Plater::priv::clear_warnings()
|
void Plater::priv::clear_warnings()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user