.. oe:namespace:: OEDepict


.. _OEDepict_OEImageTable:

.. oe:class:: OEImageTable

   .. oe:api::

      class OEImageTable

   This class represents :ref:`OEImageTable <OEDepict_OEImageTable>` which is a
   layout manager that allows to arrange information in rows and columns with
   variable height and width, respectively.

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

      **Example of using image table**

   .. seealso::

      * :ref:`section_image_layout_table` section
      * :ref:`OEImageTableOptions <OEDepict_OEImageTableOptions>` class
      * :oe:constns:`OEDepict::OEImageTableStyle` namespace
      * :ref:`OEImageGrid <OEDepict_OEImageGrid>` class


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

   .. oe:method:: Constructors

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

         .. oe:api::

            OEImageTable(OEImageBase& parent, const OEImageTableOptions& opts)

      .. oe:language:: python

         .. oe:api:: python

            OEImageTable(image: OEImageBase, opts: OEImageTableOptions) -> OEImageTable

      Creates an :ref:`OEImageTable <OEDepict_OEImageTable>` object with the specified
      options.

      *parent*
          The :ref:`OEImageBase <OEDepict_OEImageBase>` object on which the
          :ref:`OEImageTable <OEDepict_OEImageTable>` object is placed.

      *opts*
          The :ref:`OEImageTableOptions <OEDepict_OEImageTableOptions>` object that
          defines the properties and style of the table.

      .. seealso::

         * :oe:meth:`OEDepict::OEImageTable::GetOptions` method
         * :oe:meth:`OEDepict::OEImageTable::NumColumns` method
         * :oe:meth:`OEDepict::OEImageTable::NumRows` method


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

   .. oe:method:: DrawText

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

         .. oe:api::

            bool DrawText(OEImageBase* cell, const std::string& text,
                          double padding = 5.0)

      .. oe:language:: python

         .. oe:api:: python

            DrawText(cell: OEImageBase, text: str, padding: float = 5.0) -> bool

      Draws a text to the given table cell. Returns ``false`` if the given image
      does not belong to the table.

      *padding*
        Defines the padding used on the left and right of the given cell
        as a percentage of the width of the cell.

      .. note::

         The font that is used to render the text is defined in the
         :ref:`OEImageTableOptions <OEDepict_OEImageTableOptions>` class.

      .. seealso::

         * :ref:`OEFont <OEDepict_OEFont>` class
         * :oe:meth:`OEDepict::OEImageTableOptions::SetCellFont` method
         * :oe:meth:`OEDepict::OEImageTableOptions::SetHeaderFont` method
         * :oe:meth:`OEDepict::OEImageTableOptions::SetStubColumnFont` method


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

   .. oe:method:: GetBodyCell

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

         .. oe:api::

            OEImageBase* GetBodyCell(unsigned int row, unsigned int col)

      .. oe:language:: python

         .. oe:api:: python

            GetBodyCell(row: int, col: int) -> OEImageBase

      Returns the :ref:`OEImageBase <OEDepict_OEImageBase>` for the cell
      positioned in the :math:`r^{th}` row and :math:`c^{th}` columns of
      the 'body' of the table.
      A cell is considered to be part of the 'body' of the table if it is neither
      in the header nor in the stub column.

      *row*
         This value has to be in the range from :math:`1` to
         :oe:meth:`OEDepict::OEImageTable::NumRows(true)<OEDepict::OEImageTable::NumRows>`.

      *col*
         This value has to be in the range from :math:`1` to
         :oe:meth:`OEDepict::OEImageTable::NumColumns(true)<OEDepict::OEImageTable::NumColumns>`.

      .. note::

         A null pointer is returned if the **row** or the **col** parameters are
         outside the acceptable range.

      **Example**

      The image below marks the cell returned by
      :oe:meth:`OEDepict::OEImageTable::GetBodyCell` method
      for row = 1 and col = 2 parameters.

      .. _figure_OEImageTable_GetBodyCell:

      .. figure:: ../images/OEImageTable-GetBodyCell.*
         :align:  center

         **Example of accessing a specific 'body' cell of the table.**

      .. seealso::

         * :oe:meth:`OEDepict::OEImageTable::GetCell` method


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

   .. oe:method:: GetBodyCells

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

         .. oe:api::

            OESystem::OEIterBase<OEImageBase>* GetBodyCells(unsigned int row = 0u,
                                                            unsigned int col = 0u)

      .. oe:language:: python

         .. oe:api:: python

            GetBodyCells(row: int = 0, col: int = 0) -> Iterable[OEImageBase]

      Returns an iterator over the 'body' cells of the
      :ref:`OEImageTable <OEDepict_OEImageTable>` object.
      A cell is considered to be part of the 'body' of the table if it is neither
      in the header nor in the stub column.
      The cells are returned from left to right and top to bottom order.

      *row*
         This value has to be in the range from :math:`0` to
         :oe:meth:`OEDepict::OEImageTable::NumRows(true)<OEDepict::OEImageTable::NumRows>`.

      *col*
         This value has to be in the range from :math:`0` to
         :oe:meth:`OEDepict::OEImageTable::NumColumns(true)<OEDepict::OEImageTable::NumColumns>`.

      .. note::

         An empty iterator is returned if the **row** or the **col** parameters are
         outside the acceptable range.

      **Examples**

      If the :oe:meth:`OEDepict::OEImageTable::GetBodyCells` method is invoked
      without any parameter, then all 'body cells' are returned.

      .. _figure_OEImageTable_GetBodyCells:

      .. figure:: ../images/OEImageTable-GetBodyCells.*
         :align:  center

         **Example of accessing all 'body' cells of the table**

         *(The numbers inside the cells represent the order in which
         the cells are returned)*


      If the **row** parameter is zero, then the :oe:meth:`OEDepict::OEImageTable::GetBodyCells`
      method returns an iterator over the 'body' cells of the specified column.
      The image below marks the cells returned by
      :oe:meth:`OEDepict::OEImageTable::GetBodyCell` method
      for row = 0 and col = 2 parameters.

      .. _figure_OEImageTable_GetBodyColCells:

      .. figure:: ../images/OEImageTable-GetBodyColCells.*
         :align:  center

         **Example of accessing 'body' cells of a specific columns in the table**

         *(The numbers inside the cells represent the order in which
         the cells are returned)*


      If the **column** parameter is zero, then the :oe:meth:`OEDepict::OEImageTable::GetBodyCells`
      method returns an iterator over the 'body' cells of the specified column.
      The image below marks the cells returned by
      :oe:meth:`OEDepict::OEImageTable::GetBodyCell` method
      for row = 2 and col = 0 parameters.

      .. _figure_OEImageTable_GetBodyRowCells:

      .. figure:: ../images/OEImageTable-GetBodyRowCells.*
         :align:  center

         **Example of accessing 'body' cells of a specific row in the table**

         *(The numbers inside the cells represent the order in which
         the cells are returned)*

      .. seealso::

         * :oe:meth:`OEDepict::OEImageTable::GetCells` method


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

   .. oe:method:: GetCell

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

         .. oe:api::

            OEImageBase* GetCell(unsigned int row, unsigned int col)

      .. oe:language:: python

         .. oe:api:: python

            GetCell(row: int, col: int) -> OEImageBase

      Returns the :ref:`OEImageBase <OEDepict_OEImageBase>` pointer for the cell
      positioned in the :math:`r^{th}` row and :math:`c^{th}` columns.

      *row*
         This value has to be in the range from :math:`1` to
         :oe:meth:`OEDepict::OEImageTable::NumRows()<OEDepict::OEImageTable::NumRows>`.

      *col*
         This value has to be in the range from :math:`1` to
         :oe:meth:`OEDepict::OEImageTable::NumColumns()<OEDepict::OEImageTable::NumColumns>`.

      .. note::

         A null pointer is returned if the **row** or the **col** parameters are
         outside the acceptable range.

      **Example**

      The image below marks the cell returned by
      :oe:meth:`OEDepict::OEImageTable::GetCell` method
      for row = 1 and col = 2 parameters.

      .. _figure_OEImageTable_GetCell:

      .. figure:: ../images/OEImageTable-GetCell.*
         :align:  center

         **Example of accessing a specific cell of the table**

      .. seealso::

         * :oe:meth:`OEDepict::OEImageTable::GetBodyCell` method

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

   .. oe:method:: GetCells

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

         .. oe:api::

            OESystem::OEIterBase<OEImageBase>* GetCells (unsigned int row = 0u,
                                                         unsigned int col = 0u)

      .. oe:language:: python

         .. oe:api:: python

            GetCells(row: int = 0, col: int = 0) -> Iterable[OEImageBase]

      Returns an iterator over the cells of the :ref:`OEImageTable <OEDepict_OEImageTable>`
      object.
      The cells are returned from left to right and top to bottom order.

      *row*
         This value has to be in the range from :math:`0` to
         :oe:meth:`OEDepict::OEImageTable::NumRows()<OEDepict::OEImageTable::NumRows>`.

      *col*
         This value has to be in the range from :math:`0` to
         :oe:meth:`OEDepict::OEImageTable::NumColumns()<OEDepict::OEImageTable::NumColumns>`.

      .. note::

         An empty iterator is returned if the **row** or the **col** parameters are
         outside the acceptable range.

      **Examples**

      If the :oe:meth:`OEDepict::OEImageTable::GetCells` method is invoked
      without any parameter, then all cells of the table are returned.

      .. _figure_OEImageTable_GetCells:

      .. figure:: ../images/OEImageTable-GetCells.*
         :align:  center

         **Example of accessing all cells of the table**

         *(The numbers inside the cells represent the order in which
         the cells are returned)*

      If the **row** parameter is zero, then the :oe:meth:`OEDepict::OEImageTable::GetCells`
      method returns an iterator over the cells of the specified column.
      The image below marks the cells returned by
      :oe:meth:`OEDepict::OEImageTable::GetCell` method
      for row = 0 and col = 2 parameters.

      .. _figure_OEImageTable_GetColCells:

      .. figure:: ../images/OEImageTable-GetColCells.*
         :align:  center

         **Example of accessing all cells of a specific columns of the table.**

         *(The numbers inside the cells represent the order in which
         the cells are returned)*


      If the **column** parameter is zero, then the :oe:meth:`OEDepict::OEImageTable::GetCells`
      method returns an iterator over the cells of the specified row.
      The image below marks the cells returned by
      :oe:meth:`OEDepict::OEImageTable::GetCell` method
      for row = 2 and col = 0 parameters.

      .. _figure_OEImageTable_GetRowCells:

      .. figure:: ../images/OEImageTable-GetRowCells.*
         :align:  center

         **Example of accessing all cells of a specific row of the table.**

         *(The numbers inside the cells represent the order in which
         the cells are returned)*

      .. seealso::

         * :oe:meth:`OEDepict::OEImageTable::GetBodyCells` method

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

   .. oe:method:: GetHeaderCell

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

         .. oe:api::

            OEImageBase* GetHeaderCell(unsigned int col, bool skipstub = true)

      .. oe:language:: python

         .. oe:api:: python

            GetHeaderCell(col: int, skipstub: bool = True) -> OEImageBase

      Returns the :ref:`OEImageBase <OEDepict_OEImageBase>` for the cell
      positioned in the :math:`c^{th}` columns of the 'header' of the table.

      *col*
         This value has to be in the range:

         * from :math:`1` to
           :oe:meth:`OEDepict::OEImageTable::NumColumns(false)<OEDepict::OEImageTable::NumColumns>`
           if **skipstub** is true.

         * from :math:`1` to
           :oe:meth:`OEDepict::OEImageTable::NumColumns(true)<OEDepict::OEImageTable::NumColumns>`
           if **skipstub** is false.

      **skipstub**
        The parameter that determines whether to consider the stub column.
        If **skipstub** is `false` and the table has a stub column, than that stub column
        is considered as the first column.

      .. note::

         A null pointer is returned if the table has no header or
         if the **col** parameters is outside the acceptable range.

      **Example**

      The image below marks the cell returned by
      :oe:meth:`OEDepict::OEImageTable::GetHeaderCell` method
      for col = 2 and skipstub = true parameters.

      .. _figure_OEImageTable_GetHeaderCell:

      .. figure:: ../images/OEImageTable-GetHeaderCell.*
         :align:  center

         **Example of accessing a specific header cell of the table**


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

   .. oe:method:: GetHeaderCells

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

         .. oe:api::

            OESystem::OEIterBase<OEImageBase>* GetHeaderCells(bool skipstub = true)

      .. oe:language:: python

         .. oe:api:: python

            GetHeaderCells(skipstub: bool = True) -> Iterable[OEImageBase]

      Returns an iterator over the header cells of the :ref:`OEImageTable <OEDepict_OEImageTable>` object.
      The cells are returned from left to right order.

      **skipstub**
        The parameter that determines whether to consider the stub column.
        If **skipstub** is `false` and the table has a stub column, than that stub column
        is considered as the first column.

      .. note::

         An empty iterator is returned if table has no header row.

      **Example**

       The image below marks the cells returned by
       :oe:meth:`OEDepict::OEImageTable::GetHeaderCells` for skipstub = true parameter.

      .. _figure_OEImageTable_GetHeaderCells:

      .. figure:: ../images/OEImageTable-GetHeaderCells.*
         :align:  center

         **Example of accessing header cells of the table**

         *(The numbers inside the cells represent the order in which
         the cells are returned)*


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

   .. oe:method:: GetOptions

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

         .. oe:api::

            const OEImageTableOptions& GetOptions() const

      .. oe:language:: python

         .. oe:api:: python

            GetOptions() -> OEImageTableOptions

      Returns the options used to initialized the :ref:`OEImageTable <OEDepict_OEImageTable>`
      object.

      .. seealso::

          * :ref:`OEImageTableOptions <OEDepict_OEImageTableOptions>` class


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

   .. oe:method:: GetStubColumnCell

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

         .. oe:api::

            OEImageBase* GetStubColumnCell(unsigned int row)

      .. oe:language:: python

         .. oe:api:: python

            GetStubColumnCell(row: int) -> OEImageBase

      Returns the :ref:`OEImageBase <OEDepict_OEImageBase>` for the cell
      positioned in the :math:`r^{th}` row of the 'stub column' of the table.

      *row*
         This value has to be in the range from :math:`1` to
         :oe:meth:`OEDepict::OEImageTable::NumRows(true)<OEDepict::OEImageTable::NumColumns>`.

      .. note::

         A null pointer is returned if the table has no stub column or
         if the **row** parameters is outside the acceptable range.

      **Example**

      The image below marks the cell returned by
      :oe:meth:`OEDepict::OEImageTable::GetStubColumnCell` method
      for row=1 parameter.

      .. _figure_OEImageTable_GetStubColumnCell:

      .. figure:: ../images/OEImageTable-GetStubColumnCell.*
         :align:  center

         **Example of accessing a specific stub column cell of the table**


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

   .. oe:method:: GetStubColumnCells

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

         .. oe:api::

            OESystem::OEIterBase<OEImageBase>* GetStubColumnCells()

      .. oe:language:: python

         .. oe:api:: python

            GetStubColumnCells() -> Iterable[OEImageBase]

      Returns an iterator over the stub column cells of the :ref:`OEImageTable <OEDepict_OEImageTable>` object.
      The cells are returned from top to bottom order.

      .. note::

         An empty iterator is returned if table has no stub column.

      **Example**

       The image below marks the cells returned by
       :oe:meth:`OEDepict::OEImageTable::GetStubColumnCells` method.

      .. _figure_OEImageTable_GetStubColumnCells:

      .. figure:: ../images/OEImageTable-GetStubColumnCells.*
         :align:  center

         **Example of accessing stub column cells of the table**

         *(The numbers inside the cells represent the order in which
         the cells are returned)*


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

   .. oe:method:: NumColumns

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

         .. oe:api::

            unsigned int NumColumns(bool onlybody = false) const

      .. oe:language:: python

         .. oe:api:: python

            NumColumns(onlybody: bool = False) -> int

      Returns the number of columns of the :ref:`OEImageTable <OEDepict_OEImageTable>`
      object.

      *onlybody*
        If this parameter is 'true', than stub column is not counted if exists.


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

   .. oe:method:: NumRows

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

         .. oe:api::

            unsigned int NumRows(bool onlybody = false) const

      .. oe:language:: python

         .. oe:api:: python

            NumRows(onlybody: bool = False) -> int

      Returns the number of rows of the :ref:`OEImageTable <OEDepict_OEImageTable>`
      object.

      *onlybody*
        If this parameter is 'true', than header row is not counted if exists.
