.. include:: ../../toolkit-substitutions
.. include:: ../substitutions

.. oe:namespace:: OEDepict

.. meta::
   :keywords: OEGetLabelPosition

.. _OEDepict_OEGetLabelPosition:


.. oe:function:: OEGetLabelPosition


   Returns the position used to add a label to an image or molecule display.

   .. list-table:: **The overloaded versions of the OEGetLabelPosition function**
      :widths: 100 200
      :header-rows: 1

      * - Link
        - Description

      * - :ref:`OEGetLabelPosition(disp, label, match)<api_OEGetLabelPosition_OE2DMolDisplay_OEHighlightLabel_OEMatchBase>`
        - getting label position related to atoms of a match

      * - :ref:`OEGetLabelPosition(disp, label, abset)<api_OEGetLabelPosition_OE2DMolDisplay_OEHighlightLabel_OEAtomBondSet>`
        - getting label position related to set of atoms

      * - :ref:`OEGetLabelPosition(disp, label, atompred)<api_OEGetLabelPosition_OE2DMolDisplay_OEHighlightLabel_AtomPredicate>`
        - getting label position related to atoms specified by a predicate

   .. note::

      When adding label associated with atoms it is recommended to use the
      :oe:func:`OEDepict::OEAddLabel` along with the :oe:func:`OEDepict::OEAddHighlighting`
      function for visual clarity.

   .. _api_OEGetLabelPosition_OE2DMolDisplay_OEHighlightLabel_OEAtomBondSet:

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

      .. oe:api::

         OE2DPoint OEGetLabelPosition(const OE2DMolDisplay& disp,
                                      const OEHighlightLabel& label,
                                      const OEChem::OEAtomBondSet& abset)

   .. oe:language:: python

      .. oe:api:: python

         OEGetLabelPosition(disp: OE2DMolDisplay, label: OEHighlightLabel,
                            abset: OEAtomBondSet) -> OE2DPoint

   *disp*
      The :ref:`OE2DMolDisplay <OEDepict_OE2DMolDisplay>` object on which the label is going to
      be positioned.

   *label*
      The :ref:`OEHighlightLabel <OEDepict_OEHighlightLabel>` object that stores properties that
      determine the styles of the label along with the text of the label itself.

   *abset*
      The label is positioned based on the atoms stored in the
      :ref:`OEAtomBondSet <OEChem_OEAtomBondSet>` object.

   .. _api_OEGetLabelPosition_OE2DMolDisplay_OEHighlightLabel_OEMatchBase:

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

      .. oe:api::

         OE2DPoint OEGetLabelPosition(const OE2DMolDisplay& disp,
                                      const OEHighlightLabel& label,
                                      const OEChem::OEMatchBase& match)

   .. oe:language:: python

      .. oe:api:: python

         OEGetLabelPosition(disp: OE2DMolDisplay, label: OEHighlightLabel,
                            match: OEMatchBase) -> OE2DPoint

   Adds label to atoms of an :ref:`OEMatchBase <OEChem_OEMatchBase>` object that can be
   initialized by substructure search or maximum common substructure search.

      *disp*
      The :ref:`OE2DMolDisplay <OEDepict_OE2DMolDisplay>` object on which the label is going to
      be positioned.

   *label*
      The :ref:`OEHighlightLabel <OEDepict_OEHighlightLabel>` object that stores properties that
      determine the styles of the label along with the text of the label itself.

   *match*
      The label is positioned  based on the target atoms of the
      :ref:`OEMatchBase <OEChem_OEMatchBase>` object.

   .. _api_OEGetLabelPosition_OE2DMolDisplay_OEHighlightLabel_AtomPredicate:

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

      .. oe:api::

         OE2DPoint OEGetLabelPosition(const OE2DMolDisplay& disp,
                                      const OEHighlightLabel& label,
                                      const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& atompred)

   .. oe:language:: python

      .. oe:api:: python

         OEGetLabelPosition(disp: OE2DMolDisplay, label: OEHighlightLabel,
                            atompred: OEUnaryAtomPred) -> OE2DPoint

   *disp*
      The :ref:`OE2DMolDisplay <OEDepict_OE2DMolDisplay>` object on which the label is going to
      be positioned.

   *label*
      The :ref:`OEHighlightLabel <OEDepict_OEHighlightLabel>` object that stores properties that
      determine the styles of the label along with the text of the label itself.

   *atompred*
      The label is positioned based on the atoms for which the given
      atom predicate returns `true`.
