Salome HOME
022150: [CEA 789] Projection_1D2D not taken into account by BLSURF
authoreap <eap@opencascade.com>
Wed, 6 Mar 2013 13:34:53 +0000 (13:34 +0000)
committereap <eap@opencascade.com>
Wed, 6 Mar 2013 13:34:53 +0000 (13:34 +0000)
 enum compute_event {
     ...
+    COMPUTE_SUBMESH

src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_subMesh.cxx
src/SMESH/SMESH_subMesh.hxx

index 2e8a963078a6e67d006db824b98c0e813d38c4bc..44e5a46d39a1894f36380c7cf106025a4a2cb59b 100644 (file)
@@ -63,18 +63,16 @@ using namespace std;
 
 SMESH_Gen::SMESH_Gen()
 {
 
 SMESH_Gen::SMESH_Gen()
 {
-        MESSAGE("SMESH_Gen::SMESH_Gen");
-        _localId = 0;
-        _hypId = 0;
-        _segmentation = _nbSegments = 10;
-        SMDS_Mesh::_meshList.clear();
-        MESSAGE(SMDS_Mesh::_meshList.size());
-        //_counters = new counters(100);
-#ifdef WITH_SMESH_CANCEL_COMPUTE
-        _compute_canceled = false;
-        _sm_current = NULL;
-#endif
-        //vtkDebugLeaks::SetExitError(0);
+  MESSAGE("SMESH_Gen::SMESH_Gen");
+  _localId = 0;
+  _hypId = 0;
+  _segmentation = _nbSegments = 10;
+  SMDS_Mesh::_meshList.clear();
+  MESSAGE(SMDS_Mesh::_meshList.size());
+  //_counters = new counters(100);
+  _compute_canceled = false;
+  _sm_current = NULL;
+  //vtkDebugLeaks::SetExitError(0);
 }
 
 //=============================================================================
 }
 
 //=============================================================================
@@ -145,6 +143,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
   const int  globalAlgoDim = 100;
 
   SMESH_subMeshIteratorPtr smIt;
   const int  globalAlgoDim = 100;
 
   SMESH_subMeshIteratorPtr smIt;
+  SMESH_subMesh::compute_event computeEvent;
+  if ( !anUpward && aShape.IsSame( aMesh.GetShapeToMesh() ))
+    computeEvent = SMESH_subMesh::COMPUTE;
+  else
+    computeEvent = SMESH_subMesh::COMPUTE_SUBMESH;
 
   if ( anUpward ) // is called from below code here
   {
 
   if ( anUpward ) // is called from below code here
   {
@@ -172,15 +175,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
 
       if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
       {
 
       if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
       {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
         if (_compute_canceled)
           return false;
         _sm_current = smToCompute;
         if (_compute_canceled)
           return false;
         _sm_current = smToCompute;
-#endif
-        smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
-#ifdef WITH_SMESH_CANCEL_COMPUTE
+        smToCompute->ComputeStateEngine( computeEvent );
         _sm_current = NULL;
         _sm_current = NULL;
-#endif
       }
 
       // we check all the submeshes here and detect if any of them failed to compute
       }
 
       // we check all the submeshes here and detect if any of them failed to compute
@@ -258,15 +257,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
         }
         else
         {
         }
         else
         {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
           if (_compute_canceled)
             return false;
           _sm_current = smToCompute;
           if (_compute_canceled)
             return false;
           _sm_current = smToCompute;
-#endif
-          smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
-#ifdef WITH_SMESH_CANCEL_COMPUTE
+          smToCompute->ComputeStateEngine( computeEvent );
           _sm_current = NULL;
           _sm_current = NULL;
-#endif
           if ( aShapesId )
             aShapesId->insert( smToCompute->GetId() );
         }
           if ( aShapesId )
             aShapesId->insert( smToCompute->GetId() );
         }
@@ -342,15 +337,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh &          aMesh,
         if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
           continue;
 
         if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
           continue;
 
-#ifdef WITH_SMESH_CANCEL_COMPUTE
         if (_compute_canceled)
           return false;
         _sm_current = sm;
         if (_compute_canceled)
           return false;
         _sm_current = sm;
-#endif
-        sm->ComputeStateEngine( SMESH_subMesh::COMPUTE );
-#ifdef WITH_SMESH_CANCEL_COMPUTE
+        sm->ComputeStateEngine( computeEvent );
         _sm_current = NULL;
         _sm_current = NULL;
-#endif
         if ( aShapesId )
           aShapesId->insert( sm->GetId() );
       }
         if ( aShapesId )
           aShapesId->insert( sm->GetId() );
       }
index 08b033dc97ce9a590424fa23674be157dae46844..2049d5ff60975be14916f5c288139b167238fc29 100644 (file)
@@ -1336,6 +1336,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
   switch ( event ) {
   case MODIF_ALGO_STATE:
   case COMPUTE:
   switch ( event ) {
   case MODIF_ALGO_STATE:
   case COMPUTE:
+  case COMPUTE_SUBMESH:
     //case COMPUTE_CANCELED:
   case CLEAN:
     //case SUBMESH_COMPUTED:
     //case COMPUTE_CANCELED:
   case CLEAN:
     //case SUBMESH_COMPUTED:
@@ -1393,11 +1394,10 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         _computeState = READY_TO_COMPUTE;
       break;
     case COMPUTE:               // nothing to do
         _computeState = READY_TO_COMPUTE;
       break;
     case COMPUTE:               // nothing to do
+    case COMPUTE_SUBMESH:
       break;
       break;
-#ifdef WITH_SMESH_CANCEL_COMPUTE
-    case COMPUTE_CANCELED:               // nothing to do
+    case COMPUTE_CANCELED:      // nothing to do
       break;
       break;
-#endif
     case CLEAN:
       cleanDependants();
       removeSubMeshElementsAndNodes();
     case CLEAN:
       cleanDependants();
       removeSubMeshElementsAndNodes();
@@ -1440,6 +1440,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
       }
       break;
     case COMPUTE:
       }
       break;
     case COMPUTE:
+    case COMPUTE_SUBMESH:
       {
         algo = GetAlgo();
         ASSERT(algo);
       {
         algo = GetAlgo();
         ASSERT(algo);
@@ -1455,10 +1456,16 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         // check submeshes needed
         if (_father->HasShapeToMesh() ) {
           bool subComputed = false, subFailed = false;
         // check submeshes needed
         if (_father->HasShapeToMesh() ) {
           bool subComputed = false, subFailed = false;
-          if (!algo->OnlyUnaryInput())
-            shape = getCollection( gen, algo, subComputed, subFailed );
-          else
+          if (!algo->OnlyUnaryInput()) {
+            if ( event == COMPUTE &&
+                 ( algo->NeedDiscreteBoundary() || algo->SupportSubmeshes() ))
+              shape = getCollection( gen, algo, subComputed, subFailed );
+            else
+              subComputed = SubMeshesComputed( & subFailed );
+          }
+          else {
             subComputed = SubMeshesComputed();
             subComputed = SubMeshesComputed();
+          }
           ret = ( algo->NeedDiscreteBoundary() ? subComputed :
                   algo->SupportSubmeshes() ? !subFailed :
                   ( !subComputed || _father->IsNotConformAllowed() ));
           ret = ( algo->NeedDiscreteBoundary() ? subComputed :
                   algo->SupportSubmeshes() ? !subFailed :
                   ( !subComputed || _father->IsNotConformAllowed() ));
@@ -1607,10 +1614,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         }
       }
       break;
         }
       }
       break;
-#ifdef WITH_SMESH_CANCEL_COMPUTE
     case COMPUTE_CANCELED:               // nothing to do
       break;
     case COMPUTE_CANCELED:               // nothing to do
       break;
-#endif
     case CLEAN:
       cleanDependants();
       removeSubMeshElementsAndNodes();
     case CLEAN:
       cleanDependants();
       removeSubMeshElementsAndNodes();
@@ -1664,10 +1669,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
       break;
     case COMPUTE:               // nothing to do
       break;
       break;
     case COMPUTE:               // nothing to do
       break;
-#ifdef WITH_SMESH_CANCEL_COMPUTE
-    case COMPUTE_CANCELED:               // nothing to do
+    case COMPUTE_CANCELED:      // nothing to do
       break;
       break;
-#endif
     case CLEAN:
       cleanDependants();  // clean sub-meshes, dependant on this one, with event CLEAN
       removeSubMeshElementsAndNodes();
     case CLEAN:
       cleanDependants();  // clean sub-meshes, dependant on this one, with event CLEAN
       removeSubMeshElementsAndNodes();
@@ -1721,7 +1724,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
       else
         _computeState = NOT_READY;
       break;
       else
         _computeState = NOT_READY;
       break;
-    case COMPUTE:      // nothing to do
+    case COMPUTE:        // nothing to do
+    case COMPUTE_SUBMESH:
       break;
     case COMPUTE_CANCELED:
       {
       break;
     case COMPUTE_CANCELED:
       {
@@ -2369,6 +2373,7 @@ void SMESH_subMeshEventListener::ProcessEvent(const int          event,
         (*smIt)->ComputeStateEngine( event );
       break;
     case SMESH_subMesh::COMPUTE:
         (*smIt)->ComputeStateEngine( event );
       break;
     case SMESH_subMesh::COMPUTE:
+    case SMESH_subMesh::COMPUTE_SUBMESH:
       if ( subMesh->GetComputeState() == SMESH_subMesh::COMPUTE_OK )
         for ( ; smIt != smEnd; ++ smIt)
           (*smIt)->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED );
       if ( subMesh->GetComputeState() == SMESH_subMesh::COMPUTE_OK )
         for ( ; smIt != smEnd; ++ smIt)
           (*smIt)->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED );
index 669ef7164ac479b08b09674c97c5fb6c8485b48c..5e0abcd72afe34e0d1b54fc26a23857059f10ace 100644 (file)
@@ -107,7 +107,7 @@ class SMESH_EXPORT SMESH_subMesh
   };
   enum compute_event
   {
   };
   enum compute_event
   {
-    MODIF_ALGO_STATE, COMPUTE, COMPUTE_CANCELED,
+    MODIF_ALGO_STATE, COMPUTE, COMPUTE_SUBMESH, COMPUTE_CANCELED,
     CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED, SUBMESH_LOADED,
     MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE
   };
     CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED, SUBMESH_LOADED,
     MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE
   };