Salome HOME
[PY3] Fix some MRO issues
[modules/smesh.git] / src / SMESH / SMESH_Algo.cxx
index a6806c3d8eb5ca5e05ee643099be7c6ab182d7c5..035c23c5919ccc309f758165820aa958c4cdbd78 100644 (file)
@@ -231,7 +231,7 @@ SMESH_3D_Algo::SMESH_3D_Algo(int hypId, int studyId, SMESH_Gen* gen)
 
 //=============================================================================
 /*!
- * Usually an algoritm has nothing to save
+ * Usually an algorithm has nothing to save
  */
 //=============================================================================
 
@@ -440,13 +440,15 @@ bool SMESH_Algo::GetSortedNodesOnEdge(const SMESHDS_Mesh*                   theM
   TopExp::Vertices(theEdge, v1, v2);
   const SMDS_MeshNode* n1 = VertexNode( v1, eSubMesh, 0 );
   const SMDS_MeshNode* n2 = VertexNode( v2, eSubMesh, 0 );
+  const SMDS_MeshNode* nEnd[2] = { nbNodes ? theNodes.begin()->second  : 0,
+                                   nbNodes ? theNodes.rbegin()->second : 0 };
   Standard_Real f, l;
   BRep_Tool::Range(theEdge, f, l);
   if ( v1.Orientation() != TopAbs_FORWARD )
     std::swap( f, l );
-  if ( n1 && ++nbNodes )
+  if ( n1 && n1 != nEnd[0] && n1 != nEnd[1] && ++nbNodes )
     theNodes.insert( make_pair( f, n1 ));
-  if ( n2 && ++nbNodes )
+  if ( n2 && n2 != nEnd[0] && n2 != nEnd[1] && ++nbNodes )
     theNodes.insert( make_pair( l, n2 ));
 
   return (int)theNodes.size() == nbNodes;
@@ -749,7 +751,7 @@ SMESH_Algo::EMeshError SMESH_Algo::GetMeshError(SMESH_subMesh* subMesh)
     if ( !fIt->more() )
       return MEr_EMPTY;
 
-    // We check that olny links on EDGEs encouter once, the rest links, twice
+    // We check that only links on EDGEs encouter once, the rest links, twice
     set< SMESH_TLink > links;
     while ( fIt->more() )
     {