Salome HOME
23028: EDF 10508 SMESH: GroupOnFilter returns an empty group when the geometry is...
[modules/smesh.git] / src / StdMeshers / StdMeshers_Prism_3D.cxx
index f473b36ba669529e1adf6d24060e7d1138c15df1..343a3471a637d6a857fb3d31d1c1822c9790bacc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  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
@@ -1320,7 +1320,17 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
   // clear data
   myBotToColumnMap.clear();
   myBlock.Clear();
-        
+
+  // update state of sub-meshes (mostly in order to erase improper errors)
+  SMESH_subMesh* sm = myHelper->GetMesh()->GetSubMesh( thePrism.myShape3D );
+  SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/false);
+  while ( smIt->more() )
+  {
+    sm = smIt->next();
+    sm->GetComputeError().reset();
+    sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
+  }
+
   return true;
 }
 
@@ -2353,7 +2363,7 @@ bool StdMeshers_Prism_3D::isSimpleBottom( const Prism_3D::TPrismTopo& thePrism )
   TopoDS_Vertex commonV;
   const list< TopoDS_Edge >& botEdges = thePrism.myBottomEdges;
   list< TopoDS_Edge >::const_iterator edge = botEdges.begin();
-  for ( ; edge != botEdges.end(); ++edge )
+  while ( edge != botEdges.end() )
   {
     if ( SMESH_Algo::isDegenerated( *edge ))
       return false;