Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/smesh.git] / src / SMESHDS / SMESHDS_Document.cxx
index f533a72a7873fe8dd5f5f6da94c5188b5d457026..9e568e2974ab123c639507851a097b14745f6c18 100644 (file)
@@ -1,31 +1,30 @@
-//  SMESH SMESHDS : management of mesh data and SMESH document
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  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 
+//  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SMESH SMESHDS : management of mesh data and SMESH document
 //  File   : SMESHDS_Document.cxx
 //  Author : Yves FRICAUD, OCC
 //  Module : SMESH
 //  $Header: 
-
+//
 #include "SMESHDS_Document.hxx"
 #include "utilities.h"
 
@@ -39,17 +38,29 @@ SMESHDS_Document::SMESHDS_Document(int UserID):myUserID(UserID)
 {
 }
 
+//=======================================================================
+//function : Destructor
+//purpose  : 
+//=======================================================================
+
+SMESHDS_Document::~SMESHDS_Document()
+{
+  InitMeshesIterator();
+  while ( MoreMesh() )
+    delete NextMesh();
+}
+
 //=======================================================================
 //function : NewMesh
 //purpose  : 
 //=======================================================================
-int SMESHDS_Document::NewMesh()
+int SMESHDS_Document::NewMesh(bool theIsEmbeddedMode)
 {
-       static int NewMeshID = 0;
-       NewMeshID++;
-       SMESHDS_Mesh *aNewMesh = new SMESHDS_Mesh(NewMeshID);
-       myMeshes[NewMeshID] = aNewMesh;
-       return NewMeshID;
+  static int aNewMeshID = 0;
+  aNewMeshID++;
+  SMESHDS_Mesh *aNewMesh = new SMESHDS_Mesh(aNewMeshID,theIsEmbeddedMode);
+  myMeshes[aNewMeshID] = aNewMesh;
+  return aNewMeshID;
 }
 
 //=======================================================================