.. oe:namespace:: OEGrapheme


.. meta::
   :keywords: OEBondGlyphStitch, BondGlyphStitch


.. _OEGrapheme_OEBondGlyphStitch:

.. oe:class:: OEBondGlyphStitch

   .. oe:api::

      class OEBondGlyphStitch : public OEBondGlyphBase

   By using the :ref:`OEBondGlyphStitch <OEGrapheme_OEBondGlyphStitch>` class, bonds
   can be annotated by drawing perpendicular lines across them.

   .. seealso::

      * :ref:`chapter_annotation` chapter
      * :ref:`OEBondGlyphArrow <OEGrapheme_OEBondGlyphArrow>` class
      * :ref:`OEBondGlyphCircle <OEGrapheme_OEBondGlyphCircle>` class
      * :ref:`OEBondGlyphCross <OEGrapheme_OEBondGlyphCross>` class
      * :ref:`OEBondGlyphCurvedArrow <OEGrapheme_OEBondGlyphCurvedArrow>` class
      * :ref:`OEBondGlyphScissors <OEGrapheme_OEBondGlyphScissors>` 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::

            OEBondGlyphStitch(const OEDepict::OEPen& pen,
                              unsigned int nrstitches = 2u,
                              double stitchLengthScale = 1.0,
                              unsigned int layer = OEDepict::OELayerPosition::Above)

      .. oe:language:: python

         .. oe:api:: python

            OEBondGlyphStitch(pen: OEPen, nrstitches: int = 2,
                              stitchLengthScale: float = 1.0, layer: int) -> OEBondGlyphStitch

      Creates an :ref:`OEBondGlyphZigZag <OEGrapheme_OEBondGlyphZigZag>` object with the
      specified parameters.

      .. _figure_OEBondGlyphStitch:

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

         **Example of bond annotations**

      *pen*
         The pen used when drawing the perpendicular lines across the bond.

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

      *nrstitches*
         The number of perpendicular lines drawn across the bond.
         This value has to be in the range of [1, 5].

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

      *stitchLengthScale*
         The multiplier used to modify the length of the drawn perpendicular lines.

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

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

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

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

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEBondGlyphBase* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEBondGlyphStitch

      Deep copy constructor that returns a copy of the object.
      The memory for the returned :ref:`OEBondGlyphStitch <OEGrapheme_OEBondGlyphStitch>`
      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

