Salome HOME
fix test on stream linear interpolation
[modules/hydro.git] / src / HYDROData / HYDROData_IProfilesInterpolator.h
index f00e5df0bac34b262a4618299e531a896049aaf0..fa0b3eca2127475dc91d99ab9082310c01e6efe8 100644 (file)
@@ -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
 
 #include "HYDROData.h"
 
+#include <TCollection_AsciiString.hxx>
+#include <NCollection_Sequence.hxx>
+
 #include <string>
 #include <vector>
 #include <map>
+#include <gp_XYZ.hxx>
 
 
 /**
@@ -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<double> theProfile1, const std::vector<double> 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<gp_XYZ>& theProfile1, 
+                                             const NCollection_Sequence<gp_XYZ>& 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,16 +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, <number of profiles to compute>]
    * \return the profile with the given index or empty vector if the index is out of range
    */
-  HYDRODATA_EXPORT std::vector<double> GetResultProfile( const int theProfileIndex ) const;
+  HYDRODATA_EXPORT std::vector<double> GetResultProfileCoords( const int theProfileIndex ) const;
+
+  /**
+   * Get result profile by index as a sequence of gp_XYZ points.
+   * \param theProfileIndex the profile index [0, <number of profiles to compute>]
+   * \return the profile with the given index or empty sequence if the index is out of range
+   */
+  HYDRODATA_EXPORT NCollection_Sequence<gp_XYZ> GetResultProfilePoints( const int theProfileIndex ) const;
 
 protected:
   /**
@@ -130,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<double> GetFirstProfileCoords() const;
+
+  /**
+   * Get the second profile coordinates.
+   * \return the second profile points
+   */
+  HYDRODATA_EXPORT std::vector<double> GetSecondProfileCoords() const;
+
+  /**
+   * Get the first profile points.
+   * \return the first profile points
+   */
+  HYDRODATA_EXPORT NCollection_Sequence<gp_XYZ> GetFirstProfilePoints() const;
+
+  /**
+   * Get the second profile points.
+   * \return the second profile points
+   */
+  HYDRODATA_EXPORT NCollection_Sequence<gp_XYZ> 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<double>& 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<gp_XYZ>& theProfile );
+
+private:
+  NCollection_Sequence<gp_XYZ> GetPoints( const std::vector<double>& theCoords ) const;
+
 private:
   std::vector<double> myProfile1, myProfile2; ///< the two input profiles
   int myResultProfilesNumber; ///< the number of profiles to compute