From 35be0eefef1a73cc2a909afa4fe9d30256c7b9e2 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Sat, 18 Mar 2017 11:44:06 -0500 Subject: [PATCH] Remove boost references from Config.hpp (this does not work on Windows!) --- xs/src/libslic3r/Config.cpp | 24 ++++++++++++++++++++++++ xs/src/libslic3r/Config.hpp | 25 +------------------------ xs/src/libslic3r/PrintConfig.cpp | 1 + 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/xs/src/libslic3r/Config.cpp b/xs/src/libslic3r/Config.cpp index 9901282ff..2937f7d64 100644 --- a/xs/src/libslic3r/Config.cpp +++ b/xs/src/libslic3r/Config.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -682,4 +683,27 @@ ConfigOptionPoint3::deserialize(std::string str, bool append) { return true; }; +bool +ConfigOptionPoints::deserialize(std::string str, bool append) { + if (!append) this->values.clear(); + + std::vector tokens; + boost::split(tokens, str, boost::is_any_of("x,")); + if (tokens.size() % 2) return false; + + try { + for (size_t i = 0; i < tokens.size(); ++i) { + Pointf point; + point.x = boost::lexical_cast(tokens[i]); + point.y = boost::lexical_cast(tokens[++i]); + this->values.push_back(point); + } + } catch (boost::bad_lexical_cast &e) { + printf("%s\n", e.what()); + return false; + } + + return true; +} + } diff --git a/xs/src/libslic3r/Config.hpp b/xs/src/libslic3r/Config.hpp index 412c65fd3..127efa06d 100644 --- a/xs/src/libslic3r/Config.hpp +++ b/xs/src/libslic3r/Config.hpp @@ -12,9 +12,6 @@ #include #include "libslic3r.h" #include "Point.hpp" -#include -#include -#include namespace Slic3r { @@ -394,27 +391,7 @@ class ConfigOptionPoints : public ConfigOptionVector return vv; }; - bool deserialize(std::string str, bool append = false) { - if (!append) this->values.clear(); - - std::vector tokens; - boost::split(tokens, str, boost::is_any_of("x,")); - if (tokens.size() % 2) return false; - - try { - for (size_t i = 0; i < tokens.size(); ++i) { - Pointf point; - point.x = boost::lexical_cast(tokens[i]); - point.y = boost::lexical_cast(tokens[++i]); - this->values.push_back(point); - } - } catch (boost::bad_lexical_cast &e) { - printf("%s\n", e.what()); - return false; - } - - return true; - }; + bool deserialize(std::string str, bool append = false); }; class ConfigOptionBool : public ConfigOptionSingle diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 5a932bde7..c1b5870f9 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -1,5 +1,6 @@ #include "PrintConfig.hpp" #include +#include #include namespace Slic3r {