Salome HOME
0021893: EDF 2133 SMESH : Improvement of 3D extrusion algorithm
authoreap <eap@opencascade.com>
Mon, 4 Feb 2013 12:18:16 +0000 (12:18 +0000)
committereap <eap@opencascade.com>
Mon, 4 Feb 2013 12:18:16 +0000 (12:18 +0000)
   find the source FACE by local 1D hyps

src/StdMeshers/StdMeshers_Prism_3D.cxx

index ee33b97933ddc105b7cfbd142648ef5b9a951b94..fb93ab135a9274e148e1c1c53203b7c6a56e761d 100644 (file)
@@ -485,8 +485,8 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
   }
   //meshedFaces.splice( meshedFaces.begin(), notQuadMeshedFaces );
 
-  if ( meshedFaces.empty() )
-    return error( COMPERR_BAD_INPUT_MESH, "No meshed source faces found" );
+  // if ( meshedFaces.empty() )
+  //   return error( COMPERR_BAD_INPUT_MESH, "No meshed source faces found" );
 
   TopTools_MapOfShape meshedSolids;
   list< Prism_3D::TPrismTopo > meshedPrism;
@@ -574,6 +574,36 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
         break; // to compute prisms with avident sources
     }
 
+      // find FACEs with local 1D hyps, which has to be computed by now,
+      // or at least any computed FACEs
+      for ( int iF = 1; iF < faceToSolids.Extent(); ++iF )
+      {
+        const TopoDS_Face& face = TopoDS::Face( faceToSolids.FindKey( iF ));
+        SMESH_subMesh*   faceSM = theMesh.GetSubMesh( face );
+        if ( !faceSM->IsEmpty() )
+        {
+          meshedFaces.push_back( face ); // lower priority
+        }
+        else
+        {
+          bool allSubMeComputed = true;
+          SMESH_subMeshIteratorPtr smIt = faceSM->getDependsOnIterator(false,true);
+          while ( smIt->more() && allSubMeComputed )
+            allSubMeComputed = smIt->next()->IsMeshComputed();
+          if ( allSubMeComputed )
+          {
+            faceSM->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+            if ( !faceSM->IsEmpty() )
+              meshedFaces.push_front( face ); // higher priority
+            else
+              faceSM->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
+          }
+        }
+        if ( !meshedFaces.empty() )
+          break;
+      }
+
+
     // TODO. there are other ways to find out the source FACE:
     // propagation, topological similarity, ect.