.. include:: ../substitutions

.. oe:namespace:: OEDepict

.. meta::
   :keywords: OEGetNearbyBond

.. _OEDepict_OEGetNearbyBond:


.. oe:function:: OEGetNearbyBond


   .. oe:language:: c++ java csharp

      .. oe:api::

         OENearestBond OEGetNearbyBond(const OE2DMolDisplay& disp,
                                       const OE2DPoint& point,
                                       double radiusscale = 1.0)

   .. oe:language:: python

      .. oe:api:: python

         OEGetNearbyBond(disp: OE2DMolDisplay, p: OE2DPoint,
                         radiusscale: float = 1.0) -> OENearestBond

   Returns an :ref:`OENearestAtom <OEDepict_OENearestAtom>` object that stores a pointer
   of the bond which is depicted nearest to a given 2D display coordinates.
   By default, only bonds that are no further than half bond away from the given
   point will be considered.

   *disp*
      The :ref:`OE2DMolDisplay <OEDepict_OE2DMolDisplay>` object of which bonds are being
      considered.
      Only bonds of which bond display is visible are examined
      (:oe:meth:`OEDepict::OEBondDisplayBase::IsVisible`)

   *point*
      Specifies the 2D display coordinates.

   *radiusscale*
       The multiplier that can be used to increase or to decrease the
       radius around the given point to be considered.
       This value has to be in a range of :math:`[0.25, 2.0]`.

   .. note::

      If there is no bond close to the given display coordinates,
      then the :oe:meth:`OEDepict::OENearestBond::IsValid` method returns
      `false`.

   .. seealso::

      * :ref:`OENearestBond <OEDepict_OENearestBond>` class
      * :oe:func:`OEDepict::OEGetNearestBond` function
      * :oe:func:`OEDepict::OEGetNearbyAtom` function
