Salome HOME
fix failures of non-regression tests
authoreap <eap@opencascade.com>
Wed, 27 Feb 2013 11:53:02 +0000 (11:53 +0000)
committereap <eap@opencascade.com>
Wed, 27 Feb 2013 11:53:02 +0000 (11:53 +0000)
1) compute the given bottom FACE in StdMeshers_Prism_3D::compute(const TPrismTopo& thePrism)
2) set higher priority to non-quadrilateral computed FACEs over all FACEs having structured mesh

src/StdMeshers/StdMeshers_Prism_3D.cxx

index eae0a3138d840bb2ad7f64f850a294d59a0231e3..2f783b4184c10ca4ed04a60b26767b54ef9126bd 100644 (file)
@@ -470,7 +470,7 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
   TopExp::MapShapesAndAncestors( theShape, TopAbs_FACE, TopAbs_SOLID, faceToSolids );
 
   // look for meshed FACEs ("source" FACEs) that must be prism bottoms
-  list< TopoDS_Face > meshedFaces;//, notQuadMeshedFaces, notQuadFaces;
+  list< TopoDS_Face > meshedFaces, notQuadMeshedFaces;//, notQuadFaces;
   const bool meshHasQuads = ( theMesh.NbQuadrangles() > 0 );
   for ( int iF = 1; iF < faceToSolids.Extent(); ++iF )
   {
@@ -480,14 +480,17 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
     {
       if ( !meshHasQuads ||
            !helper.IsSameElemGeometry( faceSM->GetSubMeshDS(), SMDSGeom_QUADRANGLE ) ||
-           !helper.IsStructured( faceSM ))
-        // notQuadMeshedFaces are of higher priority
+           !helper.IsStructured( faceSM )
+           )
+        notQuadMeshedFaces.push_front( face );
+      else if ( myHelper->Count( face, TopAbs_EDGE, /*ignoreSame=*/false ) != 4 )
         meshedFaces.push_front( face );
       else
         meshedFaces.push_back( face );
     }
   }
-  //meshedFaces.splice( meshedFaces.begin(), notQuadMeshedFaces );
+  // notQuadMeshedFaces are of highest priority
+  meshedFaces.splice( meshedFaces.begin(), notQuadMeshedFaces );
 
   // if ( meshedFaces.empty() )
   //   return error( COMPERR_BAD_INPUT_MESH, "No meshed source faces found" );
@@ -709,7 +712,7 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
   // -------------------------
 
   // Compose a vector of indixes of right neighbour FACE for each wall FACE
-  // that is not so evident in case of several WIREs
+  // that is not so evident in case of several WIREs in the bottom FACE
   thePrism.myRightQuadIndex.clear();
   for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
     thePrism.myRightQuadIndex.push_back( i+1 );
@@ -1512,7 +1515,12 @@ bool StdMeshers_Prism_3D::assocOrProjBottom2Top()
   SMESHDS_SubMesh * topSMDS = topSM->GetSubMeshDS();
 
   if ( !botSMDS || botSMDS->NbElements() == 0 )
-    return toSM( error(TCom("No elememts on face #") << botSM->GetId() ));
+  {
+    _gen->Compute( *myHelper->GetMesh(), botSM->GetSubShape() );
+    botSMDS = botSM->GetSubMeshDS();
+    if ( !botSMDS || botSMDS->NbElements() == 0 )
+      return toSM( error(TCom("No elememts on face #") << botSM->GetId() ));
+  }
 
   bool needProject = !topSM->IsMeshComputed();
   if ( !needProject &&