.. oe:namespace:: OEDepict

.. meta::
   :keywords: OEHighlightByStick, HighlightByStick


.. _OEDepict_OEHighlightByStick:

.. oe:class:: OEHighlightByStick

   .. oe:api::

      class OEHighlightByStick : public OEHighlightBase

   The :ref:`OEHighlightByStick <OEDepict_OEHighlightByStick>` class allows the
   customization of the **stick** highlighting style that is
   associated with the :oe:const:`OEDepict::OEHighlightStyle::Stick`
   constant.
   See example in :ref:`Figure: Example of highlighting using the
   'stick' style<figure_OEHighlightStyle_Stick>`.

   .. _figure_OEHighlightStyle_Stick:

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

      **Example of highlighting using the 'stick' style**

   The :ref:`OEHighlightByStick <OEDepict_OEHighlightByStick>` class stores the following properties:

   .. list-table::
      :widths: 100 100 100 150
      :header-rows: 1

      * - Property
        - Get method
        - Set method
        - Corresponding namespace / class / type

      * - external highlight
        - :oe:meth:`GetAtomExternalHighlightRatio<OEDepict::OEHighlightByStick::GetAtomExternalHighlightRatio>`
        - :oe:meth:`SetAtomExternalHighlightRatio<OEDepict::OEHighlightByStick::SetAtomExternalHighlightRatio>`
        - floating point

      * - atom label
        - :oe:meth:`GetAtomLabelMonochrome<OEDepict::OEHighlightByStick::GetAtomLabelMonochrome>`
        - :oe:meth:`SetAtomLabelMonochrome<OEDepict::OEHighlightByStick::SetAtomLabelMonochrome>`
        - boolean

      * - color
        - :oe:meth:`GetColor<OEDepict::OEHighlightByStick::GetColor>`
        - :oe:meth:`SetColor<OEDepict::OEHighlightByStick::SetColor>`
        - :ref:`OEColor <OESystem_OEColor>`

      * - stick width scale
        - :oe:meth:`GetStickWidthScale<OEDepict::OEHighlightByStick::GetStickWidthScale>`
        - :oe:meth:`SetStickWidthScale<OEDepict::OEHighlightByStick::SetStickWidthScale>`
        - floating point number

   .. seealso::

      * :oe:func:`OEDepict::OEAddHighlighting` function
      * :oe:constns:`OEDepict::OEHighlightStyle` namespace
      * :ref:`OEHighlightByBallAndStick <OEDepict_OEHighlightByBallAndStick>` class
      * :ref:`OEHighlightByColor <OEDepict_OEHighlightByColor>` class
      * :ref:`OEHighlightByCogwheel <OEDepict_OEHighlightByCogwheel>` class
      * :ref:`OEHighlightByLasso <OEDepict_OEHighlightByLasso>` class
      * :ref:`chapter_highlighting` chapter


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

   .. oe:method:: Constructors

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

         .. oe:api::

            OEHighlightByStick(const OESystem::OEColor& color,
                               double stickWidthScale = 3.0,
                               bool monochrome = true,
                               double atomExternalHighlightRatio = 0.0)

      .. oe:language:: python

         .. oe:api:: python

            OEHighlightByStick(color: OEColor, stickWidthScale: float = 3.0,
                               monochrome: bool = True,
                               atomExternalHighlightRatio: float = 0.0) -> OEHighlightByStick

      Creates an :ref:`OEHighlightByStick <OEDepict_OEHighlightByStick>` object with the
      specified parameters.

      *color*
         The color used for highlighting.
         See also :oe:meth:`OEDepict::OEHighlightByStick::SetColor` method.

      *stickWidthScale*
         The multiplier that can be used to increase or decrease
         the stick width of the highlighted bond(s).
         See also :oe:meth:`OEDepict::OEHighlightByStick::SetStickWidthScale` method.

      *monochrome*
         Defines whether or not to change the color of the atom label
         of the highlighted atom(s).
         See also :oe:meth:`OEDepict::OEHighlightByStick::SetAtomLabelMonochrome` method.

      *atomExternalHighlightRatio*
         A ratio that can be used to extend atom highlights to bonds not being highlighted.
         See also :oe:meth:`OEDepict::OEHighlightByStick::SetAtomExternalHighlightRatio` method.


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

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

         .. oe:api::

            OEHighlightByStick(const OEHighlightByStick& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OEHighlightByStick(rhs: OEHighlightByStick) -> OEHighlightByStick

      Copy constructor.


   .. ################################################################
      # operator=
      ################################################################

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

      .. oe:api::

         OEHighlightByStick &operator=(const OEHighlightByStick &rhs)

      Assignment operator.


   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEHighlightBase* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEHighlightByStick

      Deep copy constructor that returns a copy of the object.
      The memory for the returned :ref:`OEHighlightByStick <OEDepict_OEHighlightByStick>`
      object is dynamically allocated and owned by the caller.


   .. oe:method:: GetAtomExternalHighlightRatio

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

         .. oe:api::

            double GetAtomExternalHighlightRatio() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomExternalHighlightRatio() -> float

      Returns the ratio of the external highlight of the atoms.

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByStick::SetAtomExternalHighlightRatio` method


   .. oe:method:: GetAtomLabelMonochrome

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

         .. oe:api::

            bool GetAtomLabelMonochrome() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomLabelMonochrome() -> bool

      Returns whether or not the color of the atom label of the highlighted
      atom(s) is changed.

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByStick::SetAtomLabelMonochrome` method


   .. oe:method:: GetColor

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

         .. oe:api::

            const OESystem::OEColor& GetColor() const

      .. oe:language:: python

         .. oe:api:: python

            GetColor() -> OEColor

      Returns the color of the highlighting.

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByStick::SetColor` method
         * :ref:`OEColor <OESystem_OEColor>` class


   .. oe:method:: GetStickWidthScale

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

         .. oe:api::

            double GetStickWidthScale() const

      .. oe:language:: python

         .. oe:api:: python

            GetStickWidthScale() -> float

      Returns the multiplier that can be used to increase or decrease
      the stick width of the highlighted bond(s).

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByStick::SetStickWidthScale` method


   .. oe:method:: SetAtomExternalHighlightRatio

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

         .. oe:api::

            void SetAtomExternalHighlightRatio(double ratio)

      .. oe:language:: python

         .. oe:api:: python

            SetAtomExternalHighlightRatio(ratio: float) -> None

      Sets the ratio of the external highlight of the atoms *i.e.*
      atom highlights are extended to bonds not being highlighted.

      *ratio*
         This value has to be in the range of ``[0.0, 0.5]``.

      Example (:ref:`Figure: Example of using the SetAtomExternalHighlightRatio method<figure_OEHighlightByStick_SetAtomExternalHighlightRatio>`)

      .. oe:source:: HighlightByStick.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETATOMEXTERNALHIGHLIGHTRATIO

      .. oe:source:: HighlightByStick.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETATOMEXTERNALHIGHLIGHTRATIO

      .. oe:source:: HighlightByStick.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETATOMEXTERNALHIGHLIGHTRATIO

      .. oe:source:: HighlightByStick.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETATOMEXTERNALHIGHLIGHTRATIO

      .. _figure_OEHighlightByStick_SetAtomExternalHighlightRatio:

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

         **Example of using the SetAtomExternalHighlightRatio method**

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

         **Example of scaling the 'Stick' style highlighting along with the molecule**

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByStick::GetColor` method


   .. oe:method:: SetAtomLabelMonochrome

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

         .. oe:api::

            void SetAtomLabelMonochrome(bool monochrome)

      .. oe:language:: python

         .. oe:api:: python

            SetAtomLabelMonochrome(monochrome: bool) -> None

      Sets whether or not to change the color of the atom label
      of the highlighted atom(s).

      Example (:ref:`Figure: Example of using the SetAtomLabelMonochrome method<figure_OEHighlightByStick_SetAtomLabelMonochrome>`)

      .. oe:source:: HighlightByStick.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETATOMLABELMONOCHROME

      .. oe:source:: HighlightByStick.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETATOMLABELMONOCHROME

      .. oe:source:: HighlightByStick.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETATOMLABELMONOCHROME

      .. oe:source:: HighlightByStick.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETATOMLABELMONOCHROME

      .. _figure_OEHighlightByStick_SetAtomLabelMonochrome:


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

         **Example of using the SetAtomLabelMonochrome method**

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByStick::GetAtomLabelMonochrome` method


   .. oe:method:: SetColor

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

         .. oe:api::

            void SetColor(const OESystem::OEColor& color)

      .. oe:language:: python

         .. oe:api:: python

            SetColor(color: OEColor) -> None

      Sets the color of the highlighting.

      Example (:ref:`Figure: Example of using the SetColor method<figure_OEHighlightByStick_SetColor>`)

      .. oe:source:: HighlightByStick.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETCOLOR

      .. oe:source:: HighlightByStick.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETCOLOR

      .. oe:source:: HighlightByStick.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETCOLOR

      .. oe:source:: HighlightByStick.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETCOLOR

      .. _figure_OEHighlightByStick_SetColor:

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

         **Example of using the SetColor method**

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByStick::GetColor` method
         * :ref:`OEColor <OESystem_OEColor>` class


   .. oe:method:: SetStickWidthScale

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

         .. oe:api::

            void SetStickWidthScale(double stickWidthScale)

      .. oe:language:: python

         .. oe:api:: python

            SetStickWidthScale(stickWidthScale: float) -> None

      Sets the multiplier that can be used to increase or decrease
      the stick width of the highlighted bond(s).

      Example (:ref:`Figure: Example of using the SetStickWidthScale method<figure_OEHighlightByStick_SetStickWidthScale>`)

      .. oe:source:: HighlightByStick.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETSTICKWIDTHSCALE

      .. oe:source:: HighlightByStick.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETSTICKWIDTHSCALE

      .. oe:source:: HighlightByStick.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETSTICKWIDTHSCALE

      .. oe:source:: HighlightByStick.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYSTICK-SETSTICKWIDTHSCALE

      .. _figure_OEHighlightByStick_SetStickWidthScale:

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

         **Example of using the SetStickWidthScale method**

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByStick::GetStickWidthScale` method
