mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 10:59:17 +00:00
Support vector<string> setting types
This commit is contained in:
@@ -515,12 +515,16 @@ assign_matrix_access(revolve);
|
||||
void set_(const std::string& name, const std::set<int>& val) {
|
||||
return $self->set(name, val);
|
||||
}
|
||||
void set_(const std::string& name, const std::set<std::string>& val) {
|
||||
return $self->set(name, val);
|
||||
}
|
||||
void set_(const std::string& name, const std::vector<double>& val) {
|
||||
return $self->set(name, val);
|
||||
}
|
||||
void set_(const std::string& name, const std::vector<double>& val) {
|
||||
return $self->set(name, val);
|
||||
}
|
||||
void set_(const std::string& name, const std::vector<std::string>& val) {
|
||||
// Python sequences cannot distinguish std::vector<std::string> from std::set<std::string>.
|
||||
if ($self->get_type(name) == "std::set<std::string>") {
|
||||
return $self->set(name, std::set<std::string>(val.begin(), val.end()));
|
||||
}
|
||||
return $self->set(name, val);
|
||||
}
|
||||
ifcopenshell::geometry::Settings::value_variant_t get_(const std::string& name) {
|
||||
return $self->get(name);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@
|
||||
} else if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<T>>, std::set<std::string>>) {
|
||||
std::vector<std::string> vs(t.begin(), t.end());
|
||||
return pythonize_vector(vs);
|
||||
} else if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<T>>, std::vector<double>>) {
|
||||
} else if constexpr (is_std_vector_v<std::remove_cv_t<std::remove_reference_t<T>>>) {
|
||||
return pythonize_vector(t);
|
||||
} else {
|
||||
return pythonize(t);
|
||||
|
||||
Reference in New Issue
Block a user