Storing the active printer technology onto the Undo / Redo stack,

remembering the last selected Printer profile for the SLA and FDM
technologies separately, and activating them on Undo / Redo.

When switching the technologies, user is asked whether to discard
the modified profiles or not.
This commit is contained in:
bubnikv 2019-07-18 17:41:47 +02:00
parent 631a952f94
commit a0ea96968d
14 changed files with 141 additions and 119 deletions

View file

@ -1877,6 +1877,31 @@ bool model_volume_list_changed(const ModelObject &model_object_old, const ModelO
return false;
}
extern bool model_has_multi_part_objects(const Model &model)
{
for (const ModelObject *model_object : model.objects)
if (model_object->volumes.size() != 1 || ! model_object->volumes.front()->is_model_part())
return true;
return false;
}
extern bool model_has_advanced_features(const Model &model)
{
auto config_is_advanced = [](const DynamicPrintConfig &config) {
return ! (config.empty() || (config.size() == 1 && config.cbegin()->first == "extruder"));
};
for (const ModelObject *model_object : model.objects) {
// Is there more than one instance or advanced config data?
if (model_object->instances.size() > 1 || config_is_advanced(model_object->config))
return true;
// Is there any modifier or advanced config data?
for (const ModelVolume* model_volume : model_object->volumes)
if (! model_volume->is_model_part() || config_is_advanced(model_volume->config))
return true;
}
return false;
}
#ifndef NDEBUG
// Verify whether the IDs of Model / ModelObject / ModelVolume / ModelInstance / ModelMaterial are valid and unique.
void check_model_ids_validity(const Model &model)