// Copyright (C) 2014-2015 EDF-R&D // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // %ExportedHeaderCode #include %End /** * Errors that could appear on interpolation calculations. * If there is no error, it is "OK". */ enum InterpolationError { OK = 0, ///< success InvalidParametersError, ///< input parameters are invalid UnknownError ///< problem has unknown nature }; /**\class HYDROData_IProfilesInterpolator * \brief The base class to provide interface for profiles interpolation. */ class HYDROData_IProfilesInterpolator { %TypeHeaderCode #include %End public: /** * Public constructor. */ HYDROData_IProfilesInterpolator(); /** * Public virtual destructor. */ virtual ~HYDROData_IProfilesInterpolator(); public: /** * Get description of the interpolation algorithm. * \return the description string */ virtual TCollection_AsciiString GetDescription() const = 0; /** * Set profiles as sequences of gp_XYZ points. * \param theProfile1 the first profile points * \param theProfile1 the second profile points */ virtual void SetProfiles( const NCollection_Sequence& theProfile1, const NCollection_Sequence& theProfile2 ); /** * Set number of profiles to compute. * \param theNumber the number of profiles to be computed */ virtual void SetResultProfilesNumber( const int theNumber ); /** * Set the additional parameter. * \param the parameter name * \param the parameter value */ virtual void SetParameter( const TCollection_AsciiString& theName, const TCollection_AsciiString& theValue ); /** * Get the last error code. * \return the error code from InterpolationError enumeration */ virtual InterpolationError GetErrorCode() const; /** * Get string description of the last error. * \return the string description */ virtual TCollection_AsciiString GetErrorMessage() const; /** * Reset interpolator state: both input and output data are reset. */ virtual void Reset(); public: /** * Perform interpolation calculations. */ virtual void Calculate() = 0; /** * Get number of calculated profiles ( could be less than the number of profiles to be computed set as a parameter ). * \return the number of really calculated profiles */ virtual int GetCalculatedProfilesNumber() const; /** * Get result profile by index. * \param theProfileIndex the profile index [0, ] * \return the profile with the given index or empty vector if the index is out of range */ NCollection_Sequence GetResultProfilePoints( const int theProfileIndex ) const; protected: /** * Get the first profile points. * \return the first profile points */ NCollection_Sequence GetFirstProfilePoints() const; /** * Get the second profile points. * \return the second profile points */ NCollection_Sequence GetSecondProfilePoints() const; /** * Insert the calculated profile to the resuls as a list of points. * \param theProfile the list of points gp_XYZ */ void InsertResultProfile( const NCollection_Sequence& theProfile ); };