From 7a44bb8198add15aff5ffce2910c1200e68734f2 Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 27 Feb 2012 14:36:34 +0000 Subject: [PATCH] __repr__ method for Fields. --- .../MEDCouplingFieldDiscretization.cxx | 20 +++++++++++++++++++ .../MEDCouplingFieldDiscretization.hxx | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx b/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx index f2c0ae09d..c8eb4d47b 100644 --- a/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx @@ -342,6 +342,11 @@ std::string MEDCouplingFieldDiscretizationP0::getStringRepr() const return std::string(REPR); } +const char *MEDCouplingFieldDiscretizationP0::getRepr() const +{ + return REPR; +} + bool MEDCouplingFieldDiscretizationP0::isEqual(const MEDCouplingFieldDiscretization *other, double eps) const { const MEDCouplingFieldDiscretizationP0 *otherC=dynamic_cast(other); @@ -502,6 +507,11 @@ std::string MEDCouplingFieldDiscretizationP1::getStringRepr() const return std::string(REPR); } +const char *MEDCouplingFieldDiscretizationP1::getRepr() const +{ + return REPR; +} + bool MEDCouplingFieldDiscretizationP1::isEqual(const MEDCouplingFieldDiscretization *other, double eps) const { const MEDCouplingFieldDiscretizationP1 *otherC=dynamic_cast(other); @@ -847,6 +857,11 @@ std::string MEDCouplingFieldDiscretizationGauss::getStringRepr() const return oss.str(); } +const char *MEDCouplingFieldDiscretizationGauss::getRepr() const +{ + return REPR; +} + int MEDCouplingFieldDiscretizationGauss::getNumberOfTuples(const MEDCouplingMesh *) const { int ret=0; @@ -1373,6 +1388,11 @@ std::string MEDCouplingFieldDiscretizationGaussNE::getStringRepr() const return std::string(REPR); } +const char *MEDCouplingFieldDiscretizationGaussNE::getRepr() const +{ + return REPR; +} + bool MEDCouplingFieldDiscretizationGaussNE::isEqual(const MEDCouplingFieldDiscretization *other, double eps) const { const MEDCouplingFieldDiscretizationGaussNE *otherC=dynamic_cast(other); diff --git a/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx b/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx index 93ca1478b..a85cde832 100644 --- a/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx +++ b/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx @@ -49,6 +49,7 @@ namespace ParaMEDMEM virtual bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const; virtual MEDCouplingFieldDiscretization *clone() const = 0; virtual std::string getStringRepr() const = 0; + virtual const char *getRepr() const = 0; virtual int getNumberOfTuples(const MEDCouplingMesh *mesh) const = 0; virtual int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const = 0; virtual DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const = 0; @@ -104,6 +105,7 @@ namespace ParaMEDMEM TypeOfField getEnum() const; MEDCouplingFieldDiscretization *clone() const; std::string getStringRepr() const; + const char *getRepr() const; bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const; int getNumberOfTuples(const MEDCouplingMesh *mesh) const; int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const; @@ -134,6 +136,7 @@ namespace ParaMEDMEM TypeOfField getEnum() const; MEDCouplingFieldDiscretization *clone() const; std::string getStringRepr() const; + const char *getRepr() const; bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const; int getNumberOfTuples(const MEDCouplingMesh *mesh) const; int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const; @@ -194,6 +197,7 @@ namespace ParaMEDMEM bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const; MEDCouplingFieldDiscretization *clone() const; std::string getStringRepr() const; + const char *getRepr() const; int getNumberOfTuples(const MEDCouplingMesh *mesh) const; int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const; DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const; @@ -253,6 +257,7 @@ namespace ParaMEDMEM TypeOfField getEnum() const; MEDCouplingFieldDiscretization *clone() const; std::string getStringRepr() const; + const char *getRepr() const; bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const; int getNumberOfTuples(const MEDCouplingMesh *mesh) const; int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const; -- 2.39.2