X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_Delaunay.cxx;h=bc5576797f0ba94bb15c793d9bc249a7c8fa88dc;hb=9dae8fcc9e18e4a50f7e2a0b7b1239ba77c807a4;hp=8b1f252d6ab05d011d9fa48c569d3e70f87d2d15;hpb=b718a7cc45afdc2f1e8d06862f1e043402d2ea19;p=modules%2Fsmesh.git diff --git a/src/SMESHUtils/SMESH_Delaunay.cxx b/src/SMESHUtils/SMESH_Delaunay.cxx index 8b1f252d6..bc5576797 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-2021 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; } @@ -276,12 +275,12 @@ const BRepMesh_Triangle* SMESH_Delaunay::GetTriangleNear( int iBndNode ) int nodeIDs[3]; int nbNbNodes = _bndNodes.size(); #if OCC_VERSION_LARGE <= 0x07030000 - const BRepMesh::ListOfInteger & linkIds = _triaDS->LinksConnectedTo( iBndNode + 1 ); - BRepMesh::ListOfInteger::const_iterator iLink = linkIds.cbegin(); + typedef BRepMesh::ListOfInteger TLinkList; #else - const IMeshData::ListOfInteger & linkIds = _triaDS->LinksConnectedTo( iBndNode + 1 ); - IMeshData::ListOfInteger::const_iterator iLink = linkIds.cbegin(); + typedef IMeshData::ListOfInteger TLinkList; #endif + const TLinkList & linkIds = _triaDS->LinksConnectedTo( iBndNode + 1 ); + TLinkList::const_iterator iLink = linkIds.cbegin(); for ( ; iLink != linkIds.cend(); ++iLink ) { const BRepMesh_PairOfIndex & triaIds = _triaDS->ElementsConnectedTo( *iLink ); @@ -363,7 +362,7 @@ void SMESH_Delaunay::ToPython() const text << "import salome, SMESH\n"; text << "salome.salome_init()\n"; text << "from salome.smesh import smeshBuilder\n"; - text << "smesh = smeshBuilder.New(salome.myStudy)\n"; + text << "smesh = smeshBuilder.New()\n"; text << "mesh=smesh.Mesh()\n"; const char* endl = "\n"; @@ -388,5 +387,5 @@ void SMESH_Delaunay::ToPython() const file.remove(); file.openForWriting(); file.write( text.c_str(), text.size() ); - cout << "execfile( '" << fileName << "')" << endl; + std::cout << "exec(open('" << fileName << "', 'rb').read())"; }