From: eap Date: Fri, 29 Nov 2013 08:45:55 +0000 (+0000) Subject: PPGP X-Git-Tag: V7_3_0b1~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ccb0d68b6f72744695e20f0633b3659bc6376a85;p=modules%2Fsmesh.git PPGP In TSearchersDeleter fix setting/removing the event listener --- diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 359b865e1..69bf34ec1 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -227,22 +227,22 @@ namespace MeshEditor_I { } myMesh = mesh; myMeshPartIOR = meshPartIOR; - if ( SMESH_subMesh* myMainSubMesh = mesh->GetSubMeshContaining(1) ) { - const TDependsOnMap & subMeshes = myMainSubMesh->DependsOn(); - TDependsOnMap::const_iterator sm; - for (sm = subMeshes.begin(); sm != subMeshes.end(); sm++) - sm->second->SetEventListener( this, 0, sm->second ); + SMESH_subMesh* sm = mesh->GetSubMesh( mesh->GetShapeToMesh() ); + SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator( /*includeSelf=*/true ); + while ( smIt->more() ) + { + sm = smIt->next(); + sm->SetEventListener( this, 0, sm ); } } } //!< delete self from all submeshes void Unset(SMESH_Mesh* mesh) { - if ( SMESH_subMesh* myMainSubMesh = mesh->GetSubMeshContaining(1) ) { - const TDependsOnMap & subMeshes = myMainSubMesh->DependsOn(); - TDependsOnMap::const_iterator sm; - for (sm = subMeshes.begin(); sm != subMeshes.end(); sm++) - sm->second->DeleteEventListener( this ); + if ( SMESH_subMesh* sm = mesh->GetSubMeshContaining(1) ) { + SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator( /*includeSelf=*/true ); + while ( smIt->more() ) + smIt->next()->DeleteEventListener( this ); } myMesh = 0; } @@ -1747,7 +1747,7 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array & IDsOfE if ( !myIsPreviewMode ) { // Update Python script TPythonDump() << "isDone = " << this << ".TriToQuad( " - << IDsOfElements << ", " << aNumericalFunctor << ", " << TVar( MaxAngle ) << " )"; + << IDsOfElements << ", " << aNumericalFunctor << ", " << TVar( MaxAngle ) << " )"; } bool stat = getEditor().TriToQuad( *workElements, aCrit, MaxAngle ); @@ -1785,7 +1785,7 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr // Update Python script aTPythonDump << "isDone = " << this << ".TriToQuadObject(" - << theObject << ", " << aNumericalFunctor << ", " << TVar( MaxAngle ) << " )"; + << theObject << ", " << aNumericalFunctor << ", " << TVar( MaxAngle ) << " )"; } return isDone;