mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 02:49:12 +00:00
Drastic settings refactoring
This commit is contained in:
@@ -185,4 +185,20 @@
|
||||
}
|
||||
return pyobj;
|
||||
}
|
||||
|
||||
struct pythonizing_visitor {
|
||||
typedef PyObject* result_type;
|
||||
|
||||
template <typename T>
|
||||
PyObject* operator()(const T& t) {
|
||||
return pythonize(t);
|
||||
}
|
||||
|
||||
template <>
|
||||
PyObject* operator()(const std::set<int>& t) {
|
||||
std::vector<int> vs(t.begin(), t.end());
|
||||
return pythonize_vector(vs);
|
||||
}
|
||||
};
|
||||
|
||||
%}
|
||||
|
||||
@@ -147,3 +147,8 @@ CREATE_VECTOR_TYPEMAP_OUT(IfcParse::inverse_attribute const *)
|
||||
CREATE_VECTOR_TYPEMAP_OUT(IfcParse::entity const *)
|
||||
CREATE_VECTOR_TYPEMAP_OUT(IfcParse::declaration const *)
|
||||
CREATE_VECTOR_TYPEMAP_OUT(IfcGeom::ConversionResultShape *)
|
||||
|
||||
%typemap(out) boost::variant<bool, int, double, std::string, std::set<int>> {
|
||||
pythonizing_visitor vis;
|
||||
$result = $1.apply_visitor(vis);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user