.. include:: ../../common/cookbook/cookbook-hyperlinks

.. include:: ../substitutions

.. oe:namespace:: OEGrapheme

.. meta::
   :keywords: OEDrawActiveSiteLegend


.. _OEGrapheme_OEDrawActiveSiteLegend:

.. oe:function:: OEDrawActiveSiteLegend

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

      .. oe:api::

         void OEDrawActiveSiteLegend(OEDepict::OEImageBase& image,
                                     const OE2DActiveSiteDisplay& adisp,
                                     const OE2DActiveSiteLegendDisplayOptions& opts)

   .. oe:language:: python

      .. oe:api:: python

         OEDrawActiveSiteLegend(image: OEImageBase,
                                adisp: OE2DActiveSiteDisplay,
                                opts: OE2DActiveSiteLegendDisplayOptions) -> None

   Draws legend for active site interaction map.

   *image*
      The image on which the color force field legend is drawn.

   *adisp*
      The :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` object that holds the data
      necessary to depict the interactions of an active site.

   *opts*
      The :ref:`OE2DActiveSiteLegendDisplayOptions <OEGrapheme_OE2DActiveSiteLegendDisplayOptions>` object that
      determines how the legend is depicted.

   The following code snippet shows how to use the :oe:func:`OEGrapheme::OEDrawActiveSiteLegend`
   function. The image created is shown in
   :ref:`Figure: Example of using the OEDrawActiveSiteLegend function<figure_draw_active_site_legend>`.

   .. oe:source:: DrawActiveSiteLegend.py
      :language: python
      :noindent:
      :frag:     SNIPPET-DRAW-ACTIVE-SITE-LEGEND

   ..    oe:language:: python

         :ref:`Full listing. <listing-DrawActiveSiteLegend.py>`


   .. oe:source:: DrawActiveSiteLegend.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-DRAW-ACTIVE-SITE-LEGEND

   .. oe:source:: DrawActiveSiteLegend.java
      :language: java
      :noindent:
      :frag:     SNIPPET-DRAW-ACTIVE-SITE-LEGEND

   .. oe:source:: DrawActiveSiteLegend.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-DRAW-ACTIVE-SITE-LEGEND

   .. _figure_draw_active_site_legend:

   .. figure:: ../images/DrawActiveSiteLegend.*
      :align:  center

      **Example of using the OEDrawActiveSiteLegend function**

   .. note::

      The :ref:`OEDrawActiveSiteLegend <OEGrapheme_OEDrawActiveSiteLegend>` function renders
      only those residue "glyphs" that are used to depict the interactions
      of the given active site when calling the :oe:func:`OEGrapheme::OERenderActiveSite`
      function.

   .. seealso::

      * :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` class
      * :ref:`OE2DActiveSiteLegendDisplayOptions <OEGrapheme_OE2DActiveSiteLegendDisplayOptions>` class

   .. admonition:: Code Example

      * `Visualizing Protein-Ligand Interactions`_ **OpenEye Python Cookbook** recipe
      * :ref:`section_examples_summary_complex2img` example

