Salome HOME
Selection for image presentation & updates for interpolated stream profiles and stream.
[modules/hydro.git] / src / HYDROData / HYDROData_IProfilesInterpolator.cxx
index f0c8d42027730a4e6f2d50aef8897d3bc2ff2112..2af03fd7e29179a4c18451328fb8b3217c3e8556 100644 (file)
@@ -80,7 +80,7 @@ std::vector<double> HYDROData_IProfilesInterpolator::GetResultProfile( const int
 {
   std::vector<double> aResultProfile;
 
-  if ( theProfileIndex > 0 && theProfileIndex < (int) myResultProfiles.size() ) {
+  if ( theProfileIndex >= 0 && theProfileIndex < (int) myResultProfiles.size() ) {
     aResultProfile = myResultProfiles.at( theProfileIndex );
   }
 
@@ -89,14 +89,43 @@ std::vector<double> HYDROData_IProfilesInterpolator::GetResultProfile( const int
 
 void HYDROData_IProfilesInterpolator::Reset()
 {
+  // Reset input parameters
   myProfile1.clear();  
   myProfile2.clear();  
   myParameters.clear();
 
   SetResultProfilesNumber( DEFAULT_RESULT_PROFILES_NB );
   
+  // Reset result data
+  ClearResults();
+}
+
+std::vector<double> HYDROData_IProfilesInterpolator::GetFirstProfile() const
+{
+  return myProfile1;
+}
+
+std::vector<double> HYDROData_IProfilesInterpolator::GetSecondProfile() const
+{
+  return myProfile2;
+}
+
+void HYDROData_IProfilesInterpolator::ClearResults()
+{
+  // Clear result data
   myResultProfiles.clear();
 
+  // Reset errors
   SetErrorCode( OK );
   SetErrorMessage( "" );
+}
+
+int HYDROData_IProfilesInterpolator::GetNbProfilesToCompute() const
+{
+  return myResultProfilesNumber;
+}
+
+void HYDROData_IProfilesInterpolator::InsertResultProfile( const std::vector<double>& theProfile )
+{
+  myResultProfiles.push_back( theProfile );
 }
\ No newline at end of file