Salome HOME
Creating and importing 2 meshes from the same engine was not working. Mesh ID managem...
[modules/smesh.git] / src / SMESH_I / SMESH_Mesh_i.cxx
1 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SMESH_Mesh_i.cxx
25 //  Author : Paul RASCLE, EDF
26 //  Module : SMESH
27 //  $Header$
28
29 #include "SMESH_Mesh_i.hxx"
30 #include "SMESH_subMesh_i.hxx"
31 #include "SMESH_MEDMesh_i.hxx"
32
33 #include "Utils_CorbaException.hxx"
34 #include "utilities.h"
35
36 #include "SALOME_NamingService.hxx"
37 #include "Utils_SINGLETON.hxx"
38 #include "OpUtil.hxx"
39
40 #include "TCollection_AsciiString.hxx"
41 #include "SMESHDS_Command.hxx"
42 #include "SMESHDS_CommandType.hxx"
43 #include "SMESH_MeshEditor_i.hxx"
44
45 #include <string>
46 #include <iostream>
47 using namespace std;
48
49 //=============================================================================
50 /*!
51  *  Constructor
52  */
53 //=============================================================================
54
55 SMESH_Mesh_i::SMESH_Mesh_i(SMESH_Gen_i * gen_i,
56         GEOM::GEOM_Gen_ptr geomEngine, CORBA::Long studyId, ::SMESH_Mesh * impl)
57 {
58         MESSAGE("SMESH_Mesh_i");
59         _gen_i = gen_i;
60         _geom = GEOM::GEOM_Gen::_narrow(geomEngine);
61         _impl=impl;
62         _studyId=studyId;
63 }
64
65 //=============================================================================
66 /*!
67  *  Destructor
68  */
69 //=============================================================================
70
71 SMESH_Mesh_i::~SMESH_Mesh_i()
72 {
73         MESSAGE("~SMESH_Mesh_i");
74         // ****
75 };
76
77 //=============================================================================
78 /*!
79  *  
80  */
81 //=============================================================================
82
83 CORBA::Boolean SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
84         SMESH::SMESH_Hypothesis_ptr anHyp) throw(SALOME::SALOME_Exception)
85 {
86         MESSAGE("AddHypothesis");
87         // **** proposer liste de subShape (selection multiple)
88
89         GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
90         if (CORBA::is_nil(mySubShape))
91                 THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
92                         SALOME::BAD_PARAM);
93
94         SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
95         if (CORBA::is_nil(myHyp))
96                 THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference",
97                         SALOME::BAD_PARAM);
98         bool ret = false;
99         try
100         {
101                 TopoDS_Shape myLocSubShape =
102                         _gen_i->_ShapeReader->GetShape(_geom, mySubShape);
103                 int hypId = myHyp->GetId();
104                 ret = _impl->AddHypothesis(myLocSubShape, hypId);
105         }
106         catch(SALOME_Exception & S_ex)
107         {
108                 THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
109         }
110         return ret;
111 };
112
113 //=============================================================================
114 /*!
115  *  
116  */
117 //=============================================================================
118
119 CORBA::Boolean
120         SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
121         SMESH::SMESH_Hypothesis_ptr anHyp) throw(SALOME::SALOME_Exception)
122 {
123         MESSAGE("RemoveHypothesis");
124         // **** proposer liste de subShape (selection multiple)
125
126         GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
127         if (CORBA::is_nil(mySubShape))
128                 THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
129                         SALOME::BAD_PARAM);
130
131         SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
132         if (CORBA::is_nil(myHyp))
133                 THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference",
134                         SALOME::BAD_PARAM);
135
136         bool ret = false;
137         try
138         {
139                 TopoDS_Shape myLocSubShape =
140                         _gen_i->_ShapeReader->GetShape(_geom, mySubShape);
141                 int hypId = myHyp->GetId();
142                 ret = _impl->RemoveHypothesis(myLocSubShape, hypId);
143         }
144         catch(SALOME_Exception & S_ex)
145         {
146                 THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
147         }
148         return ret;
149 };
150
151 /**
152  *@TODO Not implemented
153  */
154 SMESH::ListOfHypothesis *
155         SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Shape_ptr aSubShape)
156 throw(SALOME::SALOME_Exception)
157 {
158         MESSAGE("GetHypothesisList: Not implemented");
159         return NULL;
160 };
161
162 //=============================================================================
163 /*!
164  *  
165  */
166 //=============================================================================
167 SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetElementsOnShape(GEOM::
168         GEOM_Shape_ptr aSubShape) throw(SALOME::SALOME_Exception)
169 {
170         MESSAGE("SMESH_Mesh_i::GetElementsOnShape");
171         GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
172         if (CORBA::is_nil(mySubShape))
173                 THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
174                         SALOME::BAD_PARAM);
175
176         int subMeshId = 0;
177         try
178         {
179                 SMESH_subMesh_i *subMeshServant;
180                 TopoDS_Shape myLocSubShape
181                         = _gen_i->_ShapeReader->GetShape(_geom, mySubShape);
182
183                 //Get or Create the SMESH_subMesh object implementation
184
185                 ::SMESH_subMesh * mySubMesh = _impl->GetSubMesh(myLocSubShape);
186                 subMeshId = mySubMesh->GetId();
187
188                 // create a new subMesh object servant if there is none for the shape
189
190                 if (_mapSubMesh.find(subMeshId) != _mapSubMesh.end())
191                 {
192                         ASSERT(_mapSubMesh_i.find(subMeshId) != _mapSubMesh_i.end());
193                         subMeshServant = _mapSubMesh_i[subMeshId];
194                 }
195                 else
196                 {
197                         // create and activate the CORBA servant of Mesh
198                         subMeshServant = new SMESH_subMesh_i(_gen_i, this, subMeshId);
199                         SMESH::SMESH_subMesh_var subMesh
200                                 = SMESH::SMESH_subMesh::_narrow(subMeshServant->_this());
201                         _mapSubMesh[subMeshId] = mySubMesh;
202                         _mapSubMesh_i[subMeshId] = subMeshServant;
203                         _mapSubMeshIor[subMeshId]
204                                 = SMESH::SMESH_subMesh::_duplicate(subMesh);
205                 }
206         }
207         catch(SALOME_Exception & S_ex)
208         {
209                 THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
210         }
211
212         ASSERT(_mapSubMeshIor.find(subMeshId) != _mapSubMeshIor.end());
213         return SMESH::SMESH_subMesh::_duplicate(_mapSubMeshIor[subMeshId]);
214 }
215
216 /**
217  * Translate the UpdateAll SMESHDS_Command to a set of SMESH::log_command.
218  * As the input log need to be resized, it is realocated.
219  * @param logBlock The log where to insert created commands
220  * @param index The place where to insert created commands in log. It is updated
221  * with the place to put new elements.
222  * @return The realocated and resized log.
223  * @TODO Add support for other type of elements
224  */
225 SMESH::log_array_var SMESH_Mesh_i::
226         createUpdateAllCommand(SMESH::log_array_var log, int * index)
227 {
228         MESSAGE("SMESH_Mesh_i::createUpdateAllCommand");
229         SMESH::log_array_var aLog=new SMESH::log_array(log->length()+3);
230         aLog->length(log->length()+3);
231         
232         for(int i=0;i<*index;i++)
233         {               
234                 aLog[i]=log[i];
235         }
236         
237         log->length(0);
238         int id=*index;
239                 
240         //Remove all elements
241         aLog[id].commandType=SMESH::REMOVE_ALL;
242         id++;
243         
244         //Export nodes
245         aLog[id].commandType=SMESH::ADD_NODE;
246         aLog[id].number=_impl->GetMeshDS()->NbNodes();
247
248         double * nodesCoordinates=_impl->GetMeshDS()->getNodesCoordinates();
249         aLog[id].coords=SMESH::double_array(
250                 aLog[id].number*3,
251                 aLog[id].number*3,
252                 nodesCoordinates);
253
254         long * nodesID=_impl->GetMeshDS()->getNodesID();
255         aLog[id].indexes=SMESH::long_array(
256                 aLog[id].number,
257                 aLog[id].number,
258                 nodesID);
259
260         id++;
261         
262         MESSAGE("Export edges");
263         //Export edges
264         aLog[id].commandType=SMESH::ADD_EDGE;
265         aLog[id].number=_impl->GetMeshDS()->NbEdges();  
266         aLog[id].coords.length(0);
267
268         long * edgesIndices=_impl->GetMeshDS()->getEdgesIndices();
269         aLog[id].indexes=SMESH::long_array(
270                 aLog[id].number*3,
271                 aLog[id].number*3,
272                 edgesIndices);
273
274         id++;
275         
276         MESSAGE("Export triangles");
277         //Export triangles
278         aLog[id].commandType=SMESH::ADD_TRIANGLE;
279         aLog[id].number=_impl->GetMeshDS()->NbTriangles();      
280         aLog[id].coords.length(0);
281
282         long * triasIndices=_impl->GetMeshDS()->getTrianglesIndices();
283         aLog[id].indexes=SMESH::long_array(
284                 aLog[id].number*4,
285                 aLog[id].number*4,
286                 triasIndices);
287
288         (*index)=id;
289         return aLog;
290 }
291
292 /**
293  * Return the log of the current mesh. CORBA wrap of the SMESH::GetLog method
294  * with a special treatment for SMESHDS_UpdateAll commands
295  * @param clearAfterGet Tell if the log must be cleared after being returned
296  * @return the log
297  */
298 SMESH::log_array * SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
299         throw(SALOME::SALOME_Exception)
300 {
301         MESSAGE("SMESH_Mesh_i::GetLog");
302
303         SMESH::log_array_var aLog;
304         /*try
305         {*/
306                 list < SMESHDS_Command * >logDS = _impl->GetLog();
307                 aLog = new SMESH::log_array;
308                 int indexLog = 0;
309                 int lg = logDS.size();
310                 MESSAGE("Number of command in the log: "<<lg);
311                 aLog->length(lg);
312                 list < SMESHDS_Command * >::iterator its = logDS.begin();
313                 while (its != logDS.end())
314                 {
315                         SMESHDS_Command *com = *its;
316                         int comType = com->GetType();
317                         //SCRUTE(comType);
318                         int lgcom = com->GetNumber();
319                         //SCRUTE(lgcom);
320                         const list < int >&intList = com->GetIndexes();
321                         int inum = intList.size();
322                         //SCRUTE(inum);
323                         list < int >::const_iterator ii = intList.begin();
324                         const list < double >&coordList = com->GetCoords();
325                         int rnum = coordList.size();
326                         //SCRUTE(rnum);
327                         list < double >::const_iterator ir = coordList.begin();
328                         aLog[indexLog].commandType = comType;
329                         if(comType==SMESHDS_UpdateAll)
330                         {
331                                 aLog=createUpdateAllCommand(aLog, &indexLog);
332                         }
333                         else
334                         {
335                                 aLog[indexLog].number = lgcom;
336                                 aLog[indexLog].coords.length(rnum);
337                                 aLog[indexLog].indexes.length(inum);
338                                 for (int i = 0; i < rnum; i++)
339                                 {
340                                         aLog[indexLog].coords[i] = *ir;
341                                         //MESSAGE(" "<<i<<" "<<ir.Value());
342                                         ir++;
343                                 }
344                                 for (int i = 0; i < inum; i++)
345                                 {
346                                         aLog[indexLog].indexes[i] = *ii;
347                                         //MESSAGE(" "<<i<<" "<<ii.Value());
348                                         ii++;
349                                 }
350                                 indexLog++;
351                         }
352                         its++;
353                 }
354                 if (clearAfterGet) _impl->ClearLog();
355                 return aLog._retn();
356         /*}
357         catch(SALOME_Exception & S_ex)
358         {
359                 THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
360         }*/
361 }
362
363 //  SMESH::string_array* SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
364 //    throw (SALOME::SALOME_Exception)
365 //  {
366 //    MESSAGE("SMESH_Mesh_i::GetLog");
367
368 //    SMESH::string_array_var aLog;
369 //    try
370 //      {
371 //        const SMESHDS_ListOfCommand& logDS =_impl->GetLog();
372 //        aLog = new SMESH::string_array;
373 //        int logSize = 0;
374 //        int indexLog = 0;
375 //        int lg = logDS.Extent();
376 //        SCRUTE(lg);
377 //        SMESHDS_ListIteratorOfListOfCommand its(logDS);
378 //        while(its.More())
379 //        {
380 //      Handle(SMESHDS_Command) com = its.Value();
381 //      int comType = com->GetType();
382 //      SCRUTE(comType);
383 //      int lgcom = com->GetNumber();
384 //      SCRUTE(lgcom);
385 //      logSize += lgcom;
386 //      aLog->length(logSize);
387 //      SCRUTE(logSize);
388 //      const TColStd_ListOfInteger& intList = com->GetIndexes();
389 //      TColStd_ListIteratorOfListOfInteger ii(intList);
390 //      const TColStd_ListOfReal& coordList = com->GetCoords();
391 //      TColStd_ListIteratorOfListOfReal ir(coordList);
392 //      for (int icom = 1; icom <= lgcom; icom++)
393 //        {
394 //          ostringstream S;
395 //          switch (comType)
396 //            {
397 //            case SMESHDS_AddNode:
398 //          S << "AddNode " << ii.Value(); ii.Next();
399 //          S << " " << ir.Value(); ir.Next(); 
400 //          S << " " << ir.Value(); ir.Next();
401 //          S << " " << ir.Value(); ir.Next();
402 //          break;
403 //            case SMESHDS_AddEdge:
404 //          S << "AddEdge " << ii.Value(); ii.Next();
405 //          S << " " << ii.Value(); ii.Next();
406 //          S << " " << ii.Value(); ii.Next();
407 //          break;
408 //            case SMESHDS_AddTriangle:
409 //          S << "AddFace " << ii.Value(); ii.Next();
410 //          S << " " << ii.Value(); ii.Next();
411 //          S << " " << ii.Value(); ii.Next();
412 //          S << " " << ii.Value(); ii.Next();
413 //          break;
414 //            case SMESHDS_AddQuadrangle:
415 //          S << "AddFace " << ii.Value(); ii.Next();
416 //          S << " " << ii.Value(); ii.Next();
417 //          S << " " << ii.Value(); ii.Next();
418 //          S << " " << ii.Value(); ii.Next();
419 //          S << " " << ii.Value(); ii.Next();
420 //          break;
421 //            case SMESHDS_AddTetrahedron:
422 //          S << "AddVolume " << ii.Value(); ii.Next();
423 //          S << " " << ii.Value(); ii.Next();
424 //          S << " " << ii.Value(); ii.Next();
425 //          S << " " << ii.Value(); ii.Next();
426 //          S << " " << ii.Value(); ii.Next();
427 //          break;
428 //            case SMESHDS_AddPyramid:
429 //          S << "AddVolume " << ii.Value(); ii.Next();
430 //          S << " " << ii.Value(); ii.Next();
431 //          S << " " << ii.Value(); ii.Next();
432 //          S << " " << ii.Value(); ii.Next();
433 //          S << " " << ii.Value(); ii.Next();
434 //          S << " " << ii.Value(); ii.Next();
435 //          break;
436 //            case SMESHDS_AddPrism:
437 //          S << "AddVolume " << ii.Value(); ii.Next();
438 //          S << " " << ii.Value(); ii.Next();
439 //          S << " " << ii.Value(); ii.Next();
440 //          S << " " << ii.Value(); ii.Next();
441 //          S << " " << ii.Value(); ii.Next();
442 //          S << " " << ii.Value(); ii.Next();
443 //          S << " " << ii.Value(); ii.Next();
444 //          break;
445 //            case SMESHDS_AddHexahedron:
446 //          S << "AddVolume " << ii.Value(); ii.Next();
447 //          S << " " << ii.Value(); ii.Next();
448 //          S << " " << ii.Value(); ii.Next();
449 //          S << " " << ii.Value(); ii.Next();
450 //          S << " " << ii.Value(); ii.Next();
451 //          S << " " << ii.Value(); ii.Next();
452 //          S << " " << ii.Value(); ii.Next();
453 //          S << " " << ii.Value(); ii.Next();
454 //          S << " " << ii.Value(); ii.Next();
455 //          break;
456 //            case SMESHDS_RemoveNode:
457 //          S << "RemoveNode " << ii.Value(); ii.Next();
458 //          break;
459 //            case SMESHDS_RemoveElement:
460 //          S << "RemoveElement " << ii.Value(); ii.Next();
461 //          break;
462 //            default:
463 //          ASSERT(0);
464 //          break;
465 //            }
466 //          string ch = S.str();
467 //          SCRUTE(ch);
468 //          aLog[indexLog++] = CORBA::string_dup(ch.c_str());
469 //        }
470 //      its.Next();
471 //        }
472 //        if (clearAfterGet) _impl->ClearLog();
473 //      }
474 //    catch (SALOME_Exception& S_ex)
475 //      {
476 //        THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
477 //      }
478 //    return aLog._retn();
479 //  }
480
481 //=============================================================================
482 /*!
483  *  
484  */
485 //=============================================================================
486
487 void SMESH_Mesh_i::ClearLog() throw(SALOME::SALOME_Exception)
488 {
489         MESSAGE("SMESH_Mesh_i::ClearLog");
490         // ****
491 }
492
493 //=============================================================================
494 /*!
495  *  
496  */
497 //=============================================================================
498
499 CORBA::Long SMESH_Mesh_i::GetId()throw(SALOME::SALOME_Exception)
500 {
501         return _impl->GetId();
502 }
503
504 //=============================================================================
505 /*!
506  *  
507  */
508 //=============================================================================
509
510 CORBA::Long SMESH_Mesh_i::GetStudyId()throw(SALOME::SALOME_Exception)
511 {
512         return _studyId;
513 }
514
515 //=============================================================================
516 /*!
517  *  
518  */
519 //=============================================================================
520
521 ::SMESH_Mesh & SMESH_Mesh_i::GetImpl()
522 {
523         MESSAGE("SMESH_Mesh_i::GetImpl()");
524         return *_impl;
525 }
526
527 //=============================================================================
528 /*!
529  *  
530  */
531 //=============================================================================
532
533 GEOM::GEOM_Gen_ptr SMESH_Mesh_i::GetGeomEngine()
534 {
535         MESSAGE("SMESH_Mesh_i::GetGeomEngine");
536         return GEOM::GEOM_Gen::_duplicate(_geom);
537 }
538
539 //=============================================================================
540 /*!
541  *  
542  */
543 //=============================================================================
544
545 void SMESH_Mesh_i::SetIor(SMESH::SMESH_Mesh_ptr myIor)
546 {
547         MESSAGE("SMESH_Mesh_i::SetIor");
548         _myIor = SMESH::SMESH_Mesh::_duplicate(myIor);
549         ASSERT(!CORBA::is_nil(_myIor));
550 }
551
552 //=============================================================================
553 /*!
554  *  
555  */
556 //=============================================================================
557
558 SMESH::SMESH_Mesh_ptr SMESH_Mesh_i::GetIor()
559 {
560         MESSAGE("SMESH_Mesh_i::GetIor");
561         ASSERT(!CORBA::is_nil(_myIor));
562         return SMESH::SMESH_Mesh::_duplicate(_myIor);
563 }
564
565 //=============================================================================
566 /*!
567  *  
568  */
569 //=============================================================================
570
571 SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor()
572 {
573         SMESH_MeshEditor_i *aMeshEditor =
574                 new SMESH_MeshEditor_i(_impl->GetMeshDS());
575         SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();
576         return aMesh._retn();
577 }
578
579 //=============================================================================
580 /*!
581  *  
582  */
583 //=============================================================================
584
585 SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh()throw(SALOME::SALOME_Exception)
586 {
587         SMESH_MEDMesh_i *aMedMesh = new SMESH_MEDMesh_i(this);
588         SALOME_MED::MESH_var aMesh = aMedMesh->_this();
589         return aMesh._retn();
590 }
591
592 //=============================================================================
593 /*!
594  *  
595  */
596 //=============================================================================
597 CORBA::Long SMESH_Mesh_i::NbNodes()throw(SALOME::SALOME_Exception)
598 {
599         return _impl->NbNodes();
600 }
601
602 //=============================================================================
603 /*!
604  *  
605  */
606 //=============================================================================
607 CORBA::Long SMESH_Mesh_i::NbEdges()throw(SALOME::SALOME_Exception)
608 {
609         return _impl->NbEdges();
610 }
611
612 //=============================================================================
613 /*!
614  *  
615  */
616 //=============================================================================
617 CORBA::Long SMESH_Mesh_i::NbFaces()throw(SALOME::SALOME_Exception)
618 {
619         return _impl->NbFaces();
620 }
621
622 CORBA::Long SMESH_Mesh_i::NbTriangles()throw(SALOME::SALOME_Exception)
623 {
624         return _impl->NbTriangles();
625 }
626
627 CORBA::Long SMESH_Mesh_i::NbQuadrangles()throw(SALOME::SALOME_Exception)
628 {
629         return _impl->NbQuadrangles();
630 }
631
632 //=============================================================================
633 /*!
634  *  
635  */
636 //=============================================================================
637 CORBA::Long SMESH_Mesh_i::NbVolumes()throw(SALOME::SALOME_Exception)
638 {
639         return _impl->NbVolumes();
640 }
641
642 CORBA::Long SMESH_Mesh_i::NbTetras()throw(SALOME::SALOME_Exception)
643 {
644         return _impl->NbTetras();
645 }
646
647 CORBA::Long SMESH_Mesh_i::NbHexas()throw(SALOME::SALOME_Exception)
648 {
649         return _impl->NbHexas();
650 }
651
652 //=============================================================================
653 /*!
654  *  
655  */
656 //=============================================================================
657 CORBA::Long SMESH_Mesh_i::NbSubMesh()throw(SALOME::SALOME_Exception)
658 {
659         return _impl->NbSubMesh();
660 }
661
662 /*!
663  * Export mesh to a file
664  * @param fileName file name where to export the file
665  * @param fileType Currently it could be either "DAT", "UNV" or "MED".
666  */
667 void SMESH_Mesh_i::Export(const char* fileName, const char* fileType)
668         throw (SALOME::SALOME_Exception)
669 {
670         _impl->Export(fileName, fileType);
671 }