Salome HOME
60f7c36435cedd6ad3eb939838862a11cc114cc2
[samples/calculator.git] / idl / CALCULATOR_Gen.idl
1 // Copyright (C) 2007-2021  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 #ifndef __CALCULATOR_GEN__
24 #define __CALCULATOR_GEN__
25
26 /*!
27   \defgroup EXAMPLES SALOME EXAMPLES components
28 */
29
30 #include "SALOME_Component.idl"
31 #include "SALOME_Exception.idl"
32 #include "MEDCouplingCorbaServant.idl"
33
34 /*!
35   \ingroup EXAMPLES
36   This package contains the interface CALCULATOR_ORB used 
37   for %CALCULATOR component as an example in %SALOME application.
38 */
39
40 module CALCULATOR_ORB
41 {
42   /*!
43     \brief Enumeration ErrorCode contains a code of the error
44   */
45   typedef long ErrorCode;
46   const ErrorCode RES_OK = 0;
47   const ErrorCode NOT_COMPATIBLE = 1;
48   const ErrorCode EXCEPTION_RAISED = 2;
49   const ErrorCode INVALID_FIELD = 3;
50         
51   /*!
52     \brief Interface of the %CALCULATOR component
53   */
54   interface CALCULATOR_Gen : Engines::EngineComponent
55   {
56     /*!
57       \brief Calculate maximum relative difference of field with the previous one.
58       At first call store passed field and return 1.
59     */
60     double convergenceCriteria(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
61
62     /*!
63       \brief Apply to each (scalar) field component the linear function x -> ax+b.
64       Release field1 after use.
65     */
66     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface applyLin(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field,
67                                                               in double a, in double b);
68
69     /*!
70       \brief Sum two fields. 
71       Release field1 and field2 after use.
72     */
73     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface add(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field1,
74                                                          in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field2);
75
76     /*!
77       \brief Get Euclidian norm of field
78       Release field after use.
79     */
80     double norm2(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
81
82     /*!
83       \brief Get L2 norm of field
84       Release field after use.
85     */
86     double normL2(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
87     
88      /*!
89        \brief Get L1 norm of field
90        Release field after use.
91      */
92     double normL1(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
93     
94     /*!
95       \brief Get max norm of field
96       Release field after use.
97     */
98     double normMax(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
99     
100     /*!
101       \brief Print out the coordinates and field values to standard output
102       Release field after use.
103     */
104     void printField(in SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field);
105     
106     /*!
107       \brief Clone source field into four copies.
108       Release field after use.
109     */
110     void cloneField(in  SALOME_MED::MEDCouplingFieldDoubleCorbaInterface field,
111                     out SALOME_MED::MEDCouplingFieldDoubleCorbaInterface clone1, 
112                     out SALOME_MED::MEDCouplingFieldDoubleCorbaInterface clone2,
113                     out SALOME_MED::MEDCouplingFieldDoubleCorbaInterface clone3,
114                     out SALOME_MED::MEDCouplingFieldDoubleCorbaInterface clone4);
115     
116     /*!
117       \brief Get last operation status; returns \c True if last operation succeded,
118       otherwise returns \c False.
119     */
120     boolean isDone();
121     
122     /*!
123       \brief Get last error code
124     */
125     ErrorCode getErrorCode();
126   };
127 };
128
129 #endif