From 6c280dad9aa9ba3bd25ab96379ebe5138cec5453 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 28 Nov 2013 11:38:40 +0000 Subject: [PATCH] 22422: EDG SMESH Regression: Quadrangle/Hyptohesis Quadrangle preference fails Do not compute both QuadPreference and Standard --- src/StdMeshers/StdMeshers_Quadrangle_2D.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index 250948ddc..a5fd66d29 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -223,7 +223,8 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, return false; myQuadStruct = quad; - bool ok = false; + enum { NOT_COMPUTED = -1, COMPUTE_FAILED = 0, COMPUTE_OK = 1 }; + int res = NOT_COMPUTED; if (myQuadranglePreference) { 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))) { // special path genarating only quandrangle faces - ok = computeQuadPref( aMesh, F, quad ); + res = computeQuadPref( aMesh, F, quad ); } } else if (myQuadType == QUAD_REDUCED) @@ -252,7 +253,7 @@ bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh, if ((n1 == n3 && n2 != n4 && n24tmp == n24) || (n2 == n4 && n1 != n3 && n13tmp == n13)) { - ok = computeReduced( aMesh, F, quad ); + res = computeReduced( aMesh, F, quad ); } 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 ); - return ok; + return ( res == COMPUTE_OK ); } //================================================================================ -- 2.39.2