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