From 2343a5b38559522340a889eabd49a3af6c6a75db Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 21 Jun 2010 07:29:04 +0000 Subject: [PATCH] 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. --- src/SMESH/SMESH_MeshEditor.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() ); -- 2.39.2