mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-01 16:38:43 +03:00
update slic3r
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "libslic3r/libslic3r.h"
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
#include "libslic3r/TextConfiguration.hpp"
|
||||
#include "libslic3r/BuildVolume.hpp" // IWYU pragma: keep
|
||||
#include "GUI_ObjectList.hpp"
|
||||
#include "GUI_Factories.hpp"
|
||||
#include "GUI_ObjectManipulation.hpp"
|
||||
@@ -29,6 +30,7 @@
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/listbook.h>
|
||||
#include <wx/numformatter.h>
|
||||
#include <wx/bookctrl.h> // IWYU pragma: keep
|
||||
|
||||
#include "slic3r/Utils/FixModelByWin10.hpp"
|
||||
|
||||
@@ -220,6 +222,15 @@ ObjectList::ObjectList(wxWindow* parent) :
|
||||
set_tooltip_for_item(this->get_mouse_position_in_control());
|
||||
event.Skip();
|
||||
});
|
||||
|
||||
GetMainWindow()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& event) {
|
||||
m_mouse_left_down = true;
|
||||
event.Skip();
|
||||
});
|
||||
GetMainWindow()->Bind(wxEVT_LEFT_UP, [this](wxMouseEvent& event) {
|
||||
m_mouse_left_down = false;
|
||||
event.Skip();
|
||||
});
|
||||
#endif //__WXMSW__
|
||||
|
||||
Bind(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, &ObjectList::OnContextMenu, this);
|
||||
@@ -1204,6 +1215,15 @@ void ObjectList::key_event(wxKeyEvent& event)
|
||||
|
||||
void ObjectList::OnBeginDrag(wxDataViewEvent &event)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
if (!m_mouse_left_down) {
|
||||
event.Veto();
|
||||
return;
|
||||
}
|
||||
// Invalidate LeftDown flag emmidiately to avoid its unexpected using next time.
|
||||
m_mouse_left_down = false;
|
||||
#endif // __WXMSW__
|
||||
|
||||
if (m_is_editing_started)
|
||||
m_is_editing_started = false;
|
||||
#ifdef __WXGTK__
|
||||
@@ -1541,7 +1561,6 @@ void ObjectList::load_subobject(ModelVolumeType type, bool from_galery/* = false
|
||||
|
||||
void ObjectList::load_from_files(const wxArrayString& input_files, ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery)
|
||||
{
|
||||
|
||||
wxWindow* parent = wxGetApp().tab_panel()->GetPage(0);
|
||||
|
||||
wxProgressDialog dlg(_L("Loading") + dots, "", 100, wxGetApp().mainframe, wxPD_AUTO_HIDE);
|
||||
@@ -1797,21 +1816,23 @@ void ObjectList::load_mesh_object(const TriangleMesh &mesh, const std::string &n
|
||||
ModelVolume* new_volume = new_object->add_volume(mesh);
|
||||
new_object->sort_volumes(wxGetApp().app_config->get_bool("order_volumes"));
|
||||
new_volume->name = name;
|
||||
|
||||
// set a default extruder value, since user can't add it manually
|
||||
new_volume->config.set_key_value("extruder", new ConfigOptionInt(0));
|
||||
new_object->invalidate_bounding_box();
|
||||
auto bb = mesh.bounding_box();
|
||||
new_object->translate(-bb.center());
|
||||
new_object->instances[0]->set_offset(
|
||||
center ? to_3d(wxGetApp().plater()->build_volume().bounding_volume2d().center(), -new_object->origin_translation.z()) :
|
||||
bb.center());
|
||||
|
||||
auto bb = mesh.bounding_box();
|
||||
new_object->translate(-bb.center());
|
||||
new_object->instances[0]->set_offset(
|
||||
center ? to_3d(wxGetApp().plater()->build_volume().bounding_volume2d().center(), -new_object->origin_translation.z()) :
|
||||
bb.center());
|
||||
|
||||
new_object->ensure_on_bed();
|
||||
|
||||
#ifdef _DEBUG
|
||||
check_model_ids_validity(model);
|
||||
#endif /* _DEBUG */
|
||||
|
||||
|
||||
paste_objects_into_list({model.objects.size() - 1});
|
||||
|
||||
#ifdef _DEBUG
|
||||
@@ -4548,8 +4569,8 @@ void ObjectList::rename_item()
|
||||
if (new_name.IsEmpty())
|
||||
return;
|
||||
|
||||
if (Plater::has_illegal_filename_characters(new_name)) {
|
||||
Plater::show_illegal_characters_warning(this);
|
||||
if (has_illegal_characters(new_name)) {
|
||||
show_illegal_characters_warning(this);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4666,7 +4687,7 @@ void ObjectList::fix_through_winsdk()
|
||||
|
||||
// Show info notification
|
||||
wxString msg = MenuFactory::get_repaire_result_message(succes_models, failed_models);
|
||||
plater->get_notification_manager()->push_notification(NotificationType::RepairFinished, NotificationManager::NotificationLevel::PrintInfoShortNotificationLevel, boost::nowide::narrow(msg));
|
||||
plater->get_notification_manager()->push_notification(NotificationType::RepairFinished, NotificationManager::NotificationLevel::PrintInfoShortNotificationLevel, into_u8(msg));
|
||||
}
|
||||
|
||||
void ObjectList::simplify()
|
||||
@@ -4761,7 +4782,7 @@ void ObjectList::OnEditingDone(wxDataViewEvent &event)
|
||||
const auto renderer = dynamic_cast<BitmapTextRenderer*>(GetColumn(colName)->GetRenderer());
|
||||
|
||||
if (renderer->WasCanceled())
|
||||
wxTheApp->CallAfter([this]{ Plater::show_illegal_characters_warning(this); });
|
||||
wxTheApp->CallAfter([this]{ show_illegal_characters_warning(this); });
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Workaround for entering the column editing mode on Windows. Simulate keyboard enter when another column of the active line is selected.
|
||||
|
||||
Reference in New Issue
Block a user