.. oe:namespace:: OEDepict

.. meta::
   :keywords: OEHighlightByLasso, HighlightByLasso


.. _OEDepict_OEHighlightByLasso:

.. oe:class:: OEHighlightByLasso

   .. oe:api::

      class OEHighlightByLasso : public OEHighlightBase

   The :ref:`OEHighlightByLasso <OEDepict_OEHighlightByLasso>` class allows the
   customization of the **lasso** highlighting style that is
   associated with the :oe:const:`OEDepict::OEHighlightStyle::Lasso`
   constant.
   See example in :ref:`Figure: Example of highlighting using the
   'lasso' style<figure_OEHighlightStyle_Lasso>`.

   .. _figure_OEHighlightStyle_Lasso:

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

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

   The :ref:`OEHighlightByLasso <OEDepict_OEHighlightByLasso>` class stores the following properties:

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

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

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

      * - atom label box
        - :oe:meth:`GetConsiderAtomLabelBoundingBox<OEDepict::OEHighlightByLasso::GetConsiderAtomLabelBoundingBox>`
        - :oe:meth:`SetConsiderAtomLabelBoundingBox<OEDepict::OEHighlightByLasso::SetConsiderAtomLabelBoundingBox>`
        - boolean

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

      * - pen
        - :oe:meth:`GetPen<OEDepict::OEHighlightByLasso::GetPen>`
        - :oe:meth:`SetPen<OEDepict::OEHighlightByLasso::SetPen>`
        - :ref:`OEPen <OEDepict_OEPen>`

      * - position
        - :oe:meth:`GetPosition<OEDepict::OEHighlightByLasso::GetPosition>`
        - :oe:meth:`SetPosition<OEDepict::OEHighlightByLasso::SetPosition>`
        - :oe:constns:`OEDepict::OELayerPosition` namespace

      * - lasso scale
        - :oe:meth:`GetLassoScale<OEDepict::OEHighlightByLasso::GetLassoScale>`
        - :oe:meth:`SetLassoScale<OEDepict::OEHighlightByLasso::SetLassoScale>`
        - floating point number

      * - line width scale
        - :oe:meth:`GetLineWidthScale<OEDepict::OEHighlightByLasso::GetLineWidthScale>`
        - :oe:meth:`SetLineWidthScale<OEDepict::OEHighlightByLasso::SetLineWidthScale>`
        - floating point

   .. 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:`OEHighlightByStick <OEDepict_OEHighlightByStick>` class
      * :ref:`chapter_highlighting` chapter

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

   .. oe:method:: Constructors

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

         .. oe:api::

            OEHighlightByLasso(const OESystem::OEColor& color,
                               double lassoScale = 3.0, bool monochrome = true,
                               bool considerAtomLabelBox = false,
                               unsigned int position = OELayerPosition::Below,
                               double lineWidthScale = 1.0)

      .. oe:language:: python

         .. oe:api:: python

            OEHighlightByLasso(color: OEColor, lassoScale: float = 3.0,
                               monochrome: bool = True,
                               considerAtomLabelBox: bool = False,
                               position: int, lws: float = 1.0) -> OEHighlightByLasso

      Creates an :ref:`OEHighlightByLasso <OEDepict_OEHighlightByLasso>` object with the
      specified parameters.

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

      *lassoScale*
         The multiplier that can be used to increase or decrease
         the distance of the "lasso" from the highlighted atom(s) and bond(s).
         See also :oe:meth:`OEDepict::OEHighlightByLasso::SetLassoScale` method.

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

      *considerAtomLabelBox*
         Determines whether or not to consider the atom label bounding boxes when
         generating the 'lasso' highlights.
         See also :oe:meth:`OEDepict::OEHighlightByLasso::SetConsiderAtomLabelBoundingBox` method.

      *position*
         Defines whether the 'lasso' highlight is going to be rendered below
         or above the molecule.
         See also :oe:meth:`OEDepict::OEHighlightByLasso::SetPosition` method.

      *lineWidthScale*
         The multiplier that can be used to increase or decrease
         the line width of lasso.
         See also :oe:meth:`OEDepict::OEHighlightByLasso::SetLineWidthScale` method.

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

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

         .. oe:api::

            OEHighlightByLasso(const OEHighlightByLasso& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OEHighlightByLasso(rhs: OEHighlightByLasso) -> OEHighlightByLasso

      Copy constructor.


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

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

      .. oe:api::

         OEHighlightByLasso &operator=(const OEHighlightByLasso &rhs)

      Assignment operator.


   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEHighlightBase* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEHighlightByLasso

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


   .. 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::OEHighlightByLasso::SetAtomLabelMonochrome` method


   .. oe:method:: GetConsiderAtomLabelBoundingBox

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

         .. oe:api::

            bool GetConsiderAtomLabelBoundingBox() const

      .. oe:language:: python

         .. oe:api:: python

            GetConsiderAtomLabelBoundingBox() -> bool

      Returns whether or not to consider the atom label bounding boxes when
      generating the 'lasso' highlights.

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByLasso::SetConsiderAtomLabelBoundingBox` method


   .. oe:method:: GetLassoScale

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

         .. oe:api::

            double GetLassoScale() const

      .. oe:language:: python

         .. oe:api:: python

            GetLassoScale() -> float

      Returns the multiplier that can be used to increase or decrease
      the distance of the line of the 'lasso' from the highlighted atom(s) and bonds(s).

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByLasso::SetLassoScale` method

   .. oe:method:: GetLineWidthScale

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

         .. oe:api::

            double GetLineWidthScale() const

      .. oe:language:: python

         .. oe:api:: python

            GetLineWidthScale() -> float

      Returns the multiplier that can be used to increase or decrease
      the line width of the lasso.

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByLasso::SetLineWidthScale` 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 foreground color of the highlighting.

      .. seealso::

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


   .. oe:method:: GetPen

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

         .. oe:api::

            const OEPen& GetPen() const

      .. oe:language:: python

         .. oe:api:: python

            GetPen() -> OEPen

      Returns the pen of the highlighting.

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByLasso::SetPen` method
         * :ref:`OEPen <OEDepict_OEPen>` class

   .. oe:method:: GetPosition

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

         .. oe:api::

            unsigned int GetPosition() const

      .. oe:language:: python

         .. oe:api:: python

            GetPosition() -> int

      Returns whether the 'lasso' highlight is going to be render above or
      below the molecule.
      The return value is taken from the :oe:constns:`OEDepict::OELayerPosition`
      namespace.

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByLasso::SetPosition` method
         * :oe:constns:`OEDepict::OELayerPosition` namespace


   .. 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_OEHighlightByLasso_SetAtomLabelMonochrome>`)

      .. oe:source:: HighlightByLasso.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETATOMLABELMONOCHROME

      .. oe:source:: HighlightByLasso.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETATOMLABELMONOCHROME

      .. oe:source:: HighlightByLasso.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETATOMLABELMONOCHROME

      .. oe:source:: HighlightByLasso.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETATOMLABELMONOCHROME


      .. _figure_OEHighlightByLasso_SetAtomLabelMonochrome:

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

         **Example of using the SetAtomLabelMonochrome method**

      .. seealso::

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


   .. oe:method:: SetConsiderAtomLabelBoundingBox

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

         .. oe:api::

            void SetConsiderAtomLabelBoundingBox(bool consider)

      .. oe:language:: python

         .. oe:api:: python

            SetConsiderAtomLabelBoundingBox(consider: bool) -> None

      Sets whether or not to consider the atom label bounding boxes when
      generating the 'lasso' highlights.
      By considering the bounding boxes, the number cases when the
      lines of the highlight clash with the atom label can be reduced.

      Example (:ref:`Figure: Example of using the SetConsiderAtomLabelBoundingBox method<figure_OEHighlightByLasso_SetConsiderAtomLabelBoundingBox>`)

      .. oe:source:: HighlightByLasso.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETCONSIDERATOMLABELBOUNDINGBOX

      .. oe:source:: HighlightByLasso.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETCONSIDERATOMLABELBOUNDINGBOX

      .. oe:source:: HighlightByLasso.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETCONSIDERATOMLABELBOUNDINGBOX

      .. oe:source:: HighlightByLasso.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETCONSIDERATOMLABELBOUNDINGBOX


      .. _figure_OEHighlightByLasso_SetConsiderAtomLabelBoundingBox:

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

         **Example of using the SetConsiderAtomLabelBoundingBox method**

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByLasso::SetConsiderAtomLabelBoundingBox` method


   .. oe:method:: SetLassoScale

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

         .. oe:api::

            void SetLassoScale(double lassoScale)

      .. oe:language:: python

         .. oe:api:: python

            SetLassoScale(lassoScale: float) -> None

      Sets the multiplier that can be used to increase or decrease
      the distance of the line of the 'lasso' from the highlighted atom(s) and bond(s).

      Example (:ref:`Figure: Example of using the SetLassoScale method<figure_OEHighlightByLasso_SetLassoScale>`)

      .. oe:source:: HighlightByLasso.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETLASSOSCALE

      .. oe:source:: HighlightByLasso.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETLASSOSCALE

      .. oe:source:: HighlightByLasso.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETLASSOSCALE

      .. oe:source:: HighlightByLasso.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETLASSOSCALE


      .. _figure_OEHighlightByLasso_SetLassoScale:

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

         **Example of using the SetLassoScale method**

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByLasso::GetLassoScale` method


   .. oe:method:: SetLineWidthScale

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

         .. oe:api::

            void SetLineWidthScale(double lineWidthScale)

      .. oe:language:: python

         .. oe:api:: python

            SetLineWidthScale(lineWidthScale: float) -> None

      Sets the multiplier that can be used to increase or decrease
      the line width of the lasso.


      Example (:ref:`Figure: Example of using the SetLineWidthScale method<figure_OEHighlightByLasso_SetLineWidthScale>`)

      .. oe:source:: HighlightByLasso.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETLINEWIDTHSCALE

      .. oe:source:: HighlightByLasso.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETLINEWIDTHSCALE

      .. oe:source:: HighlightByLasso.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETLINEWIDTHSCALE

      .. oe:source:: HighlightByLasso.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETLINEWIDTHSCALE

      .. _figure_OEHighlightByLasso_SetLineWidthScale:

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

         **Example of using the SetLineWidthScale method**

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByLasso::GetLineWidthScale` 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 foreground color of the highlighting.

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

      .. oe:source:: HighlightByLasso.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETCOLOR

      .. oe:source:: HighlightByLasso.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETCOLOR


      .. oe:source:: HighlightByLasso.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETCOLOR

      .. oe:source:: HighlightByLasso.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETCOLOR


      .. _figure_OEHighlightByLasso_SetColor:

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

         **Example of using the SetColor method**

      .. seealso::

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


   .. oe:method:: SetPen

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

         .. oe:api::

            void SetPen(const OEPen& pen)

      .. oe:language:: python

         .. oe:api:: python

            SetPen(pen: OEPen) -> None

      Sets the pen of the highlighting.

      Example (:ref:`Figure: Example of using the SetPen method<figure_OEHighlightByLasso_SetPen>`)

      .. oe:source:: HighlightByLasso.py
         :language: python
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETPEN

      .. oe:source:: HighlightByLasso.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETPEN

      .. oe:source:: HighlightByLasso.java
         :language: java
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETPEN

      .. oe:source:: HighlightByLasso.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-OEHIGHLIGHTBYLASSO-SETPEN


      .. _figure_OEHighlightByLasso_SetPen:

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

         **Example of using the SetPen method**

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByLasso::GetPen` method
         * :ref:`OEPen <OEDepict_OEPen>` class


   .. oe:method:: SetPosition

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

         .. oe:api::

            void SetPosition(unsigned int position)

      .. oe:language:: python

         .. oe:api:: python

            SetPosition(arg2: int) -> None

      Sets whether the 'lasso' highlight is going to be render above or
      below the molecule.

      *position*
         This value has to be from the :oe:constns:`OEDepict::OELayerPosition`
         namespace.

      .. seealso::

         * :oe:meth:`OEDepict::OEHighlightByLasso::GetPosition` method
