From 6bf33753d62a10b28b75da170124d4059931c1be Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 30 Dec 2016 14:38:49 +0100 Subject: [PATCH] comment out unused global functions, fix -Wconstant-logical-operand --- .../src/NETGENPlugin/NETGENPlugin_Mesher.cpp | 4 +- .../NETGENPlugin_NETGEN_2D_ONLY.cpp | 64 ++++----- .../NETGENPlugin/NETGENPlugin_NETGEN_3D.cpp | 130 +++++++++--------- src/Gui/WidgetFactory.cpp | 1 + 4 files changed, 100 insertions(+), 99 deletions(-) diff --git a/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp b/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp index 7d0cf8e40b..19dd0c4186 100644 --- a/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp +++ b/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp @@ -890,7 +890,7 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom, #endif if ( isSeam ) { - if ( helper.GetPeriodicIndex() && 1 ) { + if ( helper.GetPeriodicIndex() & 1 ) { seg.epgeominfo[ 0 ].u = otherSeamParam; seg.epgeominfo[ 1 ].u = otherSeamParam; swap (seg.epgeominfo[0].v, seg.epgeominfo[1].v); @@ -906,7 +906,7 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom, #ifdef DUMP_SEGMENTS cout << "Segment: " << seg.edgenr << endl << "\t is SEAM (reverse) of the previous. " - << " Other " << (helper.GetPeriodicIndex() && 1 ? "U" : "V") + << " Other " << (helper.GetPeriodicIndex() & 1 ? "U" : "V") << " = " << otherSeamParam << endl; #endif } diff --git a/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cpp b/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cpp index d9d312ef0e..ae2b9377e9 100644 --- a/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cpp +++ b/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cpp @@ -191,41 +191,41 @@ bool NETGENPlugin_NETGEN_2D_ONLY::CheckHypothesis (SMESH_Mesh& aMesh, return ( aStatus == HYP_OK ); } -namespace -{ - inline void limitSize( netgen::Mesh* ngMesh, - const double maxh ) - { - // get bnd box - netgen::Point3d pmin, pmax; - ngMesh->GetBox( pmin, pmax, 0 ); - const double dx = pmax.X() - pmin.X(); - const double dy = pmax.Y() - pmin.Y(); - const double dz = pmax.Z() - pmin.Z(); +//namespace +//{ +// inline void limitSize( netgen::Mesh* ngMesh, +// const double maxh ) +// { +// // get bnd box +// netgen::Point3d pmin, pmax; +// ngMesh->GetBox( pmin, pmax, 0 ); +// const double dx = pmax.X() - pmin.X(); +// const double dy = pmax.Y() - pmin.Y(); +// const double dz = pmax.Z() - pmin.Z(); - const int nbX = Max( 2, int( dx / maxh * 3 )); - const int nbY = Max( 2, int( dy / maxh * 3 )); - const int nbZ = Max( 2, int( dz / maxh * 3 )); +// const int nbX = Max( 2, int( dx / maxh * 3 )); +// const int nbY = Max( 2, int( dy / maxh * 3 )); +// const int nbZ = Max( 2, int( dz / maxh * 3 )); - if ( ! & ngMesh->LocalHFunction() ) - ngMesh->SetLocalH( pmin, pmax, 0.1 ); +// if ( ! & ngMesh->LocalHFunction() ) +// ngMesh->SetLocalH( pmin, pmax, 0.1 ); - netgen::Point3d p; - for ( int i = 0; i <= nbX; ++i ) - { - p.X() = pmin.X() + i * dx / nbX; - for ( int j = 0; j <= nbY; ++j ) - { - p.Y() = pmin.Y() + j * dy / nbY; - for ( int k = 0; k <= nbZ; ++k ) - { - p.Z() = pmin.Z() + k * dz / nbZ; - ngMesh->RestrictLocalH( p, maxh ); - } - } - } - } -} +// netgen::Point3d p; +// for ( int i = 0; i <= nbX; ++i ) +// { +// p.X() = pmin.X() + i * dx / nbX; +// for ( int j = 0; j <= nbY; ++j ) +// { +// p.Y() = pmin.Y() + j * dy / nbY; +// for ( int k = 0; k <= nbZ; ++k ) +// { +// p.Z() = pmin.Z() + k * dz / nbZ; +// ngMesh->RestrictLocalH( p, maxh ); +// } +// } +// } +// } +//} //============================================================================= /*! diff --git a/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cpp b/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cpp index 8da4019679..6e21884d59 100644 --- a/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cpp +++ b/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cpp @@ -348,77 +348,77 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, return ( ngLib._isComputeOk = compute( aMesh, helper, nodeVec, Netgen_mesh)); } -namespace -{ - inline void limitVolumeSize( netgen::Mesh* ngMesh, - double maxh ) - { - // get average h of faces - double faceh = 0; - int nbh = 0; - for (int i = 1; i <= ngMesh->GetNSE(); i++) - { - const netgen::Element2d& face = ngMesh->SurfaceElement(i); - for (int j=1; j <= face.GetNP(); ++j) - { - const netgen::PointIndex & i1 = face.PNumMod(j); - const netgen::PointIndex & i2 = face.PNumMod(j+1); - if ( i1 < i2 ) - { - const netgen::Point3d & p1 = ngMesh->Point( i1 ); - const netgen::Point3d & p2 = ngMesh->Point( i2 ); - faceh += netgen::Dist2( p1, p2 ); - nbh++; - } - } - } - faceh = Sqrt( faceh / nbh ); +//namespace +//{ +// inline void limitVolumeSize( netgen::Mesh* ngMesh, +// double maxh ) +// { +// // get average h of faces +// double faceh = 0; +// int nbh = 0; +// for (int i = 1; i <= ngMesh->GetNSE(); i++) +// { +// const netgen::Element2d& face = ngMesh->SurfaceElement(i); +// for (int j=1; j <= face.GetNP(); ++j) +// { +// const netgen::PointIndex & i1 = face.PNumMod(j); +// const netgen::PointIndex & i2 = face.PNumMod(j+1); +// if ( i1 < i2 ) +// { +// const netgen::Point3d & p1 = ngMesh->Point( i1 ); +// const netgen::Point3d & p2 = ngMesh->Point( i2 ); +// faceh += netgen::Dist2( p1, p2 ); +// nbh++; +// } +// } +// } +// faceh = Sqrt( faceh / nbh ); - double compareh; - if ( faceh < 0.5 * maxh ) compareh = -1; - else if ( faceh > 1.5 * maxh ) compareh = 1; - else compareh = 0; - // cerr << "faceh " << faceh << endl; - // cerr << "init maxh " << maxh << endl; - // cerr << "compareh " << compareh << endl; +// double compareh; +// if ( faceh < 0.5 * maxh ) compareh = -1; +// else if ( faceh > 1.5 * maxh ) compareh = 1; +// else compareh = 0; +// // cerr << "faceh " << faceh << endl; +// // cerr << "init maxh " << maxh << endl; +// // cerr << "compareh " << compareh << endl; - if ( compareh > 0 ) - maxh *= 1.2; - else - maxh *= 0.8; - // cerr << "maxh " << maxh << endl; +// if ( compareh > 0 ) +// maxh *= 1.2; +// else +// maxh *= 0.8; +// // cerr << "maxh " << maxh << endl; - // get bnd box - netgen::Point3d pmin, pmax; - ngMesh->GetBox( pmin, pmax, 0 ); - const double dx = pmax.X() - pmin.X(); - const double dy = pmax.Y() - pmin.Y(); - const double dz = pmax.Z() - pmin.Z(); +// // get bnd box +// netgen::Point3d pmin, pmax; +// ngMesh->GetBox( pmin, pmax, 0 ); +// const double dx = pmax.X() - pmin.X(); +// const double dy = pmax.Y() - pmin.Y(); +// const double dz = pmax.Z() - pmin.Z(); - if ( ! & ngMesh->LocalHFunction() ) - ngMesh->SetLocalH( pmin, pmax, compareh <= 0 ? 0.1 : 0.5 ); +// if ( ! & ngMesh->LocalHFunction() ) +// ngMesh->SetLocalH( pmin, pmax, compareh <= 0 ? 0.1 : 0.5 ); - // adjusted by SALOME_TESTS/Grids/smesh/bugs_08/I8 - const int nbX = Max( 2, int( dx / maxh * 2 )); - const int nbY = Max( 2, int( dy / maxh * 2 )); - const int nbZ = Max( 2, int( dz / maxh * 2 )); +// // adjusted by SALOME_TESTS/Grids/smesh/bugs_08/I8 +// const int nbX = Max( 2, int( dx / maxh * 2 )); +// const int nbY = Max( 2, int( dy / maxh * 2 )); +// const int nbZ = Max( 2, int( dz / maxh * 2 )); - netgen::Point3d p; - for ( int i = 0; i <= nbX; ++i ) - { - p.X() = pmin.X() + i * dx / nbX; - for ( int j = 0; j <= nbY; ++j ) - { - p.Y() = pmin.Y() + j * dy / nbY; - for ( int k = 0; k <= nbZ; ++k ) - { - p.Z() = pmin.Z() + k * dz / nbZ; - ngMesh->RestrictLocalH( p, maxh ); - } - } - } - } -} +// netgen::Point3d p; +// for ( int i = 0; i <= nbX; ++i ) +// { +// p.X() = pmin.X() + i * dx / nbX; +// for ( int j = 0; j <= nbY; ++j ) +// { +// p.Y() = pmin.Y() + j * dy / nbY; +// for ( int k = 0; k <= nbZ; ++k ) +// { +// p.Z() = pmin.Z() + k * dz / nbZ; +// ngMesh->RestrictLocalH( p, maxh ); +// } +// } +// } +// } +//} //================================================================================ /*! diff --git a/src/Gui/WidgetFactory.cpp b/src/Gui/WidgetFactory.cpp index c6cdeb0a06..b2656349f6 100644 --- a/src/Gui/WidgetFactory.cpp +++ b/src/Gui/WidgetFactory.cpp @@ -44,6 +44,7 @@ #if defined(__clang__) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wmismatched-tags" +# pragma clang diagnostic ignored "-Wunused-parameter" #elif defined (__GNUC__) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-parameter"