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

.. oe:namespace:: OEShape

.. meta::
   :keywords: OEFlexiOverlapFunc, FlexiOverlapFunc


.. _OEShape_OEFlexiOverlapFunc:

.. oe:class:: OEFlexiOverlapFunc

   .. oe:api::

      class OEFlexiOverlapFunc : public OEMolPotential::OEMolFunc1

   The :ref:`OEFlexiOverlapFunc <OEShape_OEFlexiOverlapFunc>` class defines
   an interface for static overlap calculation between a reference and a fit molecule. 
   The :ref:`OEFlexiOverlapFunc <OEShape_OEFlexiOverlapFunc>` extends the :ref:`OEMolFunc1 <OEMolPotential_OEMolFunc1>`
   class to allow setting up a reference molecule 
   and the underlying functions defining interactions based on shape and color overlaps along with 
   intra-molecular force field of the fit molecule.

   The following methods are publicly inherited from :ref:`OEFunc0 <OEOpt_OEFunc0>`:
    * :oe:meth:`operator()<OEOpt::OEFunc0::operator()>`         
    * :oe:meth:`GetFComponents<OEOpt::OEFunc0::GetFComponents>` 
    * :oe:meth:`NumVar<OEOpt::OEFunc0::NumVar>`

   The following methods are publicly inherited from :ref:`OEFunc1 <OEOpt_OEFunc1>`:
    * :oe:meth:`operator()<OEOpt::OEFunc1::operator()>`
   
   The following methods are publicly inherited from :ref:`OEMolFunc <OEMolPotential_OEMolFunc>`:
    * :oe:meth:`GetInteractions<OEMolPotential::OEMolFunc::GetInteractions>`
    * :oe:meth:`Setup<OEMolPotential::OEMolFunc::Setup>`

   The :ref:`OEFlexiOverlapFunc <OEShape_OEFlexiOverlapFunc>` class defines the following public methods:
    * :oe:meth:`Overlap<OEShape::OEFlexiOverlapFunc::Overlap>` 
    * :oe:meth:`SetupRef<OEShape::OEFlexiOverlapFunc::SetupRef>`
    * :oe:meth:`UpdateColorCoords<OEShape::OEFlexiOverlapFunc::UpdateColorCoords>`


.. _OEShape_OEFlexiOverlapFunc_Overlap:

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

      .. oe:api::

         OEFlexiOverlapFunc & operator=(const OEFlexiOverlapFunc & func)

      Assignment operator.



   .. oe:method:: Overlap

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

         .. oe:api::

            bool Overlap(const double*, OEFlexiOverlapResults&)
            bool Overlap(const OEChem::OEMolBase& fitMol,
                         OEFlexiOverlapResults& results)

      .. oe:language:: python

         .. oe:api:: python

            Overlap(coords: OEDoubleArray, results: OEFlexiOverlapResults) -> bool
            Overlap(fitMol: Union[OEGraphMol,OEMol,OEQMol],
                    results: OEFlexiOverlapResults) -> bool

      These methods calculate the staitc overlap between the reference and
      the fit molecule using shape, color, and force field.  The reference object must be set using the
      :oe:meth:`SetupRef<OEShape::OEFlexiOverlapFunc::SetupRef>` method. The
      first overload assumes that the fit molecule has been set using the
      :oe:meth:`Setup<OEMolPotential::OEMolFunc::Setup>` method and uses
      the specified coordinates for the fit molecule. The second overlap
      takes the specified fit molecule and its current coordinates.

.. _OEShape_OEFlexiOverlapFunc_SetupRef:


   .. oe:method:: SetupRef

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

         .. oe:api::

            bool SetupRef(const OEChem::OEMolBase&)
            bool SetupRef(const OEShape::OEShapeQueryBase&)

      .. oe:language:: python

         .. oe:api:: python

            SetupRef(refMol: Union[OEGraphMol,OEMol,OEQMol]) -> bool
            SetupRef(refSQ: OEShapeQueryBase) -> bool

      This method defines the interface for setting up the reference system for the
      :ref:`OEFlexiOverlapFunc <OEShape_OEFlexiOverlapFunc>` instance with a 
      molecule or a shape query.

.. _OEShape_OEFlexiOverlapFunc_UpdateColorCoords:


   .. oe:method:: UpdateColorCoords

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

         .. oe:api::

            bool UpdateColorCoords(const double* coords,
                                   std::vector<double>& updatedCoord)

      .. oe:language:: python

         .. oe:api:: python

            UpdateColorCoords(coords: OEDoubleArray,
                              updatedCoord: OEDoubleVector) -> bool

      This method takes the coordinate of fit molecule and updates the coordinate of color atoms based on the
      modified coordinate of their parent atoms. The fit molecule must be set using the
      :oe:meth:`Setup<OEMolPotential::OEMolFunc::Setup>` method which assigns color atoms to the passed moleucle.
