1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include <HYDROData_IProfilesInterpolator.h>
24 * Errors that could appear on interpolation calculations.
25 * If there is no error, it is "OK".
27 enum InterpolationError {
29 InvalidParametersError, ///< input parameters are invalid
30 UnknownError ///< problem has unknown nature
33 /**\class HYDROData_IProfilesInterpolator
34 * \brief The base class to provide interface for profiles interpolation.
36 class HYDROData_IProfilesInterpolator
39 #include <HYDROData_IProfilesInterpolator.h>
47 HYDROData_IProfilesInterpolator();
50 * Public virtual destructor.
52 virtual ~HYDROData_IProfilesInterpolator();
57 * Get description of the interpolation algorithm.
58 * \return the description string
60 virtual TCollection_AsciiString GetDescription() const = 0;
63 * Set profiles as sequences of gp_XYZ points.
64 * \param theProfile1 the first profile points
65 * \param theProfile1 the second profile points
67 virtual void SetProfiles( const NCollection_Sequence<gp_XYZ>& theProfile1,
68 const NCollection_Sequence<gp_XYZ>& theProfile2 );
71 * Set number of profiles to compute.
72 * \param theNumber the number of profiles to be computed
74 virtual void SetResultProfilesNumber( const int theNumber );
77 * Set the additional parameter.
78 * \param the parameter name
79 * \param the parameter value
81 virtual void SetParameter( const TCollection_AsciiString& theName, const TCollection_AsciiString& theValue );
84 * Get the last error code.
85 * \return the error code from InterpolationError enumeration
87 virtual InterpolationError GetErrorCode() const;
90 * Get string description of the last error.
91 * \return the string description
93 virtual TCollection_AsciiString GetErrorMessage() const;
96 * Reset interpolator state: both input and output data are reset.
102 * Perform interpolation calculations.
104 virtual void Calculate() = 0;
107 * Get number of calculated profiles ( could be less than the number of profiles to be computed set as a parameter ).
108 * \return the number of really calculated profiles
110 virtual int GetCalculatedProfilesNumber() const;
113 * Get result profile by index.
114 * \param theProfileIndex the profile index [0, <number of profiles to compute>]
115 * \return the profile with the given index or empty vector if the index is out of range
117 NCollection_Sequence<gp_XYZ> GetResultProfilePoints( const int theProfileIndex ) const;
122 * Get the first profile points.
123 * \return the first profile points
125 NCollection_Sequence<gp_XYZ> GetFirstProfilePoints() const;
128 * Get the second profile points.
129 * \return the second profile points
131 NCollection_Sequence<gp_XYZ> GetSecondProfilePoints() const;
134 * Insert the calculated profile to the resuls as a list of points.
135 * \param theProfile the list of points gp_XYZ
137 void InsertResultProfile( const NCollection_Sequence<gp_XYZ>& theProfile );