]> SALOME platform Git repositories - modules/med.git/blob - src/MedClient/src/libMEDClient.i
Salome HOME
e5a017b270a045d76294e568e9e34e06e98c47f6
[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 class SUPPORTClient : public SUPPORT {
57
58  public:
59
60   SUPPORTClient(const SALOME_MED::SUPPORT_ptr S, 
61                 MESH * M = NULL);
62
63   void blankCopy();
64   void fillCopy();
65   %extend {
66     ~SUPPORTClient() {
67       self->removeReference();
68     }
69   }
70
71 };
72
73 template<class T, class INTERLACING_TAG>
74 class FIELDClient : public FIELD<T,INTERLACING_TAG>
75 {
76 public:
77   template<class U>
78   FIELDClient(U ptrCorba,MEDMEM::SUPPORT * S = NULL);
79   ~FIELDClient();
80 };
81
82 %template (FIELDDOUBLEClient) FIELDClient<double, FullInterlace>;
83 %template (FIELDDOUBLENOINTERLACEClient) FIELDClient<double, NoInterlace>;
84 %template (FIELDINTClient) FIELDClient<int, FullInterlace>;
85 %template (FIELDINTNOINTERLACEClient) FIELDClient<int, NoInterlace>;
86
87 %extend FIELDClient<double, FullInterlace>
88 {
89   %template(FIELDDOUBLEClients) FIELDClient<SALOME_MED::FIELDDOUBLE_ptr>;
90 };
91
92 %extend FIELDClient<double, NoInterlace>
93 {
94   %template(FIELDDOUBLENOINTERLACEClients) FIELDClient<SALOME_MED::FIELDDOUBLE_ptr>;
95 };
96
97 %extend FIELDClient<int, FullInterlace>
98 {
99   %template(FIELDINTClients) FIELDClient<SALOME_MED::FIELDINT_ptr>;
100 };
101
102 %extend FIELDClient<int, NoInterlace>
103 {
104   %template(FIELDINTNOINTERLACEClients) FIELDClient<SALOME_MED::FIELDINT_ptr>;
105 };
106
107 FIELD<double> * getDoublePointer(FIELDClient<double,FullInterlace> * input);
108
109 FIELD<double,NoInterlace> *getDoubleNoInterlacePointer(FIELDClient<double,NoInterlace> * input);
110
111 FIELD<int> * getIntPointer(FIELDClient<int,FullInterlace> * input);
112
113 FIELD<int,NoInterlace> * getIntNoInterlacePointer(FIELDClient<int,NoInterlace> * input);
114
115 %{
116   FIELD<double> * getDoublePointer(FIELDClient<double,FullInterlace> * input)
117     {
118       return (FIELD<double> *) input;
119     }
120
121   FIELD<double,NoInterlace> *getDoubleNoInterlacePointer(FIELDClient<double,NoInterlace> * input)
122     {
123       return (FIELD<double,NoInterlace> *) input;
124     }
125
126   FIELD<int> * getIntPointer(FIELDClient<int,FullInterlace> * input)
127   {
128       return (FIELD<int> *) input;
129   }
130
131   FIELD<int,NoInterlace> * getIntNoInterlacePointer(FIELDClient<int,NoInterlace> * input)
132   {
133       return (FIELD<int,NoInterlace> *) input;
134   }
135 %}