X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_MeshAlgos.cxx;h=a5f7701c2d549e6fb251dcd3d01d099a40491c3f;hp=985e4a7ae8690b1726d59a710a50ceba2bae9401;hb=3ae5846f2427f15ff0472576c2af89d8978a14ca;hpb=4ed74ad3da0e1ddd1d6ac5891a8202e0831abcb5 diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index 985e4a7ae..a5f7701c2 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -60,7 +60,8 @@ struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher /*! * \brief Constructor */ - SMESH_NodeSearcherImpl( const SMDS_Mesh* theMesh ) + SMESH_NodeSearcherImpl( const SMDS_Mesh* theMesh = 0, + SMDS_ElemIteratorPtr theElemIt = SMDS_ElemIteratorPtr() ) { myMesh = ( SMDS_Mesh* ) theMesh; @@ -70,6 +71,14 @@ struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher while ( nIt->more() ) nodes.insert( nodes.end(), nIt->next() ); } + else if ( theElemIt ) + { + while ( theElemIt->more() ) + { + const SMDS_MeshElement* e = theElemIt->next(); + nodes.insert( e->begin_nodes(), e->end_nodes() ); + } + } myOctreeNode = new SMESH_OctreeNode(nodes) ; // get max size of a leaf box @@ -714,8 +723,12 @@ FindElementsByPoint(const gp_Pnt& point, if ( type == SMDSAbs_Node || type == SMDSAbs_0DElement || type == SMDSAbs_Ball) { if ( !_nodeSearcher ) - _nodeSearcher = new SMESH_NodeSearcherImpl( _mesh ); - + { + if ( _meshPartIt ) + _nodeSearcher = new SMESH_NodeSearcherImpl( 0, _meshPartIt ); + else + _nodeSearcher = new SMESH_NodeSearcherImpl( _mesh ); + } std::vector< const SMDS_MeshNode* > foundNodes; _nodeSearcher->FindNearPoint( point, tolerance, foundNodes ); @@ -1695,6 +1708,17 @@ SMESH_NodeSearcher* SMESH_MeshAlgos::GetNodeSearcher(SMDS_Mesh& mesh) return new SMESH_NodeSearcherImpl( &mesh ); } +//======================================================================= +/*! + * \brief Return SMESH_NodeSearcher + */ +//======================================================================= + +SMESH_NodeSearcher* SMESH_MeshAlgos::GetNodeSearcher(SMDS_ElemIteratorPtr elemIt) +{ + return new SMESH_NodeSearcherImpl( 0, elemIt ); +} + //======================================================================= /*! * \brief Return SMESH_ElementSearcher