22422: EDG SMESH Regression: Quadrangle/Hyptohesis Quadrangle preference fails

Do not compute both QuadPreference and Standard
This commit is contained in:
eap 2013-11-28 11:38:40 +00:00
parent 05ee6999b7
commit 6c280dad9a

View File

@ -223,7 +223,8 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
return false; return false;
myQuadStruct = quad; myQuadStruct = quad;
bool ok = false; enum { NOT_COMPUTED = -1, COMPUTE_FAILED = 0, COMPUTE_OK = 1 };
int res = NOT_COMPUTED;
if (myQuadranglePreference) if (myQuadranglePreference)
{ {
int n1 = quad->side[0]->NbPoints(); int n1 = quad->side[0]->NbPoints();
@ -236,7 +237,7 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
if (nfull == ntmp && ((n1 != n3) || (n2 != n4))) if (nfull == ntmp && ((n1 != n3) || (n2 != n4)))
{ {
// special path genarating only quandrangle faces // special path genarating only quandrangle faces
ok = computeQuadPref( aMesh, F, quad ); res = computeQuadPref( aMesh, F, quad );
} }
} }
else if (myQuadType == QUAD_REDUCED) else if (myQuadType == QUAD_REDUCED)
@ -252,7 +253,7 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
if ((n1 == n3 && n2 != n4 && n24tmp == n24) || if ((n1 == n3 && n2 != n4 && n24tmp == n24) ||
(n2 == n4 && n1 != n3 && n13tmp == n13)) (n2 == n4 && n1 != n3 && n13tmp == n13))
{ {
ok = computeReduced( aMesh, F, quad ); res = computeReduced( aMesh, F, quad );
} }
else else
{ {
@ -270,12 +271,15 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
} }
} }
ok = computeQuadDominant( aMesh, F, quad ); if ( res == NOT_COMPUTED )
{
res = computeQuadDominant( aMesh, F, quad );
}
if ( ok && myNeedSmooth ) if ( res == COMPUTE_OK && myNeedSmooth )
smooth( quad ); smooth( quad );
return ok; return ( res == COMPUTE_OK );
} }
//================================================================================ //================================================================================