]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
fix check that submeshes are computed if !algo->OnlyUnaryInput()
authoreap <eap@opencascade.com>
Tue, 22 Apr 2008 16:51:01 +0000 (16:51 +0000)
committereap <eap@opencascade.com>
Tue, 22 Apr 2008 16:51:01 +0000 (16:51 +0000)
src/SMESH/SMESH_subMesh.cxx
src/SMESH/SMESH_subMesh.hxx

index fa2ea74decdc4a9479f2e4efd8312591bebeaa38..e0891b1d6875f37c2aa3a3c63a479d5e44e19b23 100644 (file)
@@ -1312,9 +1312,14 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
           SetAlgoState(MISSING_HYP);
           break;
         }
+        TopoDS_Shape shape = _subShape;
         // check submeshes needed
         if (_father->HasShapeToMesh() ) {
-          bool subComputed = SubMeshesComputed();
+          bool subComputed = false;
+          if (!algo->OnlyUnaryInput())
+            shape = GetCollection( gen, algo, subComputed );
+          else
+            subComputed = SubMeshesComputed();
           ret = ( algo->NeedDescretBoundary() ? subComputed :
                   ( !subComputed || _father->IsNotConformAllowed() ));
           if (!ret) {
@@ -1332,7 +1337,6 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         ret = false;
         _computeState = FAILED_TO_COMPUTE;
         _computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo);
-        TopoDS_Shape shape = _subShape;
         try {
 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
           OCC_CATCH_SIGNALS;
@@ -1349,9 +1353,6 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
           }
           else
           {
-            if (!algo->OnlyUnaryInput()) {
-              shape = GetCollection( gen, algo );
-            }
             ret = algo->Compute((*_father), shape);
           }
           if ( !ret )
@@ -1508,6 +1509,9 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
     switch (event)
     {
     case MODIF_ALGO_STATE:
+      algo = gen->GetAlgo((*_father), _subShape);
+      if (algo && !algo->NeedDescretBoundary())
+        CleanDependsOn(); // clean sub-meshes with event CLEAN
       if (_algoState == HYP_OK)
         _computeState = READY_TO_COMPUTE;
       else
@@ -1780,10 +1784,14 @@ void SMESH_subMesh::RemoveSubMeshElementsAndNodes()
 //           meshed at once along with _subShape
 //=======================================================================
 
-TopoDS_Shape SMESH_subMesh::GetCollection(SMESH_Gen * theGen, SMESH_Algo* theAlgo)
+TopoDS_Shape SMESH_subMesh::GetCollection(SMESH_Gen * theGen,
+                                          SMESH_Algo* theAlgo,
+                                          bool &      theSubComputed)
 {
   MESSAGE("SMESH_subMesh::GetCollection");
 
+  theSubComputed = SubMeshesComputed();
+
   TopoDS_Shape mainShape = _father->GetMeshDS()->ShapeToMesh();
 
   if ( mainShape.IsSame( _subShape ))
@@ -1815,6 +1823,8 @@ TopoDS_Shape SMESH_subMesh::GetCollection(SMESH_Gen * theGen, SMESH_Algo* theAlg
       if (anAlgo == theAlgo &&
           anAlgo->GetUsedHypothesis( *_father, S, ignoreAuxiliaryHyps ) == aUsedHyp)
         aBuilder.Add( aCompound, S );
+      if ( !subMesh->SubMeshesComputed() )
+        theSubComputed = false;
     }
   }
 
index 9770d6da0a0c7200e52febbb24516c8ea804b612..a28a56ab44f23e4485c7dca2897d76161b47fddf 100644 (file)
@@ -241,7 +241,9 @@ protected:
    * \brief Return a shape containing all sub-shapes of the MainShape that can be
    * meshed at once along with _subShape
    */
-  TopoDS_Shape GetCollection(SMESH_Gen * theGen, SMESH_Algo* theAlgo);
+  TopoDS_Shape GetCollection(SMESH_Gen * theGen,
+                             SMESH_Algo* theAlgo,
+                             bool &      theSubComputed);
 
   /*!
    * \brief Apply theAlgo to all subshapes in theCollection