.. oe:namespace:: OESzmap

.. meta::
   :keywords: OESzmapEngine, SzmapEngine


.. _OESzmap_OESzmapEngine:

.. oe:class:: OESzmapEngine

   .. oe:api::


      class OESzmapEngine

   It stores the context molecule, the configuration options (including the probe molecule),
   and an ``OEZap`` object used to perform the Poisson-Boltzmann electrostatics calculations
   by :oe:func:`OESzmap::OECalcSzmapResults`, :oe:func:`OESzmap::OECalcSzmapValue`, and
   :oe:func:`OESzmap::OEIsClashing`. A :ref:`OESzmapEngine <OESzmap_OESzmapEngine>` may cache the results
   of a calculation at a given 3D point to improve efficiency.

   .. seealso::

      * :ref:`GetSzmapEnergies<szmap_examples_szmapenergies>` example
      * :ref:`SzmapBestOrientations<szmap_examples_szmapbestorientations>` example

   .. oe:method:: Constructors

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

         .. oe:api::

            OESzmapEngine(const OESzmapEngine& rhs)
            OESzmapEngine(const OESzmapEngineOptions& opt = OESzmapEngineOptions())
            OESzmapEngine(const OEChem::OEMolBase& context,
                          const OESzmapEngineOptions& opt = OESzmapEngineOptions())

      .. oe:language:: python

         .. oe:api:: python

            OESzmapEngine(opt: OESzmapEngineOptions = OESzmapEngineOptions()) -> OESzmapEngine
            OESzmapEngine(rhs: OESzmapEngine) -> OESzmapEngine
            OESzmapEngine(context: Union[OEGraphMol,OEMol,OEQMol],
                          opt: OESzmapEngineOptions = OESzmapEngineOptions()) -> OESzmapEngine

      Default and copy constructors, along with constructors that take
      a context molecule (typically a properly prepared protein,
      see :oe:meth:`OESzmap::OESzmapEngine::SetContext`) and/or
      a :ref:`OESzmapEngineOptions <OESzmap_OESzmapEngineOptions>` object.

      .. oe:source:: SzmapCalcs.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-CREATE-SZMAPENGINE-OBJECT

      .. oe:source:: SzmapCalcs.py
         :language: python
         :noindent:
         :frag:     SNIPPET-CREATE-SZMAPENGINE-OBJECT

      .. :oe:language:: python

        :ref:`Full listing. <listing-SzmapCalcs.py>`



      .. oe:source:: SzmapCalcs.java
         :language: java
         :noindent:
         :frag:     SNIPPET-CREATE-SZMAPENGINE-OBJECT

      .. oe:source:: SzmapCalcs.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-CREATE-SZMAPENGINE-OBJECT


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

      .. oe:api::

         OESzmapEngine &operator=(const OESzmapEngine &rhs)

      Assignment operator.

   .. oe:method:: operator bool

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

         .. oe:api::

            operator bool() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      Returns *true* if this object is valid for use in OESzmap calculations.
      A context molecule---either at construction or through a call to
      :oe:meth:`OESzmap::OESzmapEngine::SetContext`---
      must be provided to establish validity.

   .. oe:method:: CheckAtomTypes

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

         .. oe:api::

            bool CheckAtomTypes() const

      .. oe:language:: python

         .. oe:api:: python

            CheckAtomTypes() -> bool

      Returns *true* if atom types could be applied to
      the molecular context and probe molecules.

   .. oe:method:: GetContext

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

         .. oe:api::

            const OEChem::OEMolBase& GetContext() const

      .. oe:language:: python

         .. oe:api:: python

            GetContext() -> OEGraphMol

      Returns a reference to the molecular context for OESzmap
      calculations (see :oe:meth:`OESzmap::OESzmapEngine::SetContext`).

      .. oe:source:: SzmapCalcs.cpp
         :language: c++
         :noindent:
         :frag:     SNIPPET-GET-CONTEXT

      .. oe:source:: SzmapCalcs.py
         :language: python
         :noindent:
         :frag:     SNIPPET-GET-CONTEXT

      .. :oe:language:: python

        :ref:`Full listing. <listing-SzmapCalcs.py>`


      .. oe:source:: SzmapCalcs.java
         :language: java
         :noindent:
         :frag:     SNIPPET-GET-CONTEXT

      .. oe:source:: SzmapCalcs.cs
         :language: csharp
         :noindent:
         :frag:     SNIPPET-GET-CONTEXT

   .. oe:method:: GetOptions

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

         .. oe:api::

            const OESzmapEngineOptions& GetOptions() const

      .. oe:language:: python

         .. oe:api:: python

            GetOptions() -> OESzmapEngineOptions

      Returns a reference to the :ref:`OESzmapEngineOptions <OESzmap_OESzmapEngineOptions>`
      used to construct this :ref:`OESzmapEngine <OESzmap_OESzmapEngine>`.
      It can be used to construct another :ref:`OESzmapEngine <OESzmap_OESzmapEngine>`
      object and to access details of the probe and other settings.

   .. oe:method:: SetContext

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

         .. oe:api::

            bool SetContext(const OEChem::OEMolBase& context)

      .. oe:language:: python

         .. oe:api:: python

            SetContext(context: Union[OEGraphMol,OEMol,OEQMol]) -> bool

      Updates the molecular context used for any OESzmap calculations
      based on this object
      (see :oe:meth:`OESzmap::OESzmapEngine::SetContext`
      and :oe:meth:`OESzmap::OESzmapEngine::operator bool`).
      The context molecule must have 3D coordinates assigned and partial
      charges associated with each atom. Atomic radii are also necessary,
      but will be generated if not supplied.

      Returns *true* if the context molecule is acceptable,
      with 3D coordinates and partial charges.
