Salome HOME
Merge remote-tracking branch 'origin/BR_1321_ECW' into BR_DEMO
[modules/hydro.git] / src / HYDROPy / HYDROData_IProfilesInterpolator.sip
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 %ExportedHeaderCode
20 #include <HYDROData_IProfilesInterpolator.h>
21 %End
22
23 /**
24  * Errors that could appear on interpolation calculations.
25  * If there is no error, it is "OK".
26  */
27 enum InterpolationError {
28   OK = 0, ///< success
29   InvalidParametersError, ///< input parameters are invalid
30   UnknownError ///< problem has unknown nature
31 };
32
33 /**\class HYDROData_IProfilesInterpolator
34  * \brief The base class to provide interface for profiles interpolation.
35  */
36 class HYDROData_IProfilesInterpolator
37 {
38 %TypeHeaderCode
39 #include <HYDROData_IProfilesInterpolator.h>
40 %End
41
42 public:
43
44   /**
45    * Public constructor.
46    */
47   HYDROData_IProfilesInterpolator();
48
49   /**
50    * Public virtual destructor.
51    */
52   virtual ~HYDROData_IProfilesInterpolator();
53   
54 public:
55
56   /**
57    * Get description of the interpolation algorithm.
58    * \return the description string
59    */
60   virtual TCollection_AsciiString GetDescription() const = 0;
61
62   /**
63    * Set profiles as sequences of gp_XYZ points.
64    * \param theProfile1 the first profile points
65    * \param theProfile1 the second profile points
66    */
67   virtual void SetProfiles( const NCollection_Sequence<gp_XYZ>& theProfile1, 
68                             const NCollection_Sequence<gp_XYZ>& theProfile2 );
69
70   /**
71    * Set number of profiles to compute.
72    * \param theNumber the number of profiles to be computed
73    */
74   virtual void SetResultProfilesNumber( const int theNumber );
75
76   /**
77    * Set the additional parameter.
78    * \param the parameter name
79    * \param the parameter value
80    */
81   virtual void SetParameter( const TCollection_AsciiString& theName, const TCollection_AsciiString& theValue );
82
83   /**
84    * Get the last error code.
85    * \return the error code from InterpolationError enumeration
86    */
87   virtual InterpolationError GetErrorCode() const;
88
89   /**
90    * Get string description of the last error.
91    * \return the string description
92    */
93   virtual TCollection_AsciiString GetErrorMessage() const;
94
95   /**
96    * Reset interpolator state: both input and output data are reset.
97    */
98   virtual void Reset();
99
100 public:
101   /**
102    * Perform interpolation calculations.
103    */
104   virtual void Calculate() = 0;
105
106   /**
107    * Get number of calculated profiles ( could be less than the number of profiles to be computed set as a parameter ).
108    * \return the number of really calculated profiles
109    */
110   virtual int GetCalculatedProfilesNumber() const;
111
112   /**
113    * Get result profile by index.
114    * \param theProfileIndex the profile index [0, <number of profiles to compute>]
115    * \return the profile with the given index or empty vector if the index is out of range
116    */
117    NCollection_Sequence<gp_XYZ> GetResultProfilePoints( const int theProfileIndex ) const; 
118
119 protected:
120
121   /**
122    * Get the first profile points.
123    * \return the first profile points
124    */
125   NCollection_Sequence<gp_XYZ> GetFirstProfilePoints() const;
126
127   /**
128    * Get the second profile points.
129    * \return the second profile points
130    */
131   NCollection_Sequence<gp_XYZ> GetSecondProfilePoints() const;
132
133   /**
134    * Insert the calculated profile to the resuls as a list of points.
135    * \param theProfile the list of points gp_XYZ
136    */
137    void InsertResultProfile( const NCollection_Sequence<gp_XYZ>& theProfile );
138 };