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

.. oe:namespace:: OEGrapheme

.. meta::
   :keywords: OE2DActiveSiteDisplay, 2DActiveSiteDisplay


.. _OEGrapheme_OE2DActiveSiteDisplay:

.. oe:class:: OE2DActiveSiteDisplay

   .. oe:api::

      class OE2DActiveSiteDisplay

   This class represents :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` that stores
   the depiction information (such as 2D coordinates, representation styles etc.)
   of an active site.

   An active site display can be rendered into an image using the
   :oe:func:`OEGrapheme::OEPrepareActiveSiteDepiction` and 
   :oe:func:`OEGrapheme::OERenderActiveSite` functions.

   .. admonition:: Code Example

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

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

   .. oe:method:: Constructors

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

         .. oe:api::

            OE2DActiveSiteDisplay(const OEBio::OEInteractionHintContainer& asite,
                                  const OE2DActiveSiteDisplayOptions& opts)

      .. oe:language:: python

         .. oe:api:: python

            OE2DActiveSiteDisplay(asite: OEInteractionHintContainer,
                                  opts: OE2DActiveSiteDisplayOptions) -> OE2DActiveSiteDisplay

      Initializes an :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` object using
      the given display options.

      *asite*
         The active site for which display information is stored in the
         :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` object.

      *opts*
         The :ref:`OE2DActiveSiteDisplayOptions <OEGrapheme_OE2DActiveSiteDisplayOptions>` object that stores
         properties that determine the styles of the active site depiction.

      .. warning::

         * An :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` object does not make a copy of the
           :ref:`OEInteractionHintContainer <OEBio_OEInteractionHintContainer>` object from which it is
           initialized but only stores its pointer.
           Therefore, the user responsibility is to not let the interaction container object
           go out of scope, before the corresponding :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>`
           object.

      .. seealso::

         * :oe:func:`OEBio::OEIsValidActiveSite` function
         * :oe:meth:`OEGrapheme::OE2DActiveSiteDisplay::IsValid` method


   .. ################################################################
      # GetActiveSite -> DEPRECATED
      ################################################################

   .. oe:method: GetActiveSite

      .. oe:api: DEPRECATED

         const OEBio::OEFragmentNetwork *GetActiveSite() const

         Returns the const pointer of the `OEBio::OEFragmentNetwork`  object for which the
         display properties are stored in :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` object.


   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetDisplayedLigand

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

         .. oe:api::

            const OEChem::OEMolBase* GetDisplayedLigand() const

      .. oe:language:: python

         .. oe:api:: python

            GetDisplayedLigand() -> OEGraphMol

      Returns a pointer to the display ligand of the active site.


   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetDisplayedResidues

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

         .. oe:api::

            OESystem::OEIterBase<OEChem::OEResidue>* GetDisplayedResidues(unsigned int renderstyle = OEActiveSiteRenderStyle::Default) const

      .. oe:language:: python

         .. oe:api:: python

            GetDisplayedResidues(renderstyle: int = Default) -> OEResidueIter

      Returns an iterator over the displayed residues of the given style.

      *renderstyle*
         This value has to be from the :oe:constns:`OEGrapheme::OEActiveSiteRenderStyle`
         namespace.

   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetHeight

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

         .. oe:api::

            double GetHeight() const

      .. oe:language:: python

         .. oe:api:: python

            GetHeight() -> float

      Returns the height of the displayed active site.


   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetOptions

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

         .. oe:api::

            const OE2DActiveSiteDisplayOptions& GetOptions() const

      .. oe:language:: python

         .. oe:api:: python

            GetOptions() -> OE2DActiveSiteDisplayOptions

      Returns the options used to initialized the :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>`
      object.

   .. ################################################################
      #
      ################################################################

   .. oe:method:: GetWidth

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

         .. oe:api::

            double GetWidth() const

      .. oe:language:: python

         .. oe:api:: python

            GetWidth() -> float

   .. ################################################################
      # 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:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>`
      object was initialized successfully.

      .. hint::

         It is highly recommend to check whether an active site display
         is valid after initialization.
