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

.. oe:namespace:: OEGrapheme

.. meta::
   :keywords: OE2DActiveSiteDisplayOptions, 2DActiveSiteDisplayOptions


.. _OEGrapheme_OE2DActiveSiteDisplayOptions:

.. oe:class:: OE2DActiveSiteDisplayOptions

   .. oe:api::

      class OE2DActiveSiteDisplayOptions: public OEDepict::OE2DMolDisplayOptions

   This class represents the :ref:`OE2DActiveSiteDisplayOptions <OEGrapheme_OE2DActiveSiteDisplayOptions>` class
   that encapsulates properties that determine how an active site is depicted.

   The following methods are publicly inherited from :ref:`OE2DMolDisplayOptions <OEDepict_OE2DMolDisplayOptions>`:

   ====================================================================================================== ===================================================================================================== ======================================================================================================
   :oe:meth:`operator=<OEDepict::OE2DMolDisplayOptions::operator=>`                                       :oe:meth:`GetDefaultBondPen<OEDepict::OE2DMolDisplayOptions::GetDefaultBondPen>`                      :oe:meth:`SetBondColorStyle<OEDepict::OE2DMolDisplayOptions::SetBondColorStyle>`
   :oe:meth:`GetAromaticStyle<OEDepict::OE2DMolDisplayOptions::GetAromaticStyle>`                         :oe:meth:`GetHeight<OEDepict::OE2DMolDisplayOptions::GetHeight>`                                      :oe:meth:`SetBondLineAtomLabelGapScale<OEDepict::OE2DMolDisplayOptions::SetBondLineAtomLabelGapScale>`
   :oe:meth:`GetAtomColor<OEDepict::OE2DMolDisplayOptions::GetAtomColor>`                                 :oe:meth:`GetHydrogenStyle<OEDepict::OE2DMolDisplayOptions::GetHydrogenStyle>`                        :oe:meth:`SetBondLineGapScale<OEDepict::OE2DMolDisplayOptions::SetBondLineGapScale>`
   :oe:meth:`GetAtomColorStyle<OEDepict::OE2DMolDisplayOptions::GetAtomColorStyle>`                       :oe:meth:`GetScale<OEDepict::OE2DMolDisplayOptions::GetScale>`                                        :oe:meth:`SetBondPropLabelFont<OEDepict::OE2DMolDisplayOptions::SetBondPropLabelFont>`
   :oe:meth:`GetAtomLabelFont<OEDepict::OE2DMolDisplayOptions::GetAtomLabelFont>`                         :oe:meth:`GetSuperAtomLabelFont<OEDepict::OE2DMolDisplayOptions::GetSuperAtomLabelFont>`              :oe:meth:`SetBondPropLabelFontScale<OEDepict::OE2DMolDisplayOptions::SetBondPropLabelFontScale>`
   :oe:meth:`GetAtomLabelFontScale<OEDepict::OE2DMolDisplayOptions::GetAtomLabelFontScale>`               :oe:meth:`GetSuperAtomStyle<OEDepict::OE2DMolDisplayOptions::GetSuperAtomStyle>`                      :oe:meth:`SetBondPropertyFunctor<OEDepict::OE2DMolDisplayOptions::SetBondPropertyFunctor>`
   :oe:meth:`GetAtomPropLabelFont<OEDepict::OE2DMolDisplayOptions::GetAtomPropLabelFont>`                 :oe:meth:`GetTitleFont<OEDepict::OE2DMolDisplayOptions::GetTitleFont>`                                :oe:meth:`SetBondStereoStyle<OEDepict::OE2DMolDisplayOptions::SetBondStereoStyle>`
   :oe:meth:`GetAtomPropLabelFontScale<OEDepict::OE2DMolDisplayOptions::GetAtomPropLabelFontScale>`       :oe:meth:`GetTitleLocation<OEDepict::OE2DMolDisplayOptions::GetTitleLocation>`                        :oe:meth:`SetBondWidthScaling<OEDepict::OE2DMolDisplayOptions::SetBondWidthScaling>`
   :oe:meth:`GetAtomPropertyFunctor<OEDepict::OE2DMolDisplayOptions::GetAtomPropertyFunctor>`             :oe:meth:`GetWidth<OEDepict::OE2DMolDisplayOptions::GetWidth>`                                        :oe:meth:`SetDefaultBondPen<OEDepict::OE2DMolDisplayOptions::SetDefaultBondPen>`
   :oe:meth:`GetAtomStereoStyle<OEDepict::OE2DMolDisplayOptions::GetAtomStereoStyle>`                     :oe:meth:`SetAromaticStyle<OEDepict::OE2DMolDisplayOptions::SetAromaticStyle>`                        :oe:meth:`SetDimensions<OEDepict::OE2DMolDisplayOptions::SetDimensions>`
   :oe:meth:`GetBackgroundColor<OEDepict::OE2DMolDisplayOptions::GetBackgroundColor>`                     :oe:meth:`SetAtomColor<OEDepict::OE2DMolDisplayOptions::SetAtomColor>`                                :oe:meth:`SetHeight<OEDepict::OE2DMolDisplayOptions::SetHeight>`
   :oe:meth:`GetBondColorStyle<OEDepict::OE2DMolDisplayOptions::GetBondColorStyle>`                       :oe:meth:`SetAtomColorStyle<OEDepict::OE2DMolDisplayOptions::SetAtomColorStyle>`                      :oe:meth:`SetHydrogenStyle<OEDepict::OE2DMolDisplayOptions::SetHydrogenStyle>`
   :oe:meth:`GetBondLineAtomLabelGapScale<OEDepict::OE2DMolDisplayOptions::GetBondLineAtomLabelGapScale>` :oe:meth:`SetAtomLabelFont<OEDepict::OE2DMolDisplayOptions::SetAtomLabelFont>`                        :oe:meth:`SetScale<OEDepict::OE2DMolDisplayOptions::SetScale>`
   :oe:meth:`GetBondLineGapScale<OEDepict::OE2DMolDisplayOptions::GetBondLineGapScale>`                   :oe:meth:`SetAtomLabelFontScale<OEDepict::OE2DMolDisplayOptions::SetAtomLabelFontScale>`              :oe:meth:`SetSuperAtomLabelFont<OEDepict::OE2DMolDisplayOptions::SetSuperAtomLabelFont>`
   :oe:meth:`GetBondPropLabelFont<OEDepict::OE2DMolDisplayOptions::GetBondPropLabelFont>`                 :oe:meth:`SetAtomPropLabelFont<OEDepict::OE2DMolDisplayOptions::SetAtomPropLabelFont>`                :oe:meth:`SetSuperAtomStyle<OEDepict::OE2DMolDisplayOptions::SetSuperAtomStyle>`
   :oe:meth:`GetBondPropLabelFontScale<OEDepict::OE2DMolDisplayOptions::GetBondPropLabelFontScale>`       :oe:meth:`SetAtomPropLabelFontScale<OEDepict::OE2DMolDisplayOptions::SetAtomPropLabelFontScale>`      :oe:meth:`SetTitleFont<OEDepict::OE2DMolDisplayOptions::SetTitleFont>`
   :oe:meth:`GetBondPropertyFunctor<OEDepict::OE2DMolDisplayOptions::GetBondPropertyFunctor>`             :oe:meth:`SetAtomPropertyFunctor<OEDepict::OE2DMolDisplayOptions::SetAtomPropertyFunctor>`            :oe:meth:`SetTitleLocation<OEDepict::OE2DMolDisplayOptions::SetTitleLocation>`
   :oe:meth:`GetBondStereoStyle<OEDepict::OE2DMolDisplayOptions::GetBondStereoStyle>`                     :oe:meth:`SetAtomStereoStyle<OEDepict::OE2DMolDisplayOptions::SetAtomStereoStyle>`                    :oe:meth:`SetWidth<OEDepict::OE2DMolDisplayOptions::SetWidth>`
   :oe:meth:`GetBondWidthScaling<OEDepict::OE2DMolDisplayOptions::GetBondWidthScaling>`                   :oe:meth:`SetBackgroundColor<OEDepict::OE2DMolDisplayOptions::SetBackgroundColor>`
   ====================================================================================================== ===================================================================================================== ======================================================================================================

   .. admonition:: Code Example

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


   .. oe:method:: Constructors

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

         .. oe:api::

            OE2DActiveSiteDisplayOptions(double width, double height)

      .. oe:language:: python

         .. oe:api:: python

            OE2DActiveSiteDisplayOptions(width: float, height: float) -> OE2DActiveSiteDisplayOptions

      Creates an :ref:`OE2DActiveSiteDisplayOptions <OEGrapheme_OE2DActiveSiteDisplayOptions>` object with the specified dimension.

      *width*, *height*
        The width and height of the active site display.
        Both numbers have to be at least 200.0.

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

         .. oe:api::

            OE2DActiveSiteDisplayOptions(const OE2DActiveSiteDisplayOptions& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OE2DActiveSiteDisplayOptions(rhs: OE2DActiveSiteDisplayOptions) -> OE2DActiveSiteDisplayOptions

      Copy constructor.


   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OE2DActiveSiteDisplayOptions &operator=(const OE2DActiveSiteDisplayOptions &rhs)

      Assignment operator.


   .. oe:method:: GetLigandAlignerFunctor

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

         .. oe:api::

            const OELigandAlignerBase& GetLigandAlignerFunctor() const

      .. oe:language:: python

         .. oe:api:: python

            GetLigandAlignerFunctor() -> OELigandAlignerBase

      Returns the functor that is used to align ligands in the active site display.
      By default, the functor is set to :oe:cls:`OEGrapheme::OENoOpLigandAligner`.

      .. seealso::

         * :oe:meth:`OEGrapheme::OE2DActiveSiteDisplayOptions::SetLigandAlignerFunctor` method

   .. oe:method:: GetOptimizeLigandOrientation

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

         .. oe:api::

            bool GetOptimizeLigandOrientation() const

      .. oe:language:: python

         .. oe:api:: python

            GetOptimizeLigandOrientation() -> bool

      Returns whether the ligand orientation is optimized after generated the 2D layout.
      The default value is `true`.

      .. seealso::

         * :oe:meth:`OEGrapheme::OE2DActiveSiteDisplayOptions::SetOptimizeLigandOrientation` method

   .. oe:method:: GetRenderInteractiveLegend

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

         .. oe:api::

            bool GetRenderInteractiveLegend() const

      .. oe:language:: python

         .. oe:api:: python

            GetRenderInteractiveLegend() -> bool

      Returns whether and interactive legend is rendered only when mouse is
      hovered  over the "Legend" button depicted on the right top corner
      on the active site depiction.

      .. seealso::

         * :oe:meth:`OEGrapheme::OE2DActiveSiteDisplayOptions::SetRenderInteractiveLegend` method


   .. oe:method:: GetResidueSVGMarkupFunctor

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

         .. oe:api::

            const OEResidueSVGMarkupBase& GetResidueSVGMarkupFunctor() const

      .. oe:language:: python

         .. oe:api:: python

            GetResidueSVGMarkupFunctor() -> OEResidueSVGMarkupBase

      Returns the functor that defines how the residues are marked in
      :file:`svg` image.
      By default, residues are not marked (:ref:`OEResidueSVGNoMarkup <OEGrapheme_OEResidueSVGNoMarkup>`).

      .. seealso::

         * :oe:meth:`OEGrapheme::OE2DActiveSiteDisplayOptions::SetResidueSVGMarkupFunctor` method


   .. oe:method:: GetSVGMagnifyResidueInHover

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

         .. oe:api::

            double GetSVGMagnifyResidueInHover() const

      .. oe:language:: python

         .. oe:api:: python

            GetSVGMagnifyResidueInHover() -> float

      Returns the scaling factor that is used to magnify residue glyphs
      when mouse is hover over them.

      .. seealso::

         * :oe:meth:`OEGrapheme::OE2DActiveSiteDisplayOptions::SetSVGMagnifyResidueInHover` method


   .. oe:method:: SetBackgroundColor

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

         .. oe:api::

            void SetBackgroundColor(const OESystem::OEColor &)

      .. oe:language:: python

         .. oe:api:: python

            SetBackgroundColor(arg2: OEColor) -> None

      This is a no-op method.
      The background of the active site display is always
      :oe:const:`OEWhite<OESystem::OESystem::OEWhite>`


   .. oe:method:: SetDimensions

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

         .. oe:api::

            void SetDimensions(double width, double height, double scale)

      .. oe:language:: python

         .. oe:api:: python

            SetDimensions(arg2: float, arg3: float, arg4: float) -> None

      This is a no-op method. The dimension of the active site display only be
      specified with the  :oe:cls:`OEGrapheme::OE2DActiveSiteDisplayOptions<OEGrapheme::OE2DActiveSiteDisplayOptions::Constructors>`
      constructor.


   .. oe:method:: SetHeight

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

         .. oe:api::

            void SetHeight(double)

      .. oe:language:: python

         .. oe:api:: python

            SetHeight(arg2: float) -> None

      This is a no-op method.
      The height of the active site display can only be specified with the
      :oe:cls:`OEGrapheme::OE2DActiveSiteDisplayOptions<OEGrapheme::OE2DActiveSiteDisplayOptions::Constructors>`
      constructor.

   .. oe:method:: SetLigandAlignerFunctor

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

         .. oe:api::

            void SetLigandAlignerFunctor(const OELigandAlignerBase& func)

      .. oe:language:: python

         .. oe:api:: python

            SetLigandAlignerFunctor(func: OELigandAlignerBase) -> None

      Sets the functor that can be used to custom align ligands in the active site display.

      .. hint::

         Turning off optimization of ligand orientation is also recommended for custom alignments with
         :oe:meth:`OEGrapheme::OE2DActiveSiteDisplayOptions::SetOptimizeLigandOrientation` method.

      .. seealso::

         * :oe:cls:`OEGrapheme::OELigandAlignerBase` abstract base class

   .. oe:method:: SetOptimizeLigandOrientation

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

         .. oe:api::

            void SetOptimizeLigandOrientation(bool optimize)

      .. oe:language:: python

         .. oe:api:: python

            SetOptimizeLigandOrientation(optimize: bool) -> None

      Sets whether the ligand orientation is optimized after generated the 2D layout to
      maximize scaling for the depiction.

      .. hint::

         Its is recommended to disable this feature when using custom ligand alignment.

   .. oe:method:: SetRenderInteractiveLegend

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

         .. oe:api::

            void SetRenderInteractiveLegend(bool render)

      .. oe:language:: python

         .. oe:api:: python

            SetRenderInteractiveLegend(render: bool) -> None

      Sets whether and interactive legend is rendered only when mouse is
      hovered  over the "Legend" button depicted on the right top corner
      on the active site depiction.

      .. note::

         This functionality is **only available** for :file:`.svg`
         image format. In other image formats it has no effect.


   .. oe:method:: SetResidueSVGMarkupFunctor

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

         .. oe:api::

            void SetResidueSVGMarkupFunctor(const OEResidueSVGMarkupBase& func)

      .. oe:language:: python

         .. oe:api:: python

            SetResidueSVGMarkupFunctor(func: OEResidueSVGMarkupBase) -> None

      Sets the functor that defines how the residues are marked in :file:`svg` image.
      Drawing elements representing residues in :file:`svg` image are grouped together
      in the following format in which the ``<group id>`` and ``<class name>``
      strings are defined by the given functor:

      ::

          <g id='<group id>' class='<class name>'>
          ..
          list of drawing elements
          ..
          </g>

      .. note::

         This setting has only effect when generating :file:`.svg`
         images.

      **Example:**

      .. oe:source:: SVGMarkResidues.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEACTIVESITEOPTIONS-RESIDUE-SVGMARKUP


      .. oe:source:: SVGMarkResidues.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEACTIVESITEOPTIONS-RESIDUE-SVGMARKUP

      .. oe:source:: SVGMarkResidues.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEACTIVESITEOPTIONS-RESIDUE-SVGMARKUP

      .. oe:source:: SVGMarkResidues.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEACTIVESITEOPTIONS-RESIDUE-SVGMARKUP


      .. seealso::

         * :ref:`OEResidueSVGMarkupBase <OEGrapheme_OEResidueSVGMarkupBase>` abstract base class
         * :ref:`OEResidueSVGNoMarkup <OEGrapheme_OEResidueSVGNoMarkup>` class
         * :ref:`OEResidueSVGStandardMarkup <OEGrapheme_OEResidueSVGStandardMarkup>` class
         * :oe:meth:`OEGrapheme::OE2DActiveSiteDisplayOptions::GetResidueSVGMarkupFunctor` method


   .. oe:method:: SetSVGMagnifyResidueInHover

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

         .. oe:api::

            void SetSVGMagnifyResidueInHover(double scale)

      .. oe:language:: python

         .. oe:api:: python

            SetSVGMagnifyResidueInHover(scale: float) -> None

      Sets the scaling factor that is used to magnify residue glyphs
      when mouse is hover over them.

      scale
         This value has to be in a range of ``[1.00, 3.00]``.
         The default value is 1.00 which has has no effect.

      .. hint::

         This is a very useful feature when generating an active site
         image with residue labels that are too small to read.

      .. note::

         This functionality is **only available** for :file:`.svg`
         image format. In other image formats it has no effect.


   .. oe:method:: SetScale

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

         .. oe:api::

            void SetScale(double)

      .. oe:language:: python

         .. oe:api:: python

            SetScale(arg2: float) -> None

      This is a no-op method.
      The active site display can not be scaled.

   .. oe:method:: SetSuperAtomStyle

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

         .. oe:api::

            void SetSuperAtomStyle(unsigned int)

      .. oe:language:: python

         .. oe:api:: python

            SetSuperAtomStyle(arg2: int) -> None

      This is a no-op method.
      The super atom style can not be used when depicting an active site.

   .. oe:method:: SetWidth

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

         .. oe:api::

            void SetWidth(double)

      .. oe:language:: python

         .. oe:api:: python

            SetWidth(arg2: float) -> None

      This is a no-op method.
      The width of the active site display can only be specified with the
      :oe:cls:`OEGrapheme::OE2DActiveSiteDisplayOptions<OEGrapheme::OE2DActiveSiteDisplayOptions::Constructors>`
      constructor.
