From: ageay Date: Wed, 27 Mar 2013 15:15:27 +0000 (+0000) Subject: __str__ for meshes X-Git-Tag: V6_main_FINAL~228 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=007dd5305a41079cf2ccbcda2617897838a3c45d;p=tools%2Fmedcoupling.git __str__ for meshes --- diff --git a/src/MEDCoupling/MEDCouplingCMesh.cxx b/src/MEDCoupling/MEDCouplingCMesh.cxx index 1e2e0df00..3018af851 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCMesh.cxx @@ -773,6 +773,11 @@ void MEDCouplingCMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData ofs << " \n"; } +void MEDCouplingCMesh::reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) +{ + stream << "MEDCouplingCMesh C++ instance at " << this << "."; +} + std::string MEDCouplingCMesh::getVTKDataSetType() const throw(INTERP_KERNEL::Exception) { return std::string("RectilinearGrid"); diff --git a/src/MEDCoupling/MEDCouplingCMesh.hxx b/src/MEDCoupling/MEDCouplingCMesh.hxx index 368f9c335..69cd72036 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCMesh.hxx @@ -90,6 +90,7 @@ namespace ParaMEDMEM 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; diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx index eb98ac357..de3ad07df 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx @@ -878,6 +878,11 @@ void MEDCouplingCurveLinearMesh::writeVTKLL(std::ostream& ofs, const std::string ofs << " \n"; } +void MEDCouplingCurveLinearMesh::reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) +{ + stream << "MEDCouplingCurveLinearMesh C++ instance at " << this << "."; +} + std::string MEDCouplingCurveLinearMesh::getVTKDataSetType() const throw(INTERP_KERNEL::Exception) { return std::string("StructuredGrid"); diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx index 33de0cafc..53f04731a 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx @@ -98,6 +98,7 @@ 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 _coords; diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx index a513cbebe..10ccb010f 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx @@ -919,6 +919,11 @@ void MEDCouplingExtrudedMesh::writeVTKLL(std::ostream& ofs, const std::string& c m->writeVTKLL(ofs,cellData,pointData); } +void MEDCouplingExtrudedMesh::reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) +{ + stream << "MEDCouplingExtrudedMesh C++ instance at " << this << "."; +} + std::string MEDCouplingExtrudedMesh::getVTKDataSetType() const throw(INTERP_KERNEL::Exception) { return _mesh2D->getVTKDataSetType(); diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx index 572e82722..b2ae506c9 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx @@ -116,6 +116,7 @@ namespace ParaMEDMEM void computeBaryCenterOfFace(const std::vector& 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; diff --git a/src/MEDCoupling/MEDCouplingMesh.hxx b/src/MEDCoupling/MEDCouplingMesh.hxx index 501123219..acee171ce 100644 --- a/src/MEDCoupling/MEDCouplingMesh.hxx +++ b/src/MEDCoupling/MEDCouplingMesh.hxx @@ -135,6 +135,7 @@ namespace ParaMEDMEM void writeVTKAdvanced(const char *fileName, const std::string& cda, const std::string& pda) const throw(INTERP_KERNEL::Exception); /// @endcond virtual void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception) = 0; + virtual void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) = 0; protected: MEDCouplingMesh(); MEDCouplingMesh(const MEDCouplingMesh& other); diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 5345dd05a..2e2da9c12 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -7440,6 +7440,11 @@ void MEDCouplingUMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData ofs << " \n"; } +void MEDCouplingUMesh::reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) +{ + stream << "MEDCouplingUMesh C++ instance at " << this << ". "; +} + std::string MEDCouplingUMesh::getVTKDataSetType() const throw(INTERP_KERNEL::Exception) { return std::string("UnstructuredGrid"); diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index 98586f3c1..bb6f1276a 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -91,6 +91,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void unserialization(const std::vector& tinyInfoD, const std::vector& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector& littleStrings); MEDCOUPLING_EXPORT std::string getVTKDataSetType() const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception); //tools MEDCOUPLING_EXPORT static int AreCellsEqual(const int *conn, const int *connI, int cell1, int cell2, int compType); MEDCOUPLING_EXPORT static int AreCellsEqual0(const int *conn, const int *connI, int cell1, int cell2); diff --git a/src/MEDCoupling/MEDCouplingUMeshDesc.cxx b/src/MEDCoupling/MEDCouplingUMeshDesc.cxx index 5f2de9027..768988d09 100644 --- a/src/MEDCoupling/MEDCouplingUMeshDesc.cxx +++ b/src/MEDCoupling/MEDCouplingUMeshDesc.cxx @@ -533,3 +533,8 @@ DataArrayDouble *MEDCouplingUMeshDesc::computeIsoBarycenterOfNodesPerCell() cons { throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::computeIsoBarycenterOfNodesPerCell : not implemented yet !"); } + +void MEDCouplingUMeshDesc::reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) +{ + stream << "MEDCouplingUMeshDesc C++ instance at " << this << "."; +} diff --git a/src/MEDCoupling/MEDCouplingUMeshDesc.hxx b/src/MEDCoupling/MEDCouplingUMeshDesc.hxx index ba3f674f8..17a387710 100644 --- a/src/MEDCoupling/MEDCouplingUMeshDesc.hxx +++ b/src/MEDCoupling/MEDCouplingUMeshDesc.hxx @@ -97,6 +97,7 @@ namespace ParaMEDMEM void computeTypes(); void checkFullyDefined() const throw(INTERP_KERNEL::Exception); 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: int _mesh_dim;