.. oe:namespace:: OEShape



.. meta::
   :keywords: OEOverlap, Overlap


.. _OEShape_OEOverlap:

.. oe:class:: OEOverlap

   .. oe:api::

      class OEOverlap

   .. note::

      This deprecated class will not be developed further. It is being replaced by
      derivatives of :ref:`OEShapeFunc <OEShape_OEShapeFunc>` which provides
      more control and greater expandability.

   OEOverlap calculates the static shape overlap between a reference
   molecule or grid and a fit molecule or grid. Note that this does not
   move the fit molecule(grid) nor does it optimize the overlap. It
   simply calculates the score for the provided orientation.

   .. oe:method:: Constructors

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

         .. oe:api::

            OEOverlap()
            OEOverlap(const OEOverlap& rhs)
            OEOverlap(const OEChem::OEMolBase& refmol)
            OEOverlap(const OESystem::OEScalarGrid& refmol)

      .. oe:language:: python

         .. oe:api:: python

            OEOverlap() -> OEOverlap
            OEOverlap(refmol: OEScalarGrid) -> OEOverlap
            OEOverlap(rhs: OEOverlap) -> OEOverlap
            OEOverlap(refmol: Union[OEGraphMol,OEMol,OEQMol]) -> OEOverlap

      Default and copy constructors.

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

      .. oe:api::

         OEOverlap & operator=(const OEOverlap & rhs)

      Assignment operator.

   .. oe:method:: GetCarbonRadius

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

         .. oe:api::

            float GetCarbonRadius() const

      .. oe:language:: python

         .. oe:api:: python

            GetCarbonRadius() -> float

      Return the current value for the carbon radius approximation.

   .. oe:method:: GetGridSpacing

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

         .. oe:api::

            float GetGridSpacing() const

      .. oe:language:: python

         .. oe:api:: python

            GetGridSpacing() -> float

      Return the current value for the grid spacing to use for the
      :oe:const:`OEShape::OEOverlapMethod::Grid` method of calculating
      overlaps. Is not used by any other overlap method. Defaults to
      ``0.25``.

   .. oe:method:: GetMethod

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

         .. oe:api::

            unsigned int GetMethod() const

      .. oe:language:: python

         .. oe:api:: python

            GetMethod() -> int

      Return the current value of overlap method.

   .. oe:method:: GetRadiiApproximation

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

         .. oe:api::

            unsigned int GetRadiiApproximation() const

      .. oe:language:: python

         .. oe:api:: python

            GetRadiiApproximation() -> int

      Return the current value of the radii approximation.

   .. oe:method:: GetUseHydrogens

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

         .. oe:api::

            bool GetUseHydrogens() const

      .. oe:language:: python

         .. oe:api:: python

            GetUseHydrogens() -> bool

      Return the status of hydrogen use in OEOverlap.

   .. oe:method:: Overlap

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

         .. oe:api::

            bool Overlap(OEOverlapResults& res, float* atomOverlaps = 0)
            bool Overlap(const OEChem::OEMolBase& fitmol,
                         OEOverlapResults& res, float* atomOverlaps = 0)

      .. oe:language:: python

         .. oe:api:: python

            Overlap(res: OEOverlapResults, atomOverlaps: OEFloatArray = None) -> bool
            Overlap(fitmol: Union[OEGraphMol,OEMol,OEQMol],
                    res: OEOverlapResults, atomOverlaps: OEFloatArray = None) -> bool

      Calculate the overlap of the passed in fit molecule or fit grid
      and place the results into the passed instance of
      :ref:`OEOverlapResults <OEShape_OEOverlapResults>`.

   .. oe:method:: SetCarbonRadius

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

         .. oe:api::

            bool SetCarbonRadius(float cradius)

      .. oe:language:: python

         .. oe:api:: python

            SetCarbonRadius(cradius: float) -> bool

      Set the radius to use when using
      :oe:const:`OEShape::OEOverlapRadii::Carbon`. By default this is
      set to 1.7 Angstroms. See
      :oe:meth:`OEShape::OEBestOverlay::GetCarbonRadius`.

   .. oe:method:: SetFitMol

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

         .. oe:api::

            bool SetFitMol(const OEChem::OEMolBase& fitmol)

      .. oe:language:: python

         .. oe:api:: python

            SetFitMol(fitmol: Union[OEGraphMol,OEMol,OEQMol]) -> bool

      Set molecule to be used as fit object.

   .. oe:method:: SetGridSpacing

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

         .. oe:api::

            bool SetGridSpacing(float spacing)

      .. oe:language:: python

         .. oe:api:: python

            SetGridSpacing(spacing: float) -> bool

      Set the grid spacing to use for the
      :oe:const:`OEShape::OEOverlapMethod::Grid` method of calculating
      overlaps. Smaller values typically lead to more accurate results
      when considering large numbers of compounds, though not
      necessarily more accurate results in individual cases. This
      method will only accept values between 0.125 and 1.0
      inclusive. The default is 0.25 angstroms for a balance of
      performance and reproducibility. Larger values may lead to
      better performance on some platforms.

   .. oe:method:: SetMethod

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

         .. oe:api::

            bool SetMethod(unsigned int m)

      .. oe:language:: python

         .. oe:api:: python

            SetMethod(m: int) -> bool

      Set the method used to calculate overlap. The default for OEOverlap is
      :oe:const:`OEShape::OEOverlapMethod::Exact`. Alternatives are defined in the
      :oe:constns:`OEShape::OEOverlapMethod` namespace. 

   .. oe:method:: SetRadiiApproximation

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

         .. oe:api::

            bool SetRadiiApproximation(unsigned int type)

      .. oe:language:: python

         .. oe:api:: python

            SetRadiiApproximation(type: int) -> bool

      Set the radius approximation used to calculate overlap. The
      default for OEOverlap is :oe:const:`OEShape::OEOverlapRadii::Carbon`. 
      Alternatives are defined in the :oe:constns:`OEShape::OEOverlapRadii` namespace.

   .. oe:method:: SetRefGrid

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

         .. oe:api::

            bool SetRefGrid(const OESystem::OEScalarGrid& refgrid)

      .. oe:language:: python

         .. oe:api:: python

            SetRefGrid(refgrid: OEScalarGrid) -> bool

      Set a reference grid for the calculation. An internal copy is made. Any 
      previous reference molecule or grid is cleared.

   .. oe:method:: SetRefMol

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

         .. oe:api::

            bool SetRefMol(const OEChem::OEMolBase& refmol)

      .. oe:language:: python

         .. oe:api:: python

            SetRefMol(refmol: Union[OEGraphMol,OEMol,OEQMol]) -> bool

      Set a reference molecule for the calculation. An internal copy
      is made. Any previous reference molecule or grid is cleared.

   .. oe:method:: SetUseHydrogens

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

         .. oe:api::

            bool SetUseHydrogens(bool state)

      .. oe:language:: python

         .. oe:api:: python

            SetUseHydrogens(state: bool) -> bool

      Boolean to determine whether hydrogens are included in the shape
      calculation.  By default this is false and hydrogens are
      ignored.
