OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::PresetUtils Namespace Reference

Functions

const VendorProfile::PrinterModel * system_printer_model (const Preset &preset)
std::string system_printer_bed_model (const Preset &preset)
std::string system_printer_bed_texture (const Preset &preset)
std::string system_printer_hotend_model (const Preset &preset)

Function Documentation

◆ system_printer_bed_model()

std::string Slic3r::PresetUtils::system_printer_bed_model ( const Preset & preset)
5096 {
5097 std::string out;
5099 if (pm != nullptr && !pm->bed_model.empty()) {
5100 out = Slic3r::data_dir() + "/vendor/" + preset.vendor->id + "/" + pm->bed_model;
5101 if (!boost::filesystem::exists(boost::filesystem::path(out)))
5102 out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->bed_model;
5103 }
5104 return out;
5105 }
const VendorProfile * vendor
Definition Preset.hpp:294
std::string id
Definition Preset.hpp:137
const VendorProfile::PrinterModel * system_printer_model(const Preset &preset)
Definition Preset.cpp:5081
const std::string & data_dir()
Definition utils.cpp:365
const std::string & resources_dir()
Definition utils.cpp:296
Definition Preset.hpp:152
std::string bed_model
Definition Preset.hpp:164

References Slic3r::VendorProfile::PrinterModel::bed_model, Slic3r::data_dir(), Slic3r::VendorProfile::id, Slic3r::resources_dir(), system_printer_model(), and Slic3r::Preset::vendor.

Referenced by Slic3r::GUI::TabPrinter::create_bed_shape_widget(), Slic3r::GUI::Bed3D::detect_type(), and Slic3r::GUI::GCodeViewer::load_as_gcode().

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

◆ system_printer_bed_texture()

std::string Slic3r::PresetUtils::system_printer_bed_texture ( const Preset & preset)
5108 {
5109 std::string out;
5111 if (pm != nullptr && !pm->bed_texture.empty()) {
5112 out = Slic3r::data_dir() + "/vendor/" + preset.vendor->id + "/" + pm->bed_texture;
5113 if (!boost::filesystem::exists(boost::filesystem::path(out)))
5114 out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->bed_texture;
5115 }
5116 return out;
5117 }
std::string bed_texture
Definition Preset.hpp:165

References Slic3r::VendorProfile::PrinterModel::bed_texture, Slic3r::data_dir(), Slic3r::VendorProfile::id, Slic3r::resources_dir(), system_printer_model(), and Slic3r::Preset::vendor.

Referenced by Slic3r::GUI::GCodeViewer::load_as_gcode(), and Slic3r::GUI::Plater::set_bed_shape().

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

◆ system_printer_hotend_model()

std::string Slic3r::PresetUtils::system_printer_hotend_model ( const Preset & preset)
5120 {
5121 std::string out;
5123 if (pm != nullptr && !pm->hotend_model.empty()) {
5124 out = Slic3r::data_dir() + "/vendor/" + preset.vendor->id + "/" + pm->hotend_model;
5125 if (!boost::filesystem::exists(boost::filesystem::path(out)))
5126 out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->hotend_model;
5127 }
5128
5129 if (out.empty() ||!boost::filesystem::exists(boost::filesystem::path(out)))
5130 out = Slic3r::resources_dir() + "/profiles/hotend.stl";
5131 return out;
5132 }
std::string hotend_model
Definition Preset.hpp:172

References Slic3r::data_dir(), Slic3r::VendorProfile::PrinterModel::hotend_model, Slic3r::VendorProfile::id, Slic3r::resources_dir(), system_printer_model(), and Slic3r::Preset::vendor.

Referenced by Slic3r::GUI::GCodeViewer::init().

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

◆ system_printer_model()

const VendorProfile::PrinterModel * Slic3r::PresetUtils::system_printer_model ( const Preset & preset)
5082 {
5083 const VendorProfile::PrinterModel *out = nullptr;
5084 if (preset.vendor != nullptr) {
5085 auto *printer_model = preset.config.opt<ConfigOptionString>("printer_model");
5086 if (printer_model != nullptr && ! printer_model->value.empty()) {
5087 auto it = std::find_if(preset.vendor->models.begin(), preset.vendor->models.end(), [printer_model](const VendorProfile::PrinterModel &pm) { return pm.id == printer_model->value; });
5088 if (it != preset.vendor->models.end())
5089 out = &(*it);
5090 }
5091 }
5092 return out;
5093 }
Definition Config.hpp:1158
T * opt(const t_config_option_key &opt_key, bool create=false)
Definition Config.hpp:3007
DynamicPrintConfig config
Definition Preset.hpp:300
std::vector< PrinterModel > models
Definition Preset.hpp:193

References Slic3r::Preset::config, Slic3r::VendorProfile::models, Slic3r::DynamicConfig::opt(), and Slic3r::Preset::vendor.

Referenced by Slic3r::GUI::ConfigWizard::priv::check_and_install_missing_materials(), Slic3r::PresetBundle::check_printer_default_materials(), Slic3r::GUI::Plater::get_curr_printer_model(), Slic3r::GUI::CalibrationPresetPage::init_selection_values(), Slic3r::PresetBundle::load_installed_filaments(), system_printer_bed_model(), system_printer_bed_texture(), and system_printer_hotend_model().

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