Feature/update deps (#3445)

* update deps

* fix win build errors

* fix mac build

* update linux

(cherry picked from commit 77b6225060)
This commit is contained in:
SoftFever 2024-01-04 06:50:11 +08:00
parent 1ea33f0919
commit 9d59cd66c4
16 changed files with 67 additions and 227 deletions

View file

@ -28,7 +28,7 @@
using namespace Slic3r;
#include "ExPolygonsIndex.hpp"
#include <boost/next_prior.hpp>
#include <CGAL/Polygon_mesh_processing/corefinement.h>
#include <CGAL/Exact_integer.h>
#include <CGAL/Surface_mesh.h>

View file

@ -31,7 +31,6 @@
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/string_file.hpp>
#include <boost/nowide/fstream.hpp>
#include <boost/nowide/cstdio.hpp>
#include <boost/spirit/include/karma.hpp>
@ -1290,9 +1289,9 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
model.set_backup_path(m_backup_path);
try {
if (boost::filesystem::exists(model.get_backup_path() + "/origin.txt"))
boost::filesystem::load_string_file(model.get_backup_path() + "/origin.txt", m_origin_file);
load_string_file(model.get_backup_path() + "/origin.txt", m_origin_file);
} catch (...) {}
boost::filesystem::save_string_file(
save_string_file(
model.get_backup_path() + "/lock.txt",
boost::lexical_cast<std::string>(get_current_pid()));
}
@ -1305,7 +1304,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
file_version = *m_bambuslicer_generator_version;
// save for restore
if (result && m_load_aux && !m_load_restore) {
boost::filesystem::save_string_file(model.get_backup_path() + "/origin.txt", filename);
save_string_file(model.get_backup_path() + "/origin.txt", filename);
}
if (m_load_restore && !result) // not clear failed backup data for later analyze
model.set_backup_path("detach");
@ -5544,7 +5543,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
return false;
}
if (!(store_params.strategy & SaveStrategy::Silence))
boost::filesystem::save_string_file(store_params.model->get_backup_path() + "/origin.txt", filename);
save_string_file(store_params.model->get_backup_path() + "/origin.txt", filename);
}
return result;
}
@ -8287,7 +8286,7 @@ bool has_restore_data(std::string & path, std::string& origin)
}
if (boost::filesystem::exists(path + "/lock.txt")) {
std::string pid;
boost::filesystem::load_string_file(path + "/lock.txt", pid);
load_string_file(path + "/lock.txt", pid);
try {
if (get_process_name(boost::lexical_cast<int>(pid)) ==
get_process_name(0)) {
@ -8304,7 +8303,7 @@ bool has_restore_data(std::string & path, std::string& origin)
return false;
try {
if (boost::filesystem::exists(path + "/origin.txt"))
boost::filesystem::load_string_file(path + "/origin.txt", origin);
load_string_file(path + "/origin.txt", origin);
}
catch (...) {
}

View file

@ -5,6 +5,7 @@
#include "libslic3r/format.hpp"
#undef PI
#include <boost/next_prior.hpp>
// Include igl first. It defines "L" macro which then clashes with our localization
#include <igl/copyleft/cgal/mesh_boolean.h>
#undef L

View file

@ -38,7 +38,6 @@
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/string_file.hpp>
#include <boost/log/trivial.hpp>
#include <boost/nowide/iostream.hpp>
@ -873,7 +872,7 @@ std::string Model::get_backup_path()
BOOST_LOG_TRIVIAL(info) << "create /Metadata in " << temp_path;
boost::filesystem::create_directories(backup_path + "/Metadata");
BOOST_LOG_TRIVIAL(info) << "create /lock.txt in " << temp_path;
boost::filesystem::save_string_file(backup_path + "/lock.txt",
save_string_file(backup_path + "/lock.txt",
boost::lexical_cast<std::string>(get_current_pid()));
}
} catch (std::exception &ex) {

View file

@ -4,6 +4,7 @@
///|/
#include "Triangulation.hpp"
#include "IntersectionPoints.hpp"
#include <boost/next_prior.hpp>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>

View file

@ -650,6 +650,9 @@ inline std::string filter_characters(const std::string& str, const std::string&
void copy_directory_recursively(const boost::filesystem::path &source, const boost::filesystem::path &target);
// Orca: Since 1.7.9 Boost deprecated save_string_file and load_string_file, copy and modified from boost 1.7.8
void save_string_file(const boost::filesystem::path& p, const std::string& str);
void load_string_file(const boost::filesystem::path& p, std::string& str);
} // namespace Slic3r

View file

@ -1527,4 +1527,22 @@ void copy_directory_recursively(const boost::filesystem::path &source, const boo
return;
}
void save_string_file(const boost::filesystem::path& p, const std::string& str)
{
boost::nowide::ofstream file;
file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
file.open(p.generic_string(), std::ios_base::binary);
file.write(str.c_str(), str.size());
}
void load_string_file(const boost::filesystem::path& p, std::string& str)
{
boost::nowide::ifstream file;
file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
file.open(p.generic_string(), std::ios_base::binary);
std::size_t sz = static_cast<std::size_t>(boost::filesystem::file_size(p));
str.resize(sz, '\0');
file.read(&str[0], sz);
}
}; // namespace Slic3r