X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSMESHUtils%2FSMESH_Delaunay.cxx;h=22b1659f44dd33d8db10e6d0c825e991bb83b739;hb=97b0a95536e8d44fecc9fda65393dfd325e450f7;hp=4771c6da890a3fd79abe7e32eb71e2b409b8cae3;hpb=70d591791d7dc1a78d662844a5c62943454aecf0;p=modules%2Fsmesh.git diff --git a/src/SMESHUtils/SMESH_Delaunay.cxx b/src/SMESHUtils/SMESH_Delaunay.cxx index 4771c6da8..22b1659f4 100644 --- a/src/SMESHUtils/SMESH_Delaunay.cxx +++ b/src/SMESHUtils/SMESH_Delaunay.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 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 @@ -225,11 +225,8 @@ const BRepMesh_Triangle* SMESH_Delaunay::FindTriangle( const gp_XY& gp_XY seg = uv - gc; tria->Edges( linkIDs, ori ); -#if OCC_VERSION_LARGE <= 0x07030000 - int triaID = _triaDS->IndexOf( *tria ); -#else - int triaID = tria - & ( _triaDS->GetElement( 0 )); -#endif + + const BRepMesh_Triangle* prevTria = tria; tria = 0; for ( int i = 0; i < 3; ++i ) @@ -252,7 +249,9 @@ const BRepMesh_Triangle* SMESH_Delaunay::FindTriangle( const gp_XY& double uSeg = ( uv1 - gc ) ^ lin / crossSegLin; if ( 0. <= uSeg && uSeg <= 1. ) { - tria = & _triaDS->GetElement( triIDs.Index( 1 + ( triIDs.Index(1) == triaID ))); + tria = & _triaDS->GetElement( triIDs.Index( 1 )); + if ( tria == prevTria ) + tria = & _triaDS->GetElement( triIDs.Index( 2 )); if ( tria->Movability() != BRepMesh_Deleted ) break; }