OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::ModelConfig Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/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)
bool erase (const t_config_option_key &opt_key)
const DynamicPrintConfig & get () 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 ConfigOption * option (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
double get_abs_value (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
2632{ m_data.apply_only(other, other.keys(), ignore_nonexistent); this->touch(); }
void touch()
Definition PrintConfig.hpp:2670
DynamicPrintConfig m_data
Definition PrintConfig.hpp:2677

References 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
2631{ this->apply(other.get(), ignore_nonexistent); }
void apply(const ModelConfig &other, bool ignore_nonexistent=false)
Definition PrintConfig.hpp:2631

References apply(), and get().

Referenced by apply(), Slic3r::GUI::GLGizmoMeshBoolean::generate_new_volume(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), and Slic3r::ModelObject::split().

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
2634{ m_data.apply_only(other, keys, ignore_nonexistent); this->touch(); }
t_config_option_keys keys() const
Definition PrintConfig.hpp:2650

References 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
2633{ 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:2633

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

Referenced by apply_only(), Slic3r::GUI::ObjectSettings::update_config_values(), and Slic3r::GUI::ObjectTableSettings::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
2629{ 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

◆ assign_config() [3/4]

void Slic3r::ModelConfig::assign_config ( DynamicPrintConfig && rhs)
inline
2630{ 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
2618 {
2619 if (m_timestamp != rhs.m_timestamp) {
2620 m_data = std::move(rhs.m_data);
2621 m_timestamp = rhs.m_timestamp;
2622 rhs.reset();
2623 }
2624 }

References m_data, and m_timestamp.

◆ cbegin()

auto Slic3r::ModelConfig::cbegin ( ) const
inline
2648{ return m_data.cbegin(); }

References m_data.

◆ cend()

auto Slic3r::ModelConfig::cend ( ) const
inline
2649{ return m_data.cend(); }

References m_data.

◆ empty()

bool Slic3r::ModelConfig::empty ( ) const
throw ( )
inline
2646{ return m_data.empty(); }

References m_data.

◆ erase()

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

References m_data, and touch().

Referenced by Slic3r::GUI::ObjectGridTable::construct_object_configs(), Slic3r::GUI::ObjectGridTable::reload_part_data(), Slic3r::GUI::ObjectTableSettings::resetAllValues(), Slic3r::GUI::ObjectList::set_extruder_for_selected_items(), Slic3r::GUI::ObjectGridTable::update_value_to_config(), and Slic3r::GUI::ObjectGridTable::update_volume_values_from_object().

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

◆ extruder()

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

References opt_int().

Referenced by Slic3r::Model::add_object(), Slic3r::Model::add_object(), Slic3r::Model::add_object(), Slic3r::GUI::ObjectList::add_volumes_to_object_in_list(), Slic3r::GUI::ObjectDataViewModel::AddObject(), Slic3r::GUI::MenuFactory::append_menu_item_change_extruder(), Slic3r::GUI::MenuFactory::append_menu_item_change_filament(), Slic3r::GUI::Plater::priv::apply_textured_mesh_import_result(), Slic3r::GUI::PartPlate::check_single_extruder_mixed_filament_risk(), Slic3r::GUI::ObjectList::delete_from_model_and_list(), Slic3r::GUI::Plater::priv::load_files(), merge_or_add_object(), Slic3r::Print::process(), Slic3r::CLI::run(), and Slic3r::GUI::ObjectList::split().

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

◆ get()

◆ get_abs_value()

double Slic3r::ModelConfig::get_abs_value ( const t_config_option_key & opt_key) const
inline
2658 {
2659 return m_data.get_abs_value(opt_key);
2660 }

References m_data.

◆ has()

◆ keys()

◆ opt_float()

double Slic3r::ModelConfig::opt_float ( const t_config_option_key & opt_key) const
inline
2655 {
2656 return m_data.opt_float(opt_key);
2657 }

References m_data.

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

Here is the caller graph for this function:

◆ opt_int()

int Slic3r::ModelConfig::opt_int ( const t_config_option_key & opt_key) const
inline
2653{ return m_data.opt_int(opt_key); }

References m_data.

Referenced by extruder(), Slic3r::GUI::ObjectList::get_default_layer_config(), Slic3r::GUI::ObjectList::load_generic_subobject(), and Slic3r::GUI::ObjectList::load_modifier().

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
2661{ return m_data.opt_serialize(opt_key); }

References m_data.

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

Here is the caller graph for this function:

◆ option()

◆ reset()

void Slic3r::ModelConfig::reset ( )
inline
2610{ m_data.clear(); touch(); }

References m_data, and touch().

Referenced by Slic3r::GUI::ObjectList::last_volume_is_deleted(), Slic3r::GUI::Plater::priv::load_files(), Slic3r::ModelObject::split(), and Slic3r::GUI::ObjectTableSettings::update_config_values().

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
2674{ 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,
T value )
inline
2637{ m_data.set(opt_key, value, true); this->touch(); }

References m_data, and touch().

Referenced by Slic3r::GUI::Plater::priv::apply_textured_mesh_import_result(), Slic3r::Print::auto_assign_extruders(), Slic3r::GUI::Plater::priv::load_files(), and Slic3r::GUI::GLGizmoMmuSegmentation::remap_filament_assignments().

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
2639 { m_data.set_deserialize(opt_key, str, substitution_context, append); this->touch(); }
void append(std::vector< T, Alloc > &dest, const std::vector< T, Alloc2 > &src)
Definition libslic3r.h:157

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

Referenced by Slic3r::_3MF_Importer::_generate_volumes(), Slic3r::_BBS_3MF_Importer::_generate_volumes_new(), Slic3r::_3MF_Importer::_load_model_from_file(), and construct_assemble_list().

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

◆ set_key_value()

bool Slic3r::ModelConfig::set_key_value ( const std::string & opt_key,
ConfigOption * opt )
inline
2635{ bool out = m_data.set_key_value(opt_key, opt); this->touch(); return out; }

References m_data, and touch().

Referenced by Slic3r::GUI::Plater::_calib_apply_belt_mode(), Slic3r::GUI::Plater::_calib_pa_pattern(), Slic3r::GUI::Plater::_calib_temp_belt_sectioned(), Slic3r::GUI::ObjectSettings::add_missed_options(), Slic3r::GUI::ObjectTableSettings::add_missed_options(), Slic3r::Model::add_object(), Slic3r::Model::add_object(), Slic3r::Model::add_object(), Slic3r::GUI::MenuFactory::append_menu_items_flush_options(), Slic3r::GUI::Plater::calib_retraction(), Slic3r::GUI::Plater::calib_temp(), construct_assemble_list(), Slic3r::GUI::ObjectGridTable::construct_object_configs(), anonymous_namespace{EmbossJob.cpp}::create_volume(), Slic3r::GUI::ensure_belt_purge_tower(), anonymous_namespace{EmbossJob.cpp}::CreateObjectJob::finalize(), Slic3r::GUI::ObjectList::last_volume_is_deleted(), Slic3r::GUI::ObjectList::load_generic_subobject(), Slic3r::GUI::ObjectList::load_mesh_object(), Slic3r::GUI::ObjectList::load_modifier(), Slic3r::GUI::ObjectList::merge(), merge_or_add_object(), Slic3r::CLI::run(), anonymous_namespace{OrcaSlicer_profile_validator.cpp}::slice_two_color_cube_and_export(), Slic3r::GUI::ObjectGridTable::update_filament_to_config(), and Slic3r::GUI::ObjectGridTable::update_value_to_config().

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

◆ size()

size_t Slic3r::ModelConfig::size ( ) const
throw ( )
inline
2647{ return m_data.size(); }

References m_data.

◆ timestamp()

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

Reimplemented in Slic3r::ModelConfigObject.

2667{ 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
2668{ return m_timestamp == rhs.m_timestamp; }

References m_timestamp.

Referenced by 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:2679

References m_timestamp, and s_last_timestamp.

Referenced by apply(), apply_only(), assign_config(), assign_config(), erase(), reset(), set(), set_deserialize(), set_key_value(), Slic3r::GUI::ObjectGridTable::update_filament_to_config(), and Slic3r::GUI::ObjectGridTable::update_value_to_config().

Here is the caller graph for this function:

◆ cereal::access

friend class cereal::access
friend

References cereal::access.

Referenced by cereal::access.

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: