.. include:: ../../common/cookbook/cookbook-hyperlinks

.. oe:namespace:: OEGrapheme

.. meta::
   :keywords: OEColorForceFieldDisplay, ColorForceFieldDisplay


.. _OEGrapheme_OEColorForceFieldDisplay:

.. oe:class:: OEColorForceFieldDisplay

   .. oe:api::

      class OEColorForceFieldDisplay

   This class represents :ref:`OEColorForceFieldDisplay <OEGrapheme_OEColorForceFieldDisplay>` that
   stores the depiction information of a :ref:`OEColorForceField <OEShape_OEColorForceField>`
   object.
   See example in :ref:`Figure: Example of depicting a color force field in a legend<figure_OEColorForceFieldDisplay>`.

   .. seealso::

      * The Theory chapter of the **Shape TK** manual.
      * :ref:`OEColorForceFieldLegendDisplayOptions <OEGrapheme_OEColorForceFieldLegendDisplayOptions>` class
      * :oe:func:`OEGrapheme::OEDrawColorForceFieldLegend` function

   .. _figure_OEColorForceFieldDisplay:

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

      **Example of depicting a color force field in a legend**


   .. admonition:: Code Example

      * `Visualizing Shape and Color Overlap`_ **OpenEye Python Cookbook** recipe

   .. _OEGrapheme_OEColorForceFieldDisplay_Constructors:

   .. oe:method:: Constructors

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

         .. oe:api::

            OEColorForceFieldDisplay(const OEShape::OEColorForceField& cff,
                                     bool preserveQueryColors = false)

      .. oe:language:: python

         .. oe:api:: python

            OEColorForceFieldDisplay(cff: OEColorForceField,
                                     preserveQueryColors: bool = False) -> OEColorForceFieldDisplay

      Creates an :ref:`OEColorForceFieldDisplay <OEGrapheme_OEColorForceFieldDisplay>` object
      with a given color force field and an option to preserve colors on input query molecules.

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

         .. oe:api::

            OEColorForceFieldDisplay(const OEColorForceFieldDisplay& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OEColorForceFieldDisplay(rhs: OEColorForceFieldDisplay) -> OEColorForceFieldDisplay

      Copy constructor.


   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEColorForceFieldDisplay &operator=(const OEColorForceFieldDisplay &rhs)

      Assignment operator. 


   .. _OEGrapheme_OEColorForceFieldDisplay_GetColor:

   .. oe:method:: GetColor

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

         .. oe:api::

            const OESystem::OEColor& GetColor(unsigned int type) const

      .. oe:language:: python

         .. oe:api:: python

            GetColor(type: int) -> OEColor

      Returns the color that is associated with the given color atom
      type.


   .. _OEGrapheme_OEColorForceFieldDisplay_GetColorTypes:

   .. oe:method:: GetColorTypes

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

         .. oe:api::

            OESystem::OEIterBase<unsigned int>* GetColorTypes() const

      .. oe:language:: python

         .. oe:api:: python

            GetColorTypes() -> Iterable[int]

      Returns the iterator over the color atom types.


   .. _OEGrapheme_OEColorForceFieldDisplay_GetName:

   .. oe:method:: GetName

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

         .. oe:api::

            std::string GetName(unsigned int type) const

      .. oe:language:: python

         .. oe:api:: python

            GetName(type: int) -> str

      Returns the name that is associated with the given color atom
      type.

   .. _OEGrapheme_OEColorForceFieldDisplay_GetPreserveQueryColors:

   .. oe::method GetPreserveQueryColors
      
      .. oe:api::

         bool GetPreserveQueryColors() const

      Returns the state of the option to preserve a query molecule's color atoms.

   .. _OEGrapheme_OEColorForceFieldDisplay_NumColorTypes:

   .. oe:method:: NumColorTypes

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

         .. oe:api::

            unsigned int NumColorTypes() const

      .. oe:language:: python

         .. oe:api:: python

            NumColorTypes() -> int

      Returns the number of color atom types.

   .. _OEGrapheme_OEColorForceFieldDisplay_SetColor:

   .. oe:method:: SetColor

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

         .. oe:api::

            void SetColor(unsigned int type, const OEDepict::OEColor& color)

      .. oe:language:: python

         .. oe:api:: python

            SetColor(type: int, color: OEColor) -> None

      Sets the color that is associated with the given color atom
      type.


   .. _OEGrapheme_OEColorForceFieldDisplay_SetName:

   .. oe:method:: SetName

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

         .. oe:api::

            void SetName(unsigned int type, const std::string& name)

      .. oe:language:: python

         .. oe:api:: python

            SetName(type: int, name: str) -> None

      Sets the name that is associated with the given color atom
      type.

   .. _OEGrapheme_OEColorForceFieldDisplay_SetPreserveQueryColors:

   .. oe::method SetPreserveQueryColors
      
      .. oe:api::

         void SetPreserveQueryColors(bool value)

      Sets the option to preserve a query molecule's color atoms or not.
