2024-09-09 03:52:59 +00:00
|
|
|
#ifndef _STEP_MESH_DIALOG_H_
|
|
|
|
#define _STEP_MESH_DIALOG_H_
|
|
|
|
|
2024-10-16 15:25:09 +00:00
|
|
|
#include <future>
|
2024-09-20 10:12:48 +00:00
|
|
|
#include <thread>
|
2024-11-08 13:06:57 +00:00
|
|
|
#include "GUI_App.hpp"
|
2024-09-09 03:52:59 +00:00
|
|
|
#include "GUI_Utils.hpp"
|
2024-09-20 10:12:48 +00:00
|
|
|
#include "libslic3r/Format/STEP.hpp"
|
|
|
|
#include "Widgets/Button.hpp"
|
2024-09-09 03:52:59 +00:00
|
|
|
class Button;
|
2024-09-20 10:12:48 +00:00
|
|
|
|
2024-09-09 03:52:59 +00:00
|
|
|
class StepMeshDialog : public Slic3r::GUI::DPIDialog
|
|
|
|
{
|
|
|
|
public:
|
2024-09-20 10:12:48 +00:00
|
|
|
StepMeshDialog(wxWindow* parent, Slic3r::Step& file);
|
2024-09-09 03:52:59 +00:00
|
|
|
void on_dpi_changed(const wxRect& suggested_rect) override;
|
2024-11-08 13:06:57 +00:00
|
|
|
inline double get_linear_init() {
|
|
|
|
return std::stod(Slic3r::GUI::wxGetApp().app_config->get("linear_defletion"));
|
|
|
|
}
|
|
|
|
inline double get_angle_init() {
|
|
|
|
return std::stod(Slic3r::GUI::wxGetApp().app_config->get("angle_defletion"));
|
|
|
|
}
|
2024-09-09 03:52:59 +00:00
|
|
|
inline double get_linear_defletion() {
|
|
|
|
double value;
|
|
|
|
if (m_linear_last.ToDouble(&value)) {
|
|
|
|
return value;
|
|
|
|
}else {
|
2024-11-08 13:06:57 +00:00
|
|
|
return get_linear_init();
|
2024-09-09 03:52:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
inline double get_angle_defletion() {
|
|
|
|
double value;
|
|
|
|
if (m_angle_last.ToDouble(&value)) {
|
|
|
|
return value;
|
|
|
|
} else {
|
2024-11-08 13:06:57 +00:00
|
|
|
return get_angle_init();
|
2024-09-09 03:52:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
private:
|
2024-09-20 10:12:48 +00:00
|
|
|
Slic3r::Step& m_file;
|
2024-09-09 03:52:59 +00:00
|
|
|
Button* m_button_ok = nullptr;
|
|
|
|
Button* m_button_cancel = nullptr;
|
2024-11-08 13:06:57 +00:00
|
|
|
wxCheckBox* m_checkbox = nullptr;
|
|
|
|
wxString m_linear_last = wxString::Format("%.3f", get_linear_init());
|
|
|
|
wxString m_angle_last = wxString::Format("%.2f", get_angle_init());
|
2024-09-09 03:52:59 +00:00
|
|
|
wxStaticText* mesh_face_number_text;
|
2024-09-20 10:12:48 +00:00
|
|
|
double m_last_linear;
|
|
|
|
double m_last_angle;
|
|
|
|
std::future<unsigned int> task;
|
2024-09-09 03:52:59 +00:00
|
|
|
bool validate_number_range(const wxString& value, double min, double max);
|
|
|
|
void update_mesh_number_text();
|
2024-09-20 10:12:48 +00:00
|
|
|
void on_task_done(wxCommandEvent& event);
|
|
|
|
void stop_task();
|
2024-09-09 03:52:59 +00:00
|
|
|
};
|
|
|
|
|
2024-10-16 15:25:09 +00:00
|
|
|
#endif // _STEP_MESH_DIALOG_H_
|