Salome HOME
Fix compilation errors using gcc-5.X relating to explicit stream::operator bool()
[modules/smesh.git] / src / StdMeshers / StdMeshers_Quadrangle_2D.cxx
index a3bf670cbdc644d54a26b46a6a824621ec5326bd..e55edf26aff59ab6801d8cfde585549c1099f8a4 100644 (file)
@@ -1781,10 +1781,10 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh &        aMesh,
   //       0  bottom  1
 
 
-  const int bfrom = quad->side[0].from;
-  const int rfrom = quad->side[1].from;
+  //const int bfrom = quad->side[0].from;
+  //const int rfrom = quad->side[1].from;
   const int tfrom = quad->side[2].from;
-  const int lfrom = quad->side[3].from;
+  //const int lfrom = quad->side[3].from;
   {
     const vector<UVPtStruct>& uv_eb_vec = quad->side[0].GetUVPtStruct(true,0);
     const vector<UVPtStruct>& uv_er_vec = quad->side[1].GetUVPtStruct(false,1);
@@ -1925,10 +1925,10 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh &        aMesh,
 
     } // if ( dv != 0 && dh != 0 )
 
-    const int db = quad->side[0].IsReversed() ? -1 : +1;
-    const int dr = quad->side[1].IsReversed() ? -1 : +1;
+    //const int db = quad->side[0].IsReversed() ? -1 : +1;
+    //const int dr = quad->side[1].IsReversed() ? -1 : +1;
     const int dt = quad->side[2].IsReversed() ? -1 : +1;
-    const int dl = quad->side[3].IsReversed() ? -1 : +1;
+    //const int dl = quad->side[3].IsReversed() ? -1 : +1;
 
     // Case dv == 0,  here possibly myQuadList.size() > 1
     //
@@ -2970,7 +2970,8 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh &        aMesh,
     const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
     const vector<UVPtStruct>& uv_el = quad->side[3].GetUVPtStruct(false,0);
 
-    if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl)
+    if ((int) uv_eb.size() != nb || (int) uv_er.size() != nr ||
+        (int) uv_et.size() != nt || (int) uv_el.size() != nl)
       return error(COMPERR_BAD_INPUT_MESH);
 
     // arrays for normalized params
@@ -3283,7 +3284,8 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh &        aMesh,
     const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
     const vector<UVPtStruct>& uv_el = quad->side[3].GetUVPtStruct(false,0);
 
-    if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl)
+    if ((int) uv_eb.size() != nb || (int) uv_er.size() != nr ||
+        (int) uv_et.size() != nt || (int) uv_el.size() != nl)
       return error(COMPERR_BAD_INPUT_MESH);
 
     gp_UV uv[ UV_SIZE ];
@@ -4337,7 +4339,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face&          theFace,
 
   // check if there are possible variations in choosing corners
   bool haveVariants = false;
-  if ( vertexByAngle.size() > nbCorners )
+  if ((int) vertexByAngle.size() > nbCorners )
   {
     double lostAngle = a2v->first;
     double lastAngle = ( --a2v, a2v->first );
@@ -4345,7 +4347,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face&          theFace,
   }
 
   const double angleTol = 5.* M_PI/180;
-  myCheckOri = ( vertexByAngle.size() > nbCorners ||
+  myCheckOri = ( (int)vertexByAngle.size() > nbCorners ||
                  vertexByAngle.begin()->first < angleTol );
 
   // make theWire begin from a corner vertex or triaVertex
@@ -4475,7 +4477,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face&          theFace,
       {
         // select two halfDivider's as corners
         TGeoIndex hd1, hd2 = -1;
-        int iC2;
+        size_t iC2;
         for ( iC2 = 0; iC2 < cornerInd.size() && hd2 < 0; ++iC2 )
         {
           hd1 = cornerInd[ iC2 ];
@@ -4521,10 +4523,10 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face&          theFace,
         vector< double > accuLength;
         double totalLen = 0;
         vector< TGeoIndex > evVec( equVerts.begin(), equVerts.end() );
-        int          iEV = 0;
+        size_t      iEV = 0;
         TGeoIndex    iE = cornerInd[ helper.WrapIndex( iC - nbC[0] - 1, cornerInd.size() )];
         TGeoIndex iEEnd = cornerInd[ helper.WrapIndex( iC + nbC[1] + 1, cornerInd.size() )];
-        while ( accuLength.size() < nbEqualV + int( !allCornersSame ) )
+        while ((int) accuLength.size() < nbEqualV + int( !allCornersSame ) )
         {
           // accumulate length of edges before iEV-th equal vertex
           accuLength.push_back( totalLen );
@@ -4780,8 +4782,6 @@ bool StdMeshers_Quadrangle_2D::addEnforcedNodes()
       quadsBySide[ (*quadIt)->side[iSide] ].push_back( *quadIt );
     }
 
-  SMESH_Mesh*          mesh = myHelper->GetMesh();
-  SMESHDS_Mesh*      meshDS = myHelper->GetMeshDS();
   const TopoDS_Face&   face = TopoDS::Face( myHelper->GetSubShape() );
   Handle(Geom_Surface) surf = BRep_Tool::Surface( face );
 
@@ -4961,8 +4961,8 @@ bool StdMeshers_Quadrangle_2D::addEnforcedNodes()
           continue;
         const vector<UVPtStruct>& oGrid = side.contacts[iC].other_side->grid->GetUVPtStruct();
         const UVPtStruct&         uvPt  = points[ side.contacts[iC].point ];
-        if ( side.contacts[iC].other_point >= oGrid .size() ||
-             side.contacts[iC].point       >= points.size() )
+        if ( side.contacts[iC].other_point >= (int) oGrid .size() ||
+             side.contacts[iC].point       >= (int) points.size() )
           throw SALOME_Exception( "StdMeshers_Quadrangle_2D::addEnforcedNodes(): wrong contact" );
         if ( oGrid[ side.contacts[iC].other_point ].node )
           (( UVPtStruct& ) uvPt).node = oGrid[ side.contacts[iC].other_point ].node;
@@ -5118,9 +5118,9 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side&  side,
     return;
   }
 
-  const int iFrom    = Min ( iForced, *iNext );
-  const int iTo      = Max ( iForced, *iNext ) + 1;
-  const int sideSize = iTo - iFrom;
+  const int    iFrom    = Min ( iForced, *iNext );
+  const int    iTo      = Max ( iForced, *iNext ) + 1;
+  const size_t sideSize = iTo - iFrom;
 
   vector<UVPtStruct> points[4]; // side points of a temporary quad
 
@@ -5130,7 +5130,7 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side&  side,
   for ( int is2nd = 0; is2nd < 2; ++is2nd )
   {
     points[ is2nd ].reserve( sideSize );
-    int nbLoops = 0;
+    size_t nbLoops = 0;
     while ( points[is2nd].size() < sideSize )
     {
       int iCur = iFrom + points[is2nd].size() - int( !points[is2nd].empty() );
@@ -5624,8 +5624,8 @@ bool FaceQuadStruct::Side::IsForced( int nodeIndex ) const
 
 void FaceQuadStruct::Side::AddContact( int ip, Side* side, int iop )
 {
-  if ( ip  >= GetUVPtStruct().size()      ||
-       iop >= side->GetUVPtStruct().size() )
+  if ( ip  >= (int) GetUVPtStruct().size()      ||
+       iop >= (int) side->GetUVPtStruct().size() )
     throw SALOME_Exception( "FaceQuadStruct::Side::AddContact(): wrong point" );
   if ( ip < from || ip >= to )
     return;