ENH: step mesh operation adjustment

1.Put commctrl.h into pch precompilation(OCCT conflicts)

2.Replace input wxWidgets to support loss focus verification(STUDIO-8101)

3.Optimize slider interaction and trigger mesh when push up slider(STUDIO-8099)

4.Optimize step loading method, separate import of step and mesh

5.Fix dialog cancel button logic;

6.mesh tasks into sub-threads to prevent blocking the UI;

JIRA: STUDIO-8101 STUDIO-8099
Change-Id: I50bbb43953a5128f358c6880032d20693531333b
(cherry picked from commit ed7ab6b505a2becf8f38edb3c43b96e51eac3317)
This commit is contained in:
Mack
2024-09-20 18:12:48 +08:00
committed by Noisyfox
parent e1477e642c
commit f91b520bb8
11 changed files with 326 additions and 94 deletions

View File

@@ -1,15 +1,16 @@
#ifndef _STEP_MESH_DIALOG_H_
#define _STEP_MESH_DIALOG_H_
#include <thread>
#include "GUI_Utils.hpp"
#include <boost/filesystem.hpp>
#include <wx/sizer.h>
#include "libslic3r/Format/STEP.hpp"
#include "Widgets/Button.hpp"
class Button;
namespace fs = boost::filesystem;
class StepMeshDialog : public Slic3r::GUI::DPIDialog
{
public:
StepMeshDialog(wxWindow* parent, fs::path file);
StepMeshDialog(wxWindow* parent, Slic3r::Step& file);
void on_dpi_changed(const wxRect& suggested_rect) override;
inline double get_linear_defletion() {
double value;
@@ -27,16 +28,20 @@ public:
return 0.5;
}
}
long get_mesh_number();
private:
fs::path m_file;
Slic3r::Step& m_file;
Button* m_button_ok = nullptr;
Button* m_button_cancel = nullptr;
wxString m_linear_last = wxString::Format("%.3f", 0.003);
wxString m_angle_last = wxString::Format("%.2f", 0.5);
wxStaticText* mesh_face_number_text;
double m_last_linear;
double m_last_angle;
std::future<unsigned int> task;
bool validate_number_range(const wxString& value, double min, double max);
void update_mesh_number_text();
void on_task_done(wxCommandEvent& event);
void stop_task();
};
#endif // _STEP_MESH_DIALOG_H_