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