Salome HOME
52459: Viscous layers are not normal to the surface.
[modules/smesh.git] / src / StdMeshers / StdMeshers_ProjectionUtils.cxx
index 18c6f27d27500a5f6041dd2eacdfb30fa1985291..92474f20566a0831457ed48a5278a7a50c62215e 100644 (file)
@@ -529,6 +529,8 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the
     TShapePairsList::iterator s1_s2 = shapesQueue.begin();
     for ( ; s1_s2 != shapesQueue.end(); ++s1_s2 )
     {
+      if ( theMap.IsBound( s1_s2->first )) // avoid re-binding for a seam edge
+        continue; // to avoid this:           Forward seam -> Reversed seam
       InsertAssociation( s1_s2->first, s1_s2->second, theMap );
       TopoDS_Iterator s1It( s1_s2->first), s2It( s1_s2->second );
       for ( ; s1It.More(); s1It.Next(), s2It.Next() )
@@ -2130,7 +2132,7 @@ bool StdMeshers_ProjectionUtils::MakeComputed(SMESH_subMesh * sm, const int iter
           mesh->GetHypotheses( shape, hypoFilter, hyps, true, &assignedTo );
         if ( nbAlgos > 1 ) // concurrent algos
         {
-          list<SMESH_subMesh*> smList; // where an algo is assigned
+          vector<SMESH_subMesh*> smList; // where an algo is assigned
           list< TopoDS_Shape >::iterator shapeIt = assignedTo.begin();
           for ( ; shapeIt != assignedTo.end(); ++shapeIt )
             smList.push_back( mesh->GetSubMesh( *shapeIt ));
@@ -2381,9 +2383,21 @@ void StdMeshers_ProjectionUtils::SetEventListener(SMESH_subMesh* subMesh,
       }
       else
       {
-        subMesh->SetEventListener( getSrcSubMeshListener(),
-                                   SMESH_subMeshEventListenerData::MakeData( subMesh ),
-                                   srcShapeSM );
+        if ( SMESH_subMeshEventListenerData* data =
+             srcShapeSM->GetEventListenerData( getSrcSubMeshListener() ))
+        {
+          bool alreadyIn =
+            (std::find( data->mySubMeshes.begin(),
+                        data->mySubMeshes.end(), subMesh ) != data->mySubMeshes.end() );
+          if ( !alreadyIn )
+            data->mySubMeshes.push_back( subMesh );
+        }
+        else
+        {
+          subMesh->SetEventListener( getSrcSubMeshListener(),
+                                     SMESH_subMeshEventListenerData::MakeData( subMesh ),
+                                     srcShapeSM );
+        }
       }
     }
   }