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
24 #include <HYDROData_IProfilesInterpolator.h>
28 * Errors that could appear on interpolation calculations.
29 * If there is no error, it is "OK".
31 enum InterpolationError {
33 InvalidParametersError, ///< input parameters are invalid
34 UnknownError ///< problem has unknown nature
37 /**\class HYDROData_IProfilesInterpolator
38 * \brief The base class to provide interface for profiles interpolation.
40 class HYDROData_IProfilesInterpolator
43 #include <HYDROData_IProfilesInterpolator.h>
51 HYDROData_IProfilesInterpolator();
54 * Public virtual destructor.
56 virtual ~HYDROData_IProfilesInterpolator();
61 * Get description of the interpolation algorithm.
62 * \return the description string
64 virtual TCollection_AsciiString GetDescription() const = 0;
67 * Set profiles as sequences of gp_XYZ points.
68 * \param theProfile1 the first profile points
69 * \param theProfile1 the second profile points
71 virtual void SetProfiles( const NCollection_Sequence<gp_XYZ>& theProfile1,
72 const NCollection_Sequence<gp_XYZ>& theProfile2 );
75 * Set number of profiles to compute.
76 * \param theNumber the number of profiles to be computed
78 virtual void SetResultProfilesNumber( const int theNumber );
81 * Set the additional parameter.
82 * \param the parameter name
83 * \param the parameter value
85 virtual void SetParameter( const TCollection_AsciiString& theName, const TCollection_AsciiString& theValue );
88 * Get the last error code.
89 * \return the error code from InterpolationError enumeration
91 virtual InterpolationError GetErrorCode() const;
94 * Get string description of the last error.
95 * \return the string description
97 virtual TCollection_AsciiString GetErrorMessage() const;
100 * Reset interpolator state: both input and output data are reset.
102 virtual void Reset();
106 * Perform interpolation calculations.
108 virtual void Calculate() = 0;
111 * Get number of calculated profiles ( could be less than the number of profiles to be computed set as a parameter ).
112 * \return the number of really calculated profiles
114 virtual int GetCalculatedProfilesNumber() const;
117 * Get result profile by index.
118 * \param theProfileIndex the profile index [0, <number of profiles to compute>]
119 * \return the profile with the given index or empty vector if the index is out of range
121 NCollection_Sequence<gp_XYZ> GetResultProfilePoints( const int theProfileIndex ) const;
126 * Get the first profile points.
127 * \return the first profile points
129 NCollection_Sequence<gp_XYZ> GetFirstProfilePoints() const;
132 * Get the second profile points.
133 * \return the second profile points
135 NCollection_Sequence<gp_XYZ> GetSecondProfilePoints() const;
138 * Insert the calculated profile to the resuls as a list of points.
139 * \param theProfile the list of points gp_XYZ
141 void InsertResultProfile( const NCollection_Sequence<gp_XYZ>& theProfile );