+//================================================================================
+/*!
+ * \brief Return a list of nodes close to a point
+ * \param [in] point - point
+ * \param [out] nodes - found nodes
+ * \param [in] precision - allowed distance from \a point
+ */
+//================================================================================
+
+void SMESH_OctreeNode::NodesAround(const gp_XYZ& point,
+ std::vector<const SMDS_MeshNode*>& nodes,
+ double precision)
+{
+ if ( isInside( point, precision ))
+ {
+ if ( isLeaf() && NbNodes() )
+ {
+ double minDist2 = precision * precision;
+ for ( size_t i = 0; i < myNodes.size(); ++i )
+ {
+ SMESH_NodeXYZ p2 = myNodes[ i ];
+ double dist2 = ( point - p2 ).SquareModulus();
+ if ( dist2 <= minDist2 )
+ nodes.push_back( myNodes[ i ] );
+ }
+ }
+ else if ( myChildren )
+ {
+ for (int i = 0; i < 8; i++)
+ {
+ SMESH_OctreeNode* myChild = static_cast<SMESH_OctreeNode*>( myChildren[ i ]);
+ myChild->NodesAround( point, nodes, precision );
+ }
+ }
+ }
+}
+