Salome HOME
Win32 compatibility
[modules/smesh.git] / src / SMESH / SMESH_Algo.cxx
index 732c3e64ae2a9a96bf00ddd29c7e37fdfe5d77cf..d764ffd4b05e453ca1c3bbb825afe826be370765 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -403,7 +403,8 @@ bool SMESH_Algo::GetNodeParamOnEdge(const SMESHDS_Mesh* theMesh,
 bool SMESH_Algo::GetSortedNodesOnEdge(const SMESHDS_Mesh*                   theMesh,
                                       const TopoDS_Edge&                    theEdge,
                                       const bool                            ignoreMediumNodes,
-                                      map< double, const SMDS_MeshNode* > & theNodes)
+                                      map< double, const SMDS_MeshNode* > & theNodes,
+                                      const SMDSAbs_ElementType             typeToCheck)
 {
   theNodes.clear();
 
@@ -423,11 +424,8 @@ bool SMESH_Algo::GetSortedNodesOnEdge(const SMESHDS_Mesh*                   theM
     while ( nIt->more() )
     {
       const SMDS_MeshNode* node = nIt->next();
-      if ( ignoreMediumNodes ) {
-        SMDS_ElemIteratorPtr elemIt = node->GetInverseElementIterator();
-        if ( elemIt->more() && elemIt->next()->IsMediumNode( node ))
-          continue;
-      }
+      if ( ignoreMediumNodes && SMESH_MesherHelper::IsMedium( node, typeToCheck ))
+        continue;
       const SMDS_PositionPtr& pos = node->GetPosition();
       if ( pos->GetTypeOfPosition() != SMDS_TOP_EDGE )
         return false;
@@ -522,9 +520,7 @@ GeomAbs_Shape SMESH_Algo::Continuity(TopoDS_Edge E1,
   Standard_Real tol = BRep_Tool::Tolerance( V );
   Standard_Real angTol = 2e-3;
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     return BRepLProp::Continuity(C1, C2, u1, u2, tol, angTol);
   }
   catch (Standard_Failure) {
@@ -570,7 +566,7 @@ bool SMESH_Algo::IsStraight( const TopoDS_Edge & E,
   if ( v1Len < std::numeric_limits< double >::min() )
     return false; // E seems closed
   const double tol = Min( 10 * curve.Tolerance(), v1Len * 1e-2 );
-  const int nbSamples = 7;
+  const double nbSamples = 7;
   for ( int i = 0; i < nbSamples; ++i )
   {
     const double  r = ( i + 1 ) / nbSamples;