OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::SettingsFactory Struct Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/GUI_Factories.hpp>

Collaboration diagram for Slic3r::GUI::SettingsFactory:

Public Types

typedef std::map< std::string, std::vector< std::string > > Bundle

Static Public Member Functions

static wxBitmap get_category_bitmap (const std::string &category_name, bool menu_bmp=true)
static Bundle get_bundle (const DynamicPrintConfig *config, bool is_object_settings, bool is_layer_settings=false)
static std::vector< std::string > get_options (bool is_part)
static std::vector< SimpleSettingData > get_visible_options (const std::string &category, const bool is_part)
static std::map< std::string, std::vector< SimpleSettingData > > get_all_visible_options (const bool is_part)

Static Public Attributes

static std::map< std::string, std::string > CATEGORY_ICON
static std::map< std::string, std::vector< SimpleSettingData > > OBJECT_CATEGORY_SETTINGS
static std::map< std::string, std::vector< SimpleSettingData > > PART_CATEGORY_SETTINGS

Detailed Description

Member Typedef Documentation

◆ Bundle

typedef std::map<std::string, std::vector<std::string> > Slic3r::GUI::SettingsFactory::Bundle

Member Function Documentation

◆ get_all_visible_options()

std::map< std::string, std::vector< SimpleSettingData > > Slic3r::GUI::SettingsFactory::get_all_visible_options ( const bool is_part)
static
269{
270 std::map<std::string, std::vector<SimpleSettingData>> option_maps;
271 std::map<std::string, std::vector<SimpleSettingData>>::iterator it1, it2;
272
273 option_maps = PART_CATEGORY_SETTINGS;
274 if (!is_part) {
275 for (it1 = OBJECT_CATEGORY_SETTINGS.begin(); it1 != OBJECT_CATEGORY_SETTINGS.end(); it1++)
276 {
277 std::string category = it1->first;
278 it2 = PART_CATEGORY_SETTINGS.find(category);
279 if (it2 != PART_CATEGORY_SETTINGS.end())
280 {
281 std::vector<SimpleSettingData>& options = option_maps[category];
282 options.insert(options.end(), it1->second.begin(), it1->second.end());
283
284 auto sort_func = [](SimpleSettingData& setting1, SimpleSettingData& setting2) {
285 return (setting1.priority < setting2.priority);
286 };
287 std::sort(options.begin(), options.end(), sort_func);
288 }
289 else {
290 option_maps.insert(*it1);
291 }
292 }
293 }
294
295 return option_maps;
296}
static std::map< std::string, std::vector< SimpleSettingData > > PART_CATEGORY_SETTINGS
Definition GUI_Factories.hpp:39
static std::map< std::string, std::vector< SimpleSettingData > > OBJECT_CATEGORY_SETTINGS
Definition GUI_Factories.hpp:38

References OBJECT_CATEGORY_SETTINGS, PART_CATEGORY_SETTINGS, and Slic3r::GUI::SimpleSettingData::priority.

Referenced by Slic3r::GUI::ObjectTableSettings::resetAllValues(), and Slic3r::GUI::ObjectTableSettings::update_settings_list().

Here is the caller graph for this function:

◆ get_bundle()

SettingsFactory::Bundle Slic3r::GUI::SettingsFactory::get_bundle ( const DynamicPrintConfig * config,
bool is_object_settings,
bool is_layer_settings = false )
static
300{
301 auto opt_keys = config->keys();
302 if (opt_keys.empty())
303 return Bundle();
304
305 // update options list according to print technology
306 auto full_current_opts = get_options(!is_object_settings);
307 if (is_layer_settings)
308 full_current_opts.push_back("layer_height");
309 for (int i = opt_keys.size() - 1; i >= 0; --i)
310 if (find(full_current_opts.begin(), full_current_opts.end(), opt_keys[i]) == full_current_opts.end())
311 opt_keys.erase(opt_keys.begin() + i);
312
313 if (opt_keys.empty())
314 return Bundle();
315
316 const int filaments_cnt = wxGetApp().filaments_cnt();
317
318 Bundle bundle;
319 for (auto& opt_key : opt_keys)
320 {
321 auto category = config->def()->get(opt_key)->category;
322 if (is_improper_category(category, filaments_cnt, is_object_settings))
323 continue;
324
325 std::vector< std::string > new_category;
326
327 auto& cat_opt = bundle.find(category) == bundle.end() ? new_category : bundle.at(category);
328 cat_opt.push_back(opt_key);
329 if (cat_opt.size() == 1)
330 bundle[category] = cat_opt;
331 }
332
333 return bundle;
334}
static bool is_improper_category(const std::string &category, const int filaments_cnt, const bool is_object_settings=true)
Definition GUI_Factories.cpp:70
RaycastManager::TrItems::iterator find(RaycastManager::TrItems &items, const RaycastManager::TrKey &key)
Definition RaycastManager.cpp:298
std::map< std::string, std::vector< std::string > > Bundle
Definition GUI_Factories.hpp:34
static std::vector< std::string > get_options(bool is_part)
Definition GUI_Factories.cpp:201

References Slic3r::ConfigOptionDef::category, Slic3r::DynamicPrintConfig::def(), Slic3r::ConfigDef::get(), get_options(), Slic3r::GUI::is_improper_category(), and Slic3r::DynamicConfig::keys().

Referenced by Slic3r::GUI::ObjectList::add_settings_item(), Slic3r::GUI::ParamsPanel::notify_object_config_changed(), Slic3r::GUI::ObjectList::object_config_options_changed(), and Slic3r::GUI::ObjectSettings::update_settings_list().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_category_bitmap()

wxBitmap Slic3r::GUI::SettingsFactory::get_category_bitmap ( const std::string & category_name,
bool menu_bmp = true )
static
358{
359 if (CATEGORY_ICON.find(category_name) == CATEGORY_ICON.end())
360 return wxNullBitmap;
362}
static const char * category_name(AuditEventCategory category)
Definition PluginAuditManager.cpp:348
static std::map< std::string, std::string > CATEGORY_ICON
Definition GUI_Factories.hpp:35
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448

References CATEGORY_ICON, Slic3r::category_name(), and create_scaled_bitmap().

Referenced by Slic3r::GUI::create_freq_settings_popupmenu(), Slic3r::GUI::create_settings_popupmenu(), and Slic3r::GUI::ObjectDataViewModelNode::update_settings_digest_bitmaps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_options()

std::vector< std::string > Slic3r::GUI::SettingsFactory::get_options ( bool is_part)
static
202{
203 if (printer_technology() == ptSLA) {
204 SLAPrintObjectConfig full_sla_config;
205 auto options = full_sla_config.keys();
206 options.erase(find(options.begin(), options.end(), "layer_height"));
207 return options;
208 }
209
210 PrintRegionConfig reg_config;
211 auto options = reg_config.keys();
212 if (!is_part) {
213 PrintObjectConfig obj_config;
214 std::vector<std::string> obj_options = obj_config.keys();
215 options.insert(options.end(), obj_options.begin(), obj_options.end());
216 }
217 return options;
218}
static PrinterTechnology printer_technology()
Definition GUI_Factories.cpp:60
zaa_minimize_perimeter_height PrintRegionConfig
Definition PrintConfig.hpp:2183
@ ptSLA
Definition Config.hpp:233
zaa_minimize_perimeter_height PrintObjectConfig
Definition PrintConfig.hpp:2183

References Slic3r::GUI::printer_technology(), Slic3r::PrintObjectConfig, Slic3r::PrintRegionConfig, and Slic3r::ptSLA.

Referenced by get_bundle(), Slic3r::GUI::get_full_settings_hierarchy(), and Slic3r::GUI::ObjectList::paste_settings_into_list().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_visible_options()

std::vector< SimpleSettingData > Slic3r::GUI::SettingsFactory::get_visible_options ( const std::string & category,
const bool is_part )
static
221{
222 /*t_config_option_keys options = {
223 //Quality
224 "wall_infill_order", "ironing_type", "inner_wall_line_width", "outer_wall_line_width", "top_surface_line_width",
225 //Shell
226 "wall_loops", "top_shell_layers", "bottom_shell_layers", "top_shell_thickness", "bottom_shell_thickness", "top_surface_expansion", "top_surface_expansion_margin", "top_surface_expansion_direction",
227 //Infill
228 "sparse_infill_density", "sparse_infill_pattern", "top_surface_pattern", "bottom_surface_pattern", "infill_combination", "infill_direction", "infill_wall_overlap",
229 //speed
230 "inner_wall_speed", "outer_wall_speed", "sparse_infill_speed", "internal_solid_infill_speed", "top_surface_speed", "gap_infill_speed"
231 };
232
233 t_config_option_keys object_options = {
234 //Quality
235 "layer_height", "initial_layer_print_height", "adaptive_layer_height", "seam_position", "xy_hole_compensation", "xy_contour_compensation", "elefant_foot_compensation", "support_line_width",
236 //Support
237 "enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap", "support_on_build_plate_only", "support_critical_regions_only", "enforce_support_layers",
238 //tree support
239 "tree_support_wall_count",
240 //support
241 "support_top_z_distance", "support_base_pattern", "support_base_pattern_spacing", "support_interface_top_layers", "support_interface_bottom_layers", "support_interface_spacing", "support_bottom_interface_spacing", "support_object_xy_distance",
242 "support_object_first_layer_gap",
243 //adhesion
244 "brim_type", "brim_width", "brim_object_gap", "raft_layers"
245 };*/
246 std::vector<SimpleSettingData> options;
247 std::map<std::string, std::vector<SimpleSettingData>>::iterator it;
248
249 it = PART_CATEGORY_SETTINGS.find(category);
250 if (it != PART_CATEGORY_SETTINGS.end())
251 {
252 options = PART_CATEGORY_SETTINGS[category];
253 }
254
255 if (!is_part) {
256 it = OBJECT_CATEGORY_SETTINGS.find(category);
257 if (it != OBJECT_CATEGORY_SETTINGS.end())
258 options.insert(options.end(), OBJECT_CATEGORY_SETTINGS[category].begin(), OBJECT_CATEGORY_SETTINGS[category].end());
259 }
260
261 auto sort_func = [](SimpleSettingData& setting1, SimpleSettingData& setting2) {
262 return (setting1.priority < setting2.priority);
263 };
264 std::sort(options.begin(), options.end(), sort_func);
265 return options;
266}

References OBJECT_CATEGORY_SETTINGS, PART_CATEGORY_SETTINGS, and Slic3r::GUI::SimpleSettingData::priority.

Referenced by Slic3r::GUI::ObjectTableSettings::resetAllValues(), Slic3r::GUI::ObjectTableSettings::update_config_values(), and Slic3r::GUI::ObjectTableSettings::update_settings_list().

Here is the caller graph for this function:

Member Data Documentation

◆ CATEGORY_ICON

std::map< std::string, std::string > Slic3r::GUI::SettingsFactory::CATEGORY_ICON
static
Initial value:
=
{
{ L("Quality") , "blank2" },
{ L("Shell") , "blank_14" },
{ L("Infill") , "blank_14" },
{ L("Ironing") , "blank_14" },
{ L("Fuzzy skin") , "menu_fuzzy_skin" },
{ L("Support") , "support" },
{ L("Speed") , "blank_14" },
{ L("Extruders") , "blank_14" },
{ L("Extrusion width") , "blank_14" },
{ L("Wipe options") , "blank_14" },
{ L("Bed adhesion") , "blank_14" },
{ L("Advanced") , "blank_14" },
}
#define L(s)
Definition ExtrusionEntity.cpp:25

Referenced by get_category_bitmap().

◆ OBJECT_CATEGORY_SETTINGS

std::map< std::string, std::vector< SimpleSettingData > > Slic3r::GUI::SettingsFactory::OBJECT_CATEGORY_SETTINGS
static
Initial value:
=
{
{ L("Quality"), {{"layer_height", "",1},
{"seam_position", "",2},
{"slice_closing_radius", "",3}, {"resolution", "",4},
{"xy_hole_compensation", "",5}, {"xy_contour_compensation", "",6}, {"elefant_foot_compensation", "",7},
{"make_overhang_printable_angle","", 8},{"make_overhang_printable_hole_size","",9}, {"wall_sequence","",10},
{"precise_z_height", "",10}
}},
{ L("Support"), {{"brim_type", "",1},{"brim_width", "",2},{"leading_brim_length", "",3},{"extra_brim_width", "",4},{"brim_object_gap", "",5},{"brim_flow_ratio", "",6},{"brim_use_efc_outline", "",7},
{"enable_support", "",8},{"support_type", "",9},{"support_threshold_angle", "",10}, {"support_threshold_overlap", "",11}, {"support_on_build_plate_only", "",12},
{"support_filament", "",13},{"support_interface_filament", "",14},{"support_expansion", "",15},{"support_style", "",16},
{"tree_support_brim_width", "",17}, {"tree_support_branch_angle", "",18},{"tree_support_branch_angle_organic","",19}, {"tree_support_wall_count", "",20},{"tree_support_branch_diameter_angle", "",21},
{"support_bottom_z_distance", "",22},{"support_top_z_distance", "",23},{"support_base_pattern", "",24},{"support_base_pattern_spacing", "",25},
{"support_interface_top_layers", "",26},{"support_interface_bottom_layers", "",27},{"support_interface_spacing", "",28},{"support_bottom_interface_spacing", "",29},
{"support_object_xy_distance", "",30}, {"bridge_no_support", "",31},{"max_bridge_length", "",32},{"support_critical_regions_only", "",33},{"support_remove_small_overhang","",34},
{"support_object_first_layer_gap","",35}
}},
{ L("Speed"), {{"support_speed", "",12}, {"support_interface_speed", "",13}
}}
}

Referenced by get_all_visible_options(), and get_visible_options().

◆ PART_CATEGORY_SETTINGS

std::map< std::string, std::vector< SimpleSettingData > > Slic3r::GUI::SettingsFactory::PART_CATEGORY_SETTINGS
static

The documentation for this struct was generated from the following files: