Salome HOME
Regression of SALOME_TESTS/Grids/smesh/bugs_03/D6
[modules/smesh.git] / src / StdMeshers / StdMeshers_CompositeSegment_1D.cxx
index 2b584703861133bc1b9f99f76dc8efcda615adc7..c71c9dfc02ba1e1e047f5f60aeb95d1450aba7eb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2013  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
@@ -215,6 +215,18 @@ namespace {
           }
         }
       }
+      // clean all EDGEs of a complex side if one EDGE is cleaned
+      else if ( event     == SMESH_subMesh::CLEAN &&
+                eventType == SMESH_subMesh::COMPUTE_EVENT )
+      {
+        SMESH_subMeshIteratorPtr smIt = subMesh->getDependsOnIterator(/*includeSelf=*/false);
+        while ( smIt->more() ) // loop on VERTEX sub-meshes
+        {
+          SMESH_subMesh* sm = smIt->next();
+          if ( sm->IsAlwaysComputed() ) // it's an internal node sub-mesh
+            sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
+        }
+      }
     }
   }; // struct VertexNodesRestoringListener
 }
@@ -396,6 +408,15 @@ bool StdMeshers_CompositeSegment_1D::Compute(SMESH_Mesh &         aMesh,
 
   // Create mesh
 
+  // compute and get nodes on extremity VERTEX'es
+  SMESH_subMesh* smVFirst = aMesh.GetSubMesh( VFirst );
+  smVFirst->SetIsAlwaysComputed( false );
+  smVFirst->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+  //
+  SMESH_subMesh* smVLast = aMesh.GetSubMesh( VLast );
+  smVLast->SetIsAlwaysComputed( false );
+  smVLast->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+  //
   const SMDS_MeshNode * nFirst = SMESH_Algo::VertexNode( VFirst, meshDS );
   const SMDS_MeshNode * nLast  = SMESH_Algo::VertexNode( VLast, meshDS );
   if (!nFirst)