Salome HOME
getHeapMemorySize rearch
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
index 1d7434b7c8864670bc339912fb4d505c24ad6773..4d746d201e4eade79e45050541ec03202e2acf6a 100644 (file)
@@ -558,17 +558,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();
   };
 }
 
@@ -611,10 +635,11 @@ namespace ParaMEDMEM
   typedef enum
     {
       UNSTRUCTURED = 5,
-      UNSTRUCTURED_DESC = 6,
       CARTESIAN = 7,
       EXTRUDED = 8,
-      CURVE_LINEAR = 9
+      CURVE_LINEAR = 9,
+      SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
+      SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11
     } MEDCouplingMeshType;
 
   class DataArrayInt;
@@ -685,7 +710,7 @@ namespace ParaMEDMEM
     virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
-    void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
+    void writeVTK(const char *fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
     // tools
     virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
     virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
@@ -3348,7 +3373,7 @@ namespace ParaMEDMEM
     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
-    void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
+    void writeVTK(const char *fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
     MEDCouplingFieldDouble *deepCpy() const;
@@ -4416,11 +4441,11 @@ namespace ParaMEDMEM
         return MEDCouplingFieldDouble::MergeFields(tmp);
       }
 
-      static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
+      static void WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
       {
         std::vector<const MEDCouplingFieldDouble *> tmp;
         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
-        MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
+        MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
       }
     }
   };