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>
|
2021-02-18 15:37:05 +05:00
|
|
|
#include <core/ngcore_api.hpp>
|
2015-01-23 15:14:42 +05:00
|
|
|
|
2021-02-18 15:37:05 +05:00
|
|
|
void NGCORE_API_IMPORT ExportNetgenMeshing(py::module &m);
|
|
|
|
void NGCORE_API_IMPORT ExportMeshVis(py::module &m);
|
|
|
|
void NGCORE_API_IMPORT ExportCSG(py::module &m);
|
|
|
|
void NGCORE_API_IMPORT ExportCSGVis(py::module &m);
|
|
|
|
void NGCORE_API_IMPORT ExportGeom2d(py::module &m);
|
|
|
|
void NGCORE_API_IMPORT ExportSTL(py::module &m);
|
|
|
|
void NGCORE_API_IMPORT ExportSTLVis(py::module &m);
|
2017-05-31 22:57:42 +05:00
|
|
|
#ifdef OCCGEOMETRY
|
2021-02-18 15:37:05 +05:00
|
|
|
void NGCORE_API_IMPORT ExportNgOCC(py::module &m);
|
2017-05-31 22:57:42 +05:00
|
|
|
#endif // OCCGEOMETRY
|
2019-12-06 17:48:00 +05:00
|
|
|
namespace netgen
|
|
|
|
{
|
2021-02-18 15:37:05 +05:00
|
|
|
std::vector<unsigned char> NGCORE_API_IMPORT Snapshot( int w, int h );
|
2019-12-06 17:48:00 +05:00
|
|
|
}
|
2015-10-20 14:09:29 +05:00
|
|
|
|
2017-09-01 12:33:57 +05:00
|
|
|
PYBIND11_MODULE(libngpy, ngpy)
|
2015-01-23 15:14:42 +05:00
|
|
|
{
|
2019-08-06 20:57:59 +05:00
|
|
|
py::module::import("pyngcore");
|
2016-11-04 16:14:52 +05:00
|
|
|
py::module meshing = ngpy.def_submodule("_meshing", "pybind meshing module");
|
|
|
|
ExportNetgenMeshing(meshing);
|
2017-01-05 09:08:24 +05:00
|
|
|
py::module csg = ngpy.def_submodule("_csg", "pybind csg module");
|
|
|
|
ExportCSG(csg);
|
2016-11-04 16:14:52 +05:00
|
|
|
py::module geom2d = ngpy.def_submodule("_geom2d", "pybind geom2d module");
|
|
|
|
ExportGeom2d(geom2d);
|
2016-12-12 14:47:05 +05:00
|
|
|
py::module stl = ngpy.def_submodule("_stl", "pybind stl module");
|
|
|
|
ExportSTL(stl);
|
2017-05-31 22:57:42 +05:00
|
|
|
#ifdef OCCGEOMETRY
|
2017-05-31 22:38:17 +05:00
|
|
|
py::module NgOCC = ngpy.def_submodule("_NgOCC", "pybind NgOCC module");
|
|
|
|
ExportNgOCC(NgOCC);
|
2017-05-31 22:57:42 +05:00
|
|
|
#endif // OCCGEOMETRY
|
2017-01-31 19:35:56 +05:00
|
|
|
#ifdef OPENGL
|
|
|
|
py::module meshvis = ngpy.def_submodule("meshvis", "pybind meshvis module");
|
|
|
|
ExportMeshVis(meshvis);
|
|
|
|
py::module csgvis = ngpy.def_submodule("csgvis", "pybind csgvis module");
|
|
|
|
ExportCSGVis(csgvis);
|
2016-12-12 17:14:47 +05:00
|
|
|
py::module stlvis = ngpy.def_submodule("stlvis", "pybind stlvis module");
|
|
|
|
ExportSTLVis(stlvis);
|
2019-12-06 17:48:00 +05:00
|
|
|
ngpy.def("Snapshot", netgen::Snapshot);
|
2017-01-31 19:35:56 +05:00
|
|
|
#endif // OPENGL
|
2015-01-26 18:49:46 +05:00
|
|
|
}
|
|
|
|
|
2016-08-09 17:03:47 +05:00
|
|
|
// Force linking libnglib to libnetgenpy
|
|
|
|
namespace netgen
|
|
|
|
{
|
|
|
|
void MyBeep (int i);
|
|
|
|
void MyDummyToForceLinkingNGLib()
|
|
|
|
{
|
|
|
|
MyBeep(0);
|
|
|
|
}
|
|
|
|
}
|