Salome HOME
merge BR_v14_rc
[modules/hydro.git] / src / HYDROData / HYDROData_StricklerTable.cxx
index 279ecaea75d844343183b49c4fa9d3566432a05b..5d7623d8047cedf9f153be9b5e9d86a77f25fae4 100644 (file)
@@ -32,7 +32,8 @@
 IMPLEMENT_STANDARD_HANDLE( HYDROData_StricklerTable, HYDROData_Entity )
     IMPLEMENT_STANDARD_RTTIEXT( HYDROData_StricklerTable, HYDROData_Entity )
 
-    HYDROData_StricklerTable::HYDROData_StricklerTable()
+HYDROData_StricklerTable::HYDROData_StricklerTable()
+: HYDROData_Entity( Geom_No )
 {
 }
 
@@ -131,6 +132,24 @@ void HYDROData_StricklerTable::Set( const QString& theType, double theCoefficien
     aMap->SetReal( toExtString( 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;
+    }
+  }
+}
+
 QStringList HYDROData_StricklerTable::GetTypes() const
 {
     QStringList aSeq;
@@ -143,6 +162,14 @@ QStringList HYDROData_StricklerTable::GetTypes() const
     return aSeq;
 }
 
+bool HYDROData_StricklerTable::HasType( const QString& theType ) const
+{
+  Handle(TDataStd_NamedData) aMap = Map();
+  
+  TCollection_ExtendedString aType = toExtString( theType );
+  return !aMap.IsNull() && aMap->HasReal( aType );
+}
+
 void HYDROData_StricklerTable::Clear()
 {
     Handle(TDataStd_NamedData) aMap = Map();