.. oe:namespace:: OEDepict



.. meta::
   :keywords: OE2DBondDisplay, 2DBondDisplay


.. _OEDepict_OE2DBondDisplay:

.. oe:class:: OE2DBondDisplay

   .. oe:api::

      class OE2DBondDisplay : public OEBondDisplayBase

   This class stores 2D depiction information of a bond.
   See :ref:`Figure: OEDepict TK bond display class hierarchy<figure_OE2DBondDisplay_Hierarchy>`.

   .. _figure_OE2DBondDisplay_Hierarchy:

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

      **OEDepict TK bond display class hierarchy**

   The following methods are publicly inherited from :ref:`OEBondDisplayBase <OEDepict_OEBondDisplayBase>`:

   ================================================================ =============================================================== ===============================================================
   :oe:meth:`GetDataType<OEDepict::OEBondDisplayBase::GetDataType>` :oe:meth:`IsDataType<OEDepict::OEBondDisplayBase::IsDataType>`  :oe:meth:`SetVisible<OEDepict::OEBondDisplayBase::SetVisible>`
   :oe:meth:`GetBond<OEDepict::OEBondDisplayBase::GetBond>`         :oe:meth:`IsVisible<OEDepict::OEBondDisplayBase::IsVisible>`
   ================================================================ =============================================================== ===============================================================


   The :ref:`OE2DBondDisplay <OEDepict_OE2DBondDisplay>` class stores the following properties:

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

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

      * - pen used to draw the begin of the bond
        - :oe:meth:`GetBgnPen<OEDepict::OE2DBondDisplay::GetBgnPen>`
        - :oe:meth:`SetBgnPen<OEDepict::OE2DBondDisplay::SetBgnPen>`
        - :ref:`OEPen <OEDepict_OEPen>` class

      * - pen used to draw the end of the bond
        - :oe:meth:`GetEndPen<OEDepict::OE2DBondDisplay::GetEndPen>`
        - :oe:meth:`SetEndPen<OEDepict::OE2DBondDisplay::SetEndPen>`
        - :ref:`OEPen <OEDepict_OEPen>` class

      * - position of multi-line bonds
        - :oe:meth:`GetDisplayPos<OEDepict::OE2DBondDisplay::GetDisplayPos>`
        - :oe:meth:`SetDisplayPos<OEDepict::OE2DBondDisplay::SetDisplayPos>`
        - :oe:constns:`OEDepict::OEBondDisplayPosition` namespace

      * - rendered bond type
        - :oe:meth:`GetDisplayType<OEDepict::OE2DBondDisplay::GetDisplayType>`
        - :oe:meth:`SetDisplayType<OEDepict::OE2DBondDisplay::SetDisplayType>`
        - :oe:constns:`OEDepict::OEBondDisplayType` namespace

      * - rendered string as property
        - :oe:meth:`GetProperty<OEDepict::OE2DBondDisplay::GetProperty>`
        - :oe:meth:`SetProperty<OEDepict::OE2DBondDisplay::SetProperty>`
        - string

      * - font of property string
        - :oe:meth:`GetPropertyFont<OEDepict::OE2DBondDisplay::GetPropertyFont>`
        - :oe:meth:`SetPropertyFont<OEDepict::OE2DBondDisplay::SetPropertyFont>`
        - :ref:`OEFont <OEDepict_OEFont>` class

      * - position of property label
        - :oe:meth:`GetPropertyOffset<OEDepict::OE2DBondDisplay::GetPropertyOffset>`
        - :oe:meth:`SetPropertyOffset<OEDepict::OE2DBondDisplay::SetPropertyOffset>`
        - :ref:`OE2DPoint <OEDepict_OE2DPoint>` class

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

   .. oe:method:: Constructors

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

         .. oe:api::

            OE2DBondDisplay(const OEChem::OEBondBase* bond)

      .. oe:language:: python

         .. oe:api:: python

            OE2DBondDisplay(arg2: OEBondBase) -> OE2DBondDisplay

      Construct an :ref:`OE2DBondDisplay <OEDepict_OE2DBondDisplay>` object that
      contains the style information for ``bond``.

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

         .. oe:api::

            OE2DBondDisplay(const OE2DBondDisplay& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OE2DBondDisplay(rhs: OE2DBondDisplay) -> OE2DBondDisplay

      Copy constructor.

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

      .. oe:api::

         OE2DBondDisplay &operator=(const OE2DBondDisplay &rhs)

      Assignment operator.

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OESystem::OEBase* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEBase

      Deep copy constructor that returns a pointer to a copy of the
      object.  The memory returned is dynamically allocated and owned
      by the caller.

   .. oe:method:: GetBgnPen

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

         .. oe:api::

            const OEPen& GetBgnPen() const

      .. oe:language:: python

         .. oe:api:: python

            GetBgnPen() -> OEPen

      Returns the pen used to draw the bond from the "begin" atom coordinates
      to the middle of the bond.

      .. _figure_OE2DBondDisplay_GetBgnPen:

      .. figure:: ../images/OE2DBondDisplay-GetBgnPen.*
         :align:  center

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::SetBgnPen` method
         * :ref:`OEPen <OEDepict_OEPen>` class

   .. oe:method:: GetDisplayPos

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

         .. oe:api::

            unsigned int GetDisplayPos() const

      .. oe:language:: python

         .. oe:api:: python

            GetDisplayPos() -> int

      Returns how multi-line bonds should be rendered.  The return
      value is taken from the
      :oe:constns:`OEDepict::OEBondDisplayPosition` namespace.

      .. note::

         The :oe:constns:`OEDepict::OEBondDisplayPosition` namespace
         only affects bonds of the following types (as returned by
         :oe:meth:`OEDepict::OE2DBondDisplay::GetDisplayType`):

         * :oe:const:`OEDepict::OEBondDisplayType::Double`
         * :oe:const:`OEDepict::OEBondDisplayType::AromaticDash`
         * :oe:const:`OEDepict::OEBondDisplayType::SingleDouble`
         * :oe:const:`OEDepict::OEBondDisplayType::SingleArom`
         * :oe:const:`OEDepict::OEBondDisplayType::DoubleArom`
         * :oe:const:`OEDepict::OEBondDisplayType::Aromatic`

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::SetDisplayPos` method
         * :oe:constns:`OEDepict::OEBondDisplayPosition` namespace

   .. oe:method:: GetDisplayType

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

         .. oe:api::

            unsigned int GetDisplayType() const

      .. oe:language:: python

         .. oe:api:: python

            GetDisplayType() -> int

      Returns how bond orders, stereochemistry, and aromaticity is
      rendered for the bond. The return value is taken from the
      :oe:constns:`OEDepict::OEBondDisplayType` namespace.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::SetDisplayType` method
         * :oe:constns:`OEDepict::OEBondDisplayType` namespace

   .. oe:method:: GetEndPen

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

         .. oe:api::

            const OEPen& GetEndPen() const

      .. oe:language:: python

         .. oe:api:: python

            GetEndPen() -> OEPen

      Returns the pen used to draw the bond from the "end" atom coordinates
      to the middle of the bond.

      .. _figure_OE2DBondDisplay_GetEndPen:

      .. figure:: ../images/OE2DBondDisplay-GetEndPen.*
         :align:  center

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::SetEndPen` method
         * :ref:`OEPen <OEDepict_OEPen>` class

   .. oe:method:: GetProperty

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

         .. oe:api::

            const std::string& GetProperty() const

      .. oe:language:: python

         .. oe:api:: python

            GetProperty() -> str

      Returns the string displayed next to the bond.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::SetProperty` method
         * :oe:meth:`OEDepict::OE2DBondDisplay::SetPropertyFont` method

   .. oe:method:: GetPropertyFont

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

         .. oe:api::

            const OEFont& GetPropertyFont() const

      .. oe:language:: python

         .. oe:api:: python

            GetPropertyFont() -> OEFont

      Returns the font that is used when displaying the property string of the
      :ref:`OE2DBondDisplay <OEDepict_OE2DBondDisplay>` object.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::SetPropertyFont` method
         * :oe:meth:`OEDepict::OE2DBondDisplay::SetProperty` method
         * :ref:`OEFont <OEDepict_OEFont>` class

   .. oe:method:: GetPropertyOffset

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

         .. oe:api::

            const OE2DPoint& GetPropertyOffset() const

      .. oe:language:: python

         .. oe:api:: python

            GetPropertyOffset() -> OE2DPoint

      Returns the offset vector (relative to the middle of the bond)
      that is used to position the property label of the bond.
      See :ref:`Figure: The property offset vector is relative to the middle of the
      displayed bond<figure_OE2DBondDisplay_GetPropertyOffset>`.

      .. _figure_OE2DBondDisplay_GetPropertyOffset:

      .. figure:: ../images/OE2DBondDisplay-GetPropertyOffset.*
         :align:  center

         **The property offset vector is relative to the middle of the
         displayed bond**

      This allows for any string representable information to be
      rendered at a logical location near the bond.
      See example in :ref:`Example of displaying indices as bond property<figure_OE2DBondDisplay_GetProperty>`.

      .. _figure_OE2DBondDisplay_GetProperty:

      .. figure:: ../images/OE2DBondDisplay-GetProperty.*
         :align:  center

         **Example of displaying indices as bond property**

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::SetPropertyOffset` method
         * :ref:`OE2DPoint <OEDepict_OE2DPoint>` class

   .. oe:method:: HasProperty

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

         .. oe:api::

            bool HasProperty() const

      .. oe:language:: python

         .. oe:api:: python

            HasProperty() -> bool

      Return whether or not the property string of the
      :ref:`OE2DBondDisplay <OEDepict_OE2DBondDisplay>` object is empty.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::GetProperty` method
         * :oe:meth:`OEDepict::OE2DBondDisplay::SetProperty` method

   .. oe:method:: SetBgnPen

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

         .. oe:api::

            void SetBgnPen(const OEPen& pen)

      .. oe:language:: python

         .. oe:api:: python

            SetBgnPen(pen: OEPen) -> None

      Sets the pen used to draw the bond from the "begin" atom coordinates
      to the middle of the bond.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::GetBgnPen` method
         * :ref:`OEPen <OEDepict_OEPen>` class

   .. oe:method:: SetDisplayPos

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

         .. oe:api::

            void SetDisplayPos(unsigned int pos)

      .. oe:language:: python

         .. oe:api:: python

            SetDisplayPos(pos: int) -> None

      Sets the display position of the bond.

      *pos*
         This value has to be from the :oe:constns:`OEDepict::OEBondDisplayPosition`
         namespace.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::GetDisplayPos` method
         * :oe:constns:`OEDepict::OEBondDisplayPosition` namespace

   .. oe:method:: SetDisplayType

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

         .. oe:api::

            void SetDisplayType(unsigned int type)

      .. oe:language:: python

         .. oe:api:: python

            SetDisplayType(type: int) -> None

      Sets the display style of the bond.

      *type*
         This value has to be from the :oe:constns:`OEDepict::OEBondDisplayType`
         namespace.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::GetDisplayType` method
         * :oe:constns:`OEDepict::OEBondDisplayType` namespace

   .. oe:method:: SetEndPen

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

         .. oe:api::

            void SetEndPen(const OEPen& pen)

      .. oe:language:: python

         .. oe:api:: python

            SetEndPen(pen: OEPen) -> None

      Sets the pen used to draw the bond from the "end" atom coordinates
      to the middle of the bond.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::GetEndPen` method
         * :ref:`OEPen <OEDepict_OEPen>` class

   .. oe:method:: SetProperty

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

         .. oe:api::

            void SetProperty(const std::string& label)

      .. oe:language:: python

         .. oe:api:: python

            SetProperty(label: str) -> None

      Sets the string displayed next to the bond.

      .. warning::

         The preferred way to set the bond property strings is to use
         :oe:meth:`OEDepict::OE2DMolDisplayOptions::SetBondPropertyFunctor`
         method.
         See example in the :ref:`section_mol_display_bond_prop`
         section.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::SetProperty` method
         * :oe:meth:`OEDepict::OE2DBondDisplay::SetPropertyFont` method
         * :oe:meth:`OEDepict::OE2DMolDisplayOptions::SetBondPropertyFunctor` method

   .. oe:method:: SetPropertyFont

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

         .. oe:api::

            void SetPropertyFont(const OEFont& font)

      .. oe:language:: python

         .. oe:api:: python

            SetPropertyFont(font: OEFont) -> None

      Sets the font that is used when displaying the property string of the
      :ref:`OE2DBondDisplay <OEDepict_OE2DBondDisplay>` object.

      .. warning::

         The preferred way to set the font of the bond property strings
         is to use :oe:meth:`OEDepict::OE2DMolDisplayOptions::SetBondPropLabelFont`
         method.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::GetPropertyFont` method
         * :oe:meth:`OEDepict::OE2DBondDisplay::GetProperty` method
         * :ref:`OEFont <OEDepict_OEFont>` class
         * :oe:meth:`OEDepict::OE2DMolDisplayOptions::SetBondPropLabelFont` method

   .. oe:method:: SetPropertyOffset

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

         .. oe:api::

            void SetPropertyOffset(const OE2DPoint& offset)

      .. oe:language:: python

         .. oe:api:: python

            SetPropertyOffset(arg2: OE2DPoint) -> None

      Sets the offset vector (relative to the middle of the bond)
      that is used to position the property label of the bond.

      .. seealso::

         * :oe:meth:`OEDepict::OE2DBondDisplay::GetPropertyOffset` method
         * :ref:`OE2DPoint <OEDepict_OE2DPoint>` class

