Salome HOME
Correct some memory leaks
[modules/smesh.git] / src / SMESH_I / SMESH_Mesh_i.cxx
index 17cd20fd45af0823ee7a7dbdd3f25d3d266fb62c..9dee0f5621005a8ca9ff9276bb9e6ebae73bcca1 100644 (file)
@@ -1,14 +1,32 @@
-using namespace std;
-//=============================================================================
-// File      : SMESH_Mesh_i.cxx
-// Created   : lun mai  6 13:41:55 CEST 2002
-// Author    : Paul RASCLE, EDF
-// Project   : SALOME
-// Copyright : EDF 2002
-// $Header$
-//=============================================================================
-using namespace std;
+//  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//
+//
+//
+//  File   : SMESH_Mesh_i.cxx
+//  Author : Paul RASCLE, EDF
+//  Module : SMESH
+//  $Header$
 
+using namespace std;
 #include "SMESH_Mesh_i.hxx"
 #include "SMESH_subMesh_i.hxx"
 #include "SMESH_MEDMesh_i.hxx"
@@ -21,22 +39,12 @@ using namespace std;
 #include "OpUtil.hxx"
 
 #include "TCollection_AsciiString.hxx"
-// #include "SMESHDS_ListOfAsciiString.hxx"
-// #include "SMESHDS_ListIteratorOfListOfAsciiString.hxx"
-#include "TColStd_ListOfInteger.hxx"
-#include "TColStd_ListOfReal.hxx"
-#include "TColStd_ListIteratorOfListOfInteger.hxx"
-#include "TColStd_ListIteratorOfListOfReal.hxx"
 #include "SMESHDS_Command.hxx"
 #include "SMESHDS_CommandType.hxx"
-#include "SMESHDS_ListOfCommand.hxx"
-#include "SMESHDS_ListIteratorOfListOfCommand.hxx"
-#include "Handle_SMESHDS_Command.hxx"
-
 #include "SMESH_MeshEditor_i.hxx"
+
 #include <string>
 #include <iostream>
-//#include <sstream>
 
 //**** SMESHDS en champ
 
@@ -48,8 +56,8 @@ using namespace std;
 
 SMESH_Mesh_i::SMESH_Mesh_i()
 {
-  MESSAGE("SMESH_Mesh_i: default constructor, not for use");
-  ASSERT(0);
+       MESSAGE("SMESH_Mesh_i: default constructor, not for use");
+       ASSERT(0);
 };
 
 //=============================================================================
@@ -58,16 +66,14 @@ SMESH_Mesh_i::SMESH_Mesh_i()
  */
 //=============================================================================
 
-SMESH_Mesh_i::SMESH_Mesh_i(SMESH_Gen_i* gen_i,
-                          GEOM::GEOM_Gen_ptr geomEngine,
-                          CORBA::Long studyId,
-                          int localId)
+SMESH_Mesh_i::SMESH_Mesh_i(SMESH_Gen_i * gen_i,
+       GEOM::GEOM_Gen_ptr geomEngine, CORBA::Long studyId, int localId)
 {
-  MESSAGE("SMESH_Mesh_i");
-  _gen_i = gen_i;
-  _id = localId;
-  _geom = GEOM::GEOM_Gen::_narrow(geomEngine);
-  _studyId = studyId;
+       MESSAGE("SMESH_Mesh_i");
+       _gen_i = gen_i;
+       _id = localId;
+       _geom = GEOM::GEOM_Gen::_narrow(geomEngine);
+       _studyId = studyId;
 }
 
 //=============================================================================
@@ -78,11 +84,10 @@ SMESH_Mesh_i::SMESH_Mesh_i(SMESH_Gen_i* gen_i,
 
 SMESH_Mesh_i::~SMESH_Mesh_i()
 {
-  MESSAGE("~SMESH_Mesh_i");
-  // ****
+       MESSAGE("~SMESH_Mesh_i");
+       // ****
 };
 
-
 //=============================================================================
 /*!
  *  
@@ -90,35 +95,33 @@ SMESH_Mesh_i::~SMESH_Mesh_i()
 //=============================================================================
 
 CORBA::Boolean SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
-                                          SMESH::SMESH_Hypothesis_ptr anHyp)
-  throw (SALOME::SALOME_Exception)
+       SMESH::SMESH_Hypothesis_ptr anHyp) throw(SALOME::SALOME_Exception)
 {
-  MESSAGE("AddHypothesis");
-  // **** proposer liste de subShape (selection multiple)
-
-  GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
-  if (CORBA::is_nil(mySubShape))
-    THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", \
-                                SALOME::BAD_PARAM);
-
-  SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
-  if (CORBA::is_nil(myHyp))
-    THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference", \
-                                SALOME::BAD_PARAM);
-  bool ret = false;
-  try
-    {
-      TopoDS_Shape myLocSubShape=
-       _gen_i->_ShapeReader->GetShape(_geom,mySubShape);
-      int hypId = myHyp->GetId();
-      ret = _impl->AddHypothesis(myLocSubShape, hypId);
-    }
-  catch (SALOME_Exception& S_ex)
-    {
-      THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
-                                  SALOME::BAD_PARAM);
-    }
-  return ret;
+       MESSAGE("AddHypothesis");
+       // **** proposer liste de subShape (selection multiple)
+
+       GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
+       if (CORBA::is_nil(mySubShape))
+               THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
+                       SALOME::BAD_PARAM);
+
+       SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
+       if (CORBA::is_nil(myHyp))
+               THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference",
+                       SALOME::BAD_PARAM);
+       bool ret = false;
+       try
+       {
+               TopoDS_Shape myLocSubShape =
+                       _gen_i->_ShapeReader->GetShape(_geom, mySubShape);
+               int hypId = myHyp->GetId();
+               ret = _impl->AddHypothesis(myLocSubShape, hypId);
+       }
+       catch(SALOME_Exception & S_ex)
+       {
+               THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
+       }
+       return ret;
 };
 
 //=============================================================================
@@ -127,38 +130,36 @@ CORBA::Boolean SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
  */
 //=============================================================================
 
-CORBA::Boolean 
-SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
-                              SMESH::SMESH_Hypothesis_ptr anHyp)
-  throw (SALOME::SALOME_Exception)
+CORBA::Boolean
+       SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
+       SMESH::SMESH_Hypothesis_ptr anHyp) throw(SALOME::SALOME_Exception)
 {
-  MESSAGE("RemoveHypothesis");
-  // **** proposer liste de subShape (selection multiple)
-
-  GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
-  if (CORBA::is_nil(mySubShape))
-    THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", \
-                                SALOME::BAD_PARAM);
-
-  SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
-  if (CORBA::is_nil(myHyp))
-    THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference", \
-                                SALOME::BAD_PARAM);
-
-  bool ret = false;
-  try
-    {
-      TopoDS_Shape myLocSubShape=
-       _gen_i->_ShapeReader->GetShape(_geom,mySubShape);
-      int hypId = myHyp->GetId();
-      ret = _impl->RemoveHypothesis(myLocSubShape, hypId);
-    }
-  catch (SALOME_Exception& S_ex)
-    {
-      THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
-                                  SALOME::BAD_PARAM);
-    }
-  return ret;
+       MESSAGE("RemoveHypothesis");
+       // **** proposer liste de subShape (selection multiple)
+
+       GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
+       if (CORBA::is_nil(mySubShape))
+               THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
+                       SALOME::BAD_PARAM);
+
+       SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
+       if (CORBA::is_nil(myHyp))
+               THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference",
+                       SALOME::BAD_PARAM);
+
+       bool ret = false;
+       try
+       {
+               TopoDS_Shape myLocSubShape =
+                       _gen_i->_ShapeReader->GetShape(_geom, mySubShape);
+               int hypId = myHyp->GetId();
+               ret = _impl->RemoveHypothesis(myLocSubShape, hypId);
+       }
+       catch(SALOME_Exception & S_ex)
+       {
+               THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
+       }
+       return ret;
 };
 
 //=============================================================================
@@ -167,12 +168,12 @@ SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
  */
 //=============================================================================
 
-SMESH::ListOfHypothesis*
-SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Shape_ptr aSubShape)
-  throw (SALOME::SALOME_Exception)
+SMESH::ListOfHypothesis *
+       SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Shape_ptr aSubShape)
+throw(SALOME::SALOME_Exception)
 {
-  MESSAGE("GetHypothesisList");
-  // ****
+       MESSAGE("GetHypothesisList");
+       // ****
 };
 
 //=============================================================================
@@ -180,54 +181,53 @@ SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Shape_ptr aSubShape)
  *  
  */
 //=============================================================================
-SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetElementsOnShape(GEOM::GEOM_Shape_ptr aSubShape)
-  throw (SALOME::SALOME_Exception)
+SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetElementsOnShape(GEOM::
+       GEOM_Shape_ptr aSubShape) throw(SALOME::SALOME_Exception)
 {
-  MESSAGE("SMESH_Mesh_i::GetElementsOnShape");
-  GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
-  if (CORBA::is_nil(mySubShape))
-    THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", \
-                                SALOME::BAD_PARAM);
-
-  int subMeshId = 0;
-  try
-    {
-      SMESH_subMesh_i* subMeshServant;
-      TopoDS_Shape myLocSubShape
-       = _gen_i->_ShapeReader->GetShape(_geom,mySubShape);
-
-      //Get or Create the SMESH_subMesh object implementation
-      
-      ::SMESH_subMesh * mySubMesh
-         = _impl->GetSubMesh(myLocSubShape);
-      subMeshId = mySubMesh->GetId();
-
-      // create a new subMesh object servant if there is none for the shape
-
-      if (_mapSubMesh.find(subMeshId) != _mapSubMesh.end())
+       MESSAGE("SMESH_Mesh_i::GetElementsOnShape");
+       GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
+       if (CORBA::is_nil(mySubShape))
+               THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
+                       SALOME::BAD_PARAM);
+
+       int subMeshId = 0;
+       try
        {
-         ASSERT(_mapSubMesh_i.find(subMeshId) != _mapSubMesh_i.end());
-         subMeshServant = _mapSubMesh_i[subMeshId];
+               SMESH_subMesh_i *subMeshServant;
+               TopoDS_Shape myLocSubShape
+                       = _gen_i->_ShapeReader->GetShape(_geom, mySubShape);
+
+               //Get or Create the SMESH_subMesh object implementation
+
+               ::SMESH_subMesh * mySubMesh = _impl->GetSubMesh(myLocSubShape);
+               subMeshId = mySubMesh->GetId();
+
+               // create a new subMesh object servant if there is none for the shape
+
+               if (_mapSubMesh.find(subMeshId) != _mapSubMesh.end())
+               {
+                       ASSERT(_mapSubMesh_i.find(subMeshId) != _mapSubMesh_i.end());
+                       subMeshServant = _mapSubMesh_i[subMeshId];
+               }
+               else
+               {
+                       // create and activate the CORBA servant of Mesh
+                       subMeshServant = new SMESH_subMesh_i(_gen_i, this, subMeshId);
+                       SMESH::SMESH_subMesh_var subMesh
+                               = SMESH::SMESH_subMesh::_narrow(subMeshServant->_this());
+                       _mapSubMesh[subMeshId] = mySubMesh;
+                       _mapSubMesh_i[subMeshId] = subMeshServant;
+                       _mapSubMeshIor[subMeshId]
+                               = SMESH::SMESH_subMesh::_duplicate(subMesh);
+               }
        }
-      else
+       catch(SALOME_Exception & S_ex)
        {
-         // create and activate the CORBA servant of Mesh
-         subMeshServant = new SMESH_subMesh_i(_gen_i, this, subMeshId);
-         SMESH::SMESH_subMesh_var subMesh
-           = SMESH::SMESH_subMesh::_narrow(subMeshServant->_this());
-         _mapSubMesh[subMeshId] = mySubMesh;
-         _mapSubMesh_i[subMeshId] = subMeshServant;
-         _mapSubMeshIor[subMeshId]
-           = SMESH::SMESH_subMesh::_duplicate(subMesh);
+               THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
        }
-    }
-  catch (SALOME_Exception& S_ex)
-    {
-      THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
-    }
-
-  ASSERT(_mapSubMeshIor.find(subMeshId) != _mapSubMeshIor.end());
-  return SMESH::SMESH_subMesh::_duplicate(_mapSubMeshIor[subMeshId]);
+
+       ASSERT(_mapSubMeshIor.find(subMeshId) != _mapSubMeshIor.end());
+       return SMESH::SMESH_subMesh::_duplicate(_mapSubMeshIor[subMeshId]);
 }
 
 //=============================================================================
@@ -236,62 +236,63 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetElementsOnShape(GEOM::GEOM_Shape_ptr a
  */
 //=============================================================================
 
-SMESH::log_array* SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
- throw (SALOME::SALOME_Exception)
+SMESH::log_array * SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
+throw(SALOME::SALOME_Exception)
 {
- MESSAGE("SMESH_Mesh_i::GetLog");
-
- SMESH::log_array_var aLog;
- try
-   {
-     const SMESHDS_ListOfCommand& logDS =_impl->GetLog();
-     aLog = new SMESH::log_array;
-     int indexLog = 0;
-     int lg = logDS.Extent();
-     SCRUTE(lg);
-     aLog->length(lg);
-     SMESHDS_ListIteratorOfListOfCommand its(logDS);
-     while(its.More())
-     {
-       Handle(SMESHDS_Command) com = its.Value();
-       int comType = com->GetType();
-       //SCRUTE(comType);
-       int lgcom = com->GetNumber();
-       //SCRUTE(lgcom);
-       const TColStd_ListOfInteger& intList = com->GetIndexes();
-       int inum = intList.Extent();
-       //SCRUTE(inum);
-       TColStd_ListIteratorOfListOfInteger ii(intList);
-       const TColStd_ListOfReal& coordList = com->GetCoords();
-       int rnum = coordList.Extent();
-       //SCRUTE(rnum);
-       TColStd_ListIteratorOfListOfReal ir(coordList);
-       aLog[indexLog].commandType = comType;
-       aLog[indexLog].number = lgcom;
-       aLog[indexLog].coords.length(rnum);
-       aLog[indexLog].indexes.length(inum);
-       for (int i=0; i<rnum; i++)
-         {
-           aLog[indexLog].coords[i] = ir.Value();
-           //MESSAGE(" "<<i<<" "<<ir.Value());
-           ir.Next();
-         }
-       for (int i=0; i<inum; i++)
-         {
-           aLog[indexLog].indexes[i] = ii.Value();
-           //MESSAGE(" "<<i<<" "<<ii.Value());
-           ii.Next();
-         }
-       indexLog++;
-       its.Next();
-     }
-     if (clearAfterGet) _impl->ClearLog();
-   }
- catch (SALOME_Exception& S_ex)
-   {
-     THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
-   }
- return aLog._retn();
+       MESSAGE("SMESH_Mesh_i::GetLog");
+
+       SMESH::log_array_var aLog;
+       try
+       {
+               list < SMESHDS_Command * >logDS = _impl->GetLog();
+               aLog = new SMESH::log_array;
+               int indexLog = 0;
+               int lg = logDS.size();
+               SCRUTE(lg);
+               aLog->length(lg);
+               list < SMESHDS_Command * >::iterator its = logDS.begin();
+               while (its != logDS.end())
+               {
+                       SMESHDS_Command *com = *its;
+                       int comType = com->GetType();
+                       //SCRUTE(comType);
+                       int lgcom = com->GetNumber();
+                       //SCRUTE(lgcom);
+                       const list < int >&intList = com->GetIndexes();
+                       int inum = intList.size();
+                       //SCRUTE(inum);
+                       list < int >::const_iterator ii = intList.begin();
+                       const list < double >&coordList = com->GetCoords();
+                       int rnum = coordList.size();
+                       //SCRUTE(rnum);
+                       list < double >::const_iterator ir = coordList.begin();
+                       aLog[indexLog].commandType = comType;
+                       aLog[indexLog].number = lgcom;
+                       aLog[indexLog].coords.length(rnum);
+                       aLog[indexLog].indexes.length(inum);
+                       for (int i = 0; i < rnum; i++)
+                       {
+                               aLog[indexLog].coords[i] = *ir;
+                               //MESSAGE(" "<<i<<" "<<ir.Value());
+                               ir++;
+                       }
+                       for (int i = 0; i < inum; i++)
+                       {
+                               aLog[indexLog].indexes[i] = *ii;
+                               //MESSAGE(" "<<i<<" "<<ii.Value());
+                               ii++;
+                       }
+                       indexLog++;
+                       its++;
+               }
+               if (clearAfterGet)
+                       _impl->ClearLog();
+       }
+       catch(SALOME_Exception & S_ex)
+       {
+               THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
+       }
+       return aLog._retn();
 }
 
 //  SMESH::string_array* SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
@@ -311,97 +312,97 @@ SMESH::log_array* SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
 //        SMESHDS_ListIteratorOfListOfCommand its(logDS);
 //        while(its.More())
 //        {
-//     Handle(SMESHDS_Command) com = its.Value();
-//     int comType = com->GetType();
-//     SCRUTE(comType);
-//     int lgcom = com->GetNumber();
-//     SCRUTE(lgcom);
-//     logSize += lgcom;
-//     aLog->length(logSize);
-//     SCRUTE(logSize);
-//     const TColStd_ListOfInteger& intList = com->GetIndexes();
-//     TColStd_ListIteratorOfListOfInteger ii(intList);
-//     const TColStd_ListOfReal& coordList = com->GetCoords();
-//     TColStd_ListIteratorOfListOfReal ir(coordList);
-//     for (int icom = 1; icom <= lgcom; icom++)
-//       {
-//         ostringstream S;
-//         switch (comType)
-//           {
-//           case SMESHDS_AddNode:
-//             S << "AddNode " << ii.Value(); ii.Next();
-//             S << " " << ir.Value(); ir.Next(); 
-//             S << " " << ir.Value(); ir.Next();
-//             S << " " << ir.Value(); ir.Next();
-//             break;
-//           case SMESHDS_AddEdge:
-//             S << "AddEdge " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             break;
-//           case SMESHDS_AddTriangle:
-//             S << "AddFace " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             break;
-//           case SMESHDS_AddQuadrangle:
-//             S << "AddFace " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             break;
-//           case SMESHDS_AddTetrahedron:
-//             S << "AddVolume " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             break;
-//           case SMESHDS_AddPyramid:
-//             S << "AddVolume " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             break;
-//           case SMESHDS_AddPrism:
-//             S << "AddVolume " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             break;
-//           case SMESHDS_AddHexahedron:
-//             S << "AddVolume " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             S << " " << ii.Value(); ii.Next();
-//             break;
-//           case SMESHDS_RemoveNode:
-//             S << "RemoveNode " << ii.Value(); ii.Next();
-//             break;
-//           case SMESHDS_RemoveElement:
-//             S << "RemoveElement " << ii.Value(); ii.Next();
-//             break;
-//           default:
-//             ASSERT(0);
-//             break;
-//           }
-//         string ch = S.str();
-//         SCRUTE(ch);
-//         aLog[indexLog++] = CORBA::string_dup(ch.c_str());
-//       }
-//     its.Next();
+//      Handle(SMESHDS_Command) com = its.Value();
+//      int comType = com->GetType();
+//      SCRUTE(comType);
+//      int lgcom = com->GetNumber();
+//      SCRUTE(lgcom);
+//      logSize += lgcom;
+//      aLog->length(logSize);
+//      SCRUTE(logSize);
+//      const TColStd_ListOfInteger& intList = com->GetIndexes();
+//      TColStd_ListIteratorOfListOfInteger ii(intList);
+//      const TColStd_ListOfReal& coordList = com->GetCoords();
+//      TColStd_ListIteratorOfListOfReal ir(coordList);
+//      for (int icom = 1; icom <= lgcom; icom++)
+//        {
+//          ostringstream S;
+//          switch (comType)
+//            {
+//            case SMESHDS_AddNode:
+//          S << "AddNode " << ii.Value(); ii.Next();
+//          S << " " << ir.Value(); ir.Next(); 
+//          S << " " << ir.Value(); ir.Next();
+//          S << " " << ir.Value(); ir.Next();
+//          break;
+//            case SMESHDS_AddEdge:
+//          S << "AddEdge " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          break;
+//            case SMESHDS_AddTriangle:
+//          S << "AddFace " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          break;
+//            case SMESHDS_AddQuadrangle:
+//          S << "AddFace " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          break;
+//            case SMESHDS_AddTetrahedron:
+//          S << "AddVolume " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          break;
+//            case SMESHDS_AddPyramid:
+//          S << "AddVolume " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          break;
+//            case SMESHDS_AddPrism:
+//          S << "AddVolume " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          break;
+//            case SMESHDS_AddHexahedron:
+//          S << "AddVolume " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          S << " " << ii.Value(); ii.Next();
+//          break;
+//            case SMESHDS_RemoveNode:
+//          S << "RemoveNode " << ii.Value(); ii.Next();
+//          break;
+//            case SMESHDS_RemoveElement:
+//          S << "RemoveElement " << ii.Value(); ii.Next();
+//          break;
+//            default:
+//          ASSERT(0);
+//          break;
+//            }
+//          string ch = S.str();
+//          SCRUTE(ch);
+//          aLog[indexLog++] = CORBA::string_dup(ch.c_str());
+//        }
+//      its.Next();
 //        }
 //        if (clearAfterGet) _impl->ClearLog();
 //      }
@@ -418,11 +419,10 @@ SMESH::log_array* SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
  */
 //=============================================================================
 
-void SMESH_Mesh_i::ClearLog()
-  throw (SALOME::SALOME_Exception)
+void SMESH_Mesh_i::ClearLog() throw(SALOME::SALOME_Exception)
 {
-  MESSAGE("SMESH_Mesh_i::ClearLog");
-  // ****
+       MESSAGE("SMESH_Mesh_i::ClearLog");
+       // ****
 }
 
 //=============================================================================
@@ -431,11 +431,10 @@ void SMESH_Mesh_i::ClearLog()
  */
 //=============================================================================
 
-CORBA::Long SMESH_Mesh_i::GetId()
-  throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::GetId()throw(SALOME::SALOME_Exception)
 {
-  MESSAGE("SMESH_Mesh_i::GetId");
-  return _id;
+       MESSAGE("SMESH_Mesh_i::GetId");
+       return _id;
 }
 
 //=============================================================================
@@ -444,21 +443,21 @@ CORBA::Long SMESH_Mesh_i::GetId()
  */
 //=============================================================================
 
-CORBA::Long SMESH_Mesh_i::GetStudyId()
-  throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::GetStudyId()throw(SALOME::SALOME_Exception)
 {
-  return _studyId;
+       return _studyId;
 }
+
 //=============================================================================
 /*!
  *  
  */
 //=============================================================================
 
-void SMESH_Mesh_i::SetImpl(::SMESH_Mesh* impl)
+void SMESH_Mesh_i::SetImpl(::SMESH_Mesh * impl)
 {
-  MESSAGE("SMESH_Mesh_i::SetImpl");
-  _impl = impl;
+       MESSAGE("SMESH_Mesh_i::SetImpl");
+       _impl = impl;
 }
 
 //=============================================================================
@@ -467,10 +466,10 @@ void SMESH_Mesh_i::SetImpl(::SMESH_Mesh* impl)
  */
 //=============================================================================
 
-::SMESH_Mesh& SMESH_Mesh_i::GetImpl()
+::SMESH_Mesh & SMESH_Mesh_i::GetImpl()
 {
-  MESSAGE("SMESH_Mesh_i::GetImpl()");
-  return  *_impl;
+       MESSAGE("SMESH_Mesh_i::GetImpl()");
+       return *_impl;
 }
 
 //=============================================================================
@@ -481,8 +480,8 @@ void SMESH_Mesh_i::SetImpl(::SMESH_Mesh* impl)
 
 GEOM::GEOM_Gen_ptr SMESH_Mesh_i::GetGeomEngine()
 {
-  MESSAGE("SMESH_Mesh_i::GetGeomEngine");
-  return GEOM::GEOM_Gen::_duplicate(_geom);
+       MESSAGE("SMESH_Mesh_i::GetGeomEngine");
+       return GEOM::GEOM_Gen::_duplicate(_geom);
 }
 
 //=============================================================================
@@ -493,9 +492,9 @@ GEOM::GEOM_Gen_ptr SMESH_Mesh_i::GetGeomEngine()
 
 void SMESH_Mesh_i::SetIor(SMESH::SMESH_Mesh_ptr myIor)
 {
-  MESSAGE("SMESH_Mesh_i::SetIor");
-  _myIor = SMESH::SMESH_Mesh::_duplicate(myIor);
-  ASSERT(! CORBA::is_nil(_myIor));
+       MESSAGE("SMESH_Mesh_i::SetIor");
+       _myIor = SMESH::SMESH_Mesh::_duplicate(myIor);
+       ASSERT(!CORBA::is_nil(_myIor));
 }
 
 //=============================================================================
@@ -506,10 +505,11 @@ void SMESH_Mesh_i::SetIor(SMESH::SMESH_Mesh_ptr myIor)
 
 SMESH::SMESH_Mesh_ptr SMESH_Mesh_i::GetIor()
 {
-  MESSAGE("SMESH_Mesh_i::GetIor");
-  ASSERT(! CORBA::is_nil(_myIor));
-  return SMESH::SMESH_Mesh::_duplicate(_myIor);
+       MESSAGE("SMESH_Mesh_i::GetIor");
+       ASSERT(!CORBA::is_nil(_myIor));
+       return SMESH::SMESH_Mesh::_duplicate(_myIor);
 }
+
 //=============================================================================
 /*!
  *  
@@ -518,9 +518,10 @@ SMESH::SMESH_Mesh_ptr SMESH_Mesh_i::GetIor()
 
 SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor()
 {
-  SMESH_MeshEditor_i* aMeshEditor =  new  SMESH_MeshEditor_i(_impl->GetMeshDS());
-  SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();
-  return aMesh._retn();
+       SMESH_MeshEditor_i *aMeshEditor =
+               new SMESH_MeshEditor_i(_impl->GetMeshDS());
+       SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();
+       return aMesh._retn();
 }
 
 //=============================================================================
@@ -529,35 +530,30 @@ SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor()
  */
 //=============================================================================
 
-void SMESH_Mesh_i::ExportMED( const char* file )
-  throw (SALOME::SALOME_Exception)
+void SMESH_Mesh_i::ExportMED(const char *file) throw(SALOME::SALOME_Exception)
 {
-  _impl->ExportMED( file );
+       _impl->ExportMED(file);
 }
-void SMESH_Mesh_i::ExportDAT( const char* file )
-  throw (SALOME::SALOME_Exception)
+void SMESH_Mesh_i::ExportDAT(const char *file) throw(SALOME::SALOME_Exception)
 {
-  _impl->ExportDAT( file );
+       _impl->ExportDAT(file);
 }
-void SMESH_Mesh_i::ExportUNV( const char* file )
-  throw (SALOME::SALOME_Exception)
+void SMESH_Mesh_i::ExportUNV(const char *file) throw(SALOME::SALOME_Exception)
 {
-  _impl->ExportUNV( file );
+       _impl->ExportUNV(file);
 }
 
-
 //=============================================================================
 /*!
  *  
  */
 //=============================================================================
 
-SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh()
-  throw (SALOME::SALOME_Exception)
+SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh()throw(SALOME::SALOME_Exception)
 {
-  SMESH_MEDMesh_i* aMedMesh =  new  SMESH_MEDMesh_i( this );
-  SALOME_MED::MESH_var aMesh = aMedMesh->_this();
-  return aMesh._retn();
+       SMESH_MEDMesh_i *aMedMesh = new SMESH_MEDMesh_i(this);
+       SALOME_MED::MESH_var aMesh = aMedMesh->_this();
+       return aMesh._retn();
 }
 
 //=============================================================================
@@ -565,10 +561,9 @@ SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh()
  *  
  */
 //=============================================================================
-CORBA::Long SMESH_Mesh_i::NbNodes()
-  throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbNodes()throw(SALOME::SALOME_Exception)
 {
-  return _impl->NbNodes();
+       return _impl->NbNodes();
 }
 
 //=============================================================================
@@ -576,10 +571,9 @@ CORBA::Long SMESH_Mesh_i::NbNodes()
  *  
  */
 //=============================================================================
-CORBA::Long SMESH_Mesh_i::NbEdges()
-  throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbEdges()throw(SALOME::SALOME_Exception)
 {
-  return _impl->NbEdges();
+       return _impl->NbEdges();
 }
 
 //=============================================================================
@@ -587,20 +581,19 @@ CORBA::Long SMESH_Mesh_i::NbEdges()
  *  
  */
 //=============================================================================
-CORBA::Long SMESH_Mesh_i::NbFaces()
-    throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbFaces()throw(SALOME::SALOME_Exception)
 {
-  return _impl->NbFaces();
+       return _impl->NbFaces();
 }
-CORBA::Long SMESH_Mesh_i::NbTriangles()
-    throw (SALOME::SALOME_Exception)
+
+CORBA::Long SMESH_Mesh_i::NbTriangles()throw(SALOME::SALOME_Exception)
 {
-  return _impl->NbTriangles();
+       return _impl->NbTriangles();
 }
-CORBA::Long SMESH_Mesh_i::NbQuadrangles()
-    throw (SALOME::SALOME_Exception)
+
+CORBA::Long SMESH_Mesh_i::NbQuadrangles()throw(SALOME::SALOME_Exception)
 {
-  return _impl->NbQuadrangles();
+       return _impl->NbQuadrangles();
 }
 
 //=============================================================================
@@ -608,20 +601,19 @@ CORBA::Long SMESH_Mesh_i::NbQuadrangles()
  *  
  */
 //=============================================================================
-CORBA::Long SMESH_Mesh_i::NbVolumes()
-  throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbVolumes()throw(SALOME::SALOME_Exception)
 {
-  return _impl->NbVolumes();
+       return _impl->NbVolumes();
 }
-CORBA::Long SMESH_Mesh_i::NbTetras()
-  throw (SALOME::SALOME_Exception)
+
+CORBA::Long SMESH_Mesh_i::NbTetras()throw(SALOME::SALOME_Exception)
 {
-  return _impl->NbTetras();
+       return _impl->NbTetras();
 }
-CORBA::Long SMESH_Mesh_i::NbHexas()
-  throw (SALOME::SALOME_Exception)
+
+CORBA::Long SMESH_Mesh_i::NbHexas()throw(SALOME::SALOME_Exception)
 {
-  return _impl->NbHexas();
+       return _impl->NbHexas();
 }
 
 //=============================================================================
@@ -629,8 +621,7 @@ CORBA::Long SMESH_Mesh_i::NbHexas()
  *  
  */
 //=============================================================================
-CORBA::Long SMESH_Mesh_i::NbSubMesh()
-  throw (SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbSubMesh()throw(SALOME::SALOME_Exception)
 {
-  return _impl->NbSubMesh();
+       return _impl->NbSubMesh();
 }