Salome HOME
b714af96641f9741bc99b7090f704ec3b48e3652
[samples/calculator.git] / src / CALCULATOR / CALCULATOR.hxx
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_HXX_
20 #define _CALCULATOR_HXX_
21
22 #include <SALOMEconfig.h>
23 #include CORBA_SERVER_HEADER(CALCULATOR_Gen)
24 #include CORBA_CLIENT_HEADER(MED)
25 #include "SALOME_Component_i.hxx"
26
27 class CALCULATOR:
28   public POA_CALCULATOR_ORB::CALCULATOR_Gen,
29   public Engines_Component_i 
30 {
31
32 public:
33     CALCULATOR(CORBA::ORB_ptr orb,
34             PortableServer::POA_ptr poa,
35             PortableServer::ObjectId * contId, 
36             const char *instanceName, 
37             const char *interfaceName);
38     virtual ~CALCULATOR();
39
40     CORBA::Double convergenceCriteria(SALOME_MED::FIELDDOUBLE_ptr field);
41     CORBA::Double normMax(SALOME_MED::FIELDDOUBLE_ptr field1);
42     CORBA::Double normL2(SALOME_MED::FIELDDOUBLE_ptr field1);
43     CORBA::Double norm2(SALOME_MED::FIELDDOUBLE_ptr field1);
44     CORBA::Double normL1(SALOME_MED::FIELDDOUBLE_ptr field1);
45     SALOME_MED::FIELDDOUBLE_ptr applyLin(SALOME_MED::FIELDDOUBLE_ptr field1,CORBA::Double a,CORBA::Double b);
46     SALOME_MED::FIELDDOUBLE_ptr add(SALOME_MED::FIELDDOUBLE_ptr field1, SALOME_MED::FIELDDOUBLE_ptr field2);
47     void printField(SALOME_MED::FIELDDOUBLE_ptr field);
48     void cloneField(SALOME_MED::FIELDDOUBLE_ptr field, SALOME_MED::FIELDDOUBLE_out clone1, SALOME_MED::FIELDDOUBLE_out clone2,
49                     SALOME_MED::FIELDDOUBLE_out clone3, SALOME_MED::FIELDDOUBLE_out clone4);
50         CORBA::Boolean isDone();
51         CALCULATOR_ORB::ErrorCode getErrorCode();
52
53 protected:
54         CALCULATOR_ORB::ErrorCode _errorCode;
55 };
56
57
58 extern "C"
59     PortableServer::ObjectId * CALCULATOREngine_factory(
60             CORBA::ORB_ptr orb,
61             PortableServer::POA_ptr poa,
62             PortableServer::ObjectId * contId,
63             const char *instanceName,
64             const char *interfaceName);
65
66
67 #endif