.. oe:namespace:: OEGrapheme

.. meta::
   :keywords: OEBondGlyphZigZag, BondGlyphZigZag


.. _OEGrapheme_OEBondGlyphZigZag:

.. oe:class:: OEBondGlyphZigZag

   .. oe:api::

      class OEBondGlyphZigZag : public OEBondGlyphBase

   By using the :ref:`OEBondGlyphZigZag <OEGrapheme_OEBondGlyphZigZag>` class, bonds
   can be annotated by drawing a zig-zag line 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:`OEBondGlyphStitch <OEGrapheme_OEBondGlyphStitch>` 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::

            OEBondGlyphZigZag(const OEDepict::OEPen& pen,
                              double zigzagLengthScale = 1.0,
                              unsigned int layer = OEDepict::OELayerPosition::Above,
                              bool diagonal = false)

      .. oe:language:: python

         .. oe:api:: python

            OEBondGlyphZigZag(pen: OEPen, zigzagLengthScale: float = 1.0,
                              layer: int, diagonal: bool = False) -> OEBondGlyphZigZag

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

      .. _figure_OEBondGlyphZigZag:

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

         **Example of bond annotations**

      *pen*
         The pen used when drawing a zig-zag line across bond.

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

      *zigzagLengthScale*
         The multiplier used to modify the length of the drawn zig-zag line.

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

      *layer*
         Specifies whether the zig-zag line is 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_OEBondGlyphZigZag>`.

      *diagonal*
         Specifies whether the zig-zag line is drawn across the bond or in parallel with it.

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


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

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEBondGlyphBase* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEBondGlyphZigZag

      Deep copy constructor that returns a copy of the object.
      The memory for the returned :ref:`OEBondGlyphZigZag <OEGrapheme_OEBondGlyphZigZag>`
      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 zig-zag line) across 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.
