Salome HOME
Merge br_enable_import_mesh. Enable import mesh and save/load SMESH study.
[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. It is updated
235  * with the place to put new elements.
236  * @return The realocated and resized log.
237  * @TODO Add support for other type of elements
238  */
239 SMESH::log_array_var SMESH_Mesh_i::
240         createUpdateAllCommand(SMESH::log_array_var log, int * index)
241 {
242         MESSAGE("SMESH_Mesh_i::createUpdateAllCommand");
243         SMESH::log_array_var aLog=new SMESH::log_array(log->length()+3);
244         aLog->length(log->length()+3);
245         
246         for(int i=0;i<*index;i++)
247         {               
248                 aLog[i]=log[i];
249         }
250         
251         log->length(0);
252         int id=*index;
253                 
254         //Remove all elements
255         aLog[id].commandType=SMESH::REMOVE_ALL;
256         id++;
257         
258         //Export nodes
259         aLog[id].commandType=SMESH::ADD_NODE;
260         aLog[id].number=_impl->GetMeshDS()->NbNodes();
261
262         double * nodesCoordinates=_impl->GetMeshDS()->getNodesCoordinates();
263         aLog[id].coords=SMESH::double_array(
264                 aLog[id].number*3,
265                 aLog[id].number*3,
266                 nodesCoordinates);
267
268         long * nodesID=_impl->GetMeshDS()->getNodesID();
269         aLog[id].indexes=SMESH::long_array(
270                 aLog[id].number,
271                 aLog[id].number,
272                 nodesID);
273
274         id++;
275         
276         MESSAGE("Export edges");
277         //Export edges
278         aLog[id].commandType=SMESH::ADD_EDGE;
279         aLog[id].number=_impl->GetMeshDS()->NbEdges();  
280         aLog[id].coords.length(0);
281
282         long * edgesIndices=_impl->GetMeshDS()->getEdgesIndices();
283         aLog[id].indexes=SMESH::long_array(
284                 aLog[id].number*3,
285                 aLog[id].number*3,
286                 edgesIndices);
287
288         id++;
289         
290         MESSAGE("Export triangles");
291         //Export triangles
292         aLog[id].commandType=SMESH::ADD_TRIANGLE;
293         aLog[id].number=_impl->GetMeshDS()->NbTriangles();      
294         aLog[id].coords.length(0);
295
296         long * triasIndices=_impl->GetMeshDS()->getTrianglesIndices();
297         aLog[id].indexes=SMESH::long_array(
298                 aLog[id].number*4,
299                 aLog[id].number*4,
300                 triasIndices);
301
302         (*index)=id;
303         return aLog;
304 }
305
306 /**
307  * Return the log of the current mesh. CORBA wrap of the SMESH::GetLog method
308  * with a special treatment for SMESHDS_UpdateAll commands
309  * @param clearAfterGet Tell if the log must be cleared after being returned
310  * @return the log
311  */
312 SMESH::log_array * SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
313         throw(SALOME::SALOME_Exception)
314 {
315         MESSAGE("SMESH_Mesh_i::GetLog");
316
317         SMESH::log_array_var aLog;
318         /*try
319         {*/
320                 list < SMESHDS_Command * >logDS = _impl->GetLog();
321                 aLog = new SMESH::log_array;
322                 int indexLog = 0;
323                 int lg = logDS.size();
324                 MESSAGE("Number of command in the log: "<<lg);
325                 aLog->length(lg);
326                 list < SMESHDS_Command * >::iterator its = logDS.begin();
327                 while (its != logDS.end())
328                 {
329                         SMESHDS_Command *com = *its;
330                         int comType = com->GetType();
331                         //SCRUTE(comType);
332                         int lgcom = com->GetNumber();
333                         //SCRUTE(lgcom);
334                         const list < int >&intList = com->GetIndexes();
335                         int inum = intList.size();
336                         //SCRUTE(inum);
337                         list < int >::const_iterator ii = intList.begin();
338                         const list < double >&coordList = com->GetCoords();
339                         int rnum = coordList.size();
340                         //SCRUTE(rnum);
341                         list < double >::const_iterator ir = coordList.begin();
342                         aLog[indexLog].commandType = comType;
343                         if(comType==SMESHDS_UpdateAll)
344                         {
345                                 aLog=createUpdateAllCommand(aLog, &indexLog);
346                         }
347                         else
348                         {
349                                 aLog[indexLog].number = lgcom;
350                                 aLog[indexLog].coords.length(rnum);
351                                 aLog[indexLog].indexes.length(inum);
352                                 for (int i = 0; i < rnum; i++)
353                                 {
354                                         aLog[indexLog].coords[i] = *ir;
355                                         //MESSAGE(" "<<i<<" "<<ir.Value());
356                                         ir++;
357                                 }
358                                 for (int i = 0; i < inum; i++)
359                                 {
360                                         aLog[indexLog].indexes[i] = *ii;
361                                         //MESSAGE(" "<<i<<" "<<ii.Value());
362                                         ii++;
363                                 }
364                                 indexLog++;
365                         }
366                         its++;
367                 }
368                 if (clearAfterGet) _impl->ClearLog();
369                 return aLog._retn();
370         /*}
371         catch(SALOME_Exception & S_ex)
372         {
373                 THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
374         }*/
375 }
376
377 //  SMESH::string_array* SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
378 //    throw (SALOME::SALOME_Exception)
379 //  {
380 //    MESSAGE("SMESH_Mesh_i::GetLog");
381
382 //    SMESH::string_array_var aLog;
383 //    try
384 //      {
385 //        const SMESHDS_ListOfCommand& logDS =_impl->GetLog();
386 //        aLog = new SMESH::string_array;
387 //        int logSize = 0;
388 //        int indexLog = 0;
389 //        int lg = logDS.Extent();
390 //        SCRUTE(lg);
391 //        SMESHDS_ListIteratorOfListOfCommand its(logDS);
392 //        while(its.More())
393 //        {
394 //      Handle(SMESHDS_Command) com = its.Value();
395 //      int comType = com->GetType();
396 //      SCRUTE(comType);
397 //      int lgcom = com->GetNumber();
398 //      SCRUTE(lgcom);
399 //      logSize += lgcom;
400 //      aLog->length(logSize);
401 //      SCRUTE(logSize);
402 //      const TColStd_ListOfInteger& intList = com->GetIndexes();
403 //      TColStd_ListIteratorOfListOfInteger ii(intList);
404 //      const TColStd_ListOfReal& coordList = com->GetCoords();
405 //      TColStd_ListIteratorOfListOfReal ir(coordList);
406 //      for (int icom = 1; icom <= lgcom; icom++)
407 //        {
408 //          ostringstream S;
409 //          switch (comType)
410 //            {
411 //            case SMESHDS_AddNode:
412 //          S << "AddNode " << ii.Value(); ii.Next();
413 //          S << " " << ir.Value(); ir.Next(); 
414 //          S << " " << ir.Value(); ir.Next();
415 //          S << " " << ir.Value(); ir.Next();
416 //          break;
417 //            case SMESHDS_AddEdge:
418 //          S << "AddEdge " << ii.Value(); ii.Next();
419 //          S << " " << ii.Value(); ii.Next();
420 //          S << " " << ii.Value(); ii.Next();
421 //          break;
422 //            case SMESHDS_AddTriangle:
423 //          S << "AddFace " << 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_AddQuadrangle:
429 //          S << "AddFace " << 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 //          break;
435 //            case SMESHDS_AddTetrahedron:
436 //          S << "AddVolume " << ii.Value(); ii.Next();
437 //          S << " " << ii.Value(); ii.Next();
438 //          S << " " << ii.Value(); ii.Next();
439 //          S << " " << ii.Value(); ii.Next();
440 //          S << " " << ii.Value(); ii.Next();
441 //          break;
442 //            case SMESHDS_AddPyramid:
443 //          S << "AddVolume " << 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 //          S << " " << ii.Value(); ii.Next();
449 //          break;
450 //            case SMESHDS_AddPrism:
451 //          S << "AddVolume " << 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 //          S << " " << ii.Value(); ii.Next();
458 //          break;
459 //            case SMESHDS_AddHexahedron:
460 //          S << "AddVolume " << 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 //          S << " " << ii.Value(); ii.Next();
469 //          break;
470 //            case SMESHDS_RemoveNode:
471 //          S << "RemoveNode " << ii.Value(); ii.Next();
472 //          break;
473 //            case SMESHDS_RemoveElement:
474 //          S << "RemoveElement " << ii.Value(); ii.Next();
475 //          break;
476 //            default:
477 //          ASSERT(0);
478 //          break;
479 //            }
480 //          string ch = S.str();
481 //          SCRUTE(ch);
482 //          aLog[indexLog++] = CORBA::string_dup(ch.c_str());
483 //        }
484 //      its.Next();
485 //        }
486 //        if (clearAfterGet) _impl->ClearLog();
487 //      }
488 //    catch (SALOME_Exception& S_ex)
489 //      {
490 //        THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
491 //      }
492 //    return aLog._retn();
493 //  }
494
495 //=============================================================================
496 /*!
497  *  
498  */
499 //=============================================================================
500
501 void SMESH_Mesh_i::ClearLog() throw(SALOME::SALOME_Exception)
502 {
503         MESSAGE("SMESH_Mesh_i::ClearLog");
504         // ****
505 }
506
507 //=============================================================================
508 /*!
509  *  
510  */
511 //=============================================================================
512
513 CORBA::Long SMESH_Mesh_i::GetId()throw(SALOME::SALOME_Exception)
514 {
515         MESSAGE("SMESH_Mesh_i::GetId");
516         return _id;
517 }
518
519 //=============================================================================
520 /*!
521  *  
522  */
523 //=============================================================================
524
525 CORBA::Long SMESH_Mesh_i::GetStudyId()throw(SALOME::SALOME_Exception)
526 {
527         return _studyId;
528 }
529
530 //=============================================================================
531 /*!
532  *  
533  */
534 //=============================================================================
535
536 void SMESH_Mesh_i::SetImpl(::SMESH_Mesh * impl)
537 {
538         MESSAGE("SMESH_Mesh_i::SetImpl");
539         _impl = impl;
540 }
541
542 //=============================================================================
543 /*!
544  *  
545  */
546 //=============================================================================
547
548 ::SMESH_Mesh & SMESH_Mesh_i::GetImpl()
549 {
550         MESSAGE("SMESH_Mesh_i::GetImpl()");
551         return *_impl;
552 }
553
554 //=============================================================================
555 /*!
556  *  
557  */
558 //=============================================================================
559
560 GEOM::GEOM_Gen_ptr SMESH_Mesh_i::GetGeomEngine()
561 {
562         MESSAGE("SMESH_Mesh_i::GetGeomEngine");
563         return GEOM::GEOM_Gen::_duplicate(_geom);
564 }
565
566 //=============================================================================
567 /*!
568  *  
569  */
570 //=============================================================================
571
572 void SMESH_Mesh_i::SetIor(SMESH::SMESH_Mesh_ptr myIor)
573 {
574         MESSAGE("SMESH_Mesh_i::SetIor");
575         _myIor = SMESH::SMESH_Mesh::_duplicate(myIor);
576         ASSERT(!CORBA::is_nil(_myIor));
577 }
578
579 //=============================================================================
580 /*!
581  *  
582  */
583 //=============================================================================
584
585 SMESH::SMESH_Mesh_ptr SMESH_Mesh_i::GetIor()
586 {
587         MESSAGE("SMESH_Mesh_i::GetIor");
588         ASSERT(!CORBA::is_nil(_myIor));
589         return SMESH::SMESH_Mesh::_duplicate(_myIor);
590 }
591
592 //=============================================================================
593 /*!
594  *  
595  */
596 //=============================================================================
597
598 SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor()
599 {
600         SMESH_MeshEditor_i *aMeshEditor =
601                 new SMESH_MeshEditor_i(_impl->GetMeshDS());
602         SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();
603         return aMesh._retn();
604 }
605
606 //=============================================================================
607 /*!
608  *  
609  */
610 //=============================================================================
611
612 SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh()throw(SALOME::SALOME_Exception)
613 {
614         SMESH_MEDMesh_i *aMedMesh = new SMESH_MEDMesh_i(this);
615         SALOME_MED::MESH_var aMesh = aMedMesh->_this();
616         return aMesh._retn();
617 }
618
619 //=============================================================================
620 /*!
621  *  
622  */
623 //=============================================================================
624 CORBA::Long SMESH_Mesh_i::NbNodes()throw(SALOME::SALOME_Exception)
625 {
626         return _impl->NbNodes();
627 }
628
629 //=============================================================================
630 /*!
631  *  
632  */
633 //=============================================================================
634 CORBA::Long SMESH_Mesh_i::NbEdges()throw(SALOME::SALOME_Exception)
635 {
636         return _impl->NbEdges();
637 }
638
639 //=============================================================================
640 /*!
641  *  
642  */
643 //=============================================================================
644 CORBA::Long SMESH_Mesh_i::NbFaces()throw(SALOME::SALOME_Exception)
645 {
646         return _impl->NbFaces();
647 }
648
649 CORBA::Long SMESH_Mesh_i::NbTriangles()throw(SALOME::SALOME_Exception)
650 {
651         return _impl->NbTriangles();
652 }
653
654 CORBA::Long SMESH_Mesh_i::NbQuadrangles()throw(SALOME::SALOME_Exception)
655 {
656         return _impl->NbQuadrangles();
657 }
658
659 //=============================================================================
660 /*!
661  *  
662  */
663 //=============================================================================
664 CORBA::Long SMESH_Mesh_i::NbVolumes()throw(SALOME::SALOME_Exception)
665 {
666         return _impl->NbVolumes();
667 }
668
669 CORBA::Long SMESH_Mesh_i::NbTetras()throw(SALOME::SALOME_Exception)
670 {
671         return _impl->NbTetras();
672 }
673
674 CORBA::Long SMESH_Mesh_i::NbHexas()throw(SALOME::SALOME_Exception)
675 {
676         return _impl->NbHexas();
677 }
678
679 //=============================================================================
680 /*!
681  *  
682  */
683 //=============================================================================
684 CORBA::Long SMESH_Mesh_i::NbSubMesh()throw(SALOME::SALOME_Exception)
685 {
686         return _impl->NbSubMesh();
687 }
688
689 /*!
690  * Export mesh to a file
691  * @param fileName file name where to export the file
692  * @param fileType Currently it could be either "DAT", "UNV" or "MED".
693  */
694 void SMESH_Mesh_i::Export(const char* fileName, const char* fileType)
695         throw (SALOME::SALOME_Exception)
696 {
697         _impl->Export(fileName, fileType);
698 }