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

.. oe:namespace:: OEMolPotential



.. _OEMolPotential_OETorsionParams:

.. oe:class:: OETorsionParams

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::


      class  OETorsionParams : public OEMolPotential::OEInteractParams

   The :ref:`OETorsionParams <OEMolPotential_OETorsionParams>` class defines generic torsion parameters
   used in any force field which has torsion term.

   The following methods are publicly inherited from :ref:`OEInteractParams <OEMolPotential_OEInteractParams>`:
    * :oe:meth:`Clear<OEMolPotential::OEInteractParams::Clear>`
    * :oe:meth:`Get<OEMolPotential::OEInteractParams::Get>`
    * :oe:meth:`Get<OEMolPotential::OEInteractParams::GetList>`
    * :oe:meth:`Set<OEMolPotential::OEInteractParams::Set>`
    * :oe:meth:`Set<OEMolPotential::OEInteractParams::SetList>`

   The :ref:`OETorsionParams <OEMolPotential_OETorsionParams>` class defines the following public methods:
    * :oe:meth:`GetAtomIndex1<OEMolPotential::OETorsionParams::GetAtomIndex1>`
    * :oe:meth:`GetAtomIndex2<OEMolPotential::OETorsionParams::GetAtomIndex2>`
    * :oe:meth:`GetAtomIndex3<OEMolPotential::OETorsionParams::GetAtomIndex3>`
    * :oe:meth:`GetAtomIndex4<OEMolPotential::OETorsionParams::GetAtomIndex4>`
    * :oe:meth:`IsValid<OEMolPotential::OETorsionParams::IsValid>`
    * :oe:meth:`IsTorsion<OEMolPotential::OETorsionParams::IsTorsion>`


   .. oe:method:: Constructors

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

         .. oe:api::

            OETorsionParams(const OEChem::OEBondBase* bond, const OEChem::OEAtomBase* atom1,
            const OEChem::OEAtomBase* atom2, const unsigned type = OEFormatType::AMBER)
            OETorsionParams(const OETorsionParams&)

      .. oe:language:: python

         .. oe:api:: python

            OETorsionParams(bond: OEBondBase, atom1: OEAtomBase,
                            atom2: OEAtomBase, type: int) -> OETorsionParams
            OETorsionParams(arg2: OETorsionParams) -> OETorsionParams

      Constructor and copy constructor.
      Constructs an :ref:`OETorsionParams <OEMolPotential_OETorsionParams>` object for a middle bond
      passed as the first argument and two terminal atoms (second and third arguments).

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

      .. oe:api::

         OETorsionParams& operator=(const OETorsionParams&)

      The assignment operator.

      Assignment operator.


   .. oe:method:: GetAtomIndex1

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

         .. oe:api::

            unsigned GetAtomIndex1() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomIndex1() -> int

      Returns atom index of the first atom for a torsion for which the instance of
      :ref:`OETorsionParams <OEMolPotential_OETorsionParams>` was created.

   .. oe:method:: GetAtomIndex2

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

         .. oe:api::

            unsigned GetAtomIndex2() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomIndex2() -> int

      Returns atom index of the second atom for a torsion for which the instance of
      :ref:`OETorsionParams <OEMolPotential_OETorsionParams>` was created.

   .. oe:method:: GetAtomIndex3

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

         .. oe:api::

            unsigned GetAtomIndex3() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomIndex3() -> int

      Returns atom index of the third atom for a torsion for which the instance of
      :ref:`OETorsionParams <OEMolPotential_OETorsionParams>` was created.

   .. oe:method:: GetAtomIndex4

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

         .. oe:api::

            unsigned GetAtomIndex4() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomIndex4() -> int

      Returns atom index of the forth atom for a torsion for which the instance of
      :ref:`OETorsionParams <OEMolPotential_OETorsionParams>` was created.

   .. oe:method:: IsValid

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

         .. oe:api::

            bool IsValid() const
            bool IsValid(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred) const
            bool IsValid(const OESystem::OEUnaryPredicate<OEChem::OEBondBase>& pred) const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool
            IsValid(pred: OEUnaryAtomPred) -> bool
            IsValid(pred: OEUnaryBondPred) -> bool

      Methods which check if an instance of the :ref:`OETorsionParams <OEMolPotential_OETorsionParams>`
      class was created for the torsion to be included in force field calculation.
      First method is checking if the above instance was correctly constructed, while
      two remaining methods provide predicates which test if atoms (second method) and
      a middle bond (third method) belong to that instance.
      
   .. oe:method:: IsTorsion

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

         .. oe:api::

            bool IsTorsion(const OEChem::OEAtomBase* atom1, const OEChem::OEAtomBase* atom2,
            const OEChem::OEAtomBase* atom3, const OEChem::OEAtomBase* atom4) const

      .. oe:language:: python

         .. oe:api:: python

            IsTorsion(atom1: OEAtomBase, atom2: OEAtomBase, atom3: OEAtomBase,
                      atom4: OEAtomBase) -> bool

      Used to check if 4 atoms passed as arguments belong to the current 
      :ref:`OETorsionParams <OEMolPotential_OETorsionParams>` instance.
       

 
