mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-01 21:21:10 -06:00
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:
parent
1ea33f0919
commit
9d59cd66c4
16 changed files with 67 additions and 227 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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 (...) {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include "MsgDialog.hpp"
|
||||
#include "DownloadProgressDialog.hpp"
|
||||
|
||||
#include <boost/filesystem/string_file.hpp>
|
||||
#include <boost/nowide/utf8_codecvt.hpp>
|
||||
#undef pid_t
|
||||
#include <boost/process.hpp>
|
||||
|
|
@ -596,7 +595,7 @@ bool MediaPlayCtrl::start_stream_service(bool *need_install)
|
|||
file_url2 = wxURI(file_url2).BuildURI();
|
||||
try {
|
||||
std::string configs;
|
||||
boost::filesystem::load_string_file(file_ff_cfg, configs);
|
||||
load_string_file(file_ff_cfg, configs);
|
||||
std::vector<std::string> configss;
|
||||
boost::algorithm::split(configss, configs, boost::algorithm::is_any_of("\r\n"));
|
||||
configss.erase(std::remove(configss.begin(), configss.end(), std::string()), configss.end());
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include <boost/format.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/string_file.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
|
@ -819,9 +818,9 @@ void PresetUpdater::priv::sync_tooltip(std::string http_url, std::string languag
|
|||
fs::path cache_root = fs::path(data_dir()) / "resources/tooltip";
|
||||
try {
|
||||
auto vf = cache_root / "common" / "version";
|
||||
if (fs::exists(vf)) fs::load_string_file(vf, common_version);
|
||||
if (fs::exists(vf)) load_string_file(vf, common_version);
|
||||
vf = cache_root / language / "version";
|
||||
if (fs::exists(vf)) fs::load_string_file(vf, language_version);
|
||||
if (fs::exists(vf)) load_string_file(vf, language_version);
|
||||
} catch (...) {}
|
||||
std::map<std::string, Resource> resources
|
||||
{
|
||||
|
|
@ -997,11 +996,11 @@ void PresetUpdater::priv::sync_printer_config(std::string http_url)
|
|||
auto cache_folder = data_dir_path / "ota" / "printers";
|
||||
|
||||
try {
|
||||
boost::filesystem::load_string_file(config_folder / "version.txt", curr_version);
|
||||
load_string_file(config_folder / "version.txt", curr_version);
|
||||
boost::algorithm::trim(curr_version);
|
||||
} catch (...) {}
|
||||
try {
|
||||
boost::filesystem::load_string_file(cache_folder / "version.txt", cached_version);
|
||||
load_string_file(cache_folder / "version.txt", cached_version);
|
||||
boost::algorithm::trim(cached_version);
|
||||
} catch (...) {}
|
||||
if (!cached_version.empty()) {
|
||||
|
|
@ -1035,7 +1034,7 @@ void PresetUpdater::priv::sync_printer_config(std::string http_url)
|
|||
|
||||
bool result = false;
|
||||
try {
|
||||
boost::filesystem::load_string_file(cache_folder / "version.txt", cached_version);
|
||||
load_string_file(cache_folder / "version.txt", cached_version);
|
||||
boost::algorithm::trim(cached_version);
|
||||
result = true;
|
||||
} catch (...) {}
|
||||
|
|
@ -1154,11 +1153,11 @@ Updates PresetUpdater::priv::get_printer_config_updates(bool update) const
|
|||
std::string curr_version;
|
||||
std::string resc_version;
|
||||
try {
|
||||
boost::filesystem::load_string_file(resc_folder / "version.txt", resc_version);
|
||||
load_string_file(resc_folder / "version.txt", resc_version);
|
||||
boost::algorithm::trim(resc_version);
|
||||
} catch (...) {}
|
||||
try {
|
||||
boost::filesystem::load_string_file(config_folder / "version.txt", curr_version);
|
||||
load_string_file(config_folder / "version.txt", curr_version);
|
||||
boost::algorithm::trim(curr_version);
|
||||
} catch (...) {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue