]> SALOME platform Git repositories - modules/hexablock.git/blob - src/HEXABLOCK_I/HexCrossElements_impl.cxx
Salome HOME
Merge from V6_main 01/04/2013
[modules/hexablock.git] / src / HEXABLOCK_I / HexCrossElements_impl.cxx
1 // Copyright (C) 2009-2013  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 using namespace std;
20 #include "hexa_base.hxx"
21 #include "HexVertex_impl.hxx"
22 #include "HexEdge_impl.hxx"
23 #include "HexQuad_impl.hxx"
24 #include "HexHexa_impl.hxx"
25 #include "HexCylinder_impl.hxx"
26 #include "HexCrossElements_impl.hxx"
27 #include "HEXABLOCK.hxx"
28
29
30 CrossElements_impl::CrossElements_impl( HEXA_NS::CrossElements *ptrCpp ):_crossElements_cpp(ptrCpp)
31 {
32 }
33
34
35 HEXA_NS::CrossElements* CrossElements_impl::GetImpl()
36 {
37   return _crossElements_cpp;
38 }
39
40
41 Vertex_ptr CrossElements_impl::getVertexIJK(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
42   throw (SALOME::SALOME_Exception)
43 {
44   Vertex_ptr result = Vertex::_nil();
45   HEXA_NS::Vertex* v = _crossElements_cpp->getVertexIJK(part, x, y, z);
46   if ( v != NULL ){
47     Vertex_impl* servantCorba = new Vertex_impl(v);
48     result = servantCorba->_this();
49   }
50   return result;
51 }
52
53
54 Edge_ptr CrossElements_impl::getEdgeI(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
55   throw (SALOME::SALOME_Exception)
56 {
57   Edge_ptr result = Edge::_nil();
58   HEXA_NS::Edge* e = _crossElements_cpp->getEdgeI(part, x, y, z);
59   if ( e != NULL ){
60     Edge_impl* servantCorba = new Edge_impl(e);
61     result = servantCorba->_this();
62   }
63   return result;
64 }
65
66
67 Edge_ptr CrossElements_impl::getEdgeJ(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
68   throw (SALOME::SALOME_Exception)
69 {
70   Edge_ptr result = Edge::_nil();
71   HEXA_NS::Edge* e = _crossElements_cpp->getEdgeJ(part, x, y, z);
72   if ( e != NULL ){
73     Edge_impl* servantCorba = new Edge_impl(e);
74     result = servantCorba->_this();
75   }
76   return result;
77 }
78
79
80 Edge_ptr CrossElements_impl::getEdgeK(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
81   throw (SALOME::SALOME_Exception)
82 {
83   Edge_ptr result = Edge::_nil();
84   HEXA_NS::Edge* e = _crossElements_cpp->getEdgeK(part, x, y, z);
85   if ( e != NULL ){
86     Edge_impl* servantCorba = new Edge_impl(e);
87     result = servantCorba->_this();
88   }
89   return result;
90 }
91
92 Quad_ptr CrossElements_impl::getQuadIJ(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
93   throw (SALOME::SALOME_Exception)
94 {
95   Quad_ptr result = Quad::_nil();
96   HEXA_NS::Quad* q = _crossElements_cpp->getQuadIJ(part, x, y, z);
97   if ( q != NULL ){
98     Quad_impl* servantCorba = new Quad_impl(q);
99     result = servantCorba->_this();
100   }
101   return result;
102 }
103
104
105 Quad_ptr CrossElements_impl::getQuadIK(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
106   throw (SALOME::SALOME_Exception)
107 {
108   Quad_ptr result = Quad::_nil();
109   HEXA_NS::Quad* q = _crossElements_cpp->getQuadIK(part, x, y, z);
110   if ( q != NULL ){
111     Quad_impl* servantCorba = new Quad_impl(q);
112     result = servantCorba->_this();
113   }
114   return result;
115 }
116
117
118 Quad_ptr CrossElements_impl::getQuadJK(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
119   throw (SALOME::SALOME_Exception)
120 {
121   Quad_ptr result = Quad::_nil();
122   HEXA_NS::Quad* q = _crossElements_cpp->getQuadJK(part, x, y, z);
123   if ( q != NULL ){
124     Quad_impl* servantCorba = new Quad_impl(q);
125     result = servantCorba->_this();
126   }
127   return result;
128 }
129
130
131 Hexa_ptr CrossElements_impl::getHexaIJK(::CORBA::Long part, ::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z) throw (SALOME::SALOME_Exception)
132 {
133   Hexa_ptr result = Hexa::_nil();
134   HEXA_NS::Hexa* h = _crossElements_cpp->getHexaIJK(part, x, y, z);
135   if ( h != NULL ){
136     Hexa_impl* servantCorba = new Hexa_impl(h);
137     result = servantCorba->_this();
138   }
139   return result;
140 }
141
142 ::CORBA::Long CrossElements_impl::saveVtk(const char* fname) throw (SALOME::SALOME_Exception)
143 {
144   ::CORBA::Long ret = _crossElements_cpp->saveVtk( fname );
145   return ret;
146 }
147
148 void CrossElements_impl::dump() throw (SALOME::SALOME_Exception)
149 {
150   _crossElements_cpp->dump();
151 }
152
153
154 void CrossElements_impl::printName() throw (SALOME::SALOME_Exception)
155 {
156   _crossElements_cpp->printName();
157 }
158
159 char* CrossElements_impl::getName() throw (SALOME::SALOME_Exception)
160 {
161   return CORBA::string_dup( _crossElements_cpp->getName() );
162 }
163
164 // ========================================================= setName
165 void CrossElements_impl::setName(const char* name) 
166      throw (SALOME::SALOME_Exception)
167 {
168   _crossElements_cpp->setName (name);
169 }
170
171 // ::CORBA::Long CrossElements_impl::countVertex() throw (SALOME::SALOME_Exception)
172 // {
173 //   ::CORBA::Long n = _crossElements_cpp->countVertex();
174 //   return n;
175 // }
176 // 
177 // ::CORBA::Long CrossElements_impl::countEdge() throw (SALOME::SALOME_Exception)
178 // {
179 //   ::CORBA::Long n = _crossElements_cpp->countEdge();
180 //   return n;
181 // }
182 // 
183 // ::CORBA::Long CrossElements_impl::countQuad() throw (SALOME::SALOME_Exception)
184 // {
185 //   ::CORBA::Long n = _crossElements_cpp->countQuad();
186 //   return n;
187 // }
188 // 
189 // ::CORBA::Long CrossElements_impl::countHexa() throw (SALOME::SALOME_Exception)
190 // {
191 //   ::CORBA::Long n = _crossElements_cpp->countHexa();
192 //   return n;
193 // }
194 // 
195 // 
196 // 
197 // Vertex_ptr CrossElements_impl::getVertex(::CORBA::Long n) throw (SALOME::SALOME_Exception)
198 // {
199 //   HEXA_NS::Vertex* v = _crossElements_cpp->getVertex(n);
200 //   Vertex_impl* servantCorba = new Vertex_impl(v);
201 //   return servantCorba->_this();
202 // }
203 // 
204 // Edge_ptr CrossElements_impl::getEdge(::CORBA::Long n) throw (SALOME::SALOME_Exception)
205 // {
206 //   HEXA_NS::Edge* e = _crossElements_cpp->getEdge(n);
207 //   Edge_impl* servantCorba = new Edge_impl(e);
208 //   return servantCorba->_this();
209 // }
210 // 
211 // Quad_ptr CrossElements_impl::getQuad(::CORBA::Long n) throw (SALOME::SALOME_Exception)
212 // {
213 //   HEXA_NS::Quad* q = _crossElements_cpp->getQuad(n);
214 //   Quad_impl* servantCorba = new Quad_impl(q);
215 //   return servantCorba->_this();
216 // }
217 // 
218 // Hexa_ptr CrossElements_impl::getHexa(::CORBA::Long n) throw (SALOME::SALOME_Exception)
219 // {
220 //   HEXA_NS::Hexa* h = _crossElements_cpp->getHexa(n);
221 //   Hexa_impl* servantCorba = new Hexa_impl(h);
222 //   return servantCorba->_this();
223 // }
224 // 
225 // 
226 // 
227 // ::CORBA::Long CrossElements_impl::saveVtk( const char* fname ) throw (SALOME::SALOME_Exception)
228 // {
229 //   ::CORBA::Long ret = _crossElements_cpp->saveVtk( fname );
230 //   return ret;
231 // }
232 // 
233 // 
234 // 
235 // Vertex_ptr CrossElements_impl::getVertexIJK(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
236 //   throw (SALOME::SALOME_Exception)
237 // {
238 //   Vertex_ptr result = Vertex::_nil();
239 // //   HEXA_NS::Vertex* v = _crossElements_cpp->getVertexIJK(x, y,z);
240 //   HEXA_NS::Vertex* v = NULL;
241 //   _crossElements_cpp->toto();
242 //   if ( v != NULL ){
243 //     Vertex_impl* servantCorba = new Vertex_impl(v);
244 //     result = servantCorba->_this();
245 //   }
246 //   return result;
247 // }
248 // 
249 // 
250 // Edge_ptr CrossElements_impl::getEdgeI(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
251 //   throw (SALOME::SALOME_Exception)
252 // {
253 //   Edge_ptr result = Edge::_nil();
254 //   HEXA_NS::Edge* e = _crossElements_cpp->getEdgeI(x, y, z);
255 //   if ( e != NULL ){
256 //     Edge_impl* servantCorba = new Edge_impl(e);
257 //     result = servantCorba->_this();
258 //   }
259 //   return result;
260 // }
261 // 
262 // 
263 // Edge_ptr CrossElements_impl::getEdgeJ(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
264 //   throw (SALOME::SALOME_Exception)
265 // {
266 //   Edge_ptr result = Edge::_nil();
267 //   HEXA_NS::Edge* e = _crossElements_cpp->getEdgeJ(x, y, z);
268 //   if ( e != NULL ){
269 //     Edge_impl* servantCorba = new Edge_impl(e);
270 //     result = servantCorba->_this();
271 //   }
272 //   return result;
273 // }
274 // 
275 // 
276 // Edge_ptr CrossElements_impl::getEdgeK(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
277 //   throw (SALOME::SALOME_Exception)
278 // {
279 //   Edge_ptr result = Edge::_nil();
280 //   HEXA_NS::Edge* e = _crossElements_cpp->getEdgeK(x, y, z);
281 //   if ( e != NULL ){
282 //     Edge_impl* servantCorba = new Edge_impl(e);
283 //     result = servantCorba->_this();
284 //   }
285 //   return result;
286 // }
287 // 
288 // Quad_ptr CrossElements_impl::getQuadIJ(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
289 //   throw (SALOME::SALOME_Exception)
290 // {
291 //   Quad_ptr result = Quad::_nil();
292 //   HEXA_NS::Quad* q = _crossElements_cpp->getQuadIJ(x, y, z);
293 //   if ( q != NULL ){
294 //     Quad_impl* servantCorba = new Quad_impl(q);
295 //     result = servantCorba->_this();
296 //   }
297 //   return result;
298 // }
299 // 
300 // 
301 // Quad_ptr CrossElements_impl::getQuadIK(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
302 //   throw (SALOME::SALOME_Exception)
303 // {
304 //   Quad_ptr result = Quad::_nil();
305 //   HEXA_NS::Quad* q = _crossElements_cpp->getQuadIK(x, y, z);
306 //   if ( q != NULL ){
307 //     Quad_impl* servantCorba = new Quad_impl(q);
308 //     result = servantCorba->_this();
309 //   }
310 //   return result;
311 // }
312 // 
313 // 
314 // Quad_ptr CrossElements_impl::getQuadJK(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z)
315 //   throw (SALOME::SALOME_Exception)
316 // {
317 //   Quad_ptr result = Quad::_nil();
318 //   HEXA_NS::Quad* q = _crossElements_cpp->getQuadJK(x, y, z);
319 //   if ( q != NULL ){
320 //     Quad_impl* servantCorba = new Quad_impl(q);
321 //     result = servantCorba->_this();
322 //   }
323 //   return result;
324 // }
325 // 
326 // 
327 // Hexa_ptr CrossElements_impl::getHexaIJK(::CORBA::Long x, ::CORBA::Long y, ::CORBA::Long z) throw (SALOME::SALOME_Exception)
328 // {
329 //   Hexa_ptr result = Hexa::_nil();
330 //   HEXA_NS::Hexa* h = _crossElements_cpp->getHexaIJK(x, y, z);
331 //   if ( h != NULL ){
332 //     Hexa_impl* servantCorba = new Hexa_impl(h);
333 //     result = servantCorba->_this();
334 //   }
335 //   return result;
336 // }
337
338