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 std::vector<double> HYDROData_IProfilesInterpolator::GetResultProfile( const int theProfileIndex ) const
76 std::vector<double> aResultProfile;
78 if ( theProfileIndex > 0 && theProfileIndex < (int) myResultProfiles.size() ) {
79 aResultProfile = myResultProfiles.at( theProfileIndex );
82 return aResultProfile;
85 void HYDROData_IProfilesInterpolator::Reset()
91 SetResultProfilesNumber( DEFAULT_RESULT_PROFILES_NB );
93 myResultProfiles.clear();
96 SetErrorMessage( "" );