Salome HOME
MEDCouplingFieldDouble::nodeToCellDiscretization
[modules/med.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
index c8339a20163f3fe276f6b02db766dafec3a6d52d..5f62bec585d63fa041f10eb6d4748cb67fe49416 100644 (file)
@@ -207,6 +207,7 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
+%newobject ParaMEDMEM::MEDCouplingFieldDouble::nodeToCellDiscretization;
 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
 %newobject ParaMEDMEM::DataArray::deepCpy;
@@ -558,17 +559,41 @@ namespace ParaMEDMEM
   bool MEDCouplingByteOrder();
   const char *MEDCouplingByteOrderStr();
 
-  class RefCountObject
+  class BigMemoryObject
+  {
+  public:
+    std::size_t getHeapMemorySize() const;
+    std::string getHeapMemorySizeStr() const;
+    virtual std::size_t getHeapMemorySizeWithoutChildren() const;
+    virtual ~BigMemoryObject();
+    %extend
+    {
+      virtual PyObject *getDirectChildren() const
+      {
+        std::vector<const BigMemoryObject *> c(self->getDirectChildren());
+        PyObject *ret(PyList_New(c.size()));
+        for(std::size_t i=0;i<c.size();i++)
+          PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(c[i]),SWIGTYPE_p_ParaMEDMEM__BigMemoryObject, 0 | 0 ));
+        return ret;
+      }
+    }
+  };
+  
+  class RefCountObjectOnly
   {
-  protected:
-    RefCountObject();
-    RefCountObject(const RefCountObject& other);
-    ~RefCountObject();
   public:
     bool decrRef() const;
     void incrRef() const;
     int getRCValue() const;
-    virtual std::size_t getHeapMemorySize() const;
+    RefCountObjectOnly& operator=(const RefCountObjectOnly& other);
+  protected:
+    ~RefCountObjectOnly();
+  };
+
+  class RefCountObject : public RefCountObjectOnly, public BigMemoryObject
+  {
+  protected:
+    ~RefCountObject();
   };
 }
 
@@ -1090,9 +1115,22 @@ namespace ParaMEDMEM
 
 //== MEDCouplingMesh End
 
-%include "NormalizedUnstructuredMesh.hxx"
-%include "MEDCouplingNatureOfField.hxx"
-%include "MEDCouplingTimeDiscretization.hxx"
+%include "NormalizedGeometricTypes"
+%include "MEDCouplingNatureOfFieldEnum"
+//
+namespace ParaMEDMEM
+{
+  class MEDCouplingNatureOfField
+  {
+  public:
+    static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
+    static std::string GetReprNoThrow(NatureOfField nat);
+    static std::string GetAllPossibilitiesStr();
+  };
+}
+
+// the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
+// include "MEDCouplingTimeDiscretization.i"
 
 namespace ParaMEDMEM
 {
@@ -3354,6 +3392,7 @@ namespace ParaMEDMEM
     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
     MEDCouplingFieldDouble *deepCpy() const;
     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
+    MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);