From add84232c666ce299cbde257ce4bc3648e8cd5c6 Mon Sep 17 00:00:00 2001 From: gdd Date: Thu, 12 May 2011 15:33:16 +0000 Subject: [PATCH] Fix compilation warnings --- src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx | 23 ++++------- src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx | 4 +- src/MEFISTO2/aptrte.cxx | 2 +- src/OBJECT/SMESH_ActorUtils.cxx | 10 ++--- src/OBJECT/SMESH_ExtractGeometry.cxx | 10 ++--- src/SMDS/SMDS_Downward.cxx | 7 +--- src/SMDS/SMDS_UnstructuredGrid.cxx | 5 --- src/SMDS/SMDS_VolumeTool.cxx | 2 + src/SMESH/SMESH_MeshEditor.cxx | 41 +++---------------- src/SMESH/SMESH_MesherHelper.cxx | 2 + src/SMESH/SMESH_Pattern.cxx | 7 ++-- src/SMESHGUI/SMESHGUI_VTKUtils.cxx | 3 +- src/StdMeshers/StdMeshers_Quadrangle_2D.cxx | 4 +- src/StdMeshers/StdMeshers_ViscousLayers.cxx | 15 +++++-- .../StdMeshersGUI_DistrTable.cxx | 2 +- .../StdMeshersGUI_NbSegmentsCreator.cxx | 2 + src/Tools/MeshCut/MeshCut_DC.cxx | 4 +- 17 files changed, 52 insertions(+), 91 deletions(-) diff --git a/src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx b/src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx index 13a318479..05d1eeef5 100644 --- a/src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx +++ b/src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx @@ -44,12 +44,9 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform() int intNumMaille, Degre; int ValElement; - int ValDegre; int NoeudsMaille[20]; int NoeudMaille; - bool ok; - MESSAGE("in DriverDAT_R_SMDS_Mesh::Read()"); /**************************************************************************** * OUVERTURE DU FICHIER EN LECTURE * @@ -72,7 +69,7 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform() for (i = 0; i < nbNodes; i++){ fscanf(aFileId, "%d %e %e %e\n", &intNumPoint, &coordX, &coordY, &coordZ); - ok = myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint); + myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint); } fprintf(stdout, "%d noeuds\n", myMesh->NbNodes()); @@ -100,29 +97,25 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform() switch (ValElement) { case 102: case 103: - ValDegre = 3; nbNoeuds = 2; - ok = myMesh->AddEdgeWithID(NoeudsMaille[0], NoeudsMaille[1], + myMesh->AddEdgeWithID(NoeudsMaille[0], NoeudsMaille[1], intNumMaille); break; case 204: case 208: - ValDegre = 9; nbNoeuds = 4; - ok = myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1], + myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1], NoeudsMaille[2], NoeudsMaille[3], intNumMaille); break; case 203: case 206: - ValDegre = 5; nbNoeuds = 3; - ok = myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1], + myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1], NoeudsMaille[2], intNumMaille); break; case 308: case 320: - ValDegre = 12; nbNoeuds = 8; if (ValElement == 320){ //A voir, correspondance VTK @@ -131,7 +124,7 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform() NoeudsMaille[6] = NoeudsMaille[10]; NoeudsMaille[7] = NoeudsMaille[11]; } - ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1], + myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1], NoeudsMaille[2], NoeudsMaille[3], NoeudsMaille[4], NoeudsMaille[5], NoeudsMaille[6], NoeudsMaille[7], @@ -139,17 +132,15 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform() break; case 304: case 310: - ValDegre = 10; nbNoeuds = 4; if (ValElement == 310) NoeudsMaille[3] = NoeudsMaille[6]; - ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1], + myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1], NoeudsMaille[2], NoeudsMaille[3], intNumMaille); break; case 306: case 315: - ValDegre = 12; nbNoeuds = 8; if (ValElement == 315) { NoeudsMaille[3] = NoeudsMaille[6]; @@ -161,7 +152,7 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform() NoeudsMaille[5] = NoeudsMaille[4]; NoeudsMaille[4] = NoeudsMaille[3]; NoeudsMaille[3] = NoeudsMaille[2]; - ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1], + myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1], NoeudsMaille[2], NoeudsMaille[3], NoeudsMaille[4], NoeudsMaille[5], intNumMaille); diff --git a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx index 666bd5e13..f01b2b924 100644 --- a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx @@ -280,8 +280,8 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() } } - // if(!anElement) - // MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<ShapeToIndex(s.Current())); +#endif SMESH_MesherHelper h(*myMesh); h.SetSubShape( s.Current() ); h.FixQuadraticElements(false); diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index 4478724a3..6226a006a 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -1899,7 +1899,7 @@ bool SMESH_Pattern:: for ( nIt = startNodes.begin(); nIt != startNodes.end(); nIt++ ) { - TIsoNode* prevN[2], *node = *nIt; + TIsoNode *node = *nIt; if ( node->IsUVComputed() || !node->IsMovable() ) continue; gp_XY newUV( 0, 0 ), sumDir( 0, 0 ); @@ -1960,7 +1960,6 @@ bool SMESH_Pattern:: newUV += prevNode1->myUV + dir * step[ iDir ]; } sumDir += dir; - prevN[ iDir ] = prevNode1; nbComp++; } } @@ -2022,7 +2021,7 @@ bool SMESH_Pattern:: } // define ratio bool ok = true; // <- stupid fix TO AVOID PB OF NODES WITH NULL BND NODES - double locR[2] = { 0, 0 }; +// double locR[2] = { 0, 0 }; for ( iDir = 0; iDir < 2; iDir++ ) { const int iCoord = 2 - iDir; // coord changing along an isoline @@ -2036,7 +2035,7 @@ bool SMESH_Pattern:: double par3 = bndNode2->myInitUV.Coord( iCoord ); double r = ( par2 - par1 ) / ( par3 - par1 ); r = Abs ( r - 0.5 ) * 2.0; // [0,1] - distance from the middle - locR[ iDir ] = ( 1 - r * r ) * 0.25; +// locR[ iDir ] = ( 1 - r * r ) * 0.25; } //locR[0] = locR[1] = 0.25; // intersect the 2 lines and move a node diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index a59cfef98..71df5c8e6 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -1267,7 +1267,7 @@ namespace SMESH {theBounds[0],theBounds[3],theBounds[5]}, {theBounds[1],theBounds[3],theBounds[5]}}; - int aMaxId = 0, aMinId = aMaxId; + int aMaxId = 0; theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]); theMinBoundPrj = theMaxBoundPrj; for(int i = 1; i < 8; i++){ @@ -1278,7 +1278,6 @@ namespace SMESH } if(theMinBoundPrj > aTmp){ theMinBoundPrj = aTmp; - aMinId = i; } } vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId]; diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index b75ca0b7a..a66623441 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -2191,7 +2191,6 @@ bool StdMeshers_Quadrangle_2D::ComputeReduced (SMESH_Mesh & aMesh, int nb1 = nb; int nr1 = nr; int nt1 = nt; - int nl1 = nl; if (nr == nl) { if (nb < nt) { @@ -2200,7 +2199,6 @@ bool StdMeshers_Quadrangle_2D::ComputeReduced (SMESH_Mesh & aMesh, } } else if (nb == nt) { - nl1 = nb; // and == nt nr1 = nb; // and == nt if (nl < nr) { nt1 = nl; @@ -2216,7 +2214,7 @@ bool StdMeshers_Quadrangle_2D::ComputeReduced (SMESH_Mesh & aMesh, } // number of rows and columns - int nrows = nr1 - 1; // and also == nl1 - 1 + int nrows = nr1 - 1; int ncol_top = nt1 - 1; int ncol_bot = nb1 - 1; // maximum number of bottom elements for "tree" simple reduce 3->1 diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index 4872d5c9b..e9e4b113e 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -2093,13 +2093,22 @@ bool _ViscousBuilder::smoothAndCheck(_SolidData& data, distToIntersection = Precision::Infinite(); double dist; const SMDS_MeshElement* intFace = 0, *closestFace = 0; +#ifdef __myDEBUG + const SMDS_MeshElement* *closestFace = 0; int iLE = 0; +#endif for ( unsigned i = 0; i < data._edges.size(); ++i ) { if ( data._edges[i]->FindIntersection( *searcher, dist, data._epsilon, &intFace )) return false; if ( distToIntersection > dist ) - distToIntersection = dist, closestFace = intFace, iLE = i; + { + distToIntersection = dist; +#ifdef __myDEBUG + iLE = i; + closestFace = intFace; +#endif + } } #ifdef __myDEBUG if ( closestFace ) @@ -3811,7 +3820,7 @@ bool _ViscousBuilder::addBoundaryElements() // Find out orientation and type of face to create - bool reverse = false, tria = false, isOnFace; + bool reverse = false, isOnFace; map< TGeomID, TopoDS_Shape >::iterator e2f = data._shrinkShape2Shape.find( getMeshDS()->ShapeToIndex( E )); @@ -3834,8 +3843,6 @@ bool _ViscousBuilder::addBoundaryElements() !_ignoreShapeIds.count( e2f->first )) F = *pF; } - - tria = true; } // Find the sub-mesh to add new faces SMESHDS_SubMesh* sm = 0; diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx index 28e664096..86a9ed946 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx @@ -414,7 +414,7 @@ sizeHint() const { if( cachedSizeHint().isValid() ) return cachedSizeHint(); - + return QTableWidget::sizeHint(); // QSize sh = QTableWidget::sizeHint(); // if( sh.width() < 400 ) // sh.setWidth( 400 ); diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx index ed50c1944..8b3f1fd9e 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx @@ -299,10 +299,12 @@ QString StdMeshersGUI_NbSegmentsCreator::storeParams() const break; } if ( hasConv ) + { if ( data.myConv ) valStr += "; " + tr("SMESH_CUT_NEG_MODE"); else valStr += "; " + tr("SMESH_EXP_MODE"); + } return valStr; } diff --git a/src/Tools/MeshCut/MeshCut_DC.cxx b/src/Tools/MeshCut/MeshCut_DC.cxx index 7702a19f8..6d11be79e 100644 --- a/src/Tools/MeshCut/MeshCut_DC.cxx +++ b/src/Tools/MeshCut/MeshCut_DC.cxx @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) int V[6]; int S[4]; // Signature du T4 courant - int NG[4]; // Num. globaux des sommets + //int NG[4]; // Num. globaux des sommets // Acquisition maillage initial //cout << chrono() << " - Acquisition du maillage initial" << endl; @@ -264,7 +264,7 @@ int main(int argc, char *argv[]) for (int is = 0; is < 4; is++) { int ng = *(MAILLAGE1->CNX[TETRA4] + 4 * it4 + is); - NG[is] = ng; + //NG[is] = ng; S[is] = *(POSN + ng - 1); } -- 2.39.2