mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 19:46:29 +08:00
Merge branch 'master' into adaptive-slicing
This commit is contained in:
commit
232369b2af
@ -10,6 +10,8 @@
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/property_tree/ini_parser.hpp>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#if defined(_WIN32) && !defined(setenv) && defined(_putenv_s)
|
||||
#define setenv(k, v, o) _putenv_s(k, v)
|
||||
@ -406,4 +408,33 @@ StaticConfig::keys() const {
|
||||
return keys;
|
||||
}
|
||||
|
||||
bool
|
||||
ConfigOptionPoint::deserialize(std::string str, bool append) {
|
||||
std::vector<std::string> tokens(2);
|
||||
boost::split(tokens, str, boost::is_any_of(",x"));
|
||||
try {
|
||||
this->value.x = boost::lexical_cast<coordf_t>(tokens[0]);
|
||||
this->value.y = boost::lexical_cast<coordf_t>(tokens[1]);
|
||||
} catch (boost::bad_lexical_cast &e){
|
||||
std::cout << "Exception caught : " << e.what() << std::endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
bool
|
||||
ConfigOptionPoint3::deserialize(std::string str, bool append) {
|
||||
std::vector<std::string> tokens(3);
|
||||
boost::split(tokens, str, boost::is_any_of(",x"));
|
||||
try {
|
||||
this->value.x = boost::lexical_cast<coordf_t>(tokens[0]);
|
||||
this->value.y = boost::lexical_cast<coordf_t>(tokens[1]);
|
||||
this->value.z = boost::lexical_cast<coordf_t>(tokens[2]);
|
||||
} catch (boost::bad_lexical_cast &e){
|
||||
std::cout << "Exception caught : " << e.what() << std::endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -10,8 +10,6 @@
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "libslic3r.h"
|
||||
#include "Point.hpp"
|
||||
|
||||
@ -353,18 +351,7 @@ class ConfigOptionPoint : public ConfigOptionSingle<Pointf>
|
||||
return ss.str();
|
||||
};
|
||||
|
||||
bool deserialize(std::string str, bool append = false) {
|
||||
std::vector<std::string> tokens(2);
|
||||
boost::split(tokens, str, boost::is_any_of(",x"));
|
||||
try {
|
||||
this->value.x = boost::lexical_cast<coordf_t>(tokens[0]);
|
||||
this->value.y = boost::lexical_cast<coordf_t>(tokens[1]);
|
||||
} catch (boost::bad_lexical_cast &e){
|
||||
std::cout << "Exception caught : " << e.what() << std::endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
bool deserialize(std::string str, bool append = false);
|
||||
};
|
||||
|
||||
class ConfigOptionPoint3 : public ConfigOptionSingle<Pointf3>
|
||||
@ -384,19 +371,7 @@ class ConfigOptionPoint3 : public ConfigOptionSingle<Pointf3>
|
||||
return ss.str();
|
||||
};
|
||||
|
||||
bool deserialize(std::string str, bool append = false) {
|
||||
std::vector<std::string> tokens(3);
|
||||
boost::split(tokens, str, boost::is_any_of(",x"));
|
||||
try {
|
||||
this->value.x = boost::lexical_cast<coordf_t>(tokens[0]);
|
||||
this->value.y = boost::lexical_cast<coordf_t>(tokens[1]);
|
||||
this->value.z = boost::lexical_cast<coordf_t>(tokens[2]);
|
||||
} catch (boost::bad_lexical_cast &e){
|
||||
std::cout << "Exception caught : " << e.what() << std::endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
bool deserialize(std::string str, bool append = false);
|
||||
|
||||
bool is_positive_volume () {
|
||||
return this->value.x > 0 && this->value.y > 0 && this->value.z > 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user