.. oe:namespace:: OEDepict


.. _OEDepict_OELegendLayoutOptions:

.. oe:class:: OELegendLayoutOptions

   .. oe:api::

      class OELegendLayoutOptions

   This class represents the :ref:`OELegendLayoutOptions <OEDepict_OELegendLayoutOptions>` class
   that encapsulates properties that determine how an legend layout is depicted.

   The :ref:`OELegendLayoutOptions <OEDepict_OELegendLayoutOptions>` class stores the following properties:

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

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

      * - legend layout style
        - :oe:meth:`GetLayoutStyle<OEDepict::OELegendLayoutOptions::GetLayoutStyle>`
        - (set by the constructor)
        - :oe:constns:`OEDepict::OELegendLayoutStyle` namespace

      * - legend color style
        - :oe:meth:`GetColorStyle<OEDepict::OELegendLayoutOptions::GetColorStyle>`
        - (set by the constructor)
        - :oe:constns:`OEDepict::OELegendColorStyle` namespace

      * - legend interactive style
        - :oe:meth:`GetInteractiveStyle<OEDepict::OELegendLayoutOptions::GetInteractiveStyle>`
        - (set by the constructor)
        - :oe:constns:`OEDepict::OELegendInteractiveStyle` namespace

      * - button label font
        - :oe:meth:`GetButtonFont<OEDepict::OELegendLayoutOptions::GetButtonFont>`
        - :oe:meth:`SetButtonFont<OEDepict::OELegendLayoutOptions::SetButtonFont>`
        - :ref:`OEFont <OEDepict_OEFont>`

      * - button pen(s)
        - :oe:meth:`GetButtonPen<OEDepict::OELegendLayoutOptions::GetButtonPen>`
        - :oe:meth:`SetButtonPen<OEDepict::OELegendLayoutOptions::SetButtonPen>`
        - :ref:`OEPen <OEDepict_OEPen>`

      * - button height scale
        - :oe:meth:`GetButtonHeightScale<OEDepict::OELegendLayoutOptions::GetButtonHeightScale>`
        - :oe:meth:`SetButtonHeightScale<OEDepict::OELegendLayoutOptions::SetButtonHeightScale>`
        - positive floating point number in the range of :math:`[0.5, 3.0]`

      * - button width scale
        - :oe:meth:`GetButtonWidthScale<OEDepict::OELegendLayoutOptions::GetButtonWidthScale>`
        - :oe:meth:`SetButtonWidthScale<OEDepict::OELegendLayoutOptions::SetButtonWidthScale>`
        - positive floating point number in the range of :math:`[0.5, 5.0]`

      * - legend box pen
        - :oe:meth:`GetLegendBoxPen<OEDepict::OELegendLayoutOptions::GetLegendBoxPen>`
        - :oe:meth:`SetLegendBoxPen<OEDepict::OELegendLayoutOptions::SetLegendBoxPen>`
        - :ref:`OEPen <OEDepict_OEPen>`

      * - layout margins
        - :oe:meth:`GetMargin<OEDepict::OELegendLayoutOptions::GetMargin>`
        - :oe:meth:`SetMargin<OEDepict::OELegendLayoutOptions::SetMargin>` / :oe:meth:`SetMargins<OEDepict::OELegendLayoutOptions::SetMargins>`
        - positive floating point number in the range of :math:`[0.0, 90.0]`


   .. seealso::

      * :ref:`OELegendLayout <OEDepict_OELegendLayout>` class


   .. oe:method:: Constructors

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

         .. oe:api::

            OELegendLayoutOptions(unsigned int layout = OELegendLayoutStyle::Default,
                                  unsigned int color = OELegendColorStyle::Default,
                                  unsigned int inter = OELegendInteractiveStyle::Default)

      .. oe:language:: python

         .. oe:api:: python

            OELegendLayoutOptions(layout: int, color: int, inter: int) -> OELegendLayoutOptions

      .. seealso::

         * :oe:constns:`OEDepict::OELegendLayoutStyle` namespace
         * :oe:constns:`OEDepict::OELegendColorStyle` namespace
         * :oe:constns:`OEDepict::OELegendInteractiveStyle` namespace

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

         .. oe:api::

            OELegendLayoutOptions(const OELegendLayoutOptions& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OELegendLayoutOptions(arg2: OELegendLayoutOptions) -> OELegendLayoutOptions

      Copy constructor.


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

      .. oe:api::

         OELegendLayoutOptions &operator=(const OELegendLayoutOptions &rhs)

      Assignment operator.


   .. oe:method:: GetButtonFont

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

         .. oe:api::

            const OEFont& GetButtonFont() const

      .. oe:language:: python

         .. oe:api:: python

            GetButtonFont() -> OEFont

      .. seealso::

         * :ref:`OEFont <OEDepict_OEFont>` class
         * :oe:meth:`OEDepict::OELegendLayoutOptions::SetButtonFont` method


   .. oe:method:: GetButtonHeightScale

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

         .. oe:api::

            double GetButtonHeightScale() const

      .. oe:language:: python

         .. oe:api:: python

            GetButtonHeightScale() -> float

      .. seealso::

         * :oe:meth:`OEDepict::OELegendLayoutOptions::SetButtonHeightScale` method


   .. oe:method:: GetButtonPen

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

         .. oe:api::

            const OEPen& GetButtonPen(bool on) const

      .. oe:language:: python

         .. oe:api:: python

            GetButtonPen(on: bool) -> OEPen

      .. seealso::

         * :ref:`OEPen <OEDepict_OEPen>` class
         * :oe:meth:`OEDepict::OELegendLayoutOptions::SetButtonPen` method


   .. oe:method:: GetButtonWidthScale

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

         .. oe:api::

            double GetButtonWidthScale() const

      .. oe:language:: python

         .. oe:api:: python

            GetButtonWidthScale() -> float

      .. seealso::

         * :oe:meth:`OEDepict::OELegendLayoutOptions::SetButtonWidthScale` method


   .. oe:method:: GetColorStyle

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

         .. oe:api::

            unsigned int GetColorStyle() const

      .. oe:language:: python

         .. oe:api:: python

            GetColorStyle() -> int

      .. seealso::

         * :oe:constns:`OEDepict::OELegendColorStyle` namespace


   .. oe:method:: GetInteractiveStyle

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

         .. oe:api::

            unsigned int GetInteractiveStyle() const

      .. oe:language:: python

         .. oe:api:: python

            GetInteractiveStyle() -> int

      .. seealso::

         * :oe:constns:`OEDepict::OELegendInteractiveStyle` namespace


   .. oe:method:: GetLayoutStyle

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

         .. oe:api::

            unsigned int GetLayoutStyle() const

      .. oe:language:: python

         .. oe:api:: python

            GetLayoutStyle() -> int

      .. seealso::

         * :oe:constns:`OEDepict::OELegendLayoutStyle` namespace


   .. oe:method:: GetLegendBoxPen

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

         .. oe:api::

            const OEPen& GetLegendBoxPen() const

      .. oe:language:: python

         .. oe:api:: python

            GetLegendBoxPen() -> OEPen

      .. seealso::

         * :ref:`OEPen <OEDepict_OEPen>` class
         * :oe:meth:`OEDepict::OELegendLayoutOptions::SetLegendBoxPen` method


   .. oe:method:: GetMargin

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

         .. oe:api::

            double GetMargin(unsigned int percent) const

      .. oe:language:: python

         .. oe:api:: python

            GetMargin(percent: int) -> float

      Returns the ratio of a specific margin of the legend layout.

      *margin*
         This value has to be from the :oe:constns:`OEDepict::OEMargin`
         namespace.

      .. seealso::

         * :oe:meth:`OEDepict::OELegendLayoutOptions::SetMargin` method
         * :oe:meth:`OEDepict::OELegendLayoutOptions::SetMargins` method


   .. oe:method:: SetButtonFont

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

         .. oe:api::

            void SetButtonFont(const OEFont& font)

      .. oe:language:: python

         .. oe:api:: python

            SetButtonFont(font: OEFont) -> None

      .. seealso::

         * :ref:`OEFont <OEDepict_OEFont>` class
         * :oe:meth:`OEDepict::OELegendLayoutOptions::GetButtonFont` method


   .. oe:method:: SetButtonHeightScale

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

         .. oe:api::

            void SetButtonHeightScale(double scale)

      .. oe:language:: python

         .. oe:api:: python

            SetButtonHeightScale(s: float) -> None

      .. seealso::

         * :oe:meth:`OEDepict::OELegendLayoutOptions::GetButtonHeightScale` method


   .. oe:method:: SetButtonPen

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

         .. oe:api::

            void SetButtonPen(const OEPen& pen, bool on)

      .. oe:language:: python

         .. oe:api:: python

            SetButtonPen(pen: OEPen, on: bool) -> None

      .. seealso::

         * :ref:`OEPen <OEDepict_OEPen>` class
         * :oe:meth:`OEDepict::OELegendLayoutOptions::GetButtonPen` method


   .. oe:method:: SetButtonWidthScale

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

         .. oe:api::

            void SetButtonWidthScale(double s)

      .. oe:language:: python

         .. oe:api:: python

            SetButtonWidthScale(s: float) -> None

      .. seealso::

         * :oe:meth:`OEDepict::OELegendLayoutOptions::GetButtonWidthScale` method


   .. oe:method:: SetLegendBoxPen

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

         .. oe:api::

            void SetLegendBoxPen(const OEPen& pen)

      .. oe:language:: python

         .. oe:api:: python

            SetLegendBoxPen(pen: OEPen) -> None

      .. seealso::

         * :ref:`OEPen <OEDepict_OEPen>` class
         * :oe:meth:`OEDepict::OELegendLayoutOptions::GetLegendBoxPen` method


   .. oe:method:: SetMargin

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

         .. oe:api::

            bool SetMargin(unsigned int margin, double percent)

      .. oe:language:: python

         .. oe:api:: python

            SetMargin(margin: int, percent: float) -> bool

      Sets the size of a specific margin of the legend layout.

      *marginloc*
         This value has to be from the :oe:constns:`OEDepict::OEMargin`
         namespace.

      *margin*
         This number is considered as a percentage of either the width or the height
         of image on which the legend layout will be drawn and has to be in the range of :math:`[0.0, 90.0]`.
         For example, 10.0% means, that the left and right margin
         are 10% of the total width of the image, and the top and bottom margins
         are 10% of the total height of the image.

      .. seealso::

         * :oe:meth:`OEDepict::OELegendLayoutOptions::GetMargin` method
         * :oe:meth:`OEDepict::OELegendLayoutOptions::SetMargins` method


   .. oe:method:: SetMargins

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

         .. oe:api::

            bool SetMargins(double margin)

      .. oe:language:: python

         .. oe:api:: python

            SetMargins(percent: float) -> bool

      Sets the size of all margins of the legend layout.

      *margin*
         This number is considered as a percentage of either the width or the height
         of image on which the legend layout will be drawn and has to be in the range of :math:`[0.0, 90.0]`.
         For example, 10.0% means, that the left and right margin
         are 10% of the total width of the image, and the top and bottom margins
         are 10% of the total height of the image.

      .. seealso::

         * :oe:meth:`OEDepict::OELegendLayoutOptions::GetMargin` method
         * :oe:meth:`OEDepict::OELegendLayoutOptions::SetMargin` method
