1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "HYDROData_IProfilesInterpolator.h"
26 const int DEFAULT_RESULT_PROFILES_NB = 1; ///< default number of results profiles
28 HYDROData_IProfilesInterpolator::HYDROData_IProfilesInterpolator()
29 : myResultProfilesNumber( DEFAULT_RESULT_PROFILES_NB ),
34 HYDROData_IProfilesInterpolator::~HYDROData_IProfilesInterpolator()
38 void HYDROData_IProfilesInterpolator::SetProfiles( const std::vector<double> theProfile1, const std::vector<double> theProfile2 )
40 myProfile1 = theProfile1;
41 myProfile2 = theProfile2;
44 void HYDROData_IProfilesInterpolator::SetParameter( const std::string& theName, const std::string& theValue )
46 myParameters[theName] = theValue;
49 InterpolationError HYDROData_IProfilesInterpolator::GetErrorCode() const
54 void HYDROData_IProfilesInterpolator::SetErrorCode( const InterpolationError& theError )
56 myErrorCode = theError;
59 std::string HYDROData_IProfilesInterpolator::GetErrorMessage() const
61 return myErrorMessage;
64 void HYDROData_IProfilesInterpolator::SetErrorMessage( const std::string& theMessage )
66 myErrorMessage = theMessage;
69 void HYDROData_IProfilesInterpolator::SetResultProfilesNumber( const int theNumber )
71 myResultProfilesNumber = theNumber;
74 int HYDROData_IProfilesInterpolator::GetCalculatedProfilesNumber() const
76 return myResultProfiles.size();
79 std::vector<double> HYDROData_IProfilesInterpolator::GetResultProfile( const int theProfileIndex ) const
81 std::vector<double> aResultProfile;
83 if ( theProfileIndex >= 0 && theProfileIndex < (int) myResultProfiles.size() ) {
84 aResultProfile = myResultProfiles.at( theProfileIndex );
87 return aResultProfile;
90 void HYDROData_IProfilesInterpolator::Reset()
92 // Reset input parameters
97 SetResultProfilesNumber( DEFAULT_RESULT_PROFILES_NB );
103 std::vector<double> HYDROData_IProfilesInterpolator::GetFirstProfile() const
108 std::vector<double> HYDROData_IProfilesInterpolator::GetSecondProfile() const
113 void HYDROData_IProfilesInterpolator::ClearResults()
116 myResultProfiles.clear();
120 SetErrorMessage( "" );
123 int HYDROData_IProfilesInterpolator::GetNbProfilesToCompute() const
125 return myResultProfilesNumber;
128 void HYDROData_IProfilesInterpolator::InsertResultProfile( const std::vector<double>& theProfile )
130 myResultProfiles.push_back( theProfile );