Salome HOME
Added methods getErrorCode and isDone
[samples/calculator.git] / idl / CALCULATOR_Gen.idl
1 // Copyright (C) 2005  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef __CALCULATOR_GEN__
20 #define __CALCULATOR_GEN__
21 /*!
22  \defgroup EXAMPLES SALOME EXAMPLES components
23  */
24
25 #include "SALOME_Component.idl"
26 #include "SALOME_Exception.idl"
27 #include "MED.idl"
28
29
30 /*!  \ingroup EXAMPLES
31
32 This package contains the interface CALCULATOR_ORB used 
33 for  %CALCULATOR component as an example in %SALOME application.
34 */
35 module CALCULATOR_ORB
36 {
37   /*!
38         Enumeration ErrorCode contains a code of the error
39    */
40    typedef long ErrorCode;
41    const ErrorCode NO_ERROR = 0;
42    const ErrorCode NOT_COMPATIBLE = 1;
43    const ErrorCode EXCEPTION_RAISED = 2;
44    const ErrorCode INVALID_FIELD = 3;
45
46         
47   /*! \brief Interface of the %CALCULATOR component
48    */
49   interface CALCULATOR_Gen : Engines::Component
50   {
51      /*!
52          Calculate the maximum relative difference of field with the previous one.
53          At first call, store passed field and return 1.
54       */
55      double convergenceCriteria(in SALOME_MED::FIELDDOUBLE field);
56      /*!
57          Apply to each (scalar) field component the linear function x -> ax+b.
58          Release field1 after use.
59       */
60      SALOME_MED::FIELDDOUBLE applyLin(in SALOME_MED::FIELDDOUBLE field1, in double a1, in double a2);
61
62      /*!
63          Addition of fields. 
64          Release field1 and field2 after use.
65      */
66      SALOME_MED::FIELDDOUBLE add(in SALOME_MED::FIELDDOUBLE field1, in SALOME_MED::FIELDDOUBLE field2);
67
68      /*!
69          return euclidian norm of field
70          Release field after use.
71       */
72      double norm2(in SALOME_MED::FIELDDOUBLE field);
73
74      /*!
75          return L2 norm of field
76          Release field after use.
77       */
78      double normL2(in SALOME_MED::FIELDDOUBLE field);
79
80      /*!
81          return L1 norm of field
82          Release field after use.
83       */
84      double normL1(in SALOME_MED::FIELDDOUBLE field);
85
86      /*!
87          return max norm of field
88          Release field after use.
89       */
90      double normMax(in SALOME_MED::FIELDDOUBLE field);
91
92      /*!
93          This utility method print in standard output the coordinates & field values
94          Release field after use.
95       */
96      void printField(in SALOME_MED::FIELDDOUBLE field);
97
98      /*!
99          This method clones field in four examples.
100          Release field after use.
101       */
102      void cloneField(in SALOME_MED::FIELDDOUBLE field, out SALOME_MED::FIELDDOUBLE clone1, 
103                      out SALOME_MED::FIELDDOUBLE clone2, out SALOME_MED::FIELDDOUBLE clone3,
104                      out SALOME_MED::FIELDDOUBLE clone4 );
105
106      /*!
107          This method returns True if the operation succeded.
108          Otherwise returns False.
109       */
110          boolean isDone();
111
112          /*!
113          This method return an error code
114       */
115          ErrorCode getErrorCode();
116   };
117 };
118
119 #endif
120