]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PAL13473 (Build repetitive mesh):
authoreap <eap@opencascade.com>
Thu, 7 Dec 2006 13:11:24 +0000 (13:11 +0000)
committereap <eap@opencascade.com>
Thu, 7 Dec 2006 13:11:24 +0000 (13:11 +0000)
notify dependent submesh on successful COMPUTE event

src/SMESH/SMESH_subMesh.cxx
src/SMESH/SMESH_subMeshEventListener.hxx

index 1701da6004a47fcf9e387284de9445bea1e4eb65..2fe40906c6336c081fb9160a8c9b77df9c702c7b 100644 (file)
@@ -1913,7 +1913,8 @@ void SMESH_subMesh::DeleteOwnListeners()
  * \param hyp - hypothesis, if eventType is algo_event
  * 
  * The base implementation translates CLEAN event to the subMesh
- * stored in listener data
+ * stored in listener data. Also it sends SUBMESH_COMPUTED event in case of
+ * successful COMPUTE event.
  */
 //================================================================================
 
@@ -1923,9 +1924,19 @@ void SMESH_subMeshEventListener::ProcessEvent(const int          event,
                                               EventListenerData* data,
                                               SMESH_Hypothesis*  /*hyp*/)
 {
-  if ( event == SMESH_subMesh::CLEAN && eventType == SMESH_subMesh::COMPUTE_EVENT )
-    if ( data && !data->mySubMeshes.empty() ) {
-      ASSERT( data->mySubMeshes.front() != subMesh );
+  if ( data && !data->mySubMeshes.empty() &&
+       eventType == SMESH_subMesh::COMPUTE_EVENT)
+  {
+    ASSERT( data->mySubMeshes.front() != subMesh );
+    switch ( event ) {
+    case SMESH_subMesh::CLEAN:
       data->mySubMeshes.front()->ComputeStateEngine( event );
+      break;
+    case SMESH_subMesh::COMPUTE:
+      if ( subMesh->GetComputeState() == SMESH_subMesh::COMPUTE_OK )
+        data->mySubMeshes.front()->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED );
+      break;
+    default:;
     }
+  }
 }
index f8a5fc4be834ec68ef57077f1aa2b5c6469fa978..2424bfe54a55ca17435369395849f88156024808 100644 (file)
@@ -55,7 +55,8 @@ public:
    * \param hyp - hypothesis, if eventType is algo_event
    * 
    * The base implementation translates CLEAN event to the subMesh stored
-   * in the listener data
+   * in the listener data. Also it sends SUBMESH_COMPUTED event in case of
+   * successful COMPUTE event.
    */
   virtual void ProcessEvent(const int          event,
                             const int          eventType,