SLA: Invalidate all PrintObjects if the scaling correction changes.
Fixes a bug, where the sla_transofmation() function works with the new scaling values for both old and new ModelObjects, therefore no reslicing is triggered. (untested)
This commit is contained in:
parent
f0d106e5f0
commit
f554d02665
2 changed files with 8 additions and 6 deletions
|
@ -158,12 +158,13 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, const DynamicPrintConf
|
||||||
tbb::mutex::scoped_lock lock(this->state_mutex());
|
tbb::mutex::scoped_lock lock(this->state_mutex());
|
||||||
|
|
||||||
// The following call may stop the background processing.
|
// The following call may stop the background processing.
|
||||||
|
bool invalidate_all_model_objects = false;
|
||||||
if (! print_diff.empty())
|
if (! print_diff.empty())
|
||||||
update_apply_status(this->invalidate_state_by_config_options(print_diff));
|
update_apply_status(this->invalidate_state_by_config_options(print_diff, invalidate_all_model_objects));
|
||||||
if (! printer_diff.empty())
|
if (! printer_diff.empty())
|
||||||
update_apply_status(this->invalidate_state_by_config_options(printer_diff));
|
update_apply_status(this->invalidate_state_by_config_options(printer_diff, invalidate_all_model_objects));
|
||||||
if (! material_diff.empty())
|
if (! material_diff.empty())
|
||||||
update_apply_status(this->invalidate_state_by_config_options(material_diff));
|
update_apply_status(this->invalidate_state_by_config_options(material_diff, invalidate_all_model_objects));
|
||||||
|
|
||||||
// Apply variables to placeholder parser. The placeholder parser is currently used
|
// Apply variables to placeholder parser. The placeholder parser is currently used
|
||||||
// only to generate the output file name.
|
// only to generate the output file name.
|
||||||
|
@ -202,7 +203,7 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, const DynamicPrintConf
|
||||||
std::set<ModelObjectStatus> model_object_status;
|
std::set<ModelObjectStatus> model_object_status;
|
||||||
|
|
||||||
// 1) Synchronize model objects.
|
// 1) Synchronize model objects.
|
||||||
if (model.id() != m_model.id()) {
|
if (model.id() != m_model.id() || invalidate_all_model_objects) {
|
||||||
// Kill everything, initialize from scratch.
|
// Kill everything, initialize from scratch.
|
||||||
// Stop background processing.
|
// Stop background processing.
|
||||||
this->call_cancel_callback();
|
this->call_cancel_callback();
|
||||||
|
@ -1433,7 +1434,7 @@ void SLAPrint::process()
|
||||||
m_report_status(*this, 100, L("Slicing done"));
|
m_report_status(*this, 100, L("Slicing done"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SLAPrint::invalidate_state_by_config_options(const std::vector<t_config_option_key> &opt_keys)
|
bool SLAPrint::invalidate_state_by_config_options(const std::vector<t_config_option_key> &opt_keys, bool &invalidate_all_model_objects)
|
||||||
{
|
{
|
||||||
if (opt_keys.empty())
|
if (opt_keys.empty())
|
||||||
return false;
|
return false;
|
||||||
|
@ -1480,6 +1481,7 @@ bool SLAPrint::invalidate_state_by_config_options(const std::vector<t_config_opt
|
||||||
} else if (steps_full.find(opt_key) != steps_full.end()) {
|
} else if (steps_full.find(opt_key) != steps_full.end()) {
|
||||||
steps.emplace_back(slapsMergeSlicesAndEval);
|
steps.emplace_back(slapsMergeSlicesAndEval);
|
||||||
osteps.emplace_back(slaposObjectSlice);
|
osteps.emplace_back(slaposObjectSlice);
|
||||||
|
invalidate_all_model_objects = true;
|
||||||
} else {
|
} else {
|
||||||
// All values should be covered.
|
// All values should be covered.
|
||||||
assert(false);
|
assert(false);
|
||||||
|
|
|
@ -459,7 +459,7 @@ private:
|
||||||
bool invalidate_step(SLAPrintStep st);
|
bool invalidate_step(SLAPrintStep st);
|
||||||
|
|
||||||
// Invalidate steps based on a set of parameters changed.
|
// Invalidate steps based on a set of parameters changed.
|
||||||
bool invalidate_state_by_config_options(const std::vector<t_config_option_key> &opt_keys);
|
bool invalidate_state_by_config_options(const std::vector<t_config_option_key> &opt_keys, bool &invalidate_all_model_objects);
|
||||||
|
|
||||||
SLAPrintConfig m_print_config;
|
SLAPrintConfig m_print_config;
|
||||||
SLAPrinterConfig m_printer_config;
|
SLAPrinterConfig m_printer_config;
|
||||||
|
|
Loading…
Reference in a new issue