mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-07 15:51:08 +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
93 lines
3.2 KiB
C++
93 lines
3.2 KiB
C++
#ifndef slic3r_GUI_ObjectTableSettings_hpp_
|
|
#define slic3r_GUI_ObjectTableSettings_hpp_
|
|
|
|
#include <map>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <wx/event.h>
|
|
#include <wx/panel.h>
|
|
#include <wx/sizer.h>
|
|
#include "wxExtensions.hpp"
|
|
#include "libslic3r/PrintConfig.hpp"
|
|
|
|
class wxSizer;
|
|
class wxWindow;
|
|
|
|
class wxBoxSizer;
|
|
|
|
namespace Slic3r {
|
|
class DynamicPrintConfig;
|
|
class ModelObject;
|
|
class ModelConfig;
|
|
namespace GUI {
|
|
class ConfigOptionsGroup;
|
|
class ObjectGridTable;
|
|
struct SimpleSettingData;
|
|
|
|
class OTG_Settings
|
|
{
|
|
protected:
|
|
std::shared_ptr<ConfigOptionsGroup> m_og;
|
|
wxWindow* m_parent;
|
|
public:
|
|
OTG_Settings(wxWindow* parent, const bool staticbox);
|
|
virtual ~OTG_Settings() {}
|
|
|
|
virtual bool IsShown();
|
|
virtual void Show(const bool show);
|
|
virtual void Hide();
|
|
virtual void UpdateAndShow(const bool show);
|
|
|
|
virtual wxSizer* get_sizer();
|
|
ConfigOptionsGroup* get_og() { return m_og.get(); }
|
|
wxWindow* parent() const {return m_parent; }
|
|
};
|
|
|
|
|
|
class ObjectTableSettings : public OTG_Settings
|
|
{
|
|
// sizer for extra Object/Part's settings
|
|
wxBoxSizer* m_settings_list_sizer{ nullptr };
|
|
// option groups for settings
|
|
std::vector <std::shared_ptr<ConfigOptionsGroup>> m_og_settings;
|
|
|
|
DynamicPrintConfig m_current_config;
|
|
DynamicPrintConfig m_origin_config;
|
|
ScalableBitmap m_bmp_reset;
|
|
ScalableBitmap m_bmp_reset_focus;
|
|
ScalableBitmap m_bmp_reset_disable;
|
|
|
|
ObjectGridTable* m_table{ nullptr };
|
|
int m_current_row{ 0 };
|
|
std::string m_current_category;
|
|
int m_current_different { 0 };
|
|
std::map<std::string, int> m_different_map;
|
|
|
|
public:
|
|
ObjectTableSettings(wxWindow* parent, ObjectGridTable* table);
|
|
~ObjectTableSettings()
|
|
{
|
|
m_different_map.clear();
|
|
}
|
|
|
|
bool update_settings_list(bool is_object, bool is_multiple_selection, ModelObject* object, ModelConfig* config, const std::string& category);
|
|
/* Additional check for override options: Add options, if its needed.
|
|
* Example: if Infill is set to 100%, and Fill Pattern is missed in config_to,
|
|
* we should add sparse_infill_pattern to avoid endless loop in update
|
|
*/
|
|
bool add_missed_options(ModelConfig *config_to, const DynamicPrintConfig &config_from);
|
|
//return visible count
|
|
int update_extra_column_visible_status(ConfigOptionsGroup* option_group, const std::vector<SimpleSettingData>& option_keys, ModelConfig* config);
|
|
void update_config_values(bool is_object, ModelObject* object, ModelConfig* config, const std::string& category, const std::string& changed_opt_key = "");
|
|
void UpdateAndShowRow(int row, const bool show, bool is_object, bool is_multiple_selection, ModelObject* object, ModelConfig* config, const std::string& category);
|
|
void ValueChanged(int row, bool is_object, ModelObject* object, ModelConfig* config, const std::string& category, const std::string& key);
|
|
void resetAllValues(int row, bool is_object, ModelObject* object, ModelConfig* config, const std::string& category);
|
|
void msw_rescale();
|
|
};
|
|
wxDECLARE_EVENT(EVT_LOCK_DISABLE, wxCommandEvent);
|
|
wxDECLARE_EVENT(EVT_LOCK_ENABLE, wxCommandEvent);
|
|
}}
|
|
|
|
#endif // slic3r_GUI_ObjectTableSettings_hpp_
|