mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-28 22:00:33 +05:00
windows fixes
This commit is contained in:
parent
f89060e260
commit
ffd9f56292
@ -530,8 +530,21 @@ inline string ToString (const T& t)
|
|||||||
#include <boost/python.hpp>
|
#include <boost/python.hpp>
|
||||||
namespace bp = boost::python;
|
namespace bp = boost::python;
|
||||||
|
|
||||||
BOOST_PYTHON_MODULE(libcsgvis)
|
void ExportCSGVis()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
std::string nested_name = "csgvis";
|
||||||
|
if (bp::scope())
|
||||||
|
nested_name = bp::extract<std::string>(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;
|
using namespace netgen;
|
||||||
|
|
||||||
cout << "exporting csg-vis " << endl;
|
cout << "exporting csg-vis " << endl;
|
||||||
@ -557,7 +570,10 @@ BOOST_PYTHON_MODULE(libcsgvis)
|
|||||||
{
|
{
|
||||||
vsgeom.MouseMove(oldx, oldy, newx, newy, mode);
|
vsgeom.MouseMove(oldx, oldy, newx, newy, mode);
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
|
BOOST_PYTHON_MODULE(libcsgvis)
|
||||||
|
{
|
||||||
|
ExportCSGVis();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user