.. include:: ../../toolkit-substitutions
.. include:: ../substitutions

.. oe:namespace:: OEDepict


.. _OEDepict_OEBondSVGMarkupBase:

.. oe:class:: OEBondSVGMarkupBase

   .. oe:api::

      class OEBondSVGMarkupBase

   :ref:`OEBondSVGMarkupBase <OEDepict_OEBondSVGMarkupBase>` is an abstract base class.
   Concrete classes derived from the base class define the markup of
   the bonds in :file:`.svg` images that are generated
   when calling the :ref:`OERenderMolecule <OEDepict_OERenderMolecule>` function.
   Drawing elements representing bonds in the :file:`.svg` images are grouped together
   in the following format in which the ``<group id>`` and ``<class name>``
   strings can be defined in the derived concrete classes.

   ::

      <g id='<group id>' class='<class name>'>
      ..
      list of drawing elements
      ..
      </g>

   The following classes derive from this class:

    * :ref:`OEBondSVGBondIdxMarkup <OEDepict_OEBondSVGBondIdxMarkup>`
    * :ref:`OEBondSVGNoMarkup <OEDepict_OEBondSVGNoMarkup>`

   .. seealso::

      * :oe:meth:`OEDepict::OE2DMolDisplayOptions::SetBondSVGMarkupFunctor` method
      * :ref:`chapter_svg` chapter

   .. note::

      User defined SVG atom marking can be implemented by deriving from this class
      and implementing all the methods listed below.

   .. oe:source:: UserBondMarkup.py
      :language: python
      :noindent:
      :frag:     SNIPPET-USER-DEF-BOND-MARKUP
      :caption:  Example of using user defined SVG atom markings


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

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEBondSVGMarkupBase* CreateCopy() const = 0

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEBondSVGMarkupBase

      Virtual const constructor which allows copying of concrete
      derived objects using a reference to this base class.

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

   .. oe:method:: GetClassName

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

         .. oe:api::

            std::string GetClassName(const OEChem::OEBondBase &) const = 0

      .. oe:language:: python

         .. oe:api:: python

            GetClassName(arg0: OEBondBase) -> str

      Returns the ``<class name>`` associated with a specific bond group
      in the :file:`.svg` image.
      This is a virtual method that has to be implemented in the concrete
      derived classes.
      The return string will be verified by the
      :oe:func:`OEDepict::OEIsValidSVGClassName` function.
      Invalid SVG class names will be ignored.

      .. seealso::

         * :oe:func:`OEDepict::OEIsValidSVGClassName` function


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

   .. oe:method:: GetGroupId

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

         .. oe:api::

            std::string GetGroupId(const OEChem::OEBondBase &) const = 0

      .. oe:language:: python

         .. oe:api:: python

            GetGroupId(arg0: OEBondBase) -> str

      Returns the ``<group id>`` associated with a specific bond group
      in the :file:`.svg` image.
      This is a virtual method that has to be implemented in the concrete
      derived classes.
      The return string will be verified by the
      :oe:func:`OEDepict::OEIsValidSVGGroupId` function.
      Invalid SVG group ids will be ignored.

      .. seealso::

         * :oe:func:`OEDepict::OEIsValidSVGGroupId` function
