.. _section_oechem_example_stylehierarchy:

OE3DMolStyle hierarchy between molecule, conformers, and atoms
================================================================================

A program that shows how the style hierarchy in :ref:`OE3DMolStyle <OEChem_OE3DMolStyle>` is inherited between molecules, conformer, and atoms. 
The style applied to the main molecule will be the top level style. The style applied to each conformer will take priority over any overlapping 
style options between the two. The style applied to each atom will take priority over both the conformers and the molecule. The output file will 
have a molecule style of: Wireframe, blue, yellow molecular surface, and no hydrogens. The first conformer will have a style that indludes: CPK, blue, 
yellow molecular surface, and polar hydrogens. The second conformer will have the same style as the molecule. The first atom on the first conformer 
will have a style that includes: Stick, white, no surface, and polar hydrogens. The first atom on the second conformer will have a style that includes: 
Stick, white, no surface, and no hydrogens. The second atom on the first conformer will have a style that includes: CPK, pink, blue molecular surface, and polar H.

Example
--------------------------------------------------------------------------------

.. oe:language:: c++

    .. code-block:: console

        prompt> styleHierarchy input.mol2 output.oeb.gz

.. oe:language:: python
    
   .. code-block:: console

      prompt> styleHierarchy.py input.oeb output.oeb


Code
--------------------------------------------------------------------------------

.. oe:language:: c++

    .. only:: oehtml

        .. admonition:: Download code

           :download:`styleHierarchy.cpp <../../../../../sublibs/tklibs/oechem/examples/styleHierarchy.cpp>`

    .. only:: oepdf

        .. oe:source:: styleHierarchy.cpp
            :language: c++

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`styleHierarchy.py <../../../../../wrappers/python/examples/oechem/styleHierarchy.py>`

      .. literalinclude:: ../../../../../wrappers/python/examples/oechem/styleHierarchy.py


   .. only:: oepdf

      .. oe:source:: styleHierarchy.py
         :language: python

.. seealso::

    * :ref:`OE3DMolStyle <OEChem_OE3DMolStyle>` class
    * :ref:`OEMolStyleColorer <OEChem_OEMolStyleColorer>` class