.. oe:namespace:: OEShape

.. meta::
   :keywords: OEOverlapFuncBase, OverlapFuncBase


.. _OEShape_OEOverlapFuncBase:

.. oe:class:: OEOverlapFuncBase

   .. oe:api::

      class OEOverlapFuncBase : public OEMolPotential::OEMolFunc1

   The :ref:`OEOverlapFuncBase <OEShape_OEOverlapFuncBase>` is an abstract base class. This class defines
   an interface for static overlap calculation between a reference object and a fit molecule. 
   The :ref:`OEOverlapFuncBase <OEShape_OEOverlapFuncBase>` extends the :ref:`OEMolFunc1 <OEMolPotential_OEMolFunc1>`
   class to allow setting up a reference object (which could be a molecule, grid or a shape query) 
   and the underlying functions defining interactions based on shape or color overlaps.

   .. _figure_OEOverlapFuncBase_Hierarchy:

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

   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:`OEOverlapFuncBase <OEShape_OEOverlapFuncBase>` class defines the following public methods:
    * :oe:meth:`Overlap<OEShape::OEOverlapFuncBase::Overlap>` 
    * :oe:meth:`SetupFlex<OEShape::OEOverlapFuncBase::SetupFlex>`
    * :oe:meth:`SetupRef<OEShape::OEOverlapFuncBase::SetupRef>`

   The following classes derive from this class:
    * :ref:`OEAnalyticColorFunc <OEShape_OEAnalyticColorFunc>`
    * :ref:`OEAnalyticShapeFunc <OEShape_OEAnalyticShapeFunc>`
    * :ref:`OEColorFunc <OEShape_OEColorFunc>`
    * :ref:`OEExactColorFunc <OEShape_OEExactColorFunc>`
    * :ref:`OEExactShapeFunc <OEShape_OEExactShapeFunc>`
    * :ref:`OEGridColorFunc <OEShape_OEGridColorFunc>`
    * :ref:`OEGridShapeFunc <OEShape_OEGridShapeFunc>`
    * :ref:`OEOverlapFunc <OEShape_OEOverlapFunc>`
    * :ref:`OEShapeFunc <OEShape_OEShapeFunc>`

.. _OEShape_OEOverlapFuncBase_Overlap:

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

      .. oe:api::

         OEOverlapFuncBase & operator=(const OEOverlapFuncBase &)

      Assignment operator.



   .. oe:method:: Overlap

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

         .. oe:api::

            bool Overlap(const double* argCoords, OEOverlapResults &)
            bool Overlap(const OEChem::OEMolBase& argFitMol, OEOverlapResults &)

      .. oe:language:: python

         .. oe:api:: python

            Overlap(argCoords: OEDoubleArray, argResults: OEOverlapResults) -> bool
            Overlap(argFitMol: Union[OEGraphMol,OEMol,OEQMol],
                    argResults: OEOverlapResults) -> bool

      These methods calculate the overlap between the reference object and
      the fit molecule.  The reference object must be set using the
      :oe:meth:`SetupRef<OEShape::OEOverlapFuncBase::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_OEOverlapFuncBase_SetupFlex:


   .. oe:method:: SetupFlex

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

         .. oe:api::

            bool SetupFlex(const OEChem::OEMolBase&)

      .. oe:language:: python

         .. oe:api:: python

            SetupFlex(fitMol: Union[OEGraphMol,OEMol,OEQMol]) -> bool

      This method is a substitute for the :oe:meth:`Setup<OEMolPotential::OEMolFunc::Setup>`
      method to setup the fit molecule. This method should be called instead of the
      :oe:meth:`Setup<OEMolPotential::OEMolFunc::Setup>`, when the fit molecule is expected
      to be flexible and that the shape of the molecule is expected to change.

.. _OEShape_OEOverlapFuncBase_SetupRef:


   .. oe:method:: SetupRef

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

         .. oe:api::

            bool SetupRef(const OEChem::OEMolBase&)
            bool SetupRef(const OESystem::OEScalarGrid&)
            bool SetupRef(const OEShapeQuery&)

      .. oe:language:: python

         .. oe:api:: python

            SetupRef(argRefMol: Union[OEGraphMol,OEMol,OEQMol]) -> bool
            SetupRef(argRefGrid: OEScalarGrid) -> bool
            SetupRef(argQuery: OEShapeQuery) -> bool

      These method defines the interface for setting up the reference system for the
      :ref:`OEOverlapFuncBase <OEShape_OEOverlapFuncBase>` derived instance with a molecule, grid or a shape query.
