From: ageay Date: Mon, 21 Feb 2011 11:18:51 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V6_main_FINAL~1057 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4acc2966c96a209fd3721b4ea7a342f8121c635e;p=tools%2Fmedcoupling.git *** empty log message *** --- diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.hxx b/src/MEDCoupling/MEDCouplingFieldDouble.hxx index 0a2d98741..aa6987ccc 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.hxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.hxx @@ -80,8 +80,10 @@ namespace ParaMEDMEM void setArray(DataArrayDouble *array); void setEndArray(DataArrayDouble *array); void setArrays(const std::vector& arrs) throw(INTERP_KERNEL::Exception); - DataArrayDouble *getArray() const { return _time_discr->getArray(); } - DataArrayDouble *getEndArray() const { return _time_discr->getEndArray(); } + const DataArrayDouble *getArray() const { return _time_discr->getArray(); } + DataArrayDouble *getArray() { return _time_discr->getArray(); } + const DataArrayDouble *getEndArray() const { return _time_discr->getEndArray(); } + DataArrayDouble *getEndArray() { return _time_discr->getEndArray(); } std::vector getArrays() const { std::vector ret; _time_discr->getArrays(ret); return ret; } double accumulate(int compId) const; void accumulate(double *res) const; diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx index 5bd900d50..e647616ad 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx @@ -185,7 +185,7 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::buildNewTimeReprFr { MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(type); ret->setTimeUnit(getTimeUnit()); - DataArrayDouble *arrSrc=getArray(); + const DataArrayDouble *arrSrc=getArray(); DataArrayDouble *arr=0; if(arrSrc) arr=arrSrc->performCpy(deepCpy); @@ -277,7 +277,12 @@ void MEDCouplingTimeDiscretization::setArray(DataArrayDouble *array, TimeLabel * } } -DataArrayDouble *MEDCouplingTimeDiscretization::getEndArray() const +const DataArrayDouble *MEDCouplingTimeDiscretization::getEndArray() const +{ + throw INTERP_KERNEL::Exception("getEndArray not available for this type of time discretization !"); +} + +DataArrayDouble *MEDCouplingTimeDiscretization::getEndArray() { throw INTERP_KERNEL::Exception("getEndArray not available for this type of time discretization !"); } @@ -1984,7 +1989,12 @@ void MEDCouplingTwoTimeSteps::copyTinyStringsFrom(const MEDCouplingTimeDiscretiz _end_array->copyStringInfoFrom(*otherC->_end_array); } -DataArrayDouble *MEDCouplingTwoTimeSteps::getEndArray() const +const DataArrayDouble *MEDCouplingTwoTimeSteps::getEndArray() const +{ + return _end_array; +} + +DataArrayDouble *MEDCouplingTwoTimeSteps::getEndArray() { return _end_array; } diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx b/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx index 9e63a02ce..5b17697ea 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx @@ -86,8 +86,10 @@ namespace ParaMEDMEM virtual void setArray(DataArrayDouble *array, TimeLabel *owner); virtual void setEndArray(DataArrayDouble *array, TimeLabel *owner); virtual void setArrays(const std::vector& arrays, TimeLabel *owner) throw(INTERP_KERNEL::Exception); - DataArrayDouble *getArray() const { return _array; } - virtual DataArrayDouble *getEndArray() const; + DataArrayDouble *getArray() { return _array; } + const DataArrayDouble *getArray() const { return _array; } + virtual const DataArrayDouble *getEndArray() const; + virtual DataArrayDouble *getEndArray(); virtual std::vector< const DataArrayDouble *> getArraysForTime(double time) const throw(INTERP_KERNEL::Exception) = 0; virtual void getValueForTime(double time, const std::vector& vals, double *res) const = 0; virtual void getArrays(std::vector& arrays) const; @@ -348,7 +350,8 @@ namespace ParaMEDMEM void updateTime() const; void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other); void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other); - DataArrayDouble *getEndArray() const; + const DataArrayDouble *getEndArray() const; + DataArrayDouble *getEndArray(); void checkCoherency() const throw(INTERP_KERNEL::Exception); bool isEqual(const MEDCouplingTimeDiscretization *other, double prec) const; bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretization *other, double prec) const; diff --git a/src/MEDCoupling_Swig/MEDCoupling.i b/src/MEDCoupling_Swig/MEDCoupling.i index 685bd558a..18dfb6980 100644 --- a/src/MEDCoupling_Swig/MEDCoupling.i +++ b/src/MEDCoupling_Swig/MEDCoupling.i @@ -1983,7 +1983,7 @@ namespace ParaMEDMEM return self->simpleRepr(); } - DataArrayDouble *getArray() const throw(INTERP_KERNEL::Exception) + DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception) { DataArrayDouble *ret=self->getArray(); if(ret) @@ -2020,7 +2020,7 @@ namespace ParaMEDMEM self->setArrays(arrs); } - DataArrayDouble *getEndArray() const throw(INTERP_KERNEL::Exception) + DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception) { DataArrayDouble *ret=self->getEndArray(); if(ret)