Salome HOME
Added option MEDCOUPLING_BUILD_STATIC to build static libs.
[tools/medcoupling.git] / src / RENUMBER_Swig / MEDRenumberCommon.i
index b099f70b618fb7421056cf1e6caec743520feac5..1c2e20ef5ad9de84f534fa3e0789b0a82ee29f51 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 %{
 #include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
 #include "MEDCouplingDataArrayTypemaps.i"
 
 #include "RenumberingFactory.hxx"
 #include "RENUMBER_Renumbering.hxx"
 
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
 using namespace INTERP_KERNEL;
  using namespace MED_RENUMBER;
 %}
@@ -61,17 +61,17 @@ class Renumbering
 public:
   %extend
   {
-    virtual PyObject *renumber(const ParaMEDMEM::DataArrayInt *graph, const ParaMEDMEM::DataArrayInt *index_graph) throw(INTERP_KERNEL::Exception)
+    virtual PyObject *renumber(const MEDCoupling::DataArrayInt *graph, const MEDCoupling::DataArrayInt *index_graph) throw(INTERP_KERNEL::Exception)
     {
       if(!graph || !index_graph)
         throw INTERP_KERNEL::Exception("wrap of Renumbering::renumber : One of the input arrays is NULL !");
       if(!graph->isAllocated() || !index_graph->isAllocated())
         throw INTERP_KERNEL::Exception("wrap of Renumbering::renumber : One of the input arrays is not allocated !");
-      ParaMEDMEM::DataArrayInt *out0(0),*out1(0);
+      MEDCoupling::DataArrayInt *out0(0),*out1(0);
       self->renumber(graph->begin(),index_graph->begin(),index_graph->getNumberOfTuples()-1,out0,out1);
       PyObject *ret=PyTuple_New(2);
-      PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(out0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
-      PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(out1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+      PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(out0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+      PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(out1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
       return ret;
     }
   }
@@ -83,6 +83,21 @@ namespace MED_RENUMBER
   Renumbering *RenumberingFactory(const std::string& s) throw(INTERP_KERNEL::Exception);
 }
 
+%inline
+{
+  std::vector<std::string> RenumberAvailableMethods()throw(INTERP_KERNEL::Exception)
+  {
+    std::vector<std::string> 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')