.. oe:namespace:: OEGrapheme


.. meta::
   :keywords: OEBondGlyphCross, BondGlyphCross


.. _OEGrapheme_OEBondGlyphCross:

.. oe:class:: OEBondGlyphCross

   .. oe:api::

      class OEBondGlyphCross : public OEBondGlyphBase

   By using the :ref:`OEBondGlyphCross <OEGrapheme_OEBondGlyphCross>` class, bonds
   can be annotated by drawing a cross in the middle of them.

   .. seealso::

      * :ref:`chapter_annotation` chapter
      * :oe:constns:`OEGrapheme::OECircleStyle` namespace
      * :ref:`OEBondGlyphArrow <OEGrapheme_OEBondGlyphArrow>` class
      * :ref:`OEBondGlyphCircle <OEGrapheme_OEBondGlyphCircle>` class
      * :ref:`OEBondGlyphCurvedArrow <OEGrapheme_OEBondGlyphCurvedArrow>` class
      * :ref:`OEBondGlyphScissors <OEGrapheme_OEBondGlyphScissors>` class
      * :ref:`OEBondGlyphStitch <OEGrapheme_OEBondGlyphStitch>` class
      * :ref:`OEBondGlyphZigZag <OEGrapheme_OEBondGlyphZigZag>` class

   The following methods are publicly inherited from :ref:`OEBondGlyphBase <OEGrapheme_OEBondGlyphBase>`:

   =============================================================== ================================================================
   :oe:meth:`CreateCopy<OEGrapheme::OEBondGlyphBase::CreateCopy>`  :oe:meth:`RenderGlyph<OEGrapheme::OEBondGlyphBase::RenderGlyph>`
   =============================================================== ================================================================

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

   .. oe:method:: Constructors

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

         .. oe:api::

            OEBondGlyphCross(const OEDepict::OEPen& pen,
                             double crossLengthScale = 1.0,
                             unsigned int layer = OEDepict::OELayerPosition::Above)

      .. oe:language:: python

         .. oe:api:: python

            OEBondGlyphCross(pen: OEPen, crossLengthScale: float = 1.0,
                             layer: int) -> OEBondGlyphCross

      Creates an :ref:`OEBondGlyphCross <OEGrapheme_OEBondGlyphCross>` object with the
      specified parameters.

      .. _figure_OEBondGlyphCross:

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

         **Example of bond annotations**

      *pen*
         The pen used when drawing a cross across the middle of the bond.

         See examples (A) and (B) in :ref:`Figure: Example of bond annotations<figure_OEBondGlyphCross>`.

      *crossLengthScale*
         The multiplier used to modify the length of the drawn cross.

         See examples (A) and (C) in :ref:`Figure: Example of bond annotations<figure_OEBondGlyphCross>`.

      *layer*
         Specifies whether the cross drawn above
         (:oe:const:`OEDepict::OELayerPosition::Above`) or below
         (:oe:const:`OEDepict::OELayerPosition::Below`) the molecule.

         See examples (B) and (D) in :ref:`Figure: Example of bond annotations<figure_OEBondGlyphCross>`.

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

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEBondGlyphBase* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEBondGlyphCross

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

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

   .. oe:method:: RenderGlyph

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

         .. oe:api::

            bool RenderGlyph(OEDepict::OE2DMolDisplay& disp,
                             const OEChem::OEBondBase* bond) const

      .. oe:language:: python

         .. oe:api:: python

            RenderGlyph(disp: OE2DMolDisplay, bond: OEBondBase) -> bool

      Draws a glyph (in this case a cross) in the middle of the given bond.

      *disp*
         The :ref:`OE2DMolDisplay <OEDepict_OE2DMolDisplay>` object that is modified
         to annotate the specified bond.

      *bond*
         The :ref:`OEBondBase <OEChem_OEBondBase>` object being annotated.
