WIP: Merged commits from stable between 1.41.2-beta and 1.42.2 final.

Changes in SupportMaterial.cpp, TriangleMesh.cpp and 01_trianglemesh.t
are yet to be merged.

WIP: Refactoring of layer height editing.
Removed layer_height_ranges from PrintObject, as the Print/PrintObject
now hold their copies of Model/ModelObject.
This commit is contained in:
bubnikv 2018-12-11 16:33:43 +01:00
parent 2ed77aadde
commit 52db7b055a
12 changed files with 231 additions and 40 deletions

View file

@ -16,6 +16,7 @@
#include <boost/property_tree/ini_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/format.hpp>
namespace Slic3r {
@ -125,8 +126,13 @@ void AppConfig::load()
void AppConfig::save()
{
// The config is first written to a file with a PID suffix and then moved
// to avoid race conditions with multiple instances of Slic3r
const auto path = config_path();
std::string path_pid = (boost::format("%1%.%2%") % path % get_current_pid()).str();
boost::nowide::ofstream c;
c.open(AppConfig::config_path(), std::ios::out | std::ios::trunc);
c.open(path_pid, std::ios::out | std::ios::trunc);
c << "# " << Slic3r::header_slic3r_generated() << std::endl;
// Make sure the "no" category is written first.
for (const std::pair<std::string, std::string> &kvp : m_storage[""])
@ -155,6 +161,8 @@ void AppConfig::save()
}
}
c.close();
rename_file(path_pid, path);
m_dirty = false;
}

View file

@ -323,17 +323,17 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) :
double brim_width = config->opt_float("brim_width");
if (boost::any_cast<bool>(value) == true)
{
new_val = m_brim_width == 0.0 ? 10 :
new_val = m_brim_width == 0.0 ? 5 :
m_brim_width < 0.0 ? m_brim_width * (-1) :
m_brim_width;
}
else{
else {
m_brim_width = brim_width * (-1);
new_val = 0;
}
new_conf.set_key_value("brim_width", new ConfigOptionFloat(new_val));
}
else{ //(opt_key == "support")
else { //(opt_key == "support")
const wxString& selection = boost::any_cast<wxString>(value);
auto support_material = selection == _("None") ? false : true;