]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
__str__ for meshes
authorageay <ageay>
Wed, 27 Mar 2013 15:26:53 +0000 (15:26 +0000)
committerageay <ageay>
Wed, 27 Mar 2013 15:26:53 +0000 (15:26 +0000)
src/MEDCoupling/MEDCouplingCMesh.hxx
src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx
src/MEDCoupling/MEDCouplingExtrudedMesh.hxx
src/MEDCoupling_Swig/MEDCouplingCommon.i

index 69cd72036c0015022474e6daff19b43ec8317acd..9abfddb73553f6256ae0a05f1b859868e8da04ba 100644 (file)
@@ -85,12 +85,12 @@ namespace ParaMEDMEM
     void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
     void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                          const std::vector<std::string>& littleStrings);
+    void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception);
   private:
     MEDCouplingCMesh();
     MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCpy);
     ~MEDCouplingCMesh();
     void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception);
-    void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception);
     std::string getVTKDataSetType() const throw(INTERP_KERNEL::Exception);
   private:
     DataArrayDouble *_x_array;
index 53f04731a6ec1cbefb632e2f92bba18b3aeafd3c..ced4e7c5a1279a35ab773ab2740210ca96af8ebc 100644 (file)
@@ -86,6 +86,7 @@ namespace ParaMEDMEM
     void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
     void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                          const std::vector<std::string>& littleStrings);
+    void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception);
   private:
     void getMeasureFieldMeshDim1(bool isAbs, MEDCouplingFieldDouble *field) const throw(INTERP_KERNEL::Exception);
     void getMeasureFieldMeshDim2(bool isAbs, MEDCouplingFieldDouble *field) const throw(INTERP_KERNEL::Exception);
@@ -98,7 +99,6 @@ namespace ParaMEDMEM
     MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCpy);
     ~MEDCouplingCurveLinearMesh();
     void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception);
-    void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception);
     std::string getVTKDataSetType() const throw(INTERP_KERNEL::Exception);
   private:
     MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> _coords;
index b2ae506c9ab98fae62fe56c70aefd27ce02fe235..265cc3e83e3d825dff9ab7e136ada718fcc7ed10 100644 (file)
@@ -100,6 +100,7 @@ namespace ParaMEDMEM
     void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
     void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                          const std::vector<std::string>& littleStrings);
+    void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception);
   private:
     MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
     MEDCouplingExtrudedMesh(const MEDCouplingExtrudedMesh& other, bool deepCopy);
@@ -116,7 +117,6 @@ namespace ParaMEDMEM
     void computeBaryCenterOfFace(const std::vector<int>& nodalConnec, int lev1DId);
     ~MEDCouplingExtrudedMesh();
     void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception);
-    void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception);
     std::string getVTKDataSetType() const throw(INTERP_KERNEL::Exception);
   private:
     MEDCouplingUMesh *_mesh2D;
index ea78518155b63ad2b1e3b67805178791f5a0d22f..a867c1268f020d113c076b7a5f22dbb492f1cb7a 100644 (file)
@@ -2519,6 +2519,13 @@ namespace ParaMEDMEM
         return self->simpleRepr();
       }
       
+      std::string __repr__() const throw(INTERP_KERNEL::Exception)
+      {
+        std::ostringstream oss;
+        self->reprQuickOverview(oss);
+        return oss.str();
+      }
+      
       MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
       {
         return self->cellIterator();
@@ -3540,6 +3547,14 @@ namespace ParaMEDMEM
       {
         return self->simpleRepr();
       }
+
+      std::string __repr__() const throw(INTERP_KERNEL::Exception)
+      {
+        std::ostringstream oss;
+        self->reprQuickOverview(oss);
+        return oss.str();
+      }
+      
       PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
       {
         MEDCouplingUMesh *ret=self->getMesh2D();
@@ -3595,6 +3610,12 @@ namespace ParaMEDMEM
       {
         return self->simpleRepr();
       }
+      std::string __repr__() const throw(INTERP_KERNEL::Exception)
+      {
+        std::ostringstream oss;
+        self->reprQuickOverview(oss);
+        return oss.str();
+      }
       DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
       {
         DataArrayDouble *ret=self->getCoordsAt(i);
@@ -3626,6 +3647,12 @@ namespace ParaMEDMEM
       {
         return self->simpleRepr();
       }
+      std::string __repr__() const throw(INTERP_KERNEL::Exception)
+      {
+        std::ostringstream oss;
+        self->reprQuickOverview(oss);
+        return oss.str();
+      }
       DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
       {
         DataArrayDouble *ret=self->getCoords();