Salome HOME
0021815: EDF 2347 SMESH : Error when meshing vertices
[modules/smesh.git] / src / SMESH / SMESH_subMesh.cxx
index 7485f18fb71446d16ce476309a1f2a7013e0b33f..afaa256ec055eeacf819c99cf66fbad0a971dd4a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  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
@@ -18,6 +18,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 //  SMESH SMESH : implementaion of SMESH idl descriptions
 //  File   : SMESH_subMesh.cxx
@@ -405,6 +406,10 @@ const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn()
       {
         insertDependence(exp.Current());
       }
+      for (TopExp_Explorer exp(_subShape, TopAbs_VERTEX, TopAbs_EDGE); exp.More();exp.Next())
+      {
+        insertDependence(exp.Current());
+      }
       break;
     }
   case TopAbs_COMPSOLID:
@@ -1383,9 +1388,11 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
             break;
           }
         }
-        // compute
-//         cleanDependants(); for "UseExisting_*D" algos
-//         removeSubMeshElementsAndNodes();
+        // Compute
+
+        //cleanDependants(); for "UseExisting_*D" algos
+        //removeSubMeshElementsAndNodes();
+        loadDependentMeshes();
         ret = false;
         _computeState = FAILED_TO_COMPUTE;
         _computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo);
@@ -1606,14 +1613,12 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
       break;
     case COMPUTE:      // nothing to do
       break;
-#ifdef WITH_SMESH_CANCEL_COMPUTE
     case COMPUTE_CANCELED:
       {
         algo = GetAlgo();
         algo->CancelCompute();
       }
       break;
-#endif
     case CLEAN:
       cleanDependants(); // submeshes dependent on me should be cleaned as well
       removeSubMeshElementsAndNodes();
@@ -1638,6 +1643,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         else
           _computeState = NOT_READY;
       break;
+    // case SUBMESH_LOADED:
+    //   break;
     default:
       ASSERT(0);
       break;
@@ -1799,9 +1806,9 @@ void SMESH_subMesh::updateSubMeshState(const compute_state theState)
 //purpose  :
 //=======================================================================
 
-void SMESH_subMesh::ComputeSubMeshStateEngine(int event)
+void SMESH_subMesh::ComputeSubMeshStateEngine(int event, const bool includeSelf)
 {
-  SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,false);
+  SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(includeSelf,false);
   while ( smIt->more() )
     smIt->next()->ComputeStateEngine(event);
 }