]> SALOME platform Git repositories - modules/med.git/blob - src/MedClient/src/libMEDClient.i
Salome HOME
Join modifications from branch CEAFor_V3_2_0
[modules/med.git] / src / MedClient / src / libMEDClient.i
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/
19 //
20 %module libMEDClient
21
22 %{
23 #include "MESHClient.hxx"
24 #include "SUPPORTClient.hxx"
25 #include "FIELDClient.hxx"
26 #include CORBA_CLIENT_HEADER(MED)
27
28   using namespace MEDMEM;
29   using namespace MED_EN;
30 %}
31
32 %include "libMedCorba_Swig.i"
33 %include "libMEDMEM_Swig.i"
34
35 %typecheck(SWIG_TYPECHECK_POINTER) SALOME_MED::FIELDDOUBLE_ptr, SALOME_MED::FIELDINT_ptr
36 {
37   $1 = ($input != 0);
38 }
39
40
41 class MESHClient : public MESH {
42
43  public:
44   
45   MESHClient(const SALOME_MED::MESH_ptr m);
46
47   void blankCopy();
48   void fillCopy();
49   %extend {
50     ~MESHClient(){
51       self->removeReference();
52     }
53   }
54 };
55
56 MESH * getMeshPointer(MESHClient * input);
57 %{
58   MESH * getMeshPointer(MESHClient * input)
59   {
60     return (MESH *) input;
61   }
62 %}
63
64 class SUPPORTClient : public SUPPORT {
65
66  public:
67
68   SUPPORTClient(const SALOME_MED::SUPPORT_ptr S, 
69                 MESH * M = NULL);
70
71   void blankCopy();
72   void fillCopy();
73   %extend {
74     ~SUPPORTClient() {
75       self->removeReference();
76     }
77   }
78
79 };
80
81 template<class T, class INTERLACING_TAG>
82 class FIELDClient : public FIELD<T,INTERLACING_TAG>
83 {
84 public:
85   template<class U>
86   FIELDClient(U ptrCorba,MEDMEM::SUPPORT * S = NULL);
87   ~FIELDClient();
88 };
89
90 %template (FIELDDOUBLEClient) FIELDClient<double, FullInterlace>;
91 %template (FIELDDOUBLENOINTERLACEClient) FIELDClient<double, NoInterlace>;
92 %template (FIELDINTClient) FIELDClient<int, FullInterlace>;
93 %template (FIELDINTNOINTERLACEClient) FIELDClient<int, NoInterlace>;
94
95 %extend FIELDClient<double, FullInterlace>
96 {
97   %template(FIELDDOUBLEClients) FIELDClient<SALOME_MED::FIELDDOUBLE_ptr>;
98 };
99
100 %extend FIELDClient<double, NoInterlace>
101 {
102   %template(FIELDDOUBLENOINTERLACEClients) FIELDClient<SALOME_MED::FIELDDOUBLE_ptr>;
103 };
104
105 %extend FIELDClient<int, FullInterlace>
106 {
107   %template(FIELDINTClients) FIELDClient<SALOME_MED::FIELDINT_ptr>;
108 };
109
110 %extend FIELDClient<int, NoInterlace>
111 {
112   %template(FIELDINTNOINTERLACEClients) FIELDClient<SALOME_MED::FIELDINT_ptr>;
113 };
114
115 FIELD<double> * getDoublePointer(FIELDClient<double,FullInterlace> * input);
116
117 FIELD<double,NoInterlace> *getDoubleNoInterlacePointer(FIELDClient<double,NoInterlace> * input);
118
119 FIELD<int> * getIntPointer(FIELDClient<int,FullInterlace> * input);
120
121 FIELD<int,NoInterlace> * getIntNoInterlacePointer(FIELDClient<int,NoInterlace> * input);
122
123 %{
124   FIELD<double> * getDoublePointer(FIELDClient<double,FullInterlace> * input)
125     {
126       return (FIELD<double> *) input;
127     }
128
129   FIELD<double,NoInterlace> *getDoubleNoInterlacePointer(FIELDClient<double,NoInterlace> * input)
130     {
131       return (FIELD<double,NoInterlace> *) input;
132     }
133
134   FIELD<int> * getIntPointer(FIELDClient<int,FullInterlace> * input)
135   {
136       return (FIELD<int> *) input;
137   }
138
139   FIELD<int,NoInterlace> * getIntNoInterlacePointer(FIELDClient<int,NoInterlace> * input)
140   {
141       return (FIELD<int,NoInterlace> *) input;
142   }
143 %}