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