From: vsr Date: Mon, 21 Jun 2010 07:29:04 +0000 (+0000) Subject: Fix bug of NodeSearcher: search fails if point is outside the mesh on the distance... X-Git-Tag: translate_resources_09Jul10~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2343a5b38559522340a889eabd49a3af6c6a75db;p=modules%2Fsmesh.git Fix bug of NodeSearcher: search fails if point is outside the mesh on the distance more than octree node precision value. Version 2 with improved performance. --- diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 44ec9e408..62d1da1f3 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -5972,12 +5972,13 @@ struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher treeList.push_back( myOctreeNode ); SMDS_MeshNode pointNode( thePnt.X(), thePnt.Y(), thePnt.Z() ); + bool pointInside = myOctreeNode->isInside( &pointNode, myHalfLeafSize ); for ( trIt = treeList.begin(); trIt != treeList.end(); ++trIt) { SMESH_OctreeNode* tree = *trIt; if ( !tree->isLeaf() ) // put children to the queue { - //if ( !tree->isInside( &pointNode, myHalfLeafSize )) continue; + if ( pointInside && !tree->isInside( &pointNode, myHalfLeafSize )) continue; SMESH_OctreeNodeIteratorPtr cIt = tree->GetChildrenIterator(); while ( cIt->more() ) treeList.push_back( cIt->next() );