X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHDS%2FSMESHDS_Mesh.cxx;h=6766fbda76a822021b0426e748ef5dd874b84b67;hp=d93e784c3141deb74e88aa1366e375a45d469453;hb=12d0e1ecd279895b1ed9484e15309984d4f06ded;hpb=b19ad3a4fdbc680eb10b5030e15fec93834a1d4d diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index d93e784c3..6766fbda7 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2014 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 @@ -6,7 +6,7 @@ // 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. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -895,8 +895,9 @@ void SMESHDS_Mesh::RemoveFreeNode(const SMDS_MeshNode * n, // Rm from sub-mesh // Node should belong to only one sub-mesh - if( subMesh ) - subMesh->RemoveNode(n,/*deleted=*/false); + if ( !subMesh || !subMesh->RemoveNode(n,/*deleted=*/false)) + if (( subMesh = MeshElements( n->getshapeId() ))) + subMesh->RemoveNode(n,/*deleted=*/false ); SMDS_Mesh::RemoveFreeElement(n); } @@ -998,6 +999,10 @@ void SMESHDS_Mesh::ClearMesh() g->Clear(); g->SetType( groupType ); } + else + { + (*group)->Extent(); // to free cashed elements in GroupOnFilter's + } } } @@ -1371,7 +1376,8 @@ const TopoDS_Shape& SMESHDS_Mesh::IndexToShape(int ShapeIndex) const { try { - return myIndexToShape.FindKey(ShapeIndex); + if ( ShapeIndex > 0 ) + return myIndexToShape.FindKey(ShapeIndex); } catch ( Standard_OutOfRange ) {