Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::ModelConfig Class Reference

#include <src/libslic3r/PrintConfig.hpp>

+ Inheritance diagram for Slic3r::ModelConfig:
+ Collaboration diagram for Slic3r::ModelConfig:

Public Member Functions

void reset ()
 
void assign_config (const ModelConfig &rhs)
 
void assign_config (ModelConfig &&rhs)
 
void assign_config (const DynamicPrintConfig &rhs)
 
void assign_config (DynamicPrintConfig &&rhs)
 
void apply (const ModelConfig &other, bool ignore_nonexistent=false)
 
void apply (const ConfigBase &other, bool ignore_nonexistent=false)
 
void apply_only (const ModelConfig &other, const t_config_option_keys &keys, bool ignore_nonexistent=false)
 
void apply_only (const ConfigBase &other, const t_config_option_keys &keys, bool ignore_nonexistent=false)
 
bool set_key_value (const std::string &opt_key, ConfigOption *opt)
 
template<typename T >
void set (const std::string &opt_key, T value)
 
void set_deserialize (const t_config_option_key &opt_key, const std::string &str, ConfigSubstitutionContext &substitution_context, bool append=false)
 
void set_deserialize_strict (const t_config_option_key &opt_key, const std::string &str, bool append=false)
 
bool erase (const t_config_option_key &opt_key)
 
const DynamicPrintConfigget () const throw ()
 
bool empty () const throw ()
 
size_t size () const throw ()
 
auto cbegin () const
 
auto cend () const
 
t_config_option_keys keys () const
 
bool has (const t_config_option_key &opt_key) const
 
const ConfigOptionoption (const t_config_option_key &opt_key) const
 
int opt_int (const t_config_option_key &opt_key) const
 
int extruder () const
 
double opt_float (const t_config_option_key &opt_key) const
 
std::string opt_serialize (const t_config_option_key &opt_key) const
 
virtual uint64_t timestamp () const throw ()
 
bool timestamp_matches (const ModelConfig &rhs) const throw ()
 
void touch ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar)
 

Private Attributes

uint64_t m_timestamp { 1 }
 
DynamicPrintConfig m_data
 

Static Private Attributes

static uint64_t s_last_timestamp = 1
 

Friends

class cereal::access
 

Detailed Description

Member Function Documentation

◆ apply() [1/2]

void Slic3r::ModelConfig::apply ( const ConfigBase other,
bool  ignore_nonexistent = false 
)
inline
1253{ m_data.apply_only(other, other.keys(), ignore_nonexistent); this->touch(); }
void apply_only(const ConfigBase &other, const t_config_option_keys &keys, bool ignore_nonexistent=false)
Definition Config.cpp:466
void touch()
Definition PrintConfig.hpp:1288
DynamicPrintConfig m_data
Definition PrintConfig.hpp:1295

References Slic3r::ConfigBase::apply_only(), Slic3r::ConfigBase::keys(), m_data, and touch().

+ Here is the call graph for this function:

◆ apply() [2/2]

void Slic3r::ModelConfig::apply ( const ModelConfig other,
bool  ignore_nonexistent = false 
)
inline
1252{ this->apply(other.get(), ignore_nonexistent); }
void apply(const ModelConfig &other, bool ignore_nonexistent=false)
Definition PrintConfig.hpp:1252

References apply(), and get().

Referenced by apply(), Slic3r::GUI::Plater::priv::reload_from_disk(), and Slic3r::GUI::Plater::priv::replace_volume_with_stl().

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

◆ apply_only() [1/2]

void Slic3r::ModelConfig::apply_only ( const ConfigBase other,
const t_config_option_keys keys,
bool  ignore_nonexistent = false 
)
inline
1255{ m_data.apply_only(other, keys, ignore_nonexistent); this->touch(); }
t_config_option_keys keys() const
Definition PrintConfig.hpp:1273

References Slic3r::ConfigBase::apply_only(), keys(), m_data, and touch().

+ Here is the call graph for this function:

◆ apply_only() [2/2]

void Slic3r::ModelConfig::apply_only ( const ModelConfig other,
const t_config_option_keys keys,
bool  ignore_nonexistent = false 
)
inline
1254{ this->apply_only(other.get(), keys, ignore_nonexistent); }
void apply_only(const ModelConfig &other, const t_config_option_keys &keys, bool ignore_nonexistent=false)
Definition PrintConfig.hpp:1254

References apply_only(), get(), and keys().

Referenced by apply_only(), and Slic3r::GUI::ObjectSettings::update_config_values().

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

◆ assign_config() [1/4]

void Slic3r::ModelConfig::assign_config ( const DynamicPrintConfig rhs)
inline
1250{ if (m_data != rhs) { m_data = rhs; this->touch(); } }

References m_data, and touch().

+ Here is the call graph for this function:

◆ assign_config() [2/4]

void Slic3r::ModelConfig::assign_config ( const ModelConfig rhs)
inline
1233 {
1234 if (m_timestamp != rhs.m_timestamp) {
1235 m_data = rhs.m_data;
1236 m_timestamp = rhs.m_timestamp;
1237 }
1238 }
uint64_t m_timestamp
Definition PrintConfig.hpp:1294

References m_data, and m_timestamp.

Referenced by Slic3r::Print::apply(), Slic3r::SLAPrint::apply(), Slic3r::ModelObject::convert_units(), Slic3r::GUI::Selection::copy_to_clipboard(), Slic3r::model_volume_list_copy_configs(), and Slic3r::ModelObject::split().

+ Here is the caller graph for this function:

◆ assign_config() [3/4]

void Slic3r::ModelConfig::assign_config ( DynamicPrintConfig &&  rhs)
inline
1251{ if (m_data != rhs) { m_data = std::move(rhs); this->touch(); } }

References m_data, and touch().

+ Here is the call graph for this function:

◆ assign_config() [4/4]

void Slic3r::ModelConfig::assign_config ( ModelConfig &&  rhs)
inline
1239 {
1240 if (m_timestamp != rhs.m_timestamp) {
1241 m_data = std::move(rhs.m_data);
1242 m_timestamp = rhs.m_timestamp;
1243 rhs.reset();
1244 }
1245 }

References m_data, and m_timestamp.

◆ cbegin()

auto Slic3r::ModelConfig::cbegin ( ) const
inline
1271{ return m_data.cbegin(); }
std::map< t_config_option_key, std::unique_ptr< ConfigOption > >::const_iterator cbegin() const
Definition Config.hpp:2453

References Slic3r::DynamicConfig::cbegin(), and m_data.

+ Here is the call graph for this function:

◆ cend()

auto Slic3r::ModelConfig::cend ( ) const
inline
1272{ return m_data.cend(); }
std::map< t_config_option_key, std::unique_ptr< ConfigOption > >::const_iterator cend() const
Definition Config.hpp:2454

References Slic3r::DynamicConfig::cend(), and m_data.

+ Here is the call graph for this function:

◆ empty()

bool Slic3r::ModelConfig::empty ( ) const
throw (
)
inline
1269{ return m_data.empty(); }
bool empty() const
Definition Config.hpp:2426

References Slic3r::DynamicConfig::empty(), and m_data.

+ Here is the call graph for this function:

◆ erase()

bool Slic3r::ModelConfig::erase ( const t_config_option_key opt_key)
inline
1263{ bool out = m_data.erase(opt_key); if (out) this->touch(); return out; }
bool erase(const t_config_option_key &opt_key)
Definition Config.hpp:2405

References Slic3r::DynamicConfig::erase(), m_data, and touch().

Referenced by Slic3r::GUI::ObjectList::add_category_to_settings_from_selection(), and Slic3r::GUI::ObjectList::set_extruder_for_selected_items().

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

◆ extruder()

int Slic3r::ModelConfig::extruder ( ) const
inline
1277{ return opt_int("extruder"); }
int opt_int(const t_config_option_key &opt_key) const
Definition PrintConfig.hpp:1276

References opt_int().

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_change_extruder(), Slic3r::GUI::ObjectList::del_settings_from_config(), Slic3r::GUI::ObjectList::del_subobject_from_object(), Slic3r::GUI::ObjectList::delete_from_model_and_list(), Slic3r::GUI::ObjectList::set_extruder_for_selected_items(), and Slic3r::GUI::ObjectList::update_extruder_values_for_items().

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

◆ get()

◆ has()

bool Slic3r::ModelConfig::has ( const t_config_option_key opt_key) const
inline
1274{ return m_data.has(opt_key); }
bool has(const t_config_option_key &opt_key) const
Definition Config.hpp:2105

References Slic3r::ConfigOptionResolver::has(), and m_data.

Referenced by Slic3r::GUI::ObjectList::add_layer_item(), Slic3r::GUI::ObjectSettings::add_missed_options(), Slic3r::GUI::MenuFactory::append_menu_item_change_extruder(), Slic3r::GUI::ObjectList::del_settings_from_config(), Slic3r::GUI::ObjectList::delete_from_model_and_list(), Slic3r::GUI::ObjectList::get_default_layer_config(), Slic3r::GUI::ObjectList::set_extruder_for_selected_items(), Slic3r::ModelObject::split(), and Slic3r::GUI::ObjectList::update_extruder_values_for_items().

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

◆ keys()

t_config_option_keys Slic3r::ModelConfig::keys ( ) const
inline
1273{ return m_data.keys(); }
t_config_option_keys keys() const override
Definition Config.cpp:1233

References Slic3r::DynamicConfig::keys(), and m_data.

Referenced by Slic3r::_3MF_Exporter::_add_layer_config_ranges_file_to_archive(), Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::GUI::ObjectList::add_category_to_settings_from_frequent(), Slic3r::GUI::ObjectList::add_category_to_settings_from_selection(), apply_only(), apply_only(), Slic3r::GUI::create_settings_popupmenu(), Slic3r::GUI::ObjectList::del_settings_from_config(), Slic3r::GUI::ObjectList::merge(), and Slic3r::GUI::ObjectSettings::update_config_values().

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

◆ opt_float()

double Slic3r::ModelConfig::opt_float ( const t_config_option_key opt_key) const
inline
1278{ return m_data.opt_float(opt_key); }
double & opt_float(const t_config_option_key &opt_key)
Definition Config.hpp:2281

References m_data, and Slic3r::ConfigBase::opt_float().

Referenced by Slic3r::GUI::ObjectList::del_settings_from_config(), Slic3r::GUI::ObjectList::edit_layer_range(), and Slic3r::GUI::ObjectList::get_default_layer_config().

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

◆ opt_int()

int Slic3r::ModelConfig::opt_int ( const t_config_option_key opt_key) const
inline
1276{ return m_data.opt_int(opt_key); }
int & opt_int(const t_config_option_key &opt_key)
Definition Config.hpp:2286

References m_data, and Slic3r::ConfigBase::opt_int().

Referenced by Slic3r::GUI::ObjectList::add_layer_item(), Slic3r::GUI::ObjectList::edit_layer_range(), and extruder().

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

◆ opt_serialize()

std::string Slic3r::ModelConfig::opt_serialize ( const t_config_option_key opt_key) const
inline
1279{ return m_data.opt_serialize(opt_key); }
std::string opt_serialize(const t_config_option_key &opt_key) const
Definition Config.cpp:528

References m_data, and Slic3r::ConfigBase::opt_serialize().

Referenced by Slic3r::_3MF_Exporter::_add_layer_config_ranges_file_to_archive(), Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), and Slic3r::store_amf().

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

◆ option()

const ConfigOption * Slic3r::ModelConfig::option ( const t_config_option_key opt_key) const
inline
1275{ return m_data.option(opt_key); }
ConfigOption * option(const t_config_option_key &opt_key, bool create=false)
Definition Config.hpp:2169

References m_data, and Slic3r::ConfigBase::option().

Referenced by Slic3r::GUI::ObjectList::merge(), Slic3r::GUI::ObjectList::split(), and Slic3r::GUI::ConfigManipulation::toggle_field().

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

◆ reset()

void Slic3r::ModelConfig::reset ( )
inline
1231{ m_data.clear(); touch(); }
void clear()
Definition Config.hpp:2400

References Slic3r::DynamicConfig::clear(), m_data, and touch().

Referenced by Slic3r::GUI::ObjectList::del_settings_from_config().

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

◆ serialize()

template<class Archive >
void Slic3r::ModelConfig::serialize ( Archive &  ar)
inlineprivate
1292{ ar(m_timestamp); ar(m_data); }

References m_data, and m_timestamp.

◆ set()

template<typename T >
void Slic3r::ModelConfig::set ( const std::string &  opt_key,
value 
)
inline
1258{ m_data.set(opt_key, value, true); this->touch(); }
void set(const std::string &opt_key, bool value, bool create=false)
Definition Config.hpp:2226

References m_data, Slic3r::ConfigBase::set(), and touch().

Referenced by Slic3r::GUI::GLGizmoHollow::on_render_input_window(), Slic3r::GUI::GLGizmoSlaSupports::on_render_input_window(), and Slic3r::GUI::ObjectList::set_extruder_for_selected_items().

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

◆ set_deserialize()

void Slic3r::ModelConfig::set_deserialize ( const t_config_option_key opt_key,
const std::string &  str,
ConfigSubstitutionContext substitution_context,
bool  append = false 
)
inline
1260 { m_data.set_deserialize(opt_key, str, substitution_context, append); this->touch(); }
void set_deserialize(const t_config_option_key &opt_key, const std::string &str, ConfigSubstitutionContext &config_substitutions, bool append=false)
Definition Config.cpp:571
void append(std::vector< T, Alloc > &dest, const std::vector< T, Alloc2 > &src)
Definition libslic3r.h:110

References Slic3r::append(), m_data, Slic3r::ConfigBase::set_deserialize(), and touch().

Referenced by Slic3r::_3MF_Importer::_load_model_from_file(), and Slic3r::AMFParserContext::endElement().

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

◆ set_deserialize_strict()

void Slic3r::ModelConfig::set_deserialize_strict ( const t_config_option_key opt_key,
const std::string &  str,
bool  append = false 
)
inline
1262 { m_data.set_deserialize_strict(opt_key, str, append); this->touch(); }
void set_deserialize_strict(const t_config_option_key &opt_key, const std::string &str, bool append=false)
Definition Config.hpp:2240

References Slic3r::append(), m_data, Slic3r::ConfigBase::set_deserialize_strict(), and touch().

+ Here is the call graph for this function:

◆ set_key_value()

bool Slic3r::ModelConfig::set_key_value ( const std::string &  opt_key,
ConfigOption opt 
)
inline

◆ size()

size_t Slic3r::ModelConfig::size ( ) const
throw (
)
inline
1270{ return m_data.size(); }
size_t size() const
Definition Config.hpp:2455

References m_data, and Slic3r::DynamicConfig::size().

+ Here is the call graph for this function:

◆ timestamp()

virtual uint64_t Slic3r::ModelConfig::timestamp ( ) const
throw (
)
inlinevirtual

Reimplemented in Slic3r::ModelConfigObject.

1285{ return m_timestamp; }

References m_timestamp.

Referenced by Slic3r::ModelConfigObject::timestamp().

+ Here is the caller graph for this function:

◆ timestamp_matches()

bool Slic3r::ModelConfig::timestamp_matches ( const ModelConfig rhs) const
throw (
)
inline
1286{ return m_timestamp == rhs.m_timestamp; }

References m_timestamp.

Referenced by Slic3r::Print::apply(), and Slic3r::SLAPrint::apply().

+ Here is the caller graph for this function:

◆ touch()

void Slic3r::ModelConfig::touch ( )
inline
static uint64_t s_last_timestamp
Definition PrintConfig.hpp:1297

References m_timestamp, and s_last_timestamp.

Referenced by apply(), apply_only(), assign_config(), assign_config(), Slic3r::GUI::ConfigOptionsGroup::change_opt_value(), erase(), reset(), set(), set_deserialize(), set_deserialize_strict(), and set_key_value().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ cereal::access

friend class cereal::access
friend

Member Data Documentation

◆ m_data

◆ m_timestamp

uint64_t Slic3r::ModelConfig::m_timestamp { 1 }
private

◆ s_last_timestamp

uint64_t Slic3r::ModelConfig::s_last_timestamp = 1
staticprivate

Referenced by touch().


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