.. oe:namespace:: OEChem



.. meta::
   :keywords: OETrans, Trans


.. _OEChem_OETrans:

.. oe:class:: OETrans

   .. oe:api::


      class OETrans

   This class represents `OETrans`.

   The :ref:`OETrans <OEChem_OETrans>` class is a container of high-level
   molecular transformations.
   It can be used to hold and wrap a series of molecular
   transformations, which can be applied to
   :oe:cls:`OEConfBase<OEChem::OEConfBase>` objects with a single function call.
   The :ref:`OETrans <OEChem_OETrans>` container keeps its own copies of the
   :oe:cls:`OETransBases<OEChem::OETransBase>`.

   .. oe:method:: Constructors

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

         .. oe:api::

            OETrans()

      .. oe:language:: python

         .. oe:api:: python

            OETrans() -> OETrans

      Default constructor.

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

         .. oe:api::

            OETrans(const OETrans& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OETrans(rhs: OETrans) -> OETrans

      Copy constructor.

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

         .. oe:api::

            OETrans(const OETransBase* t)
            OETrans(const OETransBase& tr)

      .. oe:language:: python

         .. oe:api:: python

            OETrans(tr: OETransBase) -> OETrans

      Creates a :ref:`OETrans <OEChem_OETrans>` transformation container and
      adds a copy of the :ref:`OETransBase <OEChem_OETransBase>` object to the
      container.

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

      .. oe:api::

         OETrans &operator=(const OETrans &rhs)

      Assignment operator that copies the data of the 'rhs' :ref:`OETrans <OEChem_OETrans>` object
      into the right-hand side :ref:`OETrans <OEChem_OETrans>` object.

      Assignment operator.


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

      .. oe:api::

         OETrans &operator+=(const OETrans &rhs)

      Makes copies of all :ref:`OETransBase <OEChem_OETransBase>` transformations
      of the 'rhs' :ref:`OETrans <OEChem_OETrans>` object and adds them to
      the end of the right-hand side :ref:`OETrans <OEChem_OETrans>` container.

   .. 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 at least one transformation
      (:ref:`OETransBase <OEChem_OETransBase>`) is stored in the
      :ref:`OETrans <OEChem_OETrans>` object.

   .. oe:method:: Clear

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

         .. oe:api::

            void Clear()

      .. oe:language:: python

         .. oe:api:: python

            Clear() -> None

      Removes all transformations (:ref:`OETransBase <OEChem_OETransBase>`) from
      the :ref:`OETrans <OEChem_OETrans>` object.

   .. oe:method:: Compress

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

         .. oe:api::

            void Compress()

      .. oe:language:: python

         .. oe:api:: python

            Compress() -> None

   .. oe:method:: Extract

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

         .. oe:api::

            template<class T, class U>
            void Extract(T* rmat, U* trans, bool clobber = true) const

      .. oe:language:: python

         .. oe:api:: python

            Extract(rmat: OEFloatArray, trans: OEFloatArray,
                    clobber: bool = True) -> None
            Extract(rmat: OEDoubleArray, trans: OEDoubleArray,
                    clobber: bool = True) -> None

      Extract the :ref:`OETransBase <OEChem_OETransBase>` transformation as a rotation matrix, ``rmat``,
      and a translation vector, ``trans``.
 
   .. oe:method:: GetInverse

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

         .. oe:api::

            bool GetInverse(OETrans& inverse)

      .. oe:language:: python

         .. oe:api:: python

            GetInverse(inverse: OETrans) -> bool

   .. oe:method:: GetTransforms

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

         .. oe:api::

            OESystem::OEIterBase<OETransBase>* GetTransforms() const

      .. oe:language:: python

         .. oe:api:: python

            GetTransforms() -> OETransBaseIter

      Returns an iterator over the transformations
      (:ref:`OETransBase <OEChem_OETransBase>`) stored in the
      :ref:`OETrans <OEChem_OETrans>` object.

   .. oe:method:: PushBack

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

         .. oe:api::

            void PushBack(const OETransBase& t)

      .. oe:language:: python

         .. oe:api:: python

            PushBack(t: OETransBase) -> None

      Makes a copy of the :ref:`OETransBase <OEChem_OETransBase>` transformation and adds it to
      the end of the :ref:`OETrans <OEChem_OETrans>` container.

   .. oe:method:: PushFront

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

         .. oe:api::

            void PushFront(const OETransBase& t)

      .. oe:language:: python

         .. oe:api:: python

            PushFront(t: OETransBase) -> None

      Makes a copy of the :ref:`OETransBase <OEChem_OETransBase>` transformation and adds it to
      the front of the :ref:`OETrans <OEChem_OETrans>` container.

   .. oe:method:: Transform

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

         .. oe:api::

            void Transform(OEMolBase* mol) const
            void Transform(OEConfBase* conf) const

      .. oe:language:: python

         .. oe:api:: python

            Transform(conf: OEConfBase) -> None
            Transform(mol: Union[OEGraphMol,OEMol,OEQMol]) -> None

      Applies the transformation specified by the
      :ref:`OETransBase <OEChem_OETransBase>` object to the molecule or conformer
      passed.

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

         .. oe:api::

            void Transform(float* coords, unsigned int ncoords,
                           unsigned int dim) const
            void Transform(double* coords, unsigned int ncoords,
                           unsigned int dim) const

      .. oe:language:: python

         .. oe:api:: python

            Transform(coords: OEFloatArray, ncoords: int, dim: int) -> None
            Transform(coords: OEDoubleArray, ncoords: int, dim: int) -> None

      Applies all transformations stored in the  :ref:`OETrans <OEChem_OETrans>` object
      to the a set of coordinates ('coords').
      The 'row' argument specifies the number of coordinates in
      'coords' array, while the 'dim' argument specifies the dimension
      of the coordinates.
      These methods presumes that the size of 'coords' at least :math:`rows*dim`. 
