.. oe:namespace:: OEDocking



.. meta::
   :keywords: OEFeature


.. _OEDocking_OEFeature:

.. oe:class:: OEFeature

   .. oe:api::

      class OEFeature

   :ref:`OEFeature <OEDocking_OEFeature>` is a pure virtual class that defines a single
   custom docking constraint used by :ref:`OEDock <OEDocking_OEDock>`.

   :ref:`OEFeature <OEDocking_OEFeature>` objects are created by the
   :ref:`OECustomConstraints <OEDocking_OECustomConstraints>` class (see
   :oe:meth:`OEDocking::OECustomConstraints::AddFeature`).

   To satisfy a docking constraint a pose must either have: 

   #. At least one atom that
      matches one of the SMARTS patterns returned by 
      :oe:meth:`OEDocking::OEFeature::GetSmarts`
      **and** falls within one of the spheres returned by 
      :oe:meth:`OEDocking::OEFeature::GetSpheres`.  

   #. At least one heavy atom that falls within one of the spheres
      returned by :oe:meth:`OEDocking::OEFeature::GetSpheres`, **if**
      the :ref:`OEFeature <OEDocking_OEFeature>` has no SMARTS patterns.

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

      .. oe:api::

         OEFeature& operator=(const OEFeature&)

      Assignment operator.

   .. oe:method:: Destructor

      .. oe:api::

         virtual ~OEFeature() {}

      Destructor.

   .. oe:method:: GetSpheres

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

         .. oe:api::

            OESystem::OEIterBase<const OESphereBase>* GetSpheres() const
            OESystem::OEIterBase<OESphereBase>* GetSpheres()

      .. oe:language:: python

         .. oe:api:: python

            GetSpheres() -> Iterable[OESphereBase]

      Returns all spheres associated with this custom constraint feature.

   .. oe:method:: AddSphere

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

         .. oe:api::

            OESphereBase* AddSphere()
            OESphereBase* AddSphere(const OESphereBase& sph)

      .. oe:language:: python

         .. oe:api:: python

            AddSphere() -> OESphereBase
            AddSphere(arg2: OESphereBase) -> OESphereBase

      Adds an :ref:`OESphereBase <OEDocking_OESphereBase>` object to this class.  If
      *sph* is passed the created sphere will be a copy of *sph* otherwise
      a default constructed sphere will be created.

      Note that the returned memory is owned by this class and will be
      destroyed by the destructor of this class.

   .. oe:method:: DeleteSphere

      .. oe:api::

         bool DeleteSphere(const OEMath::OESphere* sph)

      Deletes a :ref:`OESphereBase <OEDocking_OESphereBase>` held by this class.  Note
      that after this call *sph* will no longer point to a valid 
      :ref:`OESphereBase <OEDocking_OESphereBase>` object.

   .. oe:method:: NumSpheres

      .. oe:api::

         unsigned NumSpheres() const

      Returns the number of spheres held by this object.

   .. oe:method:: ClearSpheres

      .. oe:api::

         bool ClearSpheres()

      Returns this object to its default constructed state.  Deleting all
      spheres and SMARTS patterns it currently holds.

   .. oe:method:: GetSmarts
      :language: c++

      .. oe:api::

         OESystem::OEIterBase<const std::string>* GetSmarts() const
         OESystem::OEIterBase<std::string>* GetSmarts()

      Returns an iterator over all SMARTS patterns associated with this
      :ref:`OEFeature <OEDocking_OEFeature>`.

   .. oe:method:: AddSmarts

      .. oe:api::

         bool AddSmarts(const std::string& smarts)

      Adds a SMARTS pattern to this :ref:`OEFeature <OEDocking_OEFeature>`.

   .. oe:method:: DeleteSmarts

      .. oe:api::

         bool DeleteSmarts(const std::string& smarts)

      Deletes the specified SMARTS pattern from this :ref:`OEFeature <OEDocking_OEFeature>`.

   .. oe:method:: NumSmarts

      .. oe:api::

         unsigned NumSmarts() const

      Returns the number of SMARTS patterns held by this 
      :ref:`OEFeature <OEDocking_OEFeature>`.

   .. oe:method:: ClearSmarts

      .. oe:api::

         bool ClearSmarts()

      Deletes all SMARTS patterns associated with this 
      :ref:`OEFeature <OEDocking_OEFeature>`.

   .. oe:method:: SetFeatureName

      .. oe:api::

         void SetFeatureName(const std::string&)

      Sets the name of this feature.

   .. oe:method:: GetFeatureName

      .. oe:api::

         std::string GetFeatureName() const

      Returns the name of the feature.

   .. oe:method:: SetEnabled

      .. oe:api::

         void SetEnabled(const bool enabled)

      Sets whether this feature is enabled or not.  If the feature
      is disabled the constraint will be ignored 
      during the docking process.

   .. oe:method:: GetEnabled

      .. oe:api::

         bool GetEnabled() const

      Returns whether this feature is enabled.  If this function
      returns false this constraint will be ignored during the
      docking process.

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OEReceptorConstraintFeature* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEFeature

      Creates a copy of this :ref:`OEFeature <OEDocking_OEFeature>`.  Note
      that the memory returned by this function is **not** owned by
      this class, and is the responsibility of the calling function.

