Salome HOME
Fix: getCellsContainingPoints() in case of polyhedron with a face containing colinear...
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
index 1793504a52499ce337150f8dadaac754ad6f67d5..7343254f6f09547ac64940aa593495b6f13401a3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2022  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -73,7 +73,7 @@ using namespace INTERP_KERNEL;
 typedef int mcIdType;
 typedef DataArrayInt32 DataArrayIdType;
 %template(ivec) std::vector<int>;
-%template(i64vec) std::vector<long>;
+%template(i64vec) std::vector<int64_t>;
 #else
 //typedef std::int64_t mcIdType;
 typedef DataArrayInt64 DataArrayIdType;
@@ -680,6 +680,14 @@ namespace MEDCoupling
       std::ostringstream oss; oss << "C++ Pointer address is : " << self;
       return oss.str();
     }
+
+    // Hack to allow retrieving of underlying C++ pointer whatever the situation
+    // This allows for example to mix different types of Python binding (SWIG and PyBind for example)
+    long long getHiddenCppPointerAsLongLong() const
+    {
+      return (long long) self;
+    }
+
   }
 
   %extend MEDCouplingGaussLocalization
@@ -1289,7 +1297,7 @@ namespace MEDCoupling
     const std::vector<double>& getGaussCoords() const;
     double getGaussCoord(int gaussPtIdInCell, int comp) const;
     const std::vector<double>& getWeights() const;
-    double getWeight(int gaussPtIdInCell, double newVal) const;
+    double getWeight(int gaussPtIdInCell) const;
     void setRefCoord(int ptIdInCell, int comp, double newVal);
     void setGaussCoord(int gaussPtIdInCell, int comp, double newVal);
     void setWeight(int gaussPtIdInCell, double newVal);
@@ -2734,6 +2742,19 @@ namespace MEDCoupling
         return ret;
       }
 
+      PyObject *explodeMeshTo(int targetDeltaLevel) const
+      {
+        MCAuto<DataArrayIdType> desc,descIndx,revDesc,revDescIndx;
+        MCAuto<MEDCouplingUMesh> m=self->explodeMeshTo(targetDeltaLevel,desc,descIndx,revDesc,revDescIndx);
+        PyObject *ret=PyTuple_New(5);
+        PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+        PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+        PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+        PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+        PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
+        return ret;
+      }
+
       PyObject *explodeIntoEdges() const
       {
         MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
@@ -3047,6 +3068,7 @@ namespace MEDCoupling
     void convertExtrudedPolyhedra();
     bool unPolyze();
     void simplifyPolyhedra(double eps);
+    void colinearizeEdges(double eps);
     MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
     MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
   };