mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
Reintroduce --model-offset/-rotation MODEL_OFFSET/_ROTATION setting #5231
This commit is contained in:
@@ -1,37 +1,34 @@
|
||||
#include "ConversionSettings.h"
|
||||
|
||||
/*
|
||||
void ifcopenshell::geometry::ConversionSettings::setValue(GeomValue var, double value) {
|
||||
values_[var] = value;
|
||||
}
|
||||
|
||||
double ifcopenshell::geometry::ConversionSettings::getValue(GeomValue var) const {
|
||||
return values_[var];
|
||||
}
|
||||
*/
|
||||
|
||||
template <typename T>
|
||||
void istream_helper(std::istream& in, std::set<T>& ints) {
|
||||
void istream_helper(std::istream& in, T& vs) {
|
||||
std::string tokens;
|
||||
in >> tokens;
|
||||
std::vector<std::string> strs;
|
||||
boost::split(strs, tokens, boost::is_any_of(","));
|
||||
for (auto& s : strs) {
|
||||
if constexpr (std::is_same_v<T, std::string>) {
|
||||
ints.insert(s);
|
||||
} else {
|
||||
ints.insert(boost::lexical_cast<T>(s));
|
||||
if constexpr (std::is_same_v<std::decay_t<T>, std::set<std::string>>) {
|
||||
vs.insert(s);
|
||||
} else if constexpr (std::is_same_v<std::decay_t<T>, std::set<int>>) {
|
||||
vs.insert(boost::lexical_cast<typename T::value_type>(s));
|
||||
} else if constexpr (std::is_same_v<std::decay_t<T>, std::vector<double>>) {
|
||||
vs.push_back(boost::lexical_cast<typename T::value_type>(s));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::istream& std::operator>>(istream& in, set<int>& ints) {
|
||||
istream_helper<int>(in, ints);
|
||||
istream_helper<std::set<int>>(in, ints);
|
||||
return in;
|
||||
}
|
||||
|
||||
std::istream& std::operator>>(istream& in, set<string>& strs) {
|
||||
istream_helper<std::string>(in, strs);
|
||||
istream_helper<std::set<std::string>>(in, strs);
|
||||
return in;
|
||||
}
|
||||
|
||||
std::istream& std::operator>>(istream& in, vector<double>& ds) {
|
||||
istream_helper<std::vector<double>>(in, ds);
|
||||
return in;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user