Salome HOME
Fix compilation errors using gcc-5.X relating to explicit stream::operator bool()
[modules/smesh.git] / src / StdMeshers / StdMeshers_FaceSide.cxx
index 2625b9fb1322eab64c256b743d3c76a64c076069..3849040e995afa5de3d232518f36b7dd3410fdac 100644 (file)
@@ -310,14 +310,14 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool   isXConst,
     if ( NbEdges() == 0 ) return myPoints;
 
     StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this );
-    SMESHDS_Mesh*    meshDS = myProxyMesh->GetMeshDS();
+    //SMESHDS_Mesh*    meshDS = myProxyMesh->GetMeshDS();
     SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
     SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
     fHelper.SetSubShape( myFace );
     bool paramOK;
     double eps = 1e-100;
 
-    // sort nodes of all edges putting them into a map
+    // sort nodes of all edges by putting them into a map
 
     map< double, const SMDS_MeshNode*>            u2node;
     vector< pair< double, const SMDS_MeshNode*> > u2nodeVec;
@@ -428,8 +428,8 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool   isXConst,
       u2node.insert( u2node.end(), make_pair( 1., node ));
     }
 
-    if ( u2node.size() + nbProxyNodes != myNbPonits &&
-         u2node.size() + nbProxyNodes != NbPoints( /*update=*/true ))
+    if ((int) u2node.size() + nbProxyNodes != myNbPonits &&
+        (int) u2node.size() + nbProxyNodes != NbPoints( /*update=*/true ))
     {
       MESSAGE("Wrong node parameters on edges, u2node.size():"
               <<u2node.size()<<" !=  myNbPonits:"<<myNbPonits);
@@ -513,9 +513,9 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool   isXConst,
 
     // set <constValue>
     if ( isXConst )
-      for ( iPt = 0; iPt < points.size(); ++iPt ) points[ iPt ].x = constValue;
+      for ( iPt = 0; iPt < (int)points.size(); ++iPt ) points[ iPt ].x = constValue;
     else
-      for ( iPt = 0; iPt < points.size(); ++iPt ) points[ iPt ].y = constValue;
+      for ( iPt = 0; iPt < (int)points.size(); ++iPt ) points[ iPt ].y = constValue;
 
   } // if ( myPoints.empty())
 
@@ -543,7 +543,7 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::SimulateUVPtStruct(int    nbSeg,
 
     int EdgeIndex = 0;
     double prevNormPar = 0, paramSize = myNormPar[ EdgeIndex ];
-    for (int i = 0 ; i < myFalsePoints.size(); ++i ) {
+    for ( size_t i = 0 ; i < myFalsePoints.size(); ++i ) {
       double normPar = double(i) / double(nbSeg);
       UVPtStruct & uvPt = (*points)[i];
       uvPt.node = 0;
@@ -582,7 +582,7 @@ std::vector<const SMDS_MeshNode*> StdMeshers_FaceSide::GetOrderedNodes(int theEd
   {
     if ( NbEdges() == 0 ) return resultNodes;
 
-    SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
+    //SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
     SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
     SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
     fHelper.SetSubShape( myFace );
@@ -682,8 +682,8 @@ std::vector<const SMDS_MeshNode*> StdMeshers_FaceSide::GetOrderedNodes(int theEd
     // Fill the result vector
 
     if ( theEdgeInd < 0 &&
-         u2node.size() != myNbPonits &&
-         u2node.size() != NbPoints( /*update=*/true ))
+         (int) u2node.size() != myNbPonits &&
+         (int) u2node.size() != NbPoints( /*update=*/true ))
     {
       u2node.clear();
     }
@@ -810,7 +810,7 @@ const SMDS_MeshNode* StdMeshers_FaceSide::VertexNode(std::size_t i, bool* isMove
     n = SMESH_Algo::VertexNode( V, sm, myProxyMesh->GetMesh(), /*checkV=*/false );
 
     if (( !n ) &&
-        (( i > 0 && i < NbEdges() ) || IsClosed() ))
+        (( i > 0 && (int) i < NbEdges() ) || IsClosed() ))
     {
       iE = SMESH_MesherHelper::WrapIndex( int(i)-1, NbEdges() );
       sm = myProxyMesh->GetMeshDS()->MeshElements( myEdgeID[ iE ]);
@@ -1051,7 +1051,7 @@ void StdMeshers_FaceSide::dump(const char* msg) const
   if (msg) MESSAGE ( std::endl << msg );
   MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() );
   MESSAGE_ADD ( "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.size() );
-  for ( int i=0; i<myEdge.size(); ++i)
+  for ( size_t i = 0; i < myEdge.size(); ++i )
   {
     MESSAGE_ADD ( "\t"<<i+1 );
     MESSAGE_ADD ( "\tEDGE: " );
@@ -1061,17 +1061,17 @@ void StdMeshers_FaceSide::dump(const char* msg) const
     else {
       TopAbs::Print(myEdge[i].Orientation(),cout)<<" "<<myEdge[i].TShape().operator->()<<endl;
       MESSAGE_ADD ( "\tV1: " << TopExp::FirstVertex( myEdge[i], 1).TShape().operator->()
-                 << "  V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() );
+                    << "  V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() );
     }
     MESSAGE_ADD ( "\tC2d: ");
-    
+
     if (myC2d[i].IsNull()) {
       MESSAGE_ADD ( "NULL" );
     }
     else {
       MESSAGE_ADD ( myC2d[i].operator->() );
     }
-      
+
     MESSAGE_ADD ( "\tF: "<<myFirst[i]<< " L: "<< myLast[i] );
     MESSAGE_END ( "\tnormPar: "<<myNormPar[i]<<endl );
   }
@@ -1113,7 +1113,7 @@ BRepAdaptor_CompCurve* StdMeshers_FaceSide::GetCurve3d() const
   TopoDS_Wire aWire;
   BRep_Builder aBuilder;
   aBuilder.MakeWire(aWire);
-  for ( int i=0; i<myEdge.size(); ++i )
+  for ( size_t i = 0; i < myEdge.size(); ++i )
     aBuilder.Add( aWire, myEdge[i] );
 
   if ( myEdge.size() == 2 && IsClosed() )
@@ -1157,7 +1157,7 @@ gp_Pnt2d StdMeshers_FaceSide::Value2d(double U) const
     int i = U * double( myPoints.size()-1 );
     while ( i > 0 && myPoints[ i ].normParam > U )
       --i;
-    while ( i+1 < myPoints.size() && myPoints[ i+1 ].normParam < U )
+    while ( i+1 < (int)myPoints.size() && myPoints[ i+1 ].normParam < U )
       ++i;
     double r = (( U - myPoints[ i ].normParam ) /
                 ( myPoints[ i+1 ].normParam - myPoints[ i ].normParam ));