From: eap Date: Mon, 11 Feb 2008 11:14:04 +0000 (+0000) Subject: PAL18920: 2 Meshes with the same hypothesis : one compute well but the other not !?! X-Git-Tag: V3_2_10~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=adda102d1a2e230605fc9938ff51b6eaaa325f65;p=modules%2Fsmesh.git PAL18920: 2 Meshes with the same hypothesis : one compute well but the other not !?! remove all new nodes and elements if algo fails --- diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index f0badf671..0ac6f9ea4 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -191,10 +191,8 @@ namespace { { // old nodes are shared by edges and new ones are shared // only by faces created by mapper - bool isOld = false; - SMDS_ElemIteratorPtr invElem = node->GetInverseElementIterator(); - while ( !isOld && invElem->more() ) - isOld = ( invElem->next()->GetType() == SMDSAbs_Edge ); + SMDS_ElemIteratorPtr invEdge = node->GetInverseElementIterator(SMDSAbs_Edge); + bool isOld = invEdge->more(); return isOld; } @@ -212,12 +210,13 @@ namespace { MeshCleaner( SMESH_subMesh* faceSubMesh ): sm(faceSubMesh) {} ~MeshCleaner() { Clean(sm); } void Release() { sm = 0; } // mesh will not be removed - static void Clean( SMESH_subMesh* sm ) + static void Clean( SMESH_subMesh* sm, bool withSub=true ) { if ( !sm ) return; - switch ( sm->GetSubShape().ShapeType() ) { - case TopAbs_VERTEX: - case TopAbs_EDGE: { + // PAL16567, 18920. Remove face nodes as well +// switch ( sm->GetSubShape().ShapeType() ) { +// case TopAbs_VERTEX: +// case TopAbs_EDGE: { SMDS_NodeIteratorPtr nIt = sm->GetSubMeshDS()->GetNodes(); SMESHDS_Mesh* mesh = sm->GetFather()->GetMeshDS(); while ( nIt->more() ) { @@ -226,12 +225,13 @@ namespace { mesh->RemoveNode( node ); } // do not break but iterate over DependsOn() - } - default: +// } +// default: + if ( !withSub ) return; SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(false,false); while ( smIt->more() ) - Clean( smIt->next() ); - } + Clean( smIt->next(), false ); +// } } }; @@ -474,7 +474,7 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& // it will remove mesh built by pattern mapper on edges and vertices // in failure case - // MeshCleaner cleaner( tgtSubMesh ); + MeshCleaner cleaner( tgtSubMesh ); // ------------------------------------------------------------------------- // mapper doesn't take care of nodes already existing on edges and vertices, @@ -617,7 +617,7 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& } } - //cleaner.Release(); // do not remove mesh + cleaner.Release(); // do not remove mesh return true; }