mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-30 15:41:59 +08:00
Remove boost references from Config.hpp (this does not work on Windows!)
This commit is contained in:
parent
c773d407fd
commit
35be0eefef
@ -10,6 +10,7 @@
|
||||
#include <boost/algorithm/string/erase.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/property_tree/ini_parser.hpp>
|
||||
@ -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<std::string> 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<coordf_t>(tokens[i]);
|
||||
point.y = boost::lexical_cast<coordf_t>(tokens[++i]);
|
||||
this->values.push_back(point);
|
||||
}
|
||||
} catch (boost::bad_lexical_cast &e) {
|
||||
printf("%s\n", e.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,9 +12,6 @@
|
||||
#include <vector>
|
||||
#include "libslic3r.h"
|
||||
#include "Point.hpp"
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
@ -394,27 +391,7 @@ class ConfigOptionPoints : public ConfigOptionVector<Pointf>
|
||||
return vv;
|
||||
};
|
||||
|
||||
bool deserialize(std::string str, bool append = false) {
|
||||
if (!append) this->values.clear();
|
||||
|
||||
std::vector<std::string> 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<coordf_t>(tokens[i]);
|
||||
point.y = boost::lexical_cast<coordf_t>(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<bool>
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "PrintConfig.hpp"
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
namespace Slic3r {
|
||||
|
Loading…
x
Reference in New Issue
Block a user