netgen/ng/netgenpy.cpp

44 lines
1.2 KiB
C++
Raw Normal View History

2015-01-27 20:56:32 +05:00
// a wrapper to load netgen-dll into python
2015-01-23 15:14:42 +05:00
#include <iostream>
2016-11-04 16:14:52 +05:00
#include <../general/ngpython.hpp>
2015-01-23 15:14:42 +05:00
2015-10-20 14:09:29 +05:00
#ifdef WIN32
#define DLL_HEADER __declspec(dllimport)
#else
#define DLL_HEADER
#endif
2015-01-23 15:14:42 +05:00
2015-10-20 14:09:29 +05:00
2016-11-04 16:14:52 +05:00
void DLL_HEADER ExportNetgenMeshing(py::module &m);
void DLL_HEADER ExportMeshVis(py::module &m);
void DLL_HEADER ExportCSG(py::module &m);
void DLL_HEADER ExportCSGVis(py::module &m);
void DLL_HEADER ExportGeom2d(py::module &m);
2015-10-20 14:09:29 +05:00
2016-11-04 16:14:52 +05:00
PYBIND11_PLUGIN(libngpy)
2015-01-23 15:14:42 +05:00
{
2016-11-04 16:14:52 +05:00
py::module ngpy("libngpy", "pybind netgen module");
py::module csg = ngpy.def_submodule("_csg", "pybind csg module");
ExportCSG(csg);
py::module csgvis = ngpy.def_submodule("csgvis", "pybind csgvis module");
ExportCSGVis(csgvis);
py::module meshing = ngpy.def_submodule("_meshing", "pybind meshing module");
ExportNetgenMeshing(meshing);
py::module meshvis = ngpy.def_submodule("meshvis", "pybind meshvis module");
ExportMeshVis(meshvis);
py::module geom2d = ngpy.def_submodule("_geom2d", "pybind geom2d module");
ExportGeom2d(geom2d);
return ngpy.ptr();
2015-01-26 18:49:46 +05:00
}
// Force linking libnglib to libnetgenpy
namespace netgen
{
void MyBeep (int i);
void MyDummyToForceLinkingNGLib()
{
MyBeep(0);
}
}