X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_IProfilesInterpolator.h;h=fa0b3eca2127475dc91d99ab9082310c01e6efe8;hb=6120f6f24e5568ffa69e959689789e1fbe59d58a;hp=da91b2da7c56f094c6cc0e9590fbbe7a0dcde235;hpb=a7828fda5a124d2019a6682b4394781ee7292edd;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_IProfilesInterpolator.h b/src/HYDROData/HYDROData_IProfilesInterpolator.h index da91b2da..fa0b3eca 100644 --- a/src/HYDROData/HYDROData_IProfilesInterpolator.h +++ b/src/HYDROData/HYDROData_IProfilesInterpolator.h @@ -1,8 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// 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 @@ -25,9 +21,13 @@ #include "HYDROData.h" +#include +#include + #include #include #include +#include /** @@ -63,7 +63,7 @@ public: * Get description of the interpolation algorithm. * \return the description string */ - HYDRODATA_EXPORT virtual std::string GetDescription() const = 0; + HYDRODATA_EXPORT virtual TCollection_AsciiString GetDescription() const = 0; /** * Set profiles as vectors of point coordinates [x1, y1, z1, x2, y2, z2, ...]. @@ -72,6 +72,14 @@ public: */ HYDRODATA_EXPORT virtual void SetProfiles( const std::vector theProfile1, const std::vector theProfile2 ); + /** + * Set profiles as sequences of gp_XYZ points. + * \param theProfile1 the first profile points + * \param theProfile1 the second profile points + */ + HYDRODATA_EXPORT 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 @@ -83,7 +91,8 @@ public: * \param the parameter name * \param the parameter value */ - HYDRODATA_EXPORT virtual void SetParameter( const std::string& theName, const std::string& theValue ); + HYDRODATA_EXPORT virtual void SetParameter( const TCollection_AsciiString& theName, + const TCollection_AsciiString& theValue ); /** * Get the last error code. @@ -95,7 +104,7 @@ public: * Get string description of the last error. * \return the string description */ - HYDRODATA_EXPORT virtual std::string GetErrorMessage() const; + HYDRODATA_EXPORT virtual TCollection_AsciiString GetErrorMessage() const; /** * Reset interpolator state: both input and output data are reset. @@ -106,14 +115,27 @@ public: /** * Perform interpolation calculations. */ - HYDRODATA_EXPORT virtual InterpolationError Calculate() = 0; + HYDRODATA_EXPORT 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 + */ + HYDRODATA_EXPORT virtual int GetCalculatedProfilesNumber() const; /** - * Get result profile by index. + * Get result profile by index as a vector of point coordinates [x1, y1, z1, x2, y2, z2, ...]. * \param theProfileIndex the profile index [0, ] * \return the profile with the given index or empty vector if the index is out of range */ - std::vector GetResultProfile( const int theProfileIndex ) const; + HYDRODATA_EXPORT std::vector GetResultProfileCoords( const int theProfileIndex ) const; + + /** + * Get result profile by index as a sequence of gp_XYZ points. + * \param theProfileIndex the profile index [0, ] + * \return the profile with the given index or empty sequence if the index is out of range + */ + HYDRODATA_EXPORT NCollection_Sequence GetResultProfilePoints( const int theProfileIndex ) const; protected: /** @@ -128,6 +150,56 @@ protected: */ HYDRODATA_EXPORT virtual void SetErrorMessage( const std::string& theMessage ); + /** + * Get the first profile coordinates. + * \return the first profile points + */ + HYDRODATA_EXPORT std::vector GetFirstProfileCoords() const; + + /** + * Get the second profile coordinates. + * \return the second profile points + */ + HYDRODATA_EXPORT std::vector GetSecondProfileCoords() const; + + /** + * Get the first profile points. + * \return the first profile points + */ + HYDRODATA_EXPORT NCollection_Sequence GetFirstProfilePoints() const; + + /** + * Get the second profile points. + * \return the second profile points + */ + HYDRODATA_EXPORT NCollection_Sequence GetSecondProfilePoints() const; + + /** + * Get number of profiles to compute. + * \return the current value of number of result profiles parameter + */ + HYDRODATA_EXPORT virtual int GetNbProfilesToCompute() const; + + /** + * Clear result data (including errors). + */ + HYDRODATA_EXPORT void ClearResults(); + + /** + * Insert the calculated profile to the resuls as a list of coordinates. + * \param theProfile the list of coordinates [x1, y1, z1, x2, y2, z2, ...] + */ + HYDRODATA_EXPORT void InsertResultProfile( const std::vector& theProfile ); + + /** + * Insert the calculated profile to the resuls as a list of points. + * \param theProfile the list of points gp_XYZ + */ + HYDRODATA_EXPORT void InsertResultProfile( const NCollection_Sequence& theProfile ); + +private: + NCollection_Sequence GetPoints( const std::vector& theCoords ) const; + private: std::vector myProfile1, myProfile2; ///< the two input profiles int myResultProfilesNumber; ///< the number of profiles to compute @@ -136,7 +208,7 @@ private: InterpolationError myErrorCode; ///< the last error code std::string myErrorMessage; ///< the last error message - std::vector> myResultProfiles; ///< the list of result profiles + std::vector< std::vector > myResultProfiles; ///< the list of result profiles }; #endif