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

@ -188,7 +188,7 @@ Model Model::read_from_file(const std::string& input_file, DynamicPrintConfig* c
BBLProject * project,
int plate_id,
ObjImportColorFn objFn,
std::function<int(double&, double&)> step_mesh_fn)
std::function<int(Slic3r::Step&, double&, double&)> step_mesh_fn)
{
Model model;
@ -216,15 +216,15 @@ Model Model::read_from_file(const std::string& input_file, DynamicPrintConfig* c
boost::algorithm::iends_with(input_file, ".step")) {
double linear_defletion = 0.003;
double angle_defletion = 0.5;
Step step_file(input_file);
step_file.load();
if (step_mesh_fn) {
if (step_mesh_fn(linear_defletion, angle_defletion) == -1) {
result = false;
goto end;
if (step_mesh_fn(step_file, linear_defletion, angle_defletion) == -1) {
Model empty_model;
return empty_model;
}
}
result = load_step(input_file.c_str(), &model, is_cb_cancel, linear_defletion, angle_defletion, stepFn, stepIsUtf8Fn);
end:
BOOST_LOG_TRIVIAL(info) << "Cancel step mesh dialog";
} else if (boost::algorithm::iends_with(input_file, ".stl"))
result = load_stl(input_file.c_str(), &model, nullptr, stlFn);
else if (boost::algorithm::iends_with(input_file, ".oltp"))