.. oe:namespace:: OEChem

.. meta::
   :keywords: OEIsRotor, IsRotor


.. _OEChem_OEIsRotor:

.. oe:class:: OEIsRotor

   .. oe:api::

      class OEIsRotor : public OESystem::OEUnaryPredicate<OEChem::OEBondBase>

   This class represents :ref:`OEIsRotor <OEChem_OEIsRotor>` functor that
   identifies rotatable bonds (:ref:`OEBondBase <OEChem_OEBondBase>`).

   .. seealso::

      * :term:`rotatable bond`
      * :oe:func:`OEMolProp::OEGetRotatableBondCount` function in **OEMolProp TK**

      .. oe:language:: c++

         * Example programs :ref:`molstats.cpp<section_example_oechem_molstats>` and :ref:`rotorcount.cpp<section_example_oechem_rotorcount>`

      .. oe:language:: python

         * Example programs :ref:`molstats.py<section_example_oechem_molstats>` and :ref:`rotorcount.py<section_example_oechem_rotorcount>`

      .. oe:language:: java

         * Example programs :ref:`MolStats.java<section_example_oechem_molstats>` and :ref:`RotorCount.java<section_example_oechem_rotorcount>`

      .. oe:language:: csharp

         * Example programs :ref:`MolStats.cs<section_example_oechem_molstats>` and :ref:`RotorCount.cs<section_example_oechem_rotorcount>`


   The following methods are publicly inherited from :ref:`OEUnaryPredicate <OESystem_OEUnaryPredicate>`:

   ============================================================================== ============================================================================== ===============================================================================
   :oe:meth:`operator()<OESystem::OEUnaryPredicate::operator()>`                  :oe:meth:`CreateCopy<OESystem::OEUnaryPredicate::CreateCopy>`                  :oe:meth:`CreatePredicateCopy<OESystem::OEUnaryPredicate::CreatePredicateCopy>`
   ============================================================================== ============================================================================== ===============================================================================

   The following methods are publicly inherited from :ref:`OEUnaryFunction <OESystem_OEUnaryFunction>`:

   ============================================================ ============================================================ ===========================================================
   :oe:meth:`operator()<OESystem::OEUnaryFunction::operator()>` :oe:meth:`CreateCopy<OESystem::OEUnaryFunction::CreateCopy>`
   ============================================================ ============================================================ ===========================================================

   .. oe:method:: Constructors

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

         .. oe:api::

            OEIsRotor(bool includeHydrogen = false)

      .. oe:language:: python

         .. oe:api:: python

            OEIsRotor(includeHydrogen: bool = False) -> OEIsRotor

      Default and copy constructors.

   .. oe:method:: operator()

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

         .. oe:api::

            bool operator()(const OEBondBase& bond) const

      .. oe:language:: python

         .. oe:api:: python

            __call__(bond: OEBondBase) -> bool

      Returns ``true``, if the  :oe:meth:`OEChem::OEBondBase::IsRotor`
      method returns ``true`` for the given
      :ref:`OEBondBase <OEChem_OEBondBase>` object.


   .. oe:method:: CreateCopy

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

         .. oe:api::

            OESystem::OEUnaryFunction<OEChem::OEBondBase , bool>* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OEIsRotor

      Deep copy constructor that returns a copy of the object.
      The memory for the returned :ref:`OEIsRotor <OEChem_OEIsRotor>`
      object is dynamically allocated  and owned by the caller.

      .. oe:language:: c++

         The returned copy should be deallocated using C++
         delete operator in order to prevent a memory leak.
