X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_StricklerTable.cxx;h=0e68479d54660cb49495689a2cf3daf0e710de94;hb=40075335fb504d596f21e9459488a56c1277dbde;hp=68995e824be7ab26e9824459bf25e8a1567d3a3c;hpb=db8366c663ab1f4a95e4e35135ce46c0c4d41717;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_StricklerTable.cxx b/src/HYDROData/HYDROData_StricklerTable.cxx index 68995e82..0e68479d 100644 --- a/src/HYDROData/HYDROData_StricklerTable.cxx +++ b/src/HYDROData/HYDROData_StricklerTable.cxx @@ -130,6 +130,24 @@ void HYDROData_StricklerTable::Set( const TCollection_ExtendedString& theType, d aMap->SetReal( theType, theCoefficient ); } +void HYDROData_StricklerTable::GetCoefficientRange( double& theMin, double& theMax ) const +{ + theMin = 0; + theMax = 0; + + Handle(TDataStd_NamedData) aMap = Map(); + Standard_Boolean isFirst = Standard_True; + for ( TDataStd_DataMapIteratorOfDataMapOfStringReal it( aMap->GetRealsContainer() ); it.More(); it.Next() ) { + Standard_Real aValue = it.Value(); + if ( theMin == 0 || aValue < theMin ) { + theMin = aValue; + } + if ( theMax == 0 || aValue > theMax ) { + theMax = aValue; + } + } +} + TColStd_SequenceOfExtendedString HYDROData_StricklerTable::GetTypes() const { TColStd_SequenceOfExtendedString aSeq; @@ -142,6 +160,13 @@ TColStd_SequenceOfExtendedString HYDROData_StricklerTable::GetTypes() const return aSeq; } +bool HYDROData_StricklerTable::HasType( const TCollection_ExtendedString& theType ) const +{ + Handle(TDataStd_NamedData) aMap = Map(); + + return !aMap.IsNull() && aMap->HasReal( theType ); +} + void HYDROData_StricklerTable::Clear() { Handle(TDataStd_NamedData) aMap = Map();