From: skl Date: Thu, 11 Mar 2010 09:36:56 +0000 (+0000) Subject: Changes for bug 0020734. X-Git-Tag: V5_1_4a1~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=25722a6cddf533d7b024866b14ad8be6acb0236d;p=modules%2Fsmesh.git Changes for bug 0020734. --- diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index af6147a88..259c09fad 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -9928,7 +9928,8 @@ bool SMESH_MeshEditor::Make2DMeshFrom3D() SMESHDS_Mesh* aMesh = GetMeshDS(); if (!aMesh) return false; - bool res = false; + //bool res = false; + int nbFree = 0, nbExisted = 0, nbCreated = 0; SMDS_VolumeIteratorPtr vIt = aMesh->volumesIterator(); while(vIt->more()) { @@ -9941,6 +9942,7 @@ bool SMESH_MeshEditor::Make2DMeshFrom3D() { if (!vTool.IsFreeFace(iface)) continue; + nbFree++; vector nodes; int nbFaceNodes = vTool.NbFaceNodes(iface); const SMDS_MeshNode** faceNodes = vTool.GetFaceNodes(iface); @@ -9952,11 +9954,13 @@ bool SMESH_MeshEditor::Make2DMeshFrom3D() nodes.push_back(faceNodes[inode]); // add new face based on volume nodes - if (aMesh->FindFace( nodes ) ) + if (aMesh->FindFace( nodes ) ) { + nbExisted++; continue; // face already exsist + } myLastCreatedElems.Append( AddElement(nodes, SMDSAbs_Face, isPoly && iface == 1) ); - res = true; + nbCreated++; } } - return res; + return ( nbFree==(nbExisted+nbCreated) ); }