From da8267a2b34cd257e7c46f441cfcb4d601ad4d75 Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 2 Apr 2013 15:45:14 +0000 Subject: [PATCH] __repr__ of MEDCouplingField --- src/MEDCoupling/MEDCouplingField.hxx | 1 + src/MEDCoupling/MEDCouplingFieldDouble.cxx | 4 ++++ src/MEDCoupling/MEDCouplingFieldDouble.hxx | 1 + src/MEDCoupling/MEDCouplingFieldTemplate.cxx | 7 +++++++ src/MEDCoupling/MEDCouplingFieldTemplate.hxx | 1 + 5 files changed, 14 insertions(+) diff --git a/src/MEDCoupling/MEDCouplingField.hxx b/src/MEDCoupling/MEDCouplingField.hxx index c42421e8c..1df5494c2 100644 --- a/src/MEDCoupling/MEDCouplingField.hxx +++ b/src/MEDCoupling/MEDCouplingField.hxx @@ -84,6 +84,7 @@ namespace ParaMEDMEM const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception); void updateTime() const; std::size_t getHeapMemorySize() const; + virtual void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) = 0; protected: MEDCouplingField(TypeOfField type); MEDCouplingField(const MEDCouplingField& other, bool deepCopy=true); diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.cxx b/src/MEDCoupling/MEDCouplingFieldDouble.cxx index 5c874cf55..d2d915cf4 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.cxx @@ -1830,3 +1830,7 @@ void MEDCouplingFieldDouble::WriteVTK(const char *fileName, const std::vectorwriteVTKAdvanced(fileName,coss.str(),noss.str()); } + +void MEDCouplingFieldDouble::reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) +{ +} diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.hxx b/src/MEDCoupling/MEDCouplingFieldDouble.hxx index 4da0aec21..d74464c13 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.hxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.hxx @@ -187,6 +187,7 @@ namespace ParaMEDMEM public: const MEDCouplingTimeDiscretization *getTimeDiscretizationUnderGround() const { return _time_discr; } MEDCouplingTimeDiscretization *getTimeDiscretizationUnderGround() { return _time_discr; } + void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception); private: MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td); MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td); diff --git a/src/MEDCoupling/MEDCouplingFieldTemplate.cxx b/src/MEDCoupling/MEDCouplingFieldTemplate.cxx index 41733cfd3..3b07c7efa 100644 --- a/src/MEDCoupling/MEDCouplingFieldTemplate.cxx +++ b/src/MEDCoupling/MEDCouplingFieldTemplate.cxx @@ -119,3 +119,10 @@ void MEDCouplingFieldTemplate::serialize(DataArrayInt *&dataInt) const _type->getSerializationIntArray(dataInt); } +void MEDCouplingFieldTemplate::reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) +{ + stream << "MEDCouplingFieldTemplate C++ instance at " << this << "."; + const MEDCouplingFieldDiscretization *fd(_type); + if(!fd) + stream << " No spatial discretization set !"; +} diff --git a/src/MEDCoupling/MEDCouplingFieldTemplate.hxx b/src/MEDCoupling/MEDCouplingFieldTemplate.hxx index b297287c2..3fb6cfa8a 100644 --- a/src/MEDCoupling/MEDCouplingFieldTemplate.hxx +++ b/src/MEDCoupling/MEDCouplingFieldTemplate.hxx @@ -43,6 +43,7 @@ namespace ParaMEDMEM void finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoD, const std::vector& tinyInfoS); void serialize(DataArrayInt *&dataInt) const; // + void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception); private: MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception); MEDCouplingFieldTemplate(TypeOfField type); -- 2.39.2