.. oe:namespace:: OEGrapheme

.. meta::
   :keywords: OENearestResidue, NearestResidue


.. _OEGrapheme_OENearestResidue:

.. oe:class:: OENearestResidue

   .. oe:api::

      class OENearestResidue

   The :ref:`OENearestResidue <OEGrapheme_OENearestResidue>` class that is used by
   :oe:func:`OEGrapheme::OEGetNearestResidue` and
   :oe:func:`OEGrapheme::OEGetNearbyResidue` functions.
   It stores an atom pointer, an associated distance and the
   display position of the atom.


   .. ################################################################
      # Constructors
      ################################################################

   .. oe:method:: Constructors

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

         .. oe:api::

            OENearestResidue(const OEChem::OEResidue& residue, double dist,
                             const OEDepict::OE2DPoint& pos)

      .. oe:language:: python

         .. oe:api:: python

            OENearestResidue(residue: OEResidue, dist: float, pos: OE2DPoint) -> OENearestResidue

      Constructor.


   .. ################################################################
      # GetDisplayPosition
      ################################################################

   .. oe:method:: GetDisplayPosition

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

         .. oe:api::

            const OEDepict::OE2DPoint& GetDisplayPosition() const

      .. oe:language:: python

         .. oe:api:: python

            GetDisplayPosition() -> OE2DPoint

      Returns the display position of the nearest residue.


   .. ################################################################
      # GetDisplayPosition
      ################################################################

   .. oe:method:: GetDist

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

         .. oe:api::

            double GetDist() const

      .. oe:language:: python

         .. oe:api:: python

            GetDist() -> float

      Returns the distance associated with the residue.


   .. ################################################################
      # GetResidue
      ################################################################

   .. oe:method:: GetResidue

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

         .. oe:api::

            const OEChem::OEResidue& GetResidue() const

      .. oe:language:: python

         .. oe:api:: python

            GetResidue() -> OEResidue

      Returns the residue stored in the
      :ref:`OENearestResidue <OEGrapheme_OENearestResidue>` object.


   .. ################################################################
      # IsValid
      ################################################################

   .. oe:method:: IsValid

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

         .. oe:api::

            bool IsValid() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      Returns whether the :ref:`OENearestResidue <OEGrapheme_OENearestResidue>` object is
      initialized correctly.
