Salome HOME
Fix compilation after changes in SMESH headers V8_1_0a1
authoreap <eap@opencascade.com>
Wed, 29 Jun 2016 13:10:15 +0000 (16:10 +0300)
committereap <eap@opencascade.com>
Wed, 29 Jun 2016 13:10:15 +0000 (16:10 +0300)
 + Eliminate warnings

src/NETGENPlugin/NETGENPlugin_Mesher.cxx
src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx
src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx
src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx
src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.cxx

index 0970b1e87bee1a89054d4acd446112e7558147f0..a1482021f7a694d1716688ea404d4603b890be16 100644 (file)
@@ -32,6 +32,7 @@
 #include "NETGENPlugin_SimpleHypothesis_3D.hxx"
 
 #include <SMDS_FaceOfNodes.hxx>
+#include <SMDS_LinearEdge.hxx>
 #include <SMDS_MeshElement.hxx>
 #include <SMDS_MeshNode.hxx>
 #include <SMESHDS_Mesh.hxx>
@@ -530,27 +531,27 @@ namespace
    */
   //================================================================================
 
-  void makeQuadratic( const TopTools_IndexedMapOfShape& shapes,
-                      SMESH_Mesh*                       mesh )
-  {
-    for ( int i = 1; i <= shapes.Extent(); ++i )
-    {
-      SMESHDS_SubMesh* smDS = mesh->GetMeshDS()->MeshElements( shapes(i) );
-      if ( !smDS ) continue;
-      SMDS_ElemIteratorPtr elemIt = smDS->GetElements();
-      if ( !elemIt->more() ) continue;
-      const SMDS_MeshElement* e = elemIt->next();
-      if ( !e || e->IsQuadratic() )
-        continue;
-
-      TIDSortedElemSet elems;
-      elems.insert( e );
-      while ( elemIt->more() )
-        elems.insert( elems.end(), elemIt->next() );
-
-      SMESH_MeshEditor( mesh ).ConvertToQuadratic( /*3d=*/false, elems, /*biQuad=*/false );
-    }
-  }
+  // void makeQuadratic( const TopTools_IndexedMapOfShape& shapes,
+  //                     SMESH_Mesh*                       mesh )
+  // {
+  //   for ( int i = 1; i <= shapes.Extent(); ++i )
+  //   {
+  //     SMESHDS_SubMesh* smDS = mesh->GetMeshDS()->MeshElements( shapes(i) );
+  //     if ( !smDS ) continue;
+  //     SMDS_ElemIteratorPtr elemIt = smDS->GetElements();
+  //     if ( !elemIt->more() ) continue;
+  //     const SMDS_MeshElement* e = elemIt->next();
+  //     if ( !e || e->IsQuadratic() )
+  //       continue;
+
+  //     TIDSortedElemSet elems;
+  //     elems.insert( e );
+  //     while ( elemIt->more() )
+  //       elems.insert( elems.end(), elemIt->next() );
+
+  //     SMESH_MeshEditor( mesh ).ConvertToQuadratic( /*3d=*/false, elems, /*biQuad=*/false );
+  //   }
+  // }
 
 }
 
@@ -2947,8 +2948,8 @@ bool NETGENPlugin_Mesher::Compute()
 
   _ticTime = 0.98 / _progressTic;
 
-  int nbNod = _ngMesh->GetNP();
-  int nbSeg = _ngMesh->GetNSeg();
+  //int nbNod = _ngMesh->GetNP();
+  //int nbSeg = _ngMesh->GetNSeg();
   int nbFac = _ngMesh->GetNSE();
   int nbVol = _ngMesh->GetNE();
   bool isOK = ( !err && (_isVolume ? (nbVol > 0) : (nbFac > 0)) );
@@ -3435,7 +3436,7 @@ NETGENPlugin_Mesher::ReadErrors(const vector<const SMDS_MeshNode* >& nodeVec)
 
 #ifdef _DEBUG_
   size_t nbBadElems = err->myBadElements.size();
-  nbBadElems = 0;
+  if ( nbBadElems ) nbBadElems++; // avoid warning: variable set but not used
 #endif
 
   return err;
index 48071c2c9bedcd824c7d5bf8f41be5af87f9d1c4..3a513a896a840a6b206d967d9fd3c0e04de238ec 100644 (file)
@@ -184,41 +184,41 @@ bool NETGENPlugin_NETGEN_2D_ONLY::CheckHypothesis (SMESH_Mesh&         aMesh,
   return ( aStatus == HYP_OK );
 }
 
-namespace
-{
-  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 ));
-
-    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 );
-        }
-      }
-    }
-  }
-}
+// namespace
+// {
+//   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 ));
+
+//     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 );
+//         }
+//       }
+//     }
+//   }
+// }
 
 //=============================================================================
 /*!
@@ -569,11 +569,10 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh&         aMesh,
         }
         if ( j > elem.GetNP() )
         {
-          SMDS_MeshFace* face = 0;
           if ( elem.GetType() == TRIG )
-            face = helper.AddFace(nodes[0],nodes[1],nodes[2]);
+            helper.AddFace(nodes[0],nodes[1],nodes[2]);
           else
-            face = helper.AddFace(nodes[0],nodes[1],nodes[2],nodes[3]);
+            helper.AddFace(nodes[0],nodes[1],nodes[2],nodes[3]);
         }
       }
 
index 0229eea903f7ec14ca499236684e46e10ad2727e..c9d53760fd44f88ac9907fa944aaf38b59ff497f 100644 (file)
@@ -336,77 +336,77 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh&         aMesh,
   return ( ngLib._isComputeOk = compute( aMesh, helper, nodeVec, Netgen_mesh));
 }
 
-namespace
-{
-  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;
-
-    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();
-
-    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 ));
-
-    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 );
-        }
-      }
-    }
-  }
-}
+// namespace
+// {
+//   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;
+
+//     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();
+
+//     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 ));
+
+//     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 );
+//         }
+//       }
+//     }
+//   }
+// }
 
 //================================================================================
 /*!
index 87ace4147fff5564554582ab76c94b4e2cf01bbd..b13aa799e16445c667c6044601112a546f72fbd0 100644 (file)
 #include "NETGENPlugin_SimpleHypothesis_2D.hxx"
 #include "NETGENPlugin_Hypothesis.hxx"
 
+#include <SMESHDS_SubMesh.hxx>
+#include <SMESH_ControlsDef.hxx>
 #include <SMESH_Mesh.hxx>
 #include <SMESH_subMesh.hxx>
-#include <SMESH_ControlsDef.hxx>
 
 #include <TopExp_Explorer.hxx>
 
index 5430140ffd482add33c55772171379b5d6d55cf2..376a5ad62abd698281380b4f3c8b29ef0fc8fe11 100644 (file)
@@ -26,6 +26,9 @@
 #include "NETGENPlugin_SimpleHypothesis_3D.hxx"
 #include "NETGENPlugin_Hypothesis.hxx"
 
+#include <SMDS_Mesh.hxx>
+#include <SMESHDS_Mesh.hxx>
+#include <SMESHDS_SubMesh.hxx>
 #include <SMESH_ControlsDef.hxx>
 #include <SMESH_Mesh.hxx>
 #include <SMESH_subMesh.hxx>