new cheaper constructor for DynamicPrintConfig from FullPrintConfig:

DynamicPrintConfig::full_print_config()
new cheaper constructors of DynamicConfig / DynamicPrintConfig from ConfigBase
Unit tests: ported test_model from upstream Slic3r, thanks @lordofhyphens
Unit tests refactored to use less autos and initializer lists for readibility,
DynamicPrintConfig is handled by value, not by shared pointer.
This commit is contained in:
bubnikv 2019-10-16 11:16:50 +02:00
parent 90d5712091
commit 69c8b1cd21
12 changed files with 190 additions and 107 deletions

View file

@ -668,6 +668,12 @@ void ConfigBase::null_nullables()
}
}
DynamicConfig::DynamicConfig(const ConfigBase& rhs, const t_config_option_keys& keys)
{
for (const t_config_option_key& opt_key : keys)
this->options[opt_key] = std::unique_ptr<ConfigOption>(rhs.option(opt_key)->clone());
}
bool DynamicConfig::operator==(const DynamicConfig &rhs) const
{
auto it1 = this->options.begin();