From: ageay Date: Tue, 24 Sep 2013 10:06:15 +0000 (+0000) Subject: End of reorganization of MEDCoupling wrapper for Renumber X-Git-Tag: V7_3_0a1~121 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9e44591bcf3be8ad8bd27289ba84e750a274fb38;p=modules%2Fmed.git End of reorganization of MEDCoupling wrapper for Renumber --- diff --git a/src/RENUMBER_Swig/CMakeLists.txt b/src/RENUMBER_Swig/CMakeLists.txt index 70d49b650..a879a874c 100644 --- a/src/RENUMBER_Swig/CMakeLists.txt +++ b/src/RENUMBER_Swig/CMakeLists.txt @@ -29,6 +29,14 @@ ELSE(NUMPY_FOUND) SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DWITHOUT_AUTOFIELD) ENDIF(NUMPY_FOUND) +IF(Boost_FOUND) + SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_BOOST ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS}) +ENDIF(Boost_FOUND) + +IF(METIS_FOUND) + SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_METIS ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS}) +ENDIF(METIS_FOUND) + SET (MEDRenumber_SWIG_DPYS_FILES MEDRenumberCommon.i) diff --git a/src/RENUMBER_Swig/MEDRenumberCommon.i b/src/RENUMBER_Swig/MEDRenumberCommon.i index b099f70b6..81814916c 100644 --- a/src/RENUMBER_Swig/MEDRenumberCommon.i +++ b/src/RENUMBER_Swig/MEDRenumberCommon.i @@ -83,6 +83,21 @@ namespace MED_RENUMBER Renumbering *RenumberingFactory(const std::string& s) throw(INTERP_KERNEL::Exception); } +%inline +{ + std::vector RenumberAvailableMethods()throw(INTERP_KERNEL::Exception) + { + std::vector ret; +#ifdef HAS_BOOST + ret.push_back(std::string("BOOST")); +#endif +#ifdef HAS_METIS + ret.push_back(std::string("METIS")); +#endif + return ret; + } +} + %pythoncode %{ import os __filename=os.environ.get('PYTHONSTARTUP') diff --git a/src/RENUMBER_Swig/MEDRenumberTest.py b/src/RENUMBER_Swig/MEDRenumberTest.py index 1539adf61..b0d9c41a3 100644 --- a/src/RENUMBER_Swig/MEDRenumberTest.py +++ b/src/RENUMBER_Swig/MEDRenumberTest.py @@ -2,6 +2,8 @@ from MEDRenumber import * import unittest class MEDRenumberTest(unittest.TestCase): + + @unittest.skipUnless("BOOST" in RenumberAvailableMethods(),"requires BOOST prerequisite !") def test1(self): from MEDCoupling import MEDCouplingCMesh ren=RenumberingFactory("BOOST")