mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-10 01:01:57 +00:00
* Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced Generated with include-what-you-use and applied conservatively. Only OrcaSlicer's own headers, the ones under src/ and tests/, are removed or forward-declared; standard-library and third-party includes are left alone. An include is removed only when both the Release and the Debug configuration leave it unused, never from inside a conditional block, and never from a file with platform-specific blocks, which only gain includes. Files whose only use of a header sits behind a feature or debug macro (libvgcode's OpenGL ES and marker code, the ARACHNE/TESTS_EXPORT_SVGS debug output) keep their includes. clonable_ptr.hpp gains #pragma once; it had no include guard and was only safe while Config.hpp was its sole includer. * Remove Unused Project Includes From Files With Platform-Specific Code A Linux include-what-you-use run cannot see the code inside _WIN32, __APPLE__ or __linux__ blocks, so its verdict is only taken where nothing the removed header declares, directly or through what it includes, is named inside those blocks. Removals also have to hold in both the Release and Debug configuration and never touch a line inside a conditional block. * Restore the libslic3r Precompiled Header and Direct Includes Lost in the Platform Pass The platform-file pass treated pchheader.hpp as an ordinary header and emptied it, and left GUI_Preview.hpp and 14 other files relying on headers they no longer reached directly. * Restore MainFrame.hpp in ParamsDialog.cpp for the Windows-Only Reparent Call * Include Headers That Files Reached Through Ones the Cleanup Removed * Drop Includes Duplicated by the Cleanup or by Main's Own Additions * Leave PreciseSeam.cpp as Main Has It After the Precise Seam Rework
124 lines
5.6 KiB
C++
124 lines
5.6 KiB
C++
#ifndef slic3r_ConfigManipulation_hpp_
|
|
#define slic3r_ConfigManipulation_hpp_
|
|
|
|
/* Class for validation config options
|
|
* and update (enable/disable) IU components
|
|
*
|
|
* Used for config validation for global config (Print Settings Tab)
|
|
* and local config (overrides options on sidebar)
|
|
* */
|
|
|
|
#include <functional>
|
|
#include <string>
|
|
#include <wx/string.h>
|
|
#include <boost/any.hpp>
|
|
#include "libslic3r/Config.hpp"
|
|
#include <vector>
|
|
#include <map>
|
|
|
|
class wxWindow;
|
|
namespace Slic3r { class DynamicPrintConfig; }
|
|
namespace boost { class any; }
|
|
|
|
namespace Slic3r {
|
|
|
|
class ModelConfig;
|
|
class ObjectBase;
|
|
|
|
namespace GUI {
|
|
|
|
class ConfigManipulation
|
|
{
|
|
bool is_msg_dlg_already_exist{ false };
|
|
bool m_is_initialized_support_material_overhangs_queried{ false };
|
|
bool m_support_material_overhangs_queried{ false };
|
|
bool is_BBL_Printer{false};
|
|
|
|
// function to loading of changed configuration
|
|
std::function<void()> load_config = nullptr;
|
|
std::function<void (const std::string&, bool toggle, int opt_index)> cb_toggle_field = nullptr;
|
|
std::function<void(const std::string &, bool toggle, int opt_index)> cb_toggle_line = nullptr;
|
|
std::function<void(const std::string &, const wxString &, int opt_index)> cb_set_option_label = nullptr;
|
|
// callback to propagation of changed value, if needed
|
|
std::function<void(const std::string&, const boost::any&)> cb_value_change = nullptr;
|
|
//BBS: change local config to const DynamicPrintConfig
|
|
const DynamicPrintConfig* local_config = nullptr;
|
|
//ModelConfig* local_config = nullptr;
|
|
wxWindow* m_msg_dlg_parent {nullptr};
|
|
|
|
t_config_option_keys m_applying_keys;
|
|
|
|
public:
|
|
ConfigManipulation(std::function<void()> load_config,
|
|
std::function<void(const std::string&, bool toggle, int opt_index)> cb_toggle_field,
|
|
std::function<void(const std::string&, bool toggle, int opt_index)> cb_toggle_line,
|
|
std::function<void(const std::string&, const boost::any&)> cb_value_change,
|
|
//BBS: change local config to DynamicPrintConfig
|
|
const DynamicPrintConfig* local_config = nullptr,
|
|
wxWindow* msg_dlg_parent = nullptr,
|
|
std::function<void(const std::string &, const wxString &, int opt_index)> cb_set_option_label = nullptr) :
|
|
load_config(load_config),
|
|
cb_toggle_field(cb_toggle_field),
|
|
cb_toggle_line(cb_toggle_line),
|
|
cb_set_option_label(cb_set_option_label),
|
|
cb_value_change(cb_value_change),
|
|
m_msg_dlg_parent(msg_dlg_parent),
|
|
local_config(local_config) {}
|
|
ConfigManipulation() {}
|
|
|
|
~ConfigManipulation() {
|
|
load_config = nullptr;
|
|
cb_toggle_field = nullptr;
|
|
cb_toggle_line = nullptr;
|
|
cb_set_option_label = nullptr;
|
|
cb_value_change = nullptr;
|
|
}
|
|
|
|
bool is_applying() const;
|
|
|
|
void apply(DynamicPrintConfig* config, DynamicPrintConfig* new_config);
|
|
t_config_option_keys const &applying_keys() const;
|
|
void toggle_field(const std::string& field_key, const bool toggle, int opt_index = -1);
|
|
void toggle_line(const std::string& field_key, const bool toggle, int opt_index = -1);
|
|
void set_option_label(const std::string& field_key, const wxString& label, int opt_index = -1);
|
|
|
|
// FFF print
|
|
void update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config = false, const bool is_plate_config = false);
|
|
void toggle_print_fff_options(DynamicPrintConfig* config, int variant_index, const bool is_global_config = false);
|
|
void apply_null_fff_config(DynamicPrintConfig *config, std::vector<std::string> const &keys, std::map<ObjectBase*, ModelConfig*> const & configs);
|
|
|
|
//BBS: FFF filament nozzle temperature range
|
|
void check_nozzle_recommended_temperature_range(DynamicPrintConfig *config, unsigned int variant_index);
|
|
void check_nozzle_temperature_range(DynamicPrintConfig* config, unsigned int variant_index);
|
|
void check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config, unsigned int variant_index);
|
|
void check_adaptive_pressure_advance_model(DynamicPrintConfig* config);
|
|
void check_filament_max_volumetric_speed(DynamicPrintConfig *config);
|
|
void check_filament_ironing_spacing(DynamicPrintConfig *config);
|
|
void check_chamber_temperature(DynamicPrintConfig* config);
|
|
void check_chamber_minimal_temperature(DynamicPrintConfig* config);
|
|
bool check_layer_height(DynamicPrintConfig* config);
|
|
bool layer_height_out_of_range_dialog(DynamicPrintConfig* config, double clamp_to);
|
|
void layer_height_limits(double& min_layer_height, double& max_layer_height) const;
|
|
void set_is_BBL_Printer(bool is_bbl_printer) { is_BBL_Printer = is_bbl_printer; };
|
|
bool get_is_BBL_Printer() { return is_BBL_Printer; };
|
|
// SLA print
|
|
void update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config = false);
|
|
void toggle_print_sla_options(DynamicPrintConfig* config);
|
|
|
|
bool is_initialized_support_material_overhangs_queried() { return m_is_initialized_support_material_overhangs_queried; }
|
|
void initialize_support_material_overhangs_queried(bool queried)
|
|
{
|
|
m_is_initialized_support_material_overhangs_queried = true;
|
|
m_support_material_overhangs_queried = queried;
|
|
}
|
|
int show_spiral_mode_settings_dialog(bool is_object_config = false);
|
|
|
|
private:
|
|
bool get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high, unsigned int variant_index);
|
|
};
|
|
|
|
} // GUI
|
|
} // Slic3r
|
|
|
|
#endif /* slic3r_ConfigManipulation_hpp_ */
|