diff --git a/libsrc/csg/vscsg.cpp b/libsrc/csg/vscsg.cpp index a369eb37..b7c2b521 100644 --- a/libsrc/csg/vscsg.cpp +++ b/libsrc/csg/vscsg.cpp @@ -489,66 +489,16 @@ namespace netgen - - - - - - - - -////////////////////////////////////////////////////////////////////// -// Lambda to function pointer conversion -template -struct function_traits - : public function_traits {}; - -template -struct function_traits { - typedef ReturnType (*pointer)(Args...); - typedef ReturnType return_type; -}; - -template -typename function_traits::pointer -FunctionPointer (const Function& lambda) { - return static_cast::pointer>(lambda); -} - -template -inline string ToString (const T& t) -{ - stringstream ss; - ss << t; - return ss.str(); -} - - - - - #ifdef NG_PYTHON #include +#include <../general/ngpython.hpp> namespace bp = boost::python; void ExportCSGVis() { - - std::string nested_name = "csgvis"; - if (bp::scope()) - nested_name = bp::extract(bp::scope().attr("__name__") + ".csgvis"); - - bp::object module(bp::handle<>(bp::borrowed(PyImport_AddModule(nested_name.c_str())))); - - cout << "exporting csgvis " << nested_name << endl; - bp::object parent = bp::scope() ? bp::scope() : bp::import("__main__"); - parent.attr("csgvis") = module; - - bp::scope local_scope(module); - using namespace netgen; - cout << "exporting csg-vis " << endl; + ModuleScope module("csgvis"); bp::class_> ("VisualSceneGeometry", bp::no_init)