.. oe:namespace:: OEChem



.. meta::
   :keywords: OETransBase, TransBase


.. _OEChem_OETransBase:

.. oe:class:: OETransBase

   .. oe:api::


      class OETransBase

   The :ref:`OETransBase <OEChem_OETransBase>` is the abstract base class which
   describes the interface for all of the high-level molecular
   transformation objects.
   It allows generic application of many manipulations 
   (such as :oe:cls:`translation<OEChem::OETranslation>`,
   :oe:cls:`Euler rotation<OEChem::OEEuler>`, 
   :oe:cls:`rotation by matrix<OEChem::OERotMatrix>`, 
   :oe:cls:`quaternion rotation<OEChem::OEQuaternion>`) to conformers.
   All of the default transformation currently provided carry out
   rigid transformations of molecule positions rather than
   conformational modifications. These are provided in the *OEMath*
   namespace described below.

   The following classes derive from this class:
    * :ref:`OEEuler <OEChem_OEEuler>`
    * :ref:`OEQuaternion <OEChem_OEQuaternion>`
    * :ref:`OERotMatrix <OEChem_OERotMatrix>`
    * :ref:`OETranslation <OEChem_OETranslation>`
   

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OETransBase* CreateCopy() const = 0

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OETransBase

      It is a virtual const constructor which allows copying of concrete
      derived objects using a reference to this base class.

   .. oe:method:: Extract

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

         .. oe:api::

            void Extract(float *, float *) const = 0
            void Extract(double *, float *) const = 0
            void Extract(float *, double *) const = 0
            void Extract(double *, double *) const = 0

      .. oe:language:: python

         .. oe:api:: python

            Extract(arg2: OEFloatArray, arg3: OEFloatArray) -> None
            Extract(arg2: OEDoubleArray, arg3: OEFloatArray) -> None
            Extract(arg2: OEFloatArray, arg3: OEDoubleArray) -> None
            Extract(arg2: OEDoubleArray, arg3: OEDoubleArray) -> None

   .. oe:method:: GetInverse

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

         .. oe:api::

            OETransBase* GetInverse() const = 0

      .. oe:language:: python

         .. oe:api:: python

            GetInverse() -> OETransBase

   .. 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 rows, unsigned int dim) const
            void Transform(double* coords, unsigned int rows, unsigned int dim) const

      .. oe:language:: python

         .. oe:api:: python

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

      Applies the transformation specified by the
      :ref:`OETransBase <OEChem_OETransBase>` 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`. 
      Both methods modify the coordinates in place.
