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

.. oe:namespace:: OEEon

.. meta::
   :keywords: OEEonOverlapFunc, EonOverlapFunc


.. _OEEon_OEEonOverlapFunc:

.. oe:class:: OEEonOverlapFunc

   .. attention::

      |PRELIMINARY-API|

   .. oe:api::

      class OEEonOverlapFunc : public OEShape::OEOverlapFunc



The :ref:`OEEonOverlapFunc <OEEon_OEEonOverlapFunc>` class inherits public methods from :ref:`OEShape::OEOverlapFunc <OEShape_OEOverlapFunc>`. The implementation has been adjusted to return shape and charge density similarity when operator calls are made.

   .. oe:method:: Constructor

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

         .. oe:api::

            OEEonOverlapFunc(const OEShape::OEShapeFunc& shape = OEShape::OEGridShapeFunc(),
                             const OEChargeFunc& charge = OEEon::OEGridChargeFunc())

      .. oe:language:: python

         .. oe:api:: python

            OEEonOverlapFunc(shape: OEShapeFunc = OEGridShapeFunc(),
                             charge: OEChargeFunc = OEGridChargeFunc()) -> OEEonOverlapFunc
            OEEonOverlapFunc(arg2: OEEonOverlapFunc) -> OEEonOverlapFunc

      Constructor. This class is not copyable.

      *shape*
         Shape function to use. Default: :oe:cls:`OEShape::OEGridShapeFunc`.

      *charge*
         Charge function to use. Default: :oe:cls:`OEEon::OEGridChargeFunc`.

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

      .. oe:api::

         OEEonOverlapFunc & operator=(const OEEonOverlapFunc &)

      Assignment operator.


   .. oe:method:: Setup

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

         .. oe:api::

            bool Setup(const OEChem::OEMolBase& fitMol)

      .. oe:language:: python

         .. oe:api:: python

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

      Sets up the fit molecule for electrostatic overlap calculations.
      The molecule must have 3D coordinates and partial charges assigned.

   .. oe:method:: SetupRef

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

         .. oe:api::

            bool SetupRef(const OEChem::OEMolBase& refMol)

      .. oe:language:: python

         .. oe:api:: python

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

      Sets up the reference molecule for electrostatic overlap calculations.
      The molecule must have 3D coordinates and partial charges assigned.

   .. oe:method:: operator()

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

         .. oe:api::

            double operator()(const double* coords, double* grads = NULL)

      .. oe:language:: python

         .. oe:api:: python

            __call__(coords: OEDoubleArray, grads: OEDoubleArray = None) -> float

      Evaluates the combined shape and charge density overlap function at the
      given coordinates. If *grads* is non-null, the gradient is also computed.
      The reference and fit molecules must have been set via
      :oe:meth:`SetupRef<OEEon::OEEonOverlapFunc::SetupRef>` and
      :oe:meth:`Setup<OEEon::OEEonOverlapFunc::Setup>` respectively.

   .. oe:method:: Overlap

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

         .. oe:api::

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

      .. oe:language:: python

         .. oe:api:: python

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

      Calculates the combined shape and charge density overlap. The first
      overload takes a fit molecule directly. The second overload uses
      coordinates of a molecule previously set with
      :oe:meth:`Setup<OEEon::OEEonOverlapFunc::Setup>`.

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEEonOverlapFunc* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEEonOverlapFunc

      Creates and returns a deep copy of this object.

