Salome HOME
IPAL52943: "Apply and Close" button does not active on symmetry dialog box
[modules/smesh.git] / src / StdMeshers / StdMeshers_Adaptive1D.cxx
index 45e22ebb3fc23e654e35e05b63b96608f974025a..24c054636c26a814ad4f358ac80e56d646806c70 100644 (file)
@@ -535,7 +535,7 @@ namespace // internal utils
         for ( int i = 0; i < 3; ++i )
         {
           const gp_Pnt& pn = myNodes->Value(n[i]);
-          if ( avoidTria = ( pn.SquareDistance( *avoidPnt ) <= tol2 ))
+          if (( avoidTria = ( pn.SquareDistance( *avoidPnt ) <= tol2 )))
             break;
           if ( !projectedOnly )
             minD2 = Min( minD2, pn.SquareDistance( p ));
@@ -1260,7 +1260,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
         double maxSegSize = 0;
 
         // get points to check distance to the face
-        EdgeData::TPntIter pIt2 = eData.myPoints.begin(), pIt1 = pIt2++;
+        EdgeData::TPntIter pIt2 = eData.myPoints.begin(), pIt1 = pIt2++, pItLast;
         maxSegSize = pIt1->mySegSize = Min( pIt1->mySegSize, sizeTree.GetSize( pIt1->myP ));
         for ( ; pIt2 != eData.myPoints.end(); )
         {
@@ -1290,6 +1290,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
         //cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
         sizeDecreased = false;
         const gp_Pnt* avoidPnt = & eData.First().myP;
+        pItLast = --eData.myPoints.end();
         for ( pIt1 = eData.myPoints.begin(); pIt1 != eData.myPoints.end();  )
         {
           double distToFace =
@@ -1316,7 +1317,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
             pIt1->mySegSize = allowedSize;
           }
           ++pIt1;
-          if ( & (*pIt1) == & eData.Last() )
+          if ( pIt1 == pItLast )
             avoidPnt = & eData.Last().myP;
           else
             avoidPnt = NULL;
@@ -1504,7 +1505,7 @@ bool AdaptiveAlgo::Evaluate(SMESH_Mesh &         theMesh,
 
   for ( ; edExp.More(); edExp.Next() )
   {
-    const TopoDS_Edge & edge = TopoDS::Edge( edExp.Current() );
+    //const TopoDS_Edge & edge = TopoDS::Edge( edExp.Current() );
     StdMeshers_Regular_1D::Evaluate( theMesh, theShape, theResMap );
   }
   return true;