From: ageay Date: Wed, 8 Feb 2012 10:23:06 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V6_main_FINAL~884 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f8442ba4c9e4cc5d25e148f1452b1aa47f58968d;p=tools%2Fmedcoupling.git *** empty log message *** --- diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index df59ea7e9..2472ef59d 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -136,6 +136,16 @@ void DataArray::reprWithoutNameStream(std::ostream& stream) const stream << "\n"; } +void DataArray::setInfoOnComponents(const std::vector& info) throw(INTERP_KERNEL::Exception) +{ + if(getNumberOfComponents()!=(int)info.size()) + { + std::ostringstream oss; oss << "DataArray::setInfoOnComponents : input is of size " << info.size() << " whereas number of components is equal to " << getNumberOfComponents() << " !"; + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } + _info_on_compo=info; +} + std::vector DataArray::getVarsOnComponent() const { int nbOfCompo=(int)_info_on_compo.size(); diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index 1a68abc4e..993031578 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -95,7 +95,8 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT bool areInfoEquals(const DataArray& other) const; MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const; MEDCOUPLING_EXPORT std::string getName() const { return _name; } - MEDCOUPLING_EXPORT const std::vector &getInfoOnComponent() const { return _info_on_compo; } + MEDCOUPLING_EXPORT const std::vector &getInfoOnComponents() const { return _info_on_compo; } + MEDCOUPLING_EXPORT void setInfoOnComponents(const std::vector& info) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT std::vector getVarsOnComponent() const; MEDCOUPLING_EXPORT std::vector getUnitsOnComponent() const; MEDCOUPLING_EXPORT std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception);