-// 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>
+class gp_XYZ;
+
/**
* Errors that could appear on interpolation calculations.
* 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, ...].
*/
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
* \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.
* 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.
/**
* 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
+ * \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:
/**
HYDRODATA_EXPORT virtual void SetErrorMessage( const std::string& theMessage );
/**
- * Get the first profile.
+ * Get the first profile coordinates.
* \return the first profile points
*/
- HYDRODATA_EXPORT std::vector<double> GetFirstProfile() const;
+ HYDRODATA_EXPORT std::vector<double> GetFirstProfileCoords() const;
/**
- * Get the second profile.
+ * Get the second profile coordinates.
* \return the second profile points
*/
- HYDRODATA_EXPORT std::vector<double> GetSecondProfile() const;
+ 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.
HYDRODATA_EXPORT void ClearResults();
/**
- * Insert the calculated profile to the resuls.
- * \param theProfile the profile to insert
+ * 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